From 5c2f5db5c5e2428f95b6a6e33292d458aacb163b Mon Sep 17 00:00:00 2001 From: wangshi Date: Fri, 13 Jan 2023 14:52:09 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8Dv2021.1=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangshi --- .clang-format | 6 - .github/workflows/wasm.yml | 14 - .gitignore | 35 - .gn | 20 - Android.mk | 19 +- BUILD.bazel | 47 +- BUILD.gn | 5 +- CHANGES | 140 +- CMakeLists.txt | 23 +- CONTRIBUTING.md | 7 + DEPS | 8 +- README.OpenSource | 2 +- README.md | 196 +- build_defs.bzl | 55 - cmake/Config.cmake.in | 4 - include/spirv-tools/instrument.hpp | 1 - include/spirv-tools/libspirv.h | 25 +- include/spirv-tools/libspirv.hpp | 6 - include/spirv-tools/optimizer.hpp | 19 - include/spirv/1.0/GLSL.std.450.h | 131 - include/spirv/1.0/OpenCL.std.h | 210 - .../1.0/extinst.glsl.std.450.grammar.json | 642 - .../1.0/extinst.opencl.std.100.grammar.json | 1279 -- include/spirv/1.0/spirv.core.grammar.json | 5775 ------- include/spirv/1.0/spirv.cs | 993 -- include/spirv/1.0/spirv.h | 993 -- include/spirv/1.0/spirv.hpp | 1002 -- include/spirv/1.0/spirv.hpp11 | 1002 -- include/spirv/1.0/spirv.json | 1020 -- include/spirv/1.0/spirv.lua | 949 -- include/spirv/1.0/spirv.py | 949 -- include/spirv/1.1/GLSL.std.450.h | 131 - include/spirv/1.1/OpenCL.std.h | 210 - .../1.1/extinst.glsl.std.450.grammar.json | 642 - .../1.1/extinst.opencl.std.100.grammar.json | 1279 -- include/spirv/1.1/spirv.core.grammar.json | 5938 ------- include/spirv/1.1/spirv.cs | 1015 -- include/spirv/1.1/spirv.h | 1015 -- include/spirv/1.1/spirv.hpp | 1024 -- include/spirv/1.1/spirv.hpp11 | 1024 -- include/spirv/1.1/spirv.json | 1040 -- include/spirv/1.1/spirv.lua | 971 -- include/spirv/1.1/spirv.py | 971 -- include/spirv/1.2/OpenCL.std.h | 210 - .../1.2/extinst.glsl.std.450.grammar.json | 642 - .../1.2/extinst.opencl.std.100.grammar.json | 1279 -- include/spirv/1.2/spirv.core.grammar.json | 5986 ------- include/spirv/1.2/spirv.cs | 1021 -- include/spirv/1.2/spirv.h | 1021 -- include/spirv/1.2/spirv.hpp | 1030 -- include/spirv/1.2/spirv.hpp11 | 1030 -- include/spirv/1.2/spirv.json | 1046 -- include/spirv/1.2/spirv.lua | 977 -- include/spirv/1.2/spirv.py | 977 -- include/spirv/spir-v.xml | 254 - include/spirv/unified1/AMD_gcn_shader.h | 52 - include/spirv/unified1/AMD_shader_ballot.h | 53 - .../AMD_shader_explicit_vertex_parameter.h | 50 - .../unified1/AMD_shader_trinary_minmax.h | 58 - include/spirv/unified1/DebugInfo.h | 144 - .../unified1/NonSemanticClspvReflection.h | 73 - .../unified1/NonSemanticShaderDebugInfo100.h | 171 - include/spirv/unified1/OpenCLDebugInfo100.h | 158 - .../unified1/extinst.debuginfo.grammar.json | 572 - .../extinst.glsl.std.450.grammar.json | 642 - ...t.nonsemantic.clspvreflection.grammar.json | 237 - ...tinst.nonsemantic.debugprintf.grammar.json | 13 - ...semantic.shader.debuginfo.100.grammar.json | 713 - .../extinst.opencl.debuginfo.100.grammar.json | 651 - .../extinst.opencl.std.100.grammar.json | 1279 -- .../extinst.spv-amd-gcn-shader.grammar.json | 26 - ...extinst.spv-amd-shader-ballot.grammar.json | 41 - ...der-explicit-vertex-parameter.grammar.json | 14 - ...spv-amd-shader-trinary-minmax.grammar.json | 95 - .../spirv/unified1/spirv.core.grammar.json | 13663 ---------------- include/spirv/unified1/spirv.cs | 1812 -- include/spirv/unified1/spirv.hpp | 2467 --- include/spirv/unified1/spirv.hpp11 | 2467 --- include/spirv/unified1/spirv.json | 1805 -- include/spirv/unified1/spirv.lua | 1757 -- include/spirv/unified1/spirv.py | 1757 -- include/spirv/unified1/spv.d | 1814 -- kokoro/linux-clang-ubsan/build.sh | 24 - kokoro/linux-clang-ubsan/presubmit.cfg | 16 - kokoro/scripts/linux/build-docker.sh | 6 +- kokoro/scripts/macos/build.sh | 2 +- kokoro/scripts/windows/build.bat | 25 +- .../continuous.cfg | 4 +- source/CMakeLists.txt | 20 +- source/binary.cpp | 8 +- source/common_debug_info.h | 64 - source/diagnostic.cpp | 2 +- source/diff/CMakeLists.txt | 54 - source/diff/diff.cpp | 2862 ---- source/diff/diff.h | 48 - source/diff/lcs.h | 224 - source/disassemble.cpp | 16 +- source/ext_inst.cpp | 9 - ...semantic.vulkan.debuginfo.100.grammar.json | 638 - source/fuzz/CMakeLists.txt | 12 - source/fuzz/available_instructions.cpp | 2 +- source/fuzz/fuzzer.cpp | 19 +- source/fuzz/fuzzer.h | 9 +- source/fuzz/fuzzer_context.cpp | 20 - source/fuzz/fuzzer_context.h | 33 - source/fuzz/fuzzer_pass.cpp | 54 +- source/fuzz/fuzzer_pass.h | 35 +- source/fuzz/fuzzer_pass_add_access_chains.cpp | 5 +- source/fuzz/fuzzer_pass_add_access_chains.h | 3 +- ...zzer_pass_add_bit_instruction_synonyms.cpp | 26 +- ...fuzzer_pass_add_bit_instruction_synonyms.h | 3 +- .../fuzzer_pass_add_composite_extract.cpp | 5 +- .../fuzz/fuzzer_pass_add_composite_extract.h | 3 +- .../fuzzer_pass_add_composite_inserts.cpp | 5 +- .../fuzz/fuzzer_pass_add_composite_inserts.h | 3 +- .../fuzz/fuzzer_pass_add_composite_types.cpp | 5 +- source/fuzz/fuzzer_pass_add_composite_types.h | 3 +- source/fuzz/fuzzer_pass_add_copy_memory.cpp | 5 +- source/fuzz/fuzzer_pass_add_copy_memory.h | 3 +- source/fuzz/fuzzer_pass_add_dead_blocks.cpp | 5 +- source/fuzz/fuzzer_pass_add_dead_blocks.h | 3 +- source/fuzz/fuzzer_pass_add_dead_breaks.cpp | 5 +- source/fuzz/fuzzer_pass_add_dead_breaks.h | 3 +- .../fuzz/fuzzer_pass_add_dead_continues.cpp | 5 +- source/fuzz/fuzzer_pass_add_dead_continues.h | 9 +- .../fuzzer_pass_add_equation_instructions.cpp | 5 +- .../fuzzer_pass_add_equation_instructions.h | 3 +- .../fuzz/fuzzer_pass_add_function_calls.cpp | 5 +- source/fuzz/fuzzer_pass_add_function_calls.h | 9 +- .../fuzz/fuzzer_pass_add_global_variables.cpp | 9 +- .../fuzz/fuzzer_pass_add_global_variables.h | 3 +- ...ass_add_image_sample_unused_components.cpp | 5 +- ..._pass_add_image_sample_unused_components.h | 3 +- source/fuzz/fuzzer_pass_add_loads.cpp | 73 +- source/fuzz/fuzzer_pass_add_loads.h | 3 +- .../fuzz/fuzzer_pass_add_local_variables.cpp | 9 +- source/fuzz/fuzzer_pass_add_local_variables.h | 3 +- .../fuzz/fuzzer_pass_add_loop_preheaders.cpp | 5 +- source/fuzz/fuzzer_pass_add_loop_preheaders.h | 3 +- ..._loops_to_create_int_constant_synonyms.cpp | 5 +- ...dd_loops_to_create_int_constant_synonyms.h | 3 +- ...er_pass_add_no_contraction_decorations.cpp | 5 +- ...zzer_pass_add_no_contraction_decorations.h | 3 +- .../fuzz/fuzzer_pass_add_opphi_synonyms.cpp | 5 +- source/fuzz/fuzzer_pass_add_opphi_synonyms.h | 9 +- source/fuzz/fuzzer_pass_add_parameters.cpp | 5 +- source/fuzz/fuzzer_pass_add_parameters.h | 3 +- .../fuzzer_pass_add_relaxed_decorations.cpp | 5 +- .../fuzzer_pass_add_relaxed_decorations.h | 3 +- source/fuzz/fuzzer_pass_add_stores.cpp | 62 +- source/fuzz/fuzzer_pass_add_stores.h | 3 +- source/fuzz/fuzzer_pass_add_synonyms.cpp | 7 +- source/fuzz/fuzzer_pass_add_synonyms.h | 3 +- ...r_pass_add_vector_shuffle_instructions.cpp | 7 +- ...zer_pass_add_vector_shuffle_instructions.h | 3 +- .../fuzzer_pass_adjust_branch_weights.cpp | 5 +- .../fuzz/fuzzer_pass_adjust_branch_weights.h | 3 +- .../fuzzer_pass_adjust_function_controls.cpp | 5 +- .../fuzzer_pass_adjust_function_controls.h | 3 +- .../fuzz/fuzzer_pass_adjust_loop_controls.cpp | 5 +- .../fuzz/fuzzer_pass_adjust_loop_controls.h | 3 +- ...zzer_pass_adjust_memory_operands_masks.cpp | 5 +- ...fuzzer_pass_adjust_memory_operands_masks.h | 3 +- .../fuzzer_pass_adjust_selection_controls.cpp | 5 +- .../fuzzer_pass_adjust_selection_controls.h | 3 +- source/fuzz/fuzzer_pass_apply_id_synonyms.cpp | 5 +- source/fuzz/fuzzer_pass_apply_id_synonyms.h | 3 +- .../fuzz/fuzzer_pass_construct_composites.cpp | 7 +- .../fuzz/fuzzer_pass_construct_composites.h | 3 +- source/fuzz/fuzzer_pass_copy_objects.cpp | 5 +- source/fuzz/fuzzer_pass_copy_objects.h | 3 +- source/fuzz/fuzzer_pass_donate_modules.cpp | 7 +- source/fuzz/fuzzer_pass_donate_modules.h | 3 +- ...pass_duplicate_regions_with_selections.cpp | 5 +- ...r_pass_duplicate_regions_with_selections.h | 3 +- .../fuzzer_pass_expand_vector_reductions.cpp | 7 +- .../fuzzer_pass_expand_vector_reductions.h | 3 +- ...zzer_pass_flatten_conditional_branches.cpp | 5 +- ...fuzzer_pass_flatten_conditional_branches.h | 3 +- source/fuzz/fuzzer_pass_inline_functions.cpp | 5 +- source/fuzz/fuzzer_pass_inline_functions.h | 3 +- ...rchange_signedness_of_integer_operands.cpp | 5 +- ...terchange_signedness_of_integer_operands.h | 3 +- ...r_pass_interchange_zero_like_constants.cpp | 5 +- ...zer_pass_interchange_zero_like_constants.h | 3 +- ...uzzer_pass_invert_comparison_operators.cpp | 5 +- .../fuzzer_pass_invert_comparison_operators.h | 3 +- ...er_pass_make_vector_operations_dynamic.cpp | 5 +- ...zzer_pass_make_vector_operations_dynamic.h | 3 +- source/fuzz/fuzzer_pass_merge_blocks.cpp | 5 +- source/fuzz/fuzzer_pass_merge_blocks.h | 3 +- .../fuzzer_pass_merge_function_returns.cpp | 14 +- .../fuzz/fuzzer_pass_merge_function_returns.h | 3 +- source/fuzz/fuzzer_pass_mutate_pointers.cpp | 5 +- source/fuzz/fuzzer_pass_mutate_pointers.h | 3 +- .../fuzz/fuzzer_pass_obfuscate_constants.cpp | 5 +- source/fuzz/fuzzer_pass_obfuscate_constants.h | 3 +- source/fuzz/fuzzer_pass_outline_functions.cpp | 5 +- source/fuzz/fuzzer_pass_outline_functions.h | 9 +- source/fuzz/fuzzer_pass_permute_blocks.cpp | 5 +- source/fuzz/fuzzer_pass_permute_blocks.h | 3 +- ...uzzer_pass_permute_function_parameters.cpp | 5 +- .../fuzzer_pass_permute_function_parameters.h | 3 +- ...fuzzer_pass_permute_function_variables.cpp | 75 - .../fuzzer_pass_permute_function_variables.h | 38 - .../fuzz/fuzzer_pass_permute_instructions.cpp | 5 +- .../fuzz/fuzzer_pass_permute_instructions.h | 3 +- .../fuzz/fuzzer_pass_permute_phi_operands.cpp | 5 +- .../fuzz/fuzzer_pass_permute_phi_operands.h | 3 +- ...uzzer_pass_propagate_instructions_down.cpp | 8 +- .../fuzzer_pass_propagate_instructions_down.h | 3 +- .../fuzzer_pass_propagate_instructions_up.cpp | 5 +- .../fuzzer_pass_propagate_instructions_up.h | 3 +- ...fuzzer_pass_push_ids_through_variables.cpp | 15 +- .../fuzzer_pass_push_ids_through_variables.h | 3 +- ..._adds_subs_muls_with_carrying_extended.cpp | 5 +- ...ce_adds_subs_muls_with_carrying_extended.h | 3 +- ...e_branches_from_dead_blocks_with_exits.cpp | 5 +- ...ace_branches_from_dead_blocks_with_exits.h | 3 +- ...eplace_copy_memories_with_loads_stores.cpp | 5 +- ..._replace_copy_memories_with_loads_stores.h | 3 +- ...replace_copy_objects_with_stores_loads.cpp | 5 +- ...s_replace_copy_objects_with_stores_loads.h | 3 +- .../fuzzer_pass_replace_irrelevant_ids.cpp | 5 +- .../fuzz/fuzzer_pass_replace_irrelevant_ids.h | 3 +- ...ss_replace_linear_algebra_instructions.cpp | 5 +- ...pass_replace_linear_algebra_instructions.h | 3 +- ...eplace_loads_stores_with_copy_memories.cpp | 5 +- ..._replace_loads_stores_with_copy_memories.h | 3 +- ...place_opphi_ids_from_dead_predecessors.cpp | 5 +- ...replace_opphi_ids_from_dead_predecessors.h | 3 +- ...ce_opselects_with_conditional_branches.cpp | 5 +- ...lace_opselects_with_conditional_branches.h | 3 +- ...zer_pass_replace_parameter_with_global.cpp | 5 +- ...uzzer_pass_replace_parameter_with_global.h | 3 +- ...fuzzer_pass_replace_params_with_struct.cpp | 5 +- .../fuzzer_pass_replace_params_with_struct.h | 3 +- source/fuzz/fuzzer_pass_split_blocks.cpp | 5 +- source/fuzz/fuzzer_pass_split_blocks.h | 3 +- .../fuzzer_pass_swap_commutable_operands.cpp | 5 +- .../fuzzer_pass_swap_commutable_operands.h | 3 +- ..._pass_swap_conditional_branch_operands.cpp | 5 +- ...er_pass_swap_conditional_branch_operands.h | 3 +- source/fuzz/fuzzer_pass_swap_functions.cpp | 53 - source/fuzz/fuzzer_pass_swap_functions.h | 38 - ...r_pass_toggle_access_chain_instruction.cpp | 5 +- ...zer_pass_toggle_access_chain_instruction.h | 3 +- ...fuzzer_pass_wrap_regions_in_selections.cpp | 5 +- .../fuzzer_pass_wrap_regions_in_selections.h | 3 +- .../fuzz/fuzzer_pass_wrap_vector_synonym.cpp | 137 - source/fuzz/fuzzer_pass_wrap_vector_synonym.h | 38 - source/fuzz/fuzzer_util.cpp | 159 +- source/fuzz/fuzzer_util.h | 24 +- .../pass_management/repeated_pass_instances.h | 2 - .../repeated_pass_recommender_standard.cpp | 6 - source/fuzz/protobufs/spirvfuzz_protobufs.h | 4 +- source/fuzz/protobufs/spvtoolsfuzz.proto | 108 +- source/fuzz/transformation.cpp | 12 - source/fuzz/transformation_access_chain.cpp | 16 +- source/fuzz/transformation_access_chain.h | 8 +- ...sformation_add_bit_instruction_synonym.cpp | 76 +- ...ansformation_add_bit_instruction_synonym.h | 8 - .../fuzz/transformation_add_constant_null.cpp | 4 +- source/fuzz/transformation_add_dead_block.cpp | 6 +- source/fuzz/transformation_add_dead_break.cpp | 2 +- .../fuzz/transformation_add_dead_continue.cpp | 3 +- .../fuzz/transformation_add_global_undef.cpp | 9 +- source/fuzz/transformation_add_global_undef.h | 2 +- source/fuzz/transformation_add_synonym.cpp | 101 +- .../transformation_composite_construct.cpp | 2 +- .../fuzz/transformation_composite_extract.cpp | 2 +- .../fuzz/transformation_composite_insert.cpp | 9 +- ...mation_duplicate_region_with_selection.cpp | 4 +- ...transformation_expand_vector_reduction.cpp | 2 +- ...nsformation_flatten_conditional_branch.cpp | 10 +- source/fuzz/transformation_load.cpp | 154 +- source/fuzz/transformation_load.h | 11 +- source/fuzz/transformation_merge_blocks.cpp | 3 - source/fuzz/transformation_merge_blocks.h | 1 - .../transformation_merge_function_returns.cpp | 46 +- .../transformation_merge_function_returns.h | 5 +- .../fuzz/transformation_outline_function.cpp | 12 - .../transformation_permute_phi_operands.cpp | 3 +- ...nsformation_propagate_instruction_down.cpp | 10 +- ...ransformation_push_id_through_variable.cpp | 4 +- ...transformation_replace_id_with_synonym.cpp | 34 - source/fuzz/transformation_store.cpp | 146 +- source/fuzz/transformation_store.h | 11 +- ...transformation_swap_function_variables.cpp | 93 - .../transformation_swap_function_variables.h | 57 - .../transformation_swap_two_functions.cpp | 72 - .../fuzz/transformation_swap_two_functions.h | 56 - source/fuzz/transformation_vector_shuffle.cpp | 4 +- .../transformation_wrap_vector_synonym.cpp | 185 - .../fuzz/transformation_wrap_vector_synonym.h | 77 - source/operand.cpp | 17 - source/opt/BUILD.gn | 6 +- source/opt/CMakeLists.txt | 8 - source/opt/aggressive_dead_code_elim_pass.cpp | 16 +- source/opt/block_merge_pass.cpp | 4 +- source/opt/block_merge_util.cpp | 5 + source/opt/const_folding_rules.cpp | 4 +- source/opt/constants.cpp | 36 - source/opt/constants.h | 20 +- source/opt/convert_to_sampled_image_pass.cpp | 437 - source/opt/convert_to_sampled_image_pass.h | 207 - source/opt/copy_prop_arrays.cpp | 25 +- source/opt/dead_insert_elim_pass.cpp | 2 +- source/opt/debug_info_manager.cpp | 299 +- source/opt/debug_info_manager.h | 16 +- source/opt/desc_sroa_util.cpp | 117 - source/opt/desc_sroa_util.h | 54 - source/opt/eliminate_dead_functions_util.cpp | 14 +- .../eliminate_dead_input_components_pass.cpp | 146 - .../eliminate_dead_input_components_pass.h | 59 - source/opt/feature_manager.cpp | 7 - source/opt/feature_manager.h | 8 - source/opt/fix_func_call_arguments.cpp | 90 - source/opt/fix_func_call_arguments.h | 47 - source/opt/folding_rules.cpp | 105 +- source/opt/graphics_robust_access_pass.cpp | 5 +- source/opt/inline_pass.cpp | 18 +- source/opt/instruction.cpp | 59 +- source/opt/instruction.h | 20 - source/opt/interface_var_sroa.cpp | 964 -- source/opt/interface_var_sroa.h | 401 - source/opt/ir_context.cpp | 24 +- source/opt/ir_context.h | 16 +- source/opt/ir_loader.cpp | 42 +- .../opt/local_access_chain_convert_pass.cpp | 7 +- source/opt/local_single_block_elim_pass.cpp | 9 +- source/opt/local_single_store_elim_pass.cpp | 15 +- source/opt/loop_unroller.cpp | 3 - source/opt/mem_pass.cpp | 7 +- source/opt/module.cpp | 28 +- source/opt/module.h | 8 +- source/opt/optimizer.cpp | 34 - source/opt/passes.h | 2 - source/opt/private_to_local_pass.cpp | 6 +- source/opt/reduce_load_size.cpp | 2 +- source/opt/remove_dontinline_pass.cpp | 49 - source/opt/remove_dontinline_pass.h | 42 - ...remove_unused_interface_variables_pass.cpp | 93 - .../remove_unused_interface_variables_pass.h | 26 - ...lace_desc_array_access_using_var_index.cpp | 429 - ...eplace_desc_array_access_using_var_index.h | 205 - source/opt/scalar_replacement_pass.cpp | 10 +- source/opt/spread_volatile_semantics.cpp | 298 - source/opt/spread_volatile_semantics.h | 116 - source/opt/strip_nonsemantic_info_pass.cpp | 115 - source/opt/strip_nonsemantic_info_pass.h | 44 - source/opt/value_number_table.cpp | 2 +- source/opt/vector_dce.cpp | 4 +- source/print.cpp | 2 +- source/reduce/BUILD.gn | 6 +- source/reduce/CMakeLists.txt | 20 +- .../change_operand_reduction_opportunity.cpp | 3 - ...operand_to_undef_reduction_opportunity.cpp | 1 - source/reduce/reducer.cpp | 5 +- .../remove_block_reduction_opportunity.cpp | 11 +- .../remove_block_reduction_opportunity.h | 4 +- ...ove_block_reduction_opportunity_finder.cpp | 4 +- .../remove_function_reduction_opportunity.cpp | 4 +- ...ve_struct_member_reduction_opportunity.cpp | 2 - ...branch_to_branch_reduction_opportunity.cpp | 2 - ...nstruct_to_block_reduction_opportunity.cpp | 67 - ...construct_to_block_reduction_opportunity.h | 49 - ..._to_block_reduction_opportunity_finder.cpp | 185 - ...ct_to_block_reduction_opportunity_finder.h | 57 - ...oop_to_selection_reduction_opportunity.cpp | 19 +- ..._loop_to_selection_reduction_opportunity.h | 14 +- ...selection_reduction_opportunity_finder.cpp | 4 +- source/spirv_validator_options.h | 2 +- source/util/hash_combine.h | 53 - source/util/pooled_linked_list.h | 236 - source/val/construct.cpp | 7 +- source/val/validate_adjacency.cpp | 5 +- source/val/validate_atomics.cpp | 7 - source/val/validate_builtins.cpp | 10 +- source/val/validate_decorations.cpp | 38 +- source/val/validate_extensions.cpp | 1077 +- source/val/validate_image.cpp | 7 +- source/val/validate_interfaces.cpp | 20 - source/val/validate_layout.cpp | 75 +- source/val/validate_memory.cpp | 6 - source/val/validate_mode_setting.cpp | 11 - source/val/validation_state.cpp | 153 +- source/val/validation_state.h | 24 - source/wasm/README.md | 43 - source/wasm/build.sh | 78 - source/wasm/package.json | 17 - source/wasm/spirv-tools.cpp | 94 - source/wasm/spirv-tools.d.ts | 57 - test/CMakeLists.txt | 2 - test/binary_to_text_test.cpp | 2 +- test/diff/CMakeLists.txt | 26 - test/diff/diff_files/.gitignore | 3 - .../OpExtInst_in_dst_only_autogen.cpp | 242 - .../OpExtInst_in_dst_only_dst.spvasm | 33 - .../OpExtInst_in_dst_only_src.spvasm | 33 - .../OpExtInst_in_src_only_autogen.cpp | 242 - .../OpExtInst_in_src_only_dst.spvasm | 30 - .../OpExtInst_in_src_only_src.spvasm | 36 - .../OpTypeForwardPointer_basic_autogen.cpp | 136 - .../OpTypeForwardPointer_basic_dst.spvasm | 15 - .../OpTypeForwardPointer_basic_src.spvasm | 13 - ...TypeForwardPointer_intertwined_autogen.cpp | 138 - ...pTypeForwardPointer_intertwined_dst.spvasm | 13 - ...pTypeForwardPointer_intertwined_src.spvasm | 15 - ...rwardPointer_mismatching_class_autogen.cpp | 116 - ...orwardPointer_mismatching_class_dst.spvasm | 9 - ...orwardPointer_mismatching_class_src.spvasm | 11 - ...orwardPointer_mismatching_type_autogen.cpp | 111 - ...ForwardPointer_mismatching_type_dst.spvasm | 8 - ...ForwardPointer_mismatching_type_src.spvasm | 10 - .../OpTypeForwardPointer_nested_autogen.cpp | 127 - .../OpTypeForwardPointer_nested_dst.spvasm | 11 - .../OpTypeForwardPointer_nested_src.spvasm | 13 - ...eForwardPointer_onesided_debug_autogen.cpp | 124 - ...peForwardPointer_onesided_debug_dst.spvasm | 11 - ...peForwardPointer_onesided_debug_src.spvasm | 14 - test/diff/diff_files/README.md | 17 - test/diff/diff_files/basic_autogen.cpp | 407 - test/diff/diff_files/basic_dst.spvasm | 49 - test/diff/diff_files/basic_src.spvasm | 50 - .../constant_array_size_autogen.cpp | 306 - .../diff_files/constant_array_size_dst.spvasm | 47 - .../diff_files/constant_array_size_src.spvasm | 48 - .../diff_files/diff_test_files_autogen.cmake | 45 - ...different_decorations_fragment_autogen.cpp | 1626 -- .../different_decorations_fragment_dst.spvasm | 199 - .../different_decorations_fragment_src.spvasm | 198 - .../different_decorations_vertex_autogen.cpp | 1322 -- .../different_decorations_vertex_dst.spvasm | 159 - .../different_decorations_vertex_src.spvasm | 155 - ...erent_function_parameter_count_autogen.cpp | 339 - ...ferent_function_parameter_count_dst.spvasm | 52 - ...ferent_function_parameter_count_src.spvasm | 46 - .../diff_files/extra_if_block_autogen.cpp | 867 - .../diff/diff_files/extra_if_block_dst.spvasm | 136 - .../diff/diff_files/extra_if_block_src.spvasm | 137 - test/diff/diff_files/generate_tests.py | 304 - .../diff_files/index_signedness_autogen.cpp | 733 - .../diff_files/index_signedness_dst.spvasm | 110 - .../diff_files/index_signedness_src.spvasm | 111 - .../int_vs_uint_constants_autogen.cpp | 396 - .../int_vs_uint_constants_dst.spvasm | 46 - .../int_vs_uint_constants_src.spvasm | 49 - .../large_functions_large_diffs_autogen.cpp | 1534 -- .../large_functions_large_diffs_dst.spvasm | 213 - .../large_functions_large_diffs_src.spvasm | 230 - .../large_functions_small_diffs_autogen.cpp | 1364 -- .../large_functions_small_diffs_dst.spvasm | 229 - .../large_functions_small_diffs_src.spvasm | 226 - ...ultiple_different_entry_points_autogen.cpp | 330 - ...multiple_different_entry_points_dst.spvasm | 49 - ...multiple_different_entry_points_src.spvasm | 51 - .../multiple_same_entry_points_autogen.cpp | 375 - .../multiple_same_entry_points_dst.spvasm | 45 - .../multiple_same_entry_points_src.spvasm | 46 - .../reordered_if_blocks_autogen.cpp | 568 - .../diff_files/reordered_if_blocks_dst.spvasm | 87 - .../diff_files/reordered_if_blocks_src.spvasm | 87 - .../reordered_switch_blocks_autogen.cpp | 582 - .../reordered_switch_blocks_dst.spvasm | 91 - .../reordered_switch_blocks_src.spvasm | 92 - .../small_functions_small_diffs_autogen.cpp | 747 - .../small_functions_small_diffs_dst.spvasm | 92 - .../small_functions_small_diffs_src.spvasm | 93 - .../spec_constant_array_size_autogen.cpp | 310 - .../spec_constant_array_size_dst.spvasm | 47 - .../spec_constant_array_size_src.spvasm | 48 - .../spec_constant_composite_autogen.cpp | 186 - .../spec_constant_composite_dst.spvasm | 22 - .../spec_constant_composite_src.spvasm | 23 - .../diff_files/unrelated_shaders_autogen.cpp | 230 - .../diff_files/unrelated_shaders_dst.spvasm | 31 - .../diff_files/unrelated_shaders_src.spvasm | 25 - test/diff/diff_test.cpp | 228 - test/diff/diff_test_utils.cpp | 58 - test/diff/diff_test_utils.h | 30 - test/diff/lcs_test.cpp | 329 - test/fuzz/CMakeLists.txt | 4 - test/fuzz/fuzz_test_util.cpp | 10 +- .../fuzzer_pass_add_opphi_synonyms_test.cpp | 2 +- .../fuzzer_pass_construct_composites_test.cpp | 4 +- test/fuzz/fuzzer_pass_donate_modules_test.cpp | 40 +- .../fuzzer_pass_outline_functions_test.cpp | 8 +- test/fuzz/fuzzer_pass_test.cpp | 2 +- test/fuzz/fuzzer_replayer_test.cpp | 26 +- test/fuzz/fuzzer_shrinker_test.cpp | 2 +- test/fuzz/fuzzerutil_test.cpp | 1554 -- test/fuzz/shrinker_test.cpp | 4 +- .../fuzz/transformation_access_chain_test.cpp | 76 +- ...ation_add_bit_instruction_synonym_test.cpp | 69 +- ...ransformation_add_constant_scalar_test.cpp | 5 - .../transformation_add_copy_memory_test.cpp | 10 +- .../transformation_add_dead_block_test.cpp | 93 - .../transformation_add_parameter_test.cpp | 21 +- test/fuzz/transformation_add_synonym_test.cpp | 37 +- .../transformation_add_type_float_test.cpp | 16 +- .../fuzz/transformation_add_type_int_test.cpp | 23 - ...ransformation_composite_construct_test.cpp | 18 - test/fuzz/transformation_load_test.cpp | 383 +- ...sformation_merge_function_returns_test.cpp | 240 +- .../transformation_mutate_pointer_test.cpp | 8 +- .../transformation_outline_function_test.cpp | 39 - ...ansformation_permute_phi_operands_test.cpp | 26 - ...ormation_push_id_through_variable_test.cpp | 10 +- ...formation_replace_id_with_synonym_test.cpp | 633 - test/fuzz/transformation_store_test.cpp | 307 +- ...formation_swap_function_variables_test.cpp | 288 - ...transformation_swap_two_functions_test.cpp | 257 - ...ransformation_wrap_vector_synonym_test.cpp | 1394 -- test/fuzzers/CMakeLists.txt | 44 - test/fuzzers/corpora/spv/graphicsfuzz_000.spv | Bin 7968 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_001.spv | Bin 2452 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_002.spv | Bin 2060 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_003.spv | Bin 13336 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_004.spv | Bin 12368 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_005.spv | Bin 2416 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_006.spv | Bin 2728 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_007.spv | Bin 2668 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_008.spv | Bin 22972 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_009.spv | Bin 3728 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_010.spv | Bin 3280 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_011.spv | Bin 5440 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_012.spv | Bin 3692 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_013.spv | Bin 2860 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_014.spv | Bin 1772 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_015.spv | Bin 7488 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_016.spv | Bin 4044 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_017.spv | Bin 14360 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_018.spv | Bin 16524 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_019.spv | Bin 10552 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_020.spv | Bin 9800 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_021.spv | Bin 1936 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_022.spv | Bin 9436 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_023.spv | Bin 1940 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_024.spv | Bin 9256 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_025.spv | Bin 7960 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_026.spv | Bin 9680 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_027.spv | Bin 9432 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_028.spv | Bin 4092 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_029.spv | Bin 2404 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_030.spv | Bin 2568 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_031.spv | Bin 6084 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_032.spv | Bin 11380 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_033.spv | Bin 7180 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_034.spv | Bin 1356 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_035.spv | Bin 648 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_036.spv | Bin 2872 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_037.spv | Bin 6256 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_038.spv | Bin 3648 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_039.spv | Bin 3428 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_040.spv | Bin 3284 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_041.spv | Bin 3360 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_042.spv | Bin 6456 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_043.spv | Bin 2084 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_044.spv | Bin 2596 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_045.spv | Bin 4680 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_046.spv | Bin 5816 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_047.spv | Bin 3216 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_048.spv | Bin 4644 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_049.spv | Bin 7436 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_050.spv | Bin 4156 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_051.spv | Bin 3200 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_052.spv | Bin 5572 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_053.spv | Bin 3936 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_054.spv | Bin 3024 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_055.spv | Bin 1220 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_056.spv | Bin 7660 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_057.spv | Bin 9044 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_058.spv | Bin 3172 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_059.spv | Bin 5940 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_060.spv | Bin 12388 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_061.spv | Bin 9564 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_062.spv | Bin 1824 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_063.spv | Bin 13152 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_064.spv | Bin 6284 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_065.spv | Bin 7184 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_066.spv | Bin 3796 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_067.spv | Bin 3716 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_068.spv | Bin 1956 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_069.spv | Bin 3740 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_070.spv | Bin 6024 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_071.spv | Bin 964 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_072.spv | Bin 20916 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_073.spv | Bin 10108 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_074.spv | Bin 5476 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_075.spv | Bin 1264 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_076.spv | Bin 3772 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_077.spv | Bin 4276 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_078.spv | Bin 7136 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_079.spv | Bin 5548 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_080.spv | Bin 5548 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_081.spv | Bin 3216 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_082.spv | Bin 16372 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_083.spv | Bin 4328 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_084.spv | Bin 4180 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_085.spv | Bin 2132 -> 0 bytes test/fuzzers/corpora/spv/graphicsfuzz_086.spv | Bin 2476 -> 0 bytes test/fuzzers/random_generator.cpp | 135 - test/fuzzers/random_generator.h | 68 - test/fuzzers/spvtools_fuzz_fuzzer.cpp | 80 - test/fuzzers/spvtools_opt_fuzzer_common.cpp | 84 - test/fuzzers/spvtools_opt_fuzzer_common.h | 35 - test/lint/CMakeLists.txt | 18 - test/lint/divergence_analysis_test.cpp | 700 - test/operand_capabilities_test.cpp | 3 +- test/opt/CMakeLists.txt | 4 - test/opt/control_dependence.cpp | 306 - test/opt/convert_to_sampled_image_test.cpp | 353 - test/opt/dataflow.cpp | 225 - test/opt/eliminate_dead_functions_test.cpp | 78 - .../eliminate_dead_input_components_test.cpp | 404 - test/opt/eliminate_dead_member_test.cpp | 1 + test/opt/fix_func_call_arguments_test.cpp | 152 - test/opt/fold_test.cpp | 148 +- test/opt/graphics_robust_access_test.cpp | 99 - test/opt/interface_var_sroa_test.cpp | 410 - test/opt/loop_optimizations/unroll_simple.cpp | 209 - test/opt/remove_dontinline_test.cpp | 127 - ...remove_unused_interface_variables_test.cpp | 185 - ...desc_array_access_using_var_index_test.cpp | 576 - test/opt/spread_volatile_semantics_test.cpp | 1267 -- test/opt/strip_nonsemantic_info_test.cpp | 296 - test/reduce/CMakeLists.txt | 5 +- test/reduce/merge_blocks_test.cpp | 58 - test/reduce/reduce_test_util.cpp | 28 +- .../structured_construct_to_block_test.cpp | 245 - test/text_to_binary.extension_test.cpp | 97 - test/text_to_binary.mode_setting_test.cpp | 1 - test/util/hash_combine_test.cpp | 43 - test/util/pooled_linked_list_test.cpp | 185 - test/val/CMakeLists.txt | 4 - test/val/val_annotation_test.cpp | 955 -- test/val/val_atomics_test.cpp | 99 +- test/val/val_builtins_test.cpp | 45 +- test/val/val_cfg_test.cpp | 35 - test/val/val_composites_test.cpp | 23 +- test/val/val_decoration_test.cpp | 143 - test/val/val_ext_inst_debug_test.cpp | 5313 ------ test/val/val_ext_inst_test.cpp | 2828 +++- ...val_extension_spv_khr_bit_instructions.cpp | 117 - ..._extension_spv_khr_integer_dot_product.cpp | 1330 -- .../val_extension_spv_khr_subgroup_rotate.cpp | 352 - ..._spv_khr_subgroup_uniform_control_flow.cpp | 110 - test/val/val_image_test.cpp | 16 - test/val/val_interfaces_test.cpp | 25 - test/val/val_memory_test.cpp | 90 +- test/val/val_modes_test.cpp | 10 +- test/val/val_storage_test.cpp | 41 - test/wasm/test.js | 64 - tools/CMakeLists.txt | 3 +- tools/buildHeaders/CMakeLists.txt | 26 - .../bin/generate_language_headers.py | 242 - tools/buildHeaders/bin/makeExtinstHeaders.py | 28 - tools/buildHeaders/bin/makeHeaders | 7 - tools/buildHeaders/header.cpp | 835 - tools/buildHeaders/header.h | 54 - tools/buildHeaders/jsonToSpirv.cpp | 551 - tools/buildHeaders/jsonToSpirv.h | 301 - .../jsoncpp/dist/json/json-forwards.h | 255 - tools/buildHeaders/jsoncpp/dist/json/json.h | 2017 --- tools/buildHeaders/jsoncpp/dist/jsoncpp.cpp | 5124 ------ tools/buildHeaders/main.cpp | 127 - tools/cfg/cfg.cpp | 10 +- tools/diff/diff.cpp | 201 - tools/fuzz/fuzz.cpp | 24 +- tools/io.h | 4 +- tools/lint/lint.cpp | 75 - tools/opt/opt.cpp | 15 - tools/sva/yarn.lock | 12 +- tools/val/val.cpp | 4 - utils/check_copyright.py | 13 +- utils/check_symbol_exports.py | 37 +- utils/generate_grammar_tables.py | 14 +- utils/vscode/install.sh | 16 +- utils/vscode/spirv.json | 35 +- utils/vscode/src/langsvr.go | 10 +- utils/vscode/src/schema/schema.go | 2962 +++- 682 files changed, 6812 insertions(+), 141399 deletions(-) delete mode 100644 .clang-format delete mode 100644 .github/workflows/wasm.yml delete mode 100644 .gitignore delete mode 100644 .gn delete mode 100644 cmake/Config.cmake.in delete mode 100644 include/spirv/1.0/GLSL.std.450.h delete mode 100644 include/spirv/1.0/OpenCL.std.h delete mode 100644 include/spirv/1.0/extinst.glsl.std.450.grammar.json delete mode 100644 include/spirv/1.0/extinst.opencl.std.100.grammar.json delete mode 100644 include/spirv/1.0/spirv.core.grammar.json delete mode 100644 include/spirv/1.0/spirv.cs delete mode 100644 include/spirv/1.0/spirv.h delete mode 100644 include/spirv/1.0/spirv.hpp delete mode 100644 include/spirv/1.0/spirv.hpp11 delete mode 100644 include/spirv/1.0/spirv.json delete mode 100644 include/spirv/1.0/spirv.lua delete mode 100644 include/spirv/1.0/spirv.py delete mode 100644 include/spirv/1.1/GLSL.std.450.h delete mode 100644 include/spirv/1.1/OpenCL.std.h delete mode 100644 include/spirv/1.1/extinst.glsl.std.450.grammar.json delete mode 100644 include/spirv/1.1/extinst.opencl.std.100.grammar.json delete mode 100644 include/spirv/1.1/spirv.core.grammar.json delete mode 100644 include/spirv/1.1/spirv.cs delete mode 100644 include/spirv/1.1/spirv.h delete mode 100644 include/spirv/1.1/spirv.hpp delete mode 100644 include/spirv/1.1/spirv.hpp11 delete mode 100644 include/spirv/1.1/spirv.json delete mode 100644 include/spirv/1.1/spirv.lua delete mode 100644 include/spirv/1.1/spirv.py delete mode 100644 include/spirv/1.2/OpenCL.std.h delete mode 100644 include/spirv/1.2/extinst.glsl.std.450.grammar.json delete mode 100644 include/spirv/1.2/extinst.opencl.std.100.grammar.json delete mode 100644 include/spirv/1.2/spirv.core.grammar.json delete mode 100644 include/spirv/1.2/spirv.cs delete mode 100644 include/spirv/1.2/spirv.h delete mode 100644 include/spirv/1.2/spirv.hpp delete mode 100644 include/spirv/1.2/spirv.hpp11 delete mode 100644 include/spirv/1.2/spirv.json delete mode 100644 include/spirv/1.2/spirv.lua delete mode 100644 include/spirv/1.2/spirv.py delete mode 100644 include/spirv/spir-v.xml delete mode 100644 include/spirv/unified1/AMD_gcn_shader.h delete mode 100644 include/spirv/unified1/AMD_shader_ballot.h delete mode 100644 include/spirv/unified1/AMD_shader_explicit_vertex_parameter.h delete mode 100644 include/spirv/unified1/AMD_shader_trinary_minmax.h delete mode 100644 include/spirv/unified1/DebugInfo.h delete mode 100644 include/spirv/unified1/NonSemanticClspvReflection.h delete mode 100644 include/spirv/unified1/NonSemanticShaderDebugInfo100.h delete mode 100644 include/spirv/unified1/OpenCLDebugInfo100.h delete mode 100644 include/spirv/unified1/extinst.debuginfo.grammar.json delete mode 100644 include/spirv/unified1/extinst.glsl.std.450.grammar.json delete mode 100644 include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json delete mode 100644 include/spirv/unified1/extinst.nonsemantic.debugprintf.grammar.json delete mode 100644 include/spirv/unified1/extinst.nonsemantic.shader.debuginfo.100.grammar.json delete mode 100644 include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json delete mode 100644 include/spirv/unified1/extinst.opencl.std.100.grammar.json delete mode 100644 include/spirv/unified1/extinst.spv-amd-gcn-shader.grammar.json delete mode 100644 include/spirv/unified1/extinst.spv-amd-shader-ballot.grammar.json delete mode 100644 include/spirv/unified1/extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json delete mode 100644 include/spirv/unified1/extinst.spv-amd-shader-trinary-minmax.grammar.json delete mode 100644 include/spirv/unified1/spirv.core.grammar.json delete mode 100644 include/spirv/unified1/spirv.cs delete mode 100644 include/spirv/unified1/spirv.hpp delete mode 100644 include/spirv/unified1/spirv.hpp11 delete mode 100644 include/spirv/unified1/spirv.json delete mode 100644 include/spirv/unified1/spirv.lua delete mode 100644 include/spirv/unified1/spirv.py delete mode 100644 include/spirv/unified1/spv.d delete mode 100755 kokoro/linux-clang-ubsan/build.sh delete mode 100644 kokoro/linux-clang-ubsan/presubmit.cfg rename kokoro/{linux-clang-ubsan => windows-msvc-2013-release}/continuous.cfg (85%) delete mode 100644 source/common_debug_info.h delete mode 100644 source/diff/CMakeLists.txt delete mode 100644 source/diff/diff.cpp delete mode 100644 source/diff/diff.h delete mode 100644 source/diff/lcs.h delete mode 100644 source/extinst.nonsemantic.vulkan.debuginfo.100.grammar.json delete mode 100644 source/fuzz/fuzzer_pass_permute_function_variables.cpp delete mode 100644 source/fuzz/fuzzer_pass_permute_function_variables.h delete mode 100644 source/fuzz/fuzzer_pass_swap_functions.cpp delete mode 100644 source/fuzz/fuzzer_pass_swap_functions.h delete mode 100644 source/fuzz/fuzzer_pass_wrap_vector_synonym.cpp delete mode 100644 source/fuzz/fuzzer_pass_wrap_vector_synonym.h delete mode 100644 source/fuzz/transformation_swap_function_variables.cpp delete mode 100644 source/fuzz/transformation_swap_function_variables.h delete mode 100644 source/fuzz/transformation_swap_two_functions.cpp delete mode 100644 source/fuzz/transformation_swap_two_functions.h delete mode 100644 source/fuzz/transformation_wrap_vector_synonym.cpp delete mode 100644 source/fuzz/transformation_wrap_vector_synonym.h delete mode 100644 source/opt/convert_to_sampled_image_pass.cpp delete mode 100644 source/opt/convert_to_sampled_image_pass.h delete mode 100644 source/opt/desc_sroa_util.cpp delete mode 100644 source/opt/desc_sroa_util.h delete mode 100644 source/opt/eliminate_dead_input_components_pass.cpp delete mode 100644 source/opt/eliminate_dead_input_components_pass.h delete mode 100644 source/opt/fix_func_call_arguments.cpp delete mode 100644 source/opt/fix_func_call_arguments.h delete mode 100644 source/opt/interface_var_sroa.cpp delete mode 100644 source/opt/interface_var_sroa.h delete mode 100644 source/opt/remove_dontinline_pass.cpp delete mode 100644 source/opt/remove_dontinline_pass.h delete mode 100644 source/opt/remove_unused_interface_variables_pass.cpp delete mode 100644 source/opt/remove_unused_interface_variables_pass.h delete mode 100644 source/opt/replace_desc_array_access_using_var_index.cpp delete mode 100644 source/opt/replace_desc_array_access_using_var_index.h delete mode 100644 source/opt/spread_volatile_semantics.cpp delete mode 100644 source/opt/spread_volatile_semantics.h delete mode 100644 source/opt/strip_nonsemantic_info_pass.cpp delete mode 100644 source/opt/strip_nonsemantic_info_pass.h delete mode 100644 source/reduce/structured_construct_to_block_reduction_opportunity.cpp delete mode 100644 source/reduce/structured_construct_to_block_reduction_opportunity.h delete mode 100644 source/reduce/structured_construct_to_block_reduction_opportunity_finder.cpp delete mode 100644 source/reduce/structured_construct_to_block_reduction_opportunity_finder.h delete mode 100644 source/util/hash_combine.h delete mode 100644 source/util/pooled_linked_list.h delete mode 100644 source/wasm/README.md delete mode 100755 source/wasm/build.sh delete mode 100644 source/wasm/package.json delete mode 100644 source/wasm/spirv-tools.cpp delete mode 100644 source/wasm/spirv-tools.d.ts delete mode 100644 test/diff/CMakeLists.txt delete mode 100644 test/diff/diff_files/.gitignore delete mode 100644 test/diff/diff_files/OpExtInst_in_dst_only_autogen.cpp delete mode 100644 test/diff/diff_files/OpExtInst_in_dst_only_dst.spvasm delete mode 100644 test/diff/diff_files/OpExtInst_in_dst_only_src.spvasm delete mode 100644 test/diff/diff_files/OpExtInst_in_src_only_autogen.cpp delete mode 100644 test/diff/diff_files/OpExtInst_in_src_only_dst.spvasm delete mode 100644 test/diff/diff_files/OpExtInst_in_src_only_src.spvasm delete mode 100644 test/diff/diff_files/OpTypeForwardPointer_basic_autogen.cpp delete mode 100644 test/diff/diff_files/OpTypeForwardPointer_basic_dst.spvasm delete mode 100644 test/diff/diff_files/OpTypeForwardPointer_basic_src.spvasm delete mode 100644 test/diff/diff_files/OpTypeForwardPointer_intertwined_autogen.cpp delete mode 100644 test/diff/diff_files/OpTypeForwardPointer_intertwined_dst.spvasm delete mode 100644 test/diff/diff_files/OpTypeForwardPointer_intertwined_src.spvasm delete mode 100644 test/diff/diff_files/OpTypeForwardPointer_mismatching_class_autogen.cpp delete mode 100644 test/diff/diff_files/OpTypeForwardPointer_mismatching_class_dst.spvasm delete mode 100644 test/diff/diff_files/OpTypeForwardPointer_mismatching_class_src.spvasm delete mode 100644 test/diff/diff_files/OpTypeForwardPointer_mismatching_type_autogen.cpp delete mode 100644 test/diff/diff_files/OpTypeForwardPointer_mismatching_type_dst.spvasm delete mode 100644 test/diff/diff_files/OpTypeForwardPointer_mismatching_type_src.spvasm delete mode 100644 test/diff/diff_files/OpTypeForwardPointer_nested_autogen.cpp delete mode 100644 test/diff/diff_files/OpTypeForwardPointer_nested_dst.spvasm delete mode 100644 test/diff/diff_files/OpTypeForwardPointer_nested_src.spvasm delete mode 100644 test/diff/diff_files/OpTypeForwardPointer_onesided_debug_autogen.cpp delete mode 100644 test/diff/diff_files/OpTypeForwardPointer_onesided_debug_dst.spvasm delete mode 100644 test/diff/diff_files/OpTypeForwardPointer_onesided_debug_src.spvasm delete mode 100644 test/diff/diff_files/README.md delete mode 100644 test/diff/diff_files/basic_autogen.cpp delete mode 100644 test/diff/diff_files/basic_dst.spvasm delete mode 100644 test/diff/diff_files/basic_src.spvasm delete mode 100644 test/diff/diff_files/constant_array_size_autogen.cpp delete mode 100644 test/diff/diff_files/constant_array_size_dst.spvasm delete mode 100644 test/diff/diff_files/constant_array_size_src.spvasm delete mode 100644 test/diff/diff_files/diff_test_files_autogen.cmake delete mode 100644 test/diff/diff_files/different_decorations_fragment_autogen.cpp delete mode 100644 test/diff/diff_files/different_decorations_fragment_dst.spvasm delete mode 100644 test/diff/diff_files/different_decorations_fragment_src.spvasm delete mode 100644 test/diff/diff_files/different_decorations_vertex_autogen.cpp delete mode 100644 test/diff/diff_files/different_decorations_vertex_dst.spvasm delete mode 100644 test/diff/diff_files/different_decorations_vertex_src.spvasm delete mode 100644 test/diff/diff_files/different_function_parameter_count_autogen.cpp delete mode 100644 test/diff/diff_files/different_function_parameter_count_dst.spvasm delete mode 100644 test/diff/diff_files/different_function_parameter_count_src.spvasm delete mode 100644 test/diff/diff_files/extra_if_block_autogen.cpp delete mode 100644 test/diff/diff_files/extra_if_block_dst.spvasm delete mode 100644 test/diff/diff_files/extra_if_block_src.spvasm delete mode 100755 test/diff/diff_files/generate_tests.py delete mode 100644 test/diff/diff_files/index_signedness_autogen.cpp delete mode 100644 test/diff/diff_files/index_signedness_dst.spvasm delete mode 100644 test/diff/diff_files/index_signedness_src.spvasm delete mode 100644 test/diff/diff_files/int_vs_uint_constants_autogen.cpp delete mode 100644 test/diff/diff_files/int_vs_uint_constants_dst.spvasm delete mode 100644 test/diff/diff_files/int_vs_uint_constants_src.spvasm delete mode 100644 test/diff/diff_files/large_functions_large_diffs_autogen.cpp delete mode 100644 test/diff/diff_files/large_functions_large_diffs_dst.spvasm delete mode 100644 test/diff/diff_files/large_functions_large_diffs_src.spvasm delete mode 100644 test/diff/diff_files/large_functions_small_diffs_autogen.cpp delete mode 100644 test/diff/diff_files/large_functions_small_diffs_dst.spvasm delete mode 100644 test/diff/diff_files/large_functions_small_diffs_src.spvasm delete mode 100644 test/diff/diff_files/multiple_different_entry_points_autogen.cpp delete mode 100644 test/diff/diff_files/multiple_different_entry_points_dst.spvasm delete mode 100644 test/diff/diff_files/multiple_different_entry_points_src.spvasm delete mode 100644 test/diff/diff_files/multiple_same_entry_points_autogen.cpp delete mode 100644 test/diff/diff_files/multiple_same_entry_points_dst.spvasm delete mode 100644 test/diff/diff_files/multiple_same_entry_points_src.spvasm delete mode 100644 test/diff/diff_files/reordered_if_blocks_autogen.cpp delete mode 100644 test/diff/diff_files/reordered_if_blocks_dst.spvasm delete mode 100644 test/diff/diff_files/reordered_if_blocks_src.spvasm delete mode 100644 test/diff/diff_files/reordered_switch_blocks_autogen.cpp delete mode 100644 test/diff/diff_files/reordered_switch_blocks_dst.spvasm delete mode 100644 test/diff/diff_files/reordered_switch_blocks_src.spvasm delete mode 100644 test/diff/diff_files/small_functions_small_diffs_autogen.cpp delete mode 100644 test/diff/diff_files/small_functions_small_diffs_dst.spvasm delete mode 100644 test/diff/diff_files/small_functions_small_diffs_src.spvasm delete mode 100644 test/diff/diff_files/spec_constant_array_size_autogen.cpp delete mode 100644 test/diff/diff_files/spec_constant_array_size_dst.spvasm delete mode 100644 test/diff/diff_files/spec_constant_array_size_src.spvasm delete mode 100644 test/diff/diff_files/spec_constant_composite_autogen.cpp delete mode 100644 test/diff/diff_files/spec_constant_composite_dst.spvasm delete mode 100644 test/diff/diff_files/spec_constant_composite_src.spvasm delete mode 100644 test/diff/diff_files/unrelated_shaders_autogen.cpp delete mode 100644 test/diff/diff_files/unrelated_shaders_dst.spvasm delete mode 100644 test/diff/diff_files/unrelated_shaders_src.spvasm delete mode 100644 test/diff/diff_test.cpp delete mode 100644 test/diff/diff_test_utils.cpp delete mode 100644 test/diff/diff_test_utils.h delete mode 100644 test/diff/lcs_test.cpp delete mode 100644 test/fuzz/fuzzerutil_test.cpp delete mode 100644 test/fuzz/transformation_swap_function_variables_test.cpp delete mode 100644 test/fuzz/transformation_swap_two_functions_test.cpp delete mode 100644 test/fuzz/transformation_wrap_vector_synonym_test.cpp delete mode 100644 test/fuzzers/CMakeLists.txt delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_000.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_001.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_002.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_003.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_004.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_005.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_006.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_007.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_008.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_009.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_010.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_011.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_012.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_013.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_014.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_015.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_016.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_017.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_018.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_019.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_020.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_021.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_022.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_023.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_024.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_025.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_026.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_027.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_028.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_029.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_030.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_031.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_032.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_033.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_034.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_035.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_036.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_037.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_038.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_039.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_040.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_041.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_042.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_043.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_044.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_045.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_046.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_047.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_048.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_049.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_050.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_051.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_052.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_053.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_054.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_055.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_056.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_057.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_058.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_059.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_060.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_061.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_062.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_063.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_064.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_065.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_066.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_067.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_068.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_069.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_070.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_071.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_072.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_073.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_074.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_075.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_076.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_077.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_078.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_079.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_080.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_081.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_082.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_083.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_084.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_085.spv delete mode 100644 test/fuzzers/corpora/spv/graphicsfuzz_086.spv delete mode 100644 test/fuzzers/random_generator.cpp delete mode 100644 test/fuzzers/random_generator.h delete mode 100644 test/fuzzers/spvtools_fuzz_fuzzer.cpp delete mode 100644 test/fuzzers/spvtools_opt_fuzzer_common.cpp delete mode 100644 test/fuzzers/spvtools_opt_fuzzer_common.h delete mode 100644 test/lint/CMakeLists.txt delete mode 100644 test/lint/divergence_analysis_test.cpp delete mode 100644 test/opt/control_dependence.cpp delete mode 100644 test/opt/convert_to_sampled_image_test.cpp delete mode 100644 test/opt/dataflow.cpp delete mode 100644 test/opt/eliminate_dead_input_components_test.cpp delete mode 100644 test/opt/fix_func_call_arguments_test.cpp delete mode 100644 test/opt/interface_var_sroa_test.cpp delete mode 100644 test/opt/remove_dontinline_test.cpp delete mode 100644 test/opt/remove_unused_interface_variables_test.cpp delete mode 100644 test/opt/replace_desc_array_access_using_var_index_test.cpp delete mode 100644 test/opt/spread_volatile_semantics_test.cpp delete mode 100644 test/opt/strip_nonsemantic_info_test.cpp delete mode 100644 test/reduce/structured_construct_to_block_test.cpp delete mode 100644 test/util/hash_combine_test.cpp delete mode 100644 test/util/pooled_linked_list_test.cpp delete mode 100644 test/val/val_annotation_test.cpp delete mode 100644 test/val/val_ext_inst_debug_test.cpp delete mode 100644 test/val/val_extension_spv_khr_bit_instructions.cpp delete mode 100644 test/val/val_extension_spv_khr_integer_dot_product.cpp delete mode 100644 test/val/val_extension_spv_khr_subgroup_rotate.cpp delete mode 100644 test/val/val_extension_spv_khr_subgroup_uniform_control_flow.cpp delete mode 100644 test/wasm/test.js delete mode 100644 tools/buildHeaders/CMakeLists.txt delete mode 100755 tools/buildHeaders/bin/generate_language_headers.py delete mode 100755 tools/buildHeaders/bin/makeExtinstHeaders.py delete mode 100755 tools/buildHeaders/bin/makeHeaders delete mode 100644 tools/buildHeaders/header.cpp delete mode 100644 tools/buildHeaders/header.h delete mode 100644 tools/buildHeaders/jsonToSpirv.cpp delete mode 100644 tools/buildHeaders/jsonToSpirv.h delete mode 100644 tools/buildHeaders/jsoncpp/dist/json/json-forwards.h delete mode 100644 tools/buildHeaders/jsoncpp/dist/json/json.h delete mode 100644 tools/buildHeaders/jsoncpp/dist/jsoncpp.cpp delete mode 100644 tools/buildHeaders/main.cpp delete mode 100644 tools/diff/diff.cpp delete mode 100644 tools/lint/lint.cpp diff --git a/.clang-format b/.clang-format deleted file mode 100644 index 1d43c4ed..00000000 --- a/.clang-format +++ /dev/null @@ -1,6 +0,0 @@ ---- -Language: Cpp -BasedOnStyle: Google -DerivePointerAlignment: false -SortIncludes: true -... diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml deleted file mode 100644 index d9a9c5cb..00000000 --- a/.github/workflows/wasm.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Wasm Build - -on: [ push, pull_request ] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Build web - run: docker-compose up - - name: Run tests - run: node test/wasm/test.js diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 8a487875..00000000 --- a/.gitignore +++ /dev/null @@ -1,35 +0,0 @@ -.clang_complete -.ycm_extra_conf.py* -*.pyc -compile_commands.json -/build*/ -/buildtools/ -/external/googletest -/external/SPIRV-Headers -/external/spirv-headers -/external/effcee -/external/re2 -/external/protobuf -/out -/TAGS -/third_party/llvm-build/ -/testing -/tools/clang/ -/utils/clang-format-diff.py -bazel-bin -bazel-genfiles -bazel-out -bazel-spirv-tools -bazel-spirv-tools -bazel-testlogs - -# Vim -[._]*.s[a-w][a-z] -*~ - -# C-Lion -/.idea/ -/cmake-build-*/ - -# VSCode -/.vscode/* diff --git a/.gn b/.gn deleted file mode 100644 index 377a97ab..00000000 --- a/.gn +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2018 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -buildconfig = "//build/config/BUILDCONFIG.gn" - -default_args = { - clang_use_chrome_plugins = false - use_custom_libcxx = false -} diff --git a/Android.mk b/Android.mk index 6dd18341..ef1cdff1 100644 --- a/Android.mk +++ b/Android.mk @@ -88,11 +88,8 @@ SPVTOOLS_OPT_SRC_FILES := \ source/opt/composite.cpp \ source/opt/const_folding_rules.cpp \ source/opt/constants.cpp \ - source/opt/control_dependence.cpp \ - source/opt/convert_to_sampled_image_pass.cpp \ source/opt/convert_to_half_pass.cpp \ source/opt/copy_prop_arrays.cpp \ - source/opt/dataflow.cpp \ source/opt/dead_branch_elim_pass.cpp \ source/opt/dead_insert_elim_pass.cpp \ source/opt/dead_variable_elimination.cpp \ @@ -100,16 +97,13 @@ SPVTOOLS_OPT_SRC_FILES := \ source/opt/debug_info_manager.cpp \ source/opt/def_use_manager.cpp \ source/opt/desc_sroa.cpp \ - source/opt/desc_sroa_util.cpp \ source/opt/dominator_analysis.cpp \ source/opt/dominator_tree.cpp \ source/opt/eliminate_dead_constant_pass.cpp \ source/opt/eliminate_dead_functions_pass.cpp \ source/opt/eliminate_dead_functions_util.cpp \ - source/opt/eliminate_dead_input_components_pass.cpp \ source/opt/eliminate_dead_members_pass.cpp \ source/opt/feature_manager.cpp \ - source/opt/fix_func_call_arguments.cpp \ source/opt/fix_storage_class.cpp \ source/opt/flatten_decoration_pass.cpp \ source/opt/fold.cpp \ @@ -128,7 +122,6 @@ SPVTOOLS_OPT_SRC_FILES := \ source/opt/instruction.cpp \ source/opt/instruction_list.cpp \ source/opt/instrument_pass.cpp \ - source/opt/interface_var_sroa.cpp \ source/opt/interp_fixup_pass.cpp \ source/opt/ir_context.cpp \ source/opt/ir_loader.cpp \ @@ -159,21 +152,17 @@ SPVTOOLS_OPT_SRC_FILES := \ source/opt/redundancy_elimination.cpp \ source/opt/register_pressure.cpp \ source/opt/relax_float_ops_pass.cpp \ - source/opt/remove_dontinline_pass.cpp \ source/opt/remove_duplicates_pass.cpp \ - source/opt/remove_unused_interface_variables_pass.cpp \ - source/opt/replace_desc_array_access_using_var_index.cpp \ source/opt/replace_invalid_opc.cpp \ source/opt/scalar_analysis.cpp \ source/opt/scalar_analysis_simplification.cpp \ source/opt/scalar_replacement_pass.cpp \ source/opt/set_spec_constant_default_value_pass.cpp \ source/opt/simplification_pass.cpp \ - source/opt/spread_volatile_semantics.cpp \ source/opt/ssa_rewrite_pass.cpp \ source/opt/strength_reduction_pass.cpp \ source/opt/strip_debug_info_pass.cpp \ - source/opt/strip_nonsemantic_info_pass.cpp \ + source/opt/strip_reflect_info_pass.cpp \ source/opt/struct_cfg_analysis.cpp \ source/opt/type_manager.cpp \ source/opt/types.cpp \ @@ -191,7 +180,6 @@ SPV_GLSL_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/unified1/extinst.glsl.st SPV_OPENCL_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/unified1/extinst.opencl.std.100.grammar.json SPV_DEBUGINFO_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/unified1/extinst.debuginfo.grammar.json SPV_CLDEBUGINFO100_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json -SPV_VKDEBUGINFO100_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/unified1/extinst.nonsemantic.shader.debuginfo.100.grammar.json define gen_spvtools_grammar_tables $(call generate-file-dir,$(1)/core.insts-unified1.inc) @@ -223,7 +211,6 @@ $(LOCAL_PATH)/source/ext_inst.cpp: \ $(1)/opencl.std.insts.inc \ $(1)/debuginfo.insts.inc \ $(1)/opencl.debuginfo.100.insts.inc \ - $(1)/nonsemantic.shader.debuginfo.100.insts.inc \ $(1)/spv-amd-gcn-shader.insts.inc \ $(1)/spv-amd-shader-ballot.insts.inc \ $(1)/spv-amd-shader-explicit-vertex-parameter.insts.inc \ @@ -253,7 +240,6 @@ endef # We generate language-specific headers for DebugInfo and OpenCL.DebugInfo.100 $(eval $(call gen_spvtools_lang_headers,$(SPVTOOLS_OUT_PATH),DebugInfo,$(SPV_DEBUGINFO_GRAMMAR))) $(eval $(call gen_spvtools_lang_headers,$(SPVTOOLS_OUT_PATH),OpenCLDebugInfo100,$(SPV_CLDEBUGINFO100_GRAMMAR))) -$(eval $(call gen_spvtools_lang_headers,$(SPVTOOLS_OUT_PATH),NonSemanticShaderDebugInfo100,$(SPV_VKDEBUGINFO100_GRAMMAR))) define gen_spvtools_vendor_tables @@ -271,7 +257,6 @@ endef # Vendor and debug extended instruction sets, with grammars from SPIRV-Tools source tree. $(eval $(call gen_spvtools_vendor_tables,$(SPVTOOLS_OUT_PATH),debuginfo,"")) $(eval $(call gen_spvtools_vendor_tables,$(SPVTOOLS_OUT_PATH),opencl.debuginfo.100,"CLDEBUG100_")) -$(eval $(call gen_spvtools_vendor_tables,$(SPVTOOLS_OUT_PATH),nonsemantic.shader.debuginfo.100,"SHDEBUG100_")) $(eval $(call gen_spvtools_vendor_tables,$(SPVTOOLS_OUT_PATH),spv-amd-gcn-shader,"")) $(eval $(call gen_spvtools_vendor_tables,$(SPVTOOLS_OUT_PATH),spv-amd-shader-ballot,"")) $(eval $(call gen_spvtools_vendor_tables,$(SPVTOOLS_OUT_PATH),spv-amd-shader-explicit-vertex-parameter,"")) @@ -304,7 +289,7 @@ $(1)/build-version.inc: \ $(LOCAL_PATH)/utils/update_build_version.py \ $(LOCAL_PATH)/CHANGES @$(HOST_PYTHON) $(LOCAL_PATH)/utils/update_build_version.py \ - $(LOCAL_PATH)/CHANGES $(1)/build-version.inc + $(LOCAL_PATH) $(1)/build-version.inc @echo "[$(TARGET_ARCH_ABI)] Generate : build-version.inc <= CHANGES" $(LOCAL_PATH)/source/software_version.cpp: $(1)/build-version.inc endef diff --git a/BUILD.bazel b/BUILD.bazel index 914619af..52290cfb 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -3,7 +3,6 @@ load( "COMMON_COPTS", "DEBUGINFO_GRAMMAR_JSON_FILE", "CLDEBUGINFO100_GRAMMAR_JSON_FILE", - "SHDEBUGINFO100_GRAMMAR_JSON_FILE", "TEST_COPTS", "base_test", "generate_core_tables", @@ -13,7 +12,6 @@ load( "generate_opencl_tables", "generate_vendor_tables", "link_test", - "lint_test", "opt_test", "reduce_test", "util_test", @@ -61,16 +59,12 @@ generate_vendor_tables("debuginfo") generate_vendor_tables("opencl.debuginfo.100", "CLDEBUG100_") -generate_vendor_tables("nonsemantic.shader.debuginfo.100", "SHDEBUG100_") - generate_vendor_tables("nonsemantic.clspvreflection") generate_extinst_lang_headers("DebugInfo", DEBUGINFO_GRAMMAR_JSON_FILE) generate_extinst_lang_headers("OpenCLDebugInfo100", CLDEBUGINFO100_GRAMMAR_JSON_FILE) -generate_extinst_lang_headers("NonSemanticShaderDebugInfo100", SHDEBUGINFO100_GRAMMAR_JSON_FILE) - py_binary( name = "generate_registry_tables", srcs = ["utils/generate_registry_tables.py"], @@ -81,7 +75,6 @@ genrule( srcs = ["@spirv_headers//:spirv_xml_registry"], outs = ["generators.inc"], cmd = "$(location generate_registry_tables) --xml=$(location @spirv_headers//:spirv_xml_registry) --generator-output=$(location generators.inc)", - cmd_bat = "$(location //:generate_registry_tables) --xml=$(location @spirv_headers//:spirv_xml_registry) --generator-output=$(location generators.inc)", tools = [":generate_registry_tables"], ) @@ -94,8 +87,7 @@ genrule( name = "gen_build_version", srcs = ["CHANGES"], outs = ["build-version.inc"], - cmd = "SOURCE_DATE_EPOCH=0 $(location update_build_version) $(location CHANGES) $(location build-version.inc)", - cmd_bat = "set SOURCE_DATE_EPOCH=0 && $(location //:update_build_version) $(location CHANGES) $(location build-version.inc)", + cmd = "SOURCE_DATE_EPOCH=0 $(location update_build_version) $$(dirname $(location CHANGES)) $(location build-version.inc)", tools = [":update_build_version"], ) @@ -109,14 +101,12 @@ cc_library( ":gen_enum_string_mapping", ":gen_extinst_lang_headers_DebugInfo", ":gen_extinst_lang_headers_OpenCLDebugInfo100", - ":gen_extinst_lang_headers_NonSemanticShaderDebugInfo100", ":gen_glsl_tables_unified1", ":gen_opencl_tables_unified1", ":gen_registry_tables", ":gen_vendor_tables_debuginfo", ":gen_vendor_tables_nonsemantic_clspvreflection", ":gen_vendor_tables_opencl_debuginfo_100", - ":gen_vendor_tables_nonsemantic_shader_debuginfo_100", ":gen_vendor_tables_spv_amd_gcn_shader", ":gen_vendor_tables_spv_amd_shader_ballot", ":gen_vendor_tables_spv_amd_shader_explicit_vertex_parameter", @@ -235,19 +225,6 @@ cc_library( ], ) -cc_library( - name = "spirv_tools_lint", - srcs = glob(["source/lint/*.cpp", "source/lint/*.h"]), - hdrs = ["include/spirv-tools/linter.hpp"], - copts = COMMON_COPTS, - linkstatic = 1, - visibility = ["//visibility:public"], - deps = [ - ":spirv_tools", - ":spirv_tools_opt", - ], -) - cc_library( name = "tools_util", srcs = glob(["tools/util/*.cpp"]), @@ -345,21 +322,6 @@ cc_binary( ], ) -cc_binary( - name = "spirv-lint", - srcs = [ - "tools/io.h", - "tools/lint/lint.cpp", - ], - copts = COMMON_COPTS, - visibility = ["//visibility:public"], - deps = [ - ":spirv_tools", - ":spirv_tools_lint", - ":tools_util", - ], -) - cc_binary( name = "spirv-cfg", srcs = [ @@ -503,13 +465,6 @@ base_test( ["test/link/*.cpp"], )] -[lint_test( - name = f[10:-4], # strip test/lint/, .cpp - srcs = [f], -) for f in glob( - ["test/lint/*.cpp"], -)] - [opt_test( name = f[9:-4], # strip test/opt/, .cpp srcs = [f], diff --git a/BUILD.gn b/BUILD.gn index f69643ea..d6457eb9 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -50,7 +50,8 @@ import("//third_party/vk-gl-cts/vk_gl_cts.gni") config("deqp_spirvtool_config") { cflags_cc = deqp_common_cflags_cc cflags_cc += [ - "-ftemplate-depth=1024" + "-ftemplate-depth=1024", + "-Wno-switch" ] defines = deqp_common_defines defines += [ @@ -149,4 +150,4 @@ ohos_static_library("libdeqp_spirvtools") { deps = [ ":deqp_spirvtool_source" ] part_name = "graphic_standard" subsystem_name = "graphic" -} \ No newline at end of file +} diff --git a/CHANGES b/CHANGES index f5e91cb2..2b2da982 100644 --- a/CHANGES +++ b/CHANGES @@ -1,141 +1,5 @@ Revision history for SPIRV-Tools -v2022.3-dev 2022-05-31 - - General - - Add SPV_KHR_fragment_shader_barycentric support (#4805) - - Add support for SPV_KHR_subgroup_rotate (#4786) - - Optimizer - - Fold multiply and subtraction into FMA with negation (#4808) - - Add more folding for composite instructions (#4802) - - spirv-opt: add pass for interface variable scalar replacement (#4779) - - Don't try to unroll loop with step count 0. (#4769) - - Validator - - spirv-val: Add PerVertexKHR (#4807) - - spirv-opt : Add FixFuncCallArgumentsPass (#4775) - - spirv-val: Add CullMaskKHR support (#4792) - - Linker - - linker: Recalculate interface variables (#4784) - -v2022.2 2022-04-07 - - General - - Add OpModuleProcessed to debug opcode (#4694) - - Optimizer - - Complete handling of RayQueryKHR type (#4690) - - Have scalar replacement use undef instead of null (#4691) - - Optimize Instruction::Instruction (#4705) - - Handle propagation of arrays with decorations (#4717) - - spirv-opt: Add OpExecutionModeId support (#4719) - - Optimize Type::HashValue (#4707) - - Optimize DefUseManager allocations (#4709) - - Add pass to remove DontInline function control (#4747) - - Better handling of 0xFFFFFFFF when folding vector shuffle (#4743) - - Reset the id bound on the module in compact ids (#4744) - - spirv-opt: (WIP) Eliminate Dead Input Component Pass (#4720) - - Support SPV_KHR_uniform_group_instructions (#4734) - - Handle shaders without execution model in spread-volatile-semantics (#4766) - - Validator - - Fix handling of Nontemporal image operand (#4692) - - [spirv-val] Allow 0 Component Count for DebugTypeArray for Shader (#4706) - - spirv-val: Validate DebugTypeMatrix (#4732) - - spirv-val: Label Vulkan VUID 04734 (#4739) - - spirv-val: Label VUID 06491 (#4745) - - spirv-val: Disallow array of push constants (#4742) - - spirv-val: Label Vulkan RuntimeArray VUID (#4749) - - spirv-val: Add Vulkan Image VUID 06214 (#4750) - - spirv-val: Add Vulkan Dref not allowed 3D dim VUID (#4751) - - spirv-val: Label and add test for PSB Aligned (#4756) - - spirv-val: Add Vulkan 32-bit bit op Base (#4758) - - spirv-val: Add more Vulkan VUID labels (#4764) - - Diff - - Introduce spirv-diff (#4611) - - Stabilize the output of spirv-diff (#4698) - - spirv-diff: Handle OpSpecConstant array sizes (#4700) - - spirv-diff: Match OpSpecConstantComposite correctly (#4704) - - spirv-diff: Use GetSingleWord*Operand (#4768) - - spirv-diff: Basic support for OpTypeForwardPointer (#4761) - - spirv-diff: Fix OpTypeFunction matching w.r.t operand count (#4771) - -v2022.1 2022-01-26 - - General - - Add SPIR-V 1.6 support to wasm build (#4674) - - Improvements to disassembly within PassManager (#4677) - - Basic support for SPIR-V 1.6 (#4663) - - reflect debug (#4662) - - Fix endianness of string literals (#4622) - - Optimizer - - spirv-opt: add pass to Spread Volatile semantics (#4667) - - Fix constant propagation and folding of FClamp instructions (#4651) - - Manually fold floating point division by zero (#4637) - - Allow ADCE to remove dead inputs (#4629) - - Linker - - Linker improvements (#4679) - * test/linker: Code factorisation and small tweaks - * linker: Do not fail when going over limits - - Validator - - val: interface struct with builtins must be Block (#4665) - - Fuzzer - - Avoid id bound errors during opt fuzzing (#4658) - - Avoid uninitialised read when parsing hex float (#4646) - -v2021.4 2021-11-11 - - General - - Add a WebAssembly build (#3752) - - Make cxx exceptions controllable (#4591) - - Validator - - Improve decoration validation (#4490) - - Optimizer - - Add spirv-opt pass to replace descriptor accesses based on variable indices (#4574) - - Do not fold snegate feeding sdiv (#4600) - - Handle overflowing id in merge return (#4606) - - Fuzzer - - Add libFuzzer target for spirv-fuzz (#4434) - - Linter - -v2021.3 2021-08-24 - - General - - Initial support for SPV_KHR_integer_dot_product (#4327) - - Add non-semantic vulkan extended instruction set (#4362) - - Add common enum for debug info instructions from either opencl or vulkan (#4377) - - Validator - - Add validation for SPV_EXT_shader_atomic_float16_add (#4325) - - Disallow loading a runtime-sized array (#4473) - - spirv-val: Validate vulkan debug info similarly to opencl debug info (#4466) - - Optimizer - - spirv-opt: support SPV_EXT_shader_image_int64 (#4379) - - spirv-opt: Add dataflow analysis framework (#4402) - - Add control dependence analysis to opt (#4380) - - Add spirv-opt convert-to-sampled-image pass (#4340) - - spirv-opt: Add handling of vulkan debug info to DebugInfoManager (#4423) - - Fuzz - - spirv-fuzz: support AtomicLoad (#4330) - - spirv-fuzz: Support AtomicStore (#4440) - - spirv-fuzz: TransformationWrapVectorSynonym that rewrites scalar operations using vectors (#4376) - - spirv-fuzz: Add minimal SPIR-V example to test shaders (#4415) - - spirv-fuzz: support building using gn (#4365) - - Linter - - Add new target for spirv-lint (#4446) - - spirv-lint: add basic CLI argument handling (#4478) - - Add divergence analysis to linter (#4465) - -v2021.2 2021-06-18 - - General - - Support SPV_KHR_subgroup_uniform_control_flow (#4318) - - Support Intel extensions for fixed point and hls-float (#4321) - - Fix crash when optimizing shaders with DebugPrintf (#4280) - - - Validator - - Support Vulkan Storage Class for Execution Model (#4212) - - - Optimizer - - Handle SPV_KHR_vulkan_memory_model in dead-code elimination (#4320) - - Support folding OpBitcast with numeric constants (#4247) - - - Fuzz - - Add tests for MaybeGet* functions in fuzzerutil (#4284) - - Fix OutlineFunction in presence of unreachable blocks (#4308) - - Fix def-use update in PermutePhiOperands (#4309) - - Swap positions of two functions in a module (#4236) - v2021.1 2021-04-19 - General - Support SPV_KHR_linkonce_odr, SPV_KHR_expect_assume (#4161) @@ -151,6 +15,10 @@ v2021.1 2021-04-19 - Do not add too many dead blocks (#4217) - Add WGSL compatibility flag to context (#4193) - Add persistent state to the fuzzer (#4137) + - Debug Info + - Instrumentation + - Linker + - Reduce v2020.7 2021-02-16 - General diff --git a/CMakeLists.txt b/CMakeLists.txt index 76b87d8c..55f84e6d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,7 +33,6 @@ include(GNUInstallDirs) set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_CXX_STANDARD 11) -option(ENABLE_RTTI "Enables RTTI" OFF) option(SPIRV_ALLOW_TIMERS "Allow timers via clock_gettime on supported platforms" ON) if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") @@ -49,8 +48,6 @@ elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") add_definitions(-DSPIRV_MAC) elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "iOS") add_definitions(-DSPIRV_IOS) -elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "tvOS") - add_definitions(-DSPIRV_TVOS) elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Android") add_definitions(-DSPIRV_ANDROID) set(SPIRV_TIMER_ENABLED ${SPIRV_ALLOW_TIMERS}) @@ -84,10 +81,6 @@ endif(SPIRV_BUILD_COMPRESSION) option(SPIRV_BUILD_FUZZER "Build spirv-fuzz" OFF) -set(SPIRV_LIB_FUZZING_ENGINE_LINK_OPTIONS "" CACHE STRING "Used by OSS-Fuzz to control, via link options, which fuzzing engine should be used") - -option(SPIRV_BUILD_LIBFUZZER_TARGETS "Build libFuzzer targets" OFF) - option(SPIRV_WERROR "Enable error on warning" ON) if(("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR (("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") AND (NOT CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC"))) set(COMPILER_IS_LIKE_GNU TRUE) @@ -116,7 +109,7 @@ if(${COMPILER_IS_LIKE_GNU}) set(SPIRV_WARNINGS ${SPIRV_WARNINGS} -Werror) endif() elseif(MSVC) - set(SPIRV_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS /wd4800 /wd4819) + set(SPIRV_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS /wd4800) if(${SPIRV_WERROR}) set(SPIRV_WARNINGS ${SPIRV_WARNINGS} /WX) @@ -164,7 +157,6 @@ endif() # Note this target provides no API stability guarantees. # # Ideally, all of these will go away - see https://github.com/KhronosGroup/SPIRV-Tools/issues/3909. -option(ENABLE_EXCEPTIONS_ON_MSVC "Build SPIRV-TOOLS with c++ exceptions enabled in MSVC" ON) option(SPIRV_TOOLS_BUILD_STATIC "Build ${SPIRV_TOOLS}-static target. ${SPIRV_TOOLS} will alias to ${SPIRV_TOOLS}-static or ${SPIRV_TOOLS}-shared based on BUILD_SHARED_LIBS" ON) if(SPIRV_TOOLS_BUILD_STATIC) set(SPIRV_TOOLS_FULL_VISIBILITY ${SPIRV_TOOLS}-static) @@ -184,14 +176,11 @@ function(spvtools_default_compile_options TARGET) target_compile_options(${TARGET} PRIVATE ${SPIRV_WARNINGS}) if (${COMPILER_IS_LIKE_GNU}) - target_compile_options(${TARGET} PRIVATE -std=c++11 -fno-exceptions) + target_compile_options(${TARGET} PRIVATE + -std=c++11 -fno-exceptions -fno-rtti) target_compile_options(${TARGET} PRIVATE -Wall -Wextra -Wno-long-long -Wshadow -Wundef -Wconversion -Wno-sign-conversion) - - if(NOT ENABLE_RTTI) - add_compile_options(-fno-rtti) - endif() # For good call stacks in profiles, keep the frame pointers. if(NOT "${SPIRV_PERF}" STREQUAL "") target_compile_options(${TARGET} PRIVATE -fno-omit-frame-pointer) @@ -216,9 +205,7 @@ function(spvtools_default_compile_options TARGET) if (MSVC) # Specify /EHs for exception handling. This makes using SPIRV-Tools as # dependencies in other projects easier. - if(ENABLE_EXCEPTIONS_ON_MSVC) - target_compile_options(${TARGET} PRIVATE /EHs) - endif() + target_compile_options(${TARGET} PRIVATE /EHs) endif() # For MinGW cross compile, statically link to the C++ runtime. @@ -299,7 +286,7 @@ endif() # Turn off if they take too long. option(SPIRV_CHECK_CONTEXT "In a debug build, check if the IR context is in a valid state." ON) if (${SPIRV_CHECK_CONTEXT}) - add_compile_options($<$:-DSPIRV_CHECK_CONTEXT>) + add_definitions(-DSPIRV_CHECK_CONTEXT) endif() # Precompiled header macro. Parameters are source file list and filename for pch cpp file. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1eb8b689..b46ae31e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -98,6 +98,13 @@ should pay particular attention to: scenarios? The respective SPIR-V dialects are slightly different. * Changes are made to a container while iterating through it. You have to be careful that iterators are not invalidated or that elements are not skipped. +* C++11 and VS2013. We generally assume that we have a C++11 compliant + compiler. However, on Windows, we still support Visual Studio 2013, which is + not fully C++11 compliant. See + [here](https://msdn.microsoft.com/en-us/library/hh567368.aspx). In + particular, note that it does not provide default move-constructors or + move-assignments for classes. In general, r-value references do not work the + way you might assume they do. * For SPIR-V transforms: The module is changed, but the analyses are not updated. For example, a new instruction is added, but the def-use manager is not updated. Later on, it is possible that the def-use manager will be used, diff --git a/DEPS b/DEPS index 808ef6c9..65aebf5a 100644 --- a/DEPS +++ b/DEPS @@ -3,10 +3,10 @@ use_relative_paths = True vars = { 'github': 'https://github.com', - 'effcee_revision': 'ddf5e2bb92957dc8a12c5392f8495333d6844133', - 'googletest_revision': '548b13dc3c02b93f60eeff9a0cc6e11c1ea722ca', - 're2_revision': '5723bb8950318135ed9cf4fc76bed988a087f536', - 'spirv_headers_revision': '5a121866927a16ab9d49bed4788b532c7fcea766', + 'effcee_revision': '2ec8f8738118cc483b67c04a759fee53496c5659', + 'googletest_revision': 'b7d472f1225c5a64943821d8483fecb469d3f382', + 're2_revision': 'f8e389f3acdc2517562924239e2a188037393683', + 'spirv_headers_revision': 'bcf55210f13a4fa3c3d0963b509ff1070e434c79', } deps = { diff --git a/README.OpenSource b/README.OpenSource index ddd46b33..bbf12a12 100644 --- a/README.OpenSource +++ b/README.OpenSource @@ -3,7 +3,7 @@ "Name": "spirv-tools", "License": "Apache-2.0", "License File": "LICENSE", - "Version Number": "sdk-1.3.216.0", + "Version Number": "v2021.1", "Owner": "zhangleiyu1@huawei.com", "Upstream URL": "https://github.com/KhronosGroup/SPIRV-Tools.git", "Description": "The SPIR-V Tools project provides an API and commands for processing SPIR-V modules." diff --git a/README.md b/README.md index e951e37f..3637305b 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ headers, and XML registry. ## Downloads +[![Build status](https://ci.appveyor.com/api/projects/status/gpue87cesrx3pi0d/branch/master?svg=true)](https://ci.appveyor.com/project/Khronoswebmaster/spirv-tools/branch/master) Linux[![Linux Build Status](https://storage.googleapis.com/spirv-tools/badges/build_status_linux_clang_release.svg)](https://storage.googleapis.com/spirv-tools/badges/build_link_linux_clang_release.html) MacOS[![MacOS Build Status](https://storage.googleapis.com/spirv-tools/badges/build_status_macos_clang_release.svg)](https://storage.googleapis.com/spirv-tools/badges/build_link_macos_clang_release.html) Windows[![Windows Build Status](https://storage.googleapis.com/spirv-tools/badges/build_status_windows_release.svg)](https://storage.googleapis.com/spirv-tools/badges/build_link_windows_vs2017_release.html) @@ -44,20 +45,6 @@ following versions are ordered from oldest to newest: Use the `--version` option on each command line tool to see the software version. An API call reports the software version as a C-style string. -## Releases - -Some versions of SPIRV-Tools are tagged as stable releases (see -[tags](https://github.com/KhronosGroup/SPIRV-Tools/tags) on github). -These versions undergo extra testing. -Releases are not directly related to releases (or versions) of -[SPIRV-Headers][spirv-headers]. -Releases of SPIRV-Tools are tested against the version of SPIRV-Headers listed -in the [DEPS](DEPS) file. -The release generally uses the most recent compatible version of SPIRV-Headers -available at the time of release. -No version of SPIRV-Headers other than the one listed in the DEPS file is -guaranteed to work with the SPIRV-Tools release. - ## Supported features ### Assembler, binary parser, and disassembler @@ -212,24 +199,6 @@ issue](https://github.com/KhronosGroup/SPIRV-Tools/issues]) with "Fuzzer:" as the start of its title. -### Diff - -*Note:* The diff tool is still under development. - -The diff tool takes two SPIR-V files, either in binary or text format and -produces a diff-style comparison between the two. The instructions between the -src and dst modules are matched as best as the tool can, and output is produced -(in src id-space) that shows which instructions are removed in src, added in dst -or modified between them. The order of instructions are not retained. - -Matching instructions between two SPIR-V modules is not trivial, and thus a -number of heuristics are applied in this tool. In particular, without debug -information, match functions is nontrivial as they can be reordered. As such, -this tool is primarily useful to produce the diff of two SPIR-V modules derived -from the same source, for example before and after a modification to the shader, -before and after a transformation, or SPIR-V produced from different tools. - - ### Extras * [Utility filters](#utility-filters) @@ -273,34 +242,6 @@ Contributions via merge request are welcome. Changes should: We intend to maintain a linear history on the GitHub `master` branch. -### Getting the source - -Example of getting sources, assuming SPIRV-Tools is configured as a standalone project: - - git clone https://github.com/KhronosGroup/SPIRV-Tools.git spirv-tools - cd spirv-tools - - # Check out sources for dependencies, at versions known to work together, - # as listed in the DEPS file. - python3 utils/git-sync-deps - -For some kinds of development, you may need the latest sources from the third-party projects: - - git clone https://github.com/KhronosGroup/SPIRV-Headers.git spirv-tools/external/spirv-headers - git clone https://github.com/google/googletest.git spirv-tools/external/googletest - git clone https://github.com/google/effcee.git spirv-tools/external/effcee - git clone https://github.com/google/re2.git spirv-tools/external/re2 - -#### Dependency on Effcee - -Some tests depend on the [Effcee][effcee] library for stateful matching. -Effcee itself depends on [RE2][re2]. - -* If SPIRV-Tools is configured as part of a larger project that already uses - Effcee, then that project should include Effcee before SPIRV-Tools. -* Otherwise, SPIRV-Tools expects Effcee sources to appear in `external/effcee` - and RE2 sources to appear in `external/re2`. - ### Source code organization * `example`: demo code of using SPIRV-Tools APIs @@ -319,6 +260,14 @@ Effcee itself depends on [RE2][re2]. * `test/`: Tests, using the [googletest][googletest] framework * `tools/`: Command line executables +Example of getting sources, assuming SPIRV-Tools is configured as a standalone project: + + git clone https://github.com/KhronosGroup/SPIRV-Tools.git spirv-tools + git clone https://github.com/KhronosGroup/SPIRV-Headers.git spirv-tools/external/spirv-headers + git clone https://github.com/google/googletest.git spirv-tools/external/googletest + git clone https://github.com/google/effcee.git spirv-tools/external/effcee + git clone https://github.com/google/re2.git spirv-tools/external/re2 + ### Tests The project contains a number of tests, used to drive development @@ -332,12 +281,46 @@ tests: `googletest` source into the `/external/googletest` directory before configuring and building the project. +*Note*: You must use a version of googletest that includes +[a fix][googletest-pull-612] for [googletest issue 610][googletest-issue-610]. +The fix is included on the googletest master branch any time after 2015-11-10. +In particular, googletest must be newer than version 1.7.0. + +### Dependency on Effcee + +Some tests depend on the [Effcee][effcee] library for stateful matching. +Effcee itself depends on [RE2][re2]. + +* If SPIRV-Tools is configured as part of a larger project that already uses + Effcee, then that project should include Effcee before SPIRV-Tools. +* Otherwise, SPIRV-Tools expects Effcee sources to appear in `external/effcee` + and RE2 sources to appear in `external/re2`. + + ## Build -*Note*: Prebuilt binaries are available from the [downloads](docs/downloads.md) page. +Instead of building manually, you can also download the binaries for your +platform directly from the [master-tot release][master-tot-release] on GitHub. +Those binaries are automatically uploaded by the buildbots after successful +testing and they always reflect the current top of the tree of the master +branch. -First [get the sources](#getting-the-source). -Then build using CMake, Bazel, Android ndk-build, or the Emscripten SDK. +In order to build the code, you first need to sync the external repositories +that it depends on. Assume that `` is the root directory of the +checked out code: + +```sh +cd +git clone https://github.com/KhronosGroup/SPIRV-Headers.git external/spirv-headers +git clone https://github.com/google/effcee.git external/effcee +git clone https://github.com/google/re2.git external/re2 +git clone https://github.com/google/googletest.git external/googletest # optional + +``` + +*Note*: +The script `utils/git-sync-deps` can be used to checkout and/or update the +contents of the repos under `external/` instead of manually maintaining them. ### Build using CMake You can build the project using [CMake][cmake]: @@ -365,7 +348,7 @@ option, like so: ```sh # In (the SPIRV-Tools repo root): -git clone --depth=1 --branch v3.13.0.1 https://github.com/protocolbuffers/protobuf external/protobuf +git clone --depth=1 --branch v3.13.0 https://github.com/protocolbuffers/protobuf external/protobuf # In your build directory: cmake [-G ] -DSPIRV_BUILD_FUZZER=ON @@ -382,30 +365,6 @@ You can also use [Bazel](https://bazel.build/) to build the project. cd bazel build :all ``` -### Build a node.js package using Emscripten - -The SPIRV-Tools core library can be built to a WebAssembly [node.js](https://nodejs.org) -module. The resulting `SpirvTools` WebAssembly module only exports methods to -assemble and disassemble SPIR-V modules. - -First, make sure you have the [Emscripten SDK](https://emscripten.org). -Then: - -```sh -cd -./source/wasm/build.sh -``` - -The resulting node package, with JavaScript and TypeScript bindings, is -written to `/out/web`. - -Note: This builds the package locally. It does *not* publish it to [npm](https://npmjs.org). - -To test the result: - -```sh -node ./test/wasm/test.js -``` ### Tools you'll need @@ -417,19 +376,17 @@ targets, you need to install CMake Version 2.8.12 or later. - [Python 3](http://www.python.org/): for utility scripts and running the test suite. - [Bazel](https://bazel.build/) (optional): if building the source with Bazel, -you need to install Bazel Version 5.0.0 on your machine. Other versions may +you need to install Bazel Version 0.29.1 on your machine. Other versions may also work, but are not verified. -- [Emscripten SDK](https://emscripten.org) (optional): if building the - WebAssembly module. SPIRV-Tools is regularly tested with the following compilers: On Linux -- GCC version 9.3 -- Clang version 10.0 +- GCC version 4.8.5 +- Clang version 3.8 On MacOS -- AppleClang 11.0 +- AppleClang 10.0 On Windows - Visual Studio 2015 @@ -464,7 +421,7 @@ via setting `SPIRV_TOOLS_EXTRA_DEFINITIONS`. For example, by setting it to `/D_ITERATOR_DEBUG_LEVEL=0` on Windows, you can disable checked iterators and iterator debugging. -### Android ndk-build +### Android SPIR-V Tools supports building static libraries `libSPIRV-Tools.a` and `libSPIRV-Tools-opt.a` for Android: @@ -485,12 +442,11 @@ $ANDROID_NDK/ndk-build -C ../android_test \ ``` ### Updating DEPS - -Occasionally the entries in [DEPS](DEPS) will need to be updated. This is done on -demand when there is a request to do this, often due to downstream breakages. -To update `DEPS`, run `utils/roll_deps.sh` and confirm that tests pass. -The script requires Chromium's -[`depot_tools`](https://chromium.googlesource.com/chromium/tools/depot_tools). +Occasionally the entries in DEPS will need to be updated. This is done on demand +when there is a request to do this, often due to downstream breakages. There is +a script `utils/roll_deps.sh` provided, which will generate a patch with the +updated DEPS values. This will still need to be tested in your checkout to +confirm that there are no integration issues that need to be resolved. ## Library @@ -642,15 +598,6 @@ This is experimental. * `spirv-cfg` - the control flow graph dumper * `/tools/cfg` -### Diff tool - -*Warning:* This functionality is under development, and is incomplete. - -The diff tool produces a diff-style comparison between two SPIR-V modules. - -* `spirv-diff` - the standalone diff tool - * ``/tools/diff` - ### Utility filters * `spirv-lesspipe.sh` - Automatically disassembles `.spv` binary files for the @@ -696,32 +643,8 @@ The diff tool produces a diff-style comparison between two SPIR-V modules. ### Tests -Tests are only built when googletest is found. - -#### Running test with CMake - -Use `ctest -j ` to run all the tests. To run tests using all threads: -```shell -ctest -j$(nproc) -``` - -To run a single test target, use `ctest [-j ] -R `. For example, -you can run all `opt` tests with: -```shell -ctest -R 'spirv-tools-test_opt' -``` - -#### Running test with Bazel - -Use `bazel test :all` to run all tests. This will run tests in parallel by default. - -To run a single test target, specify `:my_test_target` instead of `:all`. Test target -names get printed when you run `bazel test :all`. For example, you can run -`opt_def_use_test` with: -```shell -bazel test :opt_def_use_test -``` - +Tests are only built when googletest is found. Use `ctest` to run all the +tests. ## Future Work @@ -782,3 +705,4 @@ limitations under the License. [CMake]: https://cmake.org/ [cpp-style-guide]: https://google.github.io/styleguide/cppguide.html [clang-sanitizers]: http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation +[master-tot-release]: https://github.com/KhronosGroup/SPIRV-Tools/releases/tag/master-tot diff --git a/build_defs.bzl b/build_defs.bzl index ef9a8294..30af3bd6 100644 --- a/build_defs.bzl +++ b/build_defs.bzl @@ -41,7 +41,6 @@ TEST_COPTS = COMMON_COPTS + select({ DEBUGINFO_GRAMMAR_JSON_FILE = "@spirv_headers//:spirv_ext_inst_debuginfo_grammar_unified1" CLDEBUGINFO100_GRAMMAR_JSON_FILE = "@spirv_headers//:spirv_ext_inst_opencl_debuginfo_100_grammar_unified1" -SHDEBUGINFO100_GRAMMAR_JSON_FILE = "@spirv_headers//:spirv_ext_inst_nonsemantic_shader_debuginfo_100_grammar_unified1" def generate_core_tables(version = None): if not version: @@ -68,14 +67,6 @@ def generate_core_tables(version = None): "--core-insts-output=$(location {3}) " + "--operand-kinds-output=$(location {4})" ).format(*fmtargs), - cmd_bat = ( - "$(location :generate_grammar_tables) " + - "--spirv-core-grammar=$(location {0}) " + - "--extinst-debuginfo-grammar=$(location {1}) " + - "--extinst-cldebuginfo100-grammar=$(location {2}) " + - "--core-insts-output=$(location {3}) " + - "--operand-kinds-output=$(location {4})" - ).format(*fmtargs), tools = [":generate_grammar_tables"], visibility = ["//visibility:private"], ) @@ -105,14 +96,6 @@ def generate_enum_string_mapping(version = None): "--extension-enum-output=$(location {3}) " + "--enum-string-mapping-output=$(location {4})" ).format(*fmtargs), - cmd_bat = ( - "$(location :generate_grammar_tables) " + - "--spirv-core-grammar=$(location {0}) " + - "--extinst-debuginfo-grammar=$(location {1}) " + - "--extinst-cldebuginfo100-grammar=$(location {2}) " + - "--extension-enum-output=$(location {3}) " + - "--enum-string-mapping-output=$(location {4})" - ).format(*fmtargs), tools = [":generate_grammar_tables"], visibility = ["//visibility:private"], ) @@ -134,11 +117,6 @@ def generate_opencl_tables(version = None): "--extinst-opencl-grammar=$(location {0}) " + "--opencl-insts-output=$(location {1})" ).format(*fmtargs), - cmd_bat = ( - "$(location :generate_grammar_tables) " + - "--extinst-opencl-grammar=$(location {0}) " + - "--opencl-insts-output=$(location {1})" - ).format(*fmtargs), tools = [":generate_grammar_tables"], visibility = ["//visibility:private"], ) @@ -160,11 +138,6 @@ def generate_glsl_tables(version = None): "--extinst-glsl-grammar=$(location {0}) " + "--glsl-insts-output=$(location {1})" ).format(*fmtargs), - cmd_bat = ( - "$(location :generate_grammar_tables) " + - "--extinst-glsl-grammar=$(location {0}) " + - "--glsl-insts-output=$(location {1})" - ).format(*fmtargs), tools = [":generate_grammar_tables"], visibility = ["//visibility:private"], ) @@ -187,12 +160,6 @@ def generate_vendor_tables(extension, operand_kind_prefix = ""): "--vendor-insts-output=$(location {1}) " + "--vendor-operand-kind-prefix={2}" ).format(*fmtargs), - cmd_bat = ( - "$(location :generate_grammar_tables) " + - "--extinst-vendor-grammar=$(location {0}) " + - "--vendor-insts-output=$(location {1}) " + - "--vendor-operand-kind-prefix={2}" - ).format(*fmtargs), tools = [":generate_grammar_tables"], visibility = ["//visibility:private"], ) @@ -211,11 +178,6 @@ def generate_extinst_lang_headers(name, grammar = None): "--extinst-grammar=$< " + "--extinst-output-path=$(location {0})" ).format(*fmtargs), - cmd_bat = ( - "$(location :generate_language_headers) " + - "--extinst-grammar=$< " + - "--extinst-output-path=$(location {0})" - ).format(*fmtargs), tools = [":generate_language_headers"], visibility = ["//visibility:private"], ) @@ -239,23 +201,6 @@ def base_test(name, srcs, deps = []): ] + deps, ) -def lint_test(name, srcs, deps = []): - if name[-5:] != "_test": - name = name + "_test" - native.cc_test( - name = "lint_" + name, - srcs = srcs, - compatible_with = [], - copts = TEST_COPTS, - size = "large", - deps = [ - ":spirv_tools_lint", - "@com_google_googletest//:gtest_main", - "@com_google_googletest//:gtest", - "@com_google_effcee//:effcee", - ] + deps, - ) - def link_test(name, srcs, deps = []): if name[-5:] != "_test": name = name + "_test" diff --git a/cmake/Config.cmake.in b/cmake/Config.cmake.in deleted file mode 100644 index 38bbde7b..00000000 --- a/cmake/Config.cmake.in +++ /dev/null @@ -1,4 +0,0 @@ -@PACKAGE_INIT@ - -include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake") -check_required_components("@PROJECT_NAME@") diff --git a/include/spirv-tools/instrument.hpp b/include/spirv-tools/instrument.hpp index a19491fd..05a0472e 100644 --- a/include/spirv-tools/instrument.hpp +++ b/include/spirv-tools/instrument.hpp @@ -178,7 +178,6 @@ static const int kInstErrorBuffOOBUniform = 4; static const int kInstErrorBuffOOBStorage = 5; static const int kInstErrorBuffOOBUniformTexel = 6; static const int kInstErrorBuffOOBStorageTexel = 7; -static const int kInstErrorMax = kInstErrorBuffOOBStorageTexel; // Direct Input Buffer Offsets // diff --git a/include/spirv-tools/libspirv.h b/include/spirv-tools/libspirv.h index 1cd40cc8..344c3c01 100644 --- a/include/spirv-tools/libspirv.h +++ b/include/spirv-tools/libspirv.h @@ -113,9 +113,6 @@ typedef enum spv_endianness_t { // Sometimes we also need to be able to express the fact that an operand // is a member of an optional tuple of values. In that case the first member // would be optional, and the subsequent members would be required. -// -// NOTE: Although we don't promise binary compatibility, as a courtesy, please -// add new enum values at the end. typedef enum spv_operand_type_t { // A sentinel value. SPV_OPERAND_TYPE_NONE = 0, @@ -170,8 +167,12 @@ typedef enum spv_operand_type_t { SPV_OPERAND_TYPE_KERNEL_ENQ_FLAGS, // SPIR-V Sec 3.29 SPV_OPERAND_TYPE_KERNEL_PROFILING_INFO, // SPIR-V Sec 3.30 SPV_OPERAND_TYPE_CAPABILITY, // SPIR-V Sec 3.31 - - // NOTE: New concrete enum values should be added at the end. + SPV_OPERAND_TYPE_RAY_FLAGS, // SPIR-V Sec 3.RF + SPV_OPERAND_TYPE_RAY_QUERY_INTERSECTION, // SPIR-V Sec 3.RQIntersection + SPV_OPERAND_TYPE_RAY_QUERY_COMMITTED_INTERSECTION_TYPE, // SPIR-V Sec + // 3.RQCommitted + SPV_OPERAND_TYPE_RAY_QUERY_CANDIDATE_INTERSECTION_TYPE, // SPIR-V Sec + // 3.RQCandidate // Set 5: Operands that are a single word bitmask. // Sometimes a set bit indicates the instruction requires still more operands. @@ -183,10 +184,7 @@ typedef enum spv_operand_type_t { SPV_OPERAND_TYPE_MEMORY_ACCESS, // SPIR-V Sec 3.26 SPV_OPERAND_TYPE_FRAGMENT_SHADING_RATE, // SPIR-V Sec 3.FSR -// NOTE: New concrete enum values should be added at the end. - -// The "optional" and "variable" operand types are only used internally by -// the assembler and the binary parser. +// The remaining operand types are only used internally by the assembler. // There are two categories: // Optional : expands to 0 or 1 operand, like ? in regular expressions. // Variable : expands to 0, 1 or many operands or pairs of operands. @@ -271,14 +269,6 @@ typedef enum spv_operand_type_t { // A value enum from https://github.com/KhronosGroup/SPIRV-Headers/pull/177 SPV_OPERAND_TYPE_OVERFLOW_MODES, - // Concrete operand types for the provisional Vulkan ray tracing feature. - SPV_OPERAND_TYPE_RAY_FLAGS, // SPIR-V Sec 3.RF - SPV_OPERAND_TYPE_RAY_QUERY_INTERSECTION, // SPIR-V Sec 3.RQIntersection - SPV_OPERAND_TYPE_RAY_QUERY_COMMITTED_INTERSECTION_TYPE, // SPIR-V Sec - // 3.RQCommitted - SPV_OPERAND_TYPE_RAY_QUERY_CANDIDATE_INTERSECTION_TYPE, // SPIR-V Sec - // 3.RQCandidate - // Concrete operand types for integer dot product. // Packed vector format SPV_OPERAND_TYPE_PACKED_VECTOR_FORMAT, // SPIR-V Sec 3.x @@ -309,7 +299,6 @@ typedef enum spv_ext_inst_type_t { SPV_EXT_INST_TYPE_DEBUGINFO, SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100, SPV_EXT_INST_TYPE_NONSEMANTIC_CLSPVREFLECTION, - SPV_EXT_INST_TYPE_NONSEMANTIC_VULKAN_DEBUGINFO_100, // Multiple distinct extended instruction set types could return this // value, if they are prefixed with NonSemantic. and are otherwise diff --git a/include/spirv-tools/libspirv.hpp b/include/spirv-tools/libspirv.hpp index 8dfb46b7..0c31a182 100644 --- a/include/spirv-tools/libspirv.hpp +++ b/include/spirv-tools/libspirv.hpp @@ -115,12 +115,6 @@ class ValidatorOptions { spvValidatorOptionsSetSkipBlockLayout(options_, val); } - // Enables LocalSizeId decorations where the environment would not otherwise - // allow them. - void SetAllowLocalSizeId(bool val) { - spvValidatorOptionsSetAllowLocalSizeId(options_, val); - } - // Records whether or not the validator should relax the rules on pointer // usage in logical addressing mode. // diff --git a/include/spirv-tools/optimizer.hpp b/include/spirv-tools/optimizer.hpp index b1442dcf..e8b5b698 100644 --- a/include/spirv-tools/optimizer.hpp +++ b/include/spirv-tools/optimizer.hpp @@ -19,7 +19,6 @@ #include #include #include -#include #include #include "libspirv.hpp" @@ -28,7 +27,6 @@ namespace spvtools { namespace opt { class Pass; -struct DescriptorSetAndBinding; } // C++ interface for SPIR-V optimization functionalities. It wraps the context @@ -516,13 +514,6 @@ Optimizer::PassToken CreateDeadInsertElimPass(); // eliminated with standard dead code elimination. Optimizer::PassToken CreateAggressiveDCEPass(); -// Creates a remove-unused-interface-variables pass. -// Removes variables referenced on the |OpEntryPoint| instruction that are not -// referenced in the entry point function or any function in its call tree. Note -// that this could cause the shader interface to no longer match other shader -// stages. -Optimizer::PassToken CreateRemoveUnusedInterfaceVariablesPass(); - // Creates an empty pass. // This is deprecated and will be removed. // TODO(jaebaek): remove this pass after handling glslang's broken unit tests. @@ -856,16 +847,6 @@ Optimizer::PassToken CreateAmdExtToKhrPass(); // propagated into their final positions. Optimizer::PassToken CreateInterpolateFixupPass(); -// Creates a convert-to-sampled-image pass to convert images and/or -// samplers with given pairs of descriptor set and binding to sampled image. -// If a pair of an image and a sampler have the same pair of descriptor set and -// binding that is one of the given pairs, they will be converted to a sampled -// image. In addition, if only an image has the descriptor set and binding that -// is one of the given pairs, it will be converted to a sampled image as well. -Optimizer::PassToken CreateConvertToSampledImagePass( - const std::vector& - descriptor_set_binding_pairs); - } // namespace spvtools #endif // INCLUDE_SPIRV_TOOLS_OPTIMIZER_HPP_ diff --git a/include/spirv/1.0/GLSL.std.450.h b/include/spirv/1.0/GLSL.std.450.h deleted file mode 100644 index 54cc00e9..00000000 --- a/include/spirv/1.0/GLSL.std.450.h +++ /dev/null @@ -1,131 +0,0 @@ -/* -** Copyright (c) 2014-2016 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a copy -** of this software and/or associated documentation files (the "Materials"), -** to deal in the Materials without restriction, including without limitation -** the rights to use, copy, modify, merge, publish, distribute, sublicense, -** and/or sell copies of the Materials, and to permit persons to whom the -** Materials are furnished to do so, subject to the following conditions: -** -** The above copyright notice and this permission notice shall be included in -** all copies or substantial portions of the Materials. -** -** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -** IN THE MATERIALS. -*/ - -#ifndef GLSLstd450_H -#define GLSLstd450_H - -static const int GLSLstd450Version = 100; -static const int GLSLstd450Revision = 3; - -enum GLSLstd450 { - GLSLstd450Bad = 0, // Don't use - - GLSLstd450Round = 1, - GLSLstd450RoundEven = 2, - GLSLstd450Trunc = 3, - GLSLstd450FAbs = 4, - GLSLstd450SAbs = 5, - GLSLstd450FSign = 6, - GLSLstd450SSign = 7, - GLSLstd450Floor = 8, - GLSLstd450Ceil = 9, - GLSLstd450Fract = 10, - - GLSLstd450Radians = 11, - GLSLstd450Degrees = 12, - GLSLstd450Sin = 13, - GLSLstd450Cos = 14, - GLSLstd450Tan = 15, - GLSLstd450Asin = 16, - GLSLstd450Acos = 17, - GLSLstd450Atan = 18, - GLSLstd450Sinh = 19, - GLSLstd450Cosh = 20, - GLSLstd450Tanh = 21, - GLSLstd450Asinh = 22, - GLSLstd450Acosh = 23, - GLSLstd450Atanh = 24, - GLSLstd450Atan2 = 25, - - GLSLstd450Pow = 26, - GLSLstd450Exp = 27, - GLSLstd450Log = 28, - GLSLstd450Exp2 = 29, - GLSLstd450Log2 = 30, - GLSLstd450Sqrt = 31, - GLSLstd450InverseSqrt = 32, - - GLSLstd450Determinant = 33, - GLSLstd450MatrixInverse = 34, - - GLSLstd450Modf = 35, // second operand needs an OpVariable to write to - GLSLstd450ModfStruct = 36, // no OpVariable operand - GLSLstd450FMin = 37, - GLSLstd450UMin = 38, - GLSLstd450SMin = 39, - GLSLstd450FMax = 40, - GLSLstd450UMax = 41, - GLSLstd450SMax = 42, - GLSLstd450FClamp = 43, - GLSLstd450UClamp = 44, - GLSLstd450SClamp = 45, - GLSLstd450FMix = 46, - GLSLstd450IMix = 47, // Reserved - GLSLstd450Step = 48, - GLSLstd450SmoothStep = 49, - - GLSLstd450Fma = 50, - GLSLstd450Frexp = 51, // second operand needs an OpVariable to write to - GLSLstd450FrexpStruct = 52, // no OpVariable operand - GLSLstd450Ldexp = 53, - - GLSLstd450PackSnorm4x8 = 54, - GLSLstd450PackUnorm4x8 = 55, - GLSLstd450PackSnorm2x16 = 56, - GLSLstd450PackUnorm2x16 = 57, - GLSLstd450PackHalf2x16 = 58, - GLSLstd450PackDouble2x32 = 59, - GLSLstd450UnpackSnorm2x16 = 60, - GLSLstd450UnpackUnorm2x16 = 61, - GLSLstd450UnpackHalf2x16 = 62, - GLSLstd450UnpackSnorm4x8 = 63, - GLSLstd450UnpackUnorm4x8 = 64, - GLSLstd450UnpackDouble2x32 = 65, - - GLSLstd450Length = 66, - GLSLstd450Distance = 67, - GLSLstd450Cross = 68, - GLSLstd450Normalize = 69, - GLSLstd450FaceForward = 70, - GLSLstd450Reflect = 71, - GLSLstd450Refract = 72, - - GLSLstd450FindILsb = 73, - GLSLstd450FindSMsb = 74, - GLSLstd450FindUMsb = 75, - - GLSLstd450InterpolateAtCentroid = 76, - GLSLstd450InterpolateAtSample = 77, - GLSLstd450InterpolateAtOffset = 78, - - GLSLstd450NMin = 79, - GLSLstd450NMax = 80, - GLSLstd450NClamp = 81, - - GLSLstd450Count -}; - -#endif // #ifndef GLSLstd450_H diff --git a/include/spirv/1.0/OpenCL.std.h b/include/spirv/1.0/OpenCL.std.h deleted file mode 100644 index 19a66884..00000000 --- a/include/spirv/1.0/OpenCL.std.h +++ /dev/null @@ -1,210 +0,0 @@ -/* -** Copyright (c) 2015-2017 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a copy -** of this software and/or associated documentation files (the "Materials"), -** to deal in the Materials without restriction, including without limitation -** the rights to use, copy, modify, merge, publish, distribute, sublicense, -** and/or sell copies of the Materials, and to permit persons to whom the -** Materials are furnished to do so, subject to the following conditions: -** -** The above copyright notice and this permission notice shall be included in -** all copies or substantial portions of the Materials. -** -** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -** IN THE MATERIALS. -*/ - -namespace OpenCLLIB { - -enum Entrypoints { - - // Section 2.1: Math extended instructions - Acos = 0, - Acosh = 1, - Acospi = 2, - Asin = 3, - Asinh = 4, - Asinpi = 5, - Atan = 6, - Atan2 = 7, - Atanh = 8, - Atanpi = 9, - Atan2pi = 10, - Cbrt = 11, - Ceil = 12, - Copysign = 13, - Cos = 14, - Cosh = 15, - Cospi = 16, - Erfc = 17, - Erf = 18, - Exp = 19, - Exp2 = 20, - Exp10 = 21, - Expm1 = 22, - Fabs = 23, - Fdim = 24, - Floor = 25, - Fma = 26, - Fmax = 27, - Fmin = 28, - Fmod = 29, - Fract = 30, - Frexp = 31, - Hypot = 32, - Ilogb = 33, - Ldexp = 34, - Lgamma = 35, - Lgamma_r = 36, - Log = 37, - Log2 = 38, - Log10 = 39, - Log1p = 40, - Logb = 41, - Mad = 42, - Maxmag = 43, - Minmag = 44, - Modf = 45, - Nan = 46, - Nextafter = 47, - Pow = 48, - Pown = 49, - Powr = 50, - Remainder = 51, - Remquo = 52, - Rint = 53, - Rootn = 54, - Round = 55, - Rsqrt = 56, - Sin = 57, - Sincos = 58, - Sinh = 59, - Sinpi = 60, - Sqrt = 61, - Tan = 62, - Tanh = 63, - Tanpi = 64, - Tgamma = 65, - Trunc = 66, - Half_cos = 67, - Half_divide = 68, - Half_exp = 69, - Half_exp2 = 70, - Half_exp10 = 71, - Half_log = 72, - Half_log2 = 73, - Half_log10 = 74, - Half_powr = 75, - Half_recip = 76, - Half_rsqrt = 77, - Half_sin = 78, - Half_sqrt = 79, - Half_tan = 80, - Native_cos = 81, - Native_divide = 82, - Native_exp = 83, - Native_exp2 = 84, - Native_exp10 = 85, - Native_log = 86, - Native_log2 = 87, - Native_log10 = 88, - Native_powr = 89, - Native_recip = 90, - Native_rsqrt = 91, - Native_sin = 92, - Native_sqrt = 93, - Native_tan = 94, - - // Section 2.2: Integer instructions - SAbs = 141, - SAbs_diff = 142, - SAdd_sat = 143, - UAdd_sat = 144, - SHadd = 145, - UHadd = 146, - SRhadd = 147, - URhadd = 148, - SClamp = 149, - UClamp = 150, - Clz = 151, - Ctz = 152, - SMad_hi = 153, - UMad_sat = 154, - SMad_sat = 155, - SMax = 156, - UMax = 157, - SMin = 158, - UMin = 159, - SMul_hi = 160, - Rotate = 161, - SSub_sat = 162, - USub_sat = 163, - U_Upsample = 164, - S_Upsample = 165, - Popcount = 166, - SMad24 = 167, - UMad24 = 168, - SMul24 = 169, - UMul24 = 170, - UAbs = 201, - UAbs_diff = 202, - UMul_hi = 203, - UMad_hi = 204, - - // Section 2.3: Common instructions - FClamp = 95, - Degrees = 96, - FMax_common = 97, - FMin_common = 98, - Mix = 99, - Radians = 100, - Step = 101, - Smoothstep = 102, - Sign = 103, - - // Section 2.4: Geometric instructions - Cross = 104, - Distance = 105, - Length = 106, - Normalize = 107, - Fast_distance = 108, - Fast_length = 109, - Fast_normalize = 110, - - // Section 2.5: Relational instructions - Bitselect = 186, - Select = 187, - - // Section 2.6: Vector Data Load and Store instructions - Vloadn = 171, - Vstoren = 172, - Vload_half = 173, - Vload_halfn = 174, - Vstore_half = 175, - Vstore_half_r = 176, - Vstore_halfn = 177, - Vstore_halfn_r = 178, - Vloada_halfn = 179, - Vstorea_halfn = 180, - Vstorea_halfn_r = 181, - - // Section 2.7: Miscellaneous Vector instructions - Shuffle = 182, - Shuffle2 = 183, - - // Section 2.8: Misc instructions - Printf = 184, - Prefetch = 185, -}; - -} // end namespace OpenCLLIB diff --git a/include/spirv/1.0/extinst.glsl.std.450.grammar.json b/include/spirv/1.0/extinst.glsl.std.450.grammar.json deleted file mode 100644 index 3d9f39e7..00000000 --- a/include/spirv/1.0/extinst.glsl.std.450.grammar.json +++ /dev/null @@ -1,642 +0,0 @@ -{ - "copyright" : [ - "Copyright (c) 2014-2016 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - "version" : 100, - "revision" : 2, - "instructions" : [ - { - "opname" : "Round", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "RoundEven", - "opcode" : 2, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Trunc", - "opcode" : 3, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FAbs", - "opcode" : 4, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "SAbs", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FSign", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "SSign", - "opcode" : 7, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Floor", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Ceil", - "opcode" : 9, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Fract", - "opcode" : 10, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Radians", - "opcode" : 11, - "operands" : [ - { "kind" : "IdRef", "name" : "'degrees'" } - ] - }, - { - "opname" : "Degrees", - "opcode" : 12, - "operands" : [ - { "kind" : "IdRef", "name" : "'radians'" } - ] - }, - { - "opname" : "Sin", - "opcode" : 13, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Cos", - "opcode" : 14, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Tan", - "opcode" : 15, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Asin", - "opcode" : 16, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Acos", - "opcode" : 17, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Atan", - "opcode" : 18, - "operands" : [ - { "kind" : "IdRef", "name" : "'y_over_x'" } - ] - }, - { - "opname" : "Sinh", - "opcode" : 19, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Cosh", - "opcode" : 20, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Tanh", - "opcode" : 21, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Asinh", - "opcode" : 22, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Acosh", - "opcode" : 23, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Atanh", - "opcode" : 24, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Atan2", - "opcode" : 25, - "operands" : [ - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Pow", - "opcode" : 26, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "Exp", - "opcode" : 27, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Log", - "opcode" : 28, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Exp2", - "opcode" : 29, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Log2", - "opcode" : 30, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Sqrt", - "opcode" : 31, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "InverseSqrt", - "opcode" : 32, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Determinant", - "opcode" : 33, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "MatrixInverse", - "opcode" : 34, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Modf", - "opcode" : 35, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'i'" } - ] - }, - { - "opname" : "ModfStruct", - "opcode" : 36, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FMin", - "opcode" : 37, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "UMin", - "opcode" : 38, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "SMin", - "opcode" : 39, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "FMax", - "opcode" : 40, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "UMax", - "opcode" : 41, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "SMax", - "opcode" : 42, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "FClamp", - "opcode" : 43, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - }, - { - "opname" : "UClamp", - "opcode" : 44, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - }, - { - "opname" : "SClamp", - "opcode" : 45, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - }, - { - "opname" : "FMix", - "opcode" : 46, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'a'" } - ] - }, - { - "opname" : "IMix", - "opcode" : 47, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'a'" } - ] - }, - { - "opname" : "Step", - "opcode" : 48, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "SmoothStep", - "opcode" : 49, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge0'" }, - { "kind" : "IdRef", "name" : "'edge1'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Fma", - "opcode" : 50, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "Frexp", - "opcode" : 51, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'exp'" } - ] - }, - { - "opname" : "FrexpStruct", - "opcode" : 52, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Ldexp", - "opcode" : 53, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'exp'" } - ] - }, - { - "opname" : "PackSnorm4x8", - "opcode" : 54, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackUnorm4x8", - "opcode" : 55, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackSnorm2x16", - "opcode" : 56, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackUnorm2x16", - "opcode" : 57, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackHalf2x16", - "opcode" : 58, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackDouble2x32", - "opcode" : 59, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ], - "capabilities" : [ "Float64" ] - }, - { - "opname" : "UnpackSnorm2x16", - "opcode" : 60, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackUnorm2x16", - "opcode" : 61, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackHalf2x16", - "opcode" : 62, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "UnpackSnorm4x8", - "opcode" : 63, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackUnorm4x8", - "opcode" : 64, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackDouble2x32", - "opcode" : 65, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ], - "capabilities" : [ "Float64" ] - }, - { - "opname" : "Length", - "opcode" : 66, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Distance", - "opcode" : 67, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "Cross", - "opcode" : 68, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "Normalize", - "opcode" : 69, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FaceForward", - "opcode" : 70, - "operands" : [ - { "kind" : "IdRef", "name" : "'N'" }, - { "kind" : "IdRef", "name" : "'I'" }, - { "kind" : "IdRef", "name" : "'Nref'" } - ] - }, - { - "opname" : "Reflect", - "opcode" : 71, - "operands" : [ - { "kind" : "IdRef", "name" : "'I'" }, - { "kind" : "IdRef", "name" : "'N'" } - ] - }, - { - "opname" : "Refract", - "opcode" : 72, - "operands" : [ - { "kind" : "IdRef", "name" : "'I'" }, - { "kind" : "IdRef", "name" : "'N'" }, - { "kind" : "IdRef", "name" : "'eta'" } - ] - }, - { - "opname" : "FindILsb", - "opcode" : 73, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "FindSMsb", - "opcode" : 74, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "FindUMsb", - "opcode" : 75, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "InterpolateAtCentroid", - "opcode" : 76, - "operands" : [ - { "kind" : "IdRef", "name" : "'interpolant'" } - ], - "capabilities" : [ "InterpolationFunction" ] - }, - { - "opname" : "InterpolateAtSample", - "opcode" : 77, - "operands" : [ - { "kind" : "IdRef", "name" : "'interpolant'" }, - { "kind" : "IdRef", "name" : "'sample'" } - ], - "capabilities" : [ "InterpolationFunction" ] - }, - { - "opname" : "InterpolateAtOffset", - "opcode" : 78, - "operands" : [ - { "kind" : "IdRef", "name" : "'interpolant'" }, - { "kind" : "IdRef", "name" : "'offset'" } - ], - "capabilities" : [ "InterpolationFunction" ] - }, - { - "opname" : "NMin", - "opcode" : 79, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "NMax", - "opcode" : 80, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "NClamp", - "opcode" : 81, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - } - ] -} diff --git a/include/spirv/1.0/extinst.opencl.std.100.grammar.json b/include/spirv/1.0/extinst.opencl.std.100.grammar.json deleted file mode 100644 index 4fe45060..00000000 --- a/include/spirv/1.0/extinst.opencl.std.100.grammar.json +++ /dev/null @@ -1,1279 +0,0 @@ -{ - "copyright" : [ - "Copyright (c) 2014-2016 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - "version" : 100, - "revision" : 2, - "instructions" : [ - { - "opname" : "acos", - "opcode" : 0, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "acosh", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "acospi", - "opcode" : 2, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "asin", - "opcode" : 3, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "asinh", - "opcode" : 4, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "asinpi", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atan", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atan2", - "opcode" : 7, - "operands" : [ - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atanh", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atanpi", - "opcode" : 9, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atan2pi", - "opcode" : 10, - "operands" : [ - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cbrt", - "opcode" : 11, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "ceil", - "opcode" : 12, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "copysign", - "opcode" : 13, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "cos", - "opcode" : 14, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cosh", - "opcode" : 15, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cospi", - "opcode" : 16, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "erfc", - "opcode" : 17, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "erf", - "opcode" : 18, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "exp", - "opcode" : 19, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "exp2", - "opcode" : 20, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "exp10", - "opcode" : 21, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "expm1", - "opcode" : 22, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "fabs", - "opcode" : 23, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "fdim", - "opcode" : 24, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "floor", - "opcode" : 25, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "fma", - "opcode" : 26, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "fmax", - "opcode" : 27, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fmin", - "opcode" : 28, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fmod", - "opcode" : 29, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fract", - "opcode" : 30, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'ptr'" } - ] - }, - { - "opname" : "frexp", - "opcode" : 31, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'exp'" } - ] - }, - { - "opname" : "hypot", - "opcode" : 32, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "ilogb", - "opcode" : 33, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "ldexp", - "opcode" : 34, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'k'" } - ] - }, - { - "opname" : "lgamma", - "opcode" : 35, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "lgamma_r", - "opcode" : 36, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'signp'" } - ] - }, - { - "opname" : "log", - "opcode" : 37, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "log2", - "opcode" : 38, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "log10", - "opcode" : 39, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "log1p", - "opcode" : 40, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "logb", - "opcode" : 41, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "mad", - "opcode" : 42, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "maxmag", - "opcode" : 43, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "minmag", - "opcode" : 44, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "modf", - "opcode" : 45, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'iptr'" } - ] - }, - { - "opname" : "nan", - "opcode" : 46, - "operands" : [ - { "kind" : "IdRef", "name" : "'nancode'" } - ] - }, - { - "opname" : "nextafter", - "opcode" : 47, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "pow", - "opcode" : 48, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y" } - ] - }, - { - "opname" : "pown", - "opcode" : 49, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "powr", - "opcode" : 50, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "remainder", - "opcode" : 51, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "remquo", - "opcode" : 52, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'quo'" } - ] - }, - { - "opname" : "rint", - "opcode" : 53, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "rootn", - "opcode" : 54, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "round", - "opcode" : 55, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "rsqrt", - "opcode" : 56, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sin", - "opcode" : 57, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sincos", - "opcode" : 58, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'cosval'" } - ] - }, - { - "opname" : "sinh", - "opcode" : 59, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sinpi", - "opcode" : 60, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sqrt", - "opcode" : 61, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tan", - "opcode" : 62, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tanh", - "opcode" : 63, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tanpi", - "opcode" : 64, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tgamma", - "opcode" : 65, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "trunc", - "opcode" : 66, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_cos", - "opcode" : 67, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_divide", - "opcode" : 68, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "half_exp", - "opcode" : 69, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_exp2", - "opcode" : 70, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_exp10", - "opcode" : 71, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_log", - "opcode" : 72, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_log2", - "opcode" : 73, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_log10", - "opcode" : 74, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_powr", - "opcode" : 75, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "half_recip", - "opcode" : 76, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_rsqrt", - "opcode" : 77, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_sin", - "opcode" : 78, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_sqrt", - "opcode" : 79, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_tan", - "opcode" : 80, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_cos", - "opcode" : 81, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_divide", - "opcode" : 82, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "native_exp", - "opcode" : 83, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_exp2", - "opcode" : 84, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_exp10", - "opcode" : 85, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_log", - "opcode" : 86, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_log2", - "opcode" : 87, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_log10", - "opcode" : 88, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_powr", - "opcode" : 89, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "native_recip", - "opcode" : 90, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_rsqrt", - "opcode" : 91, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_sin", - "opcode" : 92, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_sqrt", - "opcode" : 93, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_tan", - "opcode" : 94, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_abs", - "opcode" : 141, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_abs_diff", - "opcode" : 142, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_add_sat", - "opcode" : 143, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_add_sat", - "opcode" : 144, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_hadd", - "opcode" : 145, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_hadd", - "opcode" : 146, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_rhadd", - "opcode" : 147, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_rhadd", - "opcode" : 148, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_clamp", - "opcode" : 149, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minval'" }, - { "kind" : "IdRef", "name" : "'maxval'" } - ] - }, - { - "opname" : "u_clamp", - "opcode" : 150, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minval'" }, - { "kind" : "IdRef", "name" : "'maxval'" } - ] - }, - { - "opname" : "clz", - "opcode" : 151, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "ctz", - "opcode" : 152, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_mad_hi", - "opcode" : 153, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "u_mad_sat", - "opcode" : 154, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "s_mad_sat", - "opcode" : 155, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "s_max", - "opcode" : 156, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_max", - "opcode" : 157, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_min", - "opcode" : 158, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_min", - "opcode" : 159, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_mul_hi", - "opcode" : 160, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "rotate", - "opcode" : 161, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" }, - { "kind" : "IdRef", "name" : "'i'" } - ] - }, - { - "opname" : "s_sub_sat", - "opcode" : 162, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_sub_sat", - "opcode" : 163, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_upsample", - "opcode" : 164, - "operands" : [ - { "kind" : "IdRef", "name" : "'hi'" }, - { "kind" : "IdRef", "name" : "'lo'" } - ] - }, - { - "opname" : "s_upsample", - "opcode" : 165, - "operands" : [ - { "kind" : "IdRef", "name" : "'hi'" }, - { "kind" : "IdRef", "name" : "'lo'" } - ] - }, - { - "opname" : "popcount", - "opcode" : 166, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_mad24", - "opcode" : 167, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "u_mad24", - "opcode" : 168, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "s_mul24", - "opcode" : 169, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_mul24", - "opcode" : 170, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_abs", - "opcode" : 201, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "u_abs_diff", - "opcode" : 202, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_mul_hi", - "opcode" : 203, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_mad_hi", - "opcode" : 204, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "fclamp", - "opcode" : 95, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minval'" }, - { "kind" : "IdRef", "name" : "'maxval'" } - ] - }, - { - "opname" : "degrees", - "opcode" :96, - "operands" : [ - { "kind" : "IdRef", "name" : "'radians'" } - ] - }, - { - "opname" : "fmax_common", - "opcode" : 97, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fmin_common", - "opcode" : 98, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "mix", - "opcode" : 99, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'a'" } - ] - }, - { - "opname" : "radians", - "opcode" : 100, - "operands" : [ - { "kind" : "IdRef", "name" : "'degrees'" } - ] - }, - { - "opname" : "step", - "opcode" : 101, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "smoothstep", - "opcode" : 102, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge0'" }, - { "kind" : "IdRef", "name" : "'edge1'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sign", - "opcode" : 103, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cross", - "opcode" : 104, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "distance", - "opcode" : 105, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "length", - "opcode" : 106, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "normalize", - "opcode" : 107, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "fast_distance", - "opcode" : 108, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "fast_length", - "opcode" : 109, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "fast_normalize", - "opcode" : 110, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "bitselect", - "opcode" : 186, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "select", - "opcode" : 187, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "vloadn", - "opcode" : 171, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "LiteralInteger", "name" : "'n'" } - ] - }, - { - "opname" : "vstoren", - "opcode" : 172, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vload_half", - "opcode" : 173, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vload_halfn", - "opcode" : 174, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "LiteralInteger", "name" : "'n'" } - ] - }, - { - "opname" : "vstore_half", - "opcode" : 175, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vstore_half_r", - "opcode" : 176, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "FPRoundingMode", "name" : "'mode'" } - ] - }, - { - "opname" : "vstore_halfn", - "opcode" : 177, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vstore_halfn_r", - "opcode" : 178, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "FPRoundingMode", "name" : "'mode'" } - ] - }, - { - "opname" : "vloada_halfn", - "opcode" : 179, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "LiteralInteger", "name" : "'n'" } - ] - }, - { - "opname" : "vstorea_halfn", - "opcode" : 180, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vstorea_halfn_r", - "opcode" : 181, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "FPRoundingMode", "name" : "'mode'" } - ] - }, - { - "opname" : "shuffle", - "opcode" : 182, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'shuffle mask'" } - ] - }, - { - "opname" : "shuffle2", - "opcode" : 183, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'shuffle mask'" } - ] - }, - { - "opname" : "printf", - "opcode" : 184, - "operands" : [ - { "kind" : "IdRef", "name" : "'format'" }, - { "kind" : "IdRef", "name" : "'additional arguments'", "quantifier" : "*" } - ] - }, - { - "opname" : "prefetch", - "opcode" : 185, - "operands" : [ - { "kind" : "IdRef", "name" : "'ptr'" }, - { "kind" : "IdRef", "name" : "'num elements'" } - ] - } - ] -} diff --git a/include/spirv/1.0/spirv.core.grammar.json b/include/spirv/1.0/spirv.core.grammar.json deleted file mode 100644 index f3cfc4c2..00000000 --- a/include/spirv/1.0/spirv.core.grammar.json +++ /dev/null @@ -1,5775 +0,0 @@ -{ - "copyright" : [ - "Copyright (c) 2014-2016 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - "magic_number" : "0x07230203", - "major_version" : 1, - "minor_version" : 0, - "revision" : 12, - "instructions" : [ - { - "opname" : "OpNop", - "opcode" : 0 - }, - { - "opname" : "OpUndef", - "opcode" : 1, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSourceContinued", - "opcode" : 2, - "operands" : [ - { "kind" : "LiteralString", "name" : "'Continued Source'" } - ] - }, - { - "opname" : "OpSource", - "opcode" : 3, - "operands" : [ - { "kind" : "SourceLanguage" }, - { "kind" : "LiteralInteger", "name" : "'Version'" }, - { "kind" : "IdRef", "quantifier" : "?", "name" : "'File'" }, - { "kind" : "LiteralString", "quantifier" : "?", "name" : "'Source'" } - ] - }, - { - "opname" : "OpSourceExtension", - "opcode" : 4, - "operands" : [ - { "kind" : "LiteralString", "name" : "'Extension'" } - ] - }, - { - "opname" : "OpName", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpMemberName", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "LiteralInteger", "name" : "'Member'" }, - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpString", - "opcode" : 7, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralString", "name" : "'String'" } - ] - }, - { - "opname" : "OpLine", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "'File'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" } - ] - }, - { - "opname" : "OpExtension", - "opcode" : 10, - "operands" : [ - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpExtInstImport", - "opcode" : 11, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpExtInst", - "opcode" : 12, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Set'" }, - { "kind" : "LiteralExtInstInteger", "name" : "'Instruction'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Operand 1', +\n'Operand 2', +\n..." } - ] - }, - { - "opname" : "OpMemoryModel", - "opcode" : 14, - "operands" : [ - { "kind" : "AddressingModel" }, - { "kind" : "MemoryModel" } - ] - }, - { - "opname" : "OpEntryPoint", - "opcode" : 15, - "operands" : [ - { "kind" : "ExecutionModel" }, - { "kind" : "IdRef", "name" : "'Entry Point'" }, - { "kind" : "LiteralString", "name" : "'Name'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Interface'" } - ] - }, - { - "opname" : "OpExecutionMode", - "opcode" : 16, - "operands" : [ - { "kind" : "IdRef", "name" : "'Entry Point'" }, - { "kind" : "ExecutionMode", "name" : "'Mode'" } - ] - }, - { - "opname" : "OpCapability", - "opcode" : 17, - "operands" : [ - { "kind" : "Capability", "name" : "'Capability'" } - ] - }, - { - "opname" : "OpTypeVoid", - "opcode" : 19, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpTypeBool", - "opcode" : 20, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpTypeInt", - "opcode" : 21, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralInteger", "name" : "'Width'" }, - { "kind" : "LiteralInteger", "name" : "'Signedness'" } - ] - }, - { - "opname" : "OpTypeFloat", - "opcode" : 22, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralInteger", "name" : "'Width'" } - ] - }, - { - "opname" : "OpTypeVector", - "opcode" : 23, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Component Type'" }, - { "kind" : "LiteralInteger", "name" : "'Component Count'" } - ] - }, - { - "opname" : "OpTypeMatrix", - "opcode" : 24, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Column Type'" }, - { "kind" : "LiteralInteger", "name" : "'Column Count'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpTypeImage", - "opcode" : 25, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Type'" }, - { "kind" : "Dim" }, - { "kind" : "LiteralInteger", "name" : "'Depth'" }, - { "kind" : "LiteralInteger", "name" : "'Arrayed'" }, - { "kind" : "LiteralInteger", "name" : "'MS'" }, - { "kind" : "LiteralInteger", "name" : "'Sampled'" }, - { "kind" : "ImageFormat" }, - { "kind" : "AccessQualifier", "quantifier" : "?" } - ] - }, - { - "opname" : "OpTypeSampler", - "opcode" : 26, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpTypeSampledImage", - "opcode" : 27, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image Type'" } - ] - }, - { - "opname" : "OpTypeArray", - "opcode" : 28, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Element Type'" }, - { "kind" : "IdRef", "name" : "'Length'" } - ] - }, - { - "opname" : "OpTypeRuntimeArray", - "opcode" : 29, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Element Type'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpTypeStruct", - "opcode" : 30, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Member 0 type', +\n'member 1 type', +\n..." } - ] - }, - { - "opname" : "OpTypeOpaque", - "opcode" : 31, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralString", "name" : "The name of the opaque type." } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpTypePointer", - "opcode" : 32, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "StorageClass" }, - { "kind" : "IdRef", "name" : "'Type'" } - ] - }, - { - "opname" : "OpTypeFunction", - "opcode" : 33, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Return Type'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Parameter 0 Type', +\n'Parameter 1 Type', +\n..." } - ] - }, - { - "opname" : "OpTypeEvent", - "opcode" : 34, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpTypeDeviceEvent", - "opcode" : 35, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpTypeReserveId", - "opcode" : 36, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpTypeQueue", - "opcode" : 37, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpTypePipe", - "opcode" : 38, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "AccessQualifier", "name" : "'Qualifier'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpTypeForwardPointer", - "opcode" : 39, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer Type'" }, - { "kind" : "StorageClass" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpConstantTrue", - "opcode" : 41, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpConstantFalse", - "opcode" : 42, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpConstant", - "opcode" : 43, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralContextDependentNumber", "name" : "'Value'" } - ] - }, - { - "opname" : "OpConstantComposite", - "opcode" : 44, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } - ] - }, - { - "opname" : "OpConstantSampler", - "opcode" : 45, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "SamplerAddressingMode" }, - { "kind" : "LiteralInteger", "name" : "'Param'" }, - { "kind" : "SamplerFilterMode" } - ], - "capabilities" : [ "LiteralSampler" ] - }, - { - "opname" : "OpConstantNull", - "opcode" : 46, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSpecConstantTrue", - "opcode" : 48, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSpecConstantFalse", - "opcode" : 49, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSpecConstant", - "opcode" : 50, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralContextDependentNumber", "name" : "'Value'" } - ] - }, - { - "opname" : "OpSpecConstantComposite", - "opcode" : 51, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } - ] - }, - { - "opname" : "OpSpecConstantOp", - "opcode" : 52, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralSpecConstantOpInteger", "name" : "'Opcode'" } - ] - }, - { - "opname" : "OpFunction", - "opcode" : 54, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "FunctionControl" }, - { "kind" : "IdRef", "name" : "'Function Type'" } - ] - }, - { - "opname" : "OpFunctionParameter", - "opcode" : 55, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpFunctionEnd", - "opcode" : 56 - }, - { - "opname" : "OpFunctionCall", - "opcode" : 57, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Function'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Argument 0', +\n'Argument 1', +\n..." } - ] - }, - { - "opname" : "OpVariable", - "opcode" : 59, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "StorageClass" }, - { "kind" : "IdRef", "quantifier" : "?", "name" : "'Initializer'" } - ] - }, - { - "opname" : "OpImageTexelPointer", - "opcode" : 60, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Sample'" } - ] - }, - { - "opname" : "OpLoad", - "opcode" : 61, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ] - }, - { - "opname" : "OpStore", - "opcode" : 62, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Object'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ] - }, - { - "opname" : "OpCopyMemory", - "opcode" : 63, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ] - }, - { - "opname" : "OpCopyMemorySized", - "opcode" : 64, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpAccessChain", - "opcode" : 65, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpInBoundsAccessChain", - "opcode" : 66, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpPtrAccessChain", - "opcode" : 67, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Element'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ], - "capabilities" : [ - "Addresses", - "VariablePointers", - "VariablePointersStorageBuffer" - ] - }, - { - "opname" : "OpArrayLength", - "opcode" : 68, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Structure'" }, - { "kind" : "LiteralInteger", "name" : "'Array member'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpGenericPtrMemSemantics", - "opcode" : 69, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpInBoundsPtrAccessChain", - "opcode" : 70, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Element'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpDecorate", - "opcode" : 71, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "Decoration" } - ] - }, - { - "opname" : "OpMemberDecorate", - "opcode" : 72, - "operands" : [ - { "kind" : "IdRef", "name" : "'Structure Type'" }, - { "kind" : "LiteralInteger", "name" : "'Member'" }, - { "kind" : "Decoration" } - ] - }, - { - "opname" : "OpDecorationGroup", - "opcode" : 73, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpGroupDecorate", - "opcode" : 74, - "operands" : [ - { "kind" : "IdRef", "name" : "'Decoration Group'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Targets'" } - ] - }, - { - "opname" : "OpGroupMemberDecorate", - "opcode" : 75, - "operands" : [ - { "kind" : "IdRef", "name" : "'Decoration Group'" }, - { "kind" : "PairIdRefLiteralInteger", "quantifier" : "*", "name" : "'Targets'" } - ] - }, - { - "opname" : "OpVectorExtractDynamic", - "opcode" : 77, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Index'" } - ] - }, - { - "opname" : "OpVectorInsertDynamic", - "opcode" : 78, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Component'" }, - { "kind" : "IdRef", "name" : "'Index'" } - ] - }, - { - "opname" : "OpVectorShuffle", - "opcode" : 79, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Components'" } - ] - }, - { - "opname" : "OpCompositeConstruct", - "opcode" : 80, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } - ] - }, - { - "opname" : "OpCompositeExtract", - "opcode" : 81, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Composite'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpCompositeInsert", - "opcode" : 82, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Object'" }, - { "kind" : "IdRef", "name" : "'Composite'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpCopyObject", - "opcode" : 83, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpTranspose", - "opcode" : 84, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Matrix'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpSampledImage", - "opcode" : 86, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Sampler'" } - ] - }, - { - "opname" : "OpImageSampleImplicitLod", - "opcode" : 87, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleExplicitLod", - "opcode" : 88, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ] - }, - { - "opname" : "OpImageSampleDrefImplicitLod", - "opcode" : 89, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleDrefExplicitLod", - "opcode" : 90, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjImplicitLod", - "opcode" : 91, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjExplicitLod", - "opcode" : 92, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjDrefImplicitLod", - "opcode" : 93, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjDrefExplicitLod", - "opcode" : 94, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageFetch", - "opcode" : 95, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ] - }, - { - "opname" : "OpImageGather", - "opcode" : 96, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Component'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageDrefGather", - "opcode" : 97, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageRead", - "opcode" : 98, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ] - }, - { - "opname" : "OpImageWrite", - "opcode" : 99, - "operands" : [ - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Texel'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ] - }, - { - "opname" : "OpImage", - "opcode" : 100, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" } - ] - }, - { - "opname" : "OpImageQueryFormat", - "opcode" : 101, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpImageQueryOrder", - "opcode" : 102, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpImageQuerySizeLod", - "opcode" : 103, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Level of Detail'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpImageQuerySize", - "opcode" : 104, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpImageQueryLod", - "opcode" : 105, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" } - ], - "capabilities" : [ "ImageQuery" ] - }, - { - "opname" : "OpImageQueryLevels", - "opcode" : 106, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpImageQuerySamples", - "opcode" : 107, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpConvertFToU", - "opcode" : 109, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Float Value'" } - ] - }, - { - "opname" : "OpConvertFToS", - "opcode" : 110, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Float Value'" } - ] - }, - { - "opname" : "OpConvertSToF", - "opcode" : 111, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Signed Value'" } - ] - }, - { - "opname" : "OpConvertUToF", - "opcode" : 112, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Unsigned Value'" } - ] - }, - { - "opname" : "OpUConvert", - "opcode" : 113, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Unsigned Value'" } - ] - }, - { - "opname" : "OpSConvert", - "opcode" : 114, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Signed Value'" } - ] - }, - { - "opname" : "OpFConvert", - "opcode" : 115, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Float Value'" } - ] - }, - { - "opname" : "OpQuantizeToF16", - "opcode" : 116, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpConvertPtrToU", - "opcode" : 117, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpSatConvertSToU", - "opcode" : 118, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Signed Value'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpSatConvertUToS", - "opcode" : 119, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Unsigned Value'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpConvertUToPtr", - "opcode" : 120, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Integer Value'" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpPtrCastToGeneric", - "opcode" : 121, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGenericCastToPtr", - "opcode" : 122, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGenericCastToPtrExplicit", - "opcode" : 123, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "StorageClass", "name" : "'Storage'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpBitcast", - "opcode" : 124, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpSNegate", - "opcode" : 126, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpFNegate", - "opcode" : 127, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpIAdd", - "opcode" : 128, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFAdd", - "opcode" : 129, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpISub", - "opcode" : 130, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFSub", - "opcode" : 131, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpIMul", - "opcode" : 132, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFMul", - "opcode" : 133, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUDiv", - "opcode" : 134, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSDiv", - "opcode" : 135, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFDiv", - "opcode" : 136, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUMod", - "opcode" : 137, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSRem", - "opcode" : 138, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSMod", - "opcode" : 139, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFRem", - "opcode" : 140, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFMod", - "opcode" : 141, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpVectorTimesScalar", - "opcode" : 142, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Scalar'" } - ] - }, - { - "opname" : "OpMatrixTimesScalar", - "opcode" : 143, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Matrix'" }, - { "kind" : "IdRef", "name" : "'Scalar'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpVectorTimesMatrix", - "opcode" : 144, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Matrix'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpMatrixTimesVector", - "opcode" : 145, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Matrix'" }, - { "kind" : "IdRef", "name" : "'Vector'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpMatrixTimesMatrix", - "opcode" : 146, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'LeftMatrix'" }, - { "kind" : "IdRef", "name" : "'RightMatrix'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpOuterProduct", - "opcode" : 147, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpDot", - "opcode" : 148, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" } - ] - }, - { - "opname" : "OpIAddCarry", - "opcode" : 149, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpISubBorrow", - "opcode" : 150, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUMulExtended", - "opcode" : 151, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSMulExtended", - "opcode" : 152, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpAny", - "opcode" : 154, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" } - ] - }, - { - "opname" : "OpAll", - "opcode" : 155, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" } - ] - }, - { - "opname" : "OpIsNan", - "opcode" : 156, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "OpIsInf", - "opcode" : 157, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "OpIsFinite", - "opcode" : 158, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpIsNormal", - "opcode" : 159, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpSignBitSet", - "opcode" : 160, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpLessOrGreater", - "opcode" : 161, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpOrdered", - "opcode" : 162, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpUnordered", - "opcode" : 163, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpLogicalEqual", - "opcode" : 164, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalNotEqual", - "opcode" : 165, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalOr", - "opcode" : 166, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalAnd", - "opcode" : 167, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalNot", - "opcode" : 168, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpSelect", - "opcode" : 169, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Condition'" }, - { "kind" : "IdRef", "name" : "'Object 1'" }, - { "kind" : "IdRef", "name" : "'Object 2'" } - ] - }, - { - "opname" : "OpIEqual", - "opcode" : 170, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpINotEqual", - "opcode" : 171, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUGreaterThan", - "opcode" : 172, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSGreaterThan", - "opcode" : 173, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUGreaterThanEqual", - "opcode" : 174, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSGreaterThanEqual", - "opcode" : 175, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpULessThan", - "opcode" : 176, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSLessThan", - "opcode" : 177, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpULessThanEqual", - "opcode" : 178, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSLessThanEqual", - "opcode" : 179, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdEqual", - "opcode" : 180, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordEqual", - "opcode" : 181, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdNotEqual", - "opcode" : 182, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordNotEqual", - "opcode" : 183, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdLessThan", - "opcode" : 184, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordLessThan", - "opcode" : 185, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdGreaterThan", - "opcode" : 186, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordGreaterThan", - "opcode" : 187, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdLessThanEqual", - "opcode" : 188, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordLessThanEqual", - "opcode" : 189, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdGreaterThanEqual", - "opcode" : 190, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordGreaterThanEqual", - "opcode" : 191, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpShiftRightLogical", - "opcode" : 194, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Shift'" } - ] - }, - { - "opname" : "OpShiftRightArithmetic", - "opcode" : 195, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Shift'" } - ] - }, - { - "opname" : "OpShiftLeftLogical", - "opcode" : 196, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Shift'" } - ] - }, - { - "opname" : "OpBitwiseOr", - "opcode" : 197, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpBitwiseXor", - "opcode" : 198, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpBitwiseAnd", - "opcode" : 199, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpNot", - "opcode" : 200, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpBitFieldInsert", - "opcode" : 201, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Insert'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Count'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpBitFieldSExtract", - "opcode" : 202, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Count'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpBitFieldUExtract", - "opcode" : 203, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Count'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpBitReverse", - "opcode" : 204, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpBitCount", - "opcode" : 205, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" } - ] - }, - { - "opname" : "OpDPdx", - "opcode" : 207, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpDPdy", - "opcode" : 208, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpFwidth", - "opcode" : 209, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpDPdxFine", - "opcode" : 210, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpDPdyFine", - "opcode" : 211, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpFwidthFine", - "opcode" : 212, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpDPdxCoarse", - "opcode" : 213, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpDPdyCoarse", - "opcode" : 214, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpFwidthCoarse", - "opcode" : 215, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpEmitVertex", - "opcode" : 218, - "capabilities" : [ "Geometry" ] - }, - { - "opname" : "OpEndPrimitive", - "opcode" : 219, - "capabilities" : [ "Geometry" ] - }, - { - "opname" : "OpEmitStreamVertex", - "opcode" : 220, - "operands" : [ - { "kind" : "IdRef", "name" : "'Stream'" } - ], - "capabilities" : [ "GeometryStreams" ] - }, - { - "opname" : "OpEndStreamPrimitive", - "opcode" : 221, - "operands" : [ - { "kind" : "IdRef", "name" : "'Stream'" } - ], - "capabilities" : [ "GeometryStreams" ] - }, - { - "opname" : "OpControlBarrier", - "opcode" : 224, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpMemoryBarrier", - "opcode" : 225, - "operands" : [ - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicLoad", - "opcode" : 227, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicStore", - "opcode" : 228, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicExchange", - "opcode" : 229, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicCompareExchange", - "opcode" : 230, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Equal'" }, - { "kind" : "IdMemorySemantics", "name" : "'Unequal'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Comparator'" } - ] - }, - { - "opname" : "OpAtomicCompareExchangeWeak", - "opcode" : 231, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Equal'" }, - { "kind" : "IdMemorySemantics", "name" : "'Unequal'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Comparator'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpAtomicIIncrement", - "opcode" : 232, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicIDecrement", - "opcode" : 233, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicIAdd", - "opcode" : 234, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicISub", - "opcode" : 235, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicSMin", - "opcode" : 236, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicUMin", - "opcode" : 237, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicSMax", - "opcode" : 238, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicUMax", - "opcode" : 239, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicAnd", - "opcode" : 240, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicOr", - "opcode" : 241, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicXor", - "opcode" : 242, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpPhi", - "opcode" : 245, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "PairIdRefIdRef", "quantifier" : "*", "name" : "'Variable, Parent, ...'" } - ] - }, - { - "opname" : "OpLoopMerge", - "opcode" : 246, - "operands" : [ - { "kind" : "IdRef", "name" : "'Merge Block'" }, - { "kind" : "IdRef", "name" : "'Continue Target'" }, - { "kind" : "LoopControl" } - ] - }, - { - "opname" : "OpSelectionMerge", - "opcode" : 247, - "operands" : [ - { "kind" : "IdRef", "name" : "'Merge Block'" }, - { "kind" : "SelectionControl" } - ] - }, - { - "opname" : "OpLabel", - "opcode" : 248, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpBranch", - "opcode" : 249, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target Label'" } - ] - }, - { - "opname" : "OpBranchConditional", - "opcode" : 250, - "operands" : [ - { "kind" : "IdRef", "name" : "'Condition'" }, - { "kind" : "IdRef", "name" : "'True Label'" }, - { "kind" : "IdRef", "name" : "'False Label'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Branch weights'" } - ] - }, - { - "opname" : "OpSwitch", - "opcode" : 251, - "operands" : [ - { "kind" : "IdRef", "name" : "'Selector'" }, - { "kind" : "IdRef", "name" : "'Default'" }, - { "kind" : "PairLiteralIntegerIdRef", "quantifier" : "*", "name" : "'Target'" } - ] - }, - { - "opname" : "OpKill", - "opcode" : 252, - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpReturn", - "opcode" : 253 - }, - { - "opname" : "OpReturnValue", - "opcode" : 254, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpUnreachable", - "opcode" : 255 - }, - { - "opname" : "OpLifetimeStart", - "opcode" : 256, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "LiteralInteger", "name" : "'Size'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpLifetimeStop", - "opcode" : 257, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "LiteralInteger", "name" : "'Size'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGroupAsyncCopy", - "opcode" : 259, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Destination'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Num Elements'" }, - { "kind" : "IdRef", "name" : "'Stride'" }, - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGroupWaitEvents", - "opcode" : 260, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Num Events'" }, - { "kind" : "IdRef", "name" : "'Events List'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGroupAll", - "opcode" : 261, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupAny", - "opcode" : 262, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupBroadcast", - "opcode" : 263, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'LocalId'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupIAdd", - "opcode" : 264, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFAdd", - "opcode" : 265, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFMin", - "opcode" : 266, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupUMin", - "opcode" : 267, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupSMin", - "opcode" : 268, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFMax", - "opcode" : 269, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupUMax", - "opcode" : 270, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupSMax", - "opcode" : 271, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpReadPipe", - "opcode" : 274, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpWritePipe", - "opcode" : 275, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReservedReadPipe", - "opcode" : 276, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Index'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReservedWritePipe", - "opcode" : 277, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Index'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReserveReadPipePackets", - "opcode" : 278, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReserveWritePipePackets", - "opcode" : 279, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpCommitReadPipe", - "opcode" : 280, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpCommitWritePipe", - "opcode" : 281, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpIsValidReserveId", - "opcode" : 282, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGetNumPipePackets", - "opcode" : 283, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGetMaxPipePackets", - "opcode" : 284, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupReserveReadPipePackets", - "opcode" : 285, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupReserveWritePipePackets", - "opcode" : 286, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupCommitReadPipe", - "opcode" : 287, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupCommitWritePipe", - "opcode" : 288, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpEnqueueMarker", - "opcode" : 291, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Queue'" }, - { "kind" : "IdRef", "name" : "'Num Events'" }, - { "kind" : "IdRef", "name" : "'Wait Events'" }, - { "kind" : "IdRef", "name" : "'Ret Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpEnqueueKernel", - "opcode" : 292, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Queue'" }, - { "kind" : "IdRef", "name" : "'Flags'" }, - { "kind" : "IdRef", "name" : "'ND Range'" }, - { "kind" : "IdRef", "name" : "'Num Events'" }, - { "kind" : "IdRef", "name" : "'Wait Events'" }, - { "kind" : "IdRef", "name" : "'Ret Event'" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Local Size'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelNDrangeSubGroupCount", - "opcode" : 293, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'ND Range'" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelNDrangeMaxSubGroupSize", - "opcode" : 294, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'ND Range'" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelWorkGroupSize", - "opcode" : 295, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelPreferredWorkGroupSizeMultiple", - "opcode" : 296, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpRetainEvent", - "opcode" : 297, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpReleaseEvent", - "opcode" : 298, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpCreateUserEvent", - "opcode" : 299, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpIsValidEvent", - "opcode" : 300, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpSetUserEventStatus", - "opcode" : 301, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" }, - { "kind" : "IdRef", "name" : "'Status'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpCaptureEventProfilingInfo", - "opcode" : 302, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" }, - { "kind" : "IdRef", "name" : "'Profiling Info'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetDefaultQueue", - "opcode" : 303, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpBuildNDRange", - "opcode" : 304, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'GlobalWorkSize'" }, - { "kind" : "IdRef", "name" : "'LocalWorkSize'" }, - { "kind" : "IdRef", "name" : "'GlobalWorkOffset'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpImageSparseSampleImplicitLod", - "opcode" : 305, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleExplicitLod", - "opcode" : 306, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleDrefImplicitLod", - "opcode" : 307, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleDrefExplicitLod", - "opcode" : 308, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleProjImplicitLod", - "opcode" : 309, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleProjExplicitLod", - "opcode" : 310, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleProjDrefImplicitLod", - "opcode" : 311, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleProjDrefExplicitLod", - "opcode" : 312, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseFetch", - "opcode" : 313, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseGather", - "opcode" : 314, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Component'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseDrefGather", - "opcode" : 315, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseTexelsResident", - "opcode" : 316, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Resident Code'" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpNoLine", - "opcode" : 317 - }, - { - "opname" : "OpAtomicFlagTestAndSet", - "opcode" : 318, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpAtomicFlagClear", - "opcode" : 319, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpImageSparseRead", - "opcode" : 320, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpDecorateId", - "opcode" : 332, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "Decoration" } - ], - "extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ] - }, - { - "opname" : "OpSubgroupBallotKHR", - "opcode" : 4421, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "opname" : "OpSubgroupFirstInvocationKHR", - "opcode" : 4422, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "opname" : "OpSubgroupAllKHR", - "opcode" : 4428, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "SubgroupVoteKHR" ] - }, - { - "opname" : "OpSubgroupAnyKHR", - "opcode" : 4429, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "SubgroupVoteKHR" ] - }, - { - "opname" : "OpSubgroupAllEqualKHR", - "opcode" : 4430, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "SubgroupVoteKHR" ] - }, - { - "opname" : "OpSubgroupReadInvocationKHR", - "opcode" : 4432, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Index'" } - ], - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "opname" : "OpGroupIAddNonUniformAMD", - "opcode" : 5000, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFAddNonUniformAMD", - "opcode" : 5001, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFMinNonUniformAMD", - "opcode" : 5002, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupUMinNonUniformAMD", - "opcode" : 5003, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupSMinNonUniformAMD", - "opcode" : 5004, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFMaxNonUniformAMD", - "opcode" : 5005, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupUMaxNonUniformAMD", - "opcode" : 5006, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupSMaxNonUniformAMD", - "opcode" : 5007, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpFragmentMaskFetchAMD", - "opcode" : 5011, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" } - ], - "capabilities" : [ "FragmentMaskAMD" ] - }, - { - "opname" : "OpFragmentFetchAMD", - "opcode" : 5012, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Fragment Index'" } - ], - "capabilities" : [ "FragmentMaskAMD" ] - }, - { - "opname" : "OpSubgroupShuffleINTEL", - "opcode" : 5571, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Data'" }, - { "kind" : "IdRef", "name" : "'InvocationId'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ] - }, - { - "opname" : "OpSubgroupShuffleDownINTEL", - "opcode" : 5572, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Current'" }, - { "kind" : "IdRef", "name" : "'Next'" }, - { "kind" : "IdRef", "name" : "'Delta'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ] - }, - { - "opname" : "OpSubgroupShuffleUpINTEL", - "opcode" : 5573, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Previous'" }, - { "kind" : "IdRef", "name" : "'Current'" }, - { "kind" : "IdRef", "name" : "'Delta'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ] - }, - { - "opname" : "OpSubgroupShuffleXorINTEL", - "opcode" : 5574, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Data'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ] - }, - { - "opname" : "OpSubgroupBlockReadINTEL", - "opcode" : 5575, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Ptr'" } - ], - "capabilities" : [ "SubgroupBufferBlockIOINTEL" ] - }, - { - "opname" : "OpSubgroupBlockWriteINTEL", - "opcode" : 5576, - "operands" : [ - { "kind" : "IdRef", "name" : "'Ptr'" }, - { "kind" : "IdRef", "name" : "'Data'" } - ], - "capabilities" : [ "SubgroupBufferBlockIOINTEL" ] - }, - { - "opname" : "OpSubgroupImageBlockReadINTEL", - "opcode" : 5577, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" } - ], - "capabilities" : [ "SubgroupImageBlockIOINTEL" ] - }, - { - "opname" : "OpSubgroupImageBlockWriteINTEL", - "opcode" : 5578, - "operands" : [ - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Data'" } - ], - "capabilities" : [ "SubgroupImageBlockIOINTEL" ] - }, - { - "opname" : "OpDecorateStringGOOGLE", - "opcode" : 5632, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "Decoration" } - ], - "extensions" : [ "SPV_GOOGLE_decorate_string" ] - }, - { - "opname" : "OpMemberDecorateStringGOOGLE", - "opcode" : 5633, - "operands" : [ - { "kind" : "IdRef", "name" : "'Struct Type'" }, - { "kind" : "LiteralInteger", "name" : "'Member'" }, - { "kind" : "Decoration" } - ], - "extensions" : [ "SPV_GOOGLE_decorate_string" ] - } - ], - "operand_kinds" : [ - { - "category" : "BitEnum", - "kind" : "ImageOperands", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Bias", - "value" : "0x0001", - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Lod", - "value" : "0x0002", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Grad", - "value" : "0x0004", - "parameters" : [ - { "kind" : "IdRef" }, - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "ConstOffset", - "value" : "0x0008", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Offset", - "value" : "0x0010", - "capabilities" : [ "ImageGatherExtended" ], - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "ConstOffsets", - "value" : "0x0020", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Sample", - "value" : "0x0040", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "MinLod", - "value" : "0x0080", - "capabilities" : [ "MinLod" ], - "parameters" : [ - { "kind" : "IdRef" } - ] - } - ] - }, - { - "category" : "BitEnum", - "kind" : "FPFastMathMode", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "NotNaN", - "value" : "0x0001", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NotInf", - "value" : "0x0002", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NSZ", - "value" : "0x0004", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "AllowRecip", - "value" : "0x0008", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Fast", - "value" : "0x0010", - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "BitEnum", - "kind" : "SelectionControl", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Flatten", - "value" : "0x0001" - }, - { - "enumerant" : "DontFlatten", - "value" : "0x0002" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "LoopControl", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Unroll", - "value" : "0x0001" - }, - { - "enumerant" : "DontUnroll", - "value" : "0x0002" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "FunctionControl", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Inline", - "value" : "0x0001" - }, - { - "enumerant" : "DontInline", - "value" : "0x0002" - }, - { - "enumerant" : "Pure", - "value" : "0x0004" - }, - { - "enumerant" : "Const", - "value" : "0x0008" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "MemorySemantics", - "enumerants" : [ - { - "enumerant" : "Relaxed", - "value" : "0x0000" - }, - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Acquire", - "value" : "0x0002" - }, - { - "enumerant" : "Release", - "value" : "0x0004" - }, - { - "enumerant" : "AcquireRelease", - "value" : "0x0008" - }, - { - "enumerant" : "SequentiallyConsistent", - "value" : "0x0010" - }, - { - "enumerant" : "UniformMemory", - "value" : "0x0040", - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SubgroupMemory", - "value" : "0x0080" - }, - { - "enumerant" : "WorkgroupMemory", - "value" : "0x0100" - }, - { - "enumerant" : "CrossWorkgroupMemory", - "value" : "0x0200" - }, - { - "enumerant" : "AtomicCounterMemory", - "value" : "0x0400", - "capabilities" : [ "AtomicStorage" ] - }, - { - "enumerant" : "ImageMemory", - "value" : "0x0800" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "MemoryAccess", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Volatile", - "value" : "0x0001" - }, - { - "enumerant" : "Aligned", - "value" : "0x0002", - "parameters" : [ - { "kind" : "LiteralInteger" } - ] - }, - { - "enumerant" : "Nontemporal", - "value" : "0x0004" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "KernelProfilingInfo", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "CmdExecTime", - "value" : "0x0001", - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "SourceLanguage", - "enumerants" : [ - { - "enumerant" : "Unknown", - "value" : 0 - }, - { - "enumerant" : "ESSL", - "value" : 1 - }, - { - "enumerant" : "GLSL", - "value" : 2 - }, - { - "enumerant" : "OpenCL_C", - "value" : 3 - }, - { - "enumerant" : "OpenCL_CPP", - "value" : 4 - }, - { - "enumerant" : "HLSL", - "value" : 5 - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ExecutionModel", - "enumerants" : [ - { - "enumerant" : "Vertex", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "TessellationControl", - "value" : 1, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "TessellationEvaluation", - "value" : 2, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Geometry", - "value" : 3, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "Fragment", - "value" : 4, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GLCompute", - "value" : 5, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Kernel", - "value" : 6, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "AddressingModel", - "enumerants" : [ - { - "enumerant" : "Logical", - "value" : 0 - }, - { - "enumerant" : "Physical32", - "value" : 1, - "capabilities" : [ "Addresses" ] - }, - { - "enumerant" : "Physical64", - "value" : 2, - "capabilities" : [ "Addresses" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "MemoryModel", - "enumerants" : [ - { - "enumerant" : "Simple", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GLSL450", - "value" : 1, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "OpenCL", - "value" : 2, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ExecutionMode", - "enumerants" : [ - { - "enumerant" : "Invocations", - "value" : 0, - "capabilities" : [ "Geometry" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Number of <>'" } - ] - }, - { - "enumerant" : "SpacingEqual", - "value" : 1, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "SpacingFractionalEven", - "value" : 2, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "SpacingFractionalOdd", - "value" : 3, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "VertexOrderCw", - "value" : 4, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "VertexOrderCcw", - "value" : 5, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "PixelCenterInteger", - "value" : 6, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "OriginUpperLeft", - "value" : 7, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "OriginLowerLeft", - "value" : 8, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "EarlyFragmentTests", - "value" : 9, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PointMode", - "value" : 10, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Xfb", - "value" : 11, - "capabilities" : [ "TransformFeedback" ] - }, - { - "enumerant" : "DepthReplacing", - "value" : 12, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DepthGreater", - "value" : 14, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DepthLess", - "value" : 15, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DepthUnchanged", - "value" : 16, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "LocalSize", - "value" : 17, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'x size'" }, - { "kind" : "LiteralInteger", "name" : "'y size'" }, - { "kind" : "LiteralInteger", "name" : "'z size'" } - ] - }, - { - "enumerant" : "LocalSizeHint", - "value" : 18, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'x size'" }, - { "kind" : "LiteralInteger", "name" : "'y size'" }, - { "kind" : "LiteralInteger", "name" : "'z size'" } - ] - }, - { - "enumerant" : "InputPoints", - "value" : 19, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "InputLines", - "value" : 20, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "InputLinesAdjacency", - "value" : 21, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "Triangles", - "value" : 22, - "capabilities" : [ "Geometry", "Tessellation" ] - }, - { - "enumerant" : "InputTrianglesAdjacency", - "value" : 23, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "Quads", - "value" : 24, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Isolines", - "value" : 25, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "OutputVertices", - "value" : 26, - "capabilities" : [ "Geometry", "Tessellation" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Vertex count'" } - ] - }, - { - "enumerant" : "OutputPoints", - "value" : 27, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "OutputLineStrip", - "value" : 28, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "OutputTriangleStrip", - "value" : 29, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "VecTypeHint", - "value" : 30, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Vector type'" } - ] - }, - { - "enumerant" : "ContractionOff", - "value" : 31, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "PostDepthCoverage", - "value" : 4446, - "capabilities" : [ "SampleMaskPostDepthCoverage" ] - }, - { - "enumerant" : "StencilRefReplacingEXT", - "value" : 5027, - "capabilities" : [ "StencilExportEXT" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "StorageClass", - "enumerants" : [ - { - "enumerant" : "UniformConstant", - "value" : 0 - }, - { - "enumerant" : "Input", - "value" : 1 - }, - { - "enumerant" : "Uniform", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Output", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Workgroup", - "value" : 4 - }, - { - "enumerant" : "CrossWorkgroup", - "value" : 5 - }, - { - "enumerant" : "Private", - "value" : 6, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Function", - "value" : 7 - }, - { - "enumerant" : "Generic", - "value" : 8, - "capabilities" : [ "GenericPointer" ] - }, - { - "enumerant" : "PushConstant", - "value" : 9, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "AtomicCounter", - "value" : 10, - "capabilities" : [ "AtomicStorage" ] - }, - { - "enumerant" : "Image", - "value" : 11 - }, - { - "enumerant" : "StorageBuffer", - "value" : 12, - "extensions" : [ - "SPV_KHR_storage_buffer_storage_class", - "SPV_KHR_variable_pointers" - ], - "capabilities" : [ "Shader" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Dim", - "enumerants" : [ - { - "enumerant" : "1D", - "value" : 0, - "capabilities" : [ "Sampled1D" ] - }, - { - "enumerant" : "2D", - "value" : 1 - }, - { - "enumerant" : "3D", - "value" : 2 - }, - { - "enumerant" : "Cube", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rect", - "value" : 4, - "capabilities" : [ "SampledRect" ] - }, - { - "enumerant" : "Buffer", - "value" : 5, - "capabilities" : [ "SampledBuffer" ] - }, - { - "enumerant" : "SubpassData", - "value" : 6, - "capabilities" : [ "InputAttachment" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "SamplerAddressingMode", - "enumerants" : [ - { - "enumerant" : "None", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ClampToEdge", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Clamp", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Repeat", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RepeatMirrored", - "value" : 4, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "SamplerFilterMode", - "enumerants" : [ - { - "enumerant" : "Nearest", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Linear", - "value" : 1, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ImageFormat", - "enumerants" : [ - { - "enumerant" : "Unknown", - "value" : 0 - }, - { - "enumerant" : "Rgba32f", - "value" : 1, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba16f", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "R32f", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8", - "value" : 4, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8Snorm", - "value" : 5, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rg32f", - "value" : 6, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16f", - "value" : 7, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R11fG11fB10f", - "value" : 8, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16f", - "value" : 9, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba16", - "value" : 10, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgb10A2", - "value" : 11, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16", - "value" : 12, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8", - "value" : 13, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16", - "value" : 14, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8", - "value" : 15, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba16Snorm", - "value" : 16, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16Snorm", - "value" : 17, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8Snorm", - "value" : 18, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16Snorm", - "value" : 19, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8Snorm", - "value" : 20, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba32i", - "value" : 21, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba16i", - "value" : 22, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8i", - "value" : 23, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "R32i", - "value" : 24, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rg32i", - "value" : 25, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16i", - "value" : 26, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8i", - "value" : 27, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16i", - "value" : 28, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8i", - "value" : 29, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba32ui", - "value" : 30, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba16ui", - "value" : 31, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8ui", - "value" : 32, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "R32ui", - "value" : 33, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgb10a2ui", - "value" : 34, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg32ui", - "value" : 35, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16ui", - "value" : 36, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8ui", - "value" : 37, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16ui", - "value" : 38, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8ui", - "value" : 39, - "capabilities" : [ "StorageImageExtendedFormats" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ImageChannelOrder", - "enumerants" : [ - { - "enumerant" : "R", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "A", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RG", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RA", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGB", - "value" : 4, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGBA", - "value" : 5, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "BGRA", - "value" : 6, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ARGB", - "value" : 7, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Intensity", - "value" : 8, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Luminance", - "value" : 9, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Rx", - "value" : 10, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGx", - "value" : 11, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGBx", - "value" : 12, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Depth", - "value" : 13, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "DepthStencil", - "value" : 14, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sRGB", - "value" : 15, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sRGBx", - "value" : 16, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sRGBA", - "value" : 17, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sBGRA", - "value" : 18, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ABGR", - "value" : 19, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ImageChannelDataType", - "enumerants" : [ - { - "enumerant" : "SnormInt8", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SnormInt16", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt8", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt16", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormShort565", - "value" : 4, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormShort555", - "value" : 5, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt101010", - "value" : 6, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SignedInt8", - "value" : 7, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SignedInt16", - "value" : 8, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SignedInt32", - "value" : 9, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnsignedInt8", - "value" : 10, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnsignedInt16", - "value" : 11, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnsignedInt32", - "value" : 12, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "HalfFloat", - "value" : 13, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Float", - "value" : 14, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt24", - "value" : 15, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt101010_2", - "value" : 16, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "FPRoundingMode", - "enumerants" : [ - { - "enumerant" : "RTE", - "value" : 0, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ] - }, - { - "enumerant" : "RTZ", - "value" : 1, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ] - }, - { - "enumerant" : "RTP", - "value" : 2, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ] - }, - { - "enumerant" : "RTN", - "value" : 3, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "LinkageType", - "enumerants" : [ - { - "enumerant" : "Export", - "value" : 0, - "capabilities" : [ "Linkage" ] - }, - { - "enumerant" : "Import", - "value" : 1, - "capabilities" : [ "Linkage" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "AccessQualifier", - "enumerants" : [ - { - "enumerant" : "ReadOnly", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "WriteOnly", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ReadWrite", - "value" : 2, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "FunctionParameterAttribute", - "enumerants" : [ - { - "enumerant" : "Zext", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Sext", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ByVal", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Sret", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoAlias", - "value" : 4, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoCapture", - "value" : 5, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoWrite", - "value" : 6, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoReadWrite", - "value" : 7, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Decoration", - "enumerants" : [ - { - "enumerant" : "RelaxedPrecision", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SpecId", - "value" : 1, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Specialization Constant ID'" } - ] - }, - { - "enumerant" : "Block", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "BufferBlock", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "RowMajor", - "value" : 4, - "capabilities" : [ "Matrix" ] - }, - { - "enumerant" : "ColMajor", - "value" : 5, - "capabilities" : [ "Matrix" ] - }, - { - "enumerant" : "ArrayStride", - "value" : 6, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Array Stride'" } - ] - }, - { - "enumerant" : "MatrixStride", - "value" : 7, - "capabilities" : [ "Matrix" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Matrix Stride'" } - ] - }, - { - "enumerant" : "GLSLShared", - "value" : 8, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GLSLPacked", - "value" : 9, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "CPacked", - "value" : 10, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "BuiltIn", - "value" : 11, - "parameters" : [ - { "kind" : "BuiltIn" } - ] - }, - { - "enumerant" : "NoPerspective", - "value" : 13, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Flat", - "value" : 14, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Patch", - "value" : 15, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Centroid", - "value" : 16, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Sample", - "value" : 17, - "capabilities" : [ "SampleRateShading" ] - }, - { - "enumerant" : "Invariant", - "value" : 18, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Restrict", - "value" : 19 - }, - { - "enumerant" : "Aliased", - "value" : 20 - }, - { - "enumerant" : "Volatile", - "value" : 21 - }, - { - "enumerant" : "Constant", - "value" : 22, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Coherent", - "value" : 23 - }, - { - "enumerant" : "NonWritable", - "value" : 24 - }, - { - "enumerant" : "NonReadable", - "value" : 25 - }, - { - "enumerant" : "Uniform", - "value" : 26, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SaturatedConversion", - "value" : 28, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Stream", - "value" : 29, - "capabilities" : [ "GeometryStreams" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Stream Number'" } - ] - }, - { - "enumerant" : "Location", - "value" : 30, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Location'" } - ] - }, - { - "enumerant" : "Component", - "value" : 31, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Component'" } - ] - }, - { - "enumerant" : "Index", - "value" : 32, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Index'" } - ] - }, - { - "enumerant" : "Binding", - "value" : 33, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Binding Point'" } - ] - }, - { - "enumerant" : "DescriptorSet", - "value" : 34, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Descriptor Set'" } - ] - }, - { - "enumerant" : "Offset", - "value" : 35, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Byte Offset'" } - ] - }, - { - "enumerant" : "XfbBuffer", - "value" : 36, - "capabilities" : [ "TransformFeedback" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'XFB Buffer Number'" } - ] - }, - { - "enumerant" : "XfbStride", - "value" : 37, - "capabilities" : [ "TransformFeedback" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'XFB Stride'" } - ] - }, - { - "enumerant" : "FuncParamAttr", - "value" : 38, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "FunctionParameterAttribute", "name" : "'Function Parameter Attribute'" } - ] - }, - { - "enumerant" : "FPRoundingMode", - "value" : 39, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ], - "parameters" : [ - { "kind" : "FPRoundingMode", "name" : "'Floating-Point Rounding Mode'" } - ] - }, - { - "enumerant" : "FPFastMathMode", - "value" : 40, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "FPFastMathMode", "name" : "'Fast-Math Mode'" } - ] - }, - { - "enumerant" : "LinkageAttributes", - "value" : 41, - "capabilities" : [ "Linkage" ], - "parameters" : [ - { "kind" : "LiteralString", "name" : "'Name'" }, - { "kind" : "LinkageType", "name" : "'Linkage Type'" } - ] - }, - { - "enumerant" : "NoContraction", - "value" : 42, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InputAttachmentIndex", - "value" : 43, - "capabilities" : [ "InputAttachment" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Attachment Index'" } - ] - }, - { - "enumerant" : "Alignment", - "value" : 44, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Alignment'" } - ] - }, - { - "enumerant" : "ExplicitInterpAMD", - "value" : 4999 - }, - { - "enumerant" : "OverrideCoverageNV", - "value" : 5248, - "capabilities" : [ "SampleMaskOverrideCoverageNV" ] - }, - { - "enumerant" : "PassthroughNV", - "value" : 5250, - "capabilities" : [ "GeometryShaderPassthroughNV" ] - }, - { - "enumerant" : "ViewportRelativeNV", - "value" : 5252, - "capabilities" : [ "ShaderViewportMaskNV" ] - }, - { - "enumerant" : "SecondaryViewportRelativeNV", - "value" : 5256, - "capabilities" : [ "ShaderStereoViewNV" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Offset'" } - ] - }, - { - "enumerant" : "HlslCounterBufferGOOGLE", - "value" : 5634, - "parameters" : [ - { "kind" : "IdRef", "name" : "'Counter Buffer'" } - ], - "extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ] - }, - { - "enumerant" : "HlslSemanticGOOGLE", - "value" : 5635, - "parameters" : [ - { "kind" : "LiteralString", "name" : "'Semantic'" } - ], - "extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "BuiltIn", - "enumerants" : [ - { - "enumerant" : "Position", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PointSize", - "value" : 1, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ClipDistance", - "value" : 3, - "capabilities" : [ "ClipDistance" ] - }, - { - "enumerant" : "CullDistance", - "value" : 4, - "capabilities" : [ "CullDistance" ] - }, - { - "enumerant" : "VertexId", - "value" : 5, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InstanceId", - "value" : 6, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PrimitiveId", - "value" : 7, - "capabilities" : [ "Geometry", "Tessellation" ] - }, - { - "enumerant" : "InvocationId", - "value" : 8, - "capabilities" : [ "Geometry", "Tessellation" ] - }, - { - "enumerant" : "Layer", - "value" : 9, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "ViewportIndex", - "value" : 10, - "capabilities" : [ "MultiViewport" ] - }, - { - "enumerant" : "TessLevelOuter", - "value" : 11, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "TessLevelInner", - "value" : 12, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "TessCoord", - "value" : 13, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "PatchVertices", - "value" : 14, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "FragCoord", - "value" : 15, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PointCoord", - "value" : 16, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "FrontFacing", - "value" : 17, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SampleId", - "value" : 18, - "capabilities" : [ "SampleRateShading" ] - }, - { - "enumerant" : "SamplePosition", - "value" : 19, - "capabilities" : [ "SampleRateShading" ] - }, - { - "enumerant" : "SampleMask", - "value" : 20, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "FragDepth", - "value" : 22, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "HelperInvocation", - "value" : 23, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "NumWorkgroups", - "value" : 24 - }, - { - "enumerant" : "WorkgroupSize", - "value" : 25 - }, - { - "enumerant" : "WorkgroupId", - "value" : 26 - }, - { - "enumerant" : "LocalInvocationId", - "value" : 27 - }, - { - "enumerant" : "GlobalInvocationId", - "value" : 28 - }, - { - "enumerant" : "LocalInvocationIndex", - "value" : 29 - }, - { - "enumerant" : "WorkDim", - "value" : 30, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "GlobalSize", - "value" : 31, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "EnqueuedWorkgroupSize", - "value" : 32, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "GlobalOffset", - "value" : 33, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "GlobalLinearId", - "value" : 34, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupSize", - "value" : 36, - "capabilities" : [ "Kernel", "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupMaxSize", - "value" : 37, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NumSubgroups", - "value" : 38, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NumEnqueuedSubgroups", - "value" : 39, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupId", - "value" : 40, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupLocalInvocationId", - "value" : 41, - "capabilities" : [ "Kernel", "SubgroupBallotKHR" ] - }, - { - "enumerant" : "VertexIndex", - "value" : 42, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InstanceIndex", - "value" : 43, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SubgroupEqMaskKHR", - "value" : 4416, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupGeMaskKHR", - "value" : 4417, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupGtMaskKHR", - "value" : 4418, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupLeMaskKHR", - "value" : 4419, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupLtMaskKHR", - "value" : 4420, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "BaseVertex", - "value" : 4424, - "capabilities" : [ "DrawParameters" ] - }, - { - "enumerant" : "BaseInstance", - "value" : 4425, - "capabilities" : [ "DrawParameters" ] - }, - { - "enumerant" : "DrawIndex", - "value" : 4426, - "capabilities" : [ "DrawParameters" ] - }, - { - "enumerant" : "DeviceIndex", - "value" : 4438, - "capabilities" : [ "DeviceGroup" ] - }, - { - "enumerant" : "ViewIndex", - "value" : 4440, - "capabilities" : [ "MultiView" ] - }, - { - "enumerant" : "BaryCoordNoPerspAMD", - "value" : 4992 - }, - { - "enumerant" : "BaryCoordNoPerspCentroidAMD", - "value" : 4993 - }, - { - "enumerant" : "BaryCoordNoPerspSampleAMD", - "value" : 4994 - }, - { - "enumerant" : "BaryCoordSmoothAMD", - "value" : 4995 - }, - { - "enumerant" : "BaryCoordSmoothCentroidAMD", - "value" : 4996 - }, - { - "enumerant" : "BaryCoordSmoothSampleAMD", - "value" : 4997 - }, - { - "enumerant" : "BaryCoordPullModelAMD", - "value" : 4998 - }, - { - "enumerant" : "FragStencilRefEXT", - "value" : 5014, - "capabilities" : [ "StencilExportEXT" ] - }, - { - "enumerant" : "ViewportMaskNV", - "value" : 5253, - "capabilities" : [ "ShaderViewportMaskNV" ] - }, - { - "enumerant" : "SecondaryPositionNV", - "value" : 5257, - "capabilities" : [ "ShaderStereoViewNV" ] - }, - { - "enumerant" : "SecondaryViewportMaskNV", - "value" : 5258, - "capabilities" : [ "ShaderStereoViewNV" ] - }, - { - "enumerant" : "PositionPerViewNV", - "value" : 5261, - "capabilities" : [ "PerViewAttributesNV" ] - }, - { - "enumerant" : "ViewportMaskPerViewNV", - "value" : 5262, - "capabilities" : [ "PerViewAttributesNV" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Scope", - "enumerants" : [ - { - "enumerant" : "CrossDevice", - "value" : 0 - }, - { - "enumerant" : "Device", - "value" : 1 - }, - { - "enumerant" : "Workgroup", - "value" : 2 - }, - { - "enumerant" : "Subgroup", - "value" : 3 - }, - { - "enumerant" : "Invocation", - "value" : 4 - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "GroupOperation", - "enumerants" : [ - { - "enumerant" : "Reduce", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "InclusiveScan", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ExclusiveScan", - "value" : 2, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "KernelEnqueueFlags", - "enumerants" : [ - { - "enumerant" : "NoWait", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "WaitKernel", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "WaitWorkGroup", - "value" : 2, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Capability", - "enumerants" : [ - { - "enumerant" : "Matrix", - "value" : 0 - }, - { - "enumerant" : "Shader", - "value" : 1, - "capabilities" : [ "Matrix" ] - }, - { - "enumerant" : "Geometry", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Tessellation", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Addresses", - "value" : 4 - }, - { - "enumerant" : "Linkage", - "value" : 5 - }, - { - "enumerant" : "Kernel", - "value" : 6 - }, - { - "enumerant" : "Vector16", - "value" : 7, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Float16Buffer", - "value" : 8, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Float16", - "value" : 9 - }, - { - "enumerant" : "Float64", - "value" : 10 - }, - { - "enumerant" : "Int64", - "value" : 11 - }, - { - "enumerant" : "Int64Atomics", - "value" : 12, - "capabilities" : [ "Int64" ] - }, - { - "enumerant" : "ImageBasic", - "value" : 13, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ImageReadWrite", - "value" : 14, - "capabilities" : [ "ImageBasic" ] - }, - { - "enumerant" : "ImageMipmap", - "value" : 15, - "capabilities" : [ "ImageBasic" ] - }, - { - "enumerant" : "Pipes", - "value" : 17, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Groups", - "value" : 18 - }, - { - "enumerant" : "DeviceEnqueue", - "value" : 19, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "LiteralSampler", - "value" : 20, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "AtomicStorage", - "value" : 21, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Int16", - "value" : 22 - }, - { - "enumerant" : "TessellationPointSize", - "value" : 23, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "GeometryPointSize", - "value" : 24, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "ImageGatherExtended", - "value" : 25, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageMultisample", - "value" : 27, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "UniformBufferArrayDynamicIndexing", - "value" : 28, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SampledImageArrayDynamicIndexing", - "value" : 29, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageBufferArrayDynamicIndexing", - "value" : 30, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageArrayDynamicIndexing", - "value" : 31, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ClipDistance", - "value" : 32, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "CullDistance", - "value" : 33, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ImageCubeArray", - "value" : 34, - "capabilities" : [ "SampledCubeArray" ] - }, - { - "enumerant" : "SampleRateShading", - "value" : 35, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ImageRect", - "value" : 36, - "capabilities" : [ "SampledRect" ] - }, - { - "enumerant" : "SampledRect", - "value" : 37, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GenericPointer", - "value" : 38, - "capabilities" : [ "Addresses" ] - }, - { - "enumerant" : "Int8", - "value" : 39, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "InputAttachment", - "value" : 40, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SparseResidency", - "value" : 41, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "MinLod", - "value" : 42, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Sampled1D", - "value" : 43 - }, - { - "enumerant" : "Image1D", - "value" : 44, - "capabilities" : [ "Sampled1D" ] - }, - { - "enumerant" : "SampledCubeArray", - "value" : 45, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SampledBuffer", - "value" : 46 - }, - { - "enumerant" : "ImageBuffer", - "value" : 47, - "capabilities" : [ "SampledBuffer" ] - }, - { - "enumerant" : "ImageMSArray", - "value" : 48, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageExtendedFormats", - "value" : 49, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ImageQuery", - "value" : 50, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DerivativeControl", - "value" : 51, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InterpolationFunction", - "value" : 52, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "TransformFeedback", - "value" : 53, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GeometryStreams", - "value" : 54, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "StorageImageReadWithoutFormat", - "value" : 55, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageWriteWithoutFormat", - "value" : 56, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "MultiViewport", - "value" : 57, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "SubgroupBallotKHR", - "value" : 4423, - "extensions" : [ "SPV_KHR_shader_ballot" ] - }, - { - "enumerant" : "DrawParameters", - "value" : 4427, - "extensions" : [ "SPV_KHR_shader_draw_parameters" ] - }, - { - "enumerant" : "SubgroupVoteKHR", - "value" : 4431, - "extensions" : [ "SPV_KHR_subgroup_vote" ] - }, - { - "enumerant" : "StorageBuffer16BitAccess", - "value" : 4433, - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "StorageUniformBufferBlock16", - "value" : 4433, - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "UniformAndStorageBuffer16BitAccess", - "value" : 4434, - "capabilities" : [ - "StorageBuffer16BitAccess", - "StorageUniformBufferBlock16" - ], - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "StorageUniform16", - "value" : 4434, - "capabilities" : [ - "StorageBuffer16BitAccess", - "StorageUniformBufferBlock16" - ], - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "StoragePushConstant16", - "value" : 4435, - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "StorageInputOutput16", - "value" : 4436, - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "DeviceGroup", - "value" : 4437, - "extensions" : [ "SPV_KHR_device_group" ] - }, - { - "enumerant" : "MultiView", - "value" : 4439, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_KHR_multiview" ] - }, - { - "enumerant" : "VariablePointersStorageBuffer", - "value" : 4441, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_KHR_variable_pointers" ] - }, - { - "enumerant" : "VariablePointers", - "value" : 4442, - "capabilities" : [ "VariablePointersStorageBuffer" ], - "extensions" : [ "SPV_KHR_variable_pointers" ] - }, - { - "enumerant": "AtomicStorageOps", - "value": 4445, - "extensions": [ "SPV_KHR_shader_atomic_counter_ops" ] - }, - { - "enumerant" : "SampleMaskPostDepthCoverage", - "value" : 4447, - "extensions" : [ "SPV_KHR_post_depth_coverage" ] - }, - { - "enumerant" : "ImageGatherBiasLodAMD", - "value" : 5009, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_AMD_texture_gather_bias_lod" ] - }, - { - "enumerant" : "FragmentMaskAMD", - "value" : 5010, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_AMD_shader_fragment_mask" ] - }, - { - "enumerant" : "StencilExportEXT", - "value" : 5013, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_EXT_shader_stencil_export" ] - }, - { - "enumerant" : "ImageReadWriteLodAMD", - "value" : 5015, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_AMD_shader_image_load_store_lod" ] - }, - { - "enumerant" : "SampleMaskOverrideCoverageNV", - "value" : 5249, - "capabilities" : [ "SampleRateShading" ], - "extensions" : [ "SPV_NV_sample_mask_override_coverage" ] - }, - { - "enumerant" : "GeometryShaderPassthroughNV", - "value" : 5251, - "capabilities" : [ "Geometry" ], - "extensions" : [ "SPV_NV_geometry_shader_passthrough" ] - }, - { - "enumerant" : "ShaderViewportIndexLayerEXT", - "value" : 5254, - "capabilities" : [ "MultiViewport" ], - "extensions" : [ "SPV_EXT_shader_viewport_index_layer" ] - }, - { - "enumerant" : "ShaderViewportIndexLayerNV", - "value" : 5254, - "capabilities" : [ "MultiViewport" ], - "extensions" : [ "SPV_NV_viewport_array2" ] - }, - { - "enumerant" : "ShaderViewportMaskNV", - "value" : 5255, - "capabilities" : [ "ShaderViewportIndexLayerNV" ], - "extensions" : [ "SPV_NV_viewport_array2" ] - }, - { - "enumerant" : "ShaderStereoViewNV", - "value" : 5259, - "capabilities" : [ "ShaderViewportMaskNV" ], - "extensions" : [ "SPV_NV_stereo_view_rendering" ] - }, - { - "enumerant" : "PerViewAttributesNV", - "value" : 5260, - "capabilities" : [ "MultiView" ], - "extensions" : [ "SPV_NVX_multiview_per_view_attributes" ] - }, - { - "enumerant" : "SubgroupShuffleINTEL", - "value" : 5568, - "extensions" : [ "SPV_INTEL_subgroups" ] - }, - { - "enumerant" : "SubgroupBufferBlockIOINTEL", - "value" : 5569, - "extensions" : [ "SPV_INTEL_subgroups" ] - }, - { - "enumerant" : "SubgroupImageBlockIOINTEL", - "value" : 5570, - "extensions" : [ "SPV_INTEL_subgroups" ] - } - ] - }, - { - "category" : "Id", - "kind" : "IdResultType", - "doc" : "Reference to an representing the result's type of the enclosing instruction" - }, - { - "category" : "Id", - "kind" : "IdResult", - "doc" : "Definition of an representing the result of the enclosing instruction" - }, - { - "category" : "Id", - "kind" : "IdMemorySemantics", - "doc" : "Reference to an representing a 32-bit integer that is a mask from the MemorySemantics operand kind" - }, - { - "category" : "Id", - "kind" : "IdScope", - "doc" : "Reference to an representing a 32-bit integer that is a mask from the Scope operand kind" - }, - { - "category" : "Id", - "kind" : "IdRef", - "doc" : "Reference to an " - }, - { - "category" : "Literal", - "kind" : "LiteralInteger", - "doc" : "An integer consuming one or more words" - }, - { - "category" : "Literal", - "kind" : "LiteralString", - "doc" : "A null-terminated stream of characters consuming an integral number of words" - }, - { - "category" : "Literal", - "kind" : "LiteralContextDependentNumber", - "doc" : "A literal number whose size and format are determined by a previous operand in the enclosing instruction" - }, - { - "category" : "Literal", - "kind" : "LiteralExtInstInteger", - "doc" : "A 32-bit unsigned integer indicating which instruction to use and determining the layout of following operands (for OpExtInst)" - }, - { - "category" : "Literal", - "kind" : "LiteralSpecConstantOpInteger", - "doc" : "An opcode indicating the operation to be performed and determining the layout of following operands (for OpSpecConstantOp)" - }, - { - "category" : "Composite", - "kind" : "PairLiteralIntegerIdRef", - "bases" : [ "LiteralInteger", "IdRef" ] - }, - { - "category" : "Composite", - "kind" : "PairIdRefLiteralInteger", - "bases" : [ "IdRef", "LiteralInteger" ] - }, - { - "category" : "Composite", - "kind" : "PairIdRefIdRef", - "bases" : [ "IdRef", "IdRef" ] - } - ] -} diff --git a/include/spirv/1.0/spirv.cs b/include/spirv/1.0/spirv.cs deleted file mode 100644 index de325cc4..00000000 --- a/include/spirv/1.0/spirv.cs +++ /dev/null @@ -1,993 +0,0 @@ -// Copyright (c) 2014-2018 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -// This header is automatically generated by the same tool that creates -// the Binary Section of the SPIR-V specification. - -// Enumeration tokens for SPIR-V, in various styles: -// C, C++, C++11, JSON, Lua, Python, C# -// -// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -// - C# will use enum classes in the Specification class located in the "Spv" namespace, e.g.: Spv.Specification.SourceLanguage.GLSL -// -// Some tokens act like mask values, which can be OR'd together, -// while others are mutually exclusive. The mask-like ones have -// "Mask" in their name, and a parallel enum that has the shift -// amount (1 << x) for each corresponding enumerant. - -namespace Spv -{ - - public static class Specification - { - public const uint MagicNumber = 0x07230203; - public const uint Version = 0x00010000; - public const uint Revision = 12; - public const uint OpCodeMask = 0xffff; - public const uint WordCountShift = 16; - - public enum SourceLanguage - { - Unknown = 0, - ESSL = 1, - GLSL = 2, - OpenCL_C = 3, - OpenCL_CPP = 4, - HLSL = 5, - } - - public enum ExecutionModel - { - Vertex = 0, - TessellationControl = 1, - TessellationEvaluation = 2, - Geometry = 3, - Fragment = 4, - GLCompute = 5, - Kernel = 6, - } - - public enum AddressingModel - { - Logical = 0, - Physical32 = 1, - Physical64 = 2, - } - - public enum MemoryModel - { - Simple = 0, - GLSL450 = 1, - OpenCL = 2, - } - - public enum ExecutionMode - { - Invocations = 0, - SpacingEqual = 1, - SpacingFractionalEven = 2, - SpacingFractionalOdd = 3, - VertexOrderCw = 4, - VertexOrderCcw = 5, - PixelCenterInteger = 6, - OriginUpperLeft = 7, - OriginLowerLeft = 8, - EarlyFragmentTests = 9, - PointMode = 10, - Xfb = 11, - DepthReplacing = 12, - DepthGreater = 14, - DepthLess = 15, - DepthUnchanged = 16, - LocalSize = 17, - LocalSizeHint = 18, - InputPoints = 19, - InputLines = 20, - InputLinesAdjacency = 21, - Triangles = 22, - InputTrianglesAdjacency = 23, - Quads = 24, - Isolines = 25, - OutputVertices = 26, - OutputPoints = 27, - OutputLineStrip = 28, - OutputTriangleStrip = 29, - VecTypeHint = 30, - ContractionOff = 31, - PostDepthCoverage = 4446, - StencilRefReplacingEXT = 5027, - } - - public enum StorageClass - { - UniformConstant = 0, - Input = 1, - Uniform = 2, - Output = 3, - Workgroup = 4, - CrossWorkgroup = 5, - Private = 6, - Function = 7, - Generic = 8, - PushConstant = 9, - AtomicCounter = 10, - Image = 11, - StorageBuffer = 12, - } - - public enum Dim - { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - Cube = 3, - Rect = 4, - Buffer = 5, - SubpassData = 6, - } - - public enum SamplerAddressingMode - { - None = 0, - ClampToEdge = 1, - Clamp = 2, - Repeat = 3, - RepeatMirrored = 4, - } - - public enum SamplerFilterMode - { - Nearest = 0, - Linear = 1, - } - - public enum ImageFormat - { - Unknown = 0, - Rgba32f = 1, - Rgba16f = 2, - R32f = 3, - Rgba8 = 4, - Rgba8Snorm = 5, - Rg32f = 6, - Rg16f = 7, - R11fG11fB10f = 8, - R16f = 9, - Rgba16 = 10, - Rgb10A2 = 11, - Rg16 = 12, - Rg8 = 13, - R16 = 14, - R8 = 15, - Rgba16Snorm = 16, - Rg16Snorm = 17, - Rg8Snorm = 18, - R16Snorm = 19, - R8Snorm = 20, - Rgba32i = 21, - Rgba16i = 22, - Rgba8i = 23, - R32i = 24, - Rg32i = 25, - Rg16i = 26, - Rg8i = 27, - R16i = 28, - R8i = 29, - Rgba32ui = 30, - Rgba16ui = 31, - Rgba8ui = 32, - R32ui = 33, - Rgb10a2ui = 34, - Rg32ui = 35, - Rg16ui = 36, - Rg8ui = 37, - R16ui = 38, - R8ui = 39, - } - - public enum ImageChannelOrder - { - R = 0, - A = 1, - RG = 2, - RA = 3, - RGB = 4, - RGBA = 5, - BGRA = 6, - ARGB = 7, - Intensity = 8, - Luminance = 9, - Rx = 10, - RGx = 11, - RGBx = 12, - Depth = 13, - DepthStencil = 14, - sRGB = 15, - sRGBx = 16, - sRGBA = 17, - sBGRA = 18, - ABGR = 19, - } - - public enum ImageChannelDataType - { - SnormInt8 = 0, - SnormInt16 = 1, - UnormInt8 = 2, - UnormInt16 = 3, - UnormShort565 = 4, - UnormShort555 = 5, - UnormInt101010 = 6, - SignedInt8 = 7, - SignedInt16 = 8, - SignedInt32 = 9, - UnsignedInt8 = 10, - UnsignedInt16 = 11, - UnsignedInt32 = 12, - HalfFloat = 13, - Float = 14, - UnormInt24 = 15, - UnormInt101010_2 = 16, - } - - public enum ImageOperandsShift - { - Bias = 0, - Lod = 1, - Grad = 2, - ConstOffset = 3, - Offset = 4, - ConstOffsets = 5, - Sample = 6, - MinLod = 7, - } - - public enum ImageOperandsMask - { - MaskNone = 0, - Bias = 0x00000001, - Lod = 0x00000002, - Grad = 0x00000004, - ConstOffset = 0x00000008, - Offset = 0x00000010, - ConstOffsets = 0x00000020, - Sample = 0x00000040, - MinLod = 0x00000080, - } - - public enum FPFastMathModeShift - { - NotNaN = 0, - NotInf = 1, - NSZ = 2, - AllowRecip = 3, - Fast = 4, - } - - public enum FPFastMathModeMask - { - MaskNone = 0, - NotNaN = 0x00000001, - NotInf = 0x00000002, - NSZ = 0x00000004, - AllowRecip = 0x00000008, - Fast = 0x00000010, - } - - public enum FPRoundingMode - { - RTE = 0, - RTZ = 1, - RTP = 2, - RTN = 3, - } - - public enum LinkageType - { - Export = 0, - Import = 1, - } - - public enum AccessQualifier - { - ReadOnly = 0, - WriteOnly = 1, - ReadWrite = 2, - } - - public enum FunctionParameterAttribute - { - Zext = 0, - Sext = 1, - ByVal = 2, - Sret = 3, - NoAlias = 4, - NoCapture = 5, - NoWrite = 6, - NoReadWrite = 7, - } - - public enum Decoration - { - RelaxedPrecision = 0, - SpecId = 1, - Block = 2, - BufferBlock = 3, - RowMajor = 4, - ColMajor = 5, - ArrayStride = 6, - MatrixStride = 7, - GLSLShared = 8, - GLSLPacked = 9, - CPacked = 10, - BuiltIn = 11, - NoPerspective = 13, - Flat = 14, - Patch = 15, - Centroid = 16, - Sample = 17, - Invariant = 18, - Restrict = 19, - Aliased = 20, - Volatile = 21, - Constant = 22, - Coherent = 23, - NonWritable = 24, - NonReadable = 25, - Uniform = 26, - SaturatedConversion = 28, - Stream = 29, - Location = 30, - Component = 31, - Index = 32, - Binding = 33, - DescriptorSet = 34, - Offset = 35, - XfbBuffer = 36, - XfbStride = 37, - FuncParamAttr = 38, - FPRoundingMode = 39, - FPFastMathMode = 40, - LinkageAttributes = 41, - NoContraction = 42, - InputAttachmentIndex = 43, - Alignment = 44, - ExplicitInterpAMD = 4999, - OverrideCoverageNV = 5248, - PassthroughNV = 5250, - ViewportRelativeNV = 5252, - SecondaryViewportRelativeNV = 5256, - HlslCounterBufferGOOGLE = 5634, - HlslSemanticGOOGLE = 5635, - } - - public enum BuiltIn - { - Position = 0, - PointSize = 1, - ClipDistance = 3, - CullDistance = 4, - VertexId = 5, - InstanceId = 6, - PrimitiveId = 7, - InvocationId = 8, - Layer = 9, - ViewportIndex = 10, - TessLevelOuter = 11, - TessLevelInner = 12, - TessCoord = 13, - PatchVertices = 14, - FragCoord = 15, - PointCoord = 16, - FrontFacing = 17, - SampleId = 18, - SamplePosition = 19, - SampleMask = 20, - FragDepth = 22, - HelperInvocation = 23, - NumWorkgroups = 24, - WorkgroupSize = 25, - WorkgroupId = 26, - LocalInvocationId = 27, - GlobalInvocationId = 28, - LocalInvocationIndex = 29, - WorkDim = 30, - GlobalSize = 31, - EnqueuedWorkgroupSize = 32, - GlobalOffset = 33, - GlobalLinearId = 34, - SubgroupSize = 36, - SubgroupMaxSize = 37, - NumSubgroups = 38, - NumEnqueuedSubgroups = 39, - SubgroupId = 40, - SubgroupLocalInvocationId = 41, - VertexIndex = 42, - InstanceIndex = 43, - SubgroupEqMaskKHR = 4416, - SubgroupGeMaskKHR = 4417, - SubgroupGtMaskKHR = 4418, - SubgroupLeMaskKHR = 4419, - SubgroupLtMaskKHR = 4420, - BaseVertex = 4424, - BaseInstance = 4425, - DrawIndex = 4426, - DeviceIndex = 4438, - ViewIndex = 4440, - BaryCoordNoPerspAMD = 4992, - BaryCoordNoPerspCentroidAMD = 4993, - BaryCoordNoPerspSampleAMD = 4994, - BaryCoordSmoothAMD = 4995, - BaryCoordSmoothCentroidAMD = 4996, - BaryCoordSmoothSampleAMD = 4997, - BaryCoordPullModelAMD = 4998, - FragStencilRefEXT = 5014, - ViewportMaskNV = 5253, - SecondaryPositionNV = 5257, - SecondaryViewportMaskNV = 5258, - PositionPerViewNV = 5261, - ViewportMaskPerViewNV = 5262, - } - - public enum SelectionControlShift - { - Flatten = 0, - DontFlatten = 1, - } - - public enum SelectionControlMask - { - MaskNone = 0, - Flatten = 0x00000001, - DontFlatten = 0x00000002, - } - - public enum LoopControlShift - { - Unroll = 0, - DontUnroll = 1, - } - - public enum LoopControlMask - { - MaskNone = 0, - Unroll = 0x00000001, - DontUnroll = 0x00000002, - } - - public enum FunctionControlShift - { - Inline = 0, - DontInline = 1, - Pure = 2, - Const = 3, - } - - public enum FunctionControlMask - { - MaskNone = 0, - Inline = 0x00000001, - DontInline = 0x00000002, - Pure = 0x00000004, - Const = 0x00000008, - } - - public enum MemorySemanticsShift - { - Acquire = 1, - Release = 2, - AcquireRelease = 3, - SequentiallyConsistent = 4, - UniformMemory = 6, - SubgroupMemory = 7, - WorkgroupMemory = 8, - CrossWorkgroupMemory = 9, - AtomicCounterMemory = 10, - ImageMemory = 11, - } - - public enum MemorySemanticsMask - { - MaskNone = 0, - Acquire = 0x00000002, - Release = 0x00000004, - AcquireRelease = 0x00000008, - SequentiallyConsistent = 0x00000010, - UniformMemory = 0x00000040, - SubgroupMemory = 0x00000080, - WorkgroupMemory = 0x00000100, - CrossWorkgroupMemory = 0x00000200, - AtomicCounterMemory = 0x00000400, - ImageMemory = 0x00000800, - } - - public enum MemoryAccessShift - { - Volatile = 0, - Aligned = 1, - Nontemporal = 2, - } - - public enum MemoryAccessMask - { - MaskNone = 0, - Volatile = 0x00000001, - Aligned = 0x00000002, - Nontemporal = 0x00000004, - } - - public enum Scope - { - CrossDevice = 0, - Device = 1, - Workgroup = 2, - Subgroup = 3, - Invocation = 4, - } - - public enum GroupOperation - { - Reduce = 0, - InclusiveScan = 1, - ExclusiveScan = 2, - } - - public enum KernelEnqueueFlags - { - NoWait = 0, - WaitKernel = 1, - WaitWorkGroup = 2, - } - - public enum KernelProfilingInfoShift - { - CmdExecTime = 0, - } - - public enum KernelProfilingInfoMask - { - MaskNone = 0, - CmdExecTime = 0x00000001, - } - - public enum Capability - { - Matrix = 0, - Shader = 1, - Geometry = 2, - Tessellation = 3, - Addresses = 4, - Linkage = 5, - Kernel = 6, - Vector16 = 7, - Float16Buffer = 8, - Float16 = 9, - Float64 = 10, - Int64 = 11, - Int64Atomics = 12, - ImageBasic = 13, - ImageReadWrite = 14, - ImageMipmap = 15, - Pipes = 17, - Groups = 18, - DeviceEnqueue = 19, - LiteralSampler = 20, - AtomicStorage = 21, - Int16 = 22, - TessellationPointSize = 23, - GeometryPointSize = 24, - ImageGatherExtended = 25, - StorageImageMultisample = 27, - UniformBufferArrayDynamicIndexing = 28, - SampledImageArrayDynamicIndexing = 29, - StorageBufferArrayDynamicIndexing = 30, - StorageImageArrayDynamicIndexing = 31, - ClipDistance = 32, - CullDistance = 33, - ImageCubeArray = 34, - SampleRateShading = 35, - ImageRect = 36, - SampledRect = 37, - GenericPointer = 38, - Int8 = 39, - InputAttachment = 40, - SparseResidency = 41, - MinLod = 42, - Sampled1D = 43, - Image1D = 44, - SampledCubeArray = 45, - SampledBuffer = 46, - ImageBuffer = 47, - ImageMSArray = 48, - StorageImageExtendedFormats = 49, - ImageQuery = 50, - DerivativeControl = 51, - InterpolationFunction = 52, - TransformFeedback = 53, - GeometryStreams = 54, - StorageImageReadWithoutFormat = 55, - StorageImageWriteWithoutFormat = 56, - MultiViewport = 57, - SubgroupBallotKHR = 4423, - DrawParameters = 4427, - SubgroupVoteKHR = 4431, - StorageBuffer16BitAccess = 4433, - StorageUniformBufferBlock16 = 4433, - StorageUniform16 = 4434, - UniformAndStorageBuffer16BitAccess = 4434, - StoragePushConstant16 = 4435, - StorageInputOutput16 = 4436, - DeviceGroup = 4437, - MultiView = 4439, - VariablePointersStorageBuffer = 4441, - VariablePointers = 4442, - AtomicStorageOps = 4445, - SampleMaskPostDepthCoverage = 4447, - ImageGatherBiasLodAMD = 5009, - FragmentMaskAMD = 5010, - StencilExportEXT = 5013, - ImageReadWriteLodAMD = 5015, - SampleMaskOverrideCoverageNV = 5249, - GeometryShaderPassthroughNV = 5251, - ShaderViewportIndexLayerEXT = 5254, - ShaderViewportIndexLayerNV = 5254, - ShaderViewportMaskNV = 5255, - ShaderStereoViewNV = 5259, - PerViewAttributesNV = 5260, - SubgroupShuffleINTEL = 5568, - SubgroupBufferBlockIOINTEL = 5569, - SubgroupImageBlockIOINTEL = 5570, - } - - public enum Op - { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, - OpImageSparseRead = 320, - OpDecorateId = 332, - OpSubgroupBallotKHR = 4421, - OpSubgroupFirstInvocationKHR = 4422, - OpSubgroupAllKHR = 4428, - OpSubgroupAnyKHR = 4429, - OpSubgroupAllEqualKHR = 4430, - OpSubgroupReadInvocationKHR = 4432, - OpGroupIAddNonUniformAMD = 5000, - OpGroupFAddNonUniformAMD = 5001, - OpGroupFMinNonUniformAMD = 5002, - OpGroupUMinNonUniformAMD = 5003, - OpGroupSMinNonUniformAMD = 5004, - OpGroupFMaxNonUniformAMD = 5005, - OpGroupUMaxNonUniformAMD = 5006, - OpGroupSMaxNonUniformAMD = 5007, - OpFragmentMaskFetchAMD = 5011, - OpFragmentFetchAMD = 5012, - OpSubgroupShuffleINTEL = 5571, - OpSubgroupShuffleDownINTEL = 5572, - OpSubgroupShuffleUpINTEL = 5573, - OpSubgroupShuffleXorINTEL = 5574, - OpSubgroupBlockReadINTEL = 5575, - OpSubgroupBlockWriteINTEL = 5576, - OpSubgroupImageBlockReadINTEL = 5577, - OpSubgroupImageBlockWriteINTEL = 5578, - OpDecorateStringGOOGLE = 5632, - OpMemberDecorateStringGOOGLE = 5633, - } - } -} - diff --git a/include/spirv/1.0/spirv.h b/include/spirv/1.0/spirv.h deleted file mode 100644 index bd5a9b95..00000000 --- a/include/spirv/1.0/spirv.h +++ /dev/null @@ -1,993 +0,0 @@ -/* -** Copyright (c) 2014-2018 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a copy -** of this software and/or associated documentation files (the "Materials"), -** to deal in the Materials without restriction, including without limitation -** the rights to use, copy, modify, merge, publish, distribute, sublicense, -** and/or sell copies of the Materials, and to permit persons to whom the -** Materials are furnished to do so, subject to the following conditions: -** -** The above copyright notice and this permission notice shall be included in -** all copies or substantial portions of the Materials. -** -** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -** IN THE MATERIALS. -*/ - -/* -** This header is automatically generated by the same tool that creates -** the Binary Section of the SPIR-V specification. -*/ - -/* -** Enumeration tokens for SPIR-V, in various styles: -** C, C++, C++11, JSON, Lua, Python -** -** - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -** - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -** - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -** - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -** - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -** -** Some tokens act like mask values, which can be OR'd together, -** while others are mutually exclusive. The mask-like ones have -** "Mask" in their name, and a parallel enum that has the shift -** amount (1 << x) for each corresponding enumerant. -*/ - -#ifndef spirv_H -#define spirv_H - -typedef unsigned int SpvId; - -#define SPV_VERSION 0x10000 -#define SPV_REVISION 12 - -static const unsigned int SpvMagicNumber = 0x07230203; -static const unsigned int SpvVersion = 0x00010000; -static const unsigned int SpvRevision = 12; -static const unsigned int SpvOpCodeMask = 0xffff; -static const unsigned int SpvWordCountShift = 16; - -typedef enum SpvSourceLanguage_ { - SpvSourceLanguageUnknown = 0, - SpvSourceLanguageESSL = 1, - SpvSourceLanguageGLSL = 2, - SpvSourceLanguageOpenCL_C = 3, - SpvSourceLanguageOpenCL_CPP = 4, - SpvSourceLanguageHLSL = 5, - SpvSourceLanguageMax = 0x7fffffff, -} SpvSourceLanguage; - -typedef enum SpvExecutionModel_ { - SpvExecutionModelVertex = 0, - SpvExecutionModelTessellationControl = 1, - SpvExecutionModelTessellationEvaluation = 2, - SpvExecutionModelGeometry = 3, - SpvExecutionModelFragment = 4, - SpvExecutionModelGLCompute = 5, - SpvExecutionModelKernel = 6, - SpvExecutionModelMax = 0x7fffffff, -} SpvExecutionModel; - -typedef enum SpvAddressingModel_ { - SpvAddressingModelLogical = 0, - SpvAddressingModelPhysical32 = 1, - SpvAddressingModelPhysical64 = 2, - SpvAddressingModelMax = 0x7fffffff, -} SpvAddressingModel; - -typedef enum SpvMemoryModel_ { - SpvMemoryModelSimple = 0, - SpvMemoryModelGLSL450 = 1, - SpvMemoryModelOpenCL = 2, - SpvMemoryModelMax = 0x7fffffff, -} SpvMemoryModel; - -typedef enum SpvExecutionMode_ { - SpvExecutionModeInvocations = 0, - SpvExecutionModeSpacingEqual = 1, - SpvExecutionModeSpacingFractionalEven = 2, - SpvExecutionModeSpacingFractionalOdd = 3, - SpvExecutionModeVertexOrderCw = 4, - SpvExecutionModeVertexOrderCcw = 5, - SpvExecutionModePixelCenterInteger = 6, - SpvExecutionModeOriginUpperLeft = 7, - SpvExecutionModeOriginLowerLeft = 8, - SpvExecutionModeEarlyFragmentTests = 9, - SpvExecutionModePointMode = 10, - SpvExecutionModeXfb = 11, - SpvExecutionModeDepthReplacing = 12, - SpvExecutionModeDepthGreater = 14, - SpvExecutionModeDepthLess = 15, - SpvExecutionModeDepthUnchanged = 16, - SpvExecutionModeLocalSize = 17, - SpvExecutionModeLocalSizeHint = 18, - SpvExecutionModeInputPoints = 19, - SpvExecutionModeInputLines = 20, - SpvExecutionModeInputLinesAdjacency = 21, - SpvExecutionModeTriangles = 22, - SpvExecutionModeInputTrianglesAdjacency = 23, - SpvExecutionModeQuads = 24, - SpvExecutionModeIsolines = 25, - SpvExecutionModeOutputVertices = 26, - SpvExecutionModeOutputPoints = 27, - SpvExecutionModeOutputLineStrip = 28, - SpvExecutionModeOutputTriangleStrip = 29, - SpvExecutionModeVecTypeHint = 30, - SpvExecutionModeContractionOff = 31, - SpvExecutionModePostDepthCoverage = 4446, - SpvExecutionModeStencilRefReplacingEXT = 5027, - SpvExecutionModeMax = 0x7fffffff, -} SpvExecutionMode; - -typedef enum SpvStorageClass_ { - SpvStorageClassUniformConstant = 0, - SpvStorageClassInput = 1, - SpvStorageClassUniform = 2, - SpvStorageClassOutput = 3, - SpvStorageClassWorkgroup = 4, - SpvStorageClassCrossWorkgroup = 5, - SpvStorageClassPrivate = 6, - SpvStorageClassFunction = 7, - SpvStorageClassGeneric = 8, - SpvStorageClassPushConstant = 9, - SpvStorageClassAtomicCounter = 10, - SpvStorageClassImage = 11, - SpvStorageClassStorageBuffer = 12, - SpvStorageClassMax = 0x7fffffff, -} SpvStorageClass; - -typedef enum SpvDim_ { - SpvDim1D = 0, - SpvDim2D = 1, - SpvDim3D = 2, - SpvDimCube = 3, - SpvDimRect = 4, - SpvDimBuffer = 5, - SpvDimSubpassData = 6, - SpvDimMax = 0x7fffffff, -} SpvDim; - -typedef enum SpvSamplerAddressingMode_ { - SpvSamplerAddressingModeNone = 0, - SpvSamplerAddressingModeClampToEdge = 1, - SpvSamplerAddressingModeClamp = 2, - SpvSamplerAddressingModeRepeat = 3, - SpvSamplerAddressingModeRepeatMirrored = 4, - SpvSamplerAddressingModeMax = 0x7fffffff, -} SpvSamplerAddressingMode; - -typedef enum SpvSamplerFilterMode_ { - SpvSamplerFilterModeNearest = 0, - SpvSamplerFilterModeLinear = 1, - SpvSamplerFilterModeMax = 0x7fffffff, -} SpvSamplerFilterMode; - -typedef enum SpvImageFormat_ { - SpvImageFormatUnknown = 0, - SpvImageFormatRgba32f = 1, - SpvImageFormatRgba16f = 2, - SpvImageFormatR32f = 3, - SpvImageFormatRgba8 = 4, - SpvImageFormatRgba8Snorm = 5, - SpvImageFormatRg32f = 6, - SpvImageFormatRg16f = 7, - SpvImageFormatR11fG11fB10f = 8, - SpvImageFormatR16f = 9, - SpvImageFormatRgba16 = 10, - SpvImageFormatRgb10A2 = 11, - SpvImageFormatRg16 = 12, - SpvImageFormatRg8 = 13, - SpvImageFormatR16 = 14, - SpvImageFormatR8 = 15, - SpvImageFormatRgba16Snorm = 16, - SpvImageFormatRg16Snorm = 17, - SpvImageFormatRg8Snorm = 18, - SpvImageFormatR16Snorm = 19, - SpvImageFormatR8Snorm = 20, - SpvImageFormatRgba32i = 21, - SpvImageFormatRgba16i = 22, - SpvImageFormatRgba8i = 23, - SpvImageFormatR32i = 24, - SpvImageFormatRg32i = 25, - SpvImageFormatRg16i = 26, - SpvImageFormatRg8i = 27, - SpvImageFormatR16i = 28, - SpvImageFormatR8i = 29, - SpvImageFormatRgba32ui = 30, - SpvImageFormatRgba16ui = 31, - SpvImageFormatRgba8ui = 32, - SpvImageFormatR32ui = 33, - SpvImageFormatRgb10a2ui = 34, - SpvImageFormatRg32ui = 35, - SpvImageFormatRg16ui = 36, - SpvImageFormatRg8ui = 37, - SpvImageFormatR16ui = 38, - SpvImageFormatR8ui = 39, - SpvImageFormatMax = 0x7fffffff, -} SpvImageFormat; - -typedef enum SpvImageChannelOrder_ { - SpvImageChannelOrderR = 0, - SpvImageChannelOrderA = 1, - SpvImageChannelOrderRG = 2, - SpvImageChannelOrderRA = 3, - SpvImageChannelOrderRGB = 4, - SpvImageChannelOrderRGBA = 5, - SpvImageChannelOrderBGRA = 6, - SpvImageChannelOrderARGB = 7, - SpvImageChannelOrderIntensity = 8, - SpvImageChannelOrderLuminance = 9, - SpvImageChannelOrderRx = 10, - SpvImageChannelOrderRGx = 11, - SpvImageChannelOrderRGBx = 12, - SpvImageChannelOrderDepth = 13, - SpvImageChannelOrderDepthStencil = 14, - SpvImageChannelOrdersRGB = 15, - SpvImageChannelOrdersRGBx = 16, - SpvImageChannelOrdersRGBA = 17, - SpvImageChannelOrdersBGRA = 18, - SpvImageChannelOrderABGR = 19, - SpvImageChannelOrderMax = 0x7fffffff, -} SpvImageChannelOrder; - -typedef enum SpvImageChannelDataType_ { - SpvImageChannelDataTypeSnormInt8 = 0, - SpvImageChannelDataTypeSnormInt16 = 1, - SpvImageChannelDataTypeUnormInt8 = 2, - SpvImageChannelDataTypeUnormInt16 = 3, - SpvImageChannelDataTypeUnormShort565 = 4, - SpvImageChannelDataTypeUnormShort555 = 5, - SpvImageChannelDataTypeUnormInt101010 = 6, - SpvImageChannelDataTypeSignedInt8 = 7, - SpvImageChannelDataTypeSignedInt16 = 8, - SpvImageChannelDataTypeSignedInt32 = 9, - SpvImageChannelDataTypeUnsignedInt8 = 10, - SpvImageChannelDataTypeUnsignedInt16 = 11, - SpvImageChannelDataTypeUnsignedInt32 = 12, - SpvImageChannelDataTypeHalfFloat = 13, - SpvImageChannelDataTypeFloat = 14, - SpvImageChannelDataTypeUnormInt24 = 15, - SpvImageChannelDataTypeUnormInt101010_2 = 16, - SpvImageChannelDataTypeMax = 0x7fffffff, -} SpvImageChannelDataType; - -typedef enum SpvImageOperandsShift_ { - SpvImageOperandsBiasShift = 0, - SpvImageOperandsLodShift = 1, - SpvImageOperandsGradShift = 2, - SpvImageOperandsConstOffsetShift = 3, - SpvImageOperandsOffsetShift = 4, - SpvImageOperandsConstOffsetsShift = 5, - SpvImageOperandsSampleShift = 6, - SpvImageOperandsMinLodShift = 7, - SpvImageOperandsMax = 0x7fffffff, -} SpvImageOperandsShift; - -typedef enum SpvImageOperandsMask_ { - SpvImageOperandsMaskNone = 0, - SpvImageOperandsBiasMask = 0x00000001, - SpvImageOperandsLodMask = 0x00000002, - SpvImageOperandsGradMask = 0x00000004, - SpvImageOperandsConstOffsetMask = 0x00000008, - SpvImageOperandsOffsetMask = 0x00000010, - SpvImageOperandsConstOffsetsMask = 0x00000020, - SpvImageOperandsSampleMask = 0x00000040, - SpvImageOperandsMinLodMask = 0x00000080, -} SpvImageOperandsMask; - -typedef enum SpvFPFastMathModeShift_ { - SpvFPFastMathModeNotNaNShift = 0, - SpvFPFastMathModeNotInfShift = 1, - SpvFPFastMathModeNSZShift = 2, - SpvFPFastMathModeAllowRecipShift = 3, - SpvFPFastMathModeFastShift = 4, - SpvFPFastMathModeMax = 0x7fffffff, -} SpvFPFastMathModeShift; - -typedef enum SpvFPFastMathModeMask_ { - SpvFPFastMathModeMaskNone = 0, - SpvFPFastMathModeNotNaNMask = 0x00000001, - SpvFPFastMathModeNotInfMask = 0x00000002, - SpvFPFastMathModeNSZMask = 0x00000004, - SpvFPFastMathModeAllowRecipMask = 0x00000008, - SpvFPFastMathModeFastMask = 0x00000010, -} SpvFPFastMathModeMask; - -typedef enum SpvFPRoundingMode_ { - SpvFPRoundingModeRTE = 0, - SpvFPRoundingModeRTZ = 1, - SpvFPRoundingModeRTP = 2, - SpvFPRoundingModeRTN = 3, - SpvFPRoundingModeMax = 0x7fffffff, -} SpvFPRoundingMode; - -typedef enum SpvLinkageType_ { - SpvLinkageTypeExport = 0, - SpvLinkageTypeImport = 1, - SpvLinkageTypeMax = 0x7fffffff, -} SpvLinkageType; - -typedef enum SpvAccessQualifier_ { - SpvAccessQualifierReadOnly = 0, - SpvAccessQualifierWriteOnly = 1, - SpvAccessQualifierReadWrite = 2, - SpvAccessQualifierMax = 0x7fffffff, -} SpvAccessQualifier; - -typedef enum SpvFunctionParameterAttribute_ { - SpvFunctionParameterAttributeZext = 0, - SpvFunctionParameterAttributeSext = 1, - SpvFunctionParameterAttributeByVal = 2, - SpvFunctionParameterAttributeSret = 3, - SpvFunctionParameterAttributeNoAlias = 4, - SpvFunctionParameterAttributeNoCapture = 5, - SpvFunctionParameterAttributeNoWrite = 6, - SpvFunctionParameterAttributeNoReadWrite = 7, - SpvFunctionParameterAttributeMax = 0x7fffffff, -} SpvFunctionParameterAttribute; - -typedef enum SpvDecoration_ { - SpvDecorationRelaxedPrecision = 0, - SpvDecorationSpecId = 1, - SpvDecorationBlock = 2, - SpvDecorationBufferBlock = 3, - SpvDecorationRowMajor = 4, - SpvDecorationColMajor = 5, - SpvDecorationArrayStride = 6, - SpvDecorationMatrixStride = 7, - SpvDecorationGLSLShared = 8, - SpvDecorationGLSLPacked = 9, - SpvDecorationCPacked = 10, - SpvDecorationBuiltIn = 11, - SpvDecorationNoPerspective = 13, - SpvDecorationFlat = 14, - SpvDecorationPatch = 15, - SpvDecorationCentroid = 16, - SpvDecorationSample = 17, - SpvDecorationInvariant = 18, - SpvDecorationRestrict = 19, - SpvDecorationAliased = 20, - SpvDecorationVolatile = 21, - SpvDecorationConstant = 22, - SpvDecorationCoherent = 23, - SpvDecorationNonWritable = 24, - SpvDecorationNonReadable = 25, - SpvDecorationUniform = 26, - SpvDecorationSaturatedConversion = 28, - SpvDecorationStream = 29, - SpvDecorationLocation = 30, - SpvDecorationComponent = 31, - SpvDecorationIndex = 32, - SpvDecorationBinding = 33, - SpvDecorationDescriptorSet = 34, - SpvDecorationOffset = 35, - SpvDecorationXfbBuffer = 36, - SpvDecorationXfbStride = 37, - SpvDecorationFuncParamAttr = 38, - SpvDecorationFPRoundingMode = 39, - SpvDecorationFPFastMathMode = 40, - SpvDecorationLinkageAttributes = 41, - SpvDecorationNoContraction = 42, - SpvDecorationInputAttachmentIndex = 43, - SpvDecorationAlignment = 44, - SpvDecorationExplicitInterpAMD = 4999, - SpvDecorationOverrideCoverageNV = 5248, - SpvDecorationPassthroughNV = 5250, - SpvDecorationViewportRelativeNV = 5252, - SpvDecorationSecondaryViewportRelativeNV = 5256, - SpvDecorationHlslCounterBufferGOOGLE = 5634, - SpvDecorationHlslSemanticGOOGLE = 5635, - SpvDecorationMax = 0x7fffffff, -} SpvDecoration; - -typedef enum SpvBuiltIn_ { - SpvBuiltInPosition = 0, - SpvBuiltInPointSize = 1, - SpvBuiltInClipDistance = 3, - SpvBuiltInCullDistance = 4, - SpvBuiltInVertexId = 5, - SpvBuiltInInstanceId = 6, - SpvBuiltInPrimitiveId = 7, - SpvBuiltInInvocationId = 8, - SpvBuiltInLayer = 9, - SpvBuiltInViewportIndex = 10, - SpvBuiltInTessLevelOuter = 11, - SpvBuiltInTessLevelInner = 12, - SpvBuiltInTessCoord = 13, - SpvBuiltInPatchVertices = 14, - SpvBuiltInFragCoord = 15, - SpvBuiltInPointCoord = 16, - SpvBuiltInFrontFacing = 17, - SpvBuiltInSampleId = 18, - SpvBuiltInSamplePosition = 19, - SpvBuiltInSampleMask = 20, - SpvBuiltInFragDepth = 22, - SpvBuiltInHelperInvocation = 23, - SpvBuiltInNumWorkgroups = 24, - SpvBuiltInWorkgroupSize = 25, - SpvBuiltInWorkgroupId = 26, - SpvBuiltInLocalInvocationId = 27, - SpvBuiltInGlobalInvocationId = 28, - SpvBuiltInLocalInvocationIndex = 29, - SpvBuiltInWorkDim = 30, - SpvBuiltInGlobalSize = 31, - SpvBuiltInEnqueuedWorkgroupSize = 32, - SpvBuiltInGlobalOffset = 33, - SpvBuiltInGlobalLinearId = 34, - SpvBuiltInSubgroupSize = 36, - SpvBuiltInSubgroupMaxSize = 37, - SpvBuiltInNumSubgroups = 38, - SpvBuiltInNumEnqueuedSubgroups = 39, - SpvBuiltInSubgroupId = 40, - SpvBuiltInSubgroupLocalInvocationId = 41, - SpvBuiltInVertexIndex = 42, - SpvBuiltInInstanceIndex = 43, - SpvBuiltInSubgroupEqMaskKHR = 4416, - SpvBuiltInSubgroupGeMaskKHR = 4417, - SpvBuiltInSubgroupGtMaskKHR = 4418, - SpvBuiltInSubgroupLeMaskKHR = 4419, - SpvBuiltInSubgroupLtMaskKHR = 4420, - SpvBuiltInBaseVertex = 4424, - SpvBuiltInBaseInstance = 4425, - SpvBuiltInDrawIndex = 4426, - SpvBuiltInDeviceIndex = 4438, - SpvBuiltInViewIndex = 4440, - SpvBuiltInBaryCoordNoPerspAMD = 4992, - SpvBuiltInBaryCoordNoPerspCentroidAMD = 4993, - SpvBuiltInBaryCoordNoPerspSampleAMD = 4994, - SpvBuiltInBaryCoordSmoothAMD = 4995, - SpvBuiltInBaryCoordSmoothCentroidAMD = 4996, - SpvBuiltInBaryCoordSmoothSampleAMD = 4997, - SpvBuiltInBaryCoordPullModelAMD = 4998, - SpvBuiltInFragStencilRefEXT = 5014, - SpvBuiltInViewportMaskNV = 5253, - SpvBuiltInSecondaryPositionNV = 5257, - SpvBuiltInSecondaryViewportMaskNV = 5258, - SpvBuiltInPositionPerViewNV = 5261, - SpvBuiltInViewportMaskPerViewNV = 5262, - SpvBuiltInMax = 0x7fffffff, -} SpvBuiltIn; - -typedef enum SpvSelectionControlShift_ { - SpvSelectionControlFlattenShift = 0, - SpvSelectionControlDontFlattenShift = 1, - SpvSelectionControlMax = 0x7fffffff, -} SpvSelectionControlShift; - -typedef enum SpvSelectionControlMask_ { - SpvSelectionControlMaskNone = 0, - SpvSelectionControlFlattenMask = 0x00000001, - SpvSelectionControlDontFlattenMask = 0x00000002, -} SpvSelectionControlMask; - -typedef enum SpvLoopControlShift_ { - SpvLoopControlUnrollShift = 0, - SpvLoopControlDontUnrollShift = 1, - SpvLoopControlMax = 0x7fffffff, -} SpvLoopControlShift; - -typedef enum SpvLoopControlMask_ { - SpvLoopControlMaskNone = 0, - SpvLoopControlUnrollMask = 0x00000001, - SpvLoopControlDontUnrollMask = 0x00000002, -} SpvLoopControlMask; - -typedef enum SpvFunctionControlShift_ { - SpvFunctionControlInlineShift = 0, - SpvFunctionControlDontInlineShift = 1, - SpvFunctionControlPureShift = 2, - SpvFunctionControlConstShift = 3, - SpvFunctionControlMax = 0x7fffffff, -} SpvFunctionControlShift; - -typedef enum SpvFunctionControlMask_ { - SpvFunctionControlMaskNone = 0, - SpvFunctionControlInlineMask = 0x00000001, - SpvFunctionControlDontInlineMask = 0x00000002, - SpvFunctionControlPureMask = 0x00000004, - SpvFunctionControlConstMask = 0x00000008, -} SpvFunctionControlMask; - -typedef enum SpvMemorySemanticsShift_ { - SpvMemorySemanticsAcquireShift = 1, - SpvMemorySemanticsReleaseShift = 2, - SpvMemorySemanticsAcquireReleaseShift = 3, - SpvMemorySemanticsSequentiallyConsistentShift = 4, - SpvMemorySemanticsUniformMemoryShift = 6, - SpvMemorySemanticsSubgroupMemoryShift = 7, - SpvMemorySemanticsWorkgroupMemoryShift = 8, - SpvMemorySemanticsCrossWorkgroupMemoryShift = 9, - SpvMemorySemanticsAtomicCounterMemoryShift = 10, - SpvMemorySemanticsImageMemoryShift = 11, - SpvMemorySemanticsMax = 0x7fffffff, -} SpvMemorySemanticsShift; - -typedef enum SpvMemorySemanticsMask_ { - SpvMemorySemanticsMaskNone = 0, - SpvMemorySemanticsAcquireMask = 0x00000002, - SpvMemorySemanticsReleaseMask = 0x00000004, - SpvMemorySemanticsAcquireReleaseMask = 0x00000008, - SpvMemorySemanticsSequentiallyConsistentMask = 0x00000010, - SpvMemorySemanticsUniformMemoryMask = 0x00000040, - SpvMemorySemanticsSubgroupMemoryMask = 0x00000080, - SpvMemorySemanticsWorkgroupMemoryMask = 0x00000100, - SpvMemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, - SpvMemorySemanticsAtomicCounterMemoryMask = 0x00000400, - SpvMemorySemanticsImageMemoryMask = 0x00000800, -} SpvMemorySemanticsMask; - -typedef enum SpvMemoryAccessShift_ { - SpvMemoryAccessVolatileShift = 0, - SpvMemoryAccessAlignedShift = 1, - SpvMemoryAccessNontemporalShift = 2, - SpvMemoryAccessMax = 0x7fffffff, -} SpvMemoryAccessShift; - -typedef enum SpvMemoryAccessMask_ { - SpvMemoryAccessMaskNone = 0, - SpvMemoryAccessVolatileMask = 0x00000001, - SpvMemoryAccessAlignedMask = 0x00000002, - SpvMemoryAccessNontemporalMask = 0x00000004, -} SpvMemoryAccessMask; - -typedef enum SpvScope_ { - SpvScopeCrossDevice = 0, - SpvScopeDevice = 1, - SpvScopeWorkgroup = 2, - SpvScopeSubgroup = 3, - SpvScopeInvocation = 4, - SpvScopeMax = 0x7fffffff, -} SpvScope; - -typedef enum SpvGroupOperation_ { - SpvGroupOperationReduce = 0, - SpvGroupOperationInclusiveScan = 1, - SpvGroupOperationExclusiveScan = 2, - SpvGroupOperationMax = 0x7fffffff, -} SpvGroupOperation; - -typedef enum SpvKernelEnqueueFlags_ { - SpvKernelEnqueueFlagsNoWait = 0, - SpvKernelEnqueueFlagsWaitKernel = 1, - SpvKernelEnqueueFlagsWaitWorkGroup = 2, - SpvKernelEnqueueFlagsMax = 0x7fffffff, -} SpvKernelEnqueueFlags; - -typedef enum SpvKernelProfilingInfoShift_ { - SpvKernelProfilingInfoCmdExecTimeShift = 0, - SpvKernelProfilingInfoMax = 0x7fffffff, -} SpvKernelProfilingInfoShift; - -typedef enum SpvKernelProfilingInfoMask_ { - SpvKernelProfilingInfoMaskNone = 0, - SpvKernelProfilingInfoCmdExecTimeMask = 0x00000001, -} SpvKernelProfilingInfoMask; - -typedef enum SpvCapability_ { - SpvCapabilityMatrix = 0, - SpvCapabilityShader = 1, - SpvCapabilityGeometry = 2, - SpvCapabilityTessellation = 3, - SpvCapabilityAddresses = 4, - SpvCapabilityLinkage = 5, - SpvCapabilityKernel = 6, - SpvCapabilityVector16 = 7, - SpvCapabilityFloat16Buffer = 8, - SpvCapabilityFloat16 = 9, - SpvCapabilityFloat64 = 10, - SpvCapabilityInt64 = 11, - SpvCapabilityInt64Atomics = 12, - SpvCapabilityImageBasic = 13, - SpvCapabilityImageReadWrite = 14, - SpvCapabilityImageMipmap = 15, - SpvCapabilityPipes = 17, - SpvCapabilityGroups = 18, - SpvCapabilityDeviceEnqueue = 19, - SpvCapabilityLiteralSampler = 20, - SpvCapabilityAtomicStorage = 21, - SpvCapabilityInt16 = 22, - SpvCapabilityTessellationPointSize = 23, - SpvCapabilityGeometryPointSize = 24, - SpvCapabilityImageGatherExtended = 25, - SpvCapabilityStorageImageMultisample = 27, - SpvCapabilityUniformBufferArrayDynamicIndexing = 28, - SpvCapabilitySampledImageArrayDynamicIndexing = 29, - SpvCapabilityStorageBufferArrayDynamicIndexing = 30, - SpvCapabilityStorageImageArrayDynamicIndexing = 31, - SpvCapabilityClipDistance = 32, - SpvCapabilityCullDistance = 33, - SpvCapabilityImageCubeArray = 34, - SpvCapabilitySampleRateShading = 35, - SpvCapabilityImageRect = 36, - SpvCapabilitySampledRect = 37, - SpvCapabilityGenericPointer = 38, - SpvCapabilityInt8 = 39, - SpvCapabilityInputAttachment = 40, - SpvCapabilitySparseResidency = 41, - SpvCapabilityMinLod = 42, - SpvCapabilitySampled1D = 43, - SpvCapabilityImage1D = 44, - SpvCapabilitySampledCubeArray = 45, - SpvCapabilitySampledBuffer = 46, - SpvCapabilityImageBuffer = 47, - SpvCapabilityImageMSArray = 48, - SpvCapabilityStorageImageExtendedFormats = 49, - SpvCapabilityImageQuery = 50, - SpvCapabilityDerivativeControl = 51, - SpvCapabilityInterpolationFunction = 52, - SpvCapabilityTransformFeedback = 53, - SpvCapabilityGeometryStreams = 54, - SpvCapabilityStorageImageReadWithoutFormat = 55, - SpvCapabilityStorageImageWriteWithoutFormat = 56, - SpvCapabilityMultiViewport = 57, - SpvCapabilitySubgroupBallotKHR = 4423, - SpvCapabilityDrawParameters = 4427, - SpvCapabilitySubgroupVoteKHR = 4431, - SpvCapabilityStorageBuffer16BitAccess = 4433, - SpvCapabilityStorageUniformBufferBlock16 = 4433, - SpvCapabilityStorageUniform16 = 4434, - SpvCapabilityUniformAndStorageBuffer16BitAccess = 4434, - SpvCapabilityStoragePushConstant16 = 4435, - SpvCapabilityStorageInputOutput16 = 4436, - SpvCapabilityDeviceGroup = 4437, - SpvCapabilityMultiView = 4439, - SpvCapabilityVariablePointersStorageBuffer = 4441, - SpvCapabilityVariablePointers = 4442, - SpvCapabilityAtomicStorageOps = 4445, - SpvCapabilitySampleMaskPostDepthCoverage = 4447, - SpvCapabilityImageGatherBiasLodAMD = 5009, - SpvCapabilityFragmentMaskAMD = 5010, - SpvCapabilityStencilExportEXT = 5013, - SpvCapabilityImageReadWriteLodAMD = 5015, - SpvCapabilitySampleMaskOverrideCoverageNV = 5249, - SpvCapabilityGeometryShaderPassthroughNV = 5251, - SpvCapabilityShaderViewportIndexLayerEXT = 5254, - SpvCapabilityShaderViewportIndexLayerNV = 5254, - SpvCapabilityShaderViewportMaskNV = 5255, - SpvCapabilityShaderStereoViewNV = 5259, - SpvCapabilityPerViewAttributesNV = 5260, - SpvCapabilitySubgroupShuffleINTEL = 5568, - SpvCapabilitySubgroupBufferBlockIOINTEL = 5569, - SpvCapabilitySubgroupImageBlockIOINTEL = 5570, - SpvCapabilityMax = 0x7fffffff, -} SpvCapability; - -typedef enum SpvOp_ { - SpvOpNop = 0, - SpvOpUndef = 1, - SpvOpSourceContinued = 2, - SpvOpSource = 3, - SpvOpSourceExtension = 4, - SpvOpName = 5, - SpvOpMemberName = 6, - SpvOpString = 7, - SpvOpLine = 8, - SpvOpExtension = 10, - SpvOpExtInstImport = 11, - SpvOpExtInst = 12, - SpvOpMemoryModel = 14, - SpvOpEntryPoint = 15, - SpvOpExecutionMode = 16, - SpvOpCapability = 17, - SpvOpTypeVoid = 19, - SpvOpTypeBool = 20, - SpvOpTypeInt = 21, - SpvOpTypeFloat = 22, - SpvOpTypeVector = 23, - SpvOpTypeMatrix = 24, - SpvOpTypeImage = 25, - SpvOpTypeSampler = 26, - SpvOpTypeSampledImage = 27, - SpvOpTypeArray = 28, - SpvOpTypeRuntimeArray = 29, - SpvOpTypeStruct = 30, - SpvOpTypeOpaque = 31, - SpvOpTypePointer = 32, - SpvOpTypeFunction = 33, - SpvOpTypeEvent = 34, - SpvOpTypeDeviceEvent = 35, - SpvOpTypeReserveId = 36, - SpvOpTypeQueue = 37, - SpvOpTypePipe = 38, - SpvOpTypeForwardPointer = 39, - SpvOpConstantTrue = 41, - SpvOpConstantFalse = 42, - SpvOpConstant = 43, - SpvOpConstantComposite = 44, - SpvOpConstantSampler = 45, - SpvOpConstantNull = 46, - SpvOpSpecConstantTrue = 48, - SpvOpSpecConstantFalse = 49, - SpvOpSpecConstant = 50, - SpvOpSpecConstantComposite = 51, - SpvOpSpecConstantOp = 52, - SpvOpFunction = 54, - SpvOpFunctionParameter = 55, - SpvOpFunctionEnd = 56, - SpvOpFunctionCall = 57, - SpvOpVariable = 59, - SpvOpImageTexelPointer = 60, - SpvOpLoad = 61, - SpvOpStore = 62, - SpvOpCopyMemory = 63, - SpvOpCopyMemorySized = 64, - SpvOpAccessChain = 65, - SpvOpInBoundsAccessChain = 66, - SpvOpPtrAccessChain = 67, - SpvOpArrayLength = 68, - SpvOpGenericPtrMemSemantics = 69, - SpvOpInBoundsPtrAccessChain = 70, - SpvOpDecorate = 71, - SpvOpMemberDecorate = 72, - SpvOpDecorationGroup = 73, - SpvOpGroupDecorate = 74, - SpvOpGroupMemberDecorate = 75, - SpvOpVectorExtractDynamic = 77, - SpvOpVectorInsertDynamic = 78, - SpvOpVectorShuffle = 79, - SpvOpCompositeConstruct = 80, - SpvOpCompositeExtract = 81, - SpvOpCompositeInsert = 82, - SpvOpCopyObject = 83, - SpvOpTranspose = 84, - SpvOpSampledImage = 86, - SpvOpImageSampleImplicitLod = 87, - SpvOpImageSampleExplicitLod = 88, - SpvOpImageSampleDrefImplicitLod = 89, - SpvOpImageSampleDrefExplicitLod = 90, - SpvOpImageSampleProjImplicitLod = 91, - SpvOpImageSampleProjExplicitLod = 92, - SpvOpImageSampleProjDrefImplicitLod = 93, - SpvOpImageSampleProjDrefExplicitLod = 94, - SpvOpImageFetch = 95, - SpvOpImageGather = 96, - SpvOpImageDrefGather = 97, - SpvOpImageRead = 98, - SpvOpImageWrite = 99, - SpvOpImage = 100, - SpvOpImageQueryFormat = 101, - SpvOpImageQueryOrder = 102, - SpvOpImageQuerySizeLod = 103, - SpvOpImageQuerySize = 104, - SpvOpImageQueryLod = 105, - SpvOpImageQueryLevels = 106, - SpvOpImageQuerySamples = 107, - SpvOpConvertFToU = 109, - SpvOpConvertFToS = 110, - SpvOpConvertSToF = 111, - SpvOpConvertUToF = 112, - SpvOpUConvert = 113, - SpvOpSConvert = 114, - SpvOpFConvert = 115, - SpvOpQuantizeToF16 = 116, - SpvOpConvertPtrToU = 117, - SpvOpSatConvertSToU = 118, - SpvOpSatConvertUToS = 119, - SpvOpConvertUToPtr = 120, - SpvOpPtrCastToGeneric = 121, - SpvOpGenericCastToPtr = 122, - SpvOpGenericCastToPtrExplicit = 123, - SpvOpBitcast = 124, - SpvOpSNegate = 126, - SpvOpFNegate = 127, - SpvOpIAdd = 128, - SpvOpFAdd = 129, - SpvOpISub = 130, - SpvOpFSub = 131, - SpvOpIMul = 132, - SpvOpFMul = 133, - SpvOpUDiv = 134, - SpvOpSDiv = 135, - SpvOpFDiv = 136, - SpvOpUMod = 137, - SpvOpSRem = 138, - SpvOpSMod = 139, - SpvOpFRem = 140, - SpvOpFMod = 141, - SpvOpVectorTimesScalar = 142, - SpvOpMatrixTimesScalar = 143, - SpvOpVectorTimesMatrix = 144, - SpvOpMatrixTimesVector = 145, - SpvOpMatrixTimesMatrix = 146, - SpvOpOuterProduct = 147, - SpvOpDot = 148, - SpvOpIAddCarry = 149, - SpvOpISubBorrow = 150, - SpvOpUMulExtended = 151, - SpvOpSMulExtended = 152, - SpvOpAny = 154, - SpvOpAll = 155, - SpvOpIsNan = 156, - SpvOpIsInf = 157, - SpvOpIsFinite = 158, - SpvOpIsNormal = 159, - SpvOpSignBitSet = 160, - SpvOpLessOrGreater = 161, - SpvOpOrdered = 162, - SpvOpUnordered = 163, - SpvOpLogicalEqual = 164, - SpvOpLogicalNotEqual = 165, - SpvOpLogicalOr = 166, - SpvOpLogicalAnd = 167, - SpvOpLogicalNot = 168, - SpvOpSelect = 169, - SpvOpIEqual = 170, - SpvOpINotEqual = 171, - SpvOpUGreaterThan = 172, - SpvOpSGreaterThan = 173, - SpvOpUGreaterThanEqual = 174, - SpvOpSGreaterThanEqual = 175, - SpvOpULessThan = 176, - SpvOpSLessThan = 177, - SpvOpULessThanEqual = 178, - SpvOpSLessThanEqual = 179, - SpvOpFOrdEqual = 180, - SpvOpFUnordEqual = 181, - SpvOpFOrdNotEqual = 182, - SpvOpFUnordNotEqual = 183, - SpvOpFOrdLessThan = 184, - SpvOpFUnordLessThan = 185, - SpvOpFOrdGreaterThan = 186, - SpvOpFUnordGreaterThan = 187, - SpvOpFOrdLessThanEqual = 188, - SpvOpFUnordLessThanEqual = 189, - SpvOpFOrdGreaterThanEqual = 190, - SpvOpFUnordGreaterThanEqual = 191, - SpvOpShiftRightLogical = 194, - SpvOpShiftRightArithmetic = 195, - SpvOpShiftLeftLogical = 196, - SpvOpBitwiseOr = 197, - SpvOpBitwiseXor = 198, - SpvOpBitwiseAnd = 199, - SpvOpNot = 200, - SpvOpBitFieldInsert = 201, - SpvOpBitFieldSExtract = 202, - SpvOpBitFieldUExtract = 203, - SpvOpBitReverse = 204, - SpvOpBitCount = 205, - SpvOpDPdx = 207, - SpvOpDPdy = 208, - SpvOpFwidth = 209, - SpvOpDPdxFine = 210, - SpvOpDPdyFine = 211, - SpvOpFwidthFine = 212, - SpvOpDPdxCoarse = 213, - SpvOpDPdyCoarse = 214, - SpvOpFwidthCoarse = 215, - SpvOpEmitVertex = 218, - SpvOpEndPrimitive = 219, - SpvOpEmitStreamVertex = 220, - SpvOpEndStreamPrimitive = 221, - SpvOpControlBarrier = 224, - SpvOpMemoryBarrier = 225, - SpvOpAtomicLoad = 227, - SpvOpAtomicStore = 228, - SpvOpAtomicExchange = 229, - SpvOpAtomicCompareExchange = 230, - SpvOpAtomicCompareExchangeWeak = 231, - SpvOpAtomicIIncrement = 232, - SpvOpAtomicIDecrement = 233, - SpvOpAtomicIAdd = 234, - SpvOpAtomicISub = 235, - SpvOpAtomicSMin = 236, - SpvOpAtomicUMin = 237, - SpvOpAtomicSMax = 238, - SpvOpAtomicUMax = 239, - SpvOpAtomicAnd = 240, - SpvOpAtomicOr = 241, - SpvOpAtomicXor = 242, - SpvOpPhi = 245, - SpvOpLoopMerge = 246, - SpvOpSelectionMerge = 247, - SpvOpLabel = 248, - SpvOpBranch = 249, - SpvOpBranchConditional = 250, - SpvOpSwitch = 251, - SpvOpKill = 252, - SpvOpReturn = 253, - SpvOpReturnValue = 254, - SpvOpUnreachable = 255, - SpvOpLifetimeStart = 256, - SpvOpLifetimeStop = 257, - SpvOpGroupAsyncCopy = 259, - SpvOpGroupWaitEvents = 260, - SpvOpGroupAll = 261, - SpvOpGroupAny = 262, - SpvOpGroupBroadcast = 263, - SpvOpGroupIAdd = 264, - SpvOpGroupFAdd = 265, - SpvOpGroupFMin = 266, - SpvOpGroupUMin = 267, - SpvOpGroupSMin = 268, - SpvOpGroupFMax = 269, - SpvOpGroupUMax = 270, - SpvOpGroupSMax = 271, - SpvOpReadPipe = 274, - SpvOpWritePipe = 275, - SpvOpReservedReadPipe = 276, - SpvOpReservedWritePipe = 277, - SpvOpReserveReadPipePackets = 278, - SpvOpReserveWritePipePackets = 279, - SpvOpCommitReadPipe = 280, - SpvOpCommitWritePipe = 281, - SpvOpIsValidReserveId = 282, - SpvOpGetNumPipePackets = 283, - SpvOpGetMaxPipePackets = 284, - SpvOpGroupReserveReadPipePackets = 285, - SpvOpGroupReserveWritePipePackets = 286, - SpvOpGroupCommitReadPipe = 287, - SpvOpGroupCommitWritePipe = 288, - SpvOpEnqueueMarker = 291, - SpvOpEnqueueKernel = 292, - SpvOpGetKernelNDrangeSubGroupCount = 293, - SpvOpGetKernelNDrangeMaxSubGroupSize = 294, - SpvOpGetKernelWorkGroupSize = 295, - SpvOpGetKernelPreferredWorkGroupSizeMultiple = 296, - SpvOpRetainEvent = 297, - SpvOpReleaseEvent = 298, - SpvOpCreateUserEvent = 299, - SpvOpIsValidEvent = 300, - SpvOpSetUserEventStatus = 301, - SpvOpCaptureEventProfilingInfo = 302, - SpvOpGetDefaultQueue = 303, - SpvOpBuildNDRange = 304, - SpvOpImageSparseSampleImplicitLod = 305, - SpvOpImageSparseSampleExplicitLod = 306, - SpvOpImageSparseSampleDrefImplicitLod = 307, - SpvOpImageSparseSampleDrefExplicitLod = 308, - SpvOpImageSparseSampleProjImplicitLod = 309, - SpvOpImageSparseSampleProjExplicitLod = 310, - SpvOpImageSparseSampleProjDrefImplicitLod = 311, - SpvOpImageSparseSampleProjDrefExplicitLod = 312, - SpvOpImageSparseFetch = 313, - SpvOpImageSparseGather = 314, - SpvOpImageSparseDrefGather = 315, - SpvOpImageSparseTexelsResident = 316, - SpvOpNoLine = 317, - SpvOpAtomicFlagTestAndSet = 318, - SpvOpAtomicFlagClear = 319, - SpvOpImageSparseRead = 320, - SpvOpDecorateId = 332, - SpvOpSubgroupBallotKHR = 4421, - SpvOpSubgroupFirstInvocationKHR = 4422, - SpvOpSubgroupAllKHR = 4428, - SpvOpSubgroupAnyKHR = 4429, - SpvOpSubgroupAllEqualKHR = 4430, - SpvOpSubgroupReadInvocationKHR = 4432, - SpvOpGroupIAddNonUniformAMD = 5000, - SpvOpGroupFAddNonUniformAMD = 5001, - SpvOpGroupFMinNonUniformAMD = 5002, - SpvOpGroupUMinNonUniformAMD = 5003, - SpvOpGroupSMinNonUniformAMD = 5004, - SpvOpGroupFMaxNonUniformAMD = 5005, - SpvOpGroupUMaxNonUniformAMD = 5006, - SpvOpGroupSMaxNonUniformAMD = 5007, - SpvOpFragmentMaskFetchAMD = 5011, - SpvOpFragmentFetchAMD = 5012, - SpvOpSubgroupShuffleINTEL = 5571, - SpvOpSubgroupShuffleDownINTEL = 5572, - SpvOpSubgroupShuffleUpINTEL = 5573, - SpvOpSubgroupShuffleXorINTEL = 5574, - SpvOpSubgroupBlockReadINTEL = 5575, - SpvOpSubgroupBlockWriteINTEL = 5576, - SpvOpSubgroupImageBlockReadINTEL = 5577, - SpvOpSubgroupImageBlockWriteINTEL = 5578, - SpvOpDecorateStringGOOGLE = 5632, - SpvOpMemberDecorateStringGOOGLE = 5633, - SpvOpMax = 0x7fffffff, -} SpvOp; - -#endif // #ifndef spirv_H - diff --git a/include/spirv/1.0/spirv.hpp b/include/spirv/1.0/spirv.hpp deleted file mode 100644 index e98a89ce..00000000 --- a/include/spirv/1.0/spirv.hpp +++ /dev/null @@ -1,1002 +0,0 @@ -// Copyright (c) 2014-2018 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -// This header is automatically generated by the same tool that creates -// the Binary Section of the SPIR-V specification. - -// Enumeration tokens for SPIR-V, in various styles: -// C, C++, C++11, JSON, Lua, Python -// -// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -// -// Some tokens act like mask values, which can be OR'd together, -// while others are mutually exclusive. The mask-like ones have -// "Mask" in their name, and a parallel enum that has the shift -// amount (1 << x) for each corresponding enumerant. - -#ifndef spirv_HPP -#define spirv_HPP - -namespace spv { - -typedef unsigned int Id; - -#define SPV_VERSION 0x10000 -#define SPV_REVISION 12 - -static const unsigned int MagicNumber = 0x07230203; -static const unsigned int Version = 0x00010000; -static const unsigned int Revision = 12; -static const unsigned int OpCodeMask = 0xffff; -static const unsigned int WordCountShift = 16; - -enum SourceLanguage { - SourceLanguageUnknown = 0, - SourceLanguageESSL = 1, - SourceLanguageGLSL = 2, - SourceLanguageOpenCL_C = 3, - SourceLanguageOpenCL_CPP = 4, - SourceLanguageHLSL = 5, - SourceLanguageMax = 0x7fffffff, -}; - -enum ExecutionModel { - ExecutionModelVertex = 0, - ExecutionModelTessellationControl = 1, - ExecutionModelTessellationEvaluation = 2, - ExecutionModelGeometry = 3, - ExecutionModelFragment = 4, - ExecutionModelGLCompute = 5, - ExecutionModelKernel = 6, - ExecutionModelMax = 0x7fffffff, -}; - -enum AddressingModel { - AddressingModelLogical = 0, - AddressingModelPhysical32 = 1, - AddressingModelPhysical64 = 2, - AddressingModelMax = 0x7fffffff, -}; - -enum MemoryModel { - MemoryModelSimple = 0, - MemoryModelGLSL450 = 1, - MemoryModelOpenCL = 2, - MemoryModelMax = 0x7fffffff, -}; - -enum ExecutionMode { - ExecutionModeInvocations = 0, - ExecutionModeSpacingEqual = 1, - ExecutionModeSpacingFractionalEven = 2, - ExecutionModeSpacingFractionalOdd = 3, - ExecutionModeVertexOrderCw = 4, - ExecutionModeVertexOrderCcw = 5, - ExecutionModePixelCenterInteger = 6, - ExecutionModeOriginUpperLeft = 7, - ExecutionModeOriginLowerLeft = 8, - ExecutionModeEarlyFragmentTests = 9, - ExecutionModePointMode = 10, - ExecutionModeXfb = 11, - ExecutionModeDepthReplacing = 12, - ExecutionModeDepthGreater = 14, - ExecutionModeDepthLess = 15, - ExecutionModeDepthUnchanged = 16, - ExecutionModeLocalSize = 17, - ExecutionModeLocalSizeHint = 18, - ExecutionModeInputPoints = 19, - ExecutionModeInputLines = 20, - ExecutionModeInputLinesAdjacency = 21, - ExecutionModeTriangles = 22, - ExecutionModeInputTrianglesAdjacency = 23, - ExecutionModeQuads = 24, - ExecutionModeIsolines = 25, - ExecutionModeOutputVertices = 26, - ExecutionModeOutputPoints = 27, - ExecutionModeOutputLineStrip = 28, - ExecutionModeOutputTriangleStrip = 29, - ExecutionModeVecTypeHint = 30, - ExecutionModeContractionOff = 31, - ExecutionModePostDepthCoverage = 4446, - ExecutionModeStencilRefReplacingEXT = 5027, - ExecutionModeMax = 0x7fffffff, -}; - -enum StorageClass { - StorageClassUniformConstant = 0, - StorageClassInput = 1, - StorageClassUniform = 2, - StorageClassOutput = 3, - StorageClassWorkgroup = 4, - StorageClassCrossWorkgroup = 5, - StorageClassPrivate = 6, - StorageClassFunction = 7, - StorageClassGeneric = 8, - StorageClassPushConstant = 9, - StorageClassAtomicCounter = 10, - StorageClassImage = 11, - StorageClassStorageBuffer = 12, - StorageClassMax = 0x7fffffff, -}; - -enum Dim { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - DimCube = 3, - DimRect = 4, - DimBuffer = 5, - DimSubpassData = 6, - DimMax = 0x7fffffff, -}; - -enum SamplerAddressingMode { - SamplerAddressingModeNone = 0, - SamplerAddressingModeClampToEdge = 1, - SamplerAddressingModeClamp = 2, - SamplerAddressingModeRepeat = 3, - SamplerAddressingModeRepeatMirrored = 4, - SamplerAddressingModeMax = 0x7fffffff, -}; - -enum SamplerFilterMode { - SamplerFilterModeNearest = 0, - SamplerFilterModeLinear = 1, - SamplerFilterModeMax = 0x7fffffff, -}; - -enum ImageFormat { - ImageFormatUnknown = 0, - ImageFormatRgba32f = 1, - ImageFormatRgba16f = 2, - ImageFormatR32f = 3, - ImageFormatRgba8 = 4, - ImageFormatRgba8Snorm = 5, - ImageFormatRg32f = 6, - ImageFormatRg16f = 7, - ImageFormatR11fG11fB10f = 8, - ImageFormatR16f = 9, - ImageFormatRgba16 = 10, - ImageFormatRgb10A2 = 11, - ImageFormatRg16 = 12, - ImageFormatRg8 = 13, - ImageFormatR16 = 14, - ImageFormatR8 = 15, - ImageFormatRgba16Snorm = 16, - ImageFormatRg16Snorm = 17, - ImageFormatRg8Snorm = 18, - ImageFormatR16Snorm = 19, - ImageFormatR8Snorm = 20, - ImageFormatRgba32i = 21, - ImageFormatRgba16i = 22, - ImageFormatRgba8i = 23, - ImageFormatR32i = 24, - ImageFormatRg32i = 25, - ImageFormatRg16i = 26, - ImageFormatRg8i = 27, - ImageFormatR16i = 28, - ImageFormatR8i = 29, - ImageFormatRgba32ui = 30, - ImageFormatRgba16ui = 31, - ImageFormatRgba8ui = 32, - ImageFormatR32ui = 33, - ImageFormatRgb10a2ui = 34, - ImageFormatRg32ui = 35, - ImageFormatRg16ui = 36, - ImageFormatRg8ui = 37, - ImageFormatR16ui = 38, - ImageFormatR8ui = 39, - ImageFormatMax = 0x7fffffff, -}; - -enum ImageChannelOrder { - ImageChannelOrderR = 0, - ImageChannelOrderA = 1, - ImageChannelOrderRG = 2, - ImageChannelOrderRA = 3, - ImageChannelOrderRGB = 4, - ImageChannelOrderRGBA = 5, - ImageChannelOrderBGRA = 6, - ImageChannelOrderARGB = 7, - ImageChannelOrderIntensity = 8, - ImageChannelOrderLuminance = 9, - ImageChannelOrderRx = 10, - ImageChannelOrderRGx = 11, - ImageChannelOrderRGBx = 12, - ImageChannelOrderDepth = 13, - ImageChannelOrderDepthStencil = 14, - ImageChannelOrdersRGB = 15, - ImageChannelOrdersRGBx = 16, - ImageChannelOrdersRGBA = 17, - ImageChannelOrdersBGRA = 18, - ImageChannelOrderABGR = 19, - ImageChannelOrderMax = 0x7fffffff, -}; - -enum ImageChannelDataType { - ImageChannelDataTypeSnormInt8 = 0, - ImageChannelDataTypeSnormInt16 = 1, - ImageChannelDataTypeUnormInt8 = 2, - ImageChannelDataTypeUnormInt16 = 3, - ImageChannelDataTypeUnormShort565 = 4, - ImageChannelDataTypeUnormShort555 = 5, - ImageChannelDataTypeUnormInt101010 = 6, - ImageChannelDataTypeSignedInt8 = 7, - ImageChannelDataTypeSignedInt16 = 8, - ImageChannelDataTypeSignedInt32 = 9, - ImageChannelDataTypeUnsignedInt8 = 10, - ImageChannelDataTypeUnsignedInt16 = 11, - ImageChannelDataTypeUnsignedInt32 = 12, - ImageChannelDataTypeHalfFloat = 13, - ImageChannelDataTypeFloat = 14, - ImageChannelDataTypeUnormInt24 = 15, - ImageChannelDataTypeUnormInt101010_2 = 16, - ImageChannelDataTypeMax = 0x7fffffff, -}; - -enum ImageOperandsShift { - ImageOperandsBiasShift = 0, - ImageOperandsLodShift = 1, - ImageOperandsGradShift = 2, - ImageOperandsConstOffsetShift = 3, - ImageOperandsOffsetShift = 4, - ImageOperandsConstOffsetsShift = 5, - ImageOperandsSampleShift = 6, - ImageOperandsMinLodShift = 7, - ImageOperandsMax = 0x7fffffff, -}; - -enum ImageOperandsMask { - ImageOperandsMaskNone = 0, - ImageOperandsBiasMask = 0x00000001, - ImageOperandsLodMask = 0x00000002, - ImageOperandsGradMask = 0x00000004, - ImageOperandsConstOffsetMask = 0x00000008, - ImageOperandsOffsetMask = 0x00000010, - ImageOperandsConstOffsetsMask = 0x00000020, - ImageOperandsSampleMask = 0x00000040, - ImageOperandsMinLodMask = 0x00000080, -}; - -enum FPFastMathModeShift { - FPFastMathModeNotNaNShift = 0, - FPFastMathModeNotInfShift = 1, - FPFastMathModeNSZShift = 2, - FPFastMathModeAllowRecipShift = 3, - FPFastMathModeFastShift = 4, - FPFastMathModeMax = 0x7fffffff, -}; - -enum FPFastMathModeMask { - FPFastMathModeMaskNone = 0, - FPFastMathModeNotNaNMask = 0x00000001, - FPFastMathModeNotInfMask = 0x00000002, - FPFastMathModeNSZMask = 0x00000004, - FPFastMathModeAllowRecipMask = 0x00000008, - FPFastMathModeFastMask = 0x00000010, -}; - -enum FPRoundingMode { - FPRoundingModeRTE = 0, - FPRoundingModeRTZ = 1, - FPRoundingModeRTP = 2, - FPRoundingModeRTN = 3, - FPRoundingModeMax = 0x7fffffff, -}; - -enum LinkageType { - LinkageTypeExport = 0, - LinkageTypeImport = 1, - LinkageTypeMax = 0x7fffffff, -}; - -enum AccessQualifier { - AccessQualifierReadOnly = 0, - AccessQualifierWriteOnly = 1, - AccessQualifierReadWrite = 2, - AccessQualifierMax = 0x7fffffff, -}; - -enum FunctionParameterAttribute { - FunctionParameterAttributeZext = 0, - FunctionParameterAttributeSext = 1, - FunctionParameterAttributeByVal = 2, - FunctionParameterAttributeSret = 3, - FunctionParameterAttributeNoAlias = 4, - FunctionParameterAttributeNoCapture = 5, - FunctionParameterAttributeNoWrite = 6, - FunctionParameterAttributeNoReadWrite = 7, - FunctionParameterAttributeMax = 0x7fffffff, -}; - -enum Decoration { - DecorationRelaxedPrecision = 0, - DecorationSpecId = 1, - DecorationBlock = 2, - DecorationBufferBlock = 3, - DecorationRowMajor = 4, - DecorationColMajor = 5, - DecorationArrayStride = 6, - DecorationMatrixStride = 7, - DecorationGLSLShared = 8, - DecorationGLSLPacked = 9, - DecorationCPacked = 10, - DecorationBuiltIn = 11, - DecorationNoPerspective = 13, - DecorationFlat = 14, - DecorationPatch = 15, - DecorationCentroid = 16, - DecorationSample = 17, - DecorationInvariant = 18, - DecorationRestrict = 19, - DecorationAliased = 20, - DecorationVolatile = 21, - DecorationConstant = 22, - DecorationCoherent = 23, - DecorationNonWritable = 24, - DecorationNonReadable = 25, - DecorationUniform = 26, - DecorationSaturatedConversion = 28, - DecorationStream = 29, - DecorationLocation = 30, - DecorationComponent = 31, - DecorationIndex = 32, - DecorationBinding = 33, - DecorationDescriptorSet = 34, - DecorationOffset = 35, - DecorationXfbBuffer = 36, - DecorationXfbStride = 37, - DecorationFuncParamAttr = 38, - DecorationFPRoundingMode = 39, - DecorationFPFastMathMode = 40, - DecorationLinkageAttributes = 41, - DecorationNoContraction = 42, - DecorationInputAttachmentIndex = 43, - DecorationAlignment = 44, - DecorationExplicitInterpAMD = 4999, - DecorationOverrideCoverageNV = 5248, - DecorationPassthroughNV = 5250, - DecorationViewportRelativeNV = 5252, - DecorationSecondaryViewportRelativeNV = 5256, - DecorationHlslCounterBufferGOOGLE = 5634, - DecorationHlslSemanticGOOGLE = 5635, - DecorationMax = 0x7fffffff, -}; - -enum BuiltIn { - BuiltInPosition = 0, - BuiltInPointSize = 1, - BuiltInClipDistance = 3, - BuiltInCullDistance = 4, - BuiltInVertexId = 5, - BuiltInInstanceId = 6, - BuiltInPrimitiveId = 7, - BuiltInInvocationId = 8, - BuiltInLayer = 9, - BuiltInViewportIndex = 10, - BuiltInTessLevelOuter = 11, - BuiltInTessLevelInner = 12, - BuiltInTessCoord = 13, - BuiltInPatchVertices = 14, - BuiltInFragCoord = 15, - BuiltInPointCoord = 16, - BuiltInFrontFacing = 17, - BuiltInSampleId = 18, - BuiltInSamplePosition = 19, - BuiltInSampleMask = 20, - BuiltInFragDepth = 22, - BuiltInHelperInvocation = 23, - BuiltInNumWorkgroups = 24, - BuiltInWorkgroupSize = 25, - BuiltInWorkgroupId = 26, - BuiltInLocalInvocationId = 27, - BuiltInGlobalInvocationId = 28, - BuiltInLocalInvocationIndex = 29, - BuiltInWorkDim = 30, - BuiltInGlobalSize = 31, - BuiltInEnqueuedWorkgroupSize = 32, - BuiltInGlobalOffset = 33, - BuiltInGlobalLinearId = 34, - BuiltInSubgroupSize = 36, - BuiltInSubgroupMaxSize = 37, - BuiltInNumSubgroups = 38, - BuiltInNumEnqueuedSubgroups = 39, - BuiltInSubgroupId = 40, - BuiltInSubgroupLocalInvocationId = 41, - BuiltInVertexIndex = 42, - BuiltInInstanceIndex = 43, - BuiltInSubgroupEqMaskKHR = 4416, - BuiltInSubgroupGeMaskKHR = 4417, - BuiltInSubgroupGtMaskKHR = 4418, - BuiltInSubgroupLeMaskKHR = 4419, - BuiltInSubgroupLtMaskKHR = 4420, - BuiltInBaseVertex = 4424, - BuiltInBaseInstance = 4425, - BuiltInDrawIndex = 4426, - BuiltInDeviceIndex = 4438, - BuiltInViewIndex = 4440, - BuiltInBaryCoordNoPerspAMD = 4992, - BuiltInBaryCoordNoPerspCentroidAMD = 4993, - BuiltInBaryCoordNoPerspSampleAMD = 4994, - BuiltInBaryCoordSmoothAMD = 4995, - BuiltInBaryCoordSmoothCentroidAMD = 4996, - BuiltInBaryCoordSmoothSampleAMD = 4997, - BuiltInBaryCoordPullModelAMD = 4998, - BuiltInFragStencilRefEXT = 5014, - BuiltInViewportMaskNV = 5253, - BuiltInSecondaryPositionNV = 5257, - BuiltInSecondaryViewportMaskNV = 5258, - BuiltInPositionPerViewNV = 5261, - BuiltInViewportMaskPerViewNV = 5262, - BuiltInMax = 0x7fffffff, -}; - -enum SelectionControlShift { - SelectionControlFlattenShift = 0, - SelectionControlDontFlattenShift = 1, - SelectionControlMax = 0x7fffffff, -}; - -enum SelectionControlMask { - SelectionControlMaskNone = 0, - SelectionControlFlattenMask = 0x00000001, - SelectionControlDontFlattenMask = 0x00000002, -}; - -enum LoopControlShift { - LoopControlUnrollShift = 0, - LoopControlDontUnrollShift = 1, - LoopControlMax = 0x7fffffff, -}; - -enum LoopControlMask { - LoopControlMaskNone = 0, - LoopControlUnrollMask = 0x00000001, - LoopControlDontUnrollMask = 0x00000002, -}; - -enum FunctionControlShift { - FunctionControlInlineShift = 0, - FunctionControlDontInlineShift = 1, - FunctionControlPureShift = 2, - FunctionControlConstShift = 3, - FunctionControlMax = 0x7fffffff, -}; - -enum FunctionControlMask { - FunctionControlMaskNone = 0, - FunctionControlInlineMask = 0x00000001, - FunctionControlDontInlineMask = 0x00000002, - FunctionControlPureMask = 0x00000004, - FunctionControlConstMask = 0x00000008, -}; - -enum MemorySemanticsShift { - MemorySemanticsAcquireShift = 1, - MemorySemanticsReleaseShift = 2, - MemorySemanticsAcquireReleaseShift = 3, - MemorySemanticsSequentiallyConsistentShift = 4, - MemorySemanticsUniformMemoryShift = 6, - MemorySemanticsSubgroupMemoryShift = 7, - MemorySemanticsWorkgroupMemoryShift = 8, - MemorySemanticsCrossWorkgroupMemoryShift = 9, - MemorySemanticsAtomicCounterMemoryShift = 10, - MemorySemanticsImageMemoryShift = 11, - MemorySemanticsMax = 0x7fffffff, -}; - -enum MemorySemanticsMask { - MemorySemanticsMaskNone = 0, - MemorySemanticsAcquireMask = 0x00000002, - MemorySemanticsReleaseMask = 0x00000004, - MemorySemanticsAcquireReleaseMask = 0x00000008, - MemorySemanticsSequentiallyConsistentMask = 0x00000010, - MemorySemanticsUniformMemoryMask = 0x00000040, - MemorySemanticsSubgroupMemoryMask = 0x00000080, - MemorySemanticsWorkgroupMemoryMask = 0x00000100, - MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, - MemorySemanticsAtomicCounterMemoryMask = 0x00000400, - MemorySemanticsImageMemoryMask = 0x00000800, -}; - -enum MemoryAccessShift { - MemoryAccessVolatileShift = 0, - MemoryAccessAlignedShift = 1, - MemoryAccessNontemporalShift = 2, - MemoryAccessMax = 0x7fffffff, -}; - -enum MemoryAccessMask { - MemoryAccessMaskNone = 0, - MemoryAccessVolatileMask = 0x00000001, - MemoryAccessAlignedMask = 0x00000002, - MemoryAccessNontemporalMask = 0x00000004, -}; - -enum Scope { - ScopeCrossDevice = 0, - ScopeDevice = 1, - ScopeWorkgroup = 2, - ScopeSubgroup = 3, - ScopeInvocation = 4, - ScopeMax = 0x7fffffff, -}; - -enum GroupOperation { - GroupOperationReduce = 0, - GroupOperationInclusiveScan = 1, - GroupOperationExclusiveScan = 2, - GroupOperationMax = 0x7fffffff, -}; - -enum KernelEnqueueFlags { - KernelEnqueueFlagsNoWait = 0, - KernelEnqueueFlagsWaitKernel = 1, - KernelEnqueueFlagsWaitWorkGroup = 2, - KernelEnqueueFlagsMax = 0x7fffffff, -}; - -enum KernelProfilingInfoShift { - KernelProfilingInfoCmdExecTimeShift = 0, - KernelProfilingInfoMax = 0x7fffffff, -}; - -enum KernelProfilingInfoMask { - KernelProfilingInfoMaskNone = 0, - KernelProfilingInfoCmdExecTimeMask = 0x00000001, -}; - -enum Capability { - CapabilityMatrix = 0, - CapabilityShader = 1, - CapabilityGeometry = 2, - CapabilityTessellation = 3, - CapabilityAddresses = 4, - CapabilityLinkage = 5, - CapabilityKernel = 6, - CapabilityVector16 = 7, - CapabilityFloat16Buffer = 8, - CapabilityFloat16 = 9, - CapabilityFloat64 = 10, - CapabilityInt64 = 11, - CapabilityInt64Atomics = 12, - CapabilityImageBasic = 13, - CapabilityImageReadWrite = 14, - CapabilityImageMipmap = 15, - CapabilityPipes = 17, - CapabilityGroups = 18, - CapabilityDeviceEnqueue = 19, - CapabilityLiteralSampler = 20, - CapabilityAtomicStorage = 21, - CapabilityInt16 = 22, - CapabilityTessellationPointSize = 23, - CapabilityGeometryPointSize = 24, - CapabilityImageGatherExtended = 25, - CapabilityStorageImageMultisample = 27, - CapabilityUniformBufferArrayDynamicIndexing = 28, - CapabilitySampledImageArrayDynamicIndexing = 29, - CapabilityStorageBufferArrayDynamicIndexing = 30, - CapabilityStorageImageArrayDynamicIndexing = 31, - CapabilityClipDistance = 32, - CapabilityCullDistance = 33, - CapabilityImageCubeArray = 34, - CapabilitySampleRateShading = 35, - CapabilityImageRect = 36, - CapabilitySampledRect = 37, - CapabilityGenericPointer = 38, - CapabilityInt8 = 39, - CapabilityInputAttachment = 40, - CapabilitySparseResidency = 41, - CapabilityMinLod = 42, - CapabilitySampled1D = 43, - CapabilityImage1D = 44, - CapabilitySampledCubeArray = 45, - CapabilitySampledBuffer = 46, - CapabilityImageBuffer = 47, - CapabilityImageMSArray = 48, - CapabilityStorageImageExtendedFormats = 49, - CapabilityImageQuery = 50, - CapabilityDerivativeControl = 51, - CapabilityInterpolationFunction = 52, - CapabilityTransformFeedback = 53, - CapabilityGeometryStreams = 54, - CapabilityStorageImageReadWithoutFormat = 55, - CapabilityStorageImageWriteWithoutFormat = 56, - CapabilityMultiViewport = 57, - CapabilitySubgroupBallotKHR = 4423, - CapabilityDrawParameters = 4427, - CapabilitySubgroupVoteKHR = 4431, - CapabilityStorageBuffer16BitAccess = 4433, - CapabilityStorageUniformBufferBlock16 = 4433, - CapabilityStorageUniform16 = 4434, - CapabilityUniformAndStorageBuffer16BitAccess = 4434, - CapabilityStoragePushConstant16 = 4435, - CapabilityStorageInputOutput16 = 4436, - CapabilityDeviceGroup = 4437, - CapabilityMultiView = 4439, - CapabilityVariablePointersStorageBuffer = 4441, - CapabilityVariablePointers = 4442, - CapabilityAtomicStorageOps = 4445, - CapabilitySampleMaskPostDepthCoverage = 4447, - CapabilityImageGatherBiasLodAMD = 5009, - CapabilityFragmentMaskAMD = 5010, - CapabilityStencilExportEXT = 5013, - CapabilityImageReadWriteLodAMD = 5015, - CapabilitySampleMaskOverrideCoverageNV = 5249, - CapabilityGeometryShaderPassthroughNV = 5251, - CapabilityShaderViewportIndexLayerEXT = 5254, - CapabilityShaderViewportIndexLayerNV = 5254, - CapabilityShaderViewportMaskNV = 5255, - CapabilityShaderStereoViewNV = 5259, - CapabilityPerViewAttributesNV = 5260, - CapabilitySubgroupShuffleINTEL = 5568, - CapabilitySubgroupBufferBlockIOINTEL = 5569, - CapabilitySubgroupImageBlockIOINTEL = 5570, - CapabilityMax = 0x7fffffff, -}; - -enum Op { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, - OpImageSparseRead = 320, - OpDecorateId = 332, - OpSubgroupBallotKHR = 4421, - OpSubgroupFirstInvocationKHR = 4422, - OpSubgroupAllKHR = 4428, - OpSubgroupAnyKHR = 4429, - OpSubgroupAllEqualKHR = 4430, - OpSubgroupReadInvocationKHR = 4432, - OpGroupIAddNonUniformAMD = 5000, - OpGroupFAddNonUniformAMD = 5001, - OpGroupFMinNonUniformAMD = 5002, - OpGroupUMinNonUniformAMD = 5003, - OpGroupSMinNonUniformAMD = 5004, - OpGroupFMaxNonUniformAMD = 5005, - OpGroupUMaxNonUniformAMD = 5006, - OpGroupSMaxNonUniformAMD = 5007, - OpFragmentMaskFetchAMD = 5011, - OpFragmentFetchAMD = 5012, - OpSubgroupShuffleINTEL = 5571, - OpSubgroupShuffleDownINTEL = 5572, - OpSubgroupShuffleUpINTEL = 5573, - OpSubgroupShuffleXorINTEL = 5574, - OpSubgroupBlockReadINTEL = 5575, - OpSubgroupBlockWriteINTEL = 5576, - OpSubgroupImageBlockReadINTEL = 5577, - OpSubgroupImageBlockWriteINTEL = 5578, - OpDecorateStringGOOGLE = 5632, - OpMemberDecorateStringGOOGLE = 5633, - OpMax = 0x7fffffff, -}; - -// Overload operator| for mask bit combining - -inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } -inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } -inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } -inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } -inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } -inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } -inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } -inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } - -} // end namespace spv - -#endif // #ifndef spirv_HPP - diff --git a/include/spirv/1.0/spirv.hpp11 b/include/spirv/1.0/spirv.hpp11 deleted file mode 100644 index 8896e81b..00000000 --- a/include/spirv/1.0/spirv.hpp11 +++ /dev/null @@ -1,1002 +0,0 @@ -// Copyright (c) 2014-2018 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -// This header is automatically generated by the same tool that creates -// the Binary Section of the SPIR-V specification. - -// Enumeration tokens for SPIR-V, in various styles: -// C, C++, C++11, JSON, Lua, Python -// -// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -// -// Some tokens act like mask values, which can be OR'd together, -// while others are mutually exclusive. The mask-like ones have -// "Mask" in their name, and a parallel enum that has the shift -// amount (1 << x) for each corresponding enumerant. - -#ifndef spirv_HPP -#define spirv_HPP - -namespace spv { - -typedef unsigned int Id; - -#define SPV_VERSION 0x10000 -#define SPV_REVISION 12 - -static const unsigned int MagicNumber = 0x07230203; -static const unsigned int Version = 0x00010000; -static const unsigned int Revision = 12; -static const unsigned int OpCodeMask = 0xffff; -static const unsigned int WordCountShift = 16; - -enum class SourceLanguage : unsigned { - Unknown = 0, - ESSL = 1, - GLSL = 2, - OpenCL_C = 3, - OpenCL_CPP = 4, - HLSL = 5, - Max = 0x7fffffff, -}; - -enum class ExecutionModel : unsigned { - Vertex = 0, - TessellationControl = 1, - TessellationEvaluation = 2, - Geometry = 3, - Fragment = 4, - GLCompute = 5, - Kernel = 6, - Max = 0x7fffffff, -}; - -enum class AddressingModel : unsigned { - Logical = 0, - Physical32 = 1, - Physical64 = 2, - Max = 0x7fffffff, -}; - -enum class MemoryModel : unsigned { - Simple = 0, - GLSL450 = 1, - OpenCL = 2, - Max = 0x7fffffff, -}; - -enum class ExecutionMode : unsigned { - Invocations = 0, - SpacingEqual = 1, - SpacingFractionalEven = 2, - SpacingFractionalOdd = 3, - VertexOrderCw = 4, - VertexOrderCcw = 5, - PixelCenterInteger = 6, - OriginUpperLeft = 7, - OriginLowerLeft = 8, - EarlyFragmentTests = 9, - PointMode = 10, - Xfb = 11, - DepthReplacing = 12, - DepthGreater = 14, - DepthLess = 15, - DepthUnchanged = 16, - LocalSize = 17, - LocalSizeHint = 18, - InputPoints = 19, - InputLines = 20, - InputLinesAdjacency = 21, - Triangles = 22, - InputTrianglesAdjacency = 23, - Quads = 24, - Isolines = 25, - OutputVertices = 26, - OutputPoints = 27, - OutputLineStrip = 28, - OutputTriangleStrip = 29, - VecTypeHint = 30, - ContractionOff = 31, - PostDepthCoverage = 4446, - StencilRefReplacingEXT = 5027, - Max = 0x7fffffff, -}; - -enum class StorageClass : unsigned { - UniformConstant = 0, - Input = 1, - Uniform = 2, - Output = 3, - Workgroup = 4, - CrossWorkgroup = 5, - Private = 6, - Function = 7, - Generic = 8, - PushConstant = 9, - AtomicCounter = 10, - Image = 11, - StorageBuffer = 12, - Max = 0x7fffffff, -}; - -enum class Dim : unsigned { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - Cube = 3, - Rect = 4, - Buffer = 5, - SubpassData = 6, - Max = 0x7fffffff, -}; - -enum class SamplerAddressingMode : unsigned { - None = 0, - ClampToEdge = 1, - Clamp = 2, - Repeat = 3, - RepeatMirrored = 4, - Max = 0x7fffffff, -}; - -enum class SamplerFilterMode : unsigned { - Nearest = 0, - Linear = 1, - Max = 0x7fffffff, -}; - -enum class ImageFormat : unsigned { - Unknown = 0, - Rgba32f = 1, - Rgba16f = 2, - R32f = 3, - Rgba8 = 4, - Rgba8Snorm = 5, - Rg32f = 6, - Rg16f = 7, - R11fG11fB10f = 8, - R16f = 9, - Rgba16 = 10, - Rgb10A2 = 11, - Rg16 = 12, - Rg8 = 13, - R16 = 14, - R8 = 15, - Rgba16Snorm = 16, - Rg16Snorm = 17, - Rg8Snorm = 18, - R16Snorm = 19, - R8Snorm = 20, - Rgba32i = 21, - Rgba16i = 22, - Rgba8i = 23, - R32i = 24, - Rg32i = 25, - Rg16i = 26, - Rg8i = 27, - R16i = 28, - R8i = 29, - Rgba32ui = 30, - Rgba16ui = 31, - Rgba8ui = 32, - R32ui = 33, - Rgb10a2ui = 34, - Rg32ui = 35, - Rg16ui = 36, - Rg8ui = 37, - R16ui = 38, - R8ui = 39, - Max = 0x7fffffff, -}; - -enum class ImageChannelOrder : unsigned { - R = 0, - A = 1, - RG = 2, - RA = 3, - RGB = 4, - RGBA = 5, - BGRA = 6, - ARGB = 7, - Intensity = 8, - Luminance = 9, - Rx = 10, - RGx = 11, - RGBx = 12, - Depth = 13, - DepthStencil = 14, - sRGB = 15, - sRGBx = 16, - sRGBA = 17, - sBGRA = 18, - ABGR = 19, - Max = 0x7fffffff, -}; - -enum class ImageChannelDataType : unsigned { - SnormInt8 = 0, - SnormInt16 = 1, - UnormInt8 = 2, - UnormInt16 = 3, - UnormShort565 = 4, - UnormShort555 = 5, - UnormInt101010 = 6, - SignedInt8 = 7, - SignedInt16 = 8, - SignedInt32 = 9, - UnsignedInt8 = 10, - UnsignedInt16 = 11, - UnsignedInt32 = 12, - HalfFloat = 13, - Float = 14, - UnormInt24 = 15, - UnormInt101010_2 = 16, - Max = 0x7fffffff, -}; - -enum class ImageOperandsShift : unsigned { - Bias = 0, - Lod = 1, - Grad = 2, - ConstOffset = 3, - Offset = 4, - ConstOffsets = 5, - Sample = 6, - MinLod = 7, - Max = 0x7fffffff, -}; - -enum class ImageOperandsMask : unsigned { - MaskNone = 0, - Bias = 0x00000001, - Lod = 0x00000002, - Grad = 0x00000004, - ConstOffset = 0x00000008, - Offset = 0x00000010, - ConstOffsets = 0x00000020, - Sample = 0x00000040, - MinLod = 0x00000080, -}; - -enum class FPFastMathModeShift : unsigned { - NotNaN = 0, - NotInf = 1, - NSZ = 2, - AllowRecip = 3, - Fast = 4, - Max = 0x7fffffff, -}; - -enum class FPFastMathModeMask : unsigned { - MaskNone = 0, - NotNaN = 0x00000001, - NotInf = 0x00000002, - NSZ = 0x00000004, - AllowRecip = 0x00000008, - Fast = 0x00000010, -}; - -enum class FPRoundingMode : unsigned { - RTE = 0, - RTZ = 1, - RTP = 2, - RTN = 3, - Max = 0x7fffffff, -}; - -enum class LinkageType : unsigned { - Export = 0, - Import = 1, - Max = 0x7fffffff, -}; - -enum class AccessQualifier : unsigned { - ReadOnly = 0, - WriteOnly = 1, - ReadWrite = 2, - Max = 0x7fffffff, -}; - -enum class FunctionParameterAttribute : unsigned { - Zext = 0, - Sext = 1, - ByVal = 2, - Sret = 3, - NoAlias = 4, - NoCapture = 5, - NoWrite = 6, - NoReadWrite = 7, - Max = 0x7fffffff, -}; - -enum class Decoration : unsigned { - RelaxedPrecision = 0, - SpecId = 1, - Block = 2, - BufferBlock = 3, - RowMajor = 4, - ColMajor = 5, - ArrayStride = 6, - MatrixStride = 7, - GLSLShared = 8, - GLSLPacked = 9, - CPacked = 10, - BuiltIn = 11, - NoPerspective = 13, - Flat = 14, - Patch = 15, - Centroid = 16, - Sample = 17, - Invariant = 18, - Restrict = 19, - Aliased = 20, - Volatile = 21, - Constant = 22, - Coherent = 23, - NonWritable = 24, - NonReadable = 25, - Uniform = 26, - SaturatedConversion = 28, - Stream = 29, - Location = 30, - Component = 31, - Index = 32, - Binding = 33, - DescriptorSet = 34, - Offset = 35, - XfbBuffer = 36, - XfbStride = 37, - FuncParamAttr = 38, - FPRoundingMode = 39, - FPFastMathMode = 40, - LinkageAttributes = 41, - NoContraction = 42, - InputAttachmentIndex = 43, - Alignment = 44, - ExplicitInterpAMD = 4999, - OverrideCoverageNV = 5248, - PassthroughNV = 5250, - ViewportRelativeNV = 5252, - SecondaryViewportRelativeNV = 5256, - HlslCounterBufferGOOGLE = 5634, - HlslSemanticGOOGLE = 5635, - Max = 0x7fffffff, -}; - -enum class BuiltIn : unsigned { - Position = 0, - PointSize = 1, - ClipDistance = 3, - CullDistance = 4, - VertexId = 5, - InstanceId = 6, - PrimitiveId = 7, - InvocationId = 8, - Layer = 9, - ViewportIndex = 10, - TessLevelOuter = 11, - TessLevelInner = 12, - TessCoord = 13, - PatchVertices = 14, - FragCoord = 15, - PointCoord = 16, - FrontFacing = 17, - SampleId = 18, - SamplePosition = 19, - SampleMask = 20, - FragDepth = 22, - HelperInvocation = 23, - NumWorkgroups = 24, - WorkgroupSize = 25, - WorkgroupId = 26, - LocalInvocationId = 27, - GlobalInvocationId = 28, - LocalInvocationIndex = 29, - WorkDim = 30, - GlobalSize = 31, - EnqueuedWorkgroupSize = 32, - GlobalOffset = 33, - GlobalLinearId = 34, - SubgroupSize = 36, - SubgroupMaxSize = 37, - NumSubgroups = 38, - NumEnqueuedSubgroups = 39, - SubgroupId = 40, - SubgroupLocalInvocationId = 41, - VertexIndex = 42, - InstanceIndex = 43, - SubgroupEqMaskKHR = 4416, - SubgroupGeMaskKHR = 4417, - SubgroupGtMaskKHR = 4418, - SubgroupLeMaskKHR = 4419, - SubgroupLtMaskKHR = 4420, - BaseVertex = 4424, - BaseInstance = 4425, - DrawIndex = 4426, - DeviceIndex = 4438, - ViewIndex = 4440, - BaryCoordNoPerspAMD = 4992, - BaryCoordNoPerspCentroidAMD = 4993, - BaryCoordNoPerspSampleAMD = 4994, - BaryCoordSmoothAMD = 4995, - BaryCoordSmoothCentroidAMD = 4996, - BaryCoordSmoothSampleAMD = 4997, - BaryCoordPullModelAMD = 4998, - FragStencilRefEXT = 5014, - ViewportMaskNV = 5253, - SecondaryPositionNV = 5257, - SecondaryViewportMaskNV = 5258, - PositionPerViewNV = 5261, - ViewportMaskPerViewNV = 5262, - Max = 0x7fffffff, -}; - -enum class SelectionControlShift : unsigned { - Flatten = 0, - DontFlatten = 1, - Max = 0x7fffffff, -}; - -enum class SelectionControlMask : unsigned { - MaskNone = 0, - Flatten = 0x00000001, - DontFlatten = 0x00000002, -}; - -enum class LoopControlShift : unsigned { - Unroll = 0, - DontUnroll = 1, - Max = 0x7fffffff, -}; - -enum class LoopControlMask : unsigned { - MaskNone = 0, - Unroll = 0x00000001, - DontUnroll = 0x00000002, -}; - -enum class FunctionControlShift : unsigned { - Inline = 0, - DontInline = 1, - Pure = 2, - Const = 3, - Max = 0x7fffffff, -}; - -enum class FunctionControlMask : unsigned { - MaskNone = 0, - Inline = 0x00000001, - DontInline = 0x00000002, - Pure = 0x00000004, - Const = 0x00000008, -}; - -enum class MemorySemanticsShift : unsigned { - Acquire = 1, - Release = 2, - AcquireRelease = 3, - SequentiallyConsistent = 4, - UniformMemory = 6, - SubgroupMemory = 7, - WorkgroupMemory = 8, - CrossWorkgroupMemory = 9, - AtomicCounterMemory = 10, - ImageMemory = 11, - Max = 0x7fffffff, -}; - -enum class MemorySemanticsMask : unsigned { - MaskNone = 0, - Acquire = 0x00000002, - Release = 0x00000004, - AcquireRelease = 0x00000008, - SequentiallyConsistent = 0x00000010, - UniformMemory = 0x00000040, - SubgroupMemory = 0x00000080, - WorkgroupMemory = 0x00000100, - CrossWorkgroupMemory = 0x00000200, - AtomicCounterMemory = 0x00000400, - ImageMemory = 0x00000800, -}; - -enum class MemoryAccessShift : unsigned { - Volatile = 0, - Aligned = 1, - Nontemporal = 2, - Max = 0x7fffffff, -}; - -enum class MemoryAccessMask : unsigned { - MaskNone = 0, - Volatile = 0x00000001, - Aligned = 0x00000002, - Nontemporal = 0x00000004, -}; - -enum class Scope : unsigned { - CrossDevice = 0, - Device = 1, - Workgroup = 2, - Subgroup = 3, - Invocation = 4, - Max = 0x7fffffff, -}; - -enum class GroupOperation : unsigned { - Reduce = 0, - InclusiveScan = 1, - ExclusiveScan = 2, - Max = 0x7fffffff, -}; - -enum class KernelEnqueueFlags : unsigned { - NoWait = 0, - WaitKernel = 1, - WaitWorkGroup = 2, - Max = 0x7fffffff, -}; - -enum class KernelProfilingInfoShift : unsigned { - CmdExecTime = 0, - Max = 0x7fffffff, -}; - -enum class KernelProfilingInfoMask : unsigned { - MaskNone = 0, - CmdExecTime = 0x00000001, -}; - -enum class Capability : unsigned { - Matrix = 0, - Shader = 1, - Geometry = 2, - Tessellation = 3, - Addresses = 4, - Linkage = 5, - Kernel = 6, - Vector16 = 7, - Float16Buffer = 8, - Float16 = 9, - Float64 = 10, - Int64 = 11, - Int64Atomics = 12, - ImageBasic = 13, - ImageReadWrite = 14, - ImageMipmap = 15, - Pipes = 17, - Groups = 18, - DeviceEnqueue = 19, - LiteralSampler = 20, - AtomicStorage = 21, - Int16 = 22, - TessellationPointSize = 23, - GeometryPointSize = 24, - ImageGatherExtended = 25, - StorageImageMultisample = 27, - UniformBufferArrayDynamicIndexing = 28, - SampledImageArrayDynamicIndexing = 29, - StorageBufferArrayDynamicIndexing = 30, - StorageImageArrayDynamicIndexing = 31, - ClipDistance = 32, - CullDistance = 33, - ImageCubeArray = 34, - SampleRateShading = 35, - ImageRect = 36, - SampledRect = 37, - GenericPointer = 38, - Int8 = 39, - InputAttachment = 40, - SparseResidency = 41, - MinLod = 42, - Sampled1D = 43, - Image1D = 44, - SampledCubeArray = 45, - SampledBuffer = 46, - ImageBuffer = 47, - ImageMSArray = 48, - StorageImageExtendedFormats = 49, - ImageQuery = 50, - DerivativeControl = 51, - InterpolationFunction = 52, - TransformFeedback = 53, - GeometryStreams = 54, - StorageImageReadWithoutFormat = 55, - StorageImageWriteWithoutFormat = 56, - MultiViewport = 57, - SubgroupBallotKHR = 4423, - DrawParameters = 4427, - SubgroupVoteKHR = 4431, - StorageBuffer16BitAccess = 4433, - StorageUniformBufferBlock16 = 4433, - StorageUniform16 = 4434, - UniformAndStorageBuffer16BitAccess = 4434, - StoragePushConstant16 = 4435, - StorageInputOutput16 = 4436, - DeviceGroup = 4437, - MultiView = 4439, - VariablePointersStorageBuffer = 4441, - VariablePointers = 4442, - AtomicStorageOps = 4445, - SampleMaskPostDepthCoverage = 4447, - ImageGatherBiasLodAMD = 5009, - FragmentMaskAMD = 5010, - StencilExportEXT = 5013, - ImageReadWriteLodAMD = 5015, - SampleMaskOverrideCoverageNV = 5249, - GeometryShaderPassthroughNV = 5251, - ShaderViewportIndexLayerEXT = 5254, - ShaderViewportIndexLayerNV = 5254, - ShaderViewportMaskNV = 5255, - ShaderStereoViewNV = 5259, - PerViewAttributesNV = 5260, - SubgroupShuffleINTEL = 5568, - SubgroupBufferBlockIOINTEL = 5569, - SubgroupImageBlockIOINTEL = 5570, - Max = 0x7fffffff, -}; - -enum class Op : unsigned { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, - OpImageSparseRead = 320, - OpDecorateId = 332, - OpSubgroupBallotKHR = 4421, - OpSubgroupFirstInvocationKHR = 4422, - OpSubgroupAllKHR = 4428, - OpSubgroupAnyKHR = 4429, - OpSubgroupAllEqualKHR = 4430, - OpSubgroupReadInvocationKHR = 4432, - OpGroupIAddNonUniformAMD = 5000, - OpGroupFAddNonUniformAMD = 5001, - OpGroupFMinNonUniformAMD = 5002, - OpGroupUMinNonUniformAMD = 5003, - OpGroupSMinNonUniformAMD = 5004, - OpGroupFMaxNonUniformAMD = 5005, - OpGroupUMaxNonUniformAMD = 5006, - OpGroupSMaxNonUniformAMD = 5007, - OpFragmentMaskFetchAMD = 5011, - OpFragmentFetchAMD = 5012, - OpSubgroupShuffleINTEL = 5571, - OpSubgroupShuffleDownINTEL = 5572, - OpSubgroupShuffleUpINTEL = 5573, - OpSubgroupShuffleXorINTEL = 5574, - OpSubgroupBlockReadINTEL = 5575, - OpSubgroupBlockWriteINTEL = 5576, - OpSubgroupImageBlockReadINTEL = 5577, - OpSubgroupImageBlockWriteINTEL = 5578, - OpDecorateStringGOOGLE = 5632, - OpMemberDecorateStringGOOGLE = 5633, - Max = 0x7fffffff, -}; - -// Overload operator| for mask bit combining - -inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } -inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } -inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } -inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } -inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } -inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } -inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } -inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } - -} // end namespace spv - -#endif // #ifndef spirv_HPP - diff --git a/include/spirv/1.0/spirv.json b/include/spirv/1.0/spirv.json deleted file mode 100644 index 9b0a8f3d..00000000 --- a/include/spirv/1.0/spirv.json +++ /dev/null @@ -1,1020 +0,0 @@ -{ - "spv": - { - "meta": - { - "Comment": - [ - [ - "Copyright (c) 2014-2018 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - [ - "This header is automatically generated by the same tool that creates", - "the Binary Section of the SPIR-V specification." - ], - [ - "Enumeration tokens for SPIR-V, in various styles:", - " C, C++, C++11, JSON, Lua, Python", - "", - "- C will have tokens with a \"Spv\" prefix, e.g.: SpvSourceLanguageGLSL", - "- C++ will have tokens in the \"spv\" name space, e.g.: spv::SourceLanguageGLSL", - "- C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL", - "- Lua will use tables, e.g.: spv.SourceLanguage.GLSL", - "- Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL']", - "", - "Some tokens act like mask values, which can be OR'd together,", - "while others are mutually exclusive. The mask-like ones have", - "\"Mask\" in their name, and a parallel enum that has the shift", - "amount (1 << x) for each corresponding enumerant." - ] - ], - "MagicNumber": 119734787, - "Version": 65536, - "Revision": 12, - "OpCodeMask": 65535, - "WordCountShift": 16 - }, - "enum": - [ - { - "Name": "SourceLanguage", - "Type": "Value", - "Values": - { - "Unknown": 0, - "ESSL": 1, - "GLSL": 2, - "OpenCL_C": 3, - "OpenCL_CPP": 4, - "HLSL": 5 - } - }, - { - "Name": "ExecutionModel", - "Type": "Value", - "Values": - { - "Vertex": 0, - "TessellationControl": 1, - "TessellationEvaluation": 2, - "Geometry": 3, - "Fragment": 4, - "GLCompute": 5, - "Kernel": 6 - } - }, - { - "Name": "AddressingModel", - "Type": "Value", - "Values": - { - "Logical": 0, - "Physical32": 1, - "Physical64": 2 - } - }, - { - "Name": "MemoryModel", - "Type": "Value", - "Values": - { - "Simple": 0, - "GLSL450": 1, - "OpenCL": 2 - } - }, - { - "Name": "ExecutionMode", - "Type": "Value", - "Values": - { - "Invocations": 0, - "SpacingEqual": 1, - "SpacingFractionalEven": 2, - "SpacingFractionalOdd": 3, - "VertexOrderCw": 4, - "VertexOrderCcw": 5, - "PixelCenterInteger": 6, - "OriginUpperLeft": 7, - "OriginLowerLeft": 8, - "EarlyFragmentTests": 9, - "PointMode": 10, - "Xfb": 11, - "DepthReplacing": 12, - "DepthGreater": 14, - "DepthLess": 15, - "DepthUnchanged": 16, - "LocalSize": 17, - "LocalSizeHint": 18, - "InputPoints": 19, - "InputLines": 20, - "InputLinesAdjacency": 21, - "Triangles": 22, - "InputTrianglesAdjacency": 23, - "Quads": 24, - "Isolines": 25, - "OutputVertices": 26, - "OutputPoints": 27, - "OutputLineStrip": 28, - "OutputTriangleStrip": 29, - "VecTypeHint": 30, - "ContractionOff": 31, - "PostDepthCoverage": 4446, - "StencilRefReplacingEXT": 5027 - } - }, - { - "Name": "StorageClass", - "Type": "Value", - "Values": - { - "UniformConstant": 0, - "Input": 1, - "Uniform": 2, - "Output": 3, - "Workgroup": 4, - "CrossWorkgroup": 5, - "Private": 6, - "Function": 7, - "Generic": 8, - "PushConstant": 9, - "AtomicCounter": 10, - "Image": 11, - "StorageBuffer": 12 - } - }, - { - "Name": "Dim", - "Type": "Value", - "Values": - { - "Dim1D": 0, - "Dim2D": 1, - "Dim3D": 2, - "Cube": 3, - "Rect": 4, - "Buffer": 5, - "SubpassData": 6 - } - }, - { - "Name": "SamplerAddressingMode", - "Type": "Value", - "Values": - { - "None": 0, - "ClampToEdge": 1, - "Clamp": 2, - "Repeat": 3, - "RepeatMirrored": 4 - } - }, - { - "Name": "SamplerFilterMode", - "Type": "Value", - "Values": - { - "Nearest": 0, - "Linear": 1 - } - }, - { - "Name": "ImageFormat", - "Type": "Value", - "Values": - { - "Unknown": 0, - "Rgba32f": 1, - "Rgba16f": 2, - "R32f": 3, - "Rgba8": 4, - "Rgba8Snorm": 5, - "Rg32f": 6, - "Rg16f": 7, - "R11fG11fB10f": 8, - "R16f": 9, - "Rgba16": 10, - "Rgb10A2": 11, - "Rg16": 12, - "Rg8": 13, - "R16": 14, - "R8": 15, - "Rgba16Snorm": 16, - "Rg16Snorm": 17, - "Rg8Snorm": 18, - "R16Snorm": 19, - "R8Snorm": 20, - "Rgba32i": 21, - "Rgba16i": 22, - "Rgba8i": 23, - "R32i": 24, - "Rg32i": 25, - "Rg16i": 26, - "Rg8i": 27, - "R16i": 28, - "R8i": 29, - "Rgba32ui": 30, - "Rgba16ui": 31, - "Rgba8ui": 32, - "R32ui": 33, - "Rgb10a2ui": 34, - "Rg32ui": 35, - "Rg16ui": 36, - "Rg8ui": 37, - "R16ui": 38, - "R8ui": 39 - } - }, - { - "Name": "ImageChannelOrder", - "Type": "Value", - "Values": - { - "R": 0, - "A": 1, - "RG": 2, - "RA": 3, - "RGB": 4, - "RGBA": 5, - "BGRA": 6, - "ARGB": 7, - "Intensity": 8, - "Luminance": 9, - "Rx": 10, - "RGx": 11, - "RGBx": 12, - "Depth": 13, - "DepthStencil": 14, - "sRGB": 15, - "sRGBx": 16, - "sRGBA": 17, - "sBGRA": 18, - "ABGR": 19 - } - }, - { - "Name": "ImageChannelDataType", - "Type": "Value", - "Values": - { - "SnormInt8": 0, - "SnormInt16": 1, - "UnormInt8": 2, - "UnormInt16": 3, - "UnormShort565": 4, - "UnormShort555": 5, - "UnormInt101010": 6, - "SignedInt8": 7, - "SignedInt16": 8, - "SignedInt32": 9, - "UnsignedInt8": 10, - "UnsignedInt16": 11, - "UnsignedInt32": 12, - "HalfFloat": 13, - "Float": 14, - "UnormInt24": 15, - "UnormInt101010_2": 16 - } - }, - { - "Name": "ImageOperands", - "Type": "Bit", - "Values": - { - "Bias": 0, - "Lod": 1, - "Grad": 2, - "ConstOffset": 3, - "Offset": 4, - "ConstOffsets": 5, - "Sample": 6, - "MinLod": 7 - } - }, - { - "Name": "FPFastMathMode", - "Type": "Bit", - "Values": - { - "NotNaN": 0, - "NotInf": 1, - "NSZ": 2, - "AllowRecip": 3, - "Fast": 4 - } - }, - { - "Name": "FPRoundingMode", - "Type": "Value", - "Values": - { - "RTE": 0, - "RTZ": 1, - "RTP": 2, - "RTN": 3 - } - }, - { - "Name": "LinkageType", - "Type": "Value", - "Values": - { - "Export": 0, - "Import": 1 - } - }, - { - "Name": "AccessQualifier", - "Type": "Value", - "Values": - { - "ReadOnly": 0, - "WriteOnly": 1, - "ReadWrite": 2 - } - }, - { - "Name": "FunctionParameterAttribute", - "Type": "Value", - "Values": - { - "Zext": 0, - "Sext": 1, - "ByVal": 2, - "Sret": 3, - "NoAlias": 4, - "NoCapture": 5, - "NoWrite": 6, - "NoReadWrite": 7 - } - }, - { - "Name": "Decoration", - "Type": "Value", - "Values": - { - "RelaxedPrecision": 0, - "SpecId": 1, - "Block": 2, - "BufferBlock": 3, - "RowMajor": 4, - "ColMajor": 5, - "ArrayStride": 6, - "MatrixStride": 7, - "GLSLShared": 8, - "GLSLPacked": 9, - "CPacked": 10, - "BuiltIn": 11, - "NoPerspective": 13, - "Flat": 14, - "Patch": 15, - "Centroid": 16, - "Sample": 17, - "Invariant": 18, - "Restrict": 19, - "Aliased": 20, - "Volatile": 21, - "Constant": 22, - "Coherent": 23, - "NonWritable": 24, - "NonReadable": 25, - "Uniform": 26, - "SaturatedConversion": 28, - "Stream": 29, - "Location": 30, - "Component": 31, - "Index": 32, - "Binding": 33, - "DescriptorSet": 34, - "Offset": 35, - "XfbBuffer": 36, - "XfbStride": 37, - "FuncParamAttr": 38, - "FPRoundingMode": 39, - "FPFastMathMode": 40, - "LinkageAttributes": 41, - "NoContraction": 42, - "InputAttachmentIndex": 43, - "Alignment": 44, - "ExplicitInterpAMD": 4999, - "OverrideCoverageNV": 5248, - "PassthroughNV": 5250, - "ViewportRelativeNV": 5252, - "SecondaryViewportRelativeNV": 5256, - "HlslCounterBufferGOOGLE": 5634, - "HlslSemanticGOOGLE": 5635 - } - }, - { - "Name": "BuiltIn", - "Type": "Value", - "Values": - { - "Position": 0, - "PointSize": 1, - "ClipDistance": 3, - "CullDistance": 4, - "VertexId": 5, - "InstanceId": 6, - "PrimitiveId": 7, - "InvocationId": 8, - "Layer": 9, - "ViewportIndex": 10, - "TessLevelOuter": 11, - "TessLevelInner": 12, - "TessCoord": 13, - "PatchVertices": 14, - "FragCoord": 15, - "PointCoord": 16, - "FrontFacing": 17, - "SampleId": 18, - "SamplePosition": 19, - "SampleMask": 20, - "FragDepth": 22, - "HelperInvocation": 23, - "NumWorkgroups": 24, - "WorkgroupSize": 25, - "WorkgroupId": 26, - "LocalInvocationId": 27, - "GlobalInvocationId": 28, - "LocalInvocationIndex": 29, - "WorkDim": 30, - "GlobalSize": 31, - "EnqueuedWorkgroupSize": 32, - "GlobalOffset": 33, - "GlobalLinearId": 34, - "SubgroupSize": 36, - "SubgroupMaxSize": 37, - "NumSubgroups": 38, - "NumEnqueuedSubgroups": 39, - "SubgroupId": 40, - "SubgroupLocalInvocationId": 41, - "VertexIndex": 42, - "InstanceIndex": 43, - "SubgroupEqMaskKHR": 4416, - "SubgroupGeMaskKHR": 4417, - "SubgroupGtMaskKHR": 4418, - "SubgroupLeMaskKHR": 4419, - "SubgroupLtMaskKHR": 4420, - "BaseVertex": 4424, - "BaseInstance": 4425, - "DrawIndex": 4426, - "DeviceIndex": 4438, - "ViewIndex": 4440, - "BaryCoordNoPerspAMD": 4992, - "BaryCoordNoPerspCentroidAMD": 4993, - "BaryCoordNoPerspSampleAMD": 4994, - "BaryCoordSmoothAMD": 4995, - "BaryCoordSmoothCentroidAMD": 4996, - "BaryCoordSmoothSampleAMD": 4997, - "BaryCoordPullModelAMD": 4998, - "FragStencilRefEXT": 5014, - "ViewportMaskNV": 5253, - "SecondaryPositionNV": 5257, - "SecondaryViewportMaskNV": 5258, - "PositionPerViewNV": 5261, - "ViewportMaskPerViewNV": 5262 - } - }, - { - "Name": "SelectionControl", - "Type": "Bit", - "Values": - { - "Flatten": 0, - "DontFlatten": 1 - } - }, - { - "Name": "LoopControl", - "Type": "Bit", - "Values": - { - "Unroll": 0, - "DontUnroll": 1 - } - }, - { - "Name": "FunctionControl", - "Type": "Bit", - "Values": - { - "Inline": 0, - "DontInline": 1, - "Pure": 2, - "Const": 3 - } - }, - { - "Name": "MemorySemantics", - "Type": "Bit", - "Values": - { - "Acquire": 1, - "Release": 2, - "AcquireRelease": 3, - "SequentiallyConsistent": 4, - "UniformMemory": 6, - "SubgroupMemory": 7, - "WorkgroupMemory": 8, - "CrossWorkgroupMemory": 9, - "AtomicCounterMemory": 10, - "ImageMemory": 11 - } - }, - { - "Name": "MemoryAccess", - "Type": "Bit", - "Values": - { - "Volatile": 0, - "Aligned": 1, - "Nontemporal": 2 - } - }, - { - "Name": "Scope", - "Type": "Value", - "Values": - { - "CrossDevice": 0, - "Device": 1, - "Workgroup": 2, - "Subgroup": 3, - "Invocation": 4 - } - }, - { - "Name": "GroupOperation", - "Type": "Value", - "Values": - { - "Reduce": 0, - "InclusiveScan": 1, - "ExclusiveScan": 2 - } - }, - { - "Name": "KernelEnqueueFlags", - "Type": "Value", - "Values": - { - "NoWait": 0, - "WaitKernel": 1, - "WaitWorkGroup": 2 - } - }, - { - "Name": "KernelProfilingInfo", - "Type": "Bit", - "Values": - { - "CmdExecTime": 0 - } - }, - { - "Name": "Capability", - "Type": "Value", - "Values": - { - "Matrix": 0, - "Shader": 1, - "Geometry": 2, - "Tessellation": 3, - "Addresses": 4, - "Linkage": 5, - "Kernel": 6, - "Vector16": 7, - "Float16Buffer": 8, - "Float16": 9, - "Float64": 10, - "Int64": 11, - "Int64Atomics": 12, - "ImageBasic": 13, - "ImageReadWrite": 14, - "ImageMipmap": 15, - "Pipes": 17, - "Groups": 18, - "DeviceEnqueue": 19, - "LiteralSampler": 20, - "AtomicStorage": 21, - "Int16": 22, - "TessellationPointSize": 23, - "GeometryPointSize": 24, - "ImageGatherExtended": 25, - "StorageImageMultisample": 27, - "UniformBufferArrayDynamicIndexing": 28, - "SampledImageArrayDynamicIndexing": 29, - "StorageBufferArrayDynamicIndexing": 30, - "StorageImageArrayDynamicIndexing": 31, - "ClipDistance": 32, - "CullDistance": 33, - "ImageCubeArray": 34, - "SampleRateShading": 35, - "ImageRect": 36, - "SampledRect": 37, - "GenericPointer": 38, - "Int8": 39, - "InputAttachment": 40, - "SparseResidency": 41, - "MinLod": 42, - "Sampled1D": 43, - "Image1D": 44, - "SampledCubeArray": 45, - "SampledBuffer": 46, - "ImageBuffer": 47, - "ImageMSArray": 48, - "StorageImageExtendedFormats": 49, - "ImageQuery": 50, - "DerivativeControl": 51, - "InterpolationFunction": 52, - "TransformFeedback": 53, - "GeometryStreams": 54, - "StorageImageReadWithoutFormat": 55, - "StorageImageWriteWithoutFormat": 56, - "MultiViewport": 57, - "SubgroupBallotKHR": 4423, - "DrawParameters": 4427, - "SubgroupVoteKHR": 4431, - "StorageBuffer16BitAccess": 4433, - "StorageUniformBufferBlock16": 4433, - "StorageUniform16": 4434, - "UniformAndStorageBuffer16BitAccess": 4434, - "StoragePushConstant16": 4435, - "StorageInputOutput16": 4436, - "DeviceGroup": 4437, - "MultiView": 4439, - "VariablePointersStorageBuffer": 4441, - "VariablePointers": 4442, - "AtomicStorageOps": 4445, - "SampleMaskPostDepthCoverage": 4447, - "ImageGatherBiasLodAMD": 5009, - "FragmentMaskAMD": 5010, - "StencilExportEXT": 5013, - "ImageReadWriteLodAMD": 5015, - "SampleMaskOverrideCoverageNV": 5249, - "GeometryShaderPassthroughNV": 5251, - "ShaderViewportIndexLayerEXT": 5254, - "ShaderViewportIndexLayerNV": 5254, - "ShaderViewportMaskNV": 5255, - "ShaderStereoViewNV": 5259, - "PerViewAttributesNV": 5260, - "SubgroupShuffleINTEL": 5568, - "SubgroupBufferBlockIOINTEL": 5569, - "SubgroupImageBlockIOINTEL": 5570 - } - }, - { - "Name": "Op", - "Type": "Value", - "Values": - { - "OpNop": 0, - "OpUndef": 1, - "OpSourceContinued": 2, - "OpSource": 3, - "OpSourceExtension": 4, - "OpName": 5, - "OpMemberName": 6, - "OpString": 7, - "OpLine": 8, - "OpExtension": 10, - "OpExtInstImport": 11, - "OpExtInst": 12, - "OpMemoryModel": 14, - "OpEntryPoint": 15, - "OpExecutionMode": 16, - "OpCapability": 17, - "OpTypeVoid": 19, - "OpTypeBool": 20, - "OpTypeInt": 21, - "OpTypeFloat": 22, - "OpTypeVector": 23, - "OpTypeMatrix": 24, - "OpTypeImage": 25, - "OpTypeSampler": 26, - "OpTypeSampledImage": 27, - "OpTypeArray": 28, - "OpTypeRuntimeArray": 29, - "OpTypeStruct": 30, - "OpTypeOpaque": 31, - "OpTypePointer": 32, - "OpTypeFunction": 33, - "OpTypeEvent": 34, - "OpTypeDeviceEvent": 35, - "OpTypeReserveId": 36, - "OpTypeQueue": 37, - "OpTypePipe": 38, - "OpTypeForwardPointer": 39, - "OpConstantTrue": 41, - "OpConstantFalse": 42, - "OpConstant": 43, - "OpConstantComposite": 44, - "OpConstantSampler": 45, - "OpConstantNull": 46, - "OpSpecConstantTrue": 48, - "OpSpecConstantFalse": 49, - "OpSpecConstant": 50, - "OpSpecConstantComposite": 51, - "OpSpecConstantOp": 52, - "OpFunction": 54, - "OpFunctionParameter": 55, - "OpFunctionEnd": 56, - "OpFunctionCall": 57, - "OpVariable": 59, - "OpImageTexelPointer": 60, - "OpLoad": 61, - "OpStore": 62, - "OpCopyMemory": 63, - "OpCopyMemorySized": 64, - "OpAccessChain": 65, - "OpInBoundsAccessChain": 66, - "OpPtrAccessChain": 67, - "OpArrayLength": 68, - "OpGenericPtrMemSemantics": 69, - "OpInBoundsPtrAccessChain": 70, - "OpDecorate": 71, - "OpMemberDecorate": 72, - "OpDecorationGroup": 73, - "OpGroupDecorate": 74, - "OpGroupMemberDecorate": 75, - "OpVectorExtractDynamic": 77, - "OpVectorInsertDynamic": 78, - "OpVectorShuffle": 79, - "OpCompositeConstruct": 80, - "OpCompositeExtract": 81, - "OpCompositeInsert": 82, - "OpCopyObject": 83, - "OpTranspose": 84, - "OpSampledImage": 86, - "OpImageSampleImplicitLod": 87, - "OpImageSampleExplicitLod": 88, - "OpImageSampleDrefImplicitLod": 89, - "OpImageSampleDrefExplicitLod": 90, - "OpImageSampleProjImplicitLod": 91, - "OpImageSampleProjExplicitLod": 92, - "OpImageSampleProjDrefImplicitLod": 93, - "OpImageSampleProjDrefExplicitLod": 94, - "OpImageFetch": 95, - "OpImageGather": 96, - "OpImageDrefGather": 97, - "OpImageRead": 98, - "OpImageWrite": 99, - "OpImage": 100, - "OpImageQueryFormat": 101, - "OpImageQueryOrder": 102, - "OpImageQuerySizeLod": 103, - "OpImageQuerySize": 104, - "OpImageQueryLod": 105, - "OpImageQueryLevels": 106, - "OpImageQuerySamples": 107, - "OpConvertFToU": 109, - "OpConvertFToS": 110, - "OpConvertSToF": 111, - "OpConvertUToF": 112, - "OpUConvert": 113, - "OpSConvert": 114, - "OpFConvert": 115, - "OpQuantizeToF16": 116, - "OpConvertPtrToU": 117, - "OpSatConvertSToU": 118, - "OpSatConvertUToS": 119, - "OpConvertUToPtr": 120, - "OpPtrCastToGeneric": 121, - "OpGenericCastToPtr": 122, - "OpGenericCastToPtrExplicit": 123, - "OpBitcast": 124, - "OpSNegate": 126, - "OpFNegate": 127, - "OpIAdd": 128, - "OpFAdd": 129, - "OpISub": 130, - "OpFSub": 131, - "OpIMul": 132, - "OpFMul": 133, - "OpUDiv": 134, - "OpSDiv": 135, - "OpFDiv": 136, - "OpUMod": 137, - "OpSRem": 138, - "OpSMod": 139, - "OpFRem": 140, - "OpFMod": 141, - "OpVectorTimesScalar": 142, - "OpMatrixTimesScalar": 143, - "OpVectorTimesMatrix": 144, - "OpMatrixTimesVector": 145, - "OpMatrixTimesMatrix": 146, - "OpOuterProduct": 147, - "OpDot": 148, - "OpIAddCarry": 149, - "OpISubBorrow": 150, - "OpUMulExtended": 151, - "OpSMulExtended": 152, - "OpAny": 154, - "OpAll": 155, - "OpIsNan": 156, - "OpIsInf": 157, - "OpIsFinite": 158, - "OpIsNormal": 159, - "OpSignBitSet": 160, - "OpLessOrGreater": 161, - "OpOrdered": 162, - "OpUnordered": 163, - "OpLogicalEqual": 164, - "OpLogicalNotEqual": 165, - "OpLogicalOr": 166, - "OpLogicalAnd": 167, - "OpLogicalNot": 168, - "OpSelect": 169, - "OpIEqual": 170, - "OpINotEqual": 171, - "OpUGreaterThan": 172, - "OpSGreaterThan": 173, - "OpUGreaterThanEqual": 174, - "OpSGreaterThanEqual": 175, - "OpULessThan": 176, - "OpSLessThan": 177, - "OpULessThanEqual": 178, - "OpSLessThanEqual": 179, - "OpFOrdEqual": 180, - "OpFUnordEqual": 181, - "OpFOrdNotEqual": 182, - "OpFUnordNotEqual": 183, - "OpFOrdLessThan": 184, - "OpFUnordLessThan": 185, - "OpFOrdGreaterThan": 186, - "OpFUnordGreaterThan": 187, - "OpFOrdLessThanEqual": 188, - "OpFUnordLessThanEqual": 189, - "OpFOrdGreaterThanEqual": 190, - "OpFUnordGreaterThanEqual": 191, - "OpShiftRightLogical": 194, - "OpShiftRightArithmetic": 195, - "OpShiftLeftLogical": 196, - "OpBitwiseOr": 197, - "OpBitwiseXor": 198, - "OpBitwiseAnd": 199, - "OpNot": 200, - "OpBitFieldInsert": 201, - "OpBitFieldSExtract": 202, - "OpBitFieldUExtract": 203, - "OpBitReverse": 204, - "OpBitCount": 205, - "OpDPdx": 207, - "OpDPdy": 208, - "OpFwidth": 209, - "OpDPdxFine": 210, - "OpDPdyFine": 211, - "OpFwidthFine": 212, - "OpDPdxCoarse": 213, - "OpDPdyCoarse": 214, - "OpFwidthCoarse": 215, - "OpEmitVertex": 218, - "OpEndPrimitive": 219, - "OpEmitStreamVertex": 220, - "OpEndStreamPrimitive": 221, - "OpControlBarrier": 224, - "OpMemoryBarrier": 225, - "OpAtomicLoad": 227, - "OpAtomicStore": 228, - "OpAtomicExchange": 229, - "OpAtomicCompareExchange": 230, - "OpAtomicCompareExchangeWeak": 231, - "OpAtomicIIncrement": 232, - "OpAtomicIDecrement": 233, - "OpAtomicIAdd": 234, - "OpAtomicISub": 235, - "OpAtomicSMin": 236, - "OpAtomicUMin": 237, - "OpAtomicSMax": 238, - "OpAtomicUMax": 239, - "OpAtomicAnd": 240, - "OpAtomicOr": 241, - "OpAtomicXor": 242, - "OpPhi": 245, - "OpLoopMerge": 246, - "OpSelectionMerge": 247, - "OpLabel": 248, - "OpBranch": 249, - "OpBranchConditional": 250, - "OpSwitch": 251, - "OpKill": 252, - "OpReturn": 253, - "OpReturnValue": 254, - "OpUnreachable": 255, - "OpLifetimeStart": 256, - "OpLifetimeStop": 257, - "OpGroupAsyncCopy": 259, - "OpGroupWaitEvents": 260, - "OpGroupAll": 261, - "OpGroupAny": 262, - "OpGroupBroadcast": 263, - "OpGroupIAdd": 264, - "OpGroupFAdd": 265, - "OpGroupFMin": 266, - "OpGroupUMin": 267, - "OpGroupSMin": 268, - "OpGroupFMax": 269, - "OpGroupUMax": 270, - "OpGroupSMax": 271, - "OpReadPipe": 274, - "OpWritePipe": 275, - "OpReservedReadPipe": 276, - "OpReservedWritePipe": 277, - "OpReserveReadPipePackets": 278, - "OpReserveWritePipePackets": 279, - "OpCommitReadPipe": 280, - "OpCommitWritePipe": 281, - "OpIsValidReserveId": 282, - "OpGetNumPipePackets": 283, - "OpGetMaxPipePackets": 284, - "OpGroupReserveReadPipePackets": 285, - "OpGroupReserveWritePipePackets": 286, - "OpGroupCommitReadPipe": 287, - "OpGroupCommitWritePipe": 288, - "OpEnqueueMarker": 291, - "OpEnqueueKernel": 292, - "OpGetKernelNDrangeSubGroupCount": 293, - "OpGetKernelNDrangeMaxSubGroupSize": 294, - "OpGetKernelWorkGroupSize": 295, - "OpGetKernelPreferredWorkGroupSizeMultiple": 296, - "OpRetainEvent": 297, - "OpReleaseEvent": 298, - "OpCreateUserEvent": 299, - "OpIsValidEvent": 300, - "OpSetUserEventStatus": 301, - "OpCaptureEventProfilingInfo": 302, - "OpGetDefaultQueue": 303, - "OpBuildNDRange": 304, - "OpImageSparseSampleImplicitLod": 305, - "OpImageSparseSampleExplicitLod": 306, - "OpImageSparseSampleDrefImplicitLod": 307, - "OpImageSparseSampleDrefExplicitLod": 308, - "OpImageSparseSampleProjImplicitLod": 309, - "OpImageSparseSampleProjExplicitLod": 310, - "OpImageSparseSampleProjDrefImplicitLod": 311, - "OpImageSparseSampleProjDrefExplicitLod": 312, - "OpImageSparseFetch": 313, - "OpImageSparseGather": 314, - "OpImageSparseDrefGather": 315, - "OpImageSparseTexelsResident": 316, - "OpNoLine": 317, - "OpAtomicFlagTestAndSet": 318, - "OpAtomicFlagClear": 319, - "OpImageSparseRead": 320, - "OpDecorateId": 332, - "OpSubgroupBallotKHR": 4421, - "OpSubgroupFirstInvocationKHR": 4422, - "OpSubgroupAllKHR": 4428, - "OpSubgroupAnyKHR": 4429, - "OpSubgroupAllEqualKHR": 4430, - "OpSubgroupReadInvocationKHR": 4432, - "OpGroupIAddNonUniformAMD": 5000, - "OpGroupFAddNonUniformAMD": 5001, - "OpGroupFMinNonUniformAMD": 5002, - "OpGroupUMinNonUniformAMD": 5003, - "OpGroupSMinNonUniformAMD": 5004, - "OpGroupFMaxNonUniformAMD": 5005, - "OpGroupUMaxNonUniformAMD": 5006, - "OpGroupSMaxNonUniformAMD": 5007, - "OpFragmentMaskFetchAMD": 5011, - "OpFragmentFetchAMD": 5012, - "OpSubgroupShuffleINTEL": 5571, - "OpSubgroupShuffleDownINTEL": 5572, - "OpSubgroupShuffleUpINTEL": 5573, - "OpSubgroupShuffleXorINTEL": 5574, - "OpSubgroupBlockReadINTEL": 5575, - "OpSubgroupBlockWriteINTEL": 5576, - "OpSubgroupImageBlockReadINTEL": 5577, - "OpSubgroupImageBlockWriteINTEL": 5578, - "OpDecorateStringGOOGLE": 5632, - "OpMemberDecorateStringGOOGLE": 5633 - } - } - ] - } -} - diff --git a/include/spirv/1.0/spirv.lua b/include/spirv/1.0/spirv.lua deleted file mode 100644 index 2bd33ba0..00000000 --- a/include/spirv/1.0/spirv.lua +++ /dev/null @@ -1,949 +0,0 @@ --- Copyright (c) 2014-2018 The Khronos Group Inc. --- --- Permission is hereby granted, free of charge, to any person obtaining a copy --- of this software and/or associated documentation files (the "Materials"), --- to deal in the Materials without restriction, including without limitation --- the rights to use, copy, modify, merge, publish, distribute, sublicense, --- and/or sell copies of the Materials, and to permit persons to whom the --- Materials are furnished to do so, subject to the following conditions: --- --- The above copyright notice and this permission notice shall be included in --- all copies or substantial portions of the Materials. --- --- MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS --- STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND --- HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ --- --- THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL --- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING --- FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS --- IN THE MATERIALS. - --- This header is automatically generated by the same tool that creates --- the Binary Section of the SPIR-V specification. - --- Enumeration tokens for SPIR-V, in various styles: --- C, C++, C++11, JSON, Lua, Python --- --- - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL --- - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL --- - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL --- - Lua will use tables, e.g.: spv.SourceLanguage.GLSL --- - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] --- --- Some tokens act like mask values, which can be OR'd together, --- while others are mutually exclusive. The mask-like ones have --- "Mask" in their name, and a parallel enum that has the shift --- amount (1 << x) for each corresponding enumerant. - -spv = { - MagicNumber = 0x07230203, - Version = 0x00010000, - Revision = 12, - OpCodeMask = 0xffff, - WordCountShift = 16, - - SourceLanguage = { - Unknown = 0, - ESSL = 1, - GLSL = 2, - OpenCL_C = 3, - OpenCL_CPP = 4, - HLSL = 5, - }, - - ExecutionModel = { - Vertex = 0, - TessellationControl = 1, - TessellationEvaluation = 2, - Geometry = 3, - Fragment = 4, - GLCompute = 5, - Kernel = 6, - }, - - AddressingModel = { - Logical = 0, - Physical32 = 1, - Physical64 = 2, - }, - - MemoryModel = { - Simple = 0, - GLSL450 = 1, - OpenCL = 2, - }, - - ExecutionMode = { - Invocations = 0, - SpacingEqual = 1, - SpacingFractionalEven = 2, - SpacingFractionalOdd = 3, - VertexOrderCw = 4, - VertexOrderCcw = 5, - PixelCenterInteger = 6, - OriginUpperLeft = 7, - OriginLowerLeft = 8, - EarlyFragmentTests = 9, - PointMode = 10, - Xfb = 11, - DepthReplacing = 12, - DepthGreater = 14, - DepthLess = 15, - DepthUnchanged = 16, - LocalSize = 17, - LocalSizeHint = 18, - InputPoints = 19, - InputLines = 20, - InputLinesAdjacency = 21, - Triangles = 22, - InputTrianglesAdjacency = 23, - Quads = 24, - Isolines = 25, - OutputVertices = 26, - OutputPoints = 27, - OutputLineStrip = 28, - OutputTriangleStrip = 29, - VecTypeHint = 30, - ContractionOff = 31, - PostDepthCoverage = 4446, - StencilRefReplacingEXT = 5027, - }, - - StorageClass = { - UniformConstant = 0, - Input = 1, - Uniform = 2, - Output = 3, - Workgroup = 4, - CrossWorkgroup = 5, - Private = 6, - Function = 7, - Generic = 8, - PushConstant = 9, - AtomicCounter = 10, - Image = 11, - StorageBuffer = 12, - }, - - Dim = { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - Cube = 3, - Rect = 4, - Buffer = 5, - SubpassData = 6, - }, - - SamplerAddressingMode = { - None = 0, - ClampToEdge = 1, - Clamp = 2, - Repeat = 3, - RepeatMirrored = 4, - }, - - SamplerFilterMode = { - Nearest = 0, - Linear = 1, - }, - - ImageFormat = { - Unknown = 0, - Rgba32f = 1, - Rgba16f = 2, - R32f = 3, - Rgba8 = 4, - Rgba8Snorm = 5, - Rg32f = 6, - Rg16f = 7, - R11fG11fB10f = 8, - R16f = 9, - Rgba16 = 10, - Rgb10A2 = 11, - Rg16 = 12, - Rg8 = 13, - R16 = 14, - R8 = 15, - Rgba16Snorm = 16, - Rg16Snorm = 17, - Rg8Snorm = 18, - R16Snorm = 19, - R8Snorm = 20, - Rgba32i = 21, - Rgba16i = 22, - Rgba8i = 23, - R32i = 24, - Rg32i = 25, - Rg16i = 26, - Rg8i = 27, - R16i = 28, - R8i = 29, - Rgba32ui = 30, - Rgba16ui = 31, - Rgba8ui = 32, - R32ui = 33, - Rgb10a2ui = 34, - Rg32ui = 35, - Rg16ui = 36, - Rg8ui = 37, - R16ui = 38, - R8ui = 39, - }, - - ImageChannelOrder = { - R = 0, - A = 1, - RG = 2, - RA = 3, - RGB = 4, - RGBA = 5, - BGRA = 6, - ARGB = 7, - Intensity = 8, - Luminance = 9, - Rx = 10, - RGx = 11, - RGBx = 12, - Depth = 13, - DepthStencil = 14, - sRGB = 15, - sRGBx = 16, - sRGBA = 17, - sBGRA = 18, - ABGR = 19, - }, - - ImageChannelDataType = { - SnormInt8 = 0, - SnormInt16 = 1, - UnormInt8 = 2, - UnormInt16 = 3, - UnormShort565 = 4, - UnormShort555 = 5, - UnormInt101010 = 6, - SignedInt8 = 7, - SignedInt16 = 8, - SignedInt32 = 9, - UnsignedInt8 = 10, - UnsignedInt16 = 11, - UnsignedInt32 = 12, - HalfFloat = 13, - Float = 14, - UnormInt24 = 15, - UnormInt101010_2 = 16, - }, - - ImageOperandsShift = { - Bias = 0, - Lod = 1, - Grad = 2, - ConstOffset = 3, - Offset = 4, - ConstOffsets = 5, - Sample = 6, - MinLod = 7, - }, - - ImageOperandsMask = { - MaskNone = 0, - Bias = 0x00000001, - Lod = 0x00000002, - Grad = 0x00000004, - ConstOffset = 0x00000008, - Offset = 0x00000010, - ConstOffsets = 0x00000020, - Sample = 0x00000040, - MinLod = 0x00000080, - }, - - FPFastMathModeShift = { - NotNaN = 0, - NotInf = 1, - NSZ = 2, - AllowRecip = 3, - Fast = 4, - }, - - FPFastMathModeMask = { - MaskNone = 0, - NotNaN = 0x00000001, - NotInf = 0x00000002, - NSZ = 0x00000004, - AllowRecip = 0x00000008, - Fast = 0x00000010, - }, - - FPRoundingMode = { - RTE = 0, - RTZ = 1, - RTP = 2, - RTN = 3, - }, - - LinkageType = { - Export = 0, - Import = 1, - }, - - AccessQualifier = { - ReadOnly = 0, - WriteOnly = 1, - ReadWrite = 2, - }, - - FunctionParameterAttribute = { - Zext = 0, - Sext = 1, - ByVal = 2, - Sret = 3, - NoAlias = 4, - NoCapture = 5, - NoWrite = 6, - NoReadWrite = 7, - }, - - Decoration = { - RelaxedPrecision = 0, - SpecId = 1, - Block = 2, - BufferBlock = 3, - RowMajor = 4, - ColMajor = 5, - ArrayStride = 6, - MatrixStride = 7, - GLSLShared = 8, - GLSLPacked = 9, - CPacked = 10, - BuiltIn = 11, - NoPerspective = 13, - Flat = 14, - Patch = 15, - Centroid = 16, - Sample = 17, - Invariant = 18, - Restrict = 19, - Aliased = 20, - Volatile = 21, - Constant = 22, - Coherent = 23, - NonWritable = 24, - NonReadable = 25, - Uniform = 26, - SaturatedConversion = 28, - Stream = 29, - Location = 30, - Component = 31, - Index = 32, - Binding = 33, - DescriptorSet = 34, - Offset = 35, - XfbBuffer = 36, - XfbStride = 37, - FuncParamAttr = 38, - FPRoundingMode = 39, - FPFastMathMode = 40, - LinkageAttributes = 41, - NoContraction = 42, - InputAttachmentIndex = 43, - Alignment = 44, - ExplicitInterpAMD = 4999, - OverrideCoverageNV = 5248, - PassthroughNV = 5250, - ViewportRelativeNV = 5252, - SecondaryViewportRelativeNV = 5256, - HlslCounterBufferGOOGLE = 5634, - HlslSemanticGOOGLE = 5635, - }, - - BuiltIn = { - Position = 0, - PointSize = 1, - ClipDistance = 3, - CullDistance = 4, - VertexId = 5, - InstanceId = 6, - PrimitiveId = 7, - InvocationId = 8, - Layer = 9, - ViewportIndex = 10, - TessLevelOuter = 11, - TessLevelInner = 12, - TessCoord = 13, - PatchVertices = 14, - FragCoord = 15, - PointCoord = 16, - FrontFacing = 17, - SampleId = 18, - SamplePosition = 19, - SampleMask = 20, - FragDepth = 22, - HelperInvocation = 23, - NumWorkgroups = 24, - WorkgroupSize = 25, - WorkgroupId = 26, - LocalInvocationId = 27, - GlobalInvocationId = 28, - LocalInvocationIndex = 29, - WorkDim = 30, - GlobalSize = 31, - EnqueuedWorkgroupSize = 32, - GlobalOffset = 33, - GlobalLinearId = 34, - SubgroupSize = 36, - SubgroupMaxSize = 37, - NumSubgroups = 38, - NumEnqueuedSubgroups = 39, - SubgroupId = 40, - SubgroupLocalInvocationId = 41, - VertexIndex = 42, - InstanceIndex = 43, - SubgroupEqMaskKHR = 4416, - SubgroupGeMaskKHR = 4417, - SubgroupGtMaskKHR = 4418, - SubgroupLeMaskKHR = 4419, - SubgroupLtMaskKHR = 4420, - BaseVertex = 4424, - BaseInstance = 4425, - DrawIndex = 4426, - DeviceIndex = 4438, - ViewIndex = 4440, - BaryCoordNoPerspAMD = 4992, - BaryCoordNoPerspCentroidAMD = 4993, - BaryCoordNoPerspSampleAMD = 4994, - BaryCoordSmoothAMD = 4995, - BaryCoordSmoothCentroidAMD = 4996, - BaryCoordSmoothSampleAMD = 4997, - BaryCoordPullModelAMD = 4998, - FragStencilRefEXT = 5014, - ViewportMaskNV = 5253, - SecondaryPositionNV = 5257, - SecondaryViewportMaskNV = 5258, - PositionPerViewNV = 5261, - ViewportMaskPerViewNV = 5262, - }, - - SelectionControlShift = { - Flatten = 0, - DontFlatten = 1, - }, - - SelectionControlMask = { - MaskNone = 0, - Flatten = 0x00000001, - DontFlatten = 0x00000002, - }, - - LoopControlShift = { - Unroll = 0, - DontUnroll = 1, - }, - - LoopControlMask = { - MaskNone = 0, - Unroll = 0x00000001, - DontUnroll = 0x00000002, - }, - - FunctionControlShift = { - Inline = 0, - DontInline = 1, - Pure = 2, - Const = 3, - }, - - FunctionControlMask = { - MaskNone = 0, - Inline = 0x00000001, - DontInline = 0x00000002, - Pure = 0x00000004, - Const = 0x00000008, - }, - - MemorySemanticsShift = { - Acquire = 1, - Release = 2, - AcquireRelease = 3, - SequentiallyConsistent = 4, - UniformMemory = 6, - SubgroupMemory = 7, - WorkgroupMemory = 8, - CrossWorkgroupMemory = 9, - AtomicCounterMemory = 10, - ImageMemory = 11, - }, - - MemorySemanticsMask = { - MaskNone = 0, - Acquire = 0x00000002, - Release = 0x00000004, - AcquireRelease = 0x00000008, - SequentiallyConsistent = 0x00000010, - UniformMemory = 0x00000040, - SubgroupMemory = 0x00000080, - WorkgroupMemory = 0x00000100, - CrossWorkgroupMemory = 0x00000200, - AtomicCounterMemory = 0x00000400, - ImageMemory = 0x00000800, - }, - - MemoryAccessShift = { - Volatile = 0, - Aligned = 1, - Nontemporal = 2, - }, - - MemoryAccessMask = { - MaskNone = 0, - Volatile = 0x00000001, - Aligned = 0x00000002, - Nontemporal = 0x00000004, - }, - - Scope = { - CrossDevice = 0, - Device = 1, - Workgroup = 2, - Subgroup = 3, - Invocation = 4, - }, - - GroupOperation = { - Reduce = 0, - InclusiveScan = 1, - ExclusiveScan = 2, - }, - - KernelEnqueueFlags = { - NoWait = 0, - WaitKernel = 1, - WaitWorkGroup = 2, - }, - - KernelProfilingInfoShift = { - CmdExecTime = 0, - }, - - KernelProfilingInfoMask = { - MaskNone = 0, - CmdExecTime = 0x00000001, - }, - - Capability = { - Matrix = 0, - Shader = 1, - Geometry = 2, - Tessellation = 3, - Addresses = 4, - Linkage = 5, - Kernel = 6, - Vector16 = 7, - Float16Buffer = 8, - Float16 = 9, - Float64 = 10, - Int64 = 11, - Int64Atomics = 12, - ImageBasic = 13, - ImageReadWrite = 14, - ImageMipmap = 15, - Pipes = 17, - Groups = 18, - DeviceEnqueue = 19, - LiteralSampler = 20, - AtomicStorage = 21, - Int16 = 22, - TessellationPointSize = 23, - GeometryPointSize = 24, - ImageGatherExtended = 25, - StorageImageMultisample = 27, - UniformBufferArrayDynamicIndexing = 28, - SampledImageArrayDynamicIndexing = 29, - StorageBufferArrayDynamicIndexing = 30, - StorageImageArrayDynamicIndexing = 31, - ClipDistance = 32, - CullDistance = 33, - ImageCubeArray = 34, - SampleRateShading = 35, - ImageRect = 36, - SampledRect = 37, - GenericPointer = 38, - Int8 = 39, - InputAttachment = 40, - SparseResidency = 41, - MinLod = 42, - Sampled1D = 43, - Image1D = 44, - SampledCubeArray = 45, - SampledBuffer = 46, - ImageBuffer = 47, - ImageMSArray = 48, - StorageImageExtendedFormats = 49, - ImageQuery = 50, - DerivativeControl = 51, - InterpolationFunction = 52, - TransformFeedback = 53, - GeometryStreams = 54, - StorageImageReadWithoutFormat = 55, - StorageImageWriteWithoutFormat = 56, - MultiViewport = 57, - SubgroupBallotKHR = 4423, - DrawParameters = 4427, - SubgroupVoteKHR = 4431, - StorageBuffer16BitAccess = 4433, - StorageUniformBufferBlock16 = 4433, - StorageUniform16 = 4434, - UniformAndStorageBuffer16BitAccess = 4434, - StoragePushConstant16 = 4435, - StorageInputOutput16 = 4436, - DeviceGroup = 4437, - MultiView = 4439, - VariablePointersStorageBuffer = 4441, - VariablePointers = 4442, - AtomicStorageOps = 4445, - SampleMaskPostDepthCoverage = 4447, - ImageGatherBiasLodAMD = 5009, - FragmentMaskAMD = 5010, - StencilExportEXT = 5013, - ImageReadWriteLodAMD = 5015, - SampleMaskOverrideCoverageNV = 5249, - GeometryShaderPassthroughNV = 5251, - ShaderViewportIndexLayerEXT = 5254, - ShaderViewportIndexLayerNV = 5254, - ShaderViewportMaskNV = 5255, - ShaderStereoViewNV = 5259, - PerViewAttributesNV = 5260, - SubgroupShuffleINTEL = 5568, - SubgroupBufferBlockIOINTEL = 5569, - SubgroupImageBlockIOINTEL = 5570, - }, - - Op = { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, - OpImageSparseRead = 320, - OpDecorateId = 332, - OpSubgroupBallotKHR = 4421, - OpSubgroupFirstInvocationKHR = 4422, - OpSubgroupAllKHR = 4428, - OpSubgroupAnyKHR = 4429, - OpSubgroupAllEqualKHR = 4430, - OpSubgroupReadInvocationKHR = 4432, - OpGroupIAddNonUniformAMD = 5000, - OpGroupFAddNonUniformAMD = 5001, - OpGroupFMinNonUniformAMD = 5002, - OpGroupUMinNonUniformAMD = 5003, - OpGroupSMinNonUniformAMD = 5004, - OpGroupFMaxNonUniformAMD = 5005, - OpGroupUMaxNonUniformAMD = 5006, - OpGroupSMaxNonUniformAMD = 5007, - OpFragmentMaskFetchAMD = 5011, - OpFragmentFetchAMD = 5012, - OpSubgroupShuffleINTEL = 5571, - OpSubgroupShuffleDownINTEL = 5572, - OpSubgroupShuffleUpINTEL = 5573, - OpSubgroupShuffleXorINTEL = 5574, - OpSubgroupBlockReadINTEL = 5575, - OpSubgroupBlockWriteINTEL = 5576, - OpSubgroupImageBlockReadINTEL = 5577, - OpSubgroupImageBlockWriteINTEL = 5578, - OpDecorateStringGOOGLE = 5632, - OpMemberDecorateStringGOOGLE = 5633, - }, - -} - diff --git a/include/spirv/1.0/spirv.py b/include/spirv/1.0/spirv.py deleted file mode 100644 index 8a200e76..00000000 --- a/include/spirv/1.0/spirv.py +++ /dev/null @@ -1,949 +0,0 @@ -# Copyright (c) 2014-2018 The Khronos Group Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and/or associated documentation files (the "Materials"), -# to deal in the Materials without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Materials, and to permit persons to whom the -# Materials are furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Materials. -# -# MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -# STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -# HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -# -# THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -# IN THE MATERIALS. - -# This header is automatically generated by the same tool that creates -# the Binary Section of the SPIR-V specification. - -# Enumeration tokens for SPIR-V, in various styles: -# C, C++, C++11, JSON, Lua, Python -# -# - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -# - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -# - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -# - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -# - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -# -# Some tokens act like mask values, which can be OR'd together, -# while others are mutually exclusive. The mask-like ones have -# "Mask" in their name, and a parallel enum that has the shift -# amount (1 << x) for each corresponding enumerant. - -spv = { - 'MagicNumber' : 0x07230203, - 'Version' : 0x00010000, - 'Revision' : 12, - 'OpCodeMask' : 0xffff, - 'WordCountShift' : 16, - - 'SourceLanguage' : { - 'Unknown' : 0, - 'ESSL' : 1, - 'GLSL' : 2, - 'OpenCL_C' : 3, - 'OpenCL_CPP' : 4, - 'HLSL' : 5, - }, - - 'ExecutionModel' : { - 'Vertex' : 0, - 'TessellationControl' : 1, - 'TessellationEvaluation' : 2, - 'Geometry' : 3, - 'Fragment' : 4, - 'GLCompute' : 5, - 'Kernel' : 6, - }, - - 'AddressingModel' : { - 'Logical' : 0, - 'Physical32' : 1, - 'Physical64' : 2, - }, - - 'MemoryModel' : { - 'Simple' : 0, - 'GLSL450' : 1, - 'OpenCL' : 2, - }, - - 'ExecutionMode' : { - 'Invocations' : 0, - 'SpacingEqual' : 1, - 'SpacingFractionalEven' : 2, - 'SpacingFractionalOdd' : 3, - 'VertexOrderCw' : 4, - 'VertexOrderCcw' : 5, - 'PixelCenterInteger' : 6, - 'OriginUpperLeft' : 7, - 'OriginLowerLeft' : 8, - 'EarlyFragmentTests' : 9, - 'PointMode' : 10, - 'Xfb' : 11, - 'DepthReplacing' : 12, - 'DepthGreater' : 14, - 'DepthLess' : 15, - 'DepthUnchanged' : 16, - 'LocalSize' : 17, - 'LocalSizeHint' : 18, - 'InputPoints' : 19, - 'InputLines' : 20, - 'InputLinesAdjacency' : 21, - 'Triangles' : 22, - 'InputTrianglesAdjacency' : 23, - 'Quads' : 24, - 'Isolines' : 25, - 'OutputVertices' : 26, - 'OutputPoints' : 27, - 'OutputLineStrip' : 28, - 'OutputTriangleStrip' : 29, - 'VecTypeHint' : 30, - 'ContractionOff' : 31, - 'PostDepthCoverage' : 4446, - 'StencilRefReplacingEXT' : 5027, - }, - - 'StorageClass' : { - 'UniformConstant' : 0, - 'Input' : 1, - 'Uniform' : 2, - 'Output' : 3, - 'Workgroup' : 4, - 'CrossWorkgroup' : 5, - 'Private' : 6, - 'Function' : 7, - 'Generic' : 8, - 'PushConstant' : 9, - 'AtomicCounter' : 10, - 'Image' : 11, - 'StorageBuffer' : 12, - }, - - 'Dim' : { - 'Dim1D' : 0, - 'Dim2D' : 1, - 'Dim3D' : 2, - 'Cube' : 3, - 'Rect' : 4, - 'Buffer' : 5, - 'SubpassData' : 6, - }, - - 'SamplerAddressingMode' : { - 'None' : 0, - 'ClampToEdge' : 1, - 'Clamp' : 2, - 'Repeat' : 3, - 'RepeatMirrored' : 4, - }, - - 'SamplerFilterMode' : { - 'Nearest' : 0, - 'Linear' : 1, - }, - - 'ImageFormat' : { - 'Unknown' : 0, - 'Rgba32f' : 1, - 'Rgba16f' : 2, - 'R32f' : 3, - 'Rgba8' : 4, - 'Rgba8Snorm' : 5, - 'Rg32f' : 6, - 'Rg16f' : 7, - 'R11fG11fB10f' : 8, - 'R16f' : 9, - 'Rgba16' : 10, - 'Rgb10A2' : 11, - 'Rg16' : 12, - 'Rg8' : 13, - 'R16' : 14, - 'R8' : 15, - 'Rgba16Snorm' : 16, - 'Rg16Snorm' : 17, - 'Rg8Snorm' : 18, - 'R16Snorm' : 19, - 'R8Snorm' : 20, - 'Rgba32i' : 21, - 'Rgba16i' : 22, - 'Rgba8i' : 23, - 'R32i' : 24, - 'Rg32i' : 25, - 'Rg16i' : 26, - 'Rg8i' : 27, - 'R16i' : 28, - 'R8i' : 29, - 'Rgba32ui' : 30, - 'Rgba16ui' : 31, - 'Rgba8ui' : 32, - 'R32ui' : 33, - 'Rgb10a2ui' : 34, - 'Rg32ui' : 35, - 'Rg16ui' : 36, - 'Rg8ui' : 37, - 'R16ui' : 38, - 'R8ui' : 39, - }, - - 'ImageChannelOrder' : { - 'R' : 0, - 'A' : 1, - 'RG' : 2, - 'RA' : 3, - 'RGB' : 4, - 'RGBA' : 5, - 'BGRA' : 6, - 'ARGB' : 7, - 'Intensity' : 8, - 'Luminance' : 9, - 'Rx' : 10, - 'RGx' : 11, - 'RGBx' : 12, - 'Depth' : 13, - 'DepthStencil' : 14, - 'sRGB' : 15, - 'sRGBx' : 16, - 'sRGBA' : 17, - 'sBGRA' : 18, - 'ABGR' : 19, - }, - - 'ImageChannelDataType' : { - 'SnormInt8' : 0, - 'SnormInt16' : 1, - 'UnormInt8' : 2, - 'UnormInt16' : 3, - 'UnormShort565' : 4, - 'UnormShort555' : 5, - 'UnormInt101010' : 6, - 'SignedInt8' : 7, - 'SignedInt16' : 8, - 'SignedInt32' : 9, - 'UnsignedInt8' : 10, - 'UnsignedInt16' : 11, - 'UnsignedInt32' : 12, - 'HalfFloat' : 13, - 'Float' : 14, - 'UnormInt24' : 15, - 'UnormInt101010_2' : 16, - }, - - 'ImageOperandsShift' : { - 'Bias' : 0, - 'Lod' : 1, - 'Grad' : 2, - 'ConstOffset' : 3, - 'Offset' : 4, - 'ConstOffsets' : 5, - 'Sample' : 6, - 'MinLod' : 7, - }, - - 'ImageOperandsMask' : { - 'MaskNone' : 0, - 'Bias' : 0x00000001, - 'Lod' : 0x00000002, - 'Grad' : 0x00000004, - 'ConstOffset' : 0x00000008, - 'Offset' : 0x00000010, - 'ConstOffsets' : 0x00000020, - 'Sample' : 0x00000040, - 'MinLod' : 0x00000080, - }, - - 'FPFastMathModeShift' : { - 'NotNaN' : 0, - 'NotInf' : 1, - 'NSZ' : 2, - 'AllowRecip' : 3, - 'Fast' : 4, - }, - - 'FPFastMathModeMask' : { - 'MaskNone' : 0, - 'NotNaN' : 0x00000001, - 'NotInf' : 0x00000002, - 'NSZ' : 0x00000004, - 'AllowRecip' : 0x00000008, - 'Fast' : 0x00000010, - }, - - 'FPRoundingMode' : { - 'RTE' : 0, - 'RTZ' : 1, - 'RTP' : 2, - 'RTN' : 3, - }, - - 'LinkageType' : { - 'Export' : 0, - 'Import' : 1, - }, - - 'AccessQualifier' : { - 'ReadOnly' : 0, - 'WriteOnly' : 1, - 'ReadWrite' : 2, - }, - - 'FunctionParameterAttribute' : { - 'Zext' : 0, - 'Sext' : 1, - 'ByVal' : 2, - 'Sret' : 3, - 'NoAlias' : 4, - 'NoCapture' : 5, - 'NoWrite' : 6, - 'NoReadWrite' : 7, - }, - - 'Decoration' : { - 'RelaxedPrecision' : 0, - 'SpecId' : 1, - 'Block' : 2, - 'BufferBlock' : 3, - 'RowMajor' : 4, - 'ColMajor' : 5, - 'ArrayStride' : 6, - 'MatrixStride' : 7, - 'GLSLShared' : 8, - 'GLSLPacked' : 9, - 'CPacked' : 10, - 'BuiltIn' : 11, - 'NoPerspective' : 13, - 'Flat' : 14, - 'Patch' : 15, - 'Centroid' : 16, - 'Sample' : 17, - 'Invariant' : 18, - 'Restrict' : 19, - 'Aliased' : 20, - 'Volatile' : 21, - 'Constant' : 22, - 'Coherent' : 23, - 'NonWritable' : 24, - 'NonReadable' : 25, - 'Uniform' : 26, - 'SaturatedConversion' : 28, - 'Stream' : 29, - 'Location' : 30, - 'Component' : 31, - 'Index' : 32, - 'Binding' : 33, - 'DescriptorSet' : 34, - 'Offset' : 35, - 'XfbBuffer' : 36, - 'XfbStride' : 37, - 'FuncParamAttr' : 38, - 'FPRoundingMode' : 39, - 'FPFastMathMode' : 40, - 'LinkageAttributes' : 41, - 'NoContraction' : 42, - 'InputAttachmentIndex' : 43, - 'Alignment' : 44, - 'ExplicitInterpAMD' : 4999, - 'OverrideCoverageNV' : 5248, - 'PassthroughNV' : 5250, - 'ViewportRelativeNV' : 5252, - 'SecondaryViewportRelativeNV' : 5256, - 'HlslCounterBufferGOOGLE' : 5634, - 'HlslSemanticGOOGLE' : 5635, - }, - - 'BuiltIn' : { - 'Position' : 0, - 'PointSize' : 1, - 'ClipDistance' : 3, - 'CullDistance' : 4, - 'VertexId' : 5, - 'InstanceId' : 6, - 'PrimitiveId' : 7, - 'InvocationId' : 8, - 'Layer' : 9, - 'ViewportIndex' : 10, - 'TessLevelOuter' : 11, - 'TessLevelInner' : 12, - 'TessCoord' : 13, - 'PatchVertices' : 14, - 'FragCoord' : 15, - 'PointCoord' : 16, - 'FrontFacing' : 17, - 'SampleId' : 18, - 'SamplePosition' : 19, - 'SampleMask' : 20, - 'FragDepth' : 22, - 'HelperInvocation' : 23, - 'NumWorkgroups' : 24, - 'WorkgroupSize' : 25, - 'WorkgroupId' : 26, - 'LocalInvocationId' : 27, - 'GlobalInvocationId' : 28, - 'LocalInvocationIndex' : 29, - 'WorkDim' : 30, - 'GlobalSize' : 31, - 'EnqueuedWorkgroupSize' : 32, - 'GlobalOffset' : 33, - 'GlobalLinearId' : 34, - 'SubgroupSize' : 36, - 'SubgroupMaxSize' : 37, - 'NumSubgroups' : 38, - 'NumEnqueuedSubgroups' : 39, - 'SubgroupId' : 40, - 'SubgroupLocalInvocationId' : 41, - 'VertexIndex' : 42, - 'InstanceIndex' : 43, - 'SubgroupEqMaskKHR' : 4416, - 'SubgroupGeMaskKHR' : 4417, - 'SubgroupGtMaskKHR' : 4418, - 'SubgroupLeMaskKHR' : 4419, - 'SubgroupLtMaskKHR' : 4420, - 'BaseVertex' : 4424, - 'BaseInstance' : 4425, - 'DrawIndex' : 4426, - 'DeviceIndex' : 4438, - 'ViewIndex' : 4440, - 'BaryCoordNoPerspAMD' : 4992, - 'BaryCoordNoPerspCentroidAMD' : 4993, - 'BaryCoordNoPerspSampleAMD' : 4994, - 'BaryCoordSmoothAMD' : 4995, - 'BaryCoordSmoothCentroidAMD' : 4996, - 'BaryCoordSmoothSampleAMD' : 4997, - 'BaryCoordPullModelAMD' : 4998, - 'FragStencilRefEXT' : 5014, - 'ViewportMaskNV' : 5253, - 'SecondaryPositionNV' : 5257, - 'SecondaryViewportMaskNV' : 5258, - 'PositionPerViewNV' : 5261, - 'ViewportMaskPerViewNV' : 5262, - }, - - 'SelectionControlShift' : { - 'Flatten' : 0, - 'DontFlatten' : 1, - }, - - 'SelectionControlMask' : { - 'MaskNone' : 0, - 'Flatten' : 0x00000001, - 'DontFlatten' : 0x00000002, - }, - - 'LoopControlShift' : { - 'Unroll' : 0, - 'DontUnroll' : 1, - }, - - 'LoopControlMask' : { - 'MaskNone' : 0, - 'Unroll' : 0x00000001, - 'DontUnroll' : 0x00000002, - }, - - 'FunctionControlShift' : { - 'Inline' : 0, - 'DontInline' : 1, - 'Pure' : 2, - 'Const' : 3, - }, - - 'FunctionControlMask' : { - 'MaskNone' : 0, - 'Inline' : 0x00000001, - 'DontInline' : 0x00000002, - 'Pure' : 0x00000004, - 'Const' : 0x00000008, - }, - - 'MemorySemanticsShift' : { - 'Acquire' : 1, - 'Release' : 2, - 'AcquireRelease' : 3, - 'SequentiallyConsistent' : 4, - 'UniformMemory' : 6, - 'SubgroupMemory' : 7, - 'WorkgroupMemory' : 8, - 'CrossWorkgroupMemory' : 9, - 'AtomicCounterMemory' : 10, - 'ImageMemory' : 11, - }, - - 'MemorySemanticsMask' : { - 'MaskNone' : 0, - 'Acquire' : 0x00000002, - 'Release' : 0x00000004, - 'AcquireRelease' : 0x00000008, - 'SequentiallyConsistent' : 0x00000010, - 'UniformMemory' : 0x00000040, - 'SubgroupMemory' : 0x00000080, - 'WorkgroupMemory' : 0x00000100, - 'CrossWorkgroupMemory' : 0x00000200, - 'AtomicCounterMemory' : 0x00000400, - 'ImageMemory' : 0x00000800, - }, - - 'MemoryAccessShift' : { - 'Volatile' : 0, - 'Aligned' : 1, - 'Nontemporal' : 2, - }, - - 'MemoryAccessMask' : { - 'MaskNone' : 0, - 'Volatile' : 0x00000001, - 'Aligned' : 0x00000002, - 'Nontemporal' : 0x00000004, - }, - - 'Scope' : { - 'CrossDevice' : 0, - 'Device' : 1, - 'Workgroup' : 2, - 'Subgroup' : 3, - 'Invocation' : 4, - }, - - 'GroupOperation' : { - 'Reduce' : 0, - 'InclusiveScan' : 1, - 'ExclusiveScan' : 2, - }, - - 'KernelEnqueueFlags' : { - 'NoWait' : 0, - 'WaitKernel' : 1, - 'WaitWorkGroup' : 2, - }, - - 'KernelProfilingInfoShift' : { - 'CmdExecTime' : 0, - }, - - 'KernelProfilingInfoMask' : { - 'MaskNone' : 0, - 'CmdExecTime' : 0x00000001, - }, - - 'Capability' : { - 'Matrix' : 0, - 'Shader' : 1, - 'Geometry' : 2, - 'Tessellation' : 3, - 'Addresses' : 4, - 'Linkage' : 5, - 'Kernel' : 6, - 'Vector16' : 7, - 'Float16Buffer' : 8, - 'Float16' : 9, - 'Float64' : 10, - 'Int64' : 11, - 'Int64Atomics' : 12, - 'ImageBasic' : 13, - 'ImageReadWrite' : 14, - 'ImageMipmap' : 15, - 'Pipes' : 17, - 'Groups' : 18, - 'DeviceEnqueue' : 19, - 'LiteralSampler' : 20, - 'AtomicStorage' : 21, - 'Int16' : 22, - 'TessellationPointSize' : 23, - 'GeometryPointSize' : 24, - 'ImageGatherExtended' : 25, - 'StorageImageMultisample' : 27, - 'UniformBufferArrayDynamicIndexing' : 28, - 'SampledImageArrayDynamicIndexing' : 29, - 'StorageBufferArrayDynamicIndexing' : 30, - 'StorageImageArrayDynamicIndexing' : 31, - 'ClipDistance' : 32, - 'CullDistance' : 33, - 'ImageCubeArray' : 34, - 'SampleRateShading' : 35, - 'ImageRect' : 36, - 'SampledRect' : 37, - 'GenericPointer' : 38, - 'Int8' : 39, - 'InputAttachment' : 40, - 'SparseResidency' : 41, - 'MinLod' : 42, - 'Sampled1D' : 43, - 'Image1D' : 44, - 'SampledCubeArray' : 45, - 'SampledBuffer' : 46, - 'ImageBuffer' : 47, - 'ImageMSArray' : 48, - 'StorageImageExtendedFormats' : 49, - 'ImageQuery' : 50, - 'DerivativeControl' : 51, - 'InterpolationFunction' : 52, - 'TransformFeedback' : 53, - 'GeometryStreams' : 54, - 'StorageImageReadWithoutFormat' : 55, - 'StorageImageWriteWithoutFormat' : 56, - 'MultiViewport' : 57, - 'SubgroupBallotKHR' : 4423, - 'DrawParameters' : 4427, - 'SubgroupVoteKHR' : 4431, - 'StorageBuffer16BitAccess' : 4433, - 'StorageUniformBufferBlock16' : 4433, - 'StorageUniform16' : 4434, - 'UniformAndStorageBuffer16BitAccess' : 4434, - 'StoragePushConstant16' : 4435, - 'StorageInputOutput16' : 4436, - 'DeviceGroup' : 4437, - 'MultiView' : 4439, - 'VariablePointersStorageBuffer' : 4441, - 'VariablePointers' : 4442, - 'AtomicStorageOps' : 4445, - 'SampleMaskPostDepthCoverage' : 4447, - 'ImageGatherBiasLodAMD' : 5009, - 'FragmentMaskAMD' : 5010, - 'StencilExportEXT' : 5013, - 'ImageReadWriteLodAMD' : 5015, - 'SampleMaskOverrideCoverageNV' : 5249, - 'GeometryShaderPassthroughNV' : 5251, - 'ShaderViewportIndexLayerEXT' : 5254, - 'ShaderViewportIndexLayerNV' : 5254, - 'ShaderViewportMaskNV' : 5255, - 'ShaderStereoViewNV' : 5259, - 'PerViewAttributesNV' : 5260, - 'SubgroupShuffleINTEL' : 5568, - 'SubgroupBufferBlockIOINTEL' : 5569, - 'SubgroupImageBlockIOINTEL' : 5570, - }, - - 'Op' : { - 'OpNop' : 0, - 'OpUndef' : 1, - 'OpSourceContinued' : 2, - 'OpSource' : 3, - 'OpSourceExtension' : 4, - 'OpName' : 5, - 'OpMemberName' : 6, - 'OpString' : 7, - 'OpLine' : 8, - 'OpExtension' : 10, - 'OpExtInstImport' : 11, - 'OpExtInst' : 12, - 'OpMemoryModel' : 14, - 'OpEntryPoint' : 15, - 'OpExecutionMode' : 16, - 'OpCapability' : 17, - 'OpTypeVoid' : 19, - 'OpTypeBool' : 20, - 'OpTypeInt' : 21, - 'OpTypeFloat' : 22, - 'OpTypeVector' : 23, - 'OpTypeMatrix' : 24, - 'OpTypeImage' : 25, - 'OpTypeSampler' : 26, - 'OpTypeSampledImage' : 27, - 'OpTypeArray' : 28, - 'OpTypeRuntimeArray' : 29, - 'OpTypeStruct' : 30, - 'OpTypeOpaque' : 31, - 'OpTypePointer' : 32, - 'OpTypeFunction' : 33, - 'OpTypeEvent' : 34, - 'OpTypeDeviceEvent' : 35, - 'OpTypeReserveId' : 36, - 'OpTypeQueue' : 37, - 'OpTypePipe' : 38, - 'OpTypeForwardPointer' : 39, - 'OpConstantTrue' : 41, - 'OpConstantFalse' : 42, - 'OpConstant' : 43, - 'OpConstantComposite' : 44, - 'OpConstantSampler' : 45, - 'OpConstantNull' : 46, - 'OpSpecConstantTrue' : 48, - 'OpSpecConstantFalse' : 49, - 'OpSpecConstant' : 50, - 'OpSpecConstantComposite' : 51, - 'OpSpecConstantOp' : 52, - 'OpFunction' : 54, - 'OpFunctionParameter' : 55, - 'OpFunctionEnd' : 56, - 'OpFunctionCall' : 57, - 'OpVariable' : 59, - 'OpImageTexelPointer' : 60, - 'OpLoad' : 61, - 'OpStore' : 62, - 'OpCopyMemory' : 63, - 'OpCopyMemorySized' : 64, - 'OpAccessChain' : 65, - 'OpInBoundsAccessChain' : 66, - 'OpPtrAccessChain' : 67, - 'OpArrayLength' : 68, - 'OpGenericPtrMemSemantics' : 69, - 'OpInBoundsPtrAccessChain' : 70, - 'OpDecorate' : 71, - 'OpMemberDecorate' : 72, - 'OpDecorationGroup' : 73, - 'OpGroupDecorate' : 74, - 'OpGroupMemberDecorate' : 75, - 'OpVectorExtractDynamic' : 77, - 'OpVectorInsertDynamic' : 78, - 'OpVectorShuffle' : 79, - 'OpCompositeConstruct' : 80, - 'OpCompositeExtract' : 81, - 'OpCompositeInsert' : 82, - 'OpCopyObject' : 83, - 'OpTranspose' : 84, - 'OpSampledImage' : 86, - 'OpImageSampleImplicitLod' : 87, - 'OpImageSampleExplicitLod' : 88, - 'OpImageSampleDrefImplicitLod' : 89, - 'OpImageSampleDrefExplicitLod' : 90, - 'OpImageSampleProjImplicitLod' : 91, - 'OpImageSampleProjExplicitLod' : 92, - 'OpImageSampleProjDrefImplicitLod' : 93, - 'OpImageSampleProjDrefExplicitLod' : 94, - 'OpImageFetch' : 95, - 'OpImageGather' : 96, - 'OpImageDrefGather' : 97, - 'OpImageRead' : 98, - 'OpImageWrite' : 99, - 'OpImage' : 100, - 'OpImageQueryFormat' : 101, - 'OpImageQueryOrder' : 102, - 'OpImageQuerySizeLod' : 103, - 'OpImageQuerySize' : 104, - 'OpImageQueryLod' : 105, - 'OpImageQueryLevels' : 106, - 'OpImageQuerySamples' : 107, - 'OpConvertFToU' : 109, - 'OpConvertFToS' : 110, - 'OpConvertSToF' : 111, - 'OpConvertUToF' : 112, - 'OpUConvert' : 113, - 'OpSConvert' : 114, - 'OpFConvert' : 115, - 'OpQuantizeToF16' : 116, - 'OpConvertPtrToU' : 117, - 'OpSatConvertSToU' : 118, - 'OpSatConvertUToS' : 119, - 'OpConvertUToPtr' : 120, - 'OpPtrCastToGeneric' : 121, - 'OpGenericCastToPtr' : 122, - 'OpGenericCastToPtrExplicit' : 123, - 'OpBitcast' : 124, - 'OpSNegate' : 126, - 'OpFNegate' : 127, - 'OpIAdd' : 128, - 'OpFAdd' : 129, - 'OpISub' : 130, - 'OpFSub' : 131, - 'OpIMul' : 132, - 'OpFMul' : 133, - 'OpUDiv' : 134, - 'OpSDiv' : 135, - 'OpFDiv' : 136, - 'OpUMod' : 137, - 'OpSRem' : 138, - 'OpSMod' : 139, - 'OpFRem' : 140, - 'OpFMod' : 141, - 'OpVectorTimesScalar' : 142, - 'OpMatrixTimesScalar' : 143, - 'OpVectorTimesMatrix' : 144, - 'OpMatrixTimesVector' : 145, - 'OpMatrixTimesMatrix' : 146, - 'OpOuterProduct' : 147, - 'OpDot' : 148, - 'OpIAddCarry' : 149, - 'OpISubBorrow' : 150, - 'OpUMulExtended' : 151, - 'OpSMulExtended' : 152, - 'OpAny' : 154, - 'OpAll' : 155, - 'OpIsNan' : 156, - 'OpIsInf' : 157, - 'OpIsFinite' : 158, - 'OpIsNormal' : 159, - 'OpSignBitSet' : 160, - 'OpLessOrGreater' : 161, - 'OpOrdered' : 162, - 'OpUnordered' : 163, - 'OpLogicalEqual' : 164, - 'OpLogicalNotEqual' : 165, - 'OpLogicalOr' : 166, - 'OpLogicalAnd' : 167, - 'OpLogicalNot' : 168, - 'OpSelect' : 169, - 'OpIEqual' : 170, - 'OpINotEqual' : 171, - 'OpUGreaterThan' : 172, - 'OpSGreaterThan' : 173, - 'OpUGreaterThanEqual' : 174, - 'OpSGreaterThanEqual' : 175, - 'OpULessThan' : 176, - 'OpSLessThan' : 177, - 'OpULessThanEqual' : 178, - 'OpSLessThanEqual' : 179, - 'OpFOrdEqual' : 180, - 'OpFUnordEqual' : 181, - 'OpFOrdNotEqual' : 182, - 'OpFUnordNotEqual' : 183, - 'OpFOrdLessThan' : 184, - 'OpFUnordLessThan' : 185, - 'OpFOrdGreaterThan' : 186, - 'OpFUnordGreaterThan' : 187, - 'OpFOrdLessThanEqual' : 188, - 'OpFUnordLessThanEqual' : 189, - 'OpFOrdGreaterThanEqual' : 190, - 'OpFUnordGreaterThanEqual' : 191, - 'OpShiftRightLogical' : 194, - 'OpShiftRightArithmetic' : 195, - 'OpShiftLeftLogical' : 196, - 'OpBitwiseOr' : 197, - 'OpBitwiseXor' : 198, - 'OpBitwiseAnd' : 199, - 'OpNot' : 200, - 'OpBitFieldInsert' : 201, - 'OpBitFieldSExtract' : 202, - 'OpBitFieldUExtract' : 203, - 'OpBitReverse' : 204, - 'OpBitCount' : 205, - 'OpDPdx' : 207, - 'OpDPdy' : 208, - 'OpFwidth' : 209, - 'OpDPdxFine' : 210, - 'OpDPdyFine' : 211, - 'OpFwidthFine' : 212, - 'OpDPdxCoarse' : 213, - 'OpDPdyCoarse' : 214, - 'OpFwidthCoarse' : 215, - 'OpEmitVertex' : 218, - 'OpEndPrimitive' : 219, - 'OpEmitStreamVertex' : 220, - 'OpEndStreamPrimitive' : 221, - 'OpControlBarrier' : 224, - 'OpMemoryBarrier' : 225, - 'OpAtomicLoad' : 227, - 'OpAtomicStore' : 228, - 'OpAtomicExchange' : 229, - 'OpAtomicCompareExchange' : 230, - 'OpAtomicCompareExchangeWeak' : 231, - 'OpAtomicIIncrement' : 232, - 'OpAtomicIDecrement' : 233, - 'OpAtomicIAdd' : 234, - 'OpAtomicISub' : 235, - 'OpAtomicSMin' : 236, - 'OpAtomicUMin' : 237, - 'OpAtomicSMax' : 238, - 'OpAtomicUMax' : 239, - 'OpAtomicAnd' : 240, - 'OpAtomicOr' : 241, - 'OpAtomicXor' : 242, - 'OpPhi' : 245, - 'OpLoopMerge' : 246, - 'OpSelectionMerge' : 247, - 'OpLabel' : 248, - 'OpBranch' : 249, - 'OpBranchConditional' : 250, - 'OpSwitch' : 251, - 'OpKill' : 252, - 'OpReturn' : 253, - 'OpReturnValue' : 254, - 'OpUnreachable' : 255, - 'OpLifetimeStart' : 256, - 'OpLifetimeStop' : 257, - 'OpGroupAsyncCopy' : 259, - 'OpGroupWaitEvents' : 260, - 'OpGroupAll' : 261, - 'OpGroupAny' : 262, - 'OpGroupBroadcast' : 263, - 'OpGroupIAdd' : 264, - 'OpGroupFAdd' : 265, - 'OpGroupFMin' : 266, - 'OpGroupUMin' : 267, - 'OpGroupSMin' : 268, - 'OpGroupFMax' : 269, - 'OpGroupUMax' : 270, - 'OpGroupSMax' : 271, - 'OpReadPipe' : 274, - 'OpWritePipe' : 275, - 'OpReservedReadPipe' : 276, - 'OpReservedWritePipe' : 277, - 'OpReserveReadPipePackets' : 278, - 'OpReserveWritePipePackets' : 279, - 'OpCommitReadPipe' : 280, - 'OpCommitWritePipe' : 281, - 'OpIsValidReserveId' : 282, - 'OpGetNumPipePackets' : 283, - 'OpGetMaxPipePackets' : 284, - 'OpGroupReserveReadPipePackets' : 285, - 'OpGroupReserveWritePipePackets' : 286, - 'OpGroupCommitReadPipe' : 287, - 'OpGroupCommitWritePipe' : 288, - 'OpEnqueueMarker' : 291, - 'OpEnqueueKernel' : 292, - 'OpGetKernelNDrangeSubGroupCount' : 293, - 'OpGetKernelNDrangeMaxSubGroupSize' : 294, - 'OpGetKernelWorkGroupSize' : 295, - 'OpGetKernelPreferredWorkGroupSizeMultiple' : 296, - 'OpRetainEvent' : 297, - 'OpReleaseEvent' : 298, - 'OpCreateUserEvent' : 299, - 'OpIsValidEvent' : 300, - 'OpSetUserEventStatus' : 301, - 'OpCaptureEventProfilingInfo' : 302, - 'OpGetDefaultQueue' : 303, - 'OpBuildNDRange' : 304, - 'OpImageSparseSampleImplicitLod' : 305, - 'OpImageSparseSampleExplicitLod' : 306, - 'OpImageSparseSampleDrefImplicitLod' : 307, - 'OpImageSparseSampleDrefExplicitLod' : 308, - 'OpImageSparseSampleProjImplicitLod' : 309, - 'OpImageSparseSampleProjExplicitLod' : 310, - 'OpImageSparseSampleProjDrefImplicitLod' : 311, - 'OpImageSparseSampleProjDrefExplicitLod' : 312, - 'OpImageSparseFetch' : 313, - 'OpImageSparseGather' : 314, - 'OpImageSparseDrefGather' : 315, - 'OpImageSparseTexelsResident' : 316, - 'OpNoLine' : 317, - 'OpAtomicFlagTestAndSet' : 318, - 'OpAtomicFlagClear' : 319, - 'OpImageSparseRead' : 320, - 'OpDecorateId' : 332, - 'OpSubgroupBallotKHR' : 4421, - 'OpSubgroupFirstInvocationKHR' : 4422, - 'OpSubgroupAllKHR' : 4428, - 'OpSubgroupAnyKHR' : 4429, - 'OpSubgroupAllEqualKHR' : 4430, - 'OpSubgroupReadInvocationKHR' : 4432, - 'OpGroupIAddNonUniformAMD' : 5000, - 'OpGroupFAddNonUniformAMD' : 5001, - 'OpGroupFMinNonUniformAMD' : 5002, - 'OpGroupUMinNonUniformAMD' : 5003, - 'OpGroupSMinNonUniformAMD' : 5004, - 'OpGroupFMaxNonUniformAMD' : 5005, - 'OpGroupUMaxNonUniformAMD' : 5006, - 'OpGroupSMaxNonUniformAMD' : 5007, - 'OpFragmentMaskFetchAMD' : 5011, - 'OpFragmentFetchAMD' : 5012, - 'OpSubgroupShuffleINTEL' : 5571, - 'OpSubgroupShuffleDownINTEL' : 5572, - 'OpSubgroupShuffleUpINTEL' : 5573, - 'OpSubgroupShuffleXorINTEL' : 5574, - 'OpSubgroupBlockReadINTEL' : 5575, - 'OpSubgroupBlockWriteINTEL' : 5576, - 'OpSubgroupImageBlockReadINTEL' : 5577, - 'OpSubgroupImageBlockWriteINTEL' : 5578, - 'OpDecorateStringGOOGLE' : 5632, - 'OpMemberDecorateStringGOOGLE' : 5633, - }, - -} - diff --git a/include/spirv/1.1/GLSL.std.450.h b/include/spirv/1.1/GLSL.std.450.h deleted file mode 100644 index 54cc00e9..00000000 --- a/include/spirv/1.1/GLSL.std.450.h +++ /dev/null @@ -1,131 +0,0 @@ -/* -** Copyright (c) 2014-2016 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a copy -** of this software and/or associated documentation files (the "Materials"), -** to deal in the Materials without restriction, including without limitation -** the rights to use, copy, modify, merge, publish, distribute, sublicense, -** and/or sell copies of the Materials, and to permit persons to whom the -** Materials are furnished to do so, subject to the following conditions: -** -** The above copyright notice and this permission notice shall be included in -** all copies or substantial portions of the Materials. -** -** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -** IN THE MATERIALS. -*/ - -#ifndef GLSLstd450_H -#define GLSLstd450_H - -static const int GLSLstd450Version = 100; -static const int GLSLstd450Revision = 3; - -enum GLSLstd450 { - GLSLstd450Bad = 0, // Don't use - - GLSLstd450Round = 1, - GLSLstd450RoundEven = 2, - GLSLstd450Trunc = 3, - GLSLstd450FAbs = 4, - GLSLstd450SAbs = 5, - GLSLstd450FSign = 6, - GLSLstd450SSign = 7, - GLSLstd450Floor = 8, - GLSLstd450Ceil = 9, - GLSLstd450Fract = 10, - - GLSLstd450Radians = 11, - GLSLstd450Degrees = 12, - GLSLstd450Sin = 13, - GLSLstd450Cos = 14, - GLSLstd450Tan = 15, - GLSLstd450Asin = 16, - GLSLstd450Acos = 17, - GLSLstd450Atan = 18, - GLSLstd450Sinh = 19, - GLSLstd450Cosh = 20, - GLSLstd450Tanh = 21, - GLSLstd450Asinh = 22, - GLSLstd450Acosh = 23, - GLSLstd450Atanh = 24, - GLSLstd450Atan2 = 25, - - GLSLstd450Pow = 26, - GLSLstd450Exp = 27, - GLSLstd450Log = 28, - GLSLstd450Exp2 = 29, - GLSLstd450Log2 = 30, - GLSLstd450Sqrt = 31, - GLSLstd450InverseSqrt = 32, - - GLSLstd450Determinant = 33, - GLSLstd450MatrixInverse = 34, - - GLSLstd450Modf = 35, // second operand needs an OpVariable to write to - GLSLstd450ModfStruct = 36, // no OpVariable operand - GLSLstd450FMin = 37, - GLSLstd450UMin = 38, - GLSLstd450SMin = 39, - GLSLstd450FMax = 40, - GLSLstd450UMax = 41, - GLSLstd450SMax = 42, - GLSLstd450FClamp = 43, - GLSLstd450UClamp = 44, - GLSLstd450SClamp = 45, - GLSLstd450FMix = 46, - GLSLstd450IMix = 47, // Reserved - GLSLstd450Step = 48, - GLSLstd450SmoothStep = 49, - - GLSLstd450Fma = 50, - GLSLstd450Frexp = 51, // second operand needs an OpVariable to write to - GLSLstd450FrexpStruct = 52, // no OpVariable operand - GLSLstd450Ldexp = 53, - - GLSLstd450PackSnorm4x8 = 54, - GLSLstd450PackUnorm4x8 = 55, - GLSLstd450PackSnorm2x16 = 56, - GLSLstd450PackUnorm2x16 = 57, - GLSLstd450PackHalf2x16 = 58, - GLSLstd450PackDouble2x32 = 59, - GLSLstd450UnpackSnorm2x16 = 60, - GLSLstd450UnpackUnorm2x16 = 61, - GLSLstd450UnpackHalf2x16 = 62, - GLSLstd450UnpackSnorm4x8 = 63, - GLSLstd450UnpackUnorm4x8 = 64, - GLSLstd450UnpackDouble2x32 = 65, - - GLSLstd450Length = 66, - GLSLstd450Distance = 67, - GLSLstd450Cross = 68, - GLSLstd450Normalize = 69, - GLSLstd450FaceForward = 70, - GLSLstd450Reflect = 71, - GLSLstd450Refract = 72, - - GLSLstd450FindILsb = 73, - GLSLstd450FindSMsb = 74, - GLSLstd450FindUMsb = 75, - - GLSLstd450InterpolateAtCentroid = 76, - GLSLstd450InterpolateAtSample = 77, - GLSLstd450InterpolateAtOffset = 78, - - GLSLstd450NMin = 79, - GLSLstd450NMax = 80, - GLSLstd450NClamp = 81, - - GLSLstd450Count -}; - -#endif // #ifndef GLSLstd450_H diff --git a/include/spirv/1.1/OpenCL.std.h b/include/spirv/1.1/OpenCL.std.h deleted file mode 100644 index 19a66884..00000000 --- a/include/spirv/1.1/OpenCL.std.h +++ /dev/null @@ -1,210 +0,0 @@ -/* -** Copyright (c) 2015-2017 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a copy -** of this software and/or associated documentation files (the "Materials"), -** to deal in the Materials without restriction, including without limitation -** the rights to use, copy, modify, merge, publish, distribute, sublicense, -** and/or sell copies of the Materials, and to permit persons to whom the -** Materials are furnished to do so, subject to the following conditions: -** -** The above copyright notice and this permission notice shall be included in -** all copies or substantial portions of the Materials. -** -** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -** IN THE MATERIALS. -*/ - -namespace OpenCLLIB { - -enum Entrypoints { - - // Section 2.1: Math extended instructions - Acos = 0, - Acosh = 1, - Acospi = 2, - Asin = 3, - Asinh = 4, - Asinpi = 5, - Atan = 6, - Atan2 = 7, - Atanh = 8, - Atanpi = 9, - Atan2pi = 10, - Cbrt = 11, - Ceil = 12, - Copysign = 13, - Cos = 14, - Cosh = 15, - Cospi = 16, - Erfc = 17, - Erf = 18, - Exp = 19, - Exp2 = 20, - Exp10 = 21, - Expm1 = 22, - Fabs = 23, - Fdim = 24, - Floor = 25, - Fma = 26, - Fmax = 27, - Fmin = 28, - Fmod = 29, - Fract = 30, - Frexp = 31, - Hypot = 32, - Ilogb = 33, - Ldexp = 34, - Lgamma = 35, - Lgamma_r = 36, - Log = 37, - Log2 = 38, - Log10 = 39, - Log1p = 40, - Logb = 41, - Mad = 42, - Maxmag = 43, - Minmag = 44, - Modf = 45, - Nan = 46, - Nextafter = 47, - Pow = 48, - Pown = 49, - Powr = 50, - Remainder = 51, - Remquo = 52, - Rint = 53, - Rootn = 54, - Round = 55, - Rsqrt = 56, - Sin = 57, - Sincos = 58, - Sinh = 59, - Sinpi = 60, - Sqrt = 61, - Tan = 62, - Tanh = 63, - Tanpi = 64, - Tgamma = 65, - Trunc = 66, - Half_cos = 67, - Half_divide = 68, - Half_exp = 69, - Half_exp2 = 70, - Half_exp10 = 71, - Half_log = 72, - Half_log2 = 73, - Half_log10 = 74, - Half_powr = 75, - Half_recip = 76, - Half_rsqrt = 77, - Half_sin = 78, - Half_sqrt = 79, - Half_tan = 80, - Native_cos = 81, - Native_divide = 82, - Native_exp = 83, - Native_exp2 = 84, - Native_exp10 = 85, - Native_log = 86, - Native_log2 = 87, - Native_log10 = 88, - Native_powr = 89, - Native_recip = 90, - Native_rsqrt = 91, - Native_sin = 92, - Native_sqrt = 93, - Native_tan = 94, - - // Section 2.2: Integer instructions - SAbs = 141, - SAbs_diff = 142, - SAdd_sat = 143, - UAdd_sat = 144, - SHadd = 145, - UHadd = 146, - SRhadd = 147, - URhadd = 148, - SClamp = 149, - UClamp = 150, - Clz = 151, - Ctz = 152, - SMad_hi = 153, - UMad_sat = 154, - SMad_sat = 155, - SMax = 156, - UMax = 157, - SMin = 158, - UMin = 159, - SMul_hi = 160, - Rotate = 161, - SSub_sat = 162, - USub_sat = 163, - U_Upsample = 164, - S_Upsample = 165, - Popcount = 166, - SMad24 = 167, - UMad24 = 168, - SMul24 = 169, - UMul24 = 170, - UAbs = 201, - UAbs_diff = 202, - UMul_hi = 203, - UMad_hi = 204, - - // Section 2.3: Common instructions - FClamp = 95, - Degrees = 96, - FMax_common = 97, - FMin_common = 98, - Mix = 99, - Radians = 100, - Step = 101, - Smoothstep = 102, - Sign = 103, - - // Section 2.4: Geometric instructions - Cross = 104, - Distance = 105, - Length = 106, - Normalize = 107, - Fast_distance = 108, - Fast_length = 109, - Fast_normalize = 110, - - // Section 2.5: Relational instructions - Bitselect = 186, - Select = 187, - - // Section 2.6: Vector Data Load and Store instructions - Vloadn = 171, - Vstoren = 172, - Vload_half = 173, - Vload_halfn = 174, - Vstore_half = 175, - Vstore_half_r = 176, - Vstore_halfn = 177, - Vstore_halfn_r = 178, - Vloada_halfn = 179, - Vstorea_halfn = 180, - Vstorea_halfn_r = 181, - - // Section 2.7: Miscellaneous Vector instructions - Shuffle = 182, - Shuffle2 = 183, - - // Section 2.8: Misc instructions - Printf = 184, - Prefetch = 185, -}; - -} // end namespace OpenCLLIB diff --git a/include/spirv/1.1/extinst.glsl.std.450.grammar.json b/include/spirv/1.1/extinst.glsl.std.450.grammar.json deleted file mode 100644 index 3d9f39e7..00000000 --- a/include/spirv/1.1/extinst.glsl.std.450.grammar.json +++ /dev/null @@ -1,642 +0,0 @@ -{ - "copyright" : [ - "Copyright (c) 2014-2016 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - "version" : 100, - "revision" : 2, - "instructions" : [ - { - "opname" : "Round", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "RoundEven", - "opcode" : 2, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Trunc", - "opcode" : 3, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FAbs", - "opcode" : 4, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "SAbs", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FSign", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "SSign", - "opcode" : 7, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Floor", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Ceil", - "opcode" : 9, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Fract", - "opcode" : 10, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Radians", - "opcode" : 11, - "operands" : [ - { "kind" : "IdRef", "name" : "'degrees'" } - ] - }, - { - "opname" : "Degrees", - "opcode" : 12, - "operands" : [ - { "kind" : "IdRef", "name" : "'radians'" } - ] - }, - { - "opname" : "Sin", - "opcode" : 13, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Cos", - "opcode" : 14, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Tan", - "opcode" : 15, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Asin", - "opcode" : 16, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Acos", - "opcode" : 17, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Atan", - "opcode" : 18, - "operands" : [ - { "kind" : "IdRef", "name" : "'y_over_x'" } - ] - }, - { - "opname" : "Sinh", - "opcode" : 19, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Cosh", - "opcode" : 20, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Tanh", - "opcode" : 21, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Asinh", - "opcode" : 22, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Acosh", - "opcode" : 23, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Atanh", - "opcode" : 24, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Atan2", - "opcode" : 25, - "operands" : [ - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Pow", - "opcode" : 26, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "Exp", - "opcode" : 27, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Log", - "opcode" : 28, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Exp2", - "opcode" : 29, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Log2", - "opcode" : 30, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Sqrt", - "opcode" : 31, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "InverseSqrt", - "opcode" : 32, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Determinant", - "opcode" : 33, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "MatrixInverse", - "opcode" : 34, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Modf", - "opcode" : 35, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'i'" } - ] - }, - { - "opname" : "ModfStruct", - "opcode" : 36, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FMin", - "opcode" : 37, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "UMin", - "opcode" : 38, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "SMin", - "opcode" : 39, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "FMax", - "opcode" : 40, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "UMax", - "opcode" : 41, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "SMax", - "opcode" : 42, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "FClamp", - "opcode" : 43, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - }, - { - "opname" : "UClamp", - "opcode" : 44, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - }, - { - "opname" : "SClamp", - "opcode" : 45, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - }, - { - "opname" : "FMix", - "opcode" : 46, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'a'" } - ] - }, - { - "opname" : "IMix", - "opcode" : 47, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'a'" } - ] - }, - { - "opname" : "Step", - "opcode" : 48, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "SmoothStep", - "opcode" : 49, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge0'" }, - { "kind" : "IdRef", "name" : "'edge1'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Fma", - "opcode" : 50, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "Frexp", - "opcode" : 51, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'exp'" } - ] - }, - { - "opname" : "FrexpStruct", - "opcode" : 52, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Ldexp", - "opcode" : 53, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'exp'" } - ] - }, - { - "opname" : "PackSnorm4x8", - "opcode" : 54, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackUnorm4x8", - "opcode" : 55, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackSnorm2x16", - "opcode" : 56, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackUnorm2x16", - "opcode" : 57, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackHalf2x16", - "opcode" : 58, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackDouble2x32", - "opcode" : 59, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ], - "capabilities" : [ "Float64" ] - }, - { - "opname" : "UnpackSnorm2x16", - "opcode" : 60, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackUnorm2x16", - "opcode" : 61, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackHalf2x16", - "opcode" : 62, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "UnpackSnorm4x8", - "opcode" : 63, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackUnorm4x8", - "opcode" : 64, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackDouble2x32", - "opcode" : 65, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ], - "capabilities" : [ "Float64" ] - }, - { - "opname" : "Length", - "opcode" : 66, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Distance", - "opcode" : 67, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "Cross", - "opcode" : 68, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "Normalize", - "opcode" : 69, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FaceForward", - "opcode" : 70, - "operands" : [ - { "kind" : "IdRef", "name" : "'N'" }, - { "kind" : "IdRef", "name" : "'I'" }, - { "kind" : "IdRef", "name" : "'Nref'" } - ] - }, - { - "opname" : "Reflect", - "opcode" : 71, - "operands" : [ - { "kind" : "IdRef", "name" : "'I'" }, - { "kind" : "IdRef", "name" : "'N'" } - ] - }, - { - "opname" : "Refract", - "opcode" : 72, - "operands" : [ - { "kind" : "IdRef", "name" : "'I'" }, - { "kind" : "IdRef", "name" : "'N'" }, - { "kind" : "IdRef", "name" : "'eta'" } - ] - }, - { - "opname" : "FindILsb", - "opcode" : 73, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "FindSMsb", - "opcode" : 74, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "FindUMsb", - "opcode" : 75, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "InterpolateAtCentroid", - "opcode" : 76, - "operands" : [ - { "kind" : "IdRef", "name" : "'interpolant'" } - ], - "capabilities" : [ "InterpolationFunction" ] - }, - { - "opname" : "InterpolateAtSample", - "opcode" : 77, - "operands" : [ - { "kind" : "IdRef", "name" : "'interpolant'" }, - { "kind" : "IdRef", "name" : "'sample'" } - ], - "capabilities" : [ "InterpolationFunction" ] - }, - { - "opname" : "InterpolateAtOffset", - "opcode" : 78, - "operands" : [ - { "kind" : "IdRef", "name" : "'interpolant'" }, - { "kind" : "IdRef", "name" : "'offset'" } - ], - "capabilities" : [ "InterpolationFunction" ] - }, - { - "opname" : "NMin", - "opcode" : 79, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "NMax", - "opcode" : 80, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "NClamp", - "opcode" : 81, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - } - ] -} diff --git a/include/spirv/1.1/extinst.opencl.std.100.grammar.json b/include/spirv/1.1/extinst.opencl.std.100.grammar.json deleted file mode 100644 index 4fe45060..00000000 --- a/include/spirv/1.1/extinst.opencl.std.100.grammar.json +++ /dev/null @@ -1,1279 +0,0 @@ -{ - "copyright" : [ - "Copyright (c) 2014-2016 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - "version" : 100, - "revision" : 2, - "instructions" : [ - { - "opname" : "acos", - "opcode" : 0, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "acosh", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "acospi", - "opcode" : 2, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "asin", - "opcode" : 3, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "asinh", - "opcode" : 4, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "asinpi", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atan", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atan2", - "opcode" : 7, - "operands" : [ - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atanh", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atanpi", - "opcode" : 9, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atan2pi", - "opcode" : 10, - "operands" : [ - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cbrt", - "opcode" : 11, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "ceil", - "opcode" : 12, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "copysign", - "opcode" : 13, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "cos", - "opcode" : 14, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cosh", - "opcode" : 15, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cospi", - "opcode" : 16, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "erfc", - "opcode" : 17, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "erf", - "opcode" : 18, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "exp", - "opcode" : 19, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "exp2", - "opcode" : 20, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "exp10", - "opcode" : 21, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "expm1", - "opcode" : 22, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "fabs", - "opcode" : 23, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "fdim", - "opcode" : 24, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "floor", - "opcode" : 25, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "fma", - "opcode" : 26, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "fmax", - "opcode" : 27, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fmin", - "opcode" : 28, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fmod", - "opcode" : 29, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fract", - "opcode" : 30, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'ptr'" } - ] - }, - { - "opname" : "frexp", - "opcode" : 31, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'exp'" } - ] - }, - { - "opname" : "hypot", - "opcode" : 32, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "ilogb", - "opcode" : 33, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "ldexp", - "opcode" : 34, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'k'" } - ] - }, - { - "opname" : "lgamma", - "opcode" : 35, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "lgamma_r", - "opcode" : 36, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'signp'" } - ] - }, - { - "opname" : "log", - "opcode" : 37, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "log2", - "opcode" : 38, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "log10", - "opcode" : 39, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "log1p", - "opcode" : 40, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "logb", - "opcode" : 41, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "mad", - "opcode" : 42, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "maxmag", - "opcode" : 43, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "minmag", - "opcode" : 44, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "modf", - "opcode" : 45, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'iptr'" } - ] - }, - { - "opname" : "nan", - "opcode" : 46, - "operands" : [ - { "kind" : "IdRef", "name" : "'nancode'" } - ] - }, - { - "opname" : "nextafter", - "opcode" : 47, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "pow", - "opcode" : 48, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y" } - ] - }, - { - "opname" : "pown", - "opcode" : 49, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "powr", - "opcode" : 50, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "remainder", - "opcode" : 51, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "remquo", - "opcode" : 52, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'quo'" } - ] - }, - { - "opname" : "rint", - "opcode" : 53, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "rootn", - "opcode" : 54, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "round", - "opcode" : 55, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "rsqrt", - "opcode" : 56, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sin", - "opcode" : 57, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sincos", - "opcode" : 58, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'cosval'" } - ] - }, - { - "opname" : "sinh", - "opcode" : 59, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sinpi", - "opcode" : 60, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sqrt", - "opcode" : 61, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tan", - "opcode" : 62, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tanh", - "opcode" : 63, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tanpi", - "opcode" : 64, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tgamma", - "opcode" : 65, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "trunc", - "opcode" : 66, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_cos", - "opcode" : 67, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_divide", - "opcode" : 68, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "half_exp", - "opcode" : 69, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_exp2", - "opcode" : 70, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_exp10", - "opcode" : 71, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_log", - "opcode" : 72, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_log2", - "opcode" : 73, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_log10", - "opcode" : 74, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_powr", - "opcode" : 75, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "half_recip", - "opcode" : 76, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_rsqrt", - "opcode" : 77, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_sin", - "opcode" : 78, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_sqrt", - "opcode" : 79, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_tan", - "opcode" : 80, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_cos", - "opcode" : 81, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_divide", - "opcode" : 82, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "native_exp", - "opcode" : 83, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_exp2", - "opcode" : 84, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_exp10", - "opcode" : 85, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_log", - "opcode" : 86, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_log2", - "opcode" : 87, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_log10", - "opcode" : 88, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_powr", - "opcode" : 89, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "native_recip", - "opcode" : 90, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_rsqrt", - "opcode" : 91, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_sin", - "opcode" : 92, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_sqrt", - "opcode" : 93, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_tan", - "opcode" : 94, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_abs", - "opcode" : 141, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_abs_diff", - "opcode" : 142, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_add_sat", - "opcode" : 143, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_add_sat", - "opcode" : 144, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_hadd", - "opcode" : 145, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_hadd", - "opcode" : 146, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_rhadd", - "opcode" : 147, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_rhadd", - "opcode" : 148, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_clamp", - "opcode" : 149, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minval'" }, - { "kind" : "IdRef", "name" : "'maxval'" } - ] - }, - { - "opname" : "u_clamp", - "opcode" : 150, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minval'" }, - { "kind" : "IdRef", "name" : "'maxval'" } - ] - }, - { - "opname" : "clz", - "opcode" : 151, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "ctz", - "opcode" : 152, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_mad_hi", - "opcode" : 153, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "u_mad_sat", - "opcode" : 154, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "s_mad_sat", - "opcode" : 155, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "s_max", - "opcode" : 156, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_max", - "opcode" : 157, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_min", - "opcode" : 158, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_min", - "opcode" : 159, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_mul_hi", - "opcode" : 160, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "rotate", - "opcode" : 161, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" }, - { "kind" : "IdRef", "name" : "'i'" } - ] - }, - { - "opname" : "s_sub_sat", - "opcode" : 162, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_sub_sat", - "opcode" : 163, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_upsample", - "opcode" : 164, - "operands" : [ - { "kind" : "IdRef", "name" : "'hi'" }, - { "kind" : "IdRef", "name" : "'lo'" } - ] - }, - { - "opname" : "s_upsample", - "opcode" : 165, - "operands" : [ - { "kind" : "IdRef", "name" : "'hi'" }, - { "kind" : "IdRef", "name" : "'lo'" } - ] - }, - { - "opname" : "popcount", - "opcode" : 166, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_mad24", - "opcode" : 167, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "u_mad24", - "opcode" : 168, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "s_mul24", - "opcode" : 169, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_mul24", - "opcode" : 170, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_abs", - "opcode" : 201, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "u_abs_diff", - "opcode" : 202, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_mul_hi", - "opcode" : 203, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_mad_hi", - "opcode" : 204, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "fclamp", - "opcode" : 95, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minval'" }, - { "kind" : "IdRef", "name" : "'maxval'" } - ] - }, - { - "opname" : "degrees", - "opcode" :96, - "operands" : [ - { "kind" : "IdRef", "name" : "'radians'" } - ] - }, - { - "opname" : "fmax_common", - "opcode" : 97, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fmin_common", - "opcode" : 98, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "mix", - "opcode" : 99, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'a'" } - ] - }, - { - "opname" : "radians", - "opcode" : 100, - "operands" : [ - { "kind" : "IdRef", "name" : "'degrees'" } - ] - }, - { - "opname" : "step", - "opcode" : 101, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "smoothstep", - "opcode" : 102, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge0'" }, - { "kind" : "IdRef", "name" : "'edge1'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sign", - "opcode" : 103, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cross", - "opcode" : 104, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "distance", - "opcode" : 105, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "length", - "opcode" : 106, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "normalize", - "opcode" : 107, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "fast_distance", - "opcode" : 108, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "fast_length", - "opcode" : 109, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "fast_normalize", - "opcode" : 110, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "bitselect", - "opcode" : 186, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "select", - "opcode" : 187, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "vloadn", - "opcode" : 171, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "LiteralInteger", "name" : "'n'" } - ] - }, - { - "opname" : "vstoren", - "opcode" : 172, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vload_half", - "opcode" : 173, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vload_halfn", - "opcode" : 174, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "LiteralInteger", "name" : "'n'" } - ] - }, - { - "opname" : "vstore_half", - "opcode" : 175, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vstore_half_r", - "opcode" : 176, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "FPRoundingMode", "name" : "'mode'" } - ] - }, - { - "opname" : "vstore_halfn", - "opcode" : 177, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vstore_halfn_r", - "opcode" : 178, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "FPRoundingMode", "name" : "'mode'" } - ] - }, - { - "opname" : "vloada_halfn", - "opcode" : 179, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "LiteralInteger", "name" : "'n'" } - ] - }, - { - "opname" : "vstorea_halfn", - "opcode" : 180, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vstorea_halfn_r", - "opcode" : 181, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "FPRoundingMode", "name" : "'mode'" } - ] - }, - { - "opname" : "shuffle", - "opcode" : 182, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'shuffle mask'" } - ] - }, - { - "opname" : "shuffle2", - "opcode" : 183, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'shuffle mask'" } - ] - }, - { - "opname" : "printf", - "opcode" : 184, - "operands" : [ - { "kind" : "IdRef", "name" : "'format'" }, - { "kind" : "IdRef", "name" : "'additional arguments'", "quantifier" : "*" } - ] - }, - { - "opname" : "prefetch", - "opcode" : 185, - "operands" : [ - { "kind" : "IdRef", "name" : "'ptr'" }, - { "kind" : "IdRef", "name" : "'num elements'" } - ] - } - ] -} diff --git a/include/spirv/1.1/spirv.core.grammar.json b/include/spirv/1.1/spirv.core.grammar.json deleted file mode 100644 index c142e60a..00000000 --- a/include/spirv/1.1/spirv.core.grammar.json +++ /dev/null @@ -1,5938 +0,0 @@ -{ - "copyright" : [ - "Copyright (c) 2014-2016 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - "magic_number" : "0x07230203", - "major_version" : 1, - "minor_version" : 1, - "revision" : 8, - "instructions" : [ - { - "opname" : "OpNop", - "opcode" : 0 - }, - { - "opname" : "OpUndef", - "opcode" : 1, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSourceContinued", - "opcode" : 2, - "operands" : [ - { "kind" : "LiteralString", "name" : "'Continued Source'" } - ] - }, - { - "opname" : "OpSource", - "opcode" : 3, - "operands" : [ - { "kind" : "SourceLanguage" }, - { "kind" : "LiteralInteger", "name" : "'Version'" }, - { "kind" : "IdRef", "quantifier" : "?", "name" : "'File'" }, - { "kind" : "LiteralString", "quantifier" : "?", "name" : "'Source'" } - ] - }, - { - "opname" : "OpSourceExtension", - "opcode" : 4, - "operands" : [ - { "kind" : "LiteralString", "name" : "'Extension'" } - ] - }, - { - "opname" : "OpName", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpMemberName", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "LiteralInteger", "name" : "'Member'" }, - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpString", - "opcode" : 7, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralString", "name" : "'String'" } - ] - }, - { - "opname" : "OpLine", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "'File'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" } - ] - }, - { - "opname" : "OpExtension", - "opcode" : 10, - "operands" : [ - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpExtInstImport", - "opcode" : 11, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpExtInst", - "opcode" : 12, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Set'" }, - { "kind" : "LiteralExtInstInteger", "name" : "'Instruction'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Operand 1', +\n'Operand 2', +\n..." } - ] - }, - { - "opname" : "OpMemoryModel", - "opcode" : 14, - "operands" : [ - { "kind" : "AddressingModel" }, - { "kind" : "MemoryModel" } - ] - }, - { - "opname" : "OpEntryPoint", - "opcode" : 15, - "operands" : [ - { "kind" : "ExecutionModel" }, - { "kind" : "IdRef", "name" : "'Entry Point'" }, - { "kind" : "LiteralString", "name" : "'Name'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Interface'" } - ] - }, - { - "opname" : "OpExecutionMode", - "opcode" : 16, - "operands" : [ - { "kind" : "IdRef", "name" : "'Entry Point'" }, - { "kind" : "ExecutionMode", "name" : "'Mode'" } - ] - }, - { - "opname" : "OpCapability", - "opcode" : 17, - "operands" : [ - { "kind" : "Capability", "name" : "'Capability'" } - ] - }, - { - "opname" : "OpTypeVoid", - "opcode" : 19, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpTypeBool", - "opcode" : 20, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpTypeInt", - "opcode" : 21, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralInteger", "name" : "'Width'" }, - { "kind" : "LiteralInteger", "name" : "'Signedness'" } - ] - }, - { - "opname" : "OpTypeFloat", - "opcode" : 22, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralInteger", "name" : "'Width'" } - ] - }, - { - "opname" : "OpTypeVector", - "opcode" : 23, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Component Type'" }, - { "kind" : "LiteralInteger", "name" : "'Component Count'" } - ] - }, - { - "opname" : "OpTypeMatrix", - "opcode" : 24, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Column Type'" }, - { "kind" : "LiteralInteger", "name" : "'Column Count'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpTypeImage", - "opcode" : 25, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Type'" }, - { "kind" : "Dim" }, - { "kind" : "LiteralInteger", "name" : "'Depth'" }, - { "kind" : "LiteralInteger", "name" : "'Arrayed'" }, - { "kind" : "LiteralInteger", "name" : "'MS'" }, - { "kind" : "LiteralInteger", "name" : "'Sampled'" }, - { "kind" : "ImageFormat" }, - { "kind" : "AccessQualifier", "quantifier" : "?" } - ] - }, - { - "opname" : "OpTypeSampler", - "opcode" : 26, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpTypeSampledImage", - "opcode" : 27, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image Type'" } - ] - }, - { - "opname" : "OpTypeArray", - "opcode" : 28, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Element Type'" }, - { "kind" : "IdRef", "name" : "'Length'" } - ] - }, - { - "opname" : "OpTypeRuntimeArray", - "opcode" : 29, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Element Type'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpTypeStruct", - "opcode" : 30, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Member 0 type', +\n'member 1 type', +\n..." } - ] - }, - { - "opname" : "OpTypeOpaque", - "opcode" : 31, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralString", "name" : "The name of the opaque type." } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpTypePointer", - "opcode" : 32, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "StorageClass" }, - { "kind" : "IdRef", "name" : "'Type'" } - ] - }, - { - "opname" : "OpTypeFunction", - "opcode" : 33, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Return Type'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Parameter 0 Type', +\n'Parameter 1 Type', +\n..." } - ] - }, - { - "opname" : "OpTypeEvent", - "opcode" : 34, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpTypeDeviceEvent", - "opcode" : 35, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpTypeReserveId", - "opcode" : 36, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpTypeQueue", - "opcode" : 37, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpTypePipe", - "opcode" : 38, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "AccessQualifier", "name" : "'Qualifier'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpTypeForwardPointer", - "opcode" : 39, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer Type'" }, - { "kind" : "StorageClass" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpConstantTrue", - "opcode" : 41, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpConstantFalse", - "opcode" : 42, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpConstant", - "opcode" : 43, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralContextDependentNumber", "name" : "'Value'" } - ] - }, - { - "opname" : "OpConstantComposite", - "opcode" : 44, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } - ] - }, - { - "opname" : "OpConstantSampler", - "opcode" : 45, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "SamplerAddressingMode" }, - { "kind" : "LiteralInteger", "name" : "'Param'" }, - { "kind" : "SamplerFilterMode" } - ], - "capabilities" : [ "LiteralSampler" ] - }, - { - "opname" : "OpConstantNull", - "opcode" : 46, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSpecConstantTrue", - "opcode" : 48, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSpecConstantFalse", - "opcode" : 49, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSpecConstant", - "opcode" : 50, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralContextDependentNumber", "name" : "'Value'" } - ] - }, - { - "opname" : "OpSpecConstantComposite", - "opcode" : 51, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } - ] - }, - { - "opname" : "OpSpecConstantOp", - "opcode" : 52, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralSpecConstantOpInteger", "name" : "'Opcode'" } - ] - }, - { - "opname" : "OpFunction", - "opcode" : 54, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "FunctionControl" }, - { "kind" : "IdRef", "name" : "'Function Type'" } - ] - }, - { - "opname" : "OpFunctionParameter", - "opcode" : 55, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpFunctionEnd", - "opcode" : 56 - }, - { - "opname" : "OpFunctionCall", - "opcode" : 57, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Function'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Argument 0', +\n'Argument 1', +\n..." } - ] - }, - { - "opname" : "OpVariable", - "opcode" : 59, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "StorageClass" }, - { "kind" : "IdRef", "quantifier" : "?", "name" : "'Initializer'" } - ] - }, - { - "opname" : "OpImageTexelPointer", - "opcode" : 60, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Sample'" } - ] - }, - { - "opname" : "OpLoad", - "opcode" : 61, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ] - }, - { - "opname" : "OpStore", - "opcode" : 62, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Object'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ] - }, - { - "opname" : "OpCopyMemory", - "opcode" : 63, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ] - }, - { - "opname" : "OpCopyMemorySized", - "opcode" : 64, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpAccessChain", - "opcode" : 65, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpInBoundsAccessChain", - "opcode" : 66, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpPtrAccessChain", - "opcode" : 67, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Element'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ], - "capabilities" : [ - "Addresses", - "VariablePointers", - "VariablePointersStorageBuffer" - ] - }, - { - "opname" : "OpArrayLength", - "opcode" : 68, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Structure'" }, - { "kind" : "LiteralInteger", "name" : "'Array member'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpGenericPtrMemSemantics", - "opcode" : 69, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpInBoundsPtrAccessChain", - "opcode" : 70, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Element'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpDecorate", - "opcode" : 71, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "Decoration" } - ] - }, - { - "opname" : "OpMemberDecorate", - "opcode" : 72, - "operands" : [ - { "kind" : "IdRef", "name" : "'Structure Type'" }, - { "kind" : "LiteralInteger", "name" : "'Member'" }, - { "kind" : "Decoration" } - ] - }, - { - "opname" : "OpDecorationGroup", - "opcode" : 73, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpGroupDecorate", - "opcode" : 74, - "operands" : [ - { "kind" : "IdRef", "name" : "'Decoration Group'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Targets'" } - ] - }, - { - "opname" : "OpGroupMemberDecorate", - "opcode" : 75, - "operands" : [ - { "kind" : "IdRef", "name" : "'Decoration Group'" }, - { "kind" : "PairIdRefLiteralInteger", "quantifier" : "*", "name" : "'Targets'" } - ] - }, - { - "opname" : "OpVectorExtractDynamic", - "opcode" : 77, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Index'" } - ] - }, - { - "opname" : "OpVectorInsertDynamic", - "opcode" : 78, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Component'" }, - { "kind" : "IdRef", "name" : "'Index'" } - ] - }, - { - "opname" : "OpVectorShuffle", - "opcode" : 79, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Components'" } - ] - }, - { - "opname" : "OpCompositeConstruct", - "opcode" : 80, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } - ] - }, - { - "opname" : "OpCompositeExtract", - "opcode" : 81, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Composite'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpCompositeInsert", - "opcode" : 82, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Object'" }, - { "kind" : "IdRef", "name" : "'Composite'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpCopyObject", - "opcode" : 83, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpTranspose", - "opcode" : 84, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Matrix'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpSampledImage", - "opcode" : 86, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Sampler'" } - ] - }, - { - "opname" : "OpImageSampleImplicitLod", - "opcode" : 87, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleExplicitLod", - "opcode" : 88, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ] - }, - { - "opname" : "OpImageSampleDrefImplicitLod", - "opcode" : 89, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleDrefExplicitLod", - "opcode" : 90, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjImplicitLod", - "opcode" : 91, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjExplicitLod", - "opcode" : 92, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjDrefImplicitLod", - "opcode" : 93, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjDrefExplicitLod", - "opcode" : 94, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageFetch", - "opcode" : 95, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ] - }, - { - "opname" : "OpImageGather", - "opcode" : 96, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Component'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageDrefGather", - "opcode" : 97, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageRead", - "opcode" : 98, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ] - }, - { - "opname" : "OpImageWrite", - "opcode" : 99, - "operands" : [ - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Texel'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ] - }, - { - "opname" : "OpImage", - "opcode" : 100, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" } - ] - }, - { - "opname" : "OpImageQueryFormat", - "opcode" : 101, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpImageQueryOrder", - "opcode" : 102, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpImageQuerySizeLod", - "opcode" : 103, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Level of Detail'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpImageQuerySize", - "opcode" : 104, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpImageQueryLod", - "opcode" : 105, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" } - ], - "capabilities" : [ "ImageQuery" ] - }, - { - "opname" : "OpImageQueryLevels", - "opcode" : 106, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpImageQuerySamples", - "opcode" : 107, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpConvertFToU", - "opcode" : 109, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Float Value'" } - ] - }, - { - "opname" : "OpConvertFToS", - "opcode" : 110, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Float Value'" } - ] - }, - { - "opname" : "OpConvertSToF", - "opcode" : 111, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Signed Value'" } - ] - }, - { - "opname" : "OpConvertUToF", - "opcode" : 112, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Unsigned Value'" } - ] - }, - { - "opname" : "OpUConvert", - "opcode" : 113, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Unsigned Value'" } - ] - }, - { - "opname" : "OpSConvert", - "opcode" : 114, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Signed Value'" } - ] - }, - { - "opname" : "OpFConvert", - "opcode" : 115, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Float Value'" } - ] - }, - { - "opname" : "OpQuantizeToF16", - "opcode" : 116, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpConvertPtrToU", - "opcode" : 117, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpSatConvertSToU", - "opcode" : 118, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Signed Value'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpSatConvertUToS", - "opcode" : 119, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Unsigned Value'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpConvertUToPtr", - "opcode" : 120, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Integer Value'" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpPtrCastToGeneric", - "opcode" : 121, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGenericCastToPtr", - "opcode" : 122, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGenericCastToPtrExplicit", - "opcode" : 123, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "StorageClass", "name" : "'Storage'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpBitcast", - "opcode" : 124, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpSNegate", - "opcode" : 126, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpFNegate", - "opcode" : 127, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpIAdd", - "opcode" : 128, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFAdd", - "opcode" : 129, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpISub", - "opcode" : 130, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFSub", - "opcode" : 131, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpIMul", - "opcode" : 132, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFMul", - "opcode" : 133, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUDiv", - "opcode" : 134, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSDiv", - "opcode" : 135, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFDiv", - "opcode" : 136, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUMod", - "opcode" : 137, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSRem", - "opcode" : 138, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSMod", - "opcode" : 139, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFRem", - "opcode" : 140, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFMod", - "opcode" : 141, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpVectorTimesScalar", - "opcode" : 142, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Scalar'" } - ] - }, - { - "opname" : "OpMatrixTimesScalar", - "opcode" : 143, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Matrix'" }, - { "kind" : "IdRef", "name" : "'Scalar'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpVectorTimesMatrix", - "opcode" : 144, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Matrix'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpMatrixTimesVector", - "opcode" : 145, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Matrix'" }, - { "kind" : "IdRef", "name" : "'Vector'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpMatrixTimesMatrix", - "opcode" : 146, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'LeftMatrix'" }, - { "kind" : "IdRef", "name" : "'RightMatrix'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpOuterProduct", - "opcode" : 147, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpDot", - "opcode" : 148, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" } - ] - }, - { - "opname" : "OpIAddCarry", - "opcode" : 149, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpISubBorrow", - "opcode" : 150, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUMulExtended", - "opcode" : 151, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSMulExtended", - "opcode" : 152, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpAny", - "opcode" : 154, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" } - ] - }, - { - "opname" : "OpAll", - "opcode" : 155, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" } - ] - }, - { - "opname" : "OpIsNan", - "opcode" : 156, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "OpIsInf", - "opcode" : 157, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "OpIsFinite", - "opcode" : 158, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpIsNormal", - "opcode" : 159, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpSignBitSet", - "opcode" : 160, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpLessOrGreater", - "opcode" : 161, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpOrdered", - "opcode" : 162, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpUnordered", - "opcode" : 163, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpLogicalEqual", - "opcode" : 164, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalNotEqual", - "opcode" : 165, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalOr", - "opcode" : 166, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalAnd", - "opcode" : 167, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalNot", - "opcode" : 168, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpSelect", - "opcode" : 169, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Condition'" }, - { "kind" : "IdRef", "name" : "'Object 1'" }, - { "kind" : "IdRef", "name" : "'Object 2'" } - ] - }, - { - "opname" : "OpIEqual", - "opcode" : 170, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpINotEqual", - "opcode" : 171, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUGreaterThan", - "opcode" : 172, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSGreaterThan", - "opcode" : 173, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUGreaterThanEqual", - "opcode" : 174, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSGreaterThanEqual", - "opcode" : 175, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpULessThan", - "opcode" : 176, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSLessThan", - "opcode" : 177, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpULessThanEqual", - "opcode" : 178, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSLessThanEqual", - "opcode" : 179, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdEqual", - "opcode" : 180, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordEqual", - "opcode" : 181, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdNotEqual", - "opcode" : 182, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordNotEqual", - "opcode" : 183, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdLessThan", - "opcode" : 184, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordLessThan", - "opcode" : 185, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdGreaterThan", - "opcode" : 186, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordGreaterThan", - "opcode" : 187, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdLessThanEqual", - "opcode" : 188, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordLessThanEqual", - "opcode" : 189, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdGreaterThanEqual", - "opcode" : 190, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordGreaterThanEqual", - "opcode" : 191, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpShiftRightLogical", - "opcode" : 194, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Shift'" } - ] - }, - { - "opname" : "OpShiftRightArithmetic", - "opcode" : 195, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Shift'" } - ] - }, - { - "opname" : "OpShiftLeftLogical", - "opcode" : 196, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Shift'" } - ] - }, - { - "opname" : "OpBitwiseOr", - "opcode" : 197, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpBitwiseXor", - "opcode" : 198, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpBitwiseAnd", - "opcode" : 199, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpNot", - "opcode" : 200, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpBitFieldInsert", - "opcode" : 201, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Insert'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Count'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpBitFieldSExtract", - "opcode" : 202, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Count'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpBitFieldUExtract", - "opcode" : 203, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Count'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpBitReverse", - "opcode" : 204, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpBitCount", - "opcode" : 205, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" } - ] - }, - { - "opname" : "OpDPdx", - "opcode" : 207, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpDPdy", - "opcode" : 208, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpFwidth", - "opcode" : 209, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpDPdxFine", - "opcode" : 210, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpDPdyFine", - "opcode" : 211, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpFwidthFine", - "opcode" : 212, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpDPdxCoarse", - "opcode" : 213, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpDPdyCoarse", - "opcode" : 214, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpFwidthCoarse", - "opcode" : 215, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpEmitVertex", - "opcode" : 218, - "capabilities" : [ "Geometry" ] - }, - { - "opname" : "OpEndPrimitive", - "opcode" : 219, - "capabilities" : [ "Geometry" ] - }, - { - "opname" : "OpEmitStreamVertex", - "opcode" : 220, - "operands" : [ - { "kind" : "IdRef", "name" : "'Stream'" } - ], - "capabilities" : [ "GeometryStreams" ] - }, - { - "opname" : "OpEndStreamPrimitive", - "opcode" : 221, - "operands" : [ - { "kind" : "IdRef", "name" : "'Stream'" } - ], - "capabilities" : [ "GeometryStreams" ] - }, - { - "opname" : "OpControlBarrier", - "opcode" : 224, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpMemoryBarrier", - "opcode" : 225, - "operands" : [ - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicLoad", - "opcode" : 227, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicStore", - "opcode" : 228, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicExchange", - "opcode" : 229, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicCompareExchange", - "opcode" : 230, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Equal'" }, - { "kind" : "IdMemorySemantics", "name" : "'Unequal'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Comparator'" } - ] - }, - { - "opname" : "OpAtomicCompareExchangeWeak", - "opcode" : 231, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Equal'" }, - { "kind" : "IdMemorySemantics", "name" : "'Unequal'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Comparator'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpAtomicIIncrement", - "opcode" : 232, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicIDecrement", - "opcode" : 233, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicIAdd", - "opcode" : 234, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicISub", - "opcode" : 235, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicSMin", - "opcode" : 236, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicUMin", - "opcode" : 237, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicSMax", - "opcode" : 238, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicUMax", - "opcode" : 239, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicAnd", - "opcode" : 240, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicOr", - "opcode" : 241, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicXor", - "opcode" : 242, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpPhi", - "opcode" : 245, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "PairIdRefIdRef", "quantifier" : "*", "name" : "'Variable, Parent, ...'" } - ] - }, - { - "opname" : "OpLoopMerge", - "opcode" : 246, - "operands" : [ - { "kind" : "IdRef", "name" : "'Merge Block'" }, - { "kind" : "IdRef", "name" : "'Continue Target'" }, - { "kind" : "LoopControl" } - ] - }, - { - "opname" : "OpSelectionMerge", - "opcode" : 247, - "operands" : [ - { "kind" : "IdRef", "name" : "'Merge Block'" }, - { "kind" : "SelectionControl" } - ] - }, - { - "opname" : "OpLabel", - "opcode" : 248, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpBranch", - "opcode" : 249, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target Label'" } - ] - }, - { - "opname" : "OpBranchConditional", - "opcode" : 250, - "operands" : [ - { "kind" : "IdRef", "name" : "'Condition'" }, - { "kind" : "IdRef", "name" : "'True Label'" }, - { "kind" : "IdRef", "name" : "'False Label'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Branch weights'" } - ] - }, - { - "opname" : "OpSwitch", - "opcode" : 251, - "operands" : [ - { "kind" : "IdRef", "name" : "'Selector'" }, - { "kind" : "IdRef", "name" : "'Default'" }, - { "kind" : "PairLiteralIntegerIdRef", "quantifier" : "*", "name" : "'Target'" } - ] - }, - { - "opname" : "OpKill", - "opcode" : 252, - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpReturn", - "opcode" : 253 - }, - { - "opname" : "OpReturnValue", - "opcode" : 254, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpUnreachable", - "opcode" : 255 - }, - { - "opname" : "OpLifetimeStart", - "opcode" : 256, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "LiteralInteger", "name" : "'Size'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpLifetimeStop", - "opcode" : 257, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "LiteralInteger", "name" : "'Size'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGroupAsyncCopy", - "opcode" : 259, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Destination'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Num Elements'" }, - { "kind" : "IdRef", "name" : "'Stride'" }, - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGroupWaitEvents", - "opcode" : 260, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Num Events'" }, - { "kind" : "IdRef", "name" : "'Events List'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGroupAll", - "opcode" : 261, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupAny", - "opcode" : 262, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupBroadcast", - "opcode" : 263, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'LocalId'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupIAdd", - "opcode" : 264, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFAdd", - "opcode" : 265, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFMin", - "opcode" : 266, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupUMin", - "opcode" : 267, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupSMin", - "opcode" : 268, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFMax", - "opcode" : 269, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupUMax", - "opcode" : 270, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupSMax", - "opcode" : 271, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpReadPipe", - "opcode" : 274, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpWritePipe", - "opcode" : 275, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReservedReadPipe", - "opcode" : 276, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Index'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReservedWritePipe", - "opcode" : 277, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Index'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReserveReadPipePackets", - "opcode" : 278, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReserveWritePipePackets", - "opcode" : 279, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpCommitReadPipe", - "opcode" : 280, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpCommitWritePipe", - "opcode" : 281, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpIsValidReserveId", - "opcode" : 282, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGetNumPipePackets", - "opcode" : 283, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGetMaxPipePackets", - "opcode" : 284, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupReserveReadPipePackets", - "opcode" : 285, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupReserveWritePipePackets", - "opcode" : 286, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupCommitReadPipe", - "opcode" : 287, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupCommitWritePipe", - "opcode" : 288, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpEnqueueMarker", - "opcode" : 291, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Queue'" }, - { "kind" : "IdRef", "name" : "'Num Events'" }, - { "kind" : "IdRef", "name" : "'Wait Events'" }, - { "kind" : "IdRef", "name" : "'Ret Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpEnqueueKernel", - "opcode" : 292, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Queue'" }, - { "kind" : "IdRef", "name" : "'Flags'" }, - { "kind" : "IdRef", "name" : "'ND Range'" }, - { "kind" : "IdRef", "name" : "'Num Events'" }, - { "kind" : "IdRef", "name" : "'Wait Events'" }, - { "kind" : "IdRef", "name" : "'Ret Event'" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Local Size'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelNDrangeSubGroupCount", - "opcode" : 293, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'ND Range'" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelNDrangeMaxSubGroupSize", - "opcode" : 294, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'ND Range'" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelWorkGroupSize", - "opcode" : 295, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelPreferredWorkGroupSizeMultiple", - "opcode" : 296, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpRetainEvent", - "opcode" : 297, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpReleaseEvent", - "opcode" : 298, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpCreateUserEvent", - "opcode" : 299, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpIsValidEvent", - "opcode" : 300, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpSetUserEventStatus", - "opcode" : 301, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" }, - { "kind" : "IdRef", "name" : "'Status'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpCaptureEventProfilingInfo", - "opcode" : 302, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" }, - { "kind" : "IdRef", "name" : "'Profiling Info'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetDefaultQueue", - "opcode" : 303, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpBuildNDRange", - "opcode" : 304, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'GlobalWorkSize'" }, - { "kind" : "IdRef", "name" : "'LocalWorkSize'" }, - { "kind" : "IdRef", "name" : "'GlobalWorkOffset'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpImageSparseSampleImplicitLod", - "opcode" : 305, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleExplicitLod", - "opcode" : 306, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleDrefImplicitLod", - "opcode" : 307, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleDrefExplicitLod", - "opcode" : 308, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleProjImplicitLod", - "opcode" : 309, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleProjExplicitLod", - "opcode" : 310, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleProjDrefImplicitLod", - "opcode" : 311, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleProjDrefExplicitLod", - "opcode" : 312, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseFetch", - "opcode" : 313, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseGather", - "opcode" : 314, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Component'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseDrefGather", - "opcode" : 315, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseTexelsResident", - "opcode" : 316, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Resident Code'" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpNoLine", - "opcode" : 317 - }, - { - "opname" : "OpAtomicFlagTestAndSet", - "opcode" : 318, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpAtomicFlagClear", - "opcode" : 319, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpImageSparseRead", - "opcode" : 320, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpSizeOf", - "opcode" : 321, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpTypePipeStorage", - "opcode" : 322, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "PipeStorage" ] - }, - { - "opname" : "OpConstantPipeStorage", - "opcode" : 323, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralInteger", "name" : "'Packet Size'" }, - { "kind" : "LiteralInteger", "name" : "'Packet Alignment'" }, - { "kind" : "LiteralInteger", "name" : "'Capacity'" } - ], - "capabilities" : [ "PipeStorage" ] - }, - { - "opname" : "OpCreatePipeFromPipeStorage", - "opcode" : 324, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe Storage'" } - ], - "capabilities" : [ "PipeStorage" ] - }, - { - "opname" : "OpGetKernelLocalSizeForSubgroupCount", - "opcode" : 325, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Subgroup Count'" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "SubgroupDispatch" ] - }, - { - "opname" : "OpGetKernelMaxNumSubgroups", - "opcode" : 326, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "SubgroupDispatch" ] - }, - { - "opname" : "OpTypeNamedBarrier", - "opcode" : 327, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "NamedBarrier" ] - }, - { - "opname" : "OpNamedBarrierInitialize", - "opcode" : 328, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Subgroup Count'" } - ], - "capabilities" : [ "NamedBarrier" ] - }, - { - "opname" : "OpMemoryNamedBarrier", - "opcode" : 329, - "operands" : [ - { "kind" : "IdRef", "name" : "'Named Barrier'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ], - "capabilities" : [ "NamedBarrier" ] - }, - { - "opname" : "OpModuleProcessed", - "opcode" : 330, - "operands" : [ - { "kind" : "LiteralString", "name" : "'Process'" } - ] - }, - { - "opname" : "OpDecorateId", - "opcode" : 332, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "Decoration" } - ], - "extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ] - }, - { - "opname" : "OpSubgroupBallotKHR", - "opcode" : 4421, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "opname" : "OpSubgroupFirstInvocationKHR", - "opcode" : 4422, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "opname" : "OpSubgroupAllKHR", - "opcode" : 4428, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "SubgroupVoteKHR" ] - }, - { - "opname" : "OpSubgroupAnyKHR", - "opcode" : 4429, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "SubgroupVoteKHR" ] - }, - { - "opname" : "OpSubgroupAllEqualKHR", - "opcode" : 4430, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "SubgroupVoteKHR" ] - }, - { - "opname" : "OpSubgroupReadInvocationKHR", - "opcode" : 4432, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Index'" } - ], - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "opname" : "OpGroupIAddNonUniformAMD", - "opcode" : 5000, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFAddNonUniformAMD", - "opcode" : 5001, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFMinNonUniformAMD", - "opcode" : 5002, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupUMinNonUniformAMD", - "opcode" : 5003, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupSMinNonUniformAMD", - "opcode" : 5004, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFMaxNonUniformAMD", - "opcode" : 5005, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupUMaxNonUniformAMD", - "opcode" : 5006, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupSMaxNonUniformAMD", - "opcode" : 5007, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpFragmentMaskFetchAMD", - "opcode" : 5011, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" } - ], - "capabilities" : [ "FragmentMaskAMD" ] - }, - { - "opname" : "OpFragmentFetchAMD", - "opcode" : 5012, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Fragment Index'" } - ], - "capabilities" : [ "FragmentMaskAMD" ] - }, - { - "opname" : "OpSubgroupShuffleINTEL", - "opcode" : 5571, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Data'" }, - { "kind" : "IdRef", "name" : "'InvocationId'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ] - }, - { - "opname" : "OpSubgroupShuffleDownINTEL", - "opcode" : 5572, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Current'" }, - { "kind" : "IdRef", "name" : "'Next'" }, - { "kind" : "IdRef", "name" : "'Delta'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ] - }, - { - "opname" : "OpSubgroupShuffleUpINTEL", - "opcode" : 5573, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Previous'" }, - { "kind" : "IdRef", "name" : "'Current'" }, - { "kind" : "IdRef", "name" : "'Delta'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ] - }, - { - "opname" : "OpSubgroupShuffleXorINTEL", - "opcode" : 5574, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Data'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ] - }, - { - "opname" : "OpSubgroupBlockReadINTEL", - "opcode" : 5575, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Ptr'" } - ], - "capabilities" : [ "SubgroupBufferBlockIOINTEL" ] - }, - { - "opname" : "OpSubgroupBlockWriteINTEL", - "opcode" : 5576, - "operands" : [ - { "kind" : "IdRef", "name" : "'Ptr'" }, - { "kind" : "IdRef", "name" : "'Data'" } - ], - "capabilities" : [ "SubgroupBufferBlockIOINTEL" ] - }, - { - "opname" : "OpSubgroupImageBlockReadINTEL", - "opcode" : 5577, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" } - ], - "capabilities" : [ "SubgroupImageBlockIOINTEL" ] - }, - { - "opname" : "OpSubgroupImageBlockWriteINTEL", - "opcode" : 5578, - "operands" : [ - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Data'" } - ], - "capabilities" : [ "SubgroupImageBlockIOINTEL" ] - }, - { - "opname" : "OpDecorateStringGOOGLE", - "opcode" : 5632, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "Decoration" } - ], - "extensions" : [ "SPV_GOOGLE_decorate_string" ] - }, - { - "opname" : "OpMemberDecorateStringGOOGLE", - "opcode" : 5633, - "operands" : [ - { "kind" : "IdRef", "name" : "'Struct Type'" }, - { "kind" : "LiteralInteger", "name" : "'Member'" }, - { "kind" : "Decoration" } - ], - "extensions" : [ "SPV_GOOGLE_decorate_string" ] - } - ], - "operand_kinds" : [ - { - "category" : "BitEnum", - "kind" : "ImageOperands", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Bias", - "value" : "0x0001", - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Lod", - "value" : "0x0002", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Grad", - "value" : "0x0004", - "parameters" : [ - { "kind" : "IdRef" }, - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "ConstOffset", - "value" : "0x0008", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Offset", - "value" : "0x0010", - "capabilities" : [ "ImageGatherExtended" ], - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "ConstOffsets", - "value" : "0x0020", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Sample", - "value" : "0x0040", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "MinLod", - "value" : "0x0080", - "capabilities" : [ "MinLod" ], - "parameters" : [ - { "kind" : "IdRef" } - ] - } - ] - }, - { - "category" : "BitEnum", - "kind" : "FPFastMathMode", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "NotNaN", - "value" : "0x0001", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NotInf", - "value" : "0x0002", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NSZ", - "value" : "0x0004", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "AllowRecip", - "value" : "0x0008", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Fast", - "value" : "0x0010", - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "BitEnum", - "kind" : "SelectionControl", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Flatten", - "value" : "0x0001" - }, - { - "enumerant" : "DontFlatten", - "value" : "0x0002" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "LoopControl", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Unroll", - "value" : "0x0001" - }, - { - "enumerant" : "DontUnroll", - "value" : "0x0002" - }, - { - "enumerant" : "DependencyInfinite", - "value" : "0x0004" - }, - { - "enumerant" : "DependencyLength", - "value" : "0x0008", - "parameters" : [ - { "kind" : "LiteralInteger" } - ] - - } - ] - }, - { - "category" : "BitEnum", - "kind" : "FunctionControl", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Inline", - "value" : "0x0001" - }, - { - "enumerant" : "DontInline", - "value" : "0x0002" - }, - { - "enumerant" : "Pure", - "value" : "0x0004" - }, - { - "enumerant" : "Const", - "value" : "0x0008" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "MemorySemantics", - "enumerants" : [ - { - "enumerant" : "Relaxed", - "value" : "0x0000" - }, - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Acquire", - "value" : "0x0002" - }, - { - "enumerant" : "Release", - "value" : "0x0004" - }, - { - "enumerant" : "AcquireRelease", - "value" : "0x0008" - }, - { - "enumerant" : "SequentiallyConsistent", - "value" : "0x0010" - }, - { - "enumerant" : "UniformMemory", - "value" : "0x0040", - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SubgroupMemory", - "value" : "0x0080" - }, - { - "enumerant" : "WorkgroupMemory", - "value" : "0x0100" - }, - { - "enumerant" : "CrossWorkgroupMemory", - "value" : "0x0200" - }, - { - "enumerant" : "AtomicCounterMemory", - "value" : "0x0400", - "capabilities" : [ "AtomicStorage" ] - }, - { - "enumerant" : "ImageMemory", - "value" : "0x0800" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "MemoryAccess", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Volatile", - "value" : "0x0001" - }, - { - "enumerant" : "Aligned", - "value" : "0x0002", - "parameters" : [ - { "kind" : "LiteralInteger" } - ] - }, - { - "enumerant" : "Nontemporal", - "value" : "0x0004" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "KernelProfilingInfo", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "CmdExecTime", - "value" : "0x0001", - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "SourceLanguage", - "enumerants" : [ - { - "enumerant" : "Unknown", - "value" : 0 - }, - { - "enumerant" : "ESSL", - "value" : 1 - }, - { - "enumerant" : "GLSL", - "value" : 2 - }, - { - "enumerant" : "OpenCL_C", - "value" : 3 - }, - { - "enumerant" : "OpenCL_CPP", - "value" : 4 - }, - { - "enumerant" : "HLSL", - "value" : 5 - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ExecutionModel", - "enumerants" : [ - { - "enumerant" : "Vertex", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "TessellationControl", - "value" : 1, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "TessellationEvaluation", - "value" : 2, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Geometry", - "value" : 3, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "Fragment", - "value" : 4, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GLCompute", - "value" : 5, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Kernel", - "value" : 6, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "AddressingModel", - "enumerants" : [ - { - "enumerant" : "Logical", - "value" : 0 - }, - { - "enumerant" : "Physical32", - "value" : 1, - "capabilities" : [ "Addresses" ] - }, - { - "enumerant" : "Physical64", - "value" : 2, - "capabilities" : [ "Addresses" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "MemoryModel", - "enumerants" : [ - { - "enumerant" : "Simple", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GLSL450", - "value" : 1, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "OpenCL", - "value" : 2, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ExecutionMode", - "enumerants" : [ - { - "enumerant" : "Invocations", - "value" : 0, - "capabilities" : [ "Geometry" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Number of <>'" } - ] - }, - { - "enumerant" : "SpacingEqual", - "value" : 1, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "SpacingFractionalEven", - "value" : 2, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "SpacingFractionalOdd", - "value" : 3, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "VertexOrderCw", - "value" : 4, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "VertexOrderCcw", - "value" : 5, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "PixelCenterInteger", - "value" : 6, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "OriginUpperLeft", - "value" : 7, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "OriginLowerLeft", - "value" : 8, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "EarlyFragmentTests", - "value" : 9, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PointMode", - "value" : 10, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Xfb", - "value" : 11, - "capabilities" : [ "TransformFeedback" ] - }, - { - "enumerant" : "DepthReplacing", - "value" : 12, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DepthGreater", - "value" : 14, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DepthLess", - "value" : 15, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DepthUnchanged", - "value" : 16, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "LocalSize", - "value" : 17, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'x size'" }, - { "kind" : "LiteralInteger", "name" : "'y size'" }, - { "kind" : "LiteralInteger", "name" : "'z size'" } - ] - }, - { - "enumerant" : "LocalSizeHint", - "value" : 18, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'x size'" }, - { "kind" : "LiteralInteger", "name" : "'y size'" }, - { "kind" : "LiteralInteger", "name" : "'z size'" } - ] - }, - { - "enumerant" : "InputPoints", - "value" : 19, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "InputLines", - "value" : 20, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "InputLinesAdjacency", - "value" : 21, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "Triangles", - "value" : 22, - "capabilities" : [ "Geometry", "Tessellation" ] - }, - { - "enumerant" : "InputTrianglesAdjacency", - "value" : 23, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "Quads", - "value" : 24, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Isolines", - "value" : 25, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "OutputVertices", - "value" : 26, - "capabilities" : [ "Geometry", "Tessellation" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Vertex count'" } - ] - }, - { - "enumerant" : "OutputPoints", - "value" : 27, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "OutputLineStrip", - "value" : 28, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "OutputTriangleStrip", - "value" : 29, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "VecTypeHint", - "value" : 30, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Vector type'" } - ] - }, - { - "enumerant" : "ContractionOff", - "value" : 31, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Initializer", - "value" : 33, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Finalizer", - "value" : 34, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupSize", - "value" : 35, - "capabilities" : [ "SubgroupDispatch" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Subgroup Size'" } - ] - }, - { - "enumerant" : "SubgroupsPerWorkgroup", - "value" : 36, - "capabilities" : [ "SubgroupDispatch" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Subgroups Per Workgroup'" } - ] - }, - { - "enumerant" : "PostDepthCoverage", - "value" : 4446, - "capabilities" : [ "SampleMaskPostDepthCoverage" ] - }, - { - "enumerant" : "StencilRefReplacingEXT", - "value" : 5027, - "capabilities" : [ "StencilExportEXT" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "StorageClass", - "enumerants" : [ - { - "enumerant" : "UniformConstant", - "value" : 0 - }, - { - "enumerant" : "Input", - "value" : 1 - }, - { - "enumerant" : "Uniform", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Output", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Workgroup", - "value" : 4 - }, - { - "enumerant" : "CrossWorkgroup", - "value" : 5 - }, - { - "enumerant" : "Private", - "value" : 6, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Function", - "value" : 7 - }, - { - "enumerant" : "Generic", - "value" : 8, - "capabilities" : [ "GenericPointer" ] - }, - { - "enumerant" : "PushConstant", - "value" : 9, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "AtomicCounter", - "value" : 10, - "capabilities" : [ "AtomicStorage" ] - }, - { - "enumerant" : "Image", - "value" : 11 - }, - { - "enumerant" : "StorageBuffer", - "value" : 12, - "extensions" : [ - "SPV_KHR_storage_buffer_storage_class", - "SPV_KHR_variable_pointers" - ], - "capabilities" : [ "Shader" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Dim", - "enumerants" : [ - { - "enumerant" : "1D", - "value" : 0, - "capabilities" : [ "Sampled1D" ] - }, - { - "enumerant" : "2D", - "value" : 1 - }, - { - "enumerant" : "3D", - "value" : 2 - }, - { - "enumerant" : "Cube", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rect", - "value" : 4, - "capabilities" : [ "SampledRect" ] - }, - { - "enumerant" : "Buffer", - "value" : 5, - "capabilities" : [ "SampledBuffer" ] - }, - { - "enumerant" : "SubpassData", - "value" : 6, - "capabilities" : [ "InputAttachment" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "SamplerAddressingMode", - "enumerants" : [ - { - "enumerant" : "None", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ClampToEdge", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Clamp", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Repeat", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RepeatMirrored", - "value" : 4, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "SamplerFilterMode", - "enumerants" : [ - { - "enumerant" : "Nearest", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Linear", - "value" : 1, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ImageFormat", - "enumerants" : [ - { - "enumerant" : "Unknown", - "value" : 0 - }, - { - "enumerant" : "Rgba32f", - "value" : 1, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba16f", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "R32f", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8", - "value" : 4, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8Snorm", - "value" : 5, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rg32f", - "value" : 6, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16f", - "value" : 7, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R11fG11fB10f", - "value" : 8, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16f", - "value" : 9, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba16", - "value" : 10, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgb10A2", - "value" : 11, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16", - "value" : 12, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8", - "value" : 13, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16", - "value" : 14, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8", - "value" : 15, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba16Snorm", - "value" : 16, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16Snorm", - "value" : 17, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8Snorm", - "value" : 18, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16Snorm", - "value" : 19, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8Snorm", - "value" : 20, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba32i", - "value" : 21, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba16i", - "value" : 22, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8i", - "value" : 23, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "R32i", - "value" : 24, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rg32i", - "value" : 25, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16i", - "value" : 26, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8i", - "value" : 27, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16i", - "value" : 28, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8i", - "value" : 29, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba32ui", - "value" : 30, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba16ui", - "value" : 31, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8ui", - "value" : 32, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "R32ui", - "value" : 33, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgb10a2ui", - "value" : 34, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg32ui", - "value" : 35, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16ui", - "value" : 36, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8ui", - "value" : 37, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16ui", - "value" : 38, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8ui", - "value" : 39, - "capabilities" : [ "StorageImageExtendedFormats" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ImageChannelOrder", - "enumerants" : [ - { - "enumerant" : "R", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "A", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RG", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RA", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGB", - "value" : 4, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGBA", - "value" : 5, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "BGRA", - "value" : 6, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ARGB", - "value" : 7, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Intensity", - "value" : 8, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Luminance", - "value" : 9, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Rx", - "value" : 10, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGx", - "value" : 11, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGBx", - "value" : 12, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Depth", - "value" : 13, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "DepthStencil", - "value" : 14, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sRGB", - "value" : 15, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sRGBx", - "value" : 16, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sRGBA", - "value" : 17, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sBGRA", - "value" : 18, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ABGR", - "value" : 19, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ImageChannelDataType", - "enumerants" : [ - { - "enumerant" : "SnormInt8", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SnormInt16", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt8", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt16", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormShort565", - "value" : 4, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormShort555", - "value" : 5, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt101010", - "value" : 6, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SignedInt8", - "value" : 7, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SignedInt16", - "value" : 8, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SignedInt32", - "value" : 9, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnsignedInt8", - "value" : 10, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnsignedInt16", - "value" : 11, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnsignedInt32", - "value" : 12, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "HalfFloat", - "value" : 13, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Float", - "value" : 14, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt24", - "value" : 15, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt101010_2", - "value" : 16, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "FPRoundingMode", - "enumerants" : [ - { - "enumerant" : "RTE", - "value" : 0, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ] - }, - { - "enumerant" : "RTZ", - "value" : 1, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ] - }, - { - "enumerant" : "RTP", - "value" : 2, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ] - }, - { - "enumerant" : "RTN", - "value" : 3, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "LinkageType", - "enumerants" : [ - { - "enumerant" : "Export", - "value" : 0, - "capabilities" : [ "Linkage" ] - }, - { - "enumerant" : "Import", - "value" : 1, - "capabilities" : [ "Linkage" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "AccessQualifier", - "enumerants" : [ - { - "enumerant" : "ReadOnly", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "WriteOnly", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ReadWrite", - "value" : 2, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "FunctionParameterAttribute", - "enumerants" : [ - { - "enumerant" : "Zext", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Sext", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ByVal", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Sret", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoAlias", - "value" : 4, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoCapture", - "value" : 5, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoWrite", - "value" : 6, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoReadWrite", - "value" : 7, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Decoration", - "enumerants" : [ - { - "enumerant" : "RelaxedPrecision", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SpecId", - "value" : 1, - "capabilities" : [ "Shader", "Kernel" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Specialization Constant ID'" } - ] - }, - { - "enumerant" : "Block", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "BufferBlock", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "RowMajor", - "value" : 4, - "capabilities" : [ "Matrix" ] - }, - { - "enumerant" : "ColMajor", - "value" : 5, - "capabilities" : [ "Matrix" ] - }, - { - "enumerant" : "ArrayStride", - "value" : 6, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Array Stride'" } - ] - }, - { - "enumerant" : "MatrixStride", - "value" : 7, - "capabilities" : [ "Matrix" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Matrix Stride'" } - ] - }, - { - "enumerant" : "GLSLShared", - "value" : 8, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GLSLPacked", - "value" : 9, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "CPacked", - "value" : 10, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "BuiltIn", - "value" : 11, - "parameters" : [ - { "kind" : "BuiltIn" } - ] - }, - { - "enumerant" : "NoPerspective", - "value" : 13, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Flat", - "value" : 14, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Patch", - "value" : 15, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Centroid", - "value" : 16, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Sample", - "value" : 17, - "capabilities" : [ "SampleRateShading" ] - }, - { - "enumerant" : "Invariant", - "value" : 18, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Restrict", - "value" : 19 - }, - { - "enumerant" : "Aliased", - "value" : 20 - }, - { - "enumerant" : "Volatile", - "value" : 21 - }, - { - "enumerant" : "Constant", - "value" : 22, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Coherent", - "value" : 23 - }, - { - "enumerant" : "NonWritable", - "value" : 24 - }, - { - "enumerant" : "NonReadable", - "value" : 25 - }, - { - "enumerant" : "Uniform", - "value" : 26, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SaturatedConversion", - "value" : 28, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Stream", - "value" : 29, - "capabilities" : [ "GeometryStreams" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Stream Number'" } - ] - }, - { - "enumerant" : "Location", - "value" : 30, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Location'" } - ] - }, - { - "enumerant" : "Component", - "value" : 31, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Component'" } - ] - }, - { - "enumerant" : "Index", - "value" : 32, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Index'" } - ] - }, - { - "enumerant" : "Binding", - "value" : 33, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Binding Point'" } - ] - }, - { - "enumerant" : "DescriptorSet", - "value" : 34, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Descriptor Set'" } - ] - }, - { - "enumerant" : "Offset", - "value" : 35, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Byte Offset'" } - ] - }, - { - "enumerant" : "XfbBuffer", - "value" : 36, - "capabilities" : [ "TransformFeedback" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'XFB Buffer Number'" } - ] - }, - { - "enumerant" : "XfbStride", - "value" : 37, - "capabilities" : [ "TransformFeedback" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'XFB Stride'" } - ] - }, - { - "enumerant" : "FuncParamAttr", - "value" : 38, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "FunctionParameterAttribute", "name" : "'Function Parameter Attribute'" } - ] - }, - { - "enumerant" : "FPRoundingMode", - "value" : 39, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ], - "parameters" : [ - { "kind" : "FPRoundingMode", "name" : "'Floating-Point Rounding Mode'" } - ] - }, - { - "enumerant" : "FPFastMathMode", - "value" : 40, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "FPFastMathMode", "name" : "'Fast-Math Mode'" } - ] - }, - { - "enumerant" : "LinkageAttributes", - "value" : 41, - "capabilities" : [ "Linkage" ], - "parameters" : [ - { "kind" : "LiteralString", "name" : "'Name'" }, - { "kind" : "LinkageType", "name" : "'Linkage Type'" } - ] - }, - { - "enumerant" : "NoContraction", - "value" : 42, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InputAttachmentIndex", - "value" : 43, - "capabilities" : [ "InputAttachment" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Attachment Index'" } - ] - }, - { - "enumerant" : "Alignment", - "value" : 44, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Alignment'" } - ] - }, - { - "enumerant" : "MaxByteOffset", - "value" : 45, - "capabilities" : [ "Addresses" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Max Byte Offset'" } - ] - }, - { - "enumerant" : "ExplicitInterpAMD", - "value" : 4999 - }, - { - "enumerant" : "OverrideCoverageNV", - "value" : 5248, - "capabilities" : [ "SampleMaskOverrideCoverageNV" ] - }, - { - "enumerant" : "PassthroughNV", - "value" : 5250, - "capabilities" : [ "GeometryShaderPassthroughNV" ] - }, - { - "enumerant" : "ViewportRelativeNV", - "value" : 5252, - "capabilities" : [ "ShaderViewportMaskNV" ] - }, - { - "enumerant" : "SecondaryViewportRelativeNV", - "value" : 5256, - "capabilities" : [ "ShaderStereoViewNV" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Offset'" } - ] - }, - { - "enumerant" : "HlslCounterBufferGOOGLE", - "value" : 5634, - "parameters" : [ - { "kind" : "IdRef", "name" : "'Counter Buffer'" } - ], - "extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ] - }, - { - "enumerant" : "HlslSemanticGOOGLE", - "value" : 5635, - "parameters" : [ - { "kind" : "LiteralString", "name" : "'Semantic'" } - ], - "extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "BuiltIn", - "enumerants" : [ - { - "enumerant" : "Position", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PointSize", - "value" : 1, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ClipDistance", - "value" : 3, - "capabilities" : [ "ClipDistance" ] - }, - { - "enumerant" : "CullDistance", - "value" : 4, - "capabilities" : [ "CullDistance" ] - }, - { - "enumerant" : "VertexId", - "value" : 5, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InstanceId", - "value" : 6, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PrimitiveId", - "value" : 7, - "capabilities" : [ "Geometry", "Tessellation" ] - }, - { - "enumerant" : "InvocationId", - "value" : 8, - "capabilities" : [ "Geometry", "Tessellation" ] - }, - { - "enumerant" : "Layer", - "value" : 9, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "ViewportIndex", - "value" : 10, - "capabilities" : [ "MultiViewport" ] - }, - { - "enumerant" : "TessLevelOuter", - "value" : 11, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "TessLevelInner", - "value" : 12, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "TessCoord", - "value" : 13, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "PatchVertices", - "value" : 14, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "FragCoord", - "value" : 15, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PointCoord", - "value" : 16, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "FrontFacing", - "value" : 17, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SampleId", - "value" : 18, - "capabilities" : [ "SampleRateShading" ] - }, - { - "enumerant" : "SamplePosition", - "value" : 19, - "capabilities" : [ "SampleRateShading" ] - }, - { - "enumerant" : "SampleMask", - "value" : 20, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "FragDepth", - "value" : 22, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "HelperInvocation", - "value" : 23, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "NumWorkgroups", - "value" : 24 - }, - { - "enumerant" : "WorkgroupSize", - "value" : 25 - }, - { - "enumerant" : "WorkgroupId", - "value" : 26 - }, - { - "enumerant" : "LocalInvocationId", - "value" : 27 - }, - { - "enumerant" : "GlobalInvocationId", - "value" : 28 - }, - { - "enumerant" : "LocalInvocationIndex", - "value" : 29 - }, - { - "enumerant" : "WorkDim", - "value" : 30, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "GlobalSize", - "value" : 31, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "EnqueuedWorkgroupSize", - "value" : 32, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "GlobalOffset", - "value" : 33, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "GlobalLinearId", - "value" : 34, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupSize", - "value" : 36, - "capabilities" : [ "Kernel", "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupMaxSize", - "value" : 37, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NumSubgroups", - "value" : 38, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NumEnqueuedSubgroups", - "value" : 39, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupId", - "value" : 40, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupLocalInvocationId", - "value" : 41, - "capabilities" : [ "Kernel", "SubgroupBallotKHR" ] - }, - { - "enumerant" : "VertexIndex", - "value" : 42, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InstanceIndex", - "value" : 43, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SubgroupEqMaskKHR", - "value" : 4416, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupGeMaskKHR", - "value" : 4417, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupGtMaskKHR", - "value" : 4418, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupLeMaskKHR", - "value" : 4419, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupLtMaskKHR", - "value" : 4420, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "BaseVertex", - "value" : 4424, - "capabilities" : [ "DrawParameters" ] - }, - { - "enumerant" : "BaseInstance", - "value" : 4425, - "capabilities" : [ "DrawParameters" ] - }, - { - "enumerant" : "DrawIndex", - "value" : 4426, - "capabilities" : [ "DrawParameters" ] - }, - { - "enumerant" : "DeviceIndex", - "value" : 4438, - "capabilities" : [ "DeviceGroup" ] - }, - { - "enumerant" : "ViewIndex", - "value" : 4440, - "capabilities" : [ "MultiView" ] - }, - { - "enumerant" : "BaryCoordNoPerspAMD", - "value" : 4992 - }, - { - "enumerant" : "BaryCoordNoPerspCentroidAMD", - "value" : 4993 - }, - { - "enumerant" : "BaryCoordNoPerspSampleAMD", - "value" : 4994 - }, - { - "enumerant" : "BaryCoordSmoothAMD", - "value" : 4995 - }, - { - "enumerant" : "BaryCoordSmoothCentroidAMD", - "value" : 4996 - }, - { - "enumerant" : "BaryCoordSmoothSampleAMD", - "value" : 4997 - }, - { - "enumerant" : "BaryCoordPullModelAMD", - "value" : 4998 - }, - { - "enumerant" : "FragStencilRefEXT", - "value" : 5014, - "capabilities" : [ "StencilExportEXT" ] - }, - { - "enumerant" : "ViewportMaskNV", - "value" : 5253, - "capabilities" : [ "ShaderViewportMaskNV" ] - }, - { - "enumerant" : "SecondaryPositionNV", - "value" : 5257, - "capabilities" : [ "ShaderStereoViewNV" ] - }, - { - "enumerant" : "SecondaryViewportMaskNV", - "value" : 5258, - "capabilities" : [ "ShaderStereoViewNV" ] - }, - { - "enumerant" : "PositionPerViewNV", - "value" : 5261, - "capabilities" : [ "PerViewAttributesNV" ] - }, - { - "enumerant" : "ViewportMaskPerViewNV", - "value" : 5262, - "capabilities" : [ "PerViewAttributesNV" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Scope", - "enumerants" : [ - { - "enumerant" : "CrossDevice", - "value" : 0 - }, - { - "enumerant" : "Device", - "value" : 1 - }, - { - "enumerant" : "Workgroup", - "value" : 2 - }, - { - "enumerant" : "Subgroup", - "value" : 3 - }, - { - "enumerant" : "Invocation", - "value" : 4 - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "GroupOperation", - "enumerants" : [ - { - "enumerant" : "Reduce", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "InclusiveScan", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ExclusiveScan", - "value" : 2, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "KernelEnqueueFlags", - "enumerants" : [ - { - "enumerant" : "NoWait", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "WaitKernel", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "WaitWorkGroup", - "value" : 2, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Capability", - "enumerants" : [ - { - "enumerant" : "Matrix", - "value" : 0 - }, - { - "enumerant" : "Shader", - "value" : 1, - "capabilities" : [ "Matrix" ] - }, - { - "enumerant" : "Geometry", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Tessellation", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Addresses", - "value" : 4 - }, - { - "enumerant" : "Linkage", - "value" : 5 - }, - { - "enumerant" : "Kernel", - "value" : 6 - }, - { - "enumerant" : "Vector16", - "value" : 7, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Float16Buffer", - "value" : 8, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Float16", - "value" : 9 - }, - { - "enumerant" : "Float64", - "value" : 10 - }, - { - "enumerant" : "Int64", - "value" : 11 - }, - { - "enumerant" : "Int64Atomics", - "value" : 12, - "capabilities" : [ "Int64" ] - }, - { - "enumerant" : "ImageBasic", - "value" : 13, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ImageReadWrite", - "value" : 14, - "capabilities" : [ "ImageBasic" ] - }, - { - "enumerant" : "ImageMipmap", - "value" : 15, - "capabilities" : [ "ImageBasic" ] - }, - { - "enumerant" : "Pipes", - "value" : 17, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Groups", - "value" : 18 - }, - { - "enumerant" : "DeviceEnqueue", - "value" : 19, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "LiteralSampler", - "value" : 20, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "AtomicStorage", - "value" : 21, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Int16", - "value" : 22 - }, - { - "enumerant" : "TessellationPointSize", - "value" : 23, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "GeometryPointSize", - "value" : 24, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "ImageGatherExtended", - "value" : 25, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageMultisample", - "value" : 27, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "UniformBufferArrayDynamicIndexing", - "value" : 28, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SampledImageArrayDynamicIndexing", - "value" : 29, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageBufferArrayDynamicIndexing", - "value" : 30, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageArrayDynamicIndexing", - "value" : 31, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ClipDistance", - "value" : 32, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "CullDistance", - "value" : 33, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ImageCubeArray", - "value" : 34, - "capabilities" : [ "SampledCubeArray" ] - }, - { - "enumerant" : "SampleRateShading", - "value" : 35, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ImageRect", - "value" : 36, - "capabilities" : [ "SampledRect" ] - }, - { - "enumerant" : "SampledRect", - "value" : 37, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GenericPointer", - "value" : 38, - "capabilities" : [ "Addresses" ] - }, - { - "enumerant" : "Int8", - "value" : 39, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "InputAttachment", - "value" : 40, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SparseResidency", - "value" : 41, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "MinLod", - "value" : 42, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Sampled1D", - "value" : 43 - }, - { - "enumerant" : "Image1D", - "value" : 44, - "capabilities" : [ "Sampled1D" ] - }, - { - "enumerant" : "SampledCubeArray", - "value" : 45, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SampledBuffer", - "value" : 46 - }, - { - "enumerant" : "ImageBuffer", - "value" : 47, - "capabilities" : [ "SampledBuffer" ] - }, - { - "enumerant" : "ImageMSArray", - "value" : 48, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageExtendedFormats", - "value" : 49, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ImageQuery", - "value" : 50, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DerivativeControl", - "value" : 51, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InterpolationFunction", - "value" : 52, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "TransformFeedback", - "value" : 53, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GeometryStreams", - "value" : 54, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "StorageImageReadWithoutFormat", - "value" : 55, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageWriteWithoutFormat", - "value" : 56, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "MultiViewport", - "value" : 57, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "SubgroupDispatch", - "value" : 58, - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "enumerant" : "NamedBarrier", - "value" : 59, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "PipeStorage", - "value" : 60, - "capabilities" : [ "Pipes" ] - }, - { - "enumerant" : "SubgroupBallotKHR", - "value" : 4423, - "extensions" : [ "SPV_KHR_shader_ballot" ] - }, - { - "enumerant" : "DrawParameters", - "value" : 4427, - "extensions" : [ "SPV_KHR_shader_draw_parameters" ] - }, - { - "enumerant" : "SubgroupVoteKHR", - "value" : 4431, - "extensions" : [ "SPV_KHR_subgroup_vote" ] - }, - { - "enumerant" : "StorageBuffer16BitAccess", - "value" : 4433, - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "StorageUniformBufferBlock16", - "value" : 4433, - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "UniformAndStorageBuffer16BitAccess", - "value" : 4434, - "capabilities" : [ - "StorageBuffer16BitAccess", - "StorageUniformBufferBlock16" - ], - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "StorageUniform16", - "value" : 4434, - "capabilities" : [ - "StorageBuffer16BitAccess", - "StorageUniformBufferBlock16" - ], - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "StoragePushConstant16", - "value" : 4435, - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "StorageInputOutput16", - "value" : 4436, - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "DeviceGroup", - "value" : 4437, - "extensions" : [ "SPV_KHR_device_group" ] - }, - { - "enumerant" : "MultiView", - "value" : 4439, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_KHR_multiview" ] - }, - { - "enumerant" : "VariablePointersStorageBuffer", - "value" : 4441, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_KHR_variable_pointers" ] - }, - { - "enumerant" : "VariablePointers", - "value" : 4442, - "capabilities" : [ "VariablePointersStorageBuffer" ], - "extensions" : [ "SPV_KHR_variable_pointers" ] - }, - { - "enumerant": "AtomicStorageOps", - "value": 4445, - "extensions": [ "SPV_KHR_shader_atomic_counter_ops" ] - }, - { - "enumerant" : "SampleMaskPostDepthCoverage", - "value" : 4447, - "extensions" : [ "SPV_KHR_post_depth_coverage" ] - }, - { - "enumerant" : "ImageGatherBiasLodAMD", - "value" : 5009, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_AMD_texture_gather_bias_lod" ] - }, - { - "enumerant" : "FragmentMaskAMD", - "value" : 5010, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_AMD_shader_fragment_mask" ] - }, - { - "enumerant" : "StencilExportEXT", - "value" : 5013, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_EXT_shader_stencil_export" ] - }, - { - "enumerant" : "ImageReadWriteLodAMD", - "value" : 5015, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_AMD_shader_image_load_store_lod" ] - }, - { - "enumerant" : "SampleMaskOverrideCoverageNV", - "value" : 5249, - "capabilities" : [ "SampleRateShading" ], - "extensions" : [ "SPV_NV_sample_mask_override_coverage" ] - }, - { - "enumerant" : "GeometryShaderPassthroughNV", - "value" : 5251, - "capabilities" : [ "Geometry" ], - "extensions" : [ "SPV_NV_geometry_shader_passthrough" ] - }, - { - "enumerant" : "ShaderViewportIndexLayerEXT", - "value" : 5254, - "capabilities" : [ "MultiViewport" ], - "extensions" : [ "SPV_EXT_shader_viewport_index_layer" ] - }, - { - "enumerant" : "ShaderViewportIndexLayerNV", - "value" : 5254, - "capabilities" : [ "MultiViewport" ], - "extensions" : [ "SPV_NV_viewport_array2" ] - }, - { - "enumerant" : "ShaderViewportMaskNV", - "value" : 5255, - "capabilities" : [ "ShaderViewportIndexLayerNV" ], - "extensions" : [ "SPV_NV_viewport_array2" ] - }, - { - "enumerant" : "ShaderStereoViewNV", - "value" : 5259, - "capabilities" : [ "ShaderViewportMaskNV" ], - "extensions" : [ "SPV_NV_stereo_view_rendering" ] - }, - { - "enumerant" : "PerViewAttributesNV", - "value" : 5260, - "capabilities" : [ "MultiView" ], - "extensions" : [ "SPV_NVX_multiview_per_view_attributes" ] - }, - { - "enumerant" : "SubgroupShuffleINTEL", - "value" : 5568, - "extensions" : [ "SPV_INTEL_subgroups" ] - }, - { - "enumerant" : "SubgroupBufferBlockIOINTEL", - "value" : 5569, - "extensions" : [ "SPV_INTEL_subgroups" ] - }, - { - "enumerant" : "SubgroupImageBlockIOINTEL", - "value" : 5570, - "extensions" : [ "SPV_INTEL_subgroups" ] - } - ] - }, - { - "category" : "Id", - "kind" : "IdResultType", - "doc" : "Reference to an representing the result's type of the enclosing instruction" - }, - { - "category" : "Id", - "kind" : "IdResult", - "doc" : "Definition of an representing the result of the enclosing instruction" - }, - { - "category" : "Id", - "kind" : "IdMemorySemantics", - "doc" : "Reference to an representing a 32-bit integer that is a mask from the MemorySemantics operand kind" - }, - { - "category" : "Id", - "kind" : "IdScope", - "doc" : "Reference to an representing a 32-bit integer that is a mask from the Scope operand kind" - }, - { - "category" : "Id", - "kind" : "IdRef", - "doc" : "Reference to an " - }, - { - "category" : "Literal", - "kind" : "LiteralInteger", - "doc" : "An integer consuming one or more words" - }, - { - "category" : "Literal", - "kind" : "LiteralString", - "doc" : "A null-terminated stream of characters consuming an integral number of words" - }, - { - "category" : "Literal", - "kind" : "LiteralContextDependentNumber", - "doc" : "A literal number whose size and format are determined by a previous operand in the enclosing instruction" - }, - { - "category" : "Literal", - "kind" : "LiteralExtInstInteger", - "doc" : "A 32-bit unsigned integer indicating which instruction to use and determining the layout of following operands (for OpExtInst)" - }, - { - "category" : "Literal", - "kind" : "LiteralSpecConstantOpInteger", - "doc" : "An opcode indicating the operation to be performed and determining the layout of following operands (for OpSpecConstantOp)" - }, - { - "category" : "Composite", - "kind" : "PairLiteralIntegerIdRef", - "bases" : [ "LiteralInteger", "IdRef" ] - }, - { - "category" : "Composite", - "kind" : "PairIdRefLiteralInteger", - "bases" : [ "IdRef", "LiteralInteger" ] - }, - { - "category" : "Composite", - "kind" : "PairIdRefIdRef", - "bases" : [ "IdRef", "IdRef" ] - } - ] -} diff --git a/include/spirv/1.1/spirv.cs b/include/spirv/1.1/spirv.cs deleted file mode 100644 index 99194e51..00000000 --- a/include/spirv/1.1/spirv.cs +++ /dev/null @@ -1,1015 +0,0 @@ -// Copyright (c) 2014-2018 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -// This header is automatically generated by the same tool that creates -// the Binary Section of the SPIR-V specification. - -// Enumeration tokens for SPIR-V, in various styles: -// C, C++, C++11, JSON, Lua, Python, C# -// -// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -// - C# will use enum classes in the Specification class located in the "Spv" namespace, e.g.: Spv.Specification.SourceLanguage.GLSL -// -// Some tokens act like mask values, which can be OR'd together, -// while others are mutually exclusive. The mask-like ones have -// "Mask" in their name, and a parallel enum that has the shift -// amount (1 << x) for each corresponding enumerant. - -namespace Spv -{ - - public static class Specification - { - public const uint MagicNumber = 0x07230203; - public const uint Version = 0x00010100; - public const uint Revision = 8; - public const uint OpCodeMask = 0xffff; - public const uint WordCountShift = 16; - - public enum SourceLanguage - { - Unknown = 0, - ESSL = 1, - GLSL = 2, - OpenCL_C = 3, - OpenCL_CPP = 4, - HLSL = 5, - } - - public enum ExecutionModel - { - Vertex = 0, - TessellationControl = 1, - TessellationEvaluation = 2, - Geometry = 3, - Fragment = 4, - GLCompute = 5, - Kernel = 6, - } - - public enum AddressingModel - { - Logical = 0, - Physical32 = 1, - Physical64 = 2, - } - - public enum MemoryModel - { - Simple = 0, - GLSL450 = 1, - OpenCL = 2, - } - - public enum ExecutionMode - { - Invocations = 0, - SpacingEqual = 1, - SpacingFractionalEven = 2, - SpacingFractionalOdd = 3, - VertexOrderCw = 4, - VertexOrderCcw = 5, - PixelCenterInteger = 6, - OriginUpperLeft = 7, - OriginLowerLeft = 8, - EarlyFragmentTests = 9, - PointMode = 10, - Xfb = 11, - DepthReplacing = 12, - DepthGreater = 14, - DepthLess = 15, - DepthUnchanged = 16, - LocalSize = 17, - LocalSizeHint = 18, - InputPoints = 19, - InputLines = 20, - InputLinesAdjacency = 21, - Triangles = 22, - InputTrianglesAdjacency = 23, - Quads = 24, - Isolines = 25, - OutputVertices = 26, - OutputPoints = 27, - OutputLineStrip = 28, - OutputTriangleStrip = 29, - VecTypeHint = 30, - ContractionOff = 31, - Initializer = 33, - Finalizer = 34, - SubgroupSize = 35, - SubgroupsPerWorkgroup = 36, - PostDepthCoverage = 4446, - StencilRefReplacingEXT = 5027, - } - - public enum StorageClass - { - UniformConstant = 0, - Input = 1, - Uniform = 2, - Output = 3, - Workgroup = 4, - CrossWorkgroup = 5, - Private = 6, - Function = 7, - Generic = 8, - PushConstant = 9, - AtomicCounter = 10, - Image = 11, - StorageBuffer = 12, - } - - public enum Dim - { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - Cube = 3, - Rect = 4, - Buffer = 5, - SubpassData = 6, - } - - public enum SamplerAddressingMode - { - None = 0, - ClampToEdge = 1, - Clamp = 2, - Repeat = 3, - RepeatMirrored = 4, - } - - public enum SamplerFilterMode - { - Nearest = 0, - Linear = 1, - } - - public enum ImageFormat - { - Unknown = 0, - Rgba32f = 1, - Rgba16f = 2, - R32f = 3, - Rgba8 = 4, - Rgba8Snorm = 5, - Rg32f = 6, - Rg16f = 7, - R11fG11fB10f = 8, - R16f = 9, - Rgba16 = 10, - Rgb10A2 = 11, - Rg16 = 12, - Rg8 = 13, - R16 = 14, - R8 = 15, - Rgba16Snorm = 16, - Rg16Snorm = 17, - Rg8Snorm = 18, - R16Snorm = 19, - R8Snorm = 20, - Rgba32i = 21, - Rgba16i = 22, - Rgba8i = 23, - R32i = 24, - Rg32i = 25, - Rg16i = 26, - Rg8i = 27, - R16i = 28, - R8i = 29, - Rgba32ui = 30, - Rgba16ui = 31, - Rgba8ui = 32, - R32ui = 33, - Rgb10a2ui = 34, - Rg32ui = 35, - Rg16ui = 36, - Rg8ui = 37, - R16ui = 38, - R8ui = 39, - } - - public enum ImageChannelOrder - { - R = 0, - A = 1, - RG = 2, - RA = 3, - RGB = 4, - RGBA = 5, - BGRA = 6, - ARGB = 7, - Intensity = 8, - Luminance = 9, - Rx = 10, - RGx = 11, - RGBx = 12, - Depth = 13, - DepthStencil = 14, - sRGB = 15, - sRGBx = 16, - sRGBA = 17, - sBGRA = 18, - ABGR = 19, - } - - public enum ImageChannelDataType - { - SnormInt8 = 0, - SnormInt16 = 1, - UnormInt8 = 2, - UnormInt16 = 3, - UnormShort565 = 4, - UnormShort555 = 5, - UnormInt101010 = 6, - SignedInt8 = 7, - SignedInt16 = 8, - SignedInt32 = 9, - UnsignedInt8 = 10, - UnsignedInt16 = 11, - UnsignedInt32 = 12, - HalfFloat = 13, - Float = 14, - UnormInt24 = 15, - UnormInt101010_2 = 16, - } - - public enum ImageOperandsShift - { - Bias = 0, - Lod = 1, - Grad = 2, - ConstOffset = 3, - Offset = 4, - ConstOffsets = 5, - Sample = 6, - MinLod = 7, - } - - public enum ImageOperandsMask - { - MaskNone = 0, - Bias = 0x00000001, - Lod = 0x00000002, - Grad = 0x00000004, - ConstOffset = 0x00000008, - Offset = 0x00000010, - ConstOffsets = 0x00000020, - Sample = 0x00000040, - MinLod = 0x00000080, - } - - public enum FPFastMathModeShift - { - NotNaN = 0, - NotInf = 1, - NSZ = 2, - AllowRecip = 3, - Fast = 4, - } - - public enum FPFastMathModeMask - { - MaskNone = 0, - NotNaN = 0x00000001, - NotInf = 0x00000002, - NSZ = 0x00000004, - AllowRecip = 0x00000008, - Fast = 0x00000010, - } - - public enum FPRoundingMode - { - RTE = 0, - RTZ = 1, - RTP = 2, - RTN = 3, - } - - public enum LinkageType - { - Export = 0, - Import = 1, - } - - public enum AccessQualifier - { - ReadOnly = 0, - WriteOnly = 1, - ReadWrite = 2, - } - - public enum FunctionParameterAttribute - { - Zext = 0, - Sext = 1, - ByVal = 2, - Sret = 3, - NoAlias = 4, - NoCapture = 5, - NoWrite = 6, - NoReadWrite = 7, - } - - public enum Decoration - { - RelaxedPrecision = 0, - SpecId = 1, - Block = 2, - BufferBlock = 3, - RowMajor = 4, - ColMajor = 5, - ArrayStride = 6, - MatrixStride = 7, - GLSLShared = 8, - GLSLPacked = 9, - CPacked = 10, - BuiltIn = 11, - NoPerspective = 13, - Flat = 14, - Patch = 15, - Centroid = 16, - Sample = 17, - Invariant = 18, - Restrict = 19, - Aliased = 20, - Volatile = 21, - Constant = 22, - Coherent = 23, - NonWritable = 24, - NonReadable = 25, - Uniform = 26, - SaturatedConversion = 28, - Stream = 29, - Location = 30, - Component = 31, - Index = 32, - Binding = 33, - DescriptorSet = 34, - Offset = 35, - XfbBuffer = 36, - XfbStride = 37, - FuncParamAttr = 38, - FPRoundingMode = 39, - FPFastMathMode = 40, - LinkageAttributes = 41, - NoContraction = 42, - InputAttachmentIndex = 43, - Alignment = 44, - MaxByteOffset = 45, - ExplicitInterpAMD = 4999, - OverrideCoverageNV = 5248, - PassthroughNV = 5250, - ViewportRelativeNV = 5252, - SecondaryViewportRelativeNV = 5256, - HlslCounterBufferGOOGLE = 5634, - HlslSemanticGOOGLE = 5635, - } - - public enum BuiltIn - { - Position = 0, - PointSize = 1, - ClipDistance = 3, - CullDistance = 4, - VertexId = 5, - InstanceId = 6, - PrimitiveId = 7, - InvocationId = 8, - Layer = 9, - ViewportIndex = 10, - TessLevelOuter = 11, - TessLevelInner = 12, - TessCoord = 13, - PatchVertices = 14, - FragCoord = 15, - PointCoord = 16, - FrontFacing = 17, - SampleId = 18, - SamplePosition = 19, - SampleMask = 20, - FragDepth = 22, - HelperInvocation = 23, - NumWorkgroups = 24, - WorkgroupSize = 25, - WorkgroupId = 26, - LocalInvocationId = 27, - GlobalInvocationId = 28, - LocalInvocationIndex = 29, - WorkDim = 30, - GlobalSize = 31, - EnqueuedWorkgroupSize = 32, - GlobalOffset = 33, - GlobalLinearId = 34, - SubgroupSize = 36, - SubgroupMaxSize = 37, - NumSubgroups = 38, - NumEnqueuedSubgroups = 39, - SubgroupId = 40, - SubgroupLocalInvocationId = 41, - VertexIndex = 42, - InstanceIndex = 43, - SubgroupEqMaskKHR = 4416, - SubgroupGeMaskKHR = 4417, - SubgroupGtMaskKHR = 4418, - SubgroupLeMaskKHR = 4419, - SubgroupLtMaskKHR = 4420, - BaseVertex = 4424, - BaseInstance = 4425, - DrawIndex = 4426, - DeviceIndex = 4438, - ViewIndex = 4440, - BaryCoordNoPerspAMD = 4992, - BaryCoordNoPerspCentroidAMD = 4993, - BaryCoordNoPerspSampleAMD = 4994, - BaryCoordSmoothAMD = 4995, - BaryCoordSmoothCentroidAMD = 4996, - BaryCoordSmoothSampleAMD = 4997, - BaryCoordPullModelAMD = 4998, - FragStencilRefEXT = 5014, - ViewportMaskNV = 5253, - SecondaryPositionNV = 5257, - SecondaryViewportMaskNV = 5258, - PositionPerViewNV = 5261, - ViewportMaskPerViewNV = 5262, - } - - public enum SelectionControlShift - { - Flatten = 0, - DontFlatten = 1, - } - - public enum SelectionControlMask - { - MaskNone = 0, - Flatten = 0x00000001, - DontFlatten = 0x00000002, - } - - public enum LoopControlShift - { - Unroll = 0, - DontUnroll = 1, - DependencyInfinite = 2, - DependencyLength = 3, - } - - public enum LoopControlMask - { - MaskNone = 0, - Unroll = 0x00000001, - DontUnroll = 0x00000002, - DependencyInfinite = 0x00000004, - DependencyLength = 0x00000008, - } - - public enum FunctionControlShift - { - Inline = 0, - DontInline = 1, - Pure = 2, - Const = 3, - } - - public enum FunctionControlMask - { - MaskNone = 0, - Inline = 0x00000001, - DontInline = 0x00000002, - Pure = 0x00000004, - Const = 0x00000008, - } - - public enum MemorySemanticsShift - { - Acquire = 1, - Release = 2, - AcquireRelease = 3, - SequentiallyConsistent = 4, - UniformMemory = 6, - SubgroupMemory = 7, - WorkgroupMemory = 8, - CrossWorkgroupMemory = 9, - AtomicCounterMemory = 10, - ImageMemory = 11, - } - - public enum MemorySemanticsMask - { - MaskNone = 0, - Acquire = 0x00000002, - Release = 0x00000004, - AcquireRelease = 0x00000008, - SequentiallyConsistent = 0x00000010, - UniformMemory = 0x00000040, - SubgroupMemory = 0x00000080, - WorkgroupMemory = 0x00000100, - CrossWorkgroupMemory = 0x00000200, - AtomicCounterMemory = 0x00000400, - ImageMemory = 0x00000800, - } - - public enum MemoryAccessShift - { - Volatile = 0, - Aligned = 1, - Nontemporal = 2, - } - - public enum MemoryAccessMask - { - MaskNone = 0, - Volatile = 0x00000001, - Aligned = 0x00000002, - Nontemporal = 0x00000004, - } - - public enum Scope - { - CrossDevice = 0, - Device = 1, - Workgroup = 2, - Subgroup = 3, - Invocation = 4, - } - - public enum GroupOperation - { - Reduce = 0, - InclusiveScan = 1, - ExclusiveScan = 2, - } - - public enum KernelEnqueueFlags - { - NoWait = 0, - WaitKernel = 1, - WaitWorkGroup = 2, - } - - public enum KernelProfilingInfoShift - { - CmdExecTime = 0, - } - - public enum KernelProfilingInfoMask - { - MaskNone = 0, - CmdExecTime = 0x00000001, - } - - public enum Capability - { - Matrix = 0, - Shader = 1, - Geometry = 2, - Tessellation = 3, - Addresses = 4, - Linkage = 5, - Kernel = 6, - Vector16 = 7, - Float16Buffer = 8, - Float16 = 9, - Float64 = 10, - Int64 = 11, - Int64Atomics = 12, - ImageBasic = 13, - ImageReadWrite = 14, - ImageMipmap = 15, - Pipes = 17, - Groups = 18, - DeviceEnqueue = 19, - LiteralSampler = 20, - AtomicStorage = 21, - Int16 = 22, - TessellationPointSize = 23, - GeometryPointSize = 24, - ImageGatherExtended = 25, - StorageImageMultisample = 27, - UniformBufferArrayDynamicIndexing = 28, - SampledImageArrayDynamicIndexing = 29, - StorageBufferArrayDynamicIndexing = 30, - StorageImageArrayDynamicIndexing = 31, - ClipDistance = 32, - CullDistance = 33, - ImageCubeArray = 34, - SampleRateShading = 35, - ImageRect = 36, - SampledRect = 37, - GenericPointer = 38, - Int8 = 39, - InputAttachment = 40, - SparseResidency = 41, - MinLod = 42, - Sampled1D = 43, - Image1D = 44, - SampledCubeArray = 45, - SampledBuffer = 46, - ImageBuffer = 47, - ImageMSArray = 48, - StorageImageExtendedFormats = 49, - ImageQuery = 50, - DerivativeControl = 51, - InterpolationFunction = 52, - TransformFeedback = 53, - GeometryStreams = 54, - StorageImageReadWithoutFormat = 55, - StorageImageWriteWithoutFormat = 56, - MultiViewport = 57, - SubgroupDispatch = 58, - NamedBarrier = 59, - PipeStorage = 60, - SubgroupBallotKHR = 4423, - DrawParameters = 4427, - SubgroupVoteKHR = 4431, - StorageBuffer16BitAccess = 4433, - StorageUniformBufferBlock16 = 4433, - StorageUniform16 = 4434, - UniformAndStorageBuffer16BitAccess = 4434, - StoragePushConstant16 = 4435, - StorageInputOutput16 = 4436, - DeviceGroup = 4437, - MultiView = 4439, - VariablePointersStorageBuffer = 4441, - VariablePointers = 4442, - AtomicStorageOps = 4445, - SampleMaskPostDepthCoverage = 4447, - ImageGatherBiasLodAMD = 5009, - FragmentMaskAMD = 5010, - StencilExportEXT = 5013, - ImageReadWriteLodAMD = 5015, - SampleMaskOverrideCoverageNV = 5249, - GeometryShaderPassthroughNV = 5251, - ShaderViewportIndexLayerEXT = 5254, - ShaderViewportIndexLayerNV = 5254, - ShaderViewportMaskNV = 5255, - ShaderStereoViewNV = 5259, - PerViewAttributesNV = 5260, - SubgroupShuffleINTEL = 5568, - SubgroupBufferBlockIOINTEL = 5569, - SubgroupImageBlockIOINTEL = 5570, - } - - public enum Op - { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, - OpImageSparseRead = 320, - OpSizeOf = 321, - OpTypePipeStorage = 322, - OpConstantPipeStorage = 323, - OpCreatePipeFromPipeStorage = 324, - OpGetKernelLocalSizeForSubgroupCount = 325, - OpGetKernelMaxNumSubgroups = 326, - OpTypeNamedBarrier = 327, - OpNamedBarrierInitialize = 328, - OpMemoryNamedBarrier = 329, - OpModuleProcessed = 330, - OpDecorateId = 332, - OpSubgroupBallotKHR = 4421, - OpSubgroupFirstInvocationKHR = 4422, - OpSubgroupAllKHR = 4428, - OpSubgroupAnyKHR = 4429, - OpSubgroupAllEqualKHR = 4430, - OpSubgroupReadInvocationKHR = 4432, - OpGroupIAddNonUniformAMD = 5000, - OpGroupFAddNonUniformAMD = 5001, - OpGroupFMinNonUniformAMD = 5002, - OpGroupUMinNonUniformAMD = 5003, - OpGroupSMinNonUniformAMD = 5004, - OpGroupFMaxNonUniformAMD = 5005, - OpGroupUMaxNonUniformAMD = 5006, - OpGroupSMaxNonUniformAMD = 5007, - OpFragmentMaskFetchAMD = 5011, - OpFragmentFetchAMD = 5012, - OpSubgroupShuffleINTEL = 5571, - OpSubgroupShuffleDownINTEL = 5572, - OpSubgroupShuffleUpINTEL = 5573, - OpSubgroupShuffleXorINTEL = 5574, - OpSubgroupBlockReadINTEL = 5575, - OpSubgroupBlockWriteINTEL = 5576, - OpSubgroupImageBlockReadINTEL = 5577, - OpSubgroupImageBlockWriteINTEL = 5578, - OpDecorateStringGOOGLE = 5632, - OpMemberDecorateStringGOOGLE = 5633, - } - } -} - diff --git a/include/spirv/1.1/spirv.h b/include/spirv/1.1/spirv.h deleted file mode 100644 index 971c3be6..00000000 --- a/include/spirv/1.1/spirv.h +++ /dev/null @@ -1,1015 +0,0 @@ -/* -** Copyright (c) 2014-2018 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a copy -** of this software and/or associated documentation files (the "Materials"), -** to deal in the Materials without restriction, including without limitation -** the rights to use, copy, modify, merge, publish, distribute, sublicense, -** and/or sell copies of the Materials, and to permit persons to whom the -** Materials are furnished to do so, subject to the following conditions: -** -** The above copyright notice and this permission notice shall be included in -** all copies or substantial portions of the Materials. -** -** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -** IN THE MATERIALS. -*/ - -/* -** This header is automatically generated by the same tool that creates -** the Binary Section of the SPIR-V specification. -*/ - -/* -** Enumeration tokens for SPIR-V, in various styles: -** C, C++, C++11, JSON, Lua, Python -** -** - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -** - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -** - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -** - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -** - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -** -** Some tokens act like mask values, which can be OR'd together, -** while others are mutually exclusive. The mask-like ones have -** "Mask" in their name, and a parallel enum that has the shift -** amount (1 << x) for each corresponding enumerant. -*/ - -#ifndef spirv_H -#define spirv_H - -typedef unsigned int SpvId; - -#define SPV_VERSION 0x10100 -#define SPV_REVISION 8 - -static const unsigned int SpvMagicNumber = 0x07230203; -static const unsigned int SpvVersion = 0x00010100; -static const unsigned int SpvRevision = 8; -static const unsigned int SpvOpCodeMask = 0xffff; -static const unsigned int SpvWordCountShift = 16; - -typedef enum SpvSourceLanguage_ { - SpvSourceLanguageUnknown = 0, - SpvSourceLanguageESSL = 1, - SpvSourceLanguageGLSL = 2, - SpvSourceLanguageOpenCL_C = 3, - SpvSourceLanguageOpenCL_CPP = 4, - SpvSourceLanguageHLSL = 5, - SpvSourceLanguageMax = 0x7fffffff, -} SpvSourceLanguage; - -typedef enum SpvExecutionModel_ { - SpvExecutionModelVertex = 0, - SpvExecutionModelTessellationControl = 1, - SpvExecutionModelTessellationEvaluation = 2, - SpvExecutionModelGeometry = 3, - SpvExecutionModelFragment = 4, - SpvExecutionModelGLCompute = 5, - SpvExecutionModelKernel = 6, - SpvExecutionModelMax = 0x7fffffff, -} SpvExecutionModel; - -typedef enum SpvAddressingModel_ { - SpvAddressingModelLogical = 0, - SpvAddressingModelPhysical32 = 1, - SpvAddressingModelPhysical64 = 2, - SpvAddressingModelMax = 0x7fffffff, -} SpvAddressingModel; - -typedef enum SpvMemoryModel_ { - SpvMemoryModelSimple = 0, - SpvMemoryModelGLSL450 = 1, - SpvMemoryModelOpenCL = 2, - SpvMemoryModelMax = 0x7fffffff, -} SpvMemoryModel; - -typedef enum SpvExecutionMode_ { - SpvExecutionModeInvocations = 0, - SpvExecutionModeSpacingEqual = 1, - SpvExecutionModeSpacingFractionalEven = 2, - SpvExecutionModeSpacingFractionalOdd = 3, - SpvExecutionModeVertexOrderCw = 4, - SpvExecutionModeVertexOrderCcw = 5, - SpvExecutionModePixelCenterInteger = 6, - SpvExecutionModeOriginUpperLeft = 7, - SpvExecutionModeOriginLowerLeft = 8, - SpvExecutionModeEarlyFragmentTests = 9, - SpvExecutionModePointMode = 10, - SpvExecutionModeXfb = 11, - SpvExecutionModeDepthReplacing = 12, - SpvExecutionModeDepthGreater = 14, - SpvExecutionModeDepthLess = 15, - SpvExecutionModeDepthUnchanged = 16, - SpvExecutionModeLocalSize = 17, - SpvExecutionModeLocalSizeHint = 18, - SpvExecutionModeInputPoints = 19, - SpvExecutionModeInputLines = 20, - SpvExecutionModeInputLinesAdjacency = 21, - SpvExecutionModeTriangles = 22, - SpvExecutionModeInputTrianglesAdjacency = 23, - SpvExecutionModeQuads = 24, - SpvExecutionModeIsolines = 25, - SpvExecutionModeOutputVertices = 26, - SpvExecutionModeOutputPoints = 27, - SpvExecutionModeOutputLineStrip = 28, - SpvExecutionModeOutputTriangleStrip = 29, - SpvExecutionModeVecTypeHint = 30, - SpvExecutionModeContractionOff = 31, - SpvExecutionModeInitializer = 33, - SpvExecutionModeFinalizer = 34, - SpvExecutionModeSubgroupSize = 35, - SpvExecutionModeSubgroupsPerWorkgroup = 36, - SpvExecutionModePostDepthCoverage = 4446, - SpvExecutionModeStencilRefReplacingEXT = 5027, - SpvExecutionModeMax = 0x7fffffff, -} SpvExecutionMode; - -typedef enum SpvStorageClass_ { - SpvStorageClassUniformConstant = 0, - SpvStorageClassInput = 1, - SpvStorageClassUniform = 2, - SpvStorageClassOutput = 3, - SpvStorageClassWorkgroup = 4, - SpvStorageClassCrossWorkgroup = 5, - SpvStorageClassPrivate = 6, - SpvStorageClassFunction = 7, - SpvStorageClassGeneric = 8, - SpvStorageClassPushConstant = 9, - SpvStorageClassAtomicCounter = 10, - SpvStorageClassImage = 11, - SpvStorageClassStorageBuffer = 12, - SpvStorageClassMax = 0x7fffffff, -} SpvStorageClass; - -typedef enum SpvDim_ { - SpvDim1D = 0, - SpvDim2D = 1, - SpvDim3D = 2, - SpvDimCube = 3, - SpvDimRect = 4, - SpvDimBuffer = 5, - SpvDimSubpassData = 6, - SpvDimMax = 0x7fffffff, -} SpvDim; - -typedef enum SpvSamplerAddressingMode_ { - SpvSamplerAddressingModeNone = 0, - SpvSamplerAddressingModeClampToEdge = 1, - SpvSamplerAddressingModeClamp = 2, - SpvSamplerAddressingModeRepeat = 3, - SpvSamplerAddressingModeRepeatMirrored = 4, - SpvSamplerAddressingModeMax = 0x7fffffff, -} SpvSamplerAddressingMode; - -typedef enum SpvSamplerFilterMode_ { - SpvSamplerFilterModeNearest = 0, - SpvSamplerFilterModeLinear = 1, - SpvSamplerFilterModeMax = 0x7fffffff, -} SpvSamplerFilterMode; - -typedef enum SpvImageFormat_ { - SpvImageFormatUnknown = 0, - SpvImageFormatRgba32f = 1, - SpvImageFormatRgba16f = 2, - SpvImageFormatR32f = 3, - SpvImageFormatRgba8 = 4, - SpvImageFormatRgba8Snorm = 5, - SpvImageFormatRg32f = 6, - SpvImageFormatRg16f = 7, - SpvImageFormatR11fG11fB10f = 8, - SpvImageFormatR16f = 9, - SpvImageFormatRgba16 = 10, - SpvImageFormatRgb10A2 = 11, - SpvImageFormatRg16 = 12, - SpvImageFormatRg8 = 13, - SpvImageFormatR16 = 14, - SpvImageFormatR8 = 15, - SpvImageFormatRgba16Snorm = 16, - SpvImageFormatRg16Snorm = 17, - SpvImageFormatRg8Snorm = 18, - SpvImageFormatR16Snorm = 19, - SpvImageFormatR8Snorm = 20, - SpvImageFormatRgba32i = 21, - SpvImageFormatRgba16i = 22, - SpvImageFormatRgba8i = 23, - SpvImageFormatR32i = 24, - SpvImageFormatRg32i = 25, - SpvImageFormatRg16i = 26, - SpvImageFormatRg8i = 27, - SpvImageFormatR16i = 28, - SpvImageFormatR8i = 29, - SpvImageFormatRgba32ui = 30, - SpvImageFormatRgba16ui = 31, - SpvImageFormatRgba8ui = 32, - SpvImageFormatR32ui = 33, - SpvImageFormatRgb10a2ui = 34, - SpvImageFormatRg32ui = 35, - SpvImageFormatRg16ui = 36, - SpvImageFormatRg8ui = 37, - SpvImageFormatR16ui = 38, - SpvImageFormatR8ui = 39, - SpvImageFormatMax = 0x7fffffff, -} SpvImageFormat; - -typedef enum SpvImageChannelOrder_ { - SpvImageChannelOrderR = 0, - SpvImageChannelOrderA = 1, - SpvImageChannelOrderRG = 2, - SpvImageChannelOrderRA = 3, - SpvImageChannelOrderRGB = 4, - SpvImageChannelOrderRGBA = 5, - SpvImageChannelOrderBGRA = 6, - SpvImageChannelOrderARGB = 7, - SpvImageChannelOrderIntensity = 8, - SpvImageChannelOrderLuminance = 9, - SpvImageChannelOrderRx = 10, - SpvImageChannelOrderRGx = 11, - SpvImageChannelOrderRGBx = 12, - SpvImageChannelOrderDepth = 13, - SpvImageChannelOrderDepthStencil = 14, - SpvImageChannelOrdersRGB = 15, - SpvImageChannelOrdersRGBx = 16, - SpvImageChannelOrdersRGBA = 17, - SpvImageChannelOrdersBGRA = 18, - SpvImageChannelOrderABGR = 19, - SpvImageChannelOrderMax = 0x7fffffff, -} SpvImageChannelOrder; - -typedef enum SpvImageChannelDataType_ { - SpvImageChannelDataTypeSnormInt8 = 0, - SpvImageChannelDataTypeSnormInt16 = 1, - SpvImageChannelDataTypeUnormInt8 = 2, - SpvImageChannelDataTypeUnormInt16 = 3, - SpvImageChannelDataTypeUnormShort565 = 4, - SpvImageChannelDataTypeUnormShort555 = 5, - SpvImageChannelDataTypeUnormInt101010 = 6, - SpvImageChannelDataTypeSignedInt8 = 7, - SpvImageChannelDataTypeSignedInt16 = 8, - SpvImageChannelDataTypeSignedInt32 = 9, - SpvImageChannelDataTypeUnsignedInt8 = 10, - SpvImageChannelDataTypeUnsignedInt16 = 11, - SpvImageChannelDataTypeUnsignedInt32 = 12, - SpvImageChannelDataTypeHalfFloat = 13, - SpvImageChannelDataTypeFloat = 14, - SpvImageChannelDataTypeUnormInt24 = 15, - SpvImageChannelDataTypeUnormInt101010_2 = 16, - SpvImageChannelDataTypeMax = 0x7fffffff, -} SpvImageChannelDataType; - -typedef enum SpvImageOperandsShift_ { - SpvImageOperandsBiasShift = 0, - SpvImageOperandsLodShift = 1, - SpvImageOperandsGradShift = 2, - SpvImageOperandsConstOffsetShift = 3, - SpvImageOperandsOffsetShift = 4, - SpvImageOperandsConstOffsetsShift = 5, - SpvImageOperandsSampleShift = 6, - SpvImageOperandsMinLodShift = 7, - SpvImageOperandsMax = 0x7fffffff, -} SpvImageOperandsShift; - -typedef enum SpvImageOperandsMask_ { - SpvImageOperandsMaskNone = 0, - SpvImageOperandsBiasMask = 0x00000001, - SpvImageOperandsLodMask = 0x00000002, - SpvImageOperandsGradMask = 0x00000004, - SpvImageOperandsConstOffsetMask = 0x00000008, - SpvImageOperandsOffsetMask = 0x00000010, - SpvImageOperandsConstOffsetsMask = 0x00000020, - SpvImageOperandsSampleMask = 0x00000040, - SpvImageOperandsMinLodMask = 0x00000080, -} SpvImageOperandsMask; - -typedef enum SpvFPFastMathModeShift_ { - SpvFPFastMathModeNotNaNShift = 0, - SpvFPFastMathModeNotInfShift = 1, - SpvFPFastMathModeNSZShift = 2, - SpvFPFastMathModeAllowRecipShift = 3, - SpvFPFastMathModeFastShift = 4, - SpvFPFastMathModeMax = 0x7fffffff, -} SpvFPFastMathModeShift; - -typedef enum SpvFPFastMathModeMask_ { - SpvFPFastMathModeMaskNone = 0, - SpvFPFastMathModeNotNaNMask = 0x00000001, - SpvFPFastMathModeNotInfMask = 0x00000002, - SpvFPFastMathModeNSZMask = 0x00000004, - SpvFPFastMathModeAllowRecipMask = 0x00000008, - SpvFPFastMathModeFastMask = 0x00000010, -} SpvFPFastMathModeMask; - -typedef enum SpvFPRoundingMode_ { - SpvFPRoundingModeRTE = 0, - SpvFPRoundingModeRTZ = 1, - SpvFPRoundingModeRTP = 2, - SpvFPRoundingModeRTN = 3, - SpvFPRoundingModeMax = 0x7fffffff, -} SpvFPRoundingMode; - -typedef enum SpvLinkageType_ { - SpvLinkageTypeExport = 0, - SpvLinkageTypeImport = 1, - SpvLinkageTypeMax = 0x7fffffff, -} SpvLinkageType; - -typedef enum SpvAccessQualifier_ { - SpvAccessQualifierReadOnly = 0, - SpvAccessQualifierWriteOnly = 1, - SpvAccessQualifierReadWrite = 2, - SpvAccessQualifierMax = 0x7fffffff, -} SpvAccessQualifier; - -typedef enum SpvFunctionParameterAttribute_ { - SpvFunctionParameterAttributeZext = 0, - SpvFunctionParameterAttributeSext = 1, - SpvFunctionParameterAttributeByVal = 2, - SpvFunctionParameterAttributeSret = 3, - SpvFunctionParameterAttributeNoAlias = 4, - SpvFunctionParameterAttributeNoCapture = 5, - SpvFunctionParameterAttributeNoWrite = 6, - SpvFunctionParameterAttributeNoReadWrite = 7, - SpvFunctionParameterAttributeMax = 0x7fffffff, -} SpvFunctionParameterAttribute; - -typedef enum SpvDecoration_ { - SpvDecorationRelaxedPrecision = 0, - SpvDecorationSpecId = 1, - SpvDecorationBlock = 2, - SpvDecorationBufferBlock = 3, - SpvDecorationRowMajor = 4, - SpvDecorationColMajor = 5, - SpvDecorationArrayStride = 6, - SpvDecorationMatrixStride = 7, - SpvDecorationGLSLShared = 8, - SpvDecorationGLSLPacked = 9, - SpvDecorationCPacked = 10, - SpvDecorationBuiltIn = 11, - SpvDecorationNoPerspective = 13, - SpvDecorationFlat = 14, - SpvDecorationPatch = 15, - SpvDecorationCentroid = 16, - SpvDecorationSample = 17, - SpvDecorationInvariant = 18, - SpvDecorationRestrict = 19, - SpvDecorationAliased = 20, - SpvDecorationVolatile = 21, - SpvDecorationConstant = 22, - SpvDecorationCoherent = 23, - SpvDecorationNonWritable = 24, - SpvDecorationNonReadable = 25, - SpvDecorationUniform = 26, - SpvDecorationSaturatedConversion = 28, - SpvDecorationStream = 29, - SpvDecorationLocation = 30, - SpvDecorationComponent = 31, - SpvDecorationIndex = 32, - SpvDecorationBinding = 33, - SpvDecorationDescriptorSet = 34, - SpvDecorationOffset = 35, - SpvDecorationXfbBuffer = 36, - SpvDecorationXfbStride = 37, - SpvDecorationFuncParamAttr = 38, - SpvDecorationFPRoundingMode = 39, - SpvDecorationFPFastMathMode = 40, - SpvDecorationLinkageAttributes = 41, - SpvDecorationNoContraction = 42, - SpvDecorationInputAttachmentIndex = 43, - SpvDecorationAlignment = 44, - SpvDecorationMaxByteOffset = 45, - SpvDecorationExplicitInterpAMD = 4999, - SpvDecorationOverrideCoverageNV = 5248, - SpvDecorationPassthroughNV = 5250, - SpvDecorationViewportRelativeNV = 5252, - SpvDecorationSecondaryViewportRelativeNV = 5256, - SpvDecorationHlslCounterBufferGOOGLE = 5634, - SpvDecorationHlslSemanticGOOGLE = 5635, - SpvDecorationMax = 0x7fffffff, -} SpvDecoration; - -typedef enum SpvBuiltIn_ { - SpvBuiltInPosition = 0, - SpvBuiltInPointSize = 1, - SpvBuiltInClipDistance = 3, - SpvBuiltInCullDistance = 4, - SpvBuiltInVertexId = 5, - SpvBuiltInInstanceId = 6, - SpvBuiltInPrimitiveId = 7, - SpvBuiltInInvocationId = 8, - SpvBuiltInLayer = 9, - SpvBuiltInViewportIndex = 10, - SpvBuiltInTessLevelOuter = 11, - SpvBuiltInTessLevelInner = 12, - SpvBuiltInTessCoord = 13, - SpvBuiltInPatchVertices = 14, - SpvBuiltInFragCoord = 15, - SpvBuiltInPointCoord = 16, - SpvBuiltInFrontFacing = 17, - SpvBuiltInSampleId = 18, - SpvBuiltInSamplePosition = 19, - SpvBuiltInSampleMask = 20, - SpvBuiltInFragDepth = 22, - SpvBuiltInHelperInvocation = 23, - SpvBuiltInNumWorkgroups = 24, - SpvBuiltInWorkgroupSize = 25, - SpvBuiltInWorkgroupId = 26, - SpvBuiltInLocalInvocationId = 27, - SpvBuiltInGlobalInvocationId = 28, - SpvBuiltInLocalInvocationIndex = 29, - SpvBuiltInWorkDim = 30, - SpvBuiltInGlobalSize = 31, - SpvBuiltInEnqueuedWorkgroupSize = 32, - SpvBuiltInGlobalOffset = 33, - SpvBuiltInGlobalLinearId = 34, - SpvBuiltInSubgroupSize = 36, - SpvBuiltInSubgroupMaxSize = 37, - SpvBuiltInNumSubgroups = 38, - SpvBuiltInNumEnqueuedSubgroups = 39, - SpvBuiltInSubgroupId = 40, - SpvBuiltInSubgroupLocalInvocationId = 41, - SpvBuiltInVertexIndex = 42, - SpvBuiltInInstanceIndex = 43, - SpvBuiltInSubgroupEqMaskKHR = 4416, - SpvBuiltInSubgroupGeMaskKHR = 4417, - SpvBuiltInSubgroupGtMaskKHR = 4418, - SpvBuiltInSubgroupLeMaskKHR = 4419, - SpvBuiltInSubgroupLtMaskKHR = 4420, - SpvBuiltInBaseVertex = 4424, - SpvBuiltInBaseInstance = 4425, - SpvBuiltInDrawIndex = 4426, - SpvBuiltInDeviceIndex = 4438, - SpvBuiltInViewIndex = 4440, - SpvBuiltInBaryCoordNoPerspAMD = 4992, - SpvBuiltInBaryCoordNoPerspCentroidAMD = 4993, - SpvBuiltInBaryCoordNoPerspSampleAMD = 4994, - SpvBuiltInBaryCoordSmoothAMD = 4995, - SpvBuiltInBaryCoordSmoothCentroidAMD = 4996, - SpvBuiltInBaryCoordSmoothSampleAMD = 4997, - SpvBuiltInBaryCoordPullModelAMD = 4998, - SpvBuiltInFragStencilRefEXT = 5014, - SpvBuiltInViewportMaskNV = 5253, - SpvBuiltInSecondaryPositionNV = 5257, - SpvBuiltInSecondaryViewportMaskNV = 5258, - SpvBuiltInPositionPerViewNV = 5261, - SpvBuiltInViewportMaskPerViewNV = 5262, - SpvBuiltInMax = 0x7fffffff, -} SpvBuiltIn; - -typedef enum SpvSelectionControlShift_ { - SpvSelectionControlFlattenShift = 0, - SpvSelectionControlDontFlattenShift = 1, - SpvSelectionControlMax = 0x7fffffff, -} SpvSelectionControlShift; - -typedef enum SpvSelectionControlMask_ { - SpvSelectionControlMaskNone = 0, - SpvSelectionControlFlattenMask = 0x00000001, - SpvSelectionControlDontFlattenMask = 0x00000002, -} SpvSelectionControlMask; - -typedef enum SpvLoopControlShift_ { - SpvLoopControlUnrollShift = 0, - SpvLoopControlDontUnrollShift = 1, - SpvLoopControlDependencyInfiniteShift = 2, - SpvLoopControlDependencyLengthShift = 3, - SpvLoopControlMax = 0x7fffffff, -} SpvLoopControlShift; - -typedef enum SpvLoopControlMask_ { - SpvLoopControlMaskNone = 0, - SpvLoopControlUnrollMask = 0x00000001, - SpvLoopControlDontUnrollMask = 0x00000002, - SpvLoopControlDependencyInfiniteMask = 0x00000004, - SpvLoopControlDependencyLengthMask = 0x00000008, -} SpvLoopControlMask; - -typedef enum SpvFunctionControlShift_ { - SpvFunctionControlInlineShift = 0, - SpvFunctionControlDontInlineShift = 1, - SpvFunctionControlPureShift = 2, - SpvFunctionControlConstShift = 3, - SpvFunctionControlMax = 0x7fffffff, -} SpvFunctionControlShift; - -typedef enum SpvFunctionControlMask_ { - SpvFunctionControlMaskNone = 0, - SpvFunctionControlInlineMask = 0x00000001, - SpvFunctionControlDontInlineMask = 0x00000002, - SpvFunctionControlPureMask = 0x00000004, - SpvFunctionControlConstMask = 0x00000008, -} SpvFunctionControlMask; - -typedef enum SpvMemorySemanticsShift_ { - SpvMemorySemanticsAcquireShift = 1, - SpvMemorySemanticsReleaseShift = 2, - SpvMemorySemanticsAcquireReleaseShift = 3, - SpvMemorySemanticsSequentiallyConsistentShift = 4, - SpvMemorySemanticsUniformMemoryShift = 6, - SpvMemorySemanticsSubgroupMemoryShift = 7, - SpvMemorySemanticsWorkgroupMemoryShift = 8, - SpvMemorySemanticsCrossWorkgroupMemoryShift = 9, - SpvMemorySemanticsAtomicCounterMemoryShift = 10, - SpvMemorySemanticsImageMemoryShift = 11, - SpvMemorySemanticsMax = 0x7fffffff, -} SpvMemorySemanticsShift; - -typedef enum SpvMemorySemanticsMask_ { - SpvMemorySemanticsMaskNone = 0, - SpvMemorySemanticsAcquireMask = 0x00000002, - SpvMemorySemanticsReleaseMask = 0x00000004, - SpvMemorySemanticsAcquireReleaseMask = 0x00000008, - SpvMemorySemanticsSequentiallyConsistentMask = 0x00000010, - SpvMemorySemanticsUniformMemoryMask = 0x00000040, - SpvMemorySemanticsSubgroupMemoryMask = 0x00000080, - SpvMemorySemanticsWorkgroupMemoryMask = 0x00000100, - SpvMemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, - SpvMemorySemanticsAtomicCounterMemoryMask = 0x00000400, - SpvMemorySemanticsImageMemoryMask = 0x00000800, -} SpvMemorySemanticsMask; - -typedef enum SpvMemoryAccessShift_ { - SpvMemoryAccessVolatileShift = 0, - SpvMemoryAccessAlignedShift = 1, - SpvMemoryAccessNontemporalShift = 2, - SpvMemoryAccessMax = 0x7fffffff, -} SpvMemoryAccessShift; - -typedef enum SpvMemoryAccessMask_ { - SpvMemoryAccessMaskNone = 0, - SpvMemoryAccessVolatileMask = 0x00000001, - SpvMemoryAccessAlignedMask = 0x00000002, - SpvMemoryAccessNontemporalMask = 0x00000004, -} SpvMemoryAccessMask; - -typedef enum SpvScope_ { - SpvScopeCrossDevice = 0, - SpvScopeDevice = 1, - SpvScopeWorkgroup = 2, - SpvScopeSubgroup = 3, - SpvScopeInvocation = 4, - SpvScopeMax = 0x7fffffff, -} SpvScope; - -typedef enum SpvGroupOperation_ { - SpvGroupOperationReduce = 0, - SpvGroupOperationInclusiveScan = 1, - SpvGroupOperationExclusiveScan = 2, - SpvGroupOperationMax = 0x7fffffff, -} SpvGroupOperation; - -typedef enum SpvKernelEnqueueFlags_ { - SpvKernelEnqueueFlagsNoWait = 0, - SpvKernelEnqueueFlagsWaitKernel = 1, - SpvKernelEnqueueFlagsWaitWorkGroup = 2, - SpvKernelEnqueueFlagsMax = 0x7fffffff, -} SpvKernelEnqueueFlags; - -typedef enum SpvKernelProfilingInfoShift_ { - SpvKernelProfilingInfoCmdExecTimeShift = 0, - SpvKernelProfilingInfoMax = 0x7fffffff, -} SpvKernelProfilingInfoShift; - -typedef enum SpvKernelProfilingInfoMask_ { - SpvKernelProfilingInfoMaskNone = 0, - SpvKernelProfilingInfoCmdExecTimeMask = 0x00000001, -} SpvKernelProfilingInfoMask; - -typedef enum SpvCapability_ { - SpvCapabilityMatrix = 0, - SpvCapabilityShader = 1, - SpvCapabilityGeometry = 2, - SpvCapabilityTessellation = 3, - SpvCapabilityAddresses = 4, - SpvCapabilityLinkage = 5, - SpvCapabilityKernel = 6, - SpvCapabilityVector16 = 7, - SpvCapabilityFloat16Buffer = 8, - SpvCapabilityFloat16 = 9, - SpvCapabilityFloat64 = 10, - SpvCapabilityInt64 = 11, - SpvCapabilityInt64Atomics = 12, - SpvCapabilityImageBasic = 13, - SpvCapabilityImageReadWrite = 14, - SpvCapabilityImageMipmap = 15, - SpvCapabilityPipes = 17, - SpvCapabilityGroups = 18, - SpvCapabilityDeviceEnqueue = 19, - SpvCapabilityLiteralSampler = 20, - SpvCapabilityAtomicStorage = 21, - SpvCapabilityInt16 = 22, - SpvCapabilityTessellationPointSize = 23, - SpvCapabilityGeometryPointSize = 24, - SpvCapabilityImageGatherExtended = 25, - SpvCapabilityStorageImageMultisample = 27, - SpvCapabilityUniformBufferArrayDynamicIndexing = 28, - SpvCapabilitySampledImageArrayDynamicIndexing = 29, - SpvCapabilityStorageBufferArrayDynamicIndexing = 30, - SpvCapabilityStorageImageArrayDynamicIndexing = 31, - SpvCapabilityClipDistance = 32, - SpvCapabilityCullDistance = 33, - SpvCapabilityImageCubeArray = 34, - SpvCapabilitySampleRateShading = 35, - SpvCapabilityImageRect = 36, - SpvCapabilitySampledRect = 37, - SpvCapabilityGenericPointer = 38, - SpvCapabilityInt8 = 39, - SpvCapabilityInputAttachment = 40, - SpvCapabilitySparseResidency = 41, - SpvCapabilityMinLod = 42, - SpvCapabilitySampled1D = 43, - SpvCapabilityImage1D = 44, - SpvCapabilitySampledCubeArray = 45, - SpvCapabilitySampledBuffer = 46, - SpvCapabilityImageBuffer = 47, - SpvCapabilityImageMSArray = 48, - SpvCapabilityStorageImageExtendedFormats = 49, - SpvCapabilityImageQuery = 50, - SpvCapabilityDerivativeControl = 51, - SpvCapabilityInterpolationFunction = 52, - SpvCapabilityTransformFeedback = 53, - SpvCapabilityGeometryStreams = 54, - SpvCapabilityStorageImageReadWithoutFormat = 55, - SpvCapabilityStorageImageWriteWithoutFormat = 56, - SpvCapabilityMultiViewport = 57, - SpvCapabilitySubgroupDispatch = 58, - SpvCapabilityNamedBarrier = 59, - SpvCapabilityPipeStorage = 60, - SpvCapabilitySubgroupBallotKHR = 4423, - SpvCapabilityDrawParameters = 4427, - SpvCapabilitySubgroupVoteKHR = 4431, - SpvCapabilityStorageBuffer16BitAccess = 4433, - SpvCapabilityStorageUniformBufferBlock16 = 4433, - SpvCapabilityStorageUniform16 = 4434, - SpvCapabilityUniformAndStorageBuffer16BitAccess = 4434, - SpvCapabilityStoragePushConstant16 = 4435, - SpvCapabilityStorageInputOutput16 = 4436, - SpvCapabilityDeviceGroup = 4437, - SpvCapabilityMultiView = 4439, - SpvCapabilityVariablePointersStorageBuffer = 4441, - SpvCapabilityVariablePointers = 4442, - SpvCapabilityAtomicStorageOps = 4445, - SpvCapabilitySampleMaskPostDepthCoverage = 4447, - SpvCapabilityImageGatherBiasLodAMD = 5009, - SpvCapabilityFragmentMaskAMD = 5010, - SpvCapabilityStencilExportEXT = 5013, - SpvCapabilityImageReadWriteLodAMD = 5015, - SpvCapabilitySampleMaskOverrideCoverageNV = 5249, - SpvCapabilityGeometryShaderPassthroughNV = 5251, - SpvCapabilityShaderViewportIndexLayerEXT = 5254, - SpvCapabilityShaderViewportIndexLayerNV = 5254, - SpvCapabilityShaderViewportMaskNV = 5255, - SpvCapabilityShaderStereoViewNV = 5259, - SpvCapabilityPerViewAttributesNV = 5260, - SpvCapabilitySubgroupShuffleINTEL = 5568, - SpvCapabilitySubgroupBufferBlockIOINTEL = 5569, - SpvCapabilitySubgroupImageBlockIOINTEL = 5570, - SpvCapabilityMax = 0x7fffffff, -} SpvCapability; - -typedef enum SpvOp_ { - SpvOpNop = 0, - SpvOpUndef = 1, - SpvOpSourceContinued = 2, - SpvOpSource = 3, - SpvOpSourceExtension = 4, - SpvOpName = 5, - SpvOpMemberName = 6, - SpvOpString = 7, - SpvOpLine = 8, - SpvOpExtension = 10, - SpvOpExtInstImport = 11, - SpvOpExtInst = 12, - SpvOpMemoryModel = 14, - SpvOpEntryPoint = 15, - SpvOpExecutionMode = 16, - SpvOpCapability = 17, - SpvOpTypeVoid = 19, - SpvOpTypeBool = 20, - SpvOpTypeInt = 21, - SpvOpTypeFloat = 22, - SpvOpTypeVector = 23, - SpvOpTypeMatrix = 24, - SpvOpTypeImage = 25, - SpvOpTypeSampler = 26, - SpvOpTypeSampledImage = 27, - SpvOpTypeArray = 28, - SpvOpTypeRuntimeArray = 29, - SpvOpTypeStruct = 30, - SpvOpTypeOpaque = 31, - SpvOpTypePointer = 32, - SpvOpTypeFunction = 33, - SpvOpTypeEvent = 34, - SpvOpTypeDeviceEvent = 35, - SpvOpTypeReserveId = 36, - SpvOpTypeQueue = 37, - SpvOpTypePipe = 38, - SpvOpTypeForwardPointer = 39, - SpvOpConstantTrue = 41, - SpvOpConstantFalse = 42, - SpvOpConstant = 43, - SpvOpConstantComposite = 44, - SpvOpConstantSampler = 45, - SpvOpConstantNull = 46, - SpvOpSpecConstantTrue = 48, - SpvOpSpecConstantFalse = 49, - SpvOpSpecConstant = 50, - SpvOpSpecConstantComposite = 51, - SpvOpSpecConstantOp = 52, - SpvOpFunction = 54, - SpvOpFunctionParameter = 55, - SpvOpFunctionEnd = 56, - SpvOpFunctionCall = 57, - SpvOpVariable = 59, - SpvOpImageTexelPointer = 60, - SpvOpLoad = 61, - SpvOpStore = 62, - SpvOpCopyMemory = 63, - SpvOpCopyMemorySized = 64, - SpvOpAccessChain = 65, - SpvOpInBoundsAccessChain = 66, - SpvOpPtrAccessChain = 67, - SpvOpArrayLength = 68, - SpvOpGenericPtrMemSemantics = 69, - SpvOpInBoundsPtrAccessChain = 70, - SpvOpDecorate = 71, - SpvOpMemberDecorate = 72, - SpvOpDecorationGroup = 73, - SpvOpGroupDecorate = 74, - SpvOpGroupMemberDecorate = 75, - SpvOpVectorExtractDynamic = 77, - SpvOpVectorInsertDynamic = 78, - SpvOpVectorShuffle = 79, - SpvOpCompositeConstruct = 80, - SpvOpCompositeExtract = 81, - SpvOpCompositeInsert = 82, - SpvOpCopyObject = 83, - SpvOpTranspose = 84, - SpvOpSampledImage = 86, - SpvOpImageSampleImplicitLod = 87, - SpvOpImageSampleExplicitLod = 88, - SpvOpImageSampleDrefImplicitLod = 89, - SpvOpImageSampleDrefExplicitLod = 90, - SpvOpImageSampleProjImplicitLod = 91, - SpvOpImageSampleProjExplicitLod = 92, - SpvOpImageSampleProjDrefImplicitLod = 93, - SpvOpImageSampleProjDrefExplicitLod = 94, - SpvOpImageFetch = 95, - SpvOpImageGather = 96, - SpvOpImageDrefGather = 97, - SpvOpImageRead = 98, - SpvOpImageWrite = 99, - SpvOpImage = 100, - SpvOpImageQueryFormat = 101, - SpvOpImageQueryOrder = 102, - SpvOpImageQuerySizeLod = 103, - SpvOpImageQuerySize = 104, - SpvOpImageQueryLod = 105, - SpvOpImageQueryLevels = 106, - SpvOpImageQuerySamples = 107, - SpvOpConvertFToU = 109, - SpvOpConvertFToS = 110, - SpvOpConvertSToF = 111, - SpvOpConvertUToF = 112, - SpvOpUConvert = 113, - SpvOpSConvert = 114, - SpvOpFConvert = 115, - SpvOpQuantizeToF16 = 116, - SpvOpConvertPtrToU = 117, - SpvOpSatConvertSToU = 118, - SpvOpSatConvertUToS = 119, - SpvOpConvertUToPtr = 120, - SpvOpPtrCastToGeneric = 121, - SpvOpGenericCastToPtr = 122, - SpvOpGenericCastToPtrExplicit = 123, - SpvOpBitcast = 124, - SpvOpSNegate = 126, - SpvOpFNegate = 127, - SpvOpIAdd = 128, - SpvOpFAdd = 129, - SpvOpISub = 130, - SpvOpFSub = 131, - SpvOpIMul = 132, - SpvOpFMul = 133, - SpvOpUDiv = 134, - SpvOpSDiv = 135, - SpvOpFDiv = 136, - SpvOpUMod = 137, - SpvOpSRem = 138, - SpvOpSMod = 139, - SpvOpFRem = 140, - SpvOpFMod = 141, - SpvOpVectorTimesScalar = 142, - SpvOpMatrixTimesScalar = 143, - SpvOpVectorTimesMatrix = 144, - SpvOpMatrixTimesVector = 145, - SpvOpMatrixTimesMatrix = 146, - SpvOpOuterProduct = 147, - SpvOpDot = 148, - SpvOpIAddCarry = 149, - SpvOpISubBorrow = 150, - SpvOpUMulExtended = 151, - SpvOpSMulExtended = 152, - SpvOpAny = 154, - SpvOpAll = 155, - SpvOpIsNan = 156, - SpvOpIsInf = 157, - SpvOpIsFinite = 158, - SpvOpIsNormal = 159, - SpvOpSignBitSet = 160, - SpvOpLessOrGreater = 161, - SpvOpOrdered = 162, - SpvOpUnordered = 163, - SpvOpLogicalEqual = 164, - SpvOpLogicalNotEqual = 165, - SpvOpLogicalOr = 166, - SpvOpLogicalAnd = 167, - SpvOpLogicalNot = 168, - SpvOpSelect = 169, - SpvOpIEqual = 170, - SpvOpINotEqual = 171, - SpvOpUGreaterThan = 172, - SpvOpSGreaterThan = 173, - SpvOpUGreaterThanEqual = 174, - SpvOpSGreaterThanEqual = 175, - SpvOpULessThan = 176, - SpvOpSLessThan = 177, - SpvOpULessThanEqual = 178, - SpvOpSLessThanEqual = 179, - SpvOpFOrdEqual = 180, - SpvOpFUnordEqual = 181, - SpvOpFOrdNotEqual = 182, - SpvOpFUnordNotEqual = 183, - SpvOpFOrdLessThan = 184, - SpvOpFUnordLessThan = 185, - SpvOpFOrdGreaterThan = 186, - SpvOpFUnordGreaterThan = 187, - SpvOpFOrdLessThanEqual = 188, - SpvOpFUnordLessThanEqual = 189, - SpvOpFOrdGreaterThanEqual = 190, - SpvOpFUnordGreaterThanEqual = 191, - SpvOpShiftRightLogical = 194, - SpvOpShiftRightArithmetic = 195, - SpvOpShiftLeftLogical = 196, - SpvOpBitwiseOr = 197, - SpvOpBitwiseXor = 198, - SpvOpBitwiseAnd = 199, - SpvOpNot = 200, - SpvOpBitFieldInsert = 201, - SpvOpBitFieldSExtract = 202, - SpvOpBitFieldUExtract = 203, - SpvOpBitReverse = 204, - SpvOpBitCount = 205, - SpvOpDPdx = 207, - SpvOpDPdy = 208, - SpvOpFwidth = 209, - SpvOpDPdxFine = 210, - SpvOpDPdyFine = 211, - SpvOpFwidthFine = 212, - SpvOpDPdxCoarse = 213, - SpvOpDPdyCoarse = 214, - SpvOpFwidthCoarse = 215, - SpvOpEmitVertex = 218, - SpvOpEndPrimitive = 219, - SpvOpEmitStreamVertex = 220, - SpvOpEndStreamPrimitive = 221, - SpvOpControlBarrier = 224, - SpvOpMemoryBarrier = 225, - SpvOpAtomicLoad = 227, - SpvOpAtomicStore = 228, - SpvOpAtomicExchange = 229, - SpvOpAtomicCompareExchange = 230, - SpvOpAtomicCompareExchangeWeak = 231, - SpvOpAtomicIIncrement = 232, - SpvOpAtomicIDecrement = 233, - SpvOpAtomicIAdd = 234, - SpvOpAtomicISub = 235, - SpvOpAtomicSMin = 236, - SpvOpAtomicUMin = 237, - SpvOpAtomicSMax = 238, - SpvOpAtomicUMax = 239, - SpvOpAtomicAnd = 240, - SpvOpAtomicOr = 241, - SpvOpAtomicXor = 242, - SpvOpPhi = 245, - SpvOpLoopMerge = 246, - SpvOpSelectionMerge = 247, - SpvOpLabel = 248, - SpvOpBranch = 249, - SpvOpBranchConditional = 250, - SpvOpSwitch = 251, - SpvOpKill = 252, - SpvOpReturn = 253, - SpvOpReturnValue = 254, - SpvOpUnreachable = 255, - SpvOpLifetimeStart = 256, - SpvOpLifetimeStop = 257, - SpvOpGroupAsyncCopy = 259, - SpvOpGroupWaitEvents = 260, - SpvOpGroupAll = 261, - SpvOpGroupAny = 262, - SpvOpGroupBroadcast = 263, - SpvOpGroupIAdd = 264, - SpvOpGroupFAdd = 265, - SpvOpGroupFMin = 266, - SpvOpGroupUMin = 267, - SpvOpGroupSMin = 268, - SpvOpGroupFMax = 269, - SpvOpGroupUMax = 270, - SpvOpGroupSMax = 271, - SpvOpReadPipe = 274, - SpvOpWritePipe = 275, - SpvOpReservedReadPipe = 276, - SpvOpReservedWritePipe = 277, - SpvOpReserveReadPipePackets = 278, - SpvOpReserveWritePipePackets = 279, - SpvOpCommitReadPipe = 280, - SpvOpCommitWritePipe = 281, - SpvOpIsValidReserveId = 282, - SpvOpGetNumPipePackets = 283, - SpvOpGetMaxPipePackets = 284, - SpvOpGroupReserveReadPipePackets = 285, - SpvOpGroupReserveWritePipePackets = 286, - SpvOpGroupCommitReadPipe = 287, - SpvOpGroupCommitWritePipe = 288, - SpvOpEnqueueMarker = 291, - SpvOpEnqueueKernel = 292, - SpvOpGetKernelNDrangeSubGroupCount = 293, - SpvOpGetKernelNDrangeMaxSubGroupSize = 294, - SpvOpGetKernelWorkGroupSize = 295, - SpvOpGetKernelPreferredWorkGroupSizeMultiple = 296, - SpvOpRetainEvent = 297, - SpvOpReleaseEvent = 298, - SpvOpCreateUserEvent = 299, - SpvOpIsValidEvent = 300, - SpvOpSetUserEventStatus = 301, - SpvOpCaptureEventProfilingInfo = 302, - SpvOpGetDefaultQueue = 303, - SpvOpBuildNDRange = 304, - SpvOpImageSparseSampleImplicitLod = 305, - SpvOpImageSparseSampleExplicitLod = 306, - SpvOpImageSparseSampleDrefImplicitLod = 307, - SpvOpImageSparseSampleDrefExplicitLod = 308, - SpvOpImageSparseSampleProjImplicitLod = 309, - SpvOpImageSparseSampleProjExplicitLod = 310, - SpvOpImageSparseSampleProjDrefImplicitLod = 311, - SpvOpImageSparseSampleProjDrefExplicitLod = 312, - SpvOpImageSparseFetch = 313, - SpvOpImageSparseGather = 314, - SpvOpImageSparseDrefGather = 315, - SpvOpImageSparseTexelsResident = 316, - SpvOpNoLine = 317, - SpvOpAtomicFlagTestAndSet = 318, - SpvOpAtomicFlagClear = 319, - SpvOpImageSparseRead = 320, - SpvOpSizeOf = 321, - SpvOpTypePipeStorage = 322, - SpvOpConstantPipeStorage = 323, - SpvOpCreatePipeFromPipeStorage = 324, - SpvOpGetKernelLocalSizeForSubgroupCount = 325, - SpvOpGetKernelMaxNumSubgroups = 326, - SpvOpTypeNamedBarrier = 327, - SpvOpNamedBarrierInitialize = 328, - SpvOpMemoryNamedBarrier = 329, - SpvOpModuleProcessed = 330, - SpvOpDecorateId = 332, - SpvOpSubgroupBallotKHR = 4421, - SpvOpSubgroupFirstInvocationKHR = 4422, - SpvOpSubgroupAllKHR = 4428, - SpvOpSubgroupAnyKHR = 4429, - SpvOpSubgroupAllEqualKHR = 4430, - SpvOpSubgroupReadInvocationKHR = 4432, - SpvOpGroupIAddNonUniformAMD = 5000, - SpvOpGroupFAddNonUniformAMD = 5001, - SpvOpGroupFMinNonUniformAMD = 5002, - SpvOpGroupUMinNonUniformAMD = 5003, - SpvOpGroupSMinNonUniformAMD = 5004, - SpvOpGroupFMaxNonUniformAMD = 5005, - SpvOpGroupUMaxNonUniformAMD = 5006, - SpvOpGroupSMaxNonUniformAMD = 5007, - SpvOpFragmentMaskFetchAMD = 5011, - SpvOpFragmentFetchAMD = 5012, - SpvOpSubgroupShuffleINTEL = 5571, - SpvOpSubgroupShuffleDownINTEL = 5572, - SpvOpSubgroupShuffleUpINTEL = 5573, - SpvOpSubgroupShuffleXorINTEL = 5574, - SpvOpSubgroupBlockReadINTEL = 5575, - SpvOpSubgroupBlockWriteINTEL = 5576, - SpvOpSubgroupImageBlockReadINTEL = 5577, - SpvOpSubgroupImageBlockWriteINTEL = 5578, - SpvOpDecorateStringGOOGLE = 5632, - SpvOpMemberDecorateStringGOOGLE = 5633, - SpvOpMax = 0x7fffffff, -} SpvOp; - -#endif // #ifndef spirv_H - diff --git a/include/spirv/1.1/spirv.hpp b/include/spirv/1.1/spirv.hpp deleted file mode 100644 index c26ac1f2..00000000 --- a/include/spirv/1.1/spirv.hpp +++ /dev/null @@ -1,1024 +0,0 @@ -// Copyright (c) 2014-2018 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -// This header is automatically generated by the same tool that creates -// the Binary Section of the SPIR-V specification. - -// Enumeration tokens for SPIR-V, in various styles: -// C, C++, C++11, JSON, Lua, Python -// -// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -// -// Some tokens act like mask values, which can be OR'd together, -// while others are mutually exclusive. The mask-like ones have -// "Mask" in their name, and a parallel enum that has the shift -// amount (1 << x) for each corresponding enumerant. - -#ifndef spirv_HPP -#define spirv_HPP - -namespace spv { - -typedef unsigned int Id; - -#define SPV_VERSION 0x10100 -#define SPV_REVISION 8 - -static const unsigned int MagicNumber = 0x07230203; -static const unsigned int Version = 0x00010100; -static const unsigned int Revision = 8; -static const unsigned int OpCodeMask = 0xffff; -static const unsigned int WordCountShift = 16; - -enum SourceLanguage { - SourceLanguageUnknown = 0, - SourceLanguageESSL = 1, - SourceLanguageGLSL = 2, - SourceLanguageOpenCL_C = 3, - SourceLanguageOpenCL_CPP = 4, - SourceLanguageHLSL = 5, - SourceLanguageMax = 0x7fffffff, -}; - -enum ExecutionModel { - ExecutionModelVertex = 0, - ExecutionModelTessellationControl = 1, - ExecutionModelTessellationEvaluation = 2, - ExecutionModelGeometry = 3, - ExecutionModelFragment = 4, - ExecutionModelGLCompute = 5, - ExecutionModelKernel = 6, - ExecutionModelMax = 0x7fffffff, -}; - -enum AddressingModel { - AddressingModelLogical = 0, - AddressingModelPhysical32 = 1, - AddressingModelPhysical64 = 2, - AddressingModelMax = 0x7fffffff, -}; - -enum MemoryModel { - MemoryModelSimple = 0, - MemoryModelGLSL450 = 1, - MemoryModelOpenCL = 2, - MemoryModelMax = 0x7fffffff, -}; - -enum ExecutionMode { - ExecutionModeInvocations = 0, - ExecutionModeSpacingEqual = 1, - ExecutionModeSpacingFractionalEven = 2, - ExecutionModeSpacingFractionalOdd = 3, - ExecutionModeVertexOrderCw = 4, - ExecutionModeVertexOrderCcw = 5, - ExecutionModePixelCenterInteger = 6, - ExecutionModeOriginUpperLeft = 7, - ExecutionModeOriginLowerLeft = 8, - ExecutionModeEarlyFragmentTests = 9, - ExecutionModePointMode = 10, - ExecutionModeXfb = 11, - ExecutionModeDepthReplacing = 12, - ExecutionModeDepthGreater = 14, - ExecutionModeDepthLess = 15, - ExecutionModeDepthUnchanged = 16, - ExecutionModeLocalSize = 17, - ExecutionModeLocalSizeHint = 18, - ExecutionModeInputPoints = 19, - ExecutionModeInputLines = 20, - ExecutionModeInputLinesAdjacency = 21, - ExecutionModeTriangles = 22, - ExecutionModeInputTrianglesAdjacency = 23, - ExecutionModeQuads = 24, - ExecutionModeIsolines = 25, - ExecutionModeOutputVertices = 26, - ExecutionModeOutputPoints = 27, - ExecutionModeOutputLineStrip = 28, - ExecutionModeOutputTriangleStrip = 29, - ExecutionModeVecTypeHint = 30, - ExecutionModeContractionOff = 31, - ExecutionModeInitializer = 33, - ExecutionModeFinalizer = 34, - ExecutionModeSubgroupSize = 35, - ExecutionModeSubgroupsPerWorkgroup = 36, - ExecutionModePostDepthCoverage = 4446, - ExecutionModeStencilRefReplacingEXT = 5027, - ExecutionModeMax = 0x7fffffff, -}; - -enum StorageClass { - StorageClassUniformConstant = 0, - StorageClassInput = 1, - StorageClassUniform = 2, - StorageClassOutput = 3, - StorageClassWorkgroup = 4, - StorageClassCrossWorkgroup = 5, - StorageClassPrivate = 6, - StorageClassFunction = 7, - StorageClassGeneric = 8, - StorageClassPushConstant = 9, - StorageClassAtomicCounter = 10, - StorageClassImage = 11, - StorageClassStorageBuffer = 12, - StorageClassMax = 0x7fffffff, -}; - -enum Dim { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - DimCube = 3, - DimRect = 4, - DimBuffer = 5, - DimSubpassData = 6, - DimMax = 0x7fffffff, -}; - -enum SamplerAddressingMode { - SamplerAddressingModeNone = 0, - SamplerAddressingModeClampToEdge = 1, - SamplerAddressingModeClamp = 2, - SamplerAddressingModeRepeat = 3, - SamplerAddressingModeRepeatMirrored = 4, - SamplerAddressingModeMax = 0x7fffffff, -}; - -enum SamplerFilterMode { - SamplerFilterModeNearest = 0, - SamplerFilterModeLinear = 1, - SamplerFilterModeMax = 0x7fffffff, -}; - -enum ImageFormat { - ImageFormatUnknown = 0, - ImageFormatRgba32f = 1, - ImageFormatRgba16f = 2, - ImageFormatR32f = 3, - ImageFormatRgba8 = 4, - ImageFormatRgba8Snorm = 5, - ImageFormatRg32f = 6, - ImageFormatRg16f = 7, - ImageFormatR11fG11fB10f = 8, - ImageFormatR16f = 9, - ImageFormatRgba16 = 10, - ImageFormatRgb10A2 = 11, - ImageFormatRg16 = 12, - ImageFormatRg8 = 13, - ImageFormatR16 = 14, - ImageFormatR8 = 15, - ImageFormatRgba16Snorm = 16, - ImageFormatRg16Snorm = 17, - ImageFormatRg8Snorm = 18, - ImageFormatR16Snorm = 19, - ImageFormatR8Snorm = 20, - ImageFormatRgba32i = 21, - ImageFormatRgba16i = 22, - ImageFormatRgba8i = 23, - ImageFormatR32i = 24, - ImageFormatRg32i = 25, - ImageFormatRg16i = 26, - ImageFormatRg8i = 27, - ImageFormatR16i = 28, - ImageFormatR8i = 29, - ImageFormatRgba32ui = 30, - ImageFormatRgba16ui = 31, - ImageFormatRgba8ui = 32, - ImageFormatR32ui = 33, - ImageFormatRgb10a2ui = 34, - ImageFormatRg32ui = 35, - ImageFormatRg16ui = 36, - ImageFormatRg8ui = 37, - ImageFormatR16ui = 38, - ImageFormatR8ui = 39, - ImageFormatMax = 0x7fffffff, -}; - -enum ImageChannelOrder { - ImageChannelOrderR = 0, - ImageChannelOrderA = 1, - ImageChannelOrderRG = 2, - ImageChannelOrderRA = 3, - ImageChannelOrderRGB = 4, - ImageChannelOrderRGBA = 5, - ImageChannelOrderBGRA = 6, - ImageChannelOrderARGB = 7, - ImageChannelOrderIntensity = 8, - ImageChannelOrderLuminance = 9, - ImageChannelOrderRx = 10, - ImageChannelOrderRGx = 11, - ImageChannelOrderRGBx = 12, - ImageChannelOrderDepth = 13, - ImageChannelOrderDepthStencil = 14, - ImageChannelOrdersRGB = 15, - ImageChannelOrdersRGBx = 16, - ImageChannelOrdersRGBA = 17, - ImageChannelOrdersBGRA = 18, - ImageChannelOrderABGR = 19, - ImageChannelOrderMax = 0x7fffffff, -}; - -enum ImageChannelDataType { - ImageChannelDataTypeSnormInt8 = 0, - ImageChannelDataTypeSnormInt16 = 1, - ImageChannelDataTypeUnormInt8 = 2, - ImageChannelDataTypeUnormInt16 = 3, - ImageChannelDataTypeUnormShort565 = 4, - ImageChannelDataTypeUnormShort555 = 5, - ImageChannelDataTypeUnormInt101010 = 6, - ImageChannelDataTypeSignedInt8 = 7, - ImageChannelDataTypeSignedInt16 = 8, - ImageChannelDataTypeSignedInt32 = 9, - ImageChannelDataTypeUnsignedInt8 = 10, - ImageChannelDataTypeUnsignedInt16 = 11, - ImageChannelDataTypeUnsignedInt32 = 12, - ImageChannelDataTypeHalfFloat = 13, - ImageChannelDataTypeFloat = 14, - ImageChannelDataTypeUnormInt24 = 15, - ImageChannelDataTypeUnormInt101010_2 = 16, - ImageChannelDataTypeMax = 0x7fffffff, -}; - -enum ImageOperandsShift { - ImageOperandsBiasShift = 0, - ImageOperandsLodShift = 1, - ImageOperandsGradShift = 2, - ImageOperandsConstOffsetShift = 3, - ImageOperandsOffsetShift = 4, - ImageOperandsConstOffsetsShift = 5, - ImageOperandsSampleShift = 6, - ImageOperandsMinLodShift = 7, - ImageOperandsMax = 0x7fffffff, -}; - -enum ImageOperandsMask { - ImageOperandsMaskNone = 0, - ImageOperandsBiasMask = 0x00000001, - ImageOperandsLodMask = 0x00000002, - ImageOperandsGradMask = 0x00000004, - ImageOperandsConstOffsetMask = 0x00000008, - ImageOperandsOffsetMask = 0x00000010, - ImageOperandsConstOffsetsMask = 0x00000020, - ImageOperandsSampleMask = 0x00000040, - ImageOperandsMinLodMask = 0x00000080, -}; - -enum FPFastMathModeShift { - FPFastMathModeNotNaNShift = 0, - FPFastMathModeNotInfShift = 1, - FPFastMathModeNSZShift = 2, - FPFastMathModeAllowRecipShift = 3, - FPFastMathModeFastShift = 4, - FPFastMathModeMax = 0x7fffffff, -}; - -enum FPFastMathModeMask { - FPFastMathModeMaskNone = 0, - FPFastMathModeNotNaNMask = 0x00000001, - FPFastMathModeNotInfMask = 0x00000002, - FPFastMathModeNSZMask = 0x00000004, - FPFastMathModeAllowRecipMask = 0x00000008, - FPFastMathModeFastMask = 0x00000010, -}; - -enum FPRoundingMode { - FPRoundingModeRTE = 0, - FPRoundingModeRTZ = 1, - FPRoundingModeRTP = 2, - FPRoundingModeRTN = 3, - FPRoundingModeMax = 0x7fffffff, -}; - -enum LinkageType { - LinkageTypeExport = 0, - LinkageTypeImport = 1, - LinkageTypeMax = 0x7fffffff, -}; - -enum AccessQualifier { - AccessQualifierReadOnly = 0, - AccessQualifierWriteOnly = 1, - AccessQualifierReadWrite = 2, - AccessQualifierMax = 0x7fffffff, -}; - -enum FunctionParameterAttribute { - FunctionParameterAttributeZext = 0, - FunctionParameterAttributeSext = 1, - FunctionParameterAttributeByVal = 2, - FunctionParameterAttributeSret = 3, - FunctionParameterAttributeNoAlias = 4, - FunctionParameterAttributeNoCapture = 5, - FunctionParameterAttributeNoWrite = 6, - FunctionParameterAttributeNoReadWrite = 7, - FunctionParameterAttributeMax = 0x7fffffff, -}; - -enum Decoration { - DecorationRelaxedPrecision = 0, - DecorationSpecId = 1, - DecorationBlock = 2, - DecorationBufferBlock = 3, - DecorationRowMajor = 4, - DecorationColMajor = 5, - DecorationArrayStride = 6, - DecorationMatrixStride = 7, - DecorationGLSLShared = 8, - DecorationGLSLPacked = 9, - DecorationCPacked = 10, - DecorationBuiltIn = 11, - DecorationNoPerspective = 13, - DecorationFlat = 14, - DecorationPatch = 15, - DecorationCentroid = 16, - DecorationSample = 17, - DecorationInvariant = 18, - DecorationRestrict = 19, - DecorationAliased = 20, - DecorationVolatile = 21, - DecorationConstant = 22, - DecorationCoherent = 23, - DecorationNonWritable = 24, - DecorationNonReadable = 25, - DecorationUniform = 26, - DecorationSaturatedConversion = 28, - DecorationStream = 29, - DecorationLocation = 30, - DecorationComponent = 31, - DecorationIndex = 32, - DecorationBinding = 33, - DecorationDescriptorSet = 34, - DecorationOffset = 35, - DecorationXfbBuffer = 36, - DecorationXfbStride = 37, - DecorationFuncParamAttr = 38, - DecorationFPRoundingMode = 39, - DecorationFPFastMathMode = 40, - DecorationLinkageAttributes = 41, - DecorationNoContraction = 42, - DecorationInputAttachmentIndex = 43, - DecorationAlignment = 44, - DecorationMaxByteOffset = 45, - DecorationExplicitInterpAMD = 4999, - DecorationOverrideCoverageNV = 5248, - DecorationPassthroughNV = 5250, - DecorationViewportRelativeNV = 5252, - DecorationSecondaryViewportRelativeNV = 5256, - DecorationHlslCounterBufferGOOGLE = 5634, - DecorationHlslSemanticGOOGLE = 5635, - DecorationMax = 0x7fffffff, -}; - -enum BuiltIn { - BuiltInPosition = 0, - BuiltInPointSize = 1, - BuiltInClipDistance = 3, - BuiltInCullDistance = 4, - BuiltInVertexId = 5, - BuiltInInstanceId = 6, - BuiltInPrimitiveId = 7, - BuiltInInvocationId = 8, - BuiltInLayer = 9, - BuiltInViewportIndex = 10, - BuiltInTessLevelOuter = 11, - BuiltInTessLevelInner = 12, - BuiltInTessCoord = 13, - BuiltInPatchVertices = 14, - BuiltInFragCoord = 15, - BuiltInPointCoord = 16, - BuiltInFrontFacing = 17, - BuiltInSampleId = 18, - BuiltInSamplePosition = 19, - BuiltInSampleMask = 20, - BuiltInFragDepth = 22, - BuiltInHelperInvocation = 23, - BuiltInNumWorkgroups = 24, - BuiltInWorkgroupSize = 25, - BuiltInWorkgroupId = 26, - BuiltInLocalInvocationId = 27, - BuiltInGlobalInvocationId = 28, - BuiltInLocalInvocationIndex = 29, - BuiltInWorkDim = 30, - BuiltInGlobalSize = 31, - BuiltInEnqueuedWorkgroupSize = 32, - BuiltInGlobalOffset = 33, - BuiltInGlobalLinearId = 34, - BuiltInSubgroupSize = 36, - BuiltInSubgroupMaxSize = 37, - BuiltInNumSubgroups = 38, - BuiltInNumEnqueuedSubgroups = 39, - BuiltInSubgroupId = 40, - BuiltInSubgroupLocalInvocationId = 41, - BuiltInVertexIndex = 42, - BuiltInInstanceIndex = 43, - BuiltInSubgroupEqMaskKHR = 4416, - BuiltInSubgroupGeMaskKHR = 4417, - BuiltInSubgroupGtMaskKHR = 4418, - BuiltInSubgroupLeMaskKHR = 4419, - BuiltInSubgroupLtMaskKHR = 4420, - BuiltInBaseVertex = 4424, - BuiltInBaseInstance = 4425, - BuiltInDrawIndex = 4426, - BuiltInDeviceIndex = 4438, - BuiltInViewIndex = 4440, - BuiltInBaryCoordNoPerspAMD = 4992, - BuiltInBaryCoordNoPerspCentroidAMD = 4993, - BuiltInBaryCoordNoPerspSampleAMD = 4994, - BuiltInBaryCoordSmoothAMD = 4995, - BuiltInBaryCoordSmoothCentroidAMD = 4996, - BuiltInBaryCoordSmoothSampleAMD = 4997, - BuiltInBaryCoordPullModelAMD = 4998, - BuiltInFragStencilRefEXT = 5014, - BuiltInViewportMaskNV = 5253, - BuiltInSecondaryPositionNV = 5257, - BuiltInSecondaryViewportMaskNV = 5258, - BuiltInPositionPerViewNV = 5261, - BuiltInViewportMaskPerViewNV = 5262, - BuiltInMax = 0x7fffffff, -}; - -enum SelectionControlShift { - SelectionControlFlattenShift = 0, - SelectionControlDontFlattenShift = 1, - SelectionControlMax = 0x7fffffff, -}; - -enum SelectionControlMask { - SelectionControlMaskNone = 0, - SelectionControlFlattenMask = 0x00000001, - SelectionControlDontFlattenMask = 0x00000002, -}; - -enum LoopControlShift { - LoopControlUnrollShift = 0, - LoopControlDontUnrollShift = 1, - LoopControlDependencyInfiniteShift = 2, - LoopControlDependencyLengthShift = 3, - LoopControlMax = 0x7fffffff, -}; - -enum LoopControlMask { - LoopControlMaskNone = 0, - LoopControlUnrollMask = 0x00000001, - LoopControlDontUnrollMask = 0x00000002, - LoopControlDependencyInfiniteMask = 0x00000004, - LoopControlDependencyLengthMask = 0x00000008, -}; - -enum FunctionControlShift { - FunctionControlInlineShift = 0, - FunctionControlDontInlineShift = 1, - FunctionControlPureShift = 2, - FunctionControlConstShift = 3, - FunctionControlMax = 0x7fffffff, -}; - -enum FunctionControlMask { - FunctionControlMaskNone = 0, - FunctionControlInlineMask = 0x00000001, - FunctionControlDontInlineMask = 0x00000002, - FunctionControlPureMask = 0x00000004, - FunctionControlConstMask = 0x00000008, -}; - -enum MemorySemanticsShift { - MemorySemanticsAcquireShift = 1, - MemorySemanticsReleaseShift = 2, - MemorySemanticsAcquireReleaseShift = 3, - MemorySemanticsSequentiallyConsistentShift = 4, - MemorySemanticsUniformMemoryShift = 6, - MemorySemanticsSubgroupMemoryShift = 7, - MemorySemanticsWorkgroupMemoryShift = 8, - MemorySemanticsCrossWorkgroupMemoryShift = 9, - MemorySemanticsAtomicCounterMemoryShift = 10, - MemorySemanticsImageMemoryShift = 11, - MemorySemanticsMax = 0x7fffffff, -}; - -enum MemorySemanticsMask { - MemorySemanticsMaskNone = 0, - MemorySemanticsAcquireMask = 0x00000002, - MemorySemanticsReleaseMask = 0x00000004, - MemorySemanticsAcquireReleaseMask = 0x00000008, - MemorySemanticsSequentiallyConsistentMask = 0x00000010, - MemorySemanticsUniformMemoryMask = 0x00000040, - MemorySemanticsSubgroupMemoryMask = 0x00000080, - MemorySemanticsWorkgroupMemoryMask = 0x00000100, - MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, - MemorySemanticsAtomicCounterMemoryMask = 0x00000400, - MemorySemanticsImageMemoryMask = 0x00000800, -}; - -enum MemoryAccessShift { - MemoryAccessVolatileShift = 0, - MemoryAccessAlignedShift = 1, - MemoryAccessNontemporalShift = 2, - MemoryAccessMax = 0x7fffffff, -}; - -enum MemoryAccessMask { - MemoryAccessMaskNone = 0, - MemoryAccessVolatileMask = 0x00000001, - MemoryAccessAlignedMask = 0x00000002, - MemoryAccessNontemporalMask = 0x00000004, -}; - -enum Scope { - ScopeCrossDevice = 0, - ScopeDevice = 1, - ScopeWorkgroup = 2, - ScopeSubgroup = 3, - ScopeInvocation = 4, - ScopeMax = 0x7fffffff, -}; - -enum GroupOperation { - GroupOperationReduce = 0, - GroupOperationInclusiveScan = 1, - GroupOperationExclusiveScan = 2, - GroupOperationMax = 0x7fffffff, -}; - -enum KernelEnqueueFlags { - KernelEnqueueFlagsNoWait = 0, - KernelEnqueueFlagsWaitKernel = 1, - KernelEnqueueFlagsWaitWorkGroup = 2, - KernelEnqueueFlagsMax = 0x7fffffff, -}; - -enum KernelProfilingInfoShift { - KernelProfilingInfoCmdExecTimeShift = 0, - KernelProfilingInfoMax = 0x7fffffff, -}; - -enum KernelProfilingInfoMask { - KernelProfilingInfoMaskNone = 0, - KernelProfilingInfoCmdExecTimeMask = 0x00000001, -}; - -enum Capability { - CapabilityMatrix = 0, - CapabilityShader = 1, - CapabilityGeometry = 2, - CapabilityTessellation = 3, - CapabilityAddresses = 4, - CapabilityLinkage = 5, - CapabilityKernel = 6, - CapabilityVector16 = 7, - CapabilityFloat16Buffer = 8, - CapabilityFloat16 = 9, - CapabilityFloat64 = 10, - CapabilityInt64 = 11, - CapabilityInt64Atomics = 12, - CapabilityImageBasic = 13, - CapabilityImageReadWrite = 14, - CapabilityImageMipmap = 15, - CapabilityPipes = 17, - CapabilityGroups = 18, - CapabilityDeviceEnqueue = 19, - CapabilityLiteralSampler = 20, - CapabilityAtomicStorage = 21, - CapabilityInt16 = 22, - CapabilityTessellationPointSize = 23, - CapabilityGeometryPointSize = 24, - CapabilityImageGatherExtended = 25, - CapabilityStorageImageMultisample = 27, - CapabilityUniformBufferArrayDynamicIndexing = 28, - CapabilitySampledImageArrayDynamicIndexing = 29, - CapabilityStorageBufferArrayDynamicIndexing = 30, - CapabilityStorageImageArrayDynamicIndexing = 31, - CapabilityClipDistance = 32, - CapabilityCullDistance = 33, - CapabilityImageCubeArray = 34, - CapabilitySampleRateShading = 35, - CapabilityImageRect = 36, - CapabilitySampledRect = 37, - CapabilityGenericPointer = 38, - CapabilityInt8 = 39, - CapabilityInputAttachment = 40, - CapabilitySparseResidency = 41, - CapabilityMinLod = 42, - CapabilitySampled1D = 43, - CapabilityImage1D = 44, - CapabilitySampledCubeArray = 45, - CapabilitySampledBuffer = 46, - CapabilityImageBuffer = 47, - CapabilityImageMSArray = 48, - CapabilityStorageImageExtendedFormats = 49, - CapabilityImageQuery = 50, - CapabilityDerivativeControl = 51, - CapabilityInterpolationFunction = 52, - CapabilityTransformFeedback = 53, - CapabilityGeometryStreams = 54, - CapabilityStorageImageReadWithoutFormat = 55, - CapabilityStorageImageWriteWithoutFormat = 56, - CapabilityMultiViewport = 57, - CapabilitySubgroupDispatch = 58, - CapabilityNamedBarrier = 59, - CapabilityPipeStorage = 60, - CapabilitySubgroupBallotKHR = 4423, - CapabilityDrawParameters = 4427, - CapabilitySubgroupVoteKHR = 4431, - CapabilityStorageBuffer16BitAccess = 4433, - CapabilityStorageUniformBufferBlock16 = 4433, - CapabilityStorageUniform16 = 4434, - CapabilityUniformAndStorageBuffer16BitAccess = 4434, - CapabilityStoragePushConstant16 = 4435, - CapabilityStorageInputOutput16 = 4436, - CapabilityDeviceGroup = 4437, - CapabilityMultiView = 4439, - CapabilityVariablePointersStorageBuffer = 4441, - CapabilityVariablePointers = 4442, - CapabilityAtomicStorageOps = 4445, - CapabilitySampleMaskPostDepthCoverage = 4447, - CapabilityImageGatherBiasLodAMD = 5009, - CapabilityFragmentMaskAMD = 5010, - CapabilityStencilExportEXT = 5013, - CapabilityImageReadWriteLodAMD = 5015, - CapabilitySampleMaskOverrideCoverageNV = 5249, - CapabilityGeometryShaderPassthroughNV = 5251, - CapabilityShaderViewportIndexLayerEXT = 5254, - CapabilityShaderViewportIndexLayerNV = 5254, - CapabilityShaderViewportMaskNV = 5255, - CapabilityShaderStereoViewNV = 5259, - CapabilityPerViewAttributesNV = 5260, - CapabilitySubgroupShuffleINTEL = 5568, - CapabilitySubgroupBufferBlockIOINTEL = 5569, - CapabilitySubgroupImageBlockIOINTEL = 5570, - CapabilityMax = 0x7fffffff, -}; - -enum Op { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, - OpImageSparseRead = 320, - OpSizeOf = 321, - OpTypePipeStorage = 322, - OpConstantPipeStorage = 323, - OpCreatePipeFromPipeStorage = 324, - OpGetKernelLocalSizeForSubgroupCount = 325, - OpGetKernelMaxNumSubgroups = 326, - OpTypeNamedBarrier = 327, - OpNamedBarrierInitialize = 328, - OpMemoryNamedBarrier = 329, - OpModuleProcessed = 330, - OpDecorateId = 332, - OpSubgroupBallotKHR = 4421, - OpSubgroupFirstInvocationKHR = 4422, - OpSubgroupAllKHR = 4428, - OpSubgroupAnyKHR = 4429, - OpSubgroupAllEqualKHR = 4430, - OpSubgroupReadInvocationKHR = 4432, - OpGroupIAddNonUniformAMD = 5000, - OpGroupFAddNonUniformAMD = 5001, - OpGroupFMinNonUniformAMD = 5002, - OpGroupUMinNonUniformAMD = 5003, - OpGroupSMinNonUniformAMD = 5004, - OpGroupFMaxNonUniformAMD = 5005, - OpGroupUMaxNonUniformAMD = 5006, - OpGroupSMaxNonUniformAMD = 5007, - OpFragmentMaskFetchAMD = 5011, - OpFragmentFetchAMD = 5012, - OpSubgroupShuffleINTEL = 5571, - OpSubgroupShuffleDownINTEL = 5572, - OpSubgroupShuffleUpINTEL = 5573, - OpSubgroupShuffleXorINTEL = 5574, - OpSubgroupBlockReadINTEL = 5575, - OpSubgroupBlockWriteINTEL = 5576, - OpSubgroupImageBlockReadINTEL = 5577, - OpSubgroupImageBlockWriteINTEL = 5578, - OpDecorateStringGOOGLE = 5632, - OpMemberDecorateStringGOOGLE = 5633, - OpMax = 0x7fffffff, -}; - -// Overload operator| for mask bit combining - -inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } -inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } -inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } -inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } -inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } -inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } -inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } -inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } - -} // end namespace spv - -#endif // #ifndef spirv_HPP - diff --git a/include/spirv/1.1/spirv.hpp11 b/include/spirv/1.1/spirv.hpp11 deleted file mode 100644 index 992d43b5..00000000 --- a/include/spirv/1.1/spirv.hpp11 +++ /dev/null @@ -1,1024 +0,0 @@ -// Copyright (c) 2014-2018 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -// This header is automatically generated by the same tool that creates -// the Binary Section of the SPIR-V specification. - -// Enumeration tokens for SPIR-V, in various styles: -// C, C++, C++11, JSON, Lua, Python -// -// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -// -// Some tokens act like mask values, which can be OR'd together, -// while others are mutually exclusive. The mask-like ones have -// "Mask" in their name, and a parallel enum that has the shift -// amount (1 << x) for each corresponding enumerant. - -#ifndef spirv_HPP -#define spirv_HPP - -namespace spv { - -typedef unsigned int Id; - -#define SPV_VERSION 0x10100 -#define SPV_REVISION 8 - -static const unsigned int MagicNumber = 0x07230203; -static const unsigned int Version = 0x00010100; -static const unsigned int Revision = 8; -static const unsigned int OpCodeMask = 0xffff; -static const unsigned int WordCountShift = 16; - -enum class SourceLanguage : unsigned { - Unknown = 0, - ESSL = 1, - GLSL = 2, - OpenCL_C = 3, - OpenCL_CPP = 4, - HLSL = 5, - Max = 0x7fffffff, -}; - -enum class ExecutionModel : unsigned { - Vertex = 0, - TessellationControl = 1, - TessellationEvaluation = 2, - Geometry = 3, - Fragment = 4, - GLCompute = 5, - Kernel = 6, - Max = 0x7fffffff, -}; - -enum class AddressingModel : unsigned { - Logical = 0, - Physical32 = 1, - Physical64 = 2, - Max = 0x7fffffff, -}; - -enum class MemoryModel : unsigned { - Simple = 0, - GLSL450 = 1, - OpenCL = 2, - Max = 0x7fffffff, -}; - -enum class ExecutionMode : unsigned { - Invocations = 0, - SpacingEqual = 1, - SpacingFractionalEven = 2, - SpacingFractionalOdd = 3, - VertexOrderCw = 4, - VertexOrderCcw = 5, - PixelCenterInteger = 6, - OriginUpperLeft = 7, - OriginLowerLeft = 8, - EarlyFragmentTests = 9, - PointMode = 10, - Xfb = 11, - DepthReplacing = 12, - DepthGreater = 14, - DepthLess = 15, - DepthUnchanged = 16, - LocalSize = 17, - LocalSizeHint = 18, - InputPoints = 19, - InputLines = 20, - InputLinesAdjacency = 21, - Triangles = 22, - InputTrianglesAdjacency = 23, - Quads = 24, - Isolines = 25, - OutputVertices = 26, - OutputPoints = 27, - OutputLineStrip = 28, - OutputTriangleStrip = 29, - VecTypeHint = 30, - ContractionOff = 31, - Initializer = 33, - Finalizer = 34, - SubgroupSize = 35, - SubgroupsPerWorkgroup = 36, - PostDepthCoverage = 4446, - StencilRefReplacingEXT = 5027, - Max = 0x7fffffff, -}; - -enum class StorageClass : unsigned { - UniformConstant = 0, - Input = 1, - Uniform = 2, - Output = 3, - Workgroup = 4, - CrossWorkgroup = 5, - Private = 6, - Function = 7, - Generic = 8, - PushConstant = 9, - AtomicCounter = 10, - Image = 11, - StorageBuffer = 12, - Max = 0x7fffffff, -}; - -enum class Dim : unsigned { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - Cube = 3, - Rect = 4, - Buffer = 5, - SubpassData = 6, - Max = 0x7fffffff, -}; - -enum class SamplerAddressingMode : unsigned { - None = 0, - ClampToEdge = 1, - Clamp = 2, - Repeat = 3, - RepeatMirrored = 4, - Max = 0x7fffffff, -}; - -enum class SamplerFilterMode : unsigned { - Nearest = 0, - Linear = 1, - Max = 0x7fffffff, -}; - -enum class ImageFormat : unsigned { - Unknown = 0, - Rgba32f = 1, - Rgba16f = 2, - R32f = 3, - Rgba8 = 4, - Rgba8Snorm = 5, - Rg32f = 6, - Rg16f = 7, - R11fG11fB10f = 8, - R16f = 9, - Rgba16 = 10, - Rgb10A2 = 11, - Rg16 = 12, - Rg8 = 13, - R16 = 14, - R8 = 15, - Rgba16Snorm = 16, - Rg16Snorm = 17, - Rg8Snorm = 18, - R16Snorm = 19, - R8Snorm = 20, - Rgba32i = 21, - Rgba16i = 22, - Rgba8i = 23, - R32i = 24, - Rg32i = 25, - Rg16i = 26, - Rg8i = 27, - R16i = 28, - R8i = 29, - Rgba32ui = 30, - Rgba16ui = 31, - Rgba8ui = 32, - R32ui = 33, - Rgb10a2ui = 34, - Rg32ui = 35, - Rg16ui = 36, - Rg8ui = 37, - R16ui = 38, - R8ui = 39, - Max = 0x7fffffff, -}; - -enum class ImageChannelOrder : unsigned { - R = 0, - A = 1, - RG = 2, - RA = 3, - RGB = 4, - RGBA = 5, - BGRA = 6, - ARGB = 7, - Intensity = 8, - Luminance = 9, - Rx = 10, - RGx = 11, - RGBx = 12, - Depth = 13, - DepthStencil = 14, - sRGB = 15, - sRGBx = 16, - sRGBA = 17, - sBGRA = 18, - ABGR = 19, - Max = 0x7fffffff, -}; - -enum class ImageChannelDataType : unsigned { - SnormInt8 = 0, - SnormInt16 = 1, - UnormInt8 = 2, - UnormInt16 = 3, - UnormShort565 = 4, - UnormShort555 = 5, - UnormInt101010 = 6, - SignedInt8 = 7, - SignedInt16 = 8, - SignedInt32 = 9, - UnsignedInt8 = 10, - UnsignedInt16 = 11, - UnsignedInt32 = 12, - HalfFloat = 13, - Float = 14, - UnormInt24 = 15, - UnormInt101010_2 = 16, - Max = 0x7fffffff, -}; - -enum class ImageOperandsShift : unsigned { - Bias = 0, - Lod = 1, - Grad = 2, - ConstOffset = 3, - Offset = 4, - ConstOffsets = 5, - Sample = 6, - MinLod = 7, - Max = 0x7fffffff, -}; - -enum class ImageOperandsMask : unsigned { - MaskNone = 0, - Bias = 0x00000001, - Lod = 0x00000002, - Grad = 0x00000004, - ConstOffset = 0x00000008, - Offset = 0x00000010, - ConstOffsets = 0x00000020, - Sample = 0x00000040, - MinLod = 0x00000080, -}; - -enum class FPFastMathModeShift : unsigned { - NotNaN = 0, - NotInf = 1, - NSZ = 2, - AllowRecip = 3, - Fast = 4, - Max = 0x7fffffff, -}; - -enum class FPFastMathModeMask : unsigned { - MaskNone = 0, - NotNaN = 0x00000001, - NotInf = 0x00000002, - NSZ = 0x00000004, - AllowRecip = 0x00000008, - Fast = 0x00000010, -}; - -enum class FPRoundingMode : unsigned { - RTE = 0, - RTZ = 1, - RTP = 2, - RTN = 3, - Max = 0x7fffffff, -}; - -enum class LinkageType : unsigned { - Export = 0, - Import = 1, - Max = 0x7fffffff, -}; - -enum class AccessQualifier : unsigned { - ReadOnly = 0, - WriteOnly = 1, - ReadWrite = 2, - Max = 0x7fffffff, -}; - -enum class FunctionParameterAttribute : unsigned { - Zext = 0, - Sext = 1, - ByVal = 2, - Sret = 3, - NoAlias = 4, - NoCapture = 5, - NoWrite = 6, - NoReadWrite = 7, - Max = 0x7fffffff, -}; - -enum class Decoration : unsigned { - RelaxedPrecision = 0, - SpecId = 1, - Block = 2, - BufferBlock = 3, - RowMajor = 4, - ColMajor = 5, - ArrayStride = 6, - MatrixStride = 7, - GLSLShared = 8, - GLSLPacked = 9, - CPacked = 10, - BuiltIn = 11, - NoPerspective = 13, - Flat = 14, - Patch = 15, - Centroid = 16, - Sample = 17, - Invariant = 18, - Restrict = 19, - Aliased = 20, - Volatile = 21, - Constant = 22, - Coherent = 23, - NonWritable = 24, - NonReadable = 25, - Uniform = 26, - SaturatedConversion = 28, - Stream = 29, - Location = 30, - Component = 31, - Index = 32, - Binding = 33, - DescriptorSet = 34, - Offset = 35, - XfbBuffer = 36, - XfbStride = 37, - FuncParamAttr = 38, - FPRoundingMode = 39, - FPFastMathMode = 40, - LinkageAttributes = 41, - NoContraction = 42, - InputAttachmentIndex = 43, - Alignment = 44, - MaxByteOffset = 45, - ExplicitInterpAMD = 4999, - OverrideCoverageNV = 5248, - PassthroughNV = 5250, - ViewportRelativeNV = 5252, - SecondaryViewportRelativeNV = 5256, - HlslCounterBufferGOOGLE = 5634, - HlslSemanticGOOGLE = 5635, - Max = 0x7fffffff, -}; - -enum class BuiltIn : unsigned { - Position = 0, - PointSize = 1, - ClipDistance = 3, - CullDistance = 4, - VertexId = 5, - InstanceId = 6, - PrimitiveId = 7, - InvocationId = 8, - Layer = 9, - ViewportIndex = 10, - TessLevelOuter = 11, - TessLevelInner = 12, - TessCoord = 13, - PatchVertices = 14, - FragCoord = 15, - PointCoord = 16, - FrontFacing = 17, - SampleId = 18, - SamplePosition = 19, - SampleMask = 20, - FragDepth = 22, - HelperInvocation = 23, - NumWorkgroups = 24, - WorkgroupSize = 25, - WorkgroupId = 26, - LocalInvocationId = 27, - GlobalInvocationId = 28, - LocalInvocationIndex = 29, - WorkDim = 30, - GlobalSize = 31, - EnqueuedWorkgroupSize = 32, - GlobalOffset = 33, - GlobalLinearId = 34, - SubgroupSize = 36, - SubgroupMaxSize = 37, - NumSubgroups = 38, - NumEnqueuedSubgroups = 39, - SubgroupId = 40, - SubgroupLocalInvocationId = 41, - VertexIndex = 42, - InstanceIndex = 43, - SubgroupEqMaskKHR = 4416, - SubgroupGeMaskKHR = 4417, - SubgroupGtMaskKHR = 4418, - SubgroupLeMaskKHR = 4419, - SubgroupLtMaskKHR = 4420, - BaseVertex = 4424, - BaseInstance = 4425, - DrawIndex = 4426, - DeviceIndex = 4438, - ViewIndex = 4440, - BaryCoordNoPerspAMD = 4992, - BaryCoordNoPerspCentroidAMD = 4993, - BaryCoordNoPerspSampleAMD = 4994, - BaryCoordSmoothAMD = 4995, - BaryCoordSmoothCentroidAMD = 4996, - BaryCoordSmoothSampleAMD = 4997, - BaryCoordPullModelAMD = 4998, - FragStencilRefEXT = 5014, - ViewportMaskNV = 5253, - SecondaryPositionNV = 5257, - SecondaryViewportMaskNV = 5258, - PositionPerViewNV = 5261, - ViewportMaskPerViewNV = 5262, - Max = 0x7fffffff, -}; - -enum class SelectionControlShift : unsigned { - Flatten = 0, - DontFlatten = 1, - Max = 0x7fffffff, -}; - -enum class SelectionControlMask : unsigned { - MaskNone = 0, - Flatten = 0x00000001, - DontFlatten = 0x00000002, -}; - -enum class LoopControlShift : unsigned { - Unroll = 0, - DontUnroll = 1, - DependencyInfinite = 2, - DependencyLength = 3, - Max = 0x7fffffff, -}; - -enum class LoopControlMask : unsigned { - MaskNone = 0, - Unroll = 0x00000001, - DontUnroll = 0x00000002, - DependencyInfinite = 0x00000004, - DependencyLength = 0x00000008, -}; - -enum class FunctionControlShift : unsigned { - Inline = 0, - DontInline = 1, - Pure = 2, - Const = 3, - Max = 0x7fffffff, -}; - -enum class FunctionControlMask : unsigned { - MaskNone = 0, - Inline = 0x00000001, - DontInline = 0x00000002, - Pure = 0x00000004, - Const = 0x00000008, -}; - -enum class MemorySemanticsShift : unsigned { - Acquire = 1, - Release = 2, - AcquireRelease = 3, - SequentiallyConsistent = 4, - UniformMemory = 6, - SubgroupMemory = 7, - WorkgroupMemory = 8, - CrossWorkgroupMemory = 9, - AtomicCounterMemory = 10, - ImageMemory = 11, - Max = 0x7fffffff, -}; - -enum class MemorySemanticsMask : unsigned { - MaskNone = 0, - Acquire = 0x00000002, - Release = 0x00000004, - AcquireRelease = 0x00000008, - SequentiallyConsistent = 0x00000010, - UniformMemory = 0x00000040, - SubgroupMemory = 0x00000080, - WorkgroupMemory = 0x00000100, - CrossWorkgroupMemory = 0x00000200, - AtomicCounterMemory = 0x00000400, - ImageMemory = 0x00000800, -}; - -enum class MemoryAccessShift : unsigned { - Volatile = 0, - Aligned = 1, - Nontemporal = 2, - Max = 0x7fffffff, -}; - -enum class MemoryAccessMask : unsigned { - MaskNone = 0, - Volatile = 0x00000001, - Aligned = 0x00000002, - Nontemporal = 0x00000004, -}; - -enum class Scope : unsigned { - CrossDevice = 0, - Device = 1, - Workgroup = 2, - Subgroup = 3, - Invocation = 4, - Max = 0x7fffffff, -}; - -enum class GroupOperation : unsigned { - Reduce = 0, - InclusiveScan = 1, - ExclusiveScan = 2, - Max = 0x7fffffff, -}; - -enum class KernelEnqueueFlags : unsigned { - NoWait = 0, - WaitKernel = 1, - WaitWorkGroup = 2, - Max = 0x7fffffff, -}; - -enum class KernelProfilingInfoShift : unsigned { - CmdExecTime = 0, - Max = 0x7fffffff, -}; - -enum class KernelProfilingInfoMask : unsigned { - MaskNone = 0, - CmdExecTime = 0x00000001, -}; - -enum class Capability : unsigned { - Matrix = 0, - Shader = 1, - Geometry = 2, - Tessellation = 3, - Addresses = 4, - Linkage = 5, - Kernel = 6, - Vector16 = 7, - Float16Buffer = 8, - Float16 = 9, - Float64 = 10, - Int64 = 11, - Int64Atomics = 12, - ImageBasic = 13, - ImageReadWrite = 14, - ImageMipmap = 15, - Pipes = 17, - Groups = 18, - DeviceEnqueue = 19, - LiteralSampler = 20, - AtomicStorage = 21, - Int16 = 22, - TessellationPointSize = 23, - GeometryPointSize = 24, - ImageGatherExtended = 25, - StorageImageMultisample = 27, - UniformBufferArrayDynamicIndexing = 28, - SampledImageArrayDynamicIndexing = 29, - StorageBufferArrayDynamicIndexing = 30, - StorageImageArrayDynamicIndexing = 31, - ClipDistance = 32, - CullDistance = 33, - ImageCubeArray = 34, - SampleRateShading = 35, - ImageRect = 36, - SampledRect = 37, - GenericPointer = 38, - Int8 = 39, - InputAttachment = 40, - SparseResidency = 41, - MinLod = 42, - Sampled1D = 43, - Image1D = 44, - SampledCubeArray = 45, - SampledBuffer = 46, - ImageBuffer = 47, - ImageMSArray = 48, - StorageImageExtendedFormats = 49, - ImageQuery = 50, - DerivativeControl = 51, - InterpolationFunction = 52, - TransformFeedback = 53, - GeometryStreams = 54, - StorageImageReadWithoutFormat = 55, - StorageImageWriteWithoutFormat = 56, - MultiViewport = 57, - SubgroupDispatch = 58, - NamedBarrier = 59, - PipeStorage = 60, - SubgroupBallotKHR = 4423, - DrawParameters = 4427, - SubgroupVoteKHR = 4431, - StorageBuffer16BitAccess = 4433, - StorageUniformBufferBlock16 = 4433, - StorageUniform16 = 4434, - UniformAndStorageBuffer16BitAccess = 4434, - StoragePushConstant16 = 4435, - StorageInputOutput16 = 4436, - DeviceGroup = 4437, - MultiView = 4439, - VariablePointersStorageBuffer = 4441, - VariablePointers = 4442, - AtomicStorageOps = 4445, - SampleMaskPostDepthCoverage = 4447, - ImageGatherBiasLodAMD = 5009, - FragmentMaskAMD = 5010, - StencilExportEXT = 5013, - ImageReadWriteLodAMD = 5015, - SampleMaskOverrideCoverageNV = 5249, - GeometryShaderPassthroughNV = 5251, - ShaderViewportIndexLayerEXT = 5254, - ShaderViewportIndexLayerNV = 5254, - ShaderViewportMaskNV = 5255, - ShaderStereoViewNV = 5259, - PerViewAttributesNV = 5260, - SubgroupShuffleINTEL = 5568, - SubgroupBufferBlockIOINTEL = 5569, - SubgroupImageBlockIOINTEL = 5570, - Max = 0x7fffffff, -}; - -enum class Op : unsigned { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, - OpImageSparseRead = 320, - OpSizeOf = 321, - OpTypePipeStorage = 322, - OpConstantPipeStorage = 323, - OpCreatePipeFromPipeStorage = 324, - OpGetKernelLocalSizeForSubgroupCount = 325, - OpGetKernelMaxNumSubgroups = 326, - OpTypeNamedBarrier = 327, - OpNamedBarrierInitialize = 328, - OpMemoryNamedBarrier = 329, - OpModuleProcessed = 330, - OpDecorateId = 332, - OpSubgroupBallotKHR = 4421, - OpSubgroupFirstInvocationKHR = 4422, - OpSubgroupAllKHR = 4428, - OpSubgroupAnyKHR = 4429, - OpSubgroupAllEqualKHR = 4430, - OpSubgroupReadInvocationKHR = 4432, - OpGroupIAddNonUniformAMD = 5000, - OpGroupFAddNonUniformAMD = 5001, - OpGroupFMinNonUniformAMD = 5002, - OpGroupUMinNonUniformAMD = 5003, - OpGroupSMinNonUniformAMD = 5004, - OpGroupFMaxNonUniformAMD = 5005, - OpGroupUMaxNonUniformAMD = 5006, - OpGroupSMaxNonUniformAMD = 5007, - OpFragmentMaskFetchAMD = 5011, - OpFragmentFetchAMD = 5012, - OpSubgroupShuffleINTEL = 5571, - OpSubgroupShuffleDownINTEL = 5572, - OpSubgroupShuffleUpINTEL = 5573, - OpSubgroupShuffleXorINTEL = 5574, - OpSubgroupBlockReadINTEL = 5575, - OpSubgroupBlockWriteINTEL = 5576, - OpSubgroupImageBlockReadINTEL = 5577, - OpSubgroupImageBlockWriteINTEL = 5578, - OpDecorateStringGOOGLE = 5632, - OpMemberDecorateStringGOOGLE = 5633, - Max = 0x7fffffff, -}; - -// Overload operator| for mask bit combining - -inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } -inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } -inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } -inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } -inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } -inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } -inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } -inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } - -} // end namespace spv - -#endif // #ifndef spirv_HPP - diff --git a/include/spirv/1.1/spirv.json b/include/spirv/1.1/spirv.json deleted file mode 100644 index 4c18e019..00000000 --- a/include/spirv/1.1/spirv.json +++ /dev/null @@ -1,1040 +0,0 @@ -{ - "spv": - { - "meta": - { - "Comment": - [ - [ - "Copyright (c) 2014-2018 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - [ - "This header is automatically generated by the same tool that creates", - "the Binary Section of the SPIR-V specification." - ], - [ - "Enumeration tokens for SPIR-V, in various styles:", - " C, C++, C++11, JSON, Lua, Python", - "", - "- C will have tokens with a \"Spv\" prefix, e.g.: SpvSourceLanguageGLSL", - "- C++ will have tokens in the \"spv\" name space, e.g.: spv::SourceLanguageGLSL", - "- C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL", - "- Lua will use tables, e.g.: spv.SourceLanguage.GLSL", - "- Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL']", - "", - "Some tokens act like mask values, which can be OR'd together,", - "while others are mutually exclusive. The mask-like ones have", - "\"Mask\" in their name, and a parallel enum that has the shift", - "amount (1 << x) for each corresponding enumerant." - ] - ], - "MagicNumber": 119734787, - "Version": 65792, - "Revision": 8, - "OpCodeMask": 65535, - "WordCountShift": 16 - }, - "enum": - [ - { - "Name": "SourceLanguage", - "Type": "Value", - "Values": - { - "Unknown": 0, - "ESSL": 1, - "GLSL": 2, - "OpenCL_C": 3, - "OpenCL_CPP": 4, - "HLSL": 5 - } - }, - { - "Name": "ExecutionModel", - "Type": "Value", - "Values": - { - "Vertex": 0, - "TessellationControl": 1, - "TessellationEvaluation": 2, - "Geometry": 3, - "Fragment": 4, - "GLCompute": 5, - "Kernel": 6 - } - }, - { - "Name": "AddressingModel", - "Type": "Value", - "Values": - { - "Logical": 0, - "Physical32": 1, - "Physical64": 2 - } - }, - { - "Name": "MemoryModel", - "Type": "Value", - "Values": - { - "Simple": 0, - "GLSL450": 1, - "OpenCL": 2 - } - }, - { - "Name": "ExecutionMode", - "Type": "Value", - "Values": - { - "Invocations": 0, - "SpacingEqual": 1, - "SpacingFractionalEven": 2, - "SpacingFractionalOdd": 3, - "VertexOrderCw": 4, - "VertexOrderCcw": 5, - "PixelCenterInteger": 6, - "OriginUpperLeft": 7, - "OriginLowerLeft": 8, - "EarlyFragmentTests": 9, - "PointMode": 10, - "Xfb": 11, - "DepthReplacing": 12, - "DepthGreater": 14, - "DepthLess": 15, - "DepthUnchanged": 16, - "LocalSize": 17, - "LocalSizeHint": 18, - "InputPoints": 19, - "InputLines": 20, - "InputLinesAdjacency": 21, - "Triangles": 22, - "InputTrianglesAdjacency": 23, - "Quads": 24, - "Isolines": 25, - "OutputVertices": 26, - "OutputPoints": 27, - "OutputLineStrip": 28, - "OutputTriangleStrip": 29, - "VecTypeHint": 30, - "ContractionOff": 31, - "Initializer": 33, - "Finalizer": 34, - "SubgroupSize": 35, - "SubgroupsPerWorkgroup": 36, - "PostDepthCoverage": 4446, - "StencilRefReplacingEXT": 5027 - } - }, - { - "Name": "StorageClass", - "Type": "Value", - "Values": - { - "UniformConstant": 0, - "Input": 1, - "Uniform": 2, - "Output": 3, - "Workgroup": 4, - "CrossWorkgroup": 5, - "Private": 6, - "Function": 7, - "Generic": 8, - "PushConstant": 9, - "AtomicCounter": 10, - "Image": 11, - "StorageBuffer": 12 - } - }, - { - "Name": "Dim", - "Type": "Value", - "Values": - { - "Dim1D": 0, - "Dim2D": 1, - "Dim3D": 2, - "Cube": 3, - "Rect": 4, - "Buffer": 5, - "SubpassData": 6 - } - }, - { - "Name": "SamplerAddressingMode", - "Type": "Value", - "Values": - { - "None": 0, - "ClampToEdge": 1, - "Clamp": 2, - "Repeat": 3, - "RepeatMirrored": 4 - } - }, - { - "Name": "SamplerFilterMode", - "Type": "Value", - "Values": - { - "Nearest": 0, - "Linear": 1 - } - }, - { - "Name": "ImageFormat", - "Type": "Value", - "Values": - { - "Unknown": 0, - "Rgba32f": 1, - "Rgba16f": 2, - "R32f": 3, - "Rgba8": 4, - "Rgba8Snorm": 5, - "Rg32f": 6, - "Rg16f": 7, - "R11fG11fB10f": 8, - "R16f": 9, - "Rgba16": 10, - "Rgb10A2": 11, - "Rg16": 12, - "Rg8": 13, - "R16": 14, - "R8": 15, - "Rgba16Snorm": 16, - "Rg16Snorm": 17, - "Rg8Snorm": 18, - "R16Snorm": 19, - "R8Snorm": 20, - "Rgba32i": 21, - "Rgba16i": 22, - "Rgba8i": 23, - "R32i": 24, - "Rg32i": 25, - "Rg16i": 26, - "Rg8i": 27, - "R16i": 28, - "R8i": 29, - "Rgba32ui": 30, - "Rgba16ui": 31, - "Rgba8ui": 32, - "R32ui": 33, - "Rgb10a2ui": 34, - "Rg32ui": 35, - "Rg16ui": 36, - "Rg8ui": 37, - "R16ui": 38, - "R8ui": 39 - } - }, - { - "Name": "ImageChannelOrder", - "Type": "Value", - "Values": - { - "R": 0, - "A": 1, - "RG": 2, - "RA": 3, - "RGB": 4, - "RGBA": 5, - "BGRA": 6, - "ARGB": 7, - "Intensity": 8, - "Luminance": 9, - "Rx": 10, - "RGx": 11, - "RGBx": 12, - "Depth": 13, - "DepthStencil": 14, - "sRGB": 15, - "sRGBx": 16, - "sRGBA": 17, - "sBGRA": 18, - "ABGR": 19 - } - }, - { - "Name": "ImageChannelDataType", - "Type": "Value", - "Values": - { - "SnormInt8": 0, - "SnormInt16": 1, - "UnormInt8": 2, - "UnormInt16": 3, - "UnormShort565": 4, - "UnormShort555": 5, - "UnormInt101010": 6, - "SignedInt8": 7, - "SignedInt16": 8, - "SignedInt32": 9, - "UnsignedInt8": 10, - "UnsignedInt16": 11, - "UnsignedInt32": 12, - "HalfFloat": 13, - "Float": 14, - "UnormInt24": 15, - "UnormInt101010_2": 16 - } - }, - { - "Name": "ImageOperands", - "Type": "Bit", - "Values": - { - "Bias": 0, - "Lod": 1, - "Grad": 2, - "ConstOffset": 3, - "Offset": 4, - "ConstOffsets": 5, - "Sample": 6, - "MinLod": 7 - } - }, - { - "Name": "FPFastMathMode", - "Type": "Bit", - "Values": - { - "NotNaN": 0, - "NotInf": 1, - "NSZ": 2, - "AllowRecip": 3, - "Fast": 4 - } - }, - { - "Name": "FPRoundingMode", - "Type": "Value", - "Values": - { - "RTE": 0, - "RTZ": 1, - "RTP": 2, - "RTN": 3 - } - }, - { - "Name": "LinkageType", - "Type": "Value", - "Values": - { - "Export": 0, - "Import": 1 - } - }, - { - "Name": "AccessQualifier", - "Type": "Value", - "Values": - { - "ReadOnly": 0, - "WriteOnly": 1, - "ReadWrite": 2 - } - }, - { - "Name": "FunctionParameterAttribute", - "Type": "Value", - "Values": - { - "Zext": 0, - "Sext": 1, - "ByVal": 2, - "Sret": 3, - "NoAlias": 4, - "NoCapture": 5, - "NoWrite": 6, - "NoReadWrite": 7 - } - }, - { - "Name": "Decoration", - "Type": "Value", - "Values": - { - "RelaxedPrecision": 0, - "SpecId": 1, - "Block": 2, - "BufferBlock": 3, - "RowMajor": 4, - "ColMajor": 5, - "ArrayStride": 6, - "MatrixStride": 7, - "GLSLShared": 8, - "GLSLPacked": 9, - "CPacked": 10, - "BuiltIn": 11, - "NoPerspective": 13, - "Flat": 14, - "Patch": 15, - "Centroid": 16, - "Sample": 17, - "Invariant": 18, - "Restrict": 19, - "Aliased": 20, - "Volatile": 21, - "Constant": 22, - "Coherent": 23, - "NonWritable": 24, - "NonReadable": 25, - "Uniform": 26, - "SaturatedConversion": 28, - "Stream": 29, - "Location": 30, - "Component": 31, - "Index": 32, - "Binding": 33, - "DescriptorSet": 34, - "Offset": 35, - "XfbBuffer": 36, - "XfbStride": 37, - "FuncParamAttr": 38, - "FPRoundingMode": 39, - "FPFastMathMode": 40, - "LinkageAttributes": 41, - "NoContraction": 42, - "InputAttachmentIndex": 43, - "Alignment": 44, - "MaxByteOffset": 45, - "ExplicitInterpAMD": 4999, - "OverrideCoverageNV": 5248, - "PassthroughNV": 5250, - "ViewportRelativeNV": 5252, - "SecondaryViewportRelativeNV": 5256, - "HlslCounterBufferGOOGLE": 5634, - "HlslSemanticGOOGLE": 5635 - } - }, - { - "Name": "BuiltIn", - "Type": "Value", - "Values": - { - "Position": 0, - "PointSize": 1, - "ClipDistance": 3, - "CullDistance": 4, - "VertexId": 5, - "InstanceId": 6, - "PrimitiveId": 7, - "InvocationId": 8, - "Layer": 9, - "ViewportIndex": 10, - "TessLevelOuter": 11, - "TessLevelInner": 12, - "TessCoord": 13, - "PatchVertices": 14, - "FragCoord": 15, - "PointCoord": 16, - "FrontFacing": 17, - "SampleId": 18, - "SamplePosition": 19, - "SampleMask": 20, - "FragDepth": 22, - "HelperInvocation": 23, - "NumWorkgroups": 24, - "WorkgroupSize": 25, - "WorkgroupId": 26, - "LocalInvocationId": 27, - "GlobalInvocationId": 28, - "LocalInvocationIndex": 29, - "WorkDim": 30, - "GlobalSize": 31, - "EnqueuedWorkgroupSize": 32, - "GlobalOffset": 33, - "GlobalLinearId": 34, - "SubgroupSize": 36, - "SubgroupMaxSize": 37, - "NumSubgroups": 38, - "NumEnqueuedSubgroups": 39, - "SubgroupId": 40, - "SubgroupLocalInvocationId": 41, - "VertexIndex": 42, - "InstanceIndex": 43, - "SubgroupEqMaskKHR": 4416, - "SubgroupGeMaskKHR": 4417, - "SubgroupGtMaskKHR": 4418, - "SubgroupLeMaskKHR": 4419, - "SubgroupLtMaskKHR": 4420, - "BaseVertex": 4424, - "BaseInstance": 4425, - "DrawIndex": 4426, - "DeviceIndex": 4438, - "ViewIndex": 4440, - "BaryCoordNoPerspAMD": 4992, - "BaryCoordNoPerspCentroidAMD": 4993, - "BaryCoordNoPerspSampleAMD": 4994, - "BaryCoordSmoothAMD": 4995, - "BaryCoordSmoothCentroidAMD": 4996, - "BaryCoordSmoothSampleAMD": 4997, - "BaryCoordPullModelAMD": 4998, - "FragStencilRefEXT": 5014, - "ViewportMaskNV": 5253, - "SecondaryPositionNV": 5257, - "SecondaryViewportMaskNV": 5258, - "PositionPerViewNV": 5261, - "ViewportMaskPerViewNV": 5262 - } - }, - { - "Name": "SelectionControl", - "Type": "Bit", - "Values": - { - "Flatten": 0, - "DontFlatten": 1 - } - }, - { - "Name": "LoopControl", - "Type": "Bit", - "Values": - { - "Unroll": 0, - "DontUnroll": 1, - "DependencyInfinite": 2, - "DependencyLength": 3 - } - }, - { - "Name": "FunctionControl", - "Type": "Bit", - "Values": - { - "Inline": 0, - "DontInline": 1, - "Pure": 2, - "Const": 3 - } - }, - { - "Name": "MemorySemantics", - "Type": "Bit", - "Values": - { - "Acquire": 1, - "Release": 2, - "AcquireRelease": 3, - "SequentiallyConsistent": 4, - "UniformMemory": 6, - "SubgroupMemory": 7, - "WorkgroupMemory": 8, - "CrossWorkgroupMemory": 9, - "AtomicCounterMemory": 10, - "ImageMemory": 11 - } - }, - { - "Name": "MemoryAccess", - "Type": "Bit", - "Values": - { - "Volatile": 0, - "Aligned": 1, - "Nontemporal": 2 - } - }, - { - "Name": "Scope", - "Type": "Value", - "Values": - { - "CrossDevice": 0, - "Device": 1, - "Workgroup": 2, - "Subgroup": 3, - "Invocation": 4 - } - }, - { - "Name": "GroupOperation", - "Type": "Value", - "Values": - { - "Reduce": 0, - "InclusiveScan": 1, - "ExclusiveScan": 2 - } - }, - { - "Name": "KernelEnqueueFlags", - "Type": "Value", - "Values": - { - "NoWait": 0, - "WaitKernel": 1, - "WaitWorkGroup": 2 - } - }, - { - "Name": "KernelProfilingInfo", - "Type": "Bit", - "Values": - { - "CmdExecTime": 0 - } - }, - { - "Name": "Capability", - "Type": "Value", - "Values": - { - "Matrix": 0, - "Shader": 1, - "Geometry": 2, - "Tessellation": 3, - "Addresses": 4, - "Linkage": 5, - "Kernel": 6, - "Vector16": 7, - "Float16Buffer": 8, - "Float16": 9, - "Float64": 10, - "Int64": 11, - "Int64Atomics": 12, - "ImageBasic": 13, - "ImageReadWrite": 14, - "ImageMipmap": 15, - "Pipes": 17, - "Groups": 18, - "DeviceEnqueue": 19, - "LiteralSampler": 20, - "AtomicStorage": 21, - "Int16": 22, - "TessellationPointSize": 23, - "GeometryPointSize": 24, - "ImageGatherExtended": 25, - "StorageImageMultisample": 27, - "UniformBufferArrayDynamicIndexing": 28, - "SampledImageArrayDynamicIndexing": 29, - "StorageBufferArrayDynamicIndexing": 30, - "StorageImageArrayDynamicIndexing": 31, - "ClipDistance": 32, - "CullDistance": 33, - "ImageCubeArray": 34, - "SampleRateShading": 35, - "ImageRect": 36, - "SampledRect": 37, - "GenericPointer": 38, - "Int8": 39, - "InputAttachment": 40, - "SparseResidency": 41, - "MinLod": 42, - "Sampled1D": 43, - "Image1D": 44, - "SampledCubeArray": 45, - "SampledBuffer": 46, - "ImageBuffer": 47, - "ImageMSArray": 48, - "StorageImageExtendedFormats": 49, - "ImageQuery": 50, - "DerivativeControl": 51, - "InterpolationFunction": 52, - "TransformFeedback": 53, - "GeometryStreams": 54, - "StorageImageReadWithoutFormat": 55, - "StorageImageWriteWithoutFormat": 56, - "MultiViewport": 57, - "SubgroupDispatch": 58, - "NamedBarrier": 59, - "PipeStorage": 60, - "SubgroupBallotKHR": 4423, - "DrawParameters": 4427, - "SubgroupVoteKHR": 4431, - "StorageBuffer16BitAccess": 4433, - "StorageUniformBufferBlock16": 4433, - "StorageUniform16": 4434, - "UniformAndStorageBuffer16BitAccess": 4434, - "StoragePushConstant16": 4435, - "StorageInputOutput16": 4436, - "DeviceGroup": 4437, - "MultiView": 4439, - "VariablePointersStorageBuffer": 4441, - "VariablePointers": 4442, - "AtomicStorageOps": 4445, - "SampleMaskPostDepthCoverage": 4447, - "ImageGatherBiasLodAMD": 5009, - "FragmentMaskAMD": 5010, - "StencilExportEXT": 5013, - "ImageReadWriteLodAMD": 5015, - "SampleMaskOverrideCoverageNV": 5249, - "GeometryShaderPassthroughNV": 5251, - "ShaderViewportIndexLayerEXT": 5254, - "ShaderViewportIndexLayerNV": 5254, - "ShaderViewportMaskNV": 5255, - "ShaderStereoViewNV": 5259, - "PerViewAttributesNV": 5260, - "SubgroupShuffleINTEL": 5568, - "SubgroupBufferBlockIOINTEL": 5569, - "SubgroupImageBlockIOINTEL": 5570 - } - }, - { - "Name": "Op", - "Type": "Value", - "Values": - { - "OpNop": 0, - "OpUndef": 1, - "OpSourceContinued": 2, - "OpSource": 3, - "OpSourceExtension": 4, - "OpName": 5, - "OpMemberName": 6, - "OpString": 7, - "OpLine": 8, - "OpExtension": 10, - "OpExtInstImport": 11, - "OpExtInst": 12, - "OpMemoryModel": 14, - "OpEntryPoint": 15, - "OpExecutionMode": 16, - "OpCapability": 17, - "OpTypeVoid": 19, - "OpTypeBool": 20, - "OpTypeInt": 21, - "OpTypeFloat": 22, - "OpTypeVector": 23, - "OpTypeMatrix": 24, - "OpTypeImage": 25, - "OpTypeSampler": 26, - "OpTypeSampledImage": 27, - "OpTypeArray": 28, - "OpTypeRuntimeArray": 29, - "OpTypeStruct": 30, - "OpTypeOpaque": 31, - "OpTypePointer": 32, - "OpTypeFunction": 33, - "OpTypeEvent": 34, - "OpTypeDeviceEvent": 35, - "OpTypeReserveId": 36, - "OpTypeQueue": 37, - "OpTypePipe": 38, - "OpTypeForwardPointer": 39, - "OpConstantTrue": 41, - "OpConstantFalse": 42, - "OpConstant": 43, - "OpConstantComposite": 44, - "OpConstantSampler": 45, - "OpConstantNull": 46, - "OpSpecConstantTrue": 48, - "OpSpecConstantFalse": 49, - "OpSpecConstant": 50, - "OpSpecConstantComposite": 51, - "OpSpecConstantOp": 52, - "OpFunction": 54, - "OpFunctionParameter": 55, - "OpFunctionEnd": 56, - "OpFunctionCall": 57, - "OpVariable": 59, - "OpImageTexelPointer": 60, - "OpLoad": 61, - "OpStore": 62, - "OpCopyMemory": 63, - "OpCopyMemorySized": 64, - "OpAccessChain": 65, - "OpInBoundsAccessChain": 66, - "OpPtrAccessChain": 67, - "OpArrayLength": 68, - "OpGenericPtrMemSemantics": 69, - "OpInBoundsPtrAccessChain": 70, - "OpDecorate": 71, - "OpMemberDecorate": 72, - "OpDecorationGroup": 73, - "OpGroupDecorate": 74, - "OpGroupMemberDecorate": 75, - "OpVectorExtractDynamic": 77, - "OpVectorInsertDynamic": 78, - "OpVectorShuffle": 79, - "OpCompositeConstruct": 80, - "OpCompositeExtract": 81, - "OpCompositeInsert": 82, - "OpCopyObject": 83, - "OpTranspose": 84, - "OpSampledImage": 86, - "OpImageSampleImplicitLod": 87, - "OpImageSampleExplicitLod": 88, - "OpImageSampleDrefImplicitLod": 89, - "OpImageSampleDrefExplicitLod": 90, - "OpImageSampleProjImplicitLod": 91, - "OpImageSampleProjExplicitLod": 92, - "OpImageSampleProjDrefImplicitLod": 93, - "OpImageSampleProjDrefExplicitLod": 94, - "OpImageFetch": 95, - "OpImageGather": 96, - "OpImageDrefGather": 97, - "OpImageRead": 98, - "OpImageWrite": 99, - "OpImage": 100, - "OpImageQueryFormat": 101, - "OpImageQueryOrder": 102, - "OpImageQuerySizeLod": 103, - "OpImageQuerySize": 104, - "OpImageQueryLod": 105, - "OpImageQueryLevels": 106, - "OpImageQuerySamples": 107, - "OpConvertFToU": 109, - "OpConvertFToS": 110, - "OpConvertSToF": 111, - "OpConvertUToF": 112, - "OpUConvert": 113, - "OpSConvert": 114, - "OpFConvert": 115, - "OpQuantizeToF16": 116, - "OpConvertPtrToU": 117, - "OpSatConvertSToU": 118, - "OpSatConvertUToS": 119, - "OpConvertUToPtr": 120, - "OpPtrCastToGeneric": 121, - "OpGenericCastToPtr": 122, - "OpGenericCastToPtrExplicit": 123, - "OpBitcast": 124, - "OpSNegate": 126, - "OpFNegate": 127, - "OpIAdd": 128, - "OpFAdd": 129, - "OpISub": 130, - "OpFSub": 131, - "OpIMul": 132, - "OpFMul": 133, - "OpUDiv": 134, - "OpSDiv": 135, - "OpFDiv": 136, - "OpUMod": 137, - "OpSRem": 138, - "OpSMod": 139, - "OpFRem": 140, - "OpFMod": 141, - "OpVectorTimesScalar": 142, - "OpMatrixTimesScalar": 143, - "OpVectorTimesMatrix": 144, - "OpMatrixTimesVector": 145, - "OpMatrixTimesMatrix": 146, - "OpOuterProduct": 147, - "OpDot": 148, - "OpIAddCarry": 149, - "OpISubBorrow": 150, - "OpUMulExtended": 151, - "OpSMulExtended": 152, - "OpAny": 154, - "OpAll": 155, - "OpIsNan": 156, - "OpIsInf": 157, - "OpIsFinite": 158, - "OpIsNormal": 159, - "OpSignBitSet": 160, - "OpLessOrGreater": 161, - "OpOrdered": 162, - "OpUnordered": 163, - "OpLogicalEqual": 164, - "OpLogicalNotEqual": 165, - "OpLogicalOr": 166, - "OpLogicalAnd": 167, - "OpLogicalNot": 168, - "OpSelect": 169, - "OpIEqual": 170, - "OpINotEqual": 171, - "OpUGreaterThan": 172, - "OpSGreaterThan": 173, - "OpUGreaterThanEqual": 174, - "OpSGreaterThanEqual": 175, - "OpULessThan": 176, - "OpSLessThan": 177, - "OpULessThanEqual": 178, - "OpSLessThanEqual": 179, - "OpFOrdEqual": 180, - "OpFUnordEqual": 181, - "OpFOrdNotEqual": 182, - "OpFUnordNotEqual": 183, - "OpFOrdLessThan": 184, - "OpFUnordLessThan": 185, - "OpFOrdGreaterThan": 186, - "OpFUnordGreaterThan": 187, - "OpFOrdLessThanEqual": 188, - "OpFUnordLessThanEqual": 189, - "OpFOrdGreaterThanEqual": 190, - "OpFUnordGreaterThanEqual": 191, - "OpShiftRightLogical": 194, - "OpShiftRightArithmetic": 195, - "OpShiftLeftLogical": 196, - "OpBitwiseOr": 197, - "OpBitwiseXor": 198, - "OpBitwiseAnd": 199, - "OpNot": 200, - "OpBitFieldInsert": 201, - "OpBitFieldSExtract": 202, - "OpBitFieldUExtract": 203, - "OpBitReverse": 204, - "OpBitCount": 205, - "OpDPdx": 207, - "OpDPdy": 208, - "OpFwidth": 209, - "OpDPdxFine": 210, - "OpDPdyFine": 211, - "OpFwidthFine": 212, - "OpDPdxCoarse": 213, - "OpDPdyCoarse": 214, - "OpFwidthCoarse": 215, - "OpEmitVertex": 218, - "OpEndPrimitive": 219, - "OpEmitStreamVertex": 220, - "OpEndStreamPrimitive": 221, - "OpControlBarrier": 224, - "OpMemoryBarrier": 225, - "OpAtomicLoad": 227, - "OpAtomicStore": 228, - "OpAtomicExchange": 229, - "OpAtomicCompareExchange": 230, - "OpAtomicCompareExchangeWeak": 231, - "OpAtomicIIncrement": 232, - "OpAtomicIDecrement": 233, - "OpAtomicIAdd": 234, - "OpAtomicISub": 235, - "OpAtomicSMin": 236, - "OpAtomicUMin": 237, - "OpAtomicSMax": 238, - "OpAtomicUMax": 239, - "OpAtomicAnd": 240, - "OpAtomicOr": 241, - "OpAtomicXor": 242, - "OpPhi": 245, - "OpLoopMerge": 246, - "OpSelectionMerge": 247, - "OpLabel": 248, - "OpBranch": 249, - "OpBranchConditional": 250, - "OpSwitch": 251, - "OpKill": 252, - "OpReturn": 253, - "OpReturnValue": 254, - "OpUnreachable": 255, - "OpLifetimeStart": 256, - "OpLifetimeStop": 257, - "OpGroupAsyncCopy": 259, - "OpGroupWaitEvents": 260, - "OpGroupAll": 261, - "OpGroupAny": 262, - "OpGroupBroadcast": 263, - "OpGroupIAdd": 264, - "OpGroupFAdd": 265, - "OpGroupFMin": 266, - "OpGroupUMin": 267, - "OpGroupSMin": 268, - "OpGroupFMax": 269, - "OpGroupUMax": 270, - "OpGroupSMax": 271, - "OpReadPipe": 274, - "OpWritePipe": 275, - "OpReservedReadPipe": 276, - "OpReservedWritePipe": 277, - "OpReserveReadPipePackets": 278, - "OpReserveWritePipePackets": 279, - "OpCommitReadPipe": 280, - "OpCommitWritePipe": 281, - "OpIsValidReserveId": 282, - "OpGetNumPipePackets": 283, - "OpGetMaxPipePackets": 284, - "OpGroupReserveReadPipePackets": 285, - "OpGroupReserveWritePipePackets": 286, - "OpGroupCommitReadPipe": 287, - "OpGroupCommitWritePipe": 288, - "OpEnqueueMarker": 291, - "OpEnqueueKernel": 292, - "OpGetKernelNDrangeSubGroupCount": 293, - "OpGetKernelNDrangeMaxSubGroupSize": 294, - "OpGetKernelWorkGroupSize": 295, - "OpGetKernelPreferredWorkGroupSizeMultiple": 296, - "OpRetainEvent": 297, - "OpReleaseEvent": 298, - "OpCreateUserEvent": 299, - "OpIsValidEvent": 300, - "OpSetUserEventStatus": 301, - "OpCaptureEventProfilingInfo": 302, - "OpGetDefaultQueue": 303, - "OpBuildNDRange": 304, - "OpImageSparseSampleImplicitLod": 305, - "OpImageSparseSampleExplicitLod": 306, - "OpImageSparseSampleDrefImplicitLod": 307, - "OpImageSparseSampleDrefExplicitLod": 308, - "OpImageSparseSampleProjImplicitLod": 309, - "OpImageSparseSampleProjExplicitLod": 310, - "OpImageSparseSampleProjDrefImplicitLod": 311, - "OpImageSparseSampleProjDrefExplicitLod": 312, - "OpImageSparseFetch": 313, - "OpImageSparseGather": 314, - "OpImageSparseDrefGather": 315, - "OpImageSparseTexelsResident": 316, - "OpNoLine": 317, - "OpAtomicFlagTestAndSet": 318, - "OpAtomicFlagClear": 319, - "OpImageSparseRead": 320, - "OpSizeOf": 321, - "OpTypePipeStorage": 322, - "OpConstantPipeStorage": 323, - "OpCreatePipeFromPipeStorage": 324, - "OpGetKernelLocalSizeForSubgroupCount": 325, - "OpGetKernelMaxNumSubgroups": 326, - "OpTypeNamedBarrier": 327, - "OpNamedBarrierInitialize": 328, - "OpMemoryNamedBarrier": 329, - "OpModuleProcessed": 330, - "OpDecorateId": 332, - "OpSubgroupBallotKHR": 4421, - "OpSubgroupFirstInvocationKHR": 4422, - "OpSubgroupAllKHR": 4428, - "OpSubgroupAnyKHR": 4429, - "OpSubgroupAllEqualKHR": 4430, - "OpSubgroupReadInvocationKHR": 4432, - "OpGroupIAddNonUniformAMD": 5000, - "OpGroupFAddNonUniformAMD": 5001, - "OpGroupFMinNonUniformAMD": 5002, - "OpGroupUMinNonUniformAMD": 5003, - "OpGroupSMinNonUniformAMD": 5004, - "OpGroupFMaxNonUniformAMD": 5005, - "OpGroupUMaxNonUniformAMD": 5006, - "OpGroupSMaxNonUniformAMD": 5007, - "OpFragmentMaskFetchAMD": 5011, - "OpFragmentFetchAMD": 5012, - "OpSubgroupShuffleINTEL": 5571, - "OpSubgroupShuffleDownINTEL": 5572, - "OpSubgroupShuffleUpINTEL": 5573, - "OpSubgroupShuffleXorINTEL": 5574, - "OpSubgroupBlockReadINTEL": 5575, - "OpSubgroupBlockWriteINTEL": 5576, - "OpSubgroupImageBlockReadINTEL": 5577, - "OpSubgroupImageBlockWriteINTEL": 5578, - "OpDecorateStringGOOGLE": 5632, - "OpMemberDecorateStringGOOGLE": 5633 - } - } - ] - } -} - diff --git a/include/spirv/1.1/spirv.lua b/include/spirv/1.1/spirv.lua deleted file mode 100644 index ad34e0ab..00000000 --- a/include/spirv/1.1/spirv.lua +++ /dev/null @@ -1,971 +0,0 @@ --- Copyright (c) 2014-2018 The Khronos Group Inc. --- --- Permission is hereby granted, free of charge, to any person obtaining a copy --- of this software and/or associated documentation files (the "Materials"), --- to deal in the Materials without restriction, including without limitation --- the rights to use, copy, modify, merge, publish, distribute, sublicense, --- and/or sell copies of the Materials, and to permit persons to whom the --- Materials are furnished to do so, subject to the following conditions: --- --- The above copyright notice and this permission notice shall be included in --- all copies or substantial portions of the Materials. --- --- MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS --- STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND --- HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ --- --- THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL --- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING --- FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS --- IN THE MATERIALS. - --- This header is automatically generated by the same tool that creates --- the Binary Section of the SPIR-V specification. - --- Enumeration tokens for SPIR-V, in various styles: --- C, C++, C++11, JSON, Lua, Python --- --- - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL --- - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL --- - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL --- - Lua will use tables, e.g.: spv.SourceLanguage.GLSL --- - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] --- --- Some tokens act like mask values, which can be OR'd together, --- while others are mutually exclusive. The mask-like ones have --- "Mask" in their name, and a parallel enum that has the shift --- amount (1 << x) for each corresponding enumerant. - -spv = { - MagicNumber = 0x07230203, - Version = 0x00010100, - Revision = 8, - OpCodeMask = 0xffff, - WordCountShift = 16, - - SourceLanguage = { - Unknown = 0, - ESSL = 1, - GLSL = 2, - OpenCL_C = 3, - OpenCL_CPP = 4, - HLSL = 5, - }, - - ExecutionModel = { - Vertex = 0, - TessellationControl = 1, - TessellationEvaluation = 2, - Geometry = 3, - Fragment = 4, - GLCompute = 5, - Kernel = 6, - }, - - AddressingModel = { - Logical = 0, - Physical32 = 1, - Physical64 = 2, - }, - - MemoryModel = { - Simple = 0, - GLSL450 = 1, - OpenCL = 2, - }, - - ExecutionMode = { - Invocations = 0, - SpacingEqual = 1, - SpacingFractionalEven = 2, - SpacingFractionalOdd = 3, - VertexOrderCw = 4, - VertexOrderCcw = 5, - PixelCenterInteger = 6, - OriginUpperLeft = 7, - OriginLowerLeft = 8, - EarlyFragmentTests = 9, - PointMode = 10, - Xfb = 11, - DepthReplacing = 12, - DepthGreater = 14, - DepthLess = 15, - DepthUnchanged = 16, - LocalSize = 17, - LocalSizeHint = 18, - InputPoints = 19, - InputLines = 20, - InputLinesAdjacency = 21, - Triangles = 22, - InputTrianglesAdjacency = 23, - Quads = 24, - Isolines = 25, - OutputVertices = 26, - OutputPoints = 27, - OutputLineStrip = 28, - OutputTriangleStrip = 29, - VecTypeHint = 30, - ContractionOff = 31, - Initializer = 33, - Finalizer = 34, - SubgroupSize = 35, - SubgroupsPerWorkgroup = 36, - PostDepthCoverage = 4446, - StencilRefReplacingEXT = 5027, - }, - - StorageClass = { - UniformConstant = 0, - Input = 1, - Uniform = 2, - Output = 3, - Workgroup = 4, - CrossWorkgroup = 5, - Private = 6, - Function = 7, - Generic = 8, - PushConstant = 9, - AtomicCounter = 10, - Image = 11, - StorageBuffer = 12, - }, - - Dim = { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - Cube = 3, - Rect = 4, - Buffer = 5, - SubpassData = 6, - }, - - SamplerAddressingMode = { - None = 0, - ClampToEdge = 1, - Clamp = 2, - Repeat = 3, - RepeatMirrored = 4, - }, - - SamplerFilterMode = { - Nearest = 0, - Linear = 1, - }, - - ImageFormat = { - Unknown = 0, - Rgba32f = 1, - Rgba16f = 2, - R32f = 3, - Rgba8 = 4, - Rgba8Snorm = 5, - Rg32f = 6, - Rg16f = 7, - R11fG11fB10f = 8, - R16f = 9, - Rgba16 = 10, - Rgb10A2 = 11, - Rg16 = 12, - Rg8 = 13, - R16 = 14, - R8 = 15, - Rgba16Snorm = 16, - Rg16Snorm = 17, - Rg8Snorm = 18, - R16Snorm = 19, - R8Snorm = 20, - Rgba32i = 21, - Rgba16i = 22, - Rgba8i = 23, - R32i = 24, - Rg32i = 25, - Rg16i = 26, - Rg8i = 27, - R16i = 28, - R8i = 29, - Rgba32ui = 30, - Rgba16ui = 31, - Rgba8ui = 32, - R32ui = 33, - Rgb10a2ui = 34, - Rg32ui = 35, - Rg16ui = 36, - Rg8ui = 37, - R16ui = 38, - R8ui = 39, - }, - - ImageChannelOrder = { - R = 0, - A = 1, - RG = 2, - RA = 3, - RGB = 4, - RGBA = 5, - BGRA = 6, - ARGB = 7, - Intensity = 8, - Luminance = 9, - Rx = 10, - RGx = 11, - RGBx = 12, - Depth = 13, - DepthStencil = 14, - sRGB = 15, - sRGBx = 16, - sRGBA = 17, - sBGRA = 18, - ABGR = 19, - }, - - ImageChannelDataType = { - SnormInt8 = 0, - SnormInt16 = 1, - UnormInt8 = 2, - UnormInt16 = 3, - UnormShort565 = 4, - UnormShort555 = 5, - UnormInt101010 = 6, - SignedInt8 = 7, - SignedInt16 = 8, - SignedInt32 = 9, - UnsignedInt8 = 10, - UnsignedInt16 = 11, - UnsignedInt32 = 12, - HalfFloat = 13, - Float = 14, - UnormInt24 = 15, - UnormInt101010_2 = 16, - }, - - ImageOperandsShift = { - Bias = 0, - Lod = 1, - Grad = 2, - ConstOffset = 3, - Offset = 4, - ConstOffsets = 5, - Sample = 6, - MinLod = 7, - }, - - ImageOperandsMask = { - MaskNone = 0, - Bias = 0x00000001, - Lod = 0x00000002, - Grad = 0x00000004, - ConstOffset = 0x00000008, - Offset = 0x00000010, - ConstOffsets = 0x00000020, - Sample = 0x00000040, - MinLod = 0x00000080, - }, - - FPFastMathModeShift = { - NotNaN = 0, - NotInf = 1, - NSZ = 2, - AllowRecip = 3, - Fast = 4, - }, - - FPFastMathModeMask = { - MaskNone = 0, - NotNaN = 0x00000001, - NotInf = 0x00000002, - NSZ = 0x00000004, - AllowRecip = 0x00000008, - Fast = 0x00000010, - }, - - FPRoundingMode = { - RTE = 0, - RTZ = 1, - RTP = 2, - RTN = 3, - }, - - LinkageType = { - Export = 0, - Import = 1, - }, - - AccessQualifier = { - ReadOnly = 0, - WriteOnly = 1, - ReadWrite = 2, - }, - - FunctionParameterAttribute = { - Zext = 0, - Sext = 1, - ByVal = 2, - Sret = 3, - NoAlias = 4, - NoCapture = 5, - NoWrite = 6, - NoReadWrite = 7, - }, - - Decoration = { - RelaxedPrecision = 0, - SpecId = 1, - Block = 2, - BufferBlock = 3, - RowMajor = 4, - ColMajor = 5, - ArrayStride = 6, - MatrixStride = 7, - GLSLShared = 8, - GLSLPacked = 9, - CPacked = 10, - BuiltIn = 11, - NoPerspective = 13, - Flat = 14, - Patch = 15, - Centroid = 16, - Sample = 17, - Invariant = 18, - Restrict = 19, - Aliased = 20, - Volatile = 21, - Constant = 22, - Coherent = 23, - NonWritable = 24, - NonReadable = 25, - Uniform = 26, - SaturatedConversion = 28, - Stream = 29, - Location = 30, - Component = 31, - Index = 32, - Binding = 33, - DescriptorSet = 34, - Offset = 35, - XfbBuffer = 36, - XfbStride = 37, - FuncParamAttr = 38, - FPRoundingMode = 39, - FPFastMathMode = 40, - LinkageAttributes = 41, - NoContraction = 42, - InputAttachmentIndex = 43, - Alignment = 44, - MaxByteOffset = 45, - ExplicitInterpAMD = 4999, - OverrideCoverageNV = 5248, - PassthroughNV = 5250, - ViewportRelativeNV = 5252, - SecondaryViewportRelativeNV = 5256, - HlslCounterBufferGOOGLE = 5634, - HlslSemanticGOOGLE = 5635, - }, - - BuiltIn = { - Position = 0, - PointSize = 1, - ClipDistance = 3, - CullDistance = 4, - VertexId = 5, - InstanceId = 6, - PrimitiveId = 7, - InvocationId = 8, - Layer = 9, - ViewportIndex = 10, - TessLevelOuter = 11, - TessLevelInner = 12, - TessCoord = 13, - PatchVertices = 14, - FragCoord = 15, - PointCoord = 16, - FrontFacing = 17, - SampleId = 18, - SamplePosition = 19, - SampleMask = 20, - FragDepth = 22, - HelperInvocation = 23, - NumWorkgroups = 24, - WorkgroupSize = 25, - WorkgroupId = 26, - LocalInvocationId = 27, - GlobalInvocationId = 28, - LocalInvocationIndex = 29, - WorkDim = 30, - GlobalSize = 31, - EnqueuedWorkgroupSize = 32, - GlobalOffset = 33, - GlobalLinearId = 34, - SubgroupSize = 36, - SubgroupMaxSize = 37, - NumSubgroups = 38, - NumEnqueuedSubgroups = 39, - SubgroupId = 40, - SubgroupLocalInvocationId = 41, - VertexIndex = 42, - InstanceIndex = 43, - SubgroupEqMaskKHR = 4416, - SubgroupGeMaskKHR = 4417, - SubgroupGtMaskKHR = 4418, - SubgroupLeMaskKHR = 4419, - SubgroupLtMaskKHR = 4420, - BaseVertex = 4424, - BaseInstance = 4425, - DrawIndex = 4426, - DeviceIndex = 4438, - ViewIndex = 4440, - BaryCoordNoPerspAMD = 4992, - BaryCoordNoPerspCentroidAMD = 4993, - BaryCoordNoPerspSampleAMD = 4994, - BaryCoordSmoothAMD = 4995, - BaryCoordSmoothCentroidAMD = 4996, - BaryCoordSmoothSampleAMD = 4997, - BaryCoordPullModelAMD = 4998, - FragStencilRefEXT = 5014, - ViewportMaskNV = 5253, - SecondaryPositionNV = 5257, - SecondaryViewportMaskNV = 5258, - PositionPerViewNV = 5261, - ViewportMaskPerViewNV = 5262, - }, - - SelectionControlShift = { - Flatten = 0, - DontFlatten = 1, - }, - - SelectionControlMask = { - MaskNone = 0, - Flatten = 0x00000001, - DontFlatten = 0x00000002, - }, - - LoopControlShift = { - Unroll = 0, - DontUnroll = 1, - DependencyInfinite = 2, - DependencyLength = 3, - }, - - LoopControlMask = { - MaskNone = 0, - Unroll = 0x00000001, - DontUnroll = 0x00000002, - DependencyInfinite = 0x00000004, - DependencyLength = 0x00000008, - }, - - FunctionControlShift = { - Inline = 0, - DontInline = 1, - Pure = 2, - Const = 3, - }, - - FunctionControlMask = { - MaskNone = 0, - Inline = 0x00000001, - DontInline = 0x00000002, - Pure = 0x00000004, - Const = 0x00000008, - }, - - MemorySemanticsShift = { - Acquire = 1, - Release = 2, - AcquireRelease = 3, - SequentiallyConsistent = 4, - UniformMemory = 6, - SubgroupMemory = 7, - WorkgroupMemory = 8, - CrossWorkgroupMemory = 9, - AtomicCounterMemory = 10, - ImageMemory = 11, - }, - - MemorySemanticsMask = { - MaskNone = 0, - Acquire = 0x00000002, - Release = 0x00000004, - AcquireRelease = 0x00000008, - SequentiallyConsistent = 0x00000010, - UniformMemory = 0x00000040, - SubgroupMemory = 0x00000080, - WorkgroupMemory = 0x00000100, - CrossWorkgroupMemory = 0x00000200, - AtomicCounterMemory = 0x00000400, - ImageMemory = 0x00000800, - }, - - MemoryAccessShift = { - Volatile = 0, - Aligned = 1, - Nontemporal = 2, - }, - - MemoryAccessMask = { - MaskNone = 0, - Volatile = 0x00000001, - Aligned = 0x00000002, - Nontemporal = 0x00000004, - }, - - Scope = { - CrossDevice = 0, - Device = 1, - Workgroup = 2, - Subgroup = 3, - Invocation = 4, - }, - - GroupOperation = { - Reduce = 0, - InclusiveScan = 1, - ExclusiveScan = 2, - }, - - KernelEnqueueFlags = { - NoWait = 0, - WaitKernel = 1, - WaitWorkGroup = 2, - }, - - KernelProfilingInfoShift = { - CmdExecTime = 0, - }, - - KernelProfilingInfoMask = { - MaskNone = 0, - CmdExecTime = 0x00000001, - }, - - Capability = { - Matrix = 0, - Shader = 1, - Geometry = 2, - Tessellation = 3, - Addresses = 4, - Linkage = 5, - Kernel = 6, - Vector16 = 7, - Float16Buffer = 8, - Float16 = 9, - Float64 = 10, - Int64 = 11, - Int64Atomics = 12, - ImageBasic = 13, - ImageReadWrite = 14, - ImageMipmap = 15, - Pipes = 17, - Groups = 18, - DeviceEnqueue = 19, - LiteralSampler = 20, - AtomicStorage = 21, - Int16 = 22, - TessellationPointSize = 23, - GeometryPointSize = 24, - ImageGatherExtended = 25, - StorageImageMultisample = 27, - UniformBufferArrayDynamicIndexing = 28, - SampledImageArrayDynamicIndexing = 29, - StorageBufferArrayDynamicIndexing = 30, - StorageImageArrayDynamicIndexing = 31, - ClipDistance = 32, - CullDistance = 33, - ImageCubeArray = 34, - SampleRateShading = 35, - ImageRect = 36, - SampledRect = 37, - GenericPointer = 38, - Int8 = 39, - InputAttachment = 40, - SparseResidency = 41, - MinLod = 42, - Sampled1D = 43, - Image1D = 44, - SampledCubeArray = 45, - SampledBuffer = 46, - ImageBuffer = 47, - ImageMSArray = 48, - StorageImageExtendedFormats = 49, - ImageQuery = 50, - DerivativeControl = 51, - InterpolationFunction = 52, - TransformFeedback = 53, - GeometryStreams = 54, - StorageImageReadWithoutFormat = 55, - StorageImageWriteWithoutFormat = 56, - MultiViewport = 57, - SubgroupDispatch = 58, - NamedBarrier = 59, - PipeStorage = 60, - SubgroupBallotKHR = 4423, - DrawParameters = 4427, - SubgroupVoteKHR = 4431, - StorageBuffer16BitAccess = 4433, - StorageUniformBufferBlock16 = 4433, - StorageUniform16 = 4434, - UniformAndStorageBuffer16BitAccess = 4434, - StoragePushConstant16 = 4435, - StorageInputOutput16 = 4436, - DeviceGroup = 4437, - MultiView = 4439, - VariablePointersStorageBuffer = 4441, - VariablePointers = 4442, - AtomicStorageOps = 4445, - SampleMaskPostDepthCoverage = 4447, - ImageGatherBiasLodAMD = 5009, - FragmentMaskAMD = 5010, - StencilExportEXT = 5013, - ImageReadWriteLodAMD = 5015, - SampleMaskOverrideCoverageNV = 5249, - GeometryShaderPassthroughNV = 5251, - ShaderViewportIndexLayerEXT = 5254, - ShaderViewportIndexLayerNV = 5254, - ShaderViewportMaskNV = 5255, - ShaderStereoViewNV = 5259, - PerViewAttributesNV = 5260, - SubgroupShuffleINTEL = 5568, - SubgroupBufferBlockIOINTEL = 5569, - SubgroupImageBlockIOINTEL = 5570, - }, - - Op = { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, - OpImageSparseRead = 320, - OpSizeOf = 321, - OpTypePipeStorage = 322, - OpConstantPipeStorage = 323, - OpCreatePipeFromPipeStorage = 324, - OpGetKernelLocalSizeForSubgroupCount = 325, - OpGetKernelMaxNumSubgroups = 326, - OpTypeNamedBarrier = 327, - OpNamedBarrierInitialize = 328, - OpMemoryNamedBarrier = 329, - OpModuleProcessed = 330, - OpDecorateId = 332, - OpSubgroupBallotKHR = 4421, - OpSubgroupFirstInvocationKHR = 4422, - OpSubgroupAllKHR = 4428, - OpSubgroupAnyKHR = 4429, - OpSubgroupAllEqualKHR = 4430, - OpSubgroupReadInvocationKHR = 4432, - OpGroupIAddNonUniformAMD = 5000, - OpGroupFAddNonUniformAMD = 5001, - OpGroupFMinNonUniformAMD = 5002, - OpGroupUMinNonUniformAMD = 5003, - OpGroupSMinNonUniformAMD = 5004, - OpGroupFMaxNonUniformAMD = 5005, - OpGroupUMaxNonUniformAMD = 5006, - OpGroupSMaxNonUniformAMD = 5007, - OpFragmentMaskFetchAMD = 5011, - OpFragmentFetchAMD = 5012, - OpSubgroupShuffleINTEL = 5571, - OpSubgroupShuffleDownINTEL = 5572, - OpSubgroupShuffleUpINTEL = 5573, - OpSubgroupShuffleXorINTEL = 5574, - OpSubgroupBlockReadINTEL = 5575, - OpSubgroupBlockWriteINTEL = 5576, - OpSubgroupImageBlockReadINTEL = 5577, - OpSubgroupImageBlockWriteINTEL = 5578, - OpDecorateStringGOOGLE = 5632, - OpMemberDecorateStringGOOGLE = 5633, - }, - -} - diff --git a/include/spirv/1.1/spirv.py b/include/spirv/1.1/spirv.py deleted file mode 100644 index 519a5971..00000000 --- a/include/spirv/1.1/spirv.py +++ /dev/null @@ -1,971 +0,0 @@ -# Copyright (c) 2014-2018 The Khronos Group Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and/or associated documentation files (the "Materials"), -# to deal in the Materials without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Materials, and to permit persons to whom the -# Materials are furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Materials. -# -# MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -# STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -# HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -# -# THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -# IN THE MATERIALS. - -# This header is automatically generated by the same tool that creates -# the Binary Section of the SPIR-V specification. - -# Enumeration tokens for SPIR-V, in various styles: -# C, C++, C++11, JSON, Lua, Python -# -# - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -# - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -# - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -# - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -# - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -# -# Some tokens act like mask values, which can be OR'd together, -# while others are mutually exclusive. The mask-like ones have -# "Mask" in their name, and a parallel enum that has the shift -# amount (1 << x) for each corresponding enumerant. - -spv = { - 'MagicNumber' : 0x07230203, - 'Version' : 0x00010100, - 'Revision' : 8, - 'OpCodeMask' : 0xffff, - 'WordCountShift' : 16, - - 'SourceLanguage' : { - 'Unknown' : 0, - 'ESSL' : 1, - 'GLSL' : 2, - 'OpenCL_C' : 3, - 'OpenCL_CPP' : 4, - 'HLSL' : 5, - }, - - 'ExecutionModel' : { - 'Vertex' : 0, - 'TessellationControl' : 1, - 'TessellationEvaluation' : 2, - 'Geometry' : 3, - 'Fragment' : 4, - 'GLCompute' : 5, - 'Kernel' : 6, - }, - - 'AddressingModel' : { - 'Logical' : 0, - 'Physical32' : 1, - 'Physical64' : 2, - }, - - 'MemoryModel' : { - 'Simple' : 0, - 'GLSL450' : 1, - 'OpenCL' : 2, - }, - - 'ExecutionMode' : { - 'Invocations' : 0, - 'SpacingEqual' : 1, - 'SpacingFractionalEven' : 2, - 'SpacingFractionalOdd' : 3, - 'VertexOrderCw' : 4, - 'VertexOrderCcw' : 5, - 'PixelCenterInteger' : 6, - 'OriginUpperLeft' : 7, - 'OriginLowerLeft' : 8, - 'EarlyFragmentTests' : 9, - 'PointMode' : 10, - 'Xfb' : 11, - 'DepthReplacing' : 12, - 'DepthGreater' : 14, - 'DepthLess' : 15, - 'DepthUnchanged' : 16, - 'LocalSize' : 17, - 'LocalSizeHint' : 18, - 'InputPoints' : 19, - 'InputLines' : 20, - 'InputLinesAdjacency' : 21, - 'Triangles' : 22, - 'InputTrianglesAdjacency' : 23, - 'Quads' : 24, - 'Isolines' : 25, - 'OutputVertices' : 26, - 'OutputPoints' : 27, - 'OutputLineStrip' : 28, - 'OutputTriangleStrip' : 29, - 'VecTypeHint' : 30, - 'ContractionOff' : 31, - 'Initializer' : 33, - 'Finalizer' : 34, - 'SubgroupSize' : 35, - 'SubgroupsPerWorkgroup' : 36, - 'PostDepthCoverage' : 4446, - 'StencilRefReplacingEXT' : 5027, - }, - - 'StorageClass' : { - 'UniformConstant' : 0, - 'Input' : 1, - 'Uniform' : 2, - 'Output' : 3, - 'Workgroup' : 4, - 'CrossWorkgroup' : 5, - 'Private' : 6, - 'Function' : 7, - 'Generic' : 8, - 'PushConstant' : 9, - 'AtomicCounter' : 10, - 'Image' : 11, - 'StorageBuffer' : 12, - }, - - 'Dim' : { - 'Dim1D' : 0, - 'Dim2D' : 1, - 'Dim3D' : 2, - 'Cube' : 3, - 'Rect' : 4, - 'Buffer' : 5, - 'SubpassData' : 6, - }, - - 'SamplerAddressingMode' : { - 'None' : 0, - 'ClampToEdge' : 1, - 'Clamp' : 2, - 'Repeat' : 3, - 'RepeatMirrored' : 4, - }, - - 'SamplerFilterMode' : { - 'Nearest' : 0, - 'Linear' : 1, - }, - - 'ImageFormat' : { - 'Unknown' : 0, - 'Rgba32f' : 1, - 'Rgba16f' : 2, - 'R32f' : 3, - 'Rgba8' : 4, - 'Rgba8Snorm' : 5, - 'Rg32f' : 6, - 'Rg16f' : 7, - 'R11fG11fB10f' : 8, - 'R16f' : 9, - 'Rgba16' : 10, - 'Rgb10A2' : 11, - 'Rg16' : 12, - 'Rg8' : 13, - 'R16' : 14, - 'R8' : 15, - 'Rgba16Snorm' : 16, - 'Rg16Snorm' : 17, - 'Rg8Snorm' : 18, - 'R16Snorm' : 19, - 'R8Snorm' : 20, - 'Rgba32i' : 21, - 'Rgba16i' : 22, - 'Rgba8i' : 23, - 'R32i' : 24, - 'Rg32i' : 25, - 'Rg16i' : 26, - 'Rg8i' : 27, - 'R16i' : 28, - 'R8i' : 29, - 'Rgba32ui' : 30, - 'Rgba16ui' : 31, - 'Rgba8ui' : 32, - 'R32ui' : 33, - 'Rgb10a2ui' : 34, - 'Rg32ui' : 35, - 'Rg16ui' : 36, - 'Rg8ui' : 37, - 'R16ui' : 38, - 'R8ui' : 39, - }, - - 'ImageChannelOrder' : { - 'R' : 0, - 'A' : 1, - 'RG' : 2, - 'RA' : 3, - 'RGB' : 4, - 'RGBA' : 5, - 'BGRA' : 6, - 'ARGB' : 7, - 'Intensity' : 8, - 'Luminance' : 9, - 'Rx' : 10, - 'RGx' : 11, - 'RGBx' : 12, - 'Depth' : 13, - 'DepthStencil' : 14, - 'sRGB' : 15, - 'sRGBx' : 16, - 'sRGBA' : 17, - 'sBGRA' : 18, - 'ABGR' : 19, - }, - - 'ImageChannelDataType' : { - 'SnormInt8' : 0, - 'SnormInt16' : 1, - 'UnormInt8' : 2, - 'UnormInt16' : 3, - 'UnormShort565' : 4, - 'UnormShort555' : 5, - 'UnormInt101010' : 6, - 'SignedInt8' : 7, - 'SignedInt16' : 8, - 'SignedInt32' : 9, - 'UnsignedInt8' : 10, - 'UnsignedInt16' : 11, - 'UnsignedInt32' : 12, - 'HalfFloat' : 13, - 'Float' : 14, - 'UnormInt24' : 15, - 'UnormInt101010_2' : 16, - }, - - 'ImageOperandsShift' : { - 'Bias' : 0, - 'Lod' : 1, - 'Grad' : 2, - 'ConstOffset' : 3, - 'Offset' : 4, - 'ConstOffsets' : 5, - 'Sample' : 6, - 'MinLod' : 7, - }, - - 'ImageOperandsMask' : { - 'MaskNone' : 0, - 'Bias' : 0x00000001, - 'Lod' : 0x00000002, - 'Grad' : 0x00000004, - 'ConstOffset' : 0x00000008, - 'Offset' : 0x00000010, - 'ConstOffsets' : 0x00000020, - 'Sample' : 0x00000040, - 'MinLod' : 0x00000080, - }, - - 'FPFastMathModeShift' : { - 'NotNaN' : 0, - 'NotInf' : 1, - 'NSZ' : 2, - 'AllowRecip' : 3, - 'Fast' : 4, - }, - - 'FPFastMathModeMask' : { - 'MaskNone' : 0, - 'NotNaN' : 0x00000001, - 'NotInf' : 0x00000002, - 'NSZ' : 0x00000004, - 'AllowRecip' : 0x00000008, - 'Fast' : 0x00000010, - }, - - 'FPRoundingMode' : { - 'RTE' : 0, - 'RTZ' : 1, - 'RTP' : 2, - 'RTN' : 3, - }, - - 'LinkageType' : { - 'Export' : 0, - 'Import' : 1, - }, - - 'AccessQualifier' : { - 'ReadOnly' : 0, - 'WriteOnly' : 1, - 'ReadWrite' : 2, - }, - - 'FunctionParameterAttribute' : { - 'Zext' : 0, - 'Sext' : 1, - 'ByVal' : 2, - 'Sret' : 3, - 'NoAlias' : 4, - 'NoCapture' : 5, - 'NoWrite' : 6, - 'NoReadWrite' : 7, - }, - - 'Decoration' : { - 'RelaxedPrecision' : 0, - 'SpecId' : 1, - 'Block' : 2, - 'BufferBlock' : 3, - 'RowMajor' : 4, - 'ColMajor' : 5, - 'ArrayStride' : 6, - 'MatrixStride' : 7, - 'GLSLShared' : 8, - 'GLSLPacked' : 9, - 'CPacked' : 10, - 'BuiltIn' : 11, - 'NoPerspective' : 13, - 'Flat' : 14, - 'Patch' : 15, - 'Centroid' : 16, - 'Sample' : 17, - 'Invariant' : 18, - 'Restrict' : 19, - 'Aliased' : 20, - 'Volatile' : 21, - 'Constant' : 22, - 'Coherent' : 23, - 'NonWritable' : 24, - 'NonReadable' : 25, - 'Uniform' : 26, - 'SaturatedConversion' : 28, - 'Stream' : 29, - 'Location' : 30, - 'Component' : 31, - 'Index' : 32, - 'Binding' : 33, - 'DescriptorSet' : 34, - 'Offset' : 35, - 'XfbBuffer' : 36, - 'XfbStride' : 37, - 'FuncParamAttr' : 38, - 'FPRoundingMode' : 39, - 'FPFastMathMode' : 40, - 'LinkageAttributes' : 41, - 'NoContraction' : 42, - 'InputAttachmentIndex' : 43, - 'Alignment' : 44, - 'MaxByteOffset' : 45, - 'ExplicitInterpAMD' : 4999, - 'OverrideCoverageNV' : 5248, - 'PassthroughNV' : 5250, - 'ViewportRelativeNV' : 5252, - 'SecondaryViewportRelativeNV' : 5256, - 'HlslCounterBufferGOOGLE' : 5634, - 'HlslSemanticGOOGLE' : 5635, - }, - - 'BuiltIn' : { - 'Position' : 0, - 'PointSize' : 1, - 'ClipDistance' : 3, - 'CullDistance' : 4, - 'VertexId' : 5, - 'InstanceId' : 6, - 'PrimitiveId' : 7, - 'InvocationId' : 8, - 'Layer' : 9, - 'ViewportIndex' : 10, - 'TessLevelOuter' : 11, - 'TessLevelInner' : 12, - 'TessCoord' : 13, - 'PatchVertices' : 14, - 'FragCoord' : 15, - 'PointCoord' : 16, - 'FrontFacing' : 17, - 'SampleId' : 18, - 'SamplePosition' : 19, - 'SampleMask' : 20, - 'FragDepth' : 22, - 'HelperInvocation' : 23, - 'NumWorkgroups' : 24, - 'WorkgroupSize' : 25, - 'WorkgroupId' : 26, - 'LocalInvocationId' : 27, - 'GlobalInvocationId' : 28, - 'LocalInvocationIndex' : 29, - 'WorkDim' : 30, - 'GlobalSize' : 31, - 'EnqueuedWorkgroupSize' : 32, - 'GlobalOffset' : 33, - 'GlobalLinearId' : 34, - 'SubgroupSize' : 36, - 'SubgroupMaxSize' : 37, - 'NumSubgroups' : 38, - 'NumEnqueuedSubgroups' : 39, - 'SubgroupId' : 40, - 'SubgroupLocalInvocationId' : 41, - 'VertexIndex' : 42, - 'InstanceIndex' : 43, - 'SubgroupEqMaskKHR' : 4416, - 'SubgroupGeMaskKHR' : 4417, - 'SubgroupGtMaskKHR' : 4418, - 'SubgroupLeMaskKHR' : 4419, - 'SubgroupLtMaskKHR' : 4420, - 'BaseVertex' : 4424, - 'BaseInstance' : 4425, - 'DrawIndex' : 4426, - 'DeviceIndex' : 4438, - 'ViewIndex' : 4440, - 'BaryCoordNoPerspAMD' : 4992, - 'BaryCoordNoPerspCentroidAMD' : 4993, - 'BaryCoordNoPerspSampleAMD' : 4994, - 'BaryCoordSmoothAMD' : 4995, - 'BaryCoordSmoothCentroidAMD' : 4996, - 'BaryCoordSmoothSampleAMD' : 4997, - 'BaryCoordPullModelAMD' : 4998, - 'FragStencilRefEXT' : 5014, - 'ViewportMaskNV' : 5253, - 'SecondaryPositionNV' : 5257, - 'SecondaryViewportMaskNV' : 5258, - 'PositionPerViewNV' : 5261, - 'ViewportMaskPerViewNV' : 5262, - }, - - 'SelectionControlShift' : { - 'Flatten' : 0, - 'DontFlatten' : 1, - }, - - 'SelectionControlMask' : { - 'MaskNone' : 0, - 'Flatten' : 0x00000001, - 'DontFlatten' : 0x00000002, - }, - - 'LoopControlShift' : { - 'Unroll' : 0, - 'DontUnroll' : 1, - 'DependencyInfinite' : 2, - 'DependencyLength' : 3, - }, - - 'LoopControlMask' : { - 'MaskNone' : 0, - 'Unroll' : 0x00000001, - 'DontUnroll' : 0x00000002, - 'DependencyInfinite' : 0x00000004, - 'DependencyLength' : 0x00000008, - }, - - 'FunctionControlShift' : { - 'Inline' : 0, - 'DontInline' : 1, - 'Pure' : 2, - 'Const' : 3, - }, - - 'FunctionControlMask' : { - 'MaskNone' : 0, - 'Inline' : 0x00000001, - 'DontInline' : 0x00000002, - 'Pure' : 0x00000004, - 'Const' : 0x00000008, - }, - - 'MemorySemanticsShift' : { - 'Acquire' : 1, - 'Release' : 2, - 'AcquireRelease' : 3, - 'SequentiallyConsistent' : 4, - 'UniformMemory' : 6, - 'SubgroupMemory' : 7, - 'WorkgroupMemory' : 8, - 'CrossWorkgroupMemory' : 9, - 'AtomicCounterMemory' : 10, - 'ImageMemory' : 11, - }, - - 'MemorySemanticsMask' : { - 'MaskNone' : 0, - 'Acquire' : 0x00000002, - 'Release' : 0x00000004, - 'AcquireRelease' : 0x00000008, - 'SequentiallyConsistent' : 0x00000010, - 'UniformMemory' : 0x00000040, - 'SubgroupMemory' : 0x00000080, - 'WorkgroupMemory' : 0x00000100, - 'CrossWorkgroupMemory' : 0x00000200, - 'AtomicCounterMemory' : 0x00000400, - 'ImageMemory' : 0x00000800, - }, - - 'MemoryAccessShift' : { - 'Volatile' : 0, - 'Aligned' : 1, - 'Nontemporal' : 2, - }, - - 'MemoryAccessMask' : { - 'MaskNone' : 0, - 'Volatile' : 0x00000001, - 'Aligned' : 0x00000002, - 'Nontemporal' : 0x00000004, - }, - - 'Scope' : { - 'CrossDevice' : 0, - 'Device' : 1, - 'Workgroup' : 2, - 'Subgroup' : 3, - 'Invocation' : 4, - }, - - 'GroupOperation' : { - 'Reduce' : 0, - 'InclusiveScan' : 1, - 'ExclusiveScan' : 2, - }, - - 'KernelEnqueueFlags' : { - 'NoWait' : 0, - 'WaitKernel' : 1, - 'WaitWorkGroup' : 2, - }, - - 'KernelProfilingInfoShift' : { - 'CmdExecTime' : 0, - }, - - 'KernelProfilingInfoMask' : { - 'MaskNone' : 0, - 'CmdExecTime' : 0x00000001, - }, - - 'Capability' : { - 'Matrix' : 0, - 'Shader' : 1, - 'Geometry' : 2, - 'Tessellation' : 3, - 'Addresses' : 4, - 'Linkage' : 5, - 'Kernel' : 6, - 'Vector16' : 7, - 'Float16Buffer' : 8, - 'Float16' : 9, - 'Float64' : 10, - 'Int64' : 11, - 'Int64Atomics' : 12, - 'ImageBasic' : 13, - 'ImageReadWrite' : 14, - 'ImageMipmap' : 15, - 'Pipes' : 17, - 'Groups' : 18, - 'DeviceEnqueue' : 19, - 'LiteralSampler' : 20, - 'AtomicStorage' : 21, - 'Int16' : 22, - 'TessellationPointSize' : 23, - 'GeometryPointSize' : 24, - 'ImageGatherExtended' : 25, - 'StorageImageMultisample' : 27, - 'UniformBufferArrayDynamicIndexing' : 28, - 'SampledImageArrayDynamicIndexing' : 29, - 'StorageBufferArrayDynamicIndexing' : 30, - 'StorageImageArrayDynamicIndexing' : 31, - 'ClipDistance' : 32, - 'CullDistance' : 33, - 'ImageCubeArray' : 34, - 'SampleRateShading' : 35, - 'ImageRect' : 36, - 'SampledRect' : 37, - 'GenericPointer' : 38, - 'Int8' : 39, - 'InputAttachment' : 40, - 'SparseResidency' : 41, - 'MinLod' : 42, - 'Sampled1D' : 43, - 'Image1D' : 44, - 'SampledCubeArray' : 45, - 'SampledBuffer' : 46, - 'ImageBuffer' : 47, - 'ImageMSArray' : 48, - 'StorageImageExtendedFormats' : 49, - 'ImageQuery' : 50, - 'DerivativeControl' : 51, - 'InterpolationFunction' : 52, - 'TransformFeedback' : 53, - 'GeometryStreams' : 54, - 'StorageImageReadWithoutFormat' : 55, - 'StorageImageWriteWithoutFormat' : 56, - 'MultiViewport' : 57, - 'SubgroupDispatch' : 58, - 'NamedBarrier' : 59, - 'PipeStorage' : 60, - 'SubgroupBallotKHR' : 4423, - 'DrawParameters' : 4427, - 'SubgroupVoteKHR' : 4431, - 'StorageBuffer16BitAccess' : 4433, - 'StorageUniformBufferBlock16' : 4433, - 'StorageUniform16' : 4434, - 'UniformAndStorageBuffer16BitAccess' : 4434, - 'StoragePushConstant16' : 4435, - 'StorageInputOutput16' : 4436, - 'DeviceGroup' : 4437, - 'MultiView' : 4439, - 'VariablePointersStorageBuffer' : 4441, - 'VariablePointers' : 4442, - 'AtomicStorageOps' : 4445, - 'SampleMaskPostDepthCoverage' : 4447, - 'ImageGatherBiasLodAMD' : 5009, - 'FragmentMaskAMD' : 5010, - 'StencilExportEXT' : 5013, - 'ImageReadWriteLodAMD' : 5015, - 'SampleMaskOverrideCoverageNV' : 5249, - 'GeometryShaderPassthroughNV' : 5251, - 'ShaderViewportIndexLayerEXT' : 5254, - 'ShaderViewportIndexLayerNV' : 5254, - 'ShaderViewportMaskNV' : 5255, - 'ShaderStereoViewNV' : 5259, - 'PerViewAttributesNV' : 5260, - 'SubgroupShuffleINTEL' : 5568, - 'SubgroupBufferBlockIOINTEL' : 5569, - 'SubgroupImageBlockIOINTEL' : 5570, - }, - - 'Op' : { - 'OpNop' : 0, - 'OpUndef' : 1, - 'OpSourceContinued' : 2, - 'OpSource' : 3, - 'OpSourceExtension' : 4, - 'OpName' : 5, - 'OpMemberName' : 6, - 'OpString' : 7, - 'OpLine' : 8, - 'OpExtension' : 10, - 'OpExtInstImport' : 11, - 'OpExtInst' : 12, - 'OpMemoryModel' : 14, - 'OpEntryPoint' : 15, - 'OpExecutionMode' : 16, - 'OpCapability' : 17, - 'OpTypeVoid' : 19, - 'OpTypeBool' : 20, - 'OpTypeInt' : 21, - 'OpTypeFloat' : 22, - 'OpTypeVector' : 23, - 'OpTypeMatrix' : 24, - 'OpTypeImage' : 25, - 'OpTypeSampler' : 26, - 'OpTypeSampledImage' : 27, - 'OpTypeArray' : 28, - 'OpTypeRuntimeArray' : 29, - 'OpTypeStruct' : 30, - 'OpTypeOpaque' : 31, - 'OpTypePointer' : 32, - 'OpTypeFunction' : 33, - 'OpTypeEvent' : 34, - 'OpTypeDeviceEvent' : 35, - 'OpTypeReserveId' : 36, - 'OpTypeQueue' : 37, - 'OpTypePipe' : 38, - 'OpTypeForwardPointer' : 39, - 'OpConstantTrue' : 41, - 'OpConstantFalse' : 42, - 'OpConstant' : 43, - 'OpConstantComposite' : 44, - 'OpConstantSampler' : 45, - 'OpConstantNull' : 46, - 'OpSpecConstantTrue' : 48, - 'OpSpecConstantFalse' : 49, - 'OpSpecConstant' : 50, - 'OpSpecConstantComposite' : 51, - 'OpSpecConstantOp' : 52, - 'OpFunction' : 54, - 'OpFunctionParameter' : 55, - 'OpFunctionEnd' : 56, - 'OpFunctionCall' : 57, - 'OpVariable' : 59, - 'OpImageTexelPointer' : 60, - 'OpLoad' : 61, - 'OpStore' : 62, - 'OpCopyMemory' : 63, - 'OpCopyMemorySized' : 64, - 'OpAccessChain' : 65, - 'OpInBoundsAccessChain' : 66, - 'OpPtrAccessChain' : 67, - 'OpArrayLength' : 68, - 'OpGenericPtrMemSemantics' : 69, - 'OpInBoundsPtrAccessChain' : 70, - 'OpDecorate' : 71, - 'OpMemberDecorate' : 72, - 'OpDecorationGroup' : 73, - 'OpGroupDecorate' : 74, - 'OpGroupMemberDecorate' : 75, - 'OpVectorExtractDynamic' : 77, - 'OpVectorInsertDynamic' : 78, - 'OpVectorShuffle' : 79, - 'OpCompositeConstruct' : 80, - 'OpCompositeExtract' : 81, - 'OpCompositeInsert' : 82, - 'OpCopyObject' : 83, - 'OpTranspose' : 84, - 'OpSampledImage' : 86, - 'OpImageSampleImplicitLod' : 87, - 'OpImageSampleExplicitLod' : 88, - 'OpImageSampleDrefImplicitLod' : 89, - 'OpImageSampleDrefExplicitLod' : 90, - 'OpImageSampleProjImplicitLod' : 91, - 'OpImageSampleProjExplicitLod' : 92, - 'OpImageSampleProjDrefImplicitLod' : 93, - 'OpImageSampleProjDrefExplicitLod' : 94, - 'OpImageFetch' : 95, - 'OpImageGather' : 96, - 'OpImageDrefGather' : 97, - 'OpImageRead' : 98, - 'OpImageWrite' : 99, - 'OpImage' : 100, - 'OpImageQueryFormat' : 101, - 'OpImageQueryOrder' : 102, - 'OpImageQuerySizeLod' : 103, - 'OpImageQuerySize' : 104, - 'OpImageQueryLod' : 105, - 'OpImageQueryLevels' : 106, - 'OpImageQuerySamples' : 107, - 'OpConvertFToU' : 109, - 'OpConvertFToS' : 110, - 'OpConvertSToF' : 111, - 'OpConvertUToF' : 112, - 'OpUConvert' : 113, - 'OpSConvert' : 114, - 'OpFConvert' : 115, - 'OpQuantizeToF16' : 116, - 'OpConvertPtrToU' : 117, - 'OpSatConvertSToU' : 118, - 'OpSatConvertUToS' : 119, - 'OpConvertUToPtr' : 120, - 'OpPtrCastToGeneric' : 121, - 'OpGenericCastToPtr' : 122, - 'OpGenericCastToPtrExplicit' : 123, - 'OpBitcast' : 124, - 'OpSNegate' : 126, - 'OpFNegate' : 127, - 'OpIAdd' : 128, - 'OpFAdd' : 129, - 'OpISub' : 130, - 'OpFSub' : 131, - 'OpIMul' : 132, - 'OpFMul' : 133, - 'OpUDiv' : 134, - 'OpSDiv' : 135, - 'OpFDiv' : 136, - 'OpUMod' : 137, - 'OpSRem' : 138, - 'OpSMod' : 139, - 'OpFRem' : 140, - 'OpFMod' : 141, - 'OpVectorTimesScalar' : 142, - 'OpMatrixTimesScalar' : 143, - 'OpVectorTimesMatrix' : 144, - 'OpMatrixTimesVector' : 145, - 'OpMatrixTimesMatrix' : 146, - 'OpOuterProduct' : 147, - 'OpDot' : 148, - 'OpIAddCarry' : 149, - 'OpISubBorrow' : 150, - 'OpUMulExtended' : 151, - 'OpSMulExtended' : 152, - 'OpAny' : 154, - 'OpAll' : 155, - 'OpIsNan' : 156, - 'OpIsInf' : 157, - 'OpIsFinite' : 158, - 'OpIsNormal' : 159, - 'OpSignBitSet' : 160, - 'OpLessOrGreater' : 161, - 'OpOrdered' : 162, - 'OpUnordered' : 163, - 'OpLogicalEqual' : 164, - 'OpLogicalNotEqual' : 165, - 'OpLogicalOr' : 166, - 'OpLogicalAnd' : 167, - 'OpLogicalNot' : 168, - 'OpSelect' : 169, - 'OpIEqual' : 170, - 'OpINotEqual' : 171, - 'OpUGreaterThan' : 172, - 'OpSGreaterThan' : 173, - 'OpUGreaterThanEqual' : 174, - 'OpSGreaterThanEqual' : 175, - 'OpULessThan' : 176, - 'OpSLessThan' : 177, - 'OpULessThanEqual' : 178, - 'OpSLessThanEqual' : 179, - 'OpFOrdEqual' : 180, - 'OpFUnordEqual' : 181, - 'OpFOrdNotEqual' : 182, - 'OpFUnordNotEqual' : 183, - 'OpFOrdLessThan' : 184, - 'OpFUnordLessThan' : 185, - 'OpFOrdGreaterThan' : 186, - 'OpFUnordGreaterThan' : 187, - 'OpFOrdLessThanEqual' : 188, - 'OpFUnordLessThanEqual' : 189, - 'OpFOrdGreaterThanEqual' : 190, - 'OpFUnordGreaterThanEqual' : 191, - 'OpShiftRightLogical' : 194, - 'OpShiftRightArithmetic' : 195, - 'OpShiftLeftLogical' : 196, - 'OpBitwiseOr' : 197, - 'OpBitwiseXor' : 198, - 'OpBitwiseAnd' : 199, - 'OpNot' : 200, - 'OpBitFieldInsert' : 201, - 'OpBitFieldSExtract' : 202, - 'OpBitFieldUExtract' : 203, - 'OpBitReverse' : 204, - 'OpBitCount' : 205, - 'OpDPdx' : 207, - 'OpDPdy' : 208, - 'OpFwidth' : 209, - 'OpDPdxFine' : 210, - 'OpDPdyFine' : 211, - 'OpFwidthFine' : 212, - 'OpDPdxCoarse' : 213, - 'OpDPdyCoarse' : 214, - 'OpFwidthCoarse' : 215, - 'OpEmitVertex' : 218, - 'OpEndPrimitive' : 219, - 'OpEmitStreamVertex' : 220, - 'OpEndStreamPrimitive' : 221, - 'OpControlBarrier' : 224, - 'OpMemoryBarrier' : 225, - 'OpAtomicLoad' : 227, - 'OpAtomicStore' : 228, - 'OpAtomicExchange' : 229, - 'OpAtomicCompareExchange' : 230, - 'OpAtomicCompareExchangeWeak' : 231, - 'OpAtomicIIncrement' : 232, - 'OpAtomicIDecrement' : 233, - 'OpAtomicIAdd' : 234, - 'OpAtomicISub' : 235, - 'OpAtomicSMin' : 236, - 'OpAtomicUMin' : 237, - 'OpAtomicSMax' : 238, - 'OpAtomicUMax' : 239, - 'OpAtomicAnd' : 240, - 'OpAtomicOr' : 241, - 'OpAtomicXor' : 242, - 'OpPhi' : 245, - 'OpLoopMerge' : 246, - 'OpSelectionMerge' : 247, - 'OpLabel' : 248, - 'OpBranch' : 249, - 'OpBranchConditional' : 250, - 'OpSwitch' : 251, - 'OpKill' : 252, - 'OpReturn' : 253, - 'OpReturnValue' : 254, - 'OpUnreachable' : 255, - 'OpLifetimeStart' : 256, - 'OpLifetimeStop' : 257, - 'OpGroupAsyncCopy' : 259, - 'OpGroupWaitEvents' : 260, - 'OpGroupAll' : 261, - 'OpGroupAny' : 262, - 'OpGroupBroadcast' : 263, - 'OpGroupIAdd' : 264, - 'OpGroupFAdd' : 265, - 'OpGroupFMin' : 266, - 'OpGroupUMin' : 267, - 'OpGroupSMin' : 268, - 'OpGroupFMax' : 269, - 'OpGroupUMax' : 270, - 'OpGroupSMax' : 271, - 'OpReadPipe' : 274, - 'OpWritePipe' : 275, - 'OpReservedReadPipe' : 276, - 'OpReservedWritePipe' : 277, - 'OpReserveReadPipePackets' : 278, - 'OpReserveWritePipePackets' : 279, - 'OpCommitReadPipe' : 280, - 'OpCommitWritePipe' : 281, - 'OpIsValidReserveId' : 282, - 'OpGetNumPipePackets' : 283, - 'OpGetMaxPipePackets' : 284, - 'OpGroupReserveReadPipePackets' : 285, - 'OpGroupReserveWritePipePackets' : 286, - 'OpGroupCommitReadPipe' : 287, - 'OpGroupCommitWritePipe' : 288, - 'OpEnqueueMarker' : 291, - 'OpEnqueueKernel' : 292, - 'OpGetKernelNDrangeSubGroupCount' : 293, - 'OpGetKernelNDrangeMaxSubGroupSize' : 294, - 'OpGetKernelWorkGroupSize' : 295, - 'OpGetKernelPreferredWorkGroupSizeMultiple' : 296, - 'OpRetainEvent' : 297, - 'OpReleaseEvent' : 298, - 'OpCreateUserEvent' : 299, - 'OpIsValidEvent' : 300, - 'OpSetUserEventStatus' : 301, - 'OpCaptureEventProfilingInfo' : 302, - 'OpGetDefaultQueue' : 303, - 'OpBuildNDRange' : 304, - 'OpImageSparseSampleImplicitLod' : 305, - 'OpImageSparseSampleExplicitLod' : 306, - 'OpImageSparseSampleDrefImplicitLod' : 307, - 'OpImageSparseSampleDrefExplicitLod' : 308, - 'OpImageSparseSampleProjImplicitLod' : 309, - 'OpImageSparseSampleProjExplicitLod' : 310, - 'OpImageSparseSampleProjDrefImplicitLod' : 311, - 'OpImageSparseSampleProjDrefExplicitLod' : 312, - 'OpImageSparseFetch' : 313, - 'OpImageSparseGather' : 314, - 'OpImageSparseDrefGather' : 315, - 'OpImageSparseTexelsResident' : 316, - 'OpNoLine' : 317, - 'OpAtomicFlagTestAndSet' : 318, - 'OpAtomicFlagClear' : 319, - 'OpImageSparseRead' : 320, - 'OpSizeOf' : 321, - 'OpTypePipeStorage' : 322, - 'OpConstantPipeStorage' : 323, - 'OpCreatePipeFromPipeStorage' : 324, - 'OpGetKernelLocalSizeForSubgroupCount' : 325, - 'OpGetKernelMaxNumSubgroups' : 326, - 'OpTypeNamedBarrier' : 327, - 'OpNamedBarrierInitialize' : 328, - 'OpMemoryNamedBarrier' : 329, - 'OpModuleProcessed' : 330, - 'OpDecorateId' : 332, - 'OpSubgroupBallotKHR' : 4421, - 'OpSubgroupFirstInvocationKHR' : 4422, - 'OpSubgroupAllKHR' : 4428, - 'OpSubgroupAnyKHR' : 4429, - 'OpSubgroupAllEqualKHR' : 4430, - 'OpSubgroupReadInvocationKHR' : 4432, - 'OpGroupIAddNonUniformAMD' : 5000, - 'OpGroupFAddNonUniformAMD' : 5001, - 'OpGroupFMinNonUniformAMD' : 5002, - 'OpGroupUMinNonUniformAMD' : 5003, - 'OpGroupSMinNonUniformAMD' : 5004, - 'OpGroupFMaxNonUniformAMD' : 5005, - 'OpGroupUMaxNonUniformAMD' : 5006, - 'OpGroupSMaxNonUniformAMD' : 5007, - 'OpFragmentMaskFetchAMD' : 5011, - 'OpFragmentFetchAMD' : 5012, - 'OpSubgroupShuffleINTEL' : 5571, - 'OpSubgroupShuffleDownINTEL' : 5572, - 'OpSubgroupShuffleUpINTEL' : 5573, - 'OpSubgroupShuffleXorINTEL' : 5574, - 'OpSubgroupBlockReadINTEL' : 5575, - 'OpSubgroupBlockWriteINTEL' : 5576, - 'OpSubgroupImageBlockReadINTEL' : 5577, - 'OpSubgroupImageBlockWriteINTEL' : 5578, - 'OpDecorateStringGOOGLE' : 5632, - 'OpMemberDecorateStringGOOGLE' : 5633, - }, - -} - diff --git a/include/spirv/1.2/OpenCL.std.h b/include/spirv/1.2/OpenCL.std.h deleted file mode 100644 index 19a66884..00000000 --- a/include/spirv/1.2/OpenCL.std.h +++ /dev/null @@ -1,210 +0,0 @@ -/* -** Copyright (c) 2015-2017 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a copy -** of this software and/or associated documentation files (the "Materials"), -** to deal in the Materials without restriction, including without limitation -** the rights to use, copy, modify, merge, publish, distribute, sublicense, -** and/or sell copies of the Materials, and to permit persons to whom the -** Materials are furnished to do so, subject to the following conditions: -** -** The above copyright notice and this permission notice shall be included in -** all copies or substantial portions of the Materials. -** -** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -** IN THE MATERIALS. -*/ - -namespace OpenCLLIB { - -enum Entrypoints { - - // Section 2.1: Math extended instructions - Acos = 0, - Acosh = 1, - Acospi = 2, - Asin = 3, - Asinh = 4, - Asinpi = 5, - Atan = 6, - Atan2 = 7, - Atanh = 8, - Atanpi = 9, - Atan2pi = 10, - Cbrt = 11, - Ceil = 12, - Copysign = 13, - Cos = 14, - Cosh = 15, - Cospi = 16, - Erfc = 17, - Erf = 18, - Exp = 19, - Exp2 = 20, - Exp10 = 21, - Expm1 = 22, - Fabs = 23, - Fdim = 24, - Floor = 25, - Fma = 26, - Fmax = 27, - Fmin = 28, - Fmod = 29, - Fract = 30, - Frexp = 31, - Hypot = 32, - Ilogb = 33, - Ldexp = 34, - Lgamma = 35, - Lgamma_r = 36, - Log = 37, - Log2 = 38, - Log10 = 39, - Log1p = 40, - Logb = 41, - Mad = 42, - Maxmag = 43, - Minmag = 44, - Modf = 45, - Nan = 46, - Nextafter = 47, - Pow = 48, - Pown = 49, - Powr = 50, - Remainder = 51, - Remquo = 52, - Rint = 53, - Rootn = 54, - Round = 55, - Rsqrt = 56, - Sin = 57, - Sincos = 58, - Sinh = 59, - Sinpi = 60, - Sqrt = 61, - Tan = 62, - Tanh = 63, - Tanpi = 64, - Tgamma = 65, - Trunc = 66, - Half_cos = 67, - Half_divide = 68, - Half_exp = 69, - Half_exp2 = 70, - Half_exp10 = 71, - Half_log = 72, - Half_log2 = 73, - Half_log10 = 74, - Half_powr = 75, - Half_recip = 76, - Half_rsqrt = 77, - Half_sin = 78, - Half_sqrt = 79, - Half_tan = 80, - Native_cos = 81, - Native_divide = 82, - Native_exp = 83, - Native_exp2 = 84, - Native_exp10 = 85, - Native_log = 86, - Native_log2 = 87, - Native_log10 = 88, - Native_powr = 89, - Native_recip = 90, - Native_rsqrt = 91, - Native_sin = 92, - Native_sqrt = 93, - Native_tan = 94, - - // Section 2.2: Integer instructions - SAbs = 141, - SAbs_diff = 142, - SAdd_sat = 143, - UAdd_sat = 144, - SHadd = 145, - UHadd = 146, - SRhadd = 147, - URhadd = 148, - SClamp = 149, - UClamp = 150, - Clz = 151, - Ctz = 152, - SMad_hi = 153, - UMad_sat = 154, - SMad_sat = 155, - SMax = 156, - UMax = 157, - SMin = 158, - UMin = 159, - SMul_hi = 160, - Rotate = 161, - SSub_sat = 162, - USub_sat = 163, - U_Upsample = 164, - S_Upsample = 165, - Popcount = 166, - SMad24 = 167, - UMad24 = 168, - SMul24 = 169, - UMul24 = 170, - UAbs = 201, - UAbs_diff = 202, - UMul_hi = 203, - UMad_hi = 204, - - // Section 2.3: Common instructions - FClamp = 95, - Degrees = 96, - FMax_common = 97, - FMin_common = 98, - Mix = 99, - Radians = 100, - Step = 101, - Smoothstep = 102, - Sign = 103, - - // Section 2.4: Geometric instructions - Cross = 104, - Distance = 105, - Length = 106, - Normalize = 107, - Fast_distance = 108, - Fast_length = 109, - Fast_normalize = 110, - - // Section 2.5: Relational instructions - Bitselect = 186, - Select = 187, - - // Section 2.6: Vector Data Load and Store instructions - Vloadn = 171, - Vstoren = 172, - Vload_half = 173, - Vload_halfn = 174, - Vstore_half = 175, - Vstore_half_r = 176, - Vstore_halfn = 177, - Vstore_halfn_r = 178, - Vloada_halfn = 179, - Vstorea_halfn = 180, - Vstorea_halfn_r = 181, - - // Section 2.7: Miscellaneous Vector instructions - Shuffle = 182, - Shuffle2 = 183, - - // Section 2.8: Misc instructions - Printf = 184, - Prefetch = 185, -}; - -} // end namespace OpenCLLIB diff --git a/include/spirv/1.2/extinst.glsl.std.450.grammar.json b/include/spirv/1.2/extinst.glsl.std.450.grammar.json deleted file mode 100644 index 3d9f39e7..00000000 --- a/include/spirv/1.2/extinst.glsl.std.450.grammar.json +++ /dev/null @@ -1,642 +0,0 @@ -{ - "copyright" : [ - "Copyright (c) 2014-2016 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - "version" : 100, - "revision" : 2, - "instructions" : [ - { - "opname" : "Round", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "RoundEven", - "opcode" : 2, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Trunc", - "opcode" : 3, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FAbs", - "opcode" : 4, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "SAbs", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FSign", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "SSign", - "opcode" : 7, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Floor", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Ceil", - "opcode" : 9, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Fract", - "opcode" : 10, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Radians", - "opcode" : 11, - "operands" : [ - { "kind" : "IdRef", "name" : "'degrees'" } - ] - }, - { - "opname" : "Degrees", - "opcode" : 12, - "operands" : [ - { "kind" : "IdRef", "name" : "'radians'" } - ] - }, - { - "opname" : "Sin", - "opcode" : 13, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Cos", - "opcode" : 14, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Tan", - "opcode" : 15, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Asin", - "opcode" : 16, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Acos", - "opcode" : 17, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Atan", - "opcode" : 18, - "operands" : [ - { "kind" : "IdRef", "name" : "'y_over_x'" } - ] - }, - { - "opname" : "Sinh", - "opcode" : 19, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Cosh", - "opcode" : 20, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Tanh", - "opcode" : 21, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Asinh", - "opcode" : 22, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Acosh", - "opcode" : 23, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Atanh", - "opcode" : 24, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Atan2", - "opcode" : 25, - "operands" : [ - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Pow", - "opcode" : 26, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "Exp", - "opcode" : 27, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Log", - "opcode" : 28, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Exp2", - "opcode" : 29, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Log2", - "opcode" : 30, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Sqrt", - "opcode" : 31, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "InverseSqrt", - "opcode" : 32, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Determinant", - "opcode" : 33, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "MatrixInverse", - "opcode" : 34, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Modf", - "opcode" : 35, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'i'" } - ] - }, - { - "opname" : "ModfStruct", - "opcode" : 36, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FMin", - "opcode" : 37, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "UMin", - "opcode" : 38, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "SMin", - "opcode" : 39, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "FMax", - "opcode" : 40, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "UMax", - "opcode" : 41, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "SMax", - "opcode" : 42, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "FClamp", - "opcode" : 43, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - }, - { - "opname" : "UClamp", - "opcode" : 44, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - }, - { - "opname" : "SClamp", - "opcode" : 45, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - }, - { - "opname" : "FMix", - "opcode" : 46, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'a'" } - ] - }, - { - "opname" : "IMix", - "opcode" : 47, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'a'" } - ] - }, - { - "opname" : "Step", - "opcode" : 48, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "SmoothStep", - "opcode" : 49, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge0'" }, - { "kind" : "IdRef", "name" : "'edge1'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Fma", - "opcode" : 50, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "Frexp", - "opcode" : 51, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'exp'" } - ] - }, - { - "opname" : "FrexpStruct", - "opcode" : 52, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Ldexp", - "opcode" : 53, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'exp'" } - ] - }, - { - "opname" : "PackSnorm4x8", - "opcode" : 54, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackUnorm4x8", - "opcode" : 55, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackSnorm2x16", - "opcode" : 56, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackUnorm2x16", - "opcode" : 57, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackHalf2x16", - "opcode" : 58, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackDouble2x32", - "opcode" : 59, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ], - "capabilities" : [ "Float64" ] - }, - { - "opname" : "UnpackSnorm2x16", - "opcode" : 60, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackUnorm2x16", - "opcode" : 61, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackHalf2x16", - "opcode" : 62, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "UnpackSnorm4x8", - "opcode" : 63, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackUnorm4x8", - "opcode" : 64, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackDouble2x32", - "opcode" : 65, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ], - "capabilities" : [ "Float64" ] - }, - { - "opname" : "Length", - "opcode" : 66, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Distance", - "opcode" : 67, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "Cross", - "opcode" : 68, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "Normalize", - "opcode" : 69, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FaceForward", - "opcode" : 70, - "operands" : [ - { "kind" : "IdRef", "name" : "'N'" }, - { "kind" : "IdRef", "name" : "'I'" }, - { "kind" : "IdRef", "name" : "'Nref'" } - ] - }, - { - "opname" : "Reflect", - "opcode" : 71, - "operands" : [ - { "kind" : "IdRef", "name" : "'I'" }, - { "kind" : "IdRef", "name" : "'N'" } - ] - }, - { - "opname" : "Refract", - "opcode" : 72, - "operands" : [ - { "kind" : "IdRef", "name" : "'I'" }, - { "kind" : "IdRef", "name" : "'N'" }, - { "kind" : "IdRef", "name" : "'eta'" } - ] - }, - { - "opname" : "FindILsb", - "opcode" : 73, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "FindSMsb", - "opcode" : 74, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "FindUMsb", - "opcode" : 75, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "InterpolateAtCentroid", - "opcode" : 76, - "operands" : [ - { "kind" : "IdRef", "name" : "'interpolant'" } - ], - "capabilities" : [ "InterpolationFunction" ] - }, - { - "opname" : "InterpolateAtSample", - "opcode" : 77, - "operands" : [ - { "kind" : "IdRef", "name" : "'interpolant'" }, - { "kind" : "IdRef", "name" : "'sample'" } - ], - "capabilities" : [ "InterpolationFunction" ] - }, - { - "opname" : "InterpolateAtOffset", - "opcode" : 78, - "operands" : [ - { "kind" : "IdRef", "name" : "'interpolant'" }, - { "kind" : "IdRef", "name" : "'offset'" } - ], - "capabilities" : [ "InterpolationFunction" ] - }, - { - "opname" : "NMin", - "opcode" : 79, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "NMax", - "opcode" : 80, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "NClamp", - "opcode" : 81, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - } - ] -} diff --git a/include/spirv/1.2/extinst.opencl.std.100.grammar.json b/include/spirv/1.2/extinst.opencl.std.100.grammar.json deleted file mode 100644 index 4fe45060..00000000 --- a/include/spirv/1.2/extinst.opencl.std.100.grammar.json +++ /dev/null @@ -1,1279 +0,0 @@ -{ - "copyright" : [ - "Copyright (c) 2014-2016 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - "version" : 100, - "revision" : 2, - "instructions" : [ - { - "opname" : "acos", - "opcode" : 0, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "acosh", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "acospi", - "opcode" : 2, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "asin", - "opcode" : 3, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "asinh", - "opcode" : 4, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "asinpi", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atan", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atan2", - "opcode" : 7, - "operands" : [ - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atanh", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atanpi", - "opcode" : 9, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atan2pi", - "opcode" : 10, - "operands" : [ - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cbrt", - "opcode" : 11, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "ceil", - "opcode" : 12, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "copysign", - "opcode" : 13, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "cos", - "opcode" : 14, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cosh", - "opcode" : 15, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cospi", - "opcode" : 16, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "erfc", - "opcode" : 17, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "erf", - "opcode" : 18, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "exp", - "opcode" : 19, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "exp2", - "opcode" : 20, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "exp10", - "opcode" : 21, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "expm1", - "opcode" : 22, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "fabs", - "opcode" : 23, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "fdim", - "opcode" : 24, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "floor", - "opcode" : 25, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "fma", - "opcode" : 26, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "fmax", - "opcode" : 27, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fmin", - "opcode" : 28, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fmod", - "opcode" : 29, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fract", - "opcode" : 30, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'ptr'" } - ] - }, - { - "opname" : "frexp", - "opcode" : 31, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'exp'" } - ] - }, - { - "opname" : "hypot", - "opcode" : 32, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "ilogb", - "opcode" : 33, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "ldexp", - "opcode" : 34, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'k'" } - ] - }, - { - "opname" : "lgamma", - "opcode" : 35, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "lgamma_r", - "opcode" : 36, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'signp'" } - ] - }, - { - "opname" : "log", - "opcode" : 37, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "log2", - "opcode" : 38, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "log10", - "opcode" : 39, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "log1p", - "opcode" : 40, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "logb", - "opcode" : 41, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "mad", - "opcode" : 42, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "maxmag", - "opcode" : 43, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "minmag", - "opcode" : 44, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "modf", - "opcode" : 45, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'iptr'" } - ] - }, - { - "opname" : "nan", - "opcode" : 46, - "operands" : [ - { "kind" : "IdRef", "name" : "'nancode'" } - ] - }, - { - "opname" : "nextafter", - "opcode" : 47, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "pow", - "opcode" : 48, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y" } - ] - }, - { - "opname" : "pown", - "opcode" : 49, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "powr", - "opcode" : 50, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "remainder", - "opcode" : 51, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "remquo", - "opcode" : 52, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'quo'" } - ] - }, - { - "opname" : "rint", - "opcode" : 53, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "rootn", - "opcode" : 54, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "round", - "opcode" : 55, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "rsqrt", - "opcode" : 56, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sin", - "opcode" : 57, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sincos", - "opcode" : 58, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'cosval'" } - ] - }, - { - "opname" : "sinh", - "opcode" : 59, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sinpi", - "opcode" : 60, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sqrt", - "opcode" : 61, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tan", - "opcode" : 62, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tanh", - "opcode" : 63, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tanpi", - "opcode" : 64, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tgamma", - "opcode" : 65, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "trunc", - "opcode" : 66, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_cos", - "opcode" : 67, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_divide", - "opcode" : 68, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "half_exp", - "opcode" : 69, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_exp2", - "opcode" : 70, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_exp10", - "opcode" : 71, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_log", - "opcode" : 72, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_log2", - "opcode" : 73, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_log10", - "opcode" : 74, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_powr", - "opcode" : 75, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "half_recip", - "opcode" : 76, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_rsqrt", - "opcode" : 77, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_sin", - "opcode" : 78, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_sqrt", - "opcode" : 79, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_tan", - "opcode" : 80, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_cos", - "opcode" : 81, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_divide", - "opcode" : 82, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "native_exp", - "opcode" : 83, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_exp2", - "opcode" : 84, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_exp10", - "opcode" : 85, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_log", - "opcode" : 86, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_log2", - "opcode" : 87, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_log10", - "opcode" : 88, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_powr", - "opcode" : 89, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "native_recip", - "opcode" : 90, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_rsqrt", - "opcode" : 91, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_sin", - "opcode" : 92, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_sqrt", - "opcode" : 93, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_tan", - "opcode" : 94, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_abs", - "opcode" : 141, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_abs_diff", - "opcode" : 142, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_add_sat", - "opcode" : 143, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_add_sat", - "opcode" : 144, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_hadd", - "opcode" : 145, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_hadd", - "opcode" : 146, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_rhadd", - "opcode" : 147, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_rhadd", - "opcode" : 148, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_clamp", - "opcode" : 149, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minval'" }, - { "kind" : "IdRef", "name" : "'maxval'" } - ] - }, - { - "opname" : "u_clamp", - "opcode" : 150, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minval'" }, - { "kind" : "IdRef", "name" : "'maxval'" } - ] - }, - { - "opname" : "clz", - "opcode" : 151, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "ctz", - "opcode" : 152, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_mad_hi", - "opcode" : 153, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "u_mad_sat", - "opcode" : 154, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "s_mad_sat", - "opcode" : 155, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "s_max", - "opcode" : 156, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_max", - "opcode" : 157, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_min", - "opcode" : 158, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_min", - "opcode" : 159, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_mul_hi", - "opcode" : 160, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "rotate", - "opcode" : 161, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" }, - { "kind" : "IdRef", "name" : "'i'" } - ] - }, - { - "opname" : "s_sub_sat", - "opcode" : 162, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_sub_sat", - "opcode" : 163, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_upsample", - "opcode" : 164, - "operands" : [ - { "kind" : "IdRef", "name" : "'hi'" }, - { "kind" : "IdRef", "name" : "'lo'" } - ] - }, - { - "opname" : "s_upsample", - "opcode" : 165, - "operands" : [ - { "kind" : "IdRef", "name" : "'hi'" }, - { "kind" : "IdRef", "name" : "'lo'" } - ] - }, - { - "opname" : "popcount", - "opcode" : 166, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_mad24", - "opcode" : 167, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "u_mad24", - "opcode" : 168, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "s_mul24", - "opcode" : 169, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_mul24", - "opcode" : 170, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_abs", - "opcode" : 201, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "u_abs_diff", - "opcode" : 202, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_mul_hi", - "opcode" : 203, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_mad_hi", - "opcode" : 204, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "fclamp", - "opcode" : 95, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minval'" }, - { "kind" : "IdRef", "name" : "'maxval'" } - ] - }, - { - "opname" : "degrees", - "opcode" :96, - "operands" : [ - { "kind" : "IdRef", "name" : "'radians'" } - ] - }, - { - "opname" : "fmax_common", - "opcode" : 97, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fmin_common", - "opcode" : 98, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "mix", - "opcode" : 99, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'a'" } - ] - }, - { - "opname" : "radians", - "opcode" : 100, - "operands" : [ - { "kind" : "IdRef", "name" : "'degrees'" } - ] - }, - { - "opname" : "step", - "opcode" : 101, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "smoothstep", - "opcode" : 102, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge0'" }, - { "kind" : "IdRef", "name" : "'edge1'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sign", - "opcode" : 103, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cross", - "opcode" : 104, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "distance", - "opcode" : 105, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "length", - "opcode" : 106, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "normalize", - "opcode" : 107, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "fast_distance", - "opcode" : 108, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "fast_length", - "opcode" : 109, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "fast_normalize", - "opcode" : 110, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "bitselect", - "opcode" : 186, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "select", - "opcode" : 187, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "vloadn", - "opcode" : 171, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "LiteralInteger", "name" : "'n'" } - ] - }, - { - "opname" : "vstoren", - "opcode" : 172, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vload_half", - "opcode" : 173, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vload_halfn", - "opcode" : 174, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "LiteralInteger", "name" : "'n'" } - ] - }, - { - "opname" : "vstore_half", - "opcode" : 175, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vstore_half_r", - "opcode" : 176, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "FPRoundingMode", "name" : "'mode'" } - ] - }, - { - "opname" : "vstore_halfn", - "opcode" : 177, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vstore_halfn_r", - "opcode" : 178, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "FPRoundingMode", "name" : "'mode'" } - ] - }, - { - "opname" : "vloada_halfn", - "opcode" : 179, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "LiteralInteger", "name" : "'n'" } - ] - }, - { - "opname" : "vstorea_halfn", - "opcode" : 180, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vstorea_halfn_r", - "opcode" : 181, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "FPRoundingMode", "name" : "'mode'" } - ] - }, - { - "opname" : "shuffle", - "opcode" : 182, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'shuffle mask'" } - ] - }, - { - "opname" : "shuffle2", - "opcode" : 183, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'shuffle mask'" } - ] - }, - { - "opname" : "printf", - "opcode" : 184, - "operands" : [ - { "kind" : "IdRef", "name" : "'format'" }, - { "kind" : "IdRef", "name" : "'additional arguments'", "quantifier" : "*" } - ] - }, - { - "opname" : "prefetch", - "opcode" : 185, - "operands" : [ - { "kind" : "IdRef", "name" : "'ptr'" }, - { "kind" : "IdRef", "name" : "'num elements'" } - ] - } - ] -} diff --git a/include/spirv/1.2/spirv.core.grammar.json b/include/spirv/1.2/spirv.core.grammar.json deleted file mode 100644 index 393ee3c8..00000000 --- a/include/spirv/1.2/spirv.core.grammar.json +++ /dev/null @@ -1,5986 +0,0 @@ -{ - "copyright" : [ - "Copyright (c) 2014-2016 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - "magic_number" : "0x07230203", - "major_version" : 1, - "minor_version" : 2, - "revision" : 2, - "instructions" : [ - { - "opname" : "OpNop", - "opcode" : 0 - }, - { - "opname" : "OpUndef", - "opcode" : 1, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSourceContinued", - "opcode" : 2, - "operands" : [ - { "kind" : "LiteralString", "name" : "'Continued Source'" } - ] - }, - { - "opname" : "OpSource", - "opcode" : 3, - "operands" : [ - { "kind" : "SourceLanguage" }, - { "kind" : "LiteralInteger", "name" : "'Version'" }, - { "kind" : "IdRef", "quantifier" : "?", "name" : "'File'" }, - { "kind" : "LiteralString", "quantifier" : "?", "name" : "'Source'" } - ] - }, - { - "opname" : "OpSourceExtension", - "opcode" : 4, - "operands" : [ - { "kind" : "LiteralString", "name" : "'Extension'" } - ] - }, - { - "opname" : "OpName", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpMemberName", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "LiteralInteger", "name" : "'Member'" }, - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpString", - "opcode" : 7, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralString", "name" : "'String'" } - ] - }, - { - "opname" : "OpLine", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "'File'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" } - ] - }, - { - "opname" : "OpExtension", - "opcode" : 10, - "operands" : [ - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpExtInstImport", - "opcode" : 11, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpExtInst", - "opcode" : 12, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Set'" }, - { "kind" : "LiteralExtInstInteger", "name" : "'Instruction'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Operand 1', +\n'Operand 2', +\n..." } - ] - }, - { - "opname" : "OpMemoryModel", - "opcode" : 14, - "operands" : [ - { "kind" : "AddressingModel" }, - { "kind" : "MemoryModel" } - ] - }, - { - "opname" : "OpEntryPoint", - "opcode" : 15, - "operands" : [ - { "kind" : "ExecutionModel" }, - { "kind" : "IdRef", "name" : "'Entry Point'" }, - { "kind" : "LiteralString", "name" : "'Name'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Interface'" } - ] - }, - { - "opname" : "OpExecutionMode", - "opcode" : 16, - "operands" : [ - { "kind" : "IdRef", "name" : "'Entry Point'" }, - { "kind" : "ExecutionMode", "name" : "'Mode'" } - ] - }, - { - "opname" : "OpCapability", - "opcode" : 17, - "operands" : [ - { "kind" : "Capability", "name" : "'Capability'" } - ] - }, - { - "opname" : "OpTypeVoid", - "opcode" : 19, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpTypeBool", - "opcode" : 20, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpTypeInt", - "opcode" : 21, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralInteger", "name" : "'Width'" }, - { "kind" : "LiteralInteger", "name" : "'Signedness'" } - ] - }, - { - "opname" : "OpTypeFloat", - "opcode" : 22, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralInteger", "name" : "'Width'" } - ] - }, - { - "opname" : "OpTypeVector", - "opcode" : 23, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Component Type'" }, - { "kind" : "LiteralInteger", "name" : "'Component Count'" } - ] - }, - { - "opname" : "OpTypeMatrix", - "opcode" : 24, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Column Type'" }, - { "kind" : "LiteralInteger", "name" : "'Column Count'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpTypeImage", - "opcode" : 25, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Type'" }, - { "kind" : "Dim" }, - { "kind" : "LiteralInteger", "name" : "'Depth'" }, - { "kind" : "LiteralInteger", "name" : "'Arrayed'" }, - { "kind" : "LiteralInteger", "name" : "'MS'" }, - { "kind" : "LiteralInteger", "name" : "'Sampled'" }, - { "kind" : "ImageFormat" }, - { "kind" : "AccessQualifier", "quantifier" : "?" } - ] - }, - { - "opname" : "OpTypeSampler", - "opcode" : 26, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpTypeSampledImage", - "opcode" : 27, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image Type'" } - ] - }, - { - "opname" : "OpTypeArray", - "opcode" : 28, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Element Type'" }, - { "kind" : "IdRef", "name" : "'Length'" } - ] - }, - { - "opname" : "OpTypeRuntimeArray", - "opcode" : 29, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Element Type'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpTypeStruct", - "opcode" : 30, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Member 0 type', +\n'member 1 type', +\n..." } - ] - }, - { - "opname" : "OpTypeOpaque", - "opcode" : 31, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralString", "name" : "The name of the opaque type." } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpTypePointer", - "opcode" : 32, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "StorageClass" }, - { "kind" : "IdRef", "name" : "'Type'" } - ] - }, - { - "opname" : "OpTypeFunction", - "opcode" : 33, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Return Type'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Parameter 0 Type', +\n'Parameter 1 Type', +\n..." } - ] - }, - { - "opname" : "OpTypeEvent", - "opcode" : 34, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpTypeDeviceEvent", - "opcode" : 35, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpTypeReserveId", - "opcode" : 36, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpTypeQueue", - "opcode" : 37, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpTypePipe", - "opcode" : 38, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "AccessQualifier", "name" : "'Qualifier'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpTypeForwardPointer", - "opcode" : 39, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer Type'" }, - { "kind" : "StorageClass" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpConstantTrue", - "opcode" : 41, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpConstantFalse", - "opcode" : 42, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpConstant", - "opcode" : 43, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralContextDependentNumber", "name" : "'Value'" } - ] - }, - { - "opname" : "OpConstantComposite", - "opcode" : 44, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } - ] - }, - { - "opname" : "OpConstantSampler", - "opcode" : 45, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "SamplerAddressingMode" }, - { "kind" : "LiteralInteger", "name" : "'Param'" }, - { "kind" : "SamplerFilterMode" } - ], - "capabilities" : [ "LiteralSampler" ] - }, - { - "opname" : "OpConstantNull", - "opcode" : 46, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSpecConstantTrue", - "opcode" : 48, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSpecConstantFalse", - "opcode" : 49, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSpecConstant", - "opcode" : 50, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralContextDependentNumber", "name" : "'Value'" } - ] - }, - { - "opname" : "OpSpecConstantComposite", - "opcode" : 51, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } - ] - }, - { - "opname" : "OpSpecConstantOp", - "opcode" : 52, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralSpecConstantOpInteger", "name" : "'Opcode'" } - ] - }, - { - "opname" : "OpFunction", - "opcode" : 54, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "FunctionControl" }, - { "kind" : "IdRef", "name" : "'Function Type'" } - ] - }, - { - "opname" : "OpFunctionParameter", - "opcode" : 55, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpFunctionEnd", - "opcode" : 56 - }, - { - "opname" : "OpFunctionCall", - "opcode" : 57, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Function'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Argument 0', +\n'Argument 1', +\n..." } - ] - }, - { - "opname" : "OpVariable", - "opcode" : 59, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "StorageClass" }, - { "kind" : "IdRef", "quantifier" : "?", "name" : "'Initializer'" } - ] - }, - { - "opname" : "OpImageTexelPointer", - "opcode" : 60, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Sample'" } - ] - }, - { - "opname" : "OpLoad", - "opcode" : 61, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ] - }, - { - "opname" : "OpStore", - "opcode" : 62, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Object'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ] - }, - { - "opname" : "OpCopyMemory", - "opcode" : 63, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ] - }, - { - "opname" : "OpCopyMemorySized", - "opcode" : 64, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpAccessChain", - "opcode" : 65, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpInBoundsAccessChain", - "opcode" : 66, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpPtrAccessChain", - "opcode" : 67, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Element'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ], - "capabilities" : [ - "Addresses", - "VariablePointers", - "VariablePointersStorageBuffer" - ] - }, - { - "opname" : "OpArrayLength", - "opcode" : 68, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Structure'" }, - { "kind" : "LiteralInteger", "name" : "'Array member'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpGenericPtrMemSemantics", - "opcode" : 69, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpInBoundsPtrAccessChain", - "opcode" : 70, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Element'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpDecorate", - "opcode" : 71, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "Decoration" } - ] - }, - { - "opname" : "OpMemberDecorate", - "opcode" : 72, - "operands" : [ - { "kind" : "IdRef", "name" : "'Structure Type'" }, - { "kind" : "LiteralInteger", "name" : "'Member'" }, - { "kind" : "Decoration" } - ] - }, - { - "opname" : "OpDecorationGroup", - "opcode" : 73, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpGroupDecorate", - "opcode" : 74, - "operands" : [ - { "kind" : "IdRef", "name" : "'Decoration Group'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Targets'" } - ] - }, - { - "opname" : "OpGroupMemberDecorate", - "opcode" : 75, - "operands" : [ - { "kind" : "IdRef", "name" : "'Decoration Group'" }, - { "kind" : "PairIdRefLiteralInteger", "quantifier" : "*", "name" : "'Targets'" } - ] - }, - { - "opname" : "OpVectorExtractDynamic", - "opcode" : 77, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Index'" } - ] - }, - { - "opname" : "OpVectorInsertDynamic", - "opcode" : 78, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Component'" }, - { "kind" : "IdRef", "name" : "'Index'" } - ] - }, - { - "opname" : "OpVectorShuffle", - "opcode" : 79, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Components'" } - ] - }, - { - "opname" : "OpCompositeConstruct", - "opcode" : 80, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } - ] - }, - { - "opname" : "OpCompositeExtract", - "opcode" : 81, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Composite'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpCompositeInsert", - "opcode" : 82, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Object'" }, - { "kind" : "IdRef", "name" : "'Composite'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpCopyObject", - "opcode" : 83, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpTranspose", - "opcode" : 84, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Matrix'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpSampledImage", - "opcode" : 86, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Sampler'" } - ] - }, - { - "opname" : "OpImageSampleImplicitLod", - "opcode" : 87, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleExplicitLod", - "opcode" : 88, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ] - }, - { - "opname" : "OpImageSampleDrefImplicitLod", - "opcode" : 89, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleDrefExplicitLod", - "opcode" : 90, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjImplicitLod", - "opcode" : 91, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjExplicitLod", - "opcode" : 92, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjDrefImplicitLod", - "opcode" : 93, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjDrefExplicitLod", - "opcode" : 94, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageFetch", - "opcode" : 95, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ] - }, - { - "opname" : "OpImageGather", - "opcode" : 96, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Component'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageDrefGather", - "opcode" : 97, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageRead", - "opcode" : 98, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ] - }, - { - "opname" : "OpImageWrite", - "opcode" : 99, - "operands" : [ - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Texel'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ] - }, - { - "opname" : "OpImage", - "opcode" : 100, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" } - ] - }, - { - "opname" : "OpImageQueryFormat", - "opcode" : 101, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpImageQueryOrder", - "opcode" : 102, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpImageQuerySizeLod", - "opcode" : 103, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Level of Detail'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpImageQuerySize", - "opcode" : 104, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpImageQueryLod", - "opcode" : 105, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" } - ], - "capabilities" : [ "ImageQuery" ] - }, - { - "opname" : "OpImageQueryLevels", - "opcode" : 106, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpImageQuerySamples", - "opcode" : 107, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpConvertFToU", - "opcode" : 109, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Float Value'" } - ] - }, - { - "opname" : "OpConvertFToS", - "opcode" : 110, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Float Value'" } - ] - }, - { - "opname" : "OpConvertSToF", - "opcode" : 111, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Signed Value'" } - ] - }, - { - "opname" : "OpConvertUToF", - "opcode" : 112, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Unsigned Value'" } - ] - }, - { - "opname" : "OpUConvert", - "opcode" : 113, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Unsigned Value'" } - ] - }, - { - "opname" : "OpSConvert", - "opcode" : 114, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Signed Value'" } - ] - }, - { - "opname" : "OpFConvert", - "opcode" : 115, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Float Value'" } - ] - }, - { - "opname" : "OpQuantizeToF16", - "opcode" : 116, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpConvertPtrToU", - "opcode" : 117, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpSatConvertSToU", - "opcode" : 118, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Signed Value'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpSatConvertUToS", - "opcode" : 119, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Unsigned Value'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpConvertUToPtr", - "opcode" : 120, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Integer Value'" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpPtrCastToGeneric", - "opcode" : 121, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGenericCastToPtr", - "opcode" : 122, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGenericCastToPtrExplicit", - "opcode" : 123, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "StorageClass", "name" : "'Storage'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpBitcast", - "opcode" : 124, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpSNegate", - "opcode" : 126, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpFNegate", - "opcode" : 127, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpIAdd", - "opcode" : 128, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFAdd", - "opcode" : 129, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpISub", - "opcode" : 130, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFSub", - "opcode" : 131, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpIMul", - "opcode" : 132, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFMul", - "opcode" : 133, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUDiv", - "opcode" : 134, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSDiv", - "opcode" : 135, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFDiv", - "opcode" : 136, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUMod", - "opcode" : 137, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSRem", - "opcode" : 138, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSMod", - "opcode" : 139, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFRem", - "opcode" : 140, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFMod", - "opcode" : 141, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpVectorTimesScalar", - "opcode" : 142, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Scalar'" } - ] - }, - { - "opname" : "OpMatrixTimesScalar", - "opcode" : 143, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Matrix'" }, - { "kind" : "IdRef", "name" : "'Scalar'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpVectorTimesMatrix", - "opcode" : 144, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Matrix'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpMatrixTimesVector", - "opcode" : 145, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Matrix'" }, - { "kind" : "IdRef", "name" : "'Vector'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpMatrixTimesMatrix", - "opcode" : 146, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'LeftMatrix'" }, - { "kind" : "IdRef", "name" : "'RightMatrix'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpOuterProduct", - "opcode" : 147, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpDot", - "opcode" : 148, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" } - ] - }, - { - "opname" : "OpIAddCarry", - "opcode" : 149, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpISubBorrow", - "opcode" : 150, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUMulExtended", - "opcode" : 151, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSMulExtended", - "opcode" : 152, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpAny", - "opcode" : 154, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" } - ] - }, - { - "opname" : "OpAll", - "opcode" : 155, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" } - ] - }, - { - "opname" : "OpIsNan", - "opcode" : 156, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "OpIsInf", - "opcode" : 157, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "OpIsFinite", - "opcode" : 158, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpIsNormal", - "opcode" : 159, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpSignBitSet", - "opcode" : 160, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpLessOrGreater", - "opcode" : 161, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpOrdered", - "opcode" : 162, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpUnordered", - "opcode" : 163, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpLogicalEqual", - "opcode" : 164, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalNotEqual", - "opcode" : 165, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalOr", - "opcode" : 166, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalAnd", - "opcode" : 167, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalNot", - "opcode" : 168, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpSelect", - "opcode" : 169, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Condition'" }, - { "kind" : "IdRef", "name" : "'Object 1'" }, - { "kind" : "IdRef", "name" : "'Object 2'" } - ] - }, - { - "opname" : "OpIEqual", - "opcode" : 170, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpINotEqual", - "opcode" : 171, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUGreaterThan", - "opcode" : 172, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSGreaterThan", - "opcode" : 173, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUGreaterThanEqual", - "opcode" : 174, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSGreaterThanEqual", - "opcode" : 175, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpULessThan", - "opcode" : 176, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSLessThan", - "opcode" : 177, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpULessThanEqual", - "opcode" : 178, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSLessThanEqual", - "opcode" : 179, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdEqual", - "opcode" : 180, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordEqual", - "opcode" : 181, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdNotEqual", - "opcode" : 182, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordNotEqual", - "opcode" : 183, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdLessThan", - "opcode" : 184, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordLessThan", - "opcode" : 185, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdGreaterThan", - "opcode" : 186, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordGreaterThan", - "opcode" : 187, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdLessThanEqual", - "opcode" : 188, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordLessThanEqual", - "opcode" : 189, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdGreaterThanEqual", - "opcode" : 190, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordGreaterThanEqual", - "opcode" : 191, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpShiftRightLogical", - "opcode" : 194, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Shift'" } - ] - }, - { - "opname" : "OpShiftRightArithmetic", - "opcode" : 195, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Shift'" } - ] - }, - { - "opname" : "OpShiftLeftLogical", - "opcode" : 196, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Shift'" } - ] - }, - { - "opname" : "OpBitwiseOr", - "opcode" : 197, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpBitwiseXor", - "opcode" : 198, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpBitwiseAnd", - "opcode" : 199, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpNot", - "opcode" : 200, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpBitFieldInsert", - "opcode" : 201, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Insert'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Count'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpBitFieldSExtract", - "opcode" : 202, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Count'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpBitFieldUExtract", - "opcode" : 203, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Count'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpBitReverse", - "opcode" : 204, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpBitCount", - "opcode" : 205, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" } - ] - }, - { - "opname" : "OpDPdx", - "opcode" : 207, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpDPdy", - "opcode" : 208, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpFwidth", - "opcode" : 209, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpDPdxFine", - "opcode" : 210, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpDPdyFine", - "opcode" : 211, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpFwidthFine", - "opcode" : 212, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpDPdxCoarse", - "opcode" : 213, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpDPdyCoarse", - "opcode" : 214, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpFwidthCoarse", - "opcode" : 215, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpEmitVertex", - "opcode" : 218, - "capabilities" : [ "Geometry" ] - }, - { - "opname" : "OpEndPrimitive", - "opcode" : 219, - "capabilities" : [ "Geometry" ] - }, - { - "opname" : "OpEmitStreamVertex", - "opcode" : 220, - "operands" : [ - { "kind" : "IdRef", "name" : "'Stream'" } - ], - "capabilities" : [ "GeometryStreams" ] - }, - { - "opname" : "OpEndStreamPrimitive", - "opcode" : 221, - "operands" : [ - { "kind" : "IdRef", "name" : "'Stream'" } - ], - "capabilities" : [ "GeometryStreams" ] - }, - { - "opname" : "OpControlBarrier", - "opcode" : 224, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpMemoryBarrier", - "opcode" : 225, - "operands" : [ - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicLoad", - "opcode" : 227, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicStore", - "opcode" : 228, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicExchange", - "opcode" : 229, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicCompareExchange", - "opcode" : 230, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Equal'" }, - { "kind" : "IdMemorySemantics", "name" : "'Unequal'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Comparator'" } - ] - }, - { - "opname" : "OpAtomicCompareExchangeWeak", - "opcode" : 231, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Equal'" }, - { "kind" : "IdMemorySemantics", "name" : "'Unequal'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Comparator'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpAtomicIIncrement", - "opcode" : 232, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicIDecrement", - "opcode" : 233, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicIAdd", - "opcode" : 234, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicISub", - "opcode" : 235, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicSMin", - "opcode" : 236, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicUMin", - "opcode" : 237, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicSMax", - "opcode" : 238, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicUMax", - "opcode" : 239, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicAnd", - "opcode" : 240, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicOr", - "opcode" : 241, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicXor", - "opcode" : 242, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpPhi", - "opcode" : 245, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "PairIdRefIdRef", "quantifier" : "*", "name" : "'Variable, Parent, ...'" } - ] - }, - { - "opname" : "OpLoopMerge", - "opcode" : 246, - "operands" : [ - { "kind" : "IdRef", "name" : "'Merge Block'" }, - { "kind" : "IdRef", "name" : "'Continue Target'" }, - { "kind" : "LoopControl" } - ] - }, - { - "opname" : "OpSelectionMerge", - "opcode" : 247, - "operands" : [ - { "kind" : "IdRef", "name" : "'Merge Block'" }, - { "kind" : "SelectionControl" } - ] - }, - { - "opname" : "OpLabel", - "opcode" : 248, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpBranch", - "opcode" : 249, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target Label'" } - ] - }, - { - "opname" : "OpBranchConditional", - "opcode" : 250, - "operands" : [ - { "kind" : "IdRef", "name" : "'Condition'" }, - { "kind" : "IdRef", "name" : "'True Label'" }, - { "kind" : "IdRef", "name" : "'False Label'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Branch weights'" } - ] - }, - { - "opname" : "OpSwitch", - "opcode" : 251, - "operands" : [ - { "kind" : "IdRef", "name" : "'Selector'" }, - { "kind" : "IdRef", "name" : "'Default'" }, - { "kind" : "PairLiteralIntegerIdRef", "quantifier" : "*", "name" : "'Target'" } - ] - }, - { - "opname" : "OpKill", - "opcode" : 252, - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpReturn", - "opcode" : 253 - }, - { - "opname" : "OpReturnValue", - "opcode" : 254, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpUnreachable", - "opcode" : 255 - }, - { - "opname" : "OpLifetimeStart", - "opcode" : 256, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "LiteralInteger", "name" : "'Size'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpLifetimeStop", - "opcode" : 257, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "LiteralInteger", "name" : "'Size'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGroupAsyncCopy", - "opcode" : 259, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Destination'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Num Elements'" }, - { "kind" : "IdRef", "name" : "'Stride'" }, - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGroupWaitEvents", - "opcode" : 260, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Num Events'" }, - { "kind" : "IdRef", "name" : "'Events List'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGroupAll", - "opcode" : 261, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupAny", - "opcode" : 262, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupBroadcast", - "opcode" : 263, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'LocalId'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupIAdd", - "opcode" : 264, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFAdd", - "opcode" : 265, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFMin", - "opcode" : 266, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupUMin", - "opcode" : 267, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupSMin", - "opcode" : 268, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFMax", - "opcode" : 269, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupUMax", - "opcode" : 270, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupSMax", - "opcode" : 271, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpReadPipe", - "opcode" : 274, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpWritePipe", - "opcode" : 275, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReservedReadPipe", - "opcode" : 276, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Index'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReservedWritePipe", - "opcode" : 277, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Index'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReserveReadPipePackets", - "opcode" : 278, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReserveWritePipePackets", - "opcode" : 279, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpCommitReadPipe", - "opcode" : 280, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpCommitWritePipe", - "opcode" : 281, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpIsValidReserveId", - "opcode" : 282, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGetNumPipePackets", - "opcode" : 283, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGetMaxPipePackets", - "opcode" : 284, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupReserveReadPipePackets", - "opcode" : 285, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupReserveWritePipePackets", - "opcode" : 286, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupCommitReadPipe", - "opcode" : 287, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupCommitWritePipe", - "opcode" : 288, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpEnqueueMarker", - "opcode" : 291, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Queue'" }, - { "kind" : "IdRef", "name" : "'Num Events'" }, - { "kind" : "IdRef", "name" : "'Wait Events'" }, - { "kind" : "IdRef", "name" : "'Ret Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpEnqueueKernel", - "opcode" : 292, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Queue'" }, - { "kind" : "IdRef", "name" : "'Flags'" }, - { "kind" : "IdRef", "name" : "'ND Range'" }, - { "kind" : "IdRef", "name" : "'Num Events'" }, - { "kind" : "IdRef", "name" : "'Wait Events'" }, - { "kind" : "IdRef", "name" : "'Ret Event'" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Local Size'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelNDrangeSubGroupCount", - "opcode" : 293, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'ND Range'" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelNDrangeMaxSubGroupSize", - "opcode" : 294, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'ND Range'" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelWorkGroupSize", - "opcode" : 295, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelPreferredWorkGroupSizeMultiple", - "opcode" : 296, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpRetainEvent", - "opcode" : 297, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpReleaseEvent", - "opcode" : 298, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpCreateUserEvent", - "opcode" : 299, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpIsValidEvent", - "opcode" : 300, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpSetUserEventStatus", - "opcode" : 301, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" }, - { "kind" : "IdRef", "name" : "'Status'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpCaptureEventProfilingInfo", - "opcode" : 302, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" }, - { "kind" : "IdRef", "name" : "'Profiling Info'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetDefaultQueue", - "opcode" : 303, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpBuildNDRange", - "opcode" : 304, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'GlobalWorkSize'" }, - { "kind" : "IdRef", "name" : "'LocalWorkSize'" }, - { "kind" : "IdRef", "name" : "'GlobalWorkOffset'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpImageSparseSampleImplicitLod", - "opcode" : 305, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleExplicitLod", - "opcode" : 306, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleDrefImplicitLod", - "opcode" : 307, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleDrefExplicitLod", - "opcode" : 308, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleProjImplicitLod", - "opcode" : 309, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleProjExplicitLod", - "opcode" : 310, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleProjDrefImplicitLod", - "opcode" : 311, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleProjDrefExplicitLod", - "opcode" : 312, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseFetch", - "opcode" : 313, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseGather", - "opcode" : 314, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Component'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseDrefGather", - "opcode" : 315, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseTexelsResident", - "opcode" : 316, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Resident Code'" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpNoLine", - "opcode" : 317 - }, - { - "opname" : "OpAtomicFlagTestAndSet", - "opcode" : 318, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpAtomicFlagClear", - "opcode" : 319, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpImageSparseRead", - "opcode" : 320, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpSizeOf", - "opcode" : 321, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpTypePipeStorage", - "opcode" : 322, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "PipeStorage" ] - }, - { - "opname" : "OpConstantPipeStorage", - "opcode" : 323, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralInteger", "name" : "'Packet Size'" }, - { "kind" : "LiteralInteger", "name" : "'Packet Alignment'" }, - { "kind" : "LiteralInteger", "name" : "'Capacity'" } - ], - "capabilities" : [ "PipeStorage" ] - }, - { - "opname" : "OpCreatePipeFromPipeStorage", - "opcode" : 324, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe Storage'" } - ], - "capabilities" : [ "PipeStorage" ] - }, - { - "opname" : "OpGetKernelLocalSizeForSubgroupCount", - "opcode" : 325, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Subgroup Count'" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "SubgroupDispatch" ] - }, - { - "opname" : "OpGetKernelMaxNumSubgroups", - "opcode" : 326, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "SubgroupDispatch" ] - }, - { - "opname" : "OpTypeNamedBarrier", - "opcode" : 327, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "NamedBarrier" ] - }, - { - "opname" : "OpNamedBarrierInitialize", - "opcode" : 328, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Subgroup Count'" } - ], - "capabilities" : [ "NamedBarrier" ] - }, - { - "opname" : "OpMemoryNamedBarrier", - "opcode" : 329, - "operands" : [ - { "kind" : "IdRef", "name" : "'Named Barrier'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ], - "capabilities" : [ "NamedBarrier" ] - }, - { - "opname" : "OpModuleProcessed", - "opcode" : 330, - "operands" : [ - { "kind" : "LiteralString", "name" : "'Process'" } - ] - }, - { - "opname" : "OpExecutionModeId", - "opcode" : 331, - "operands" : [ - { "kind" : "IdRef", "name" : "'Entry Point'" }, - { "kind" : "ExecutionMode", "name" : "'Mode'" } - ] - }, - { - "opname" : "OpDecorateId", - "opcode" : 332, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "Decoration" } - ] - }, - { - "opname" : "OpSubgroupBallotKHR", - "opcode" : 4421, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "opname" : "OpSubgroupFirstInvocationKHR", - "opcode" : 4422, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "opname" : "OpSubgroupAllKHR", - "opcode" : 4428, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "SubgroupVoteKHR" ] - }, - { - "opname" : "OpSubgroupAnyKHR", - "opcode" : 4429, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "SubgroupVoteKHR" ] - }, - { - "opname" : "OpSubgroupAllEqualKHR", - "opcode" : 4430, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "SubgroupVoteKHR" ] - }, - { - "opname" : "OpSubgroupReadInvocationKHR", - "opcode" : 4432, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Index'" } - ], - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "opname" : "OpGroupIAddNonUniformAMD", - "opcode" : 5000, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFAddNonUniformAMD", - "opcode" : 5001, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFMinNonUniformAMD", - "opcode" : 5002, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupUMinNonUniformAMD", - "opcode" : 5003, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupSMinNonUniformAMD", - "opcode" : 5004, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFMaxNonUniformAMD", - "opcode" : 5005, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupUMaxNonUniformAMD", - "opcode" : 5006, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupSMaxNonUniformAMD", - "opcode" : 5007, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpFragmentMaskFetchAMD", - "opcode" : 5011, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" } - ], - "capabilities" : [ "FragmentMaskAMD" ] - }, - { - "opname" : "OpFragmentFetchAMD", - "opcode" : 5012, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Fragment Index'" } - ], - "capabilities" : [ "FragmentMaskAMD" ] - }, - { - "opname" : "OpSubgroupShuffleINTEL", - "opcode" : 5571, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Data'" }, - { "kind" : "IdRef", "name" : "'InvocationId'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ] - }, - { - "opname" : "OpSubgroupShuffleDownINTEL", - "opcode" : 5572, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Current'" }, - { "kind" : "IdRef", "name" : "'Next'" }, - { "kind" : "IdRef", "name" : "'Delta'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ] - }, - { - "opname" : "OpSubgroupShuffleUpINTEL", - "opcode" : 5573, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Previous'" }, - { "kind" : "IdRef", "name" : "'Current'" }, - { "kind" : "IdRef", "name" : "'Delta'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ] - }, - { - "opname" : "OpSubgroupShuffleXorINTEL", - "opcode" : 5574, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Data'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ] - }, - { - "opname" : "OpSubgroupBlockReadINTEL", - "opcode" : 5575, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Ptr'" } - ], - "capabilities" : [ "SubgroupBufferBlockIOINTEL" ] - }, - { - "opname" : "OpSubgroupBlockWriteINTEL", - "opcode" : 5576, - "operands" : [ - { "kind" : "IdRef", "name" : "'Ptr'" }, - { "kind" : "IdRef", "name" : "'Data'" } - ], - "capabilities" : [ "SubgroupBufferBlockIOINTEL" ] - }, - { - "opname" : "OpSubgroupImageBlockReadINTEL", - "opcode" : 5577, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" } - ], - "capabilities" : [ "SubgroupImageBlockIOINTEL" ] - }, - { - "opname" : "OpSubgroupImageBlockWriteINTEL", - "opcode" : 5578, - "operands" : [ - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Data'" } - ], - "capabilities" : [ "SubgroupImageBlockIOINTEL" ] - }, - { - "opname" : "OpDecorateStringGOOGLE", - "opcode" : 5632, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "Decoration" } - ], - "extensions" : [ "SPV_GOOGLE_decorate_string" ] - }, - { - "opname" : "OpMemberDecorateStringGOOGLE", - "opcode" : 5633, - "operands" : [ - { "kind" : "IdRef", "name" : "'Struct Type'" }, - { "kind" : "LiteralInteger", "name" : "'Member'" }, - { "kind" : "Decoration" } - ], - "extensions" : [ "SPV_GOOGLE_decorate_string" ] - } - ], - "operand_kinds" : [ - { - "category" : "BitEnum", - "kind" : "ImageOperands", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Bias", - "value" : "0x0001", - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Lod", - "value" : "0x0002", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Grad", - "value" : "0x0004", - "parameters" : [ - { "kind" : "IdRef" }, - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "ConstOffset", - "value" : "0x0008", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Offset", - "value" : "0x0010", - "capabilities" : [ "ImageGatherExtended" ], - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "ConstOffsets", - "value" : "0x0020", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Sample", - "value" : "0x0040", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "MinLod", - "value" : "0x0080", - "capabilities" : [ "MinLod" ], - "parameters" : [ - { "kind" : "IdRef" } - ] - } - ] - }, - { - "category" : "BitEnum", - "kind" : "FPFastMathMode", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "NotNaN", - "value" : "0x0001", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NotInf", - "value" : "0x0002", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NSZ", - "value" : "0x0004", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "AllowRecip", - "value" : "0x0008", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Fast", - "value" : "0x0010", - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "BitEnum", - "kind" : "SelectionControl", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Flatten", - "value" : "0x0001" - }, - { - "enumerant" : "DontFlatten", - "value" : "0x0002" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "LoopControl", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Unroll", - "value" : "0x0001" - }, - { - "enumerant" : "DontUnroll", - "value" : "0x0002" - }, - { - "enumerant" : "DependencyInfinite", - "value" : "0x0004" - }, - { - "enumerant" : "DependencyLength", - "value" : "0x0008", - "parameters" : [ - { "kind" : "LiteralInteger" } - ] - - } - ] - }, - { - "category" : "BitEnum", - "kind" : "FunctionControl", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Inline", - "value" : "0x0001" - }, - { - "enumerant" : "DontInline", - "value" : "0x0002" - }, - { - "enumerant" : "Pure", - "value" : "0x0004" - }, - { - "enumerant" : "Const", - "value" : "0x0008" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "MemorySemantics", - "enumerants" : [ - { - "enumerant" : "Relaxed", - "value" : "0x0000" - }, - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Acquire", - "value" : "0x0002" - }, - { - "enumerant" : "Release", - "value" : "0x0004" - }, - { - "enumerant" : "AcquireRelease", - "value" : "0x0008" - }, - { - "enumerant" : "SequentiallyConsistent", - "value" : "0x0010" - }, - { - "enumerant" : "UniformMemory", - "value" : "0x0040", - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SubgroupMemory", - "value" : "0x0080" - }, - { - "enumerant" : "WorkgroupMemory", - "value" : "0x0100" - }, - { - "enumerant" : "CrossWorkgroupMemory", - "value" : "0x0200" - }, - { - "enumerant" : "AtomicCounterMemory", - "value" : "0x0400", - "capabilities" : [ "AtomicStorage" ] - }, - { - "enumerant" : "ImageMemory", - "value" : "0x0800" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "MemoryAccess", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Volatile", - "value" : "0x0001" - }, - { - "enumerant" : "Aligned", - "value" : "0x0002", - "parameters" : [ - { "kind" : "LiteralInteger" } - ] - }, - { - "enumerant" : "Nontemporal", - "value" : "0x0004" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "KernelProfilingInfo", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "CmdExecTime", - "value" : "0x0001", - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "SourceLanguage", - "enumerants" : [ - { - "enumerant" : "Unknown", - "value" : 0 - }, - { - "enumerant" : "ESSL", - "value" : 1 - }, - { - "enumerant" : "GLSL", - "value" : 2 - }, - { - "enumerant" : "OpenCL_C", - "value" : 3 - }, - { - "enumerant" : "OpenCL_CPP", - "value" : 4 - }, - { - "enumerant" : "HLSL", - "value" : 5 - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ExecutionModel", - "enumerants" : [ - { - "enumerant" : "Vertex", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "TessellationControl", - "value" : 1, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "TessellationEvaluation", - "value" : 2, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Geometry", - "value" : 3, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "Fragment", - "value" : 4, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GLCompute", - "value" : 5, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Kernel", - "value" : 6, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "AddressingModel", - "enumerants" : [ - { - "enumerant" : "Logical", - "value" : 0 - }, - { - "enumerant" : "Physical32", - "value" : 1, - "capabilities" : [ "Addresses" ] - }, - { - "enumerant" : "Physical64", - "value" : 2, - "capabilities" : [ "Addresses" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "MemoryModel", - "enumerants" : [ - { - "enumerant" : "Simple", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GLSL450", - "value" : 1, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "OpenCL", - "value" : 2, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ExecutionMode", - "enumerants" : [ - { - "enumerant" : "Invocations", - "value" : 0, - "capabilities" : [ "Geometry" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Number of <>'" } - ] - }, - { - "enumerant" : "SpacingEqual", - "value" : 1, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "SpacingFractionalEven", - "value" : 2, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "SpacingFractionalOdd", - "value" : 3, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "VertexOrderCw", - "value" : 4, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "VertexOrderCcw", - "value" : 5, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "PixelCenterInteger", - "value" : 6, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "OriginUpperLeft", - "value" : 7, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "OriginLowerLeft", - "value" : 8, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "EarlyFragmentTests", - "value" : 9, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PointMode", - "value" : 10, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Xfb", - "value" : 11, - "capabilities" : [ "TransformFeedback" ] - }, - { - "enumerant" : "DepthReplacing", - "value" : 12, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DepthGreater", - "value" : 14, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DepthLess", - "value" : 15, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DepthUnchanged", - "value" : 16, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "LocalSize", - "value" : 17, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'x size'" }, - { "kind" : "LiteralInteger", "name" : "'y size'" }, - { "kind" : "LiteralInteger", "name" : "'z size'" } - ] - }, - { - "enumerant" : "LocalSizeHint", - "value" : 18, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'x size'" }, - { "kind" : "LiteralInteger", "name" : "'y size'" }, - { "kind" : "LiteralInteger", "name" : "'z size'" } - ] - }, - { - "enumerant" : "InputPoints", - "value" : 19, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "InputLines", - "value" : 20, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "InputLinesAdjacency", - "value" : 21, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "Triangles", - "value" : 22, - "capabilities" : [ "Geometry", "Tessellation" ] - }, - { - "enumerant" : "InputTrianglesAdjacency", - "value" : 23, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "Quads", - "value" : 24, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Isolines", - "value" : 25, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "OutputVertices", - "value" : 26, - "capabilities" : [ "Geometry", "Tessellation" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Vertex count'" } - ] - }, - { - "enumerant" : "OutputPoints", - "value" : 27, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "OutputLineStrip", - "value" : 28, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "OutputTriangleStrip", - "value" : 29, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "VecTypeHint", - "value" : 30, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Vector type'" } - ] - }, - { - "enumerant" : "ContractionOff", - "value" : 31, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Initializer", - "value" : 33, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Finalizer", - "value" : 34, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupSize", - "value" : 35, - "capabilities" : [ "SubgroupDispatch" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Subgroup Size'" } - ] - }, - { - "enumerant" : "SubgroupsPerWorkgroup", - "value" : 36, - "capabilities" : [ "SubgroupDispatch" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Subgroups Per Workgroup'" } - ] - }, - { - "enumerant" : "SubgroupsPerWorkgroupId", - "value" : 37, - "capabilities" : [ "SubgroupDispatch" ], - "parameters" : [ - { "kind" : "IdRef", "name" : "'Subgroups Per Workgroup'" } - ] - }, - { - "enumerant" : "LocalSizeId", - "value" : 38, - "parameters" : [ - { "kind" : "IdRef", "name" : "'x size'" }, - { "kind" : "IdRef", "name" : "'y size'" }, - { "kind" : "IdRef", "name" : "'z size'" } - ] - }, - { - "enumerant" : "LocalSizeHintId", - "value" : 39, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "IdRef", "name" : "'Local Size Hint'" } - ] - }, - { - "enumerant" : "PostDepthCoverage", - "value" : 4446, - "capabilities" : [ "SampleMaskPostDepthCoverage" ] - }, - { - "enumerant" : "StencilRefReplacingEXT", - "value" : 5027, - "capabilities" : [ "StencilExportEXT" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "StorageClass", - "enumerants" : [ - { - "enumerant" : "UniformConstant", - "value" : 0 - }, - { - "enumerant" : "Input", - "value" : 1 - }, - { - "enumerant" : "Uniform", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Output", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Workgroup", - "value" : 4 - }, - { - "enumerant" : "CrossWorkgroup", - "value" : 5 - }, - { - "enumerant" : "Private", - "value" : 6, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Function", - "value" : 7 - }, - { - "enumerant" : "Generic", - "value" : 8, - "capabilities" : [ "GenericPointer" ] - }, - { - "enumerant" : "PushConstant", - "value" : 9, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "AtomicCounter", - "value" : 10, - "capabilities" : [ "AtomicStorage" ] - }, - { - "enumerant" : "Image", - "value" : 11 - }, - { - "enumerant" : "StorageBuffer", - "value" : 12, - "extensions" : [ - "SPV_KHR_storage_buffer_storage_class", - "SPV_KHR_variable_pointers" - ], - "capabilities" : [ "Shader" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Dim", - "enumerants" : [ - { - "enumerant" : "1D", - "value" : 0, - "capabilities" : [ "Sampled1D" ] - }, - { - "enumerant" : "2D", - "value" : 1 - }, - { - "enumerant" : "3D", - "value" : 2 - }, - { - "enumerant" : "Cube", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rect", - "value" : 4, - "capabilities" : [ "SampledRect" ] - }, - { - "enumerant" : "Buffer", - "value" : 5, - "capabilities" : [ "SampledBuffer" ] - }, - { - "enumerant" : "SubpassData", - "value" : 6, - "capabilities" : [ "InputAttachment" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "SamplerAddressingMode", - "enumerants" : [ - { - "enumerant" : "None", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ClampToEdge", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Clamp", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Repeat", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RepeatMirrored", - "value" : 4, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "SamplerFilterMode", - "enumerants" : [ - { - "enumerant" : "Nearest", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Linear", - "value" : 1, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ImageFormat", - "enumerants" : [ - { - "enumerant" : "Unknown", - "value" : 0 - }, - { - "enumerant" : "Rgba32f", - "value" : 1, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba16f", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "R32f", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8", - "value" : 4, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8Snorm", - "value" : 5, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rg32f", - "value" : 6, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16f", - "value" : 7, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R11fG11fB10f", - "value" : 8, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16f", - "value" : 9, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba16", - "value" : 10, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgb10A2", - "value" : 11, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16", - "value" : 12, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8", - "value" : 13, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16", - "value" : 14, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8", - "value" : 15, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba16Snorm", - "value" : 16, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16Snorm", - "value" : 17, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8Snorm", - "value" : 18, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16Snorm", - "value" : 19, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8Snorm", - "value" : 20, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba32i", - "value" : 21, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba16i", - "value" : 22, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8i", - "value" : 23, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "R32i", - "value" : 24, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rg32i", - "value" : 25, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16i", - "value" : 26, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8i", - "value" : 27, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16i", - "value" : 28, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8i", - "value" : 29, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba32ui", - "value" : 30, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba16ui", - "value" : 31, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8ui", - "value" : 32, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "R32ui", - "value" : 33, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgb10a2ui", - "value" : 34, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg32ui", - "value" : 35, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16ui", - "value" : 36, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8ui", - "value" : 37, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16ui", - "value" : 38, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8ui", - "value" : 39, - "capabilities" : [ "StorageImageExtendedFormats" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ImageChannelOrder", - "enumerants" : [ - { - "enumerant" : "R", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "A", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RG", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RA", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGB", - "value" : 4, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGBA", - "value" : 5, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "BGRA", - "value" : 6, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ARGB", - "value" : 7, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Intensity", - "value" : 8, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Luminance", - "value" : 9, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Rx", - "value" : 10, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGx", - "value" : 11, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGBx", - "value" : 12, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Depth", - "value" : 13, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "DepthStencil", - "value" : 14, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sRGB", - "value" : 15, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sRGBx", - "value" : 16, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sRGBA", - "value" : 17, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sBGRA", - "value" : 18, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ABGR", - "value" : 19, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ImageChannelDataType", - "enumerants" : [ - { - "enumerant" : "SnormInt8", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SnormInt16", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt8", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt16", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormShort565", - "value" : 4, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormShort555", - "value" : 5, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt101010", - "value" : 6, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SignedInt8", - "value" : 7, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SignedInt16", - "value" : 8, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SignedInt32", - "value" : 9, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnsignedInt8", - "value" : 10, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnsignedInt16", - "value" : 11, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnsignedInt32", - "value" : 12, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "HalfFloat", - "value" : 13, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Float", - "value" : 14, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt24", - "value" : 15, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt101010_2", - "value" : 16, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "FPRoundingMode", - "enumerants" : [ - { - "enumerant" : "RTE", - "value" : 0, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ] - }, - { - "enumerant" : "RTZ", - "value" : 1, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ] - }, - { - "enumerant" : "RTP", - "value" : 2, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ] - }, - { - "enumerant" : "RTN", - "value" : 3, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "LinkageType", - "enumerants" : [ - { - "enumerant" : "Export", - "value" : 0, - "capabilities" : [ "Linkage" ] - }, - { - "enumerant" : "Import", - "value" : 1, - "capabilities" : [ "Linkage" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "AccessQualifier", - "enumerants" : [ - { - "enumerant" : "ReadOnly", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "WriteOnly", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ReadWrite", - "value" : 2, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "FunctionParameterAttribute", - "enumerants" : [ - { - "enumerant" : "Zext", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Sext", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ByVal", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Sret", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoAlias", - "value" : 4, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoCapture", - "value" : 5, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoWrite", - "value" : 6, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoReadWrite", - "value" : 7, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Decoration", - "enumerants" : [ - { - "enumerant" : "RelaxedPrecision", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SpecId", - "value" : 1, - "capabilities" : [ "Shader", "Kernel" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Specialization Constant ID'" } - ] - }, - { - "enumerant" : "Block", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "BufferBlock", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "RowMajor", - "value" : 4, - "capabilities" : [ "Matrix" ] - }, - { - "enumerant" : "ColMajor", - "value" : 5, - "capabilities" : [ "Matrix" ] - }, - { - "enumerant" : "ArrayStride", - "value" : 6, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Array Stride'" } - ] - }, - { - "enumerant" : "MatrixStride", - "value" : 7, - "capabilities" : [ "Matrix" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Matrix Stride'" } - ] - }, - { - "enumerant" : "GLSLShared", - "value" : 8, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GLSLPacked", - "value" : 9, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "CPacked", - "value" : 10, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "BuiltIn", - "value" : 11, - "parameters" : [ - { "kind" : "BuiltIn" } - ] - }, - { - "enumerant" : "NoPerspective", - "value" : 13, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Flat", - "value" : 14, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Patch", - "value" : 15, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Centroid", - "value" : 16, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Sample", - "value" : 17, - "capabilities" : [ "SampleRateShading" ] - }, - { - "enumerant" : "Invariant", - "value" : 18, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Restrict", - "value" : 19 - }, - { - "enumerant" : "Aliased", - "value" : 20 - }, - { - "enumerant" : "Volatile", - "value" : 21 - }, - { - "enumerant" : "Constant", - "value" : 22, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Coherent", - "value" : 23 - }, - { - "enumerant" : "NonWritable", - "value" : 24 - }, - { - "enumerant" : "NonReadable", - "value" : 25 - }, - { - "enumerant" : "Uniform", - "value" : 26, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SaturatedConversion", - "value" : 28, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Stream", - "value" : 29, - "capabilities" : [ "GeometryStreams" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Stream Number'" } - ] - }, - { - "enumerant" : "Location", - "value" : 30, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Location'" } - ] - }, - { - "enumerant" : "Component", - "value" : 31, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Component'" } - ] - }, - { - "enumerant" : "Index", - "value" : 32, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Index'" } - ] - }, - { - "enumerant" : "Binding", - "value" : 33, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Binding Point'" } - ] - }, - { - "enumerant" : "DescriptorSet", - "value" : 34, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Descriptor Set'" } - ] - }, - { - "enumerant" : "Offset", - "value" : 35, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Byte Offset'" } - ] - }, - { - "enumerant" : "XfbBuffer", - "value" : 36, - "capabilities" : [ "TransformFeedback" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'XFB Buffer Number'" } - ] - }, - { - "enumerant" : "XfbStride", - "value" : 37, - "capabilities" : [ "TransformFeedback" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'XFB Stride'" } - ] - }, - { - "enumerant" : "FuncParamAttr", - "value" : 38, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "FunctionParameterAttribute", "name" : "'Function Parameter Attribute'" } - ] - }, - { - "enumerant" : "FPRoundingMode", - "value" : 39, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ], - "parameters" : [ - { "kind" : "FPRoundingMode", "name" : "'Floating-Point Rounding Mode'" } - ] - }, - { - "enumerant" : "FPFastMathMode", - "value" : 40, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "FPFastMathMode", "name" : "'Fast-Math Mode'" } - ] - }, - { - "enumerant" : "LinkageAttributes", - "value" : 41, - "capabilities" : [ "Linkage" ], - "parameters" : [ - { "kind" : "LiteralString", "name" : "'Name'" }, - { "kind" : "LinkageType", "name" : "'Linkage Type'" } - ] - }, - { - "enumerant" : "NoContraction", - "value" : 42, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InputAttachmentIndex", - "value" : 43, - "capabilities" : [ "InputAttachment" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Attachment Index'" } - ] - }, - { - "enumerant" : "Alignment", - "value" : 44, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Alignment'" } - ] - }, - { - "enumerant" : "MaxByteOffset", - "value" : 45, - "capabilities" : [ "Addresses" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Max Byte Offset'" } - ] - }, - { - "enumerant" : "AlignmentId", - "value" : 46, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "IdRef", "name" : "'Alignment'" } - ] - }, - { - "enumerant" : "MaxByteOffsetId", - "value" : 47, - "capabilities" : [ "Addresses" ], - "parameters" : [ - { "kind" : "IdRef", "name" : "'Max Byte Offset'" } - ] - }, - { - "enumerant" : "ExplicitInterpAMD", - "value" : 4999 - }, - { - "enumerant" : "OverrideCoverageNV", - "value" : 5248, - "capabilities" : [ "SampleMaskOverrideCoverageNV" ] - }, - { - "enumerant" : "PassthroughNV", - "value" : 5250, - "capabilities" : [ "GeometryShaderPassthroughNV" ] - }, - { - "enumerant" : "ViewportRelativeNV", - "value" : 5252, - "capabilities" : [ "ShaderViewportMaskNV" ] - }, - { - "enumerant" : "SecondaryViewportRelativeNV", - "value" : 5256, - "capabilities" : [ "ShaderStereoViewNV" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Offset'" } - ] - }, - { - "enumerant" : "HlslCounterBufferGOOGLE", - "value" : 5634, - "parameters" : [ - { "kind" : "IdRef", "name" : "'Counter Buffer'" } - ], - "extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ] - }, - { - "enumerant" : "HlslSemanticGOOGLE", - "value" : 5635, - "parameters" : [ - { "kind" : "LiteralString", "name" : "'Semantic'" } - ], - "extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "BuiltIn", - "enumerants" : [ - { - "enumerant" : "Position", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PointSize", - "value" : 1, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ClipDistance", - "value" : 3, - "capabilities" : [ "ClipDistance" ] - }, - { - "enumerant" : "CullDistance", - "value" : 4, - "capabilities" : [ "CullDistance" ] - }, - { - "enumerant" : "VertexId", - "value" : 5, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InstanceId", - "value" : 6, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PrimitiveId", - "value" : 7, - "capabilities" : [ "Geometry", "Tessellation" ] - }, - { - "enumerant" : "InvocationId", - "value" : 8, - "capabilities" : [ "Geometry", "Tessellation" ] - }, - { - "enumerant" : "Layer", - "value" : 9, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "ViewportIndex", - "value" : 10, - "capabilities" : [ "MultiViewport" ] - }, - { - "enumerant" : "TessLevelOuter", - "value" : 11, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "TessLevelInner", - "value" : 12, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "TessCoord", - "value" : 13, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "PatchVertices", - "value" : 14, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "FragCoord", - "value" : 15, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PointCoord", - "value" : 16, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "FrontFacing", - "value" : 17, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SampleId", - "value" : 18, - "capabilities" : [ "SampleRateShading" ] - }, - { - "enumerant" : "SamplePosition", - "value" : 19, - "capabilities" : [ "SampleRateShading" ] - }, - { - "enumerant" : "SampleMask", - "value" : 20, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "FragDepth", - "value" : 22, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "HelperInvocation", - "value" : 23, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "NumWorkgroups", - "value" : 24 - }, - { - "enumerant" : "WorkgroupSize", - "value" : 25 - }, - { - "enumerant" : "WorkgroupId", - "value" : 26 - }, - { - "enumerant" : "LocalInvocationId", - "value" : 27 - }, - { - "enumerant" : "GlobalInvocationId", - "value" : 28 - }, - { - "enumerant" : "LocalInvocationIndex", - "value" : 29 - }, - { - "enumerant" : "WorkDim", - "value" : 30, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "GlobalSize", - "value" : 31, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "EnqueuedWorkgroupSize", - "value" : 32, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "GlobalOffset", - "value" : 33, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "GlobalLinearId", - "value" : 34, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupSize", - "value" : 36, - "capabilities" : [ "Kernel", "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupMaxSize", - "value" : 37, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NumSubgroups", - "value" : 38, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NumEnqueuedSubgroups", - "value" : 39, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupId", - "value" : 40, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupLocalInvocationId", - "value" : 41, - "capabilities" : [ "Kernel", "SubgroupBallotKHR" ] - }, - { - "enumerant" : "VertexIndex", - "value" : 42, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InstanceIndex", - "value" : 43, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SubgroupEqMaskKHR", - "value" : 4416, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupGeMaskKHR", - "value" : 4417, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupGtMaskKHR", - "value" : 4418, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupLeMaskKHR", - "value" : 4419, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupLtMaskKHR", - "value" : 4420, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "BaseVertex", - "value" : 4424, - "capabilities" : [ "DrawParameters" ] - }, - { - "enumerant" : "BaseInstance", - "value" : 4425, - "capabilities" : [ "DrawParameters" ] - }, - { - "enumerant" : "DrawIndex", - "value" : 4426, - "capabilities" : [ "DrawParameters" ] - }, - { - "enumerant" : "DeviceIndex", - "value" : 4438, - "capabilities" : [ "DeviceGroup" ] - }, - { - "enumerant" : "ViewIndex", - "value" : 4440, - "capabilities" : [ "MultiView" ] - }, - { - "enumerant" : "BaryCoordNoPerspAMD", - "value" : 4992 - }, - { - "enumerant" : "BaryCoordNoPerspCentroidAMD", - "value" : 4993 - }, - { - "enumerant" : "BaryCoordNoPerspSampleAMD", - "value" : 4994 - }, - { - "enumerant" : "BaryCoordSmoothAMD", - "value" : 4995 - }, - { - "enumerant" : "BaryCoordSmoothCentroidAMD", - "value" : 4996 - }, - { - "enumerant" : "BaryCoordSmoothSampleAMD", - "value" : 4997 - }, - { - "enumerant" : "BaryCoordPullModelAMD", - "value" : 4998 - }, - { - "enumerant" : "FragStencilRefEXT", - "value" : 5014, - "capabilities" : [ "StencilExportEXT" ] - }, - { - "enumerant" : "ViewportMaskNV", - "value" : 5253, - "capabilities" : [ "ShaderViewportMaskNV" ] - }, - { - "enumerant" : "SecondaryPositionNV", - "value" : 5257, - "capabilities" : [ "ShaderStereoViewNV" ] - }, - { - "enumerant" : "SecondaryViewportMaskNV", - "value" : 5258, - "capabilities" : [ "ShaderStereoViewNV" ] - }, - { - "enumerant" : "PositionPerViewNV", - "value" : 5261, - "capabilities" : [ "PerViewAttributesNV" ] - }, - { - "enumerant" : "ViewportMaskPerViewNV", - "value" : 5262, - "capabilities" : [ "PerViewAttributesNV" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Scope", - "enumerants" : [ - { - "enumerant" : "CrossDevice", - "value" : 0 - }, - { - "enumerant" : "Device", - "value" : 1 - }, - { - "enumerant" : "Workgroup", - "value" : 2 - }, - { - "enumerant" : "Subgroup", - "value" : 3 - }, - { - "enumerant" : "Invocation", - "value" : 4 - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "GroupOperation", - "enumerants" : [ - { - "enumerant" : "Reduce", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "InclusiveScan", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ExclusiveScan", - "value" : 2, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "KernelEnqueueFlags", - "enumerants" : [ - { - "enumerant" : "NoWait", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "WaitKernel", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "WaitWorkGroup", - "value" : 2, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Capability", - "enumerants" : [ - { - "enumerant" : "Matrix", - "value" : 0 - }, - { - "enumerant" : "Shader", - "value" : 1, - "capabilities" : [ "Matrix" ] - }, - { - "enumerant" : "Geometry", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Tessellation", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Addresses", - "value" : 4 - }, - { - "enumerant" : "Linkage", - "value" : 5 - }, - { - "enumerant" : "Kernel", - "value" : 6 - }, - { - "enumerant" : "Vector16", - "value" : 7, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Float16Buffer", - "value" : 8, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Float16", - "value" : 9 - }, - { - "enumerant" : "Float64", - "value" : 10 - }, - { - "enumerant" : "Int64", - "value" : 11 - }, - { - "enumerant" : "Int64Atomics", - "value" : 12, - "capabilities" : [ "Int64" ] - }, - { - "enumerant" : "ImageBasic", - "value" : 13, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ImageReadWrite", - "value" : 14, - "capabilities" : [ "ImageBasic" ] - }, - { - "enumerant" : "ImageMipmap", - "value" : 15, - "capabilities" : [ "ImageBasic" ] - }, - { - "enumerant" : "Pipes", - "value" : 17, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Groups", - "value" : 18 - }, - { - "enumerant" : "DeviceEnqueue", - "value" : 19, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "LiteralSampler", - "value" : 20, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "AtomicStorage", - "value" : 21, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Int16", - "value" : 22 - }, - { - "enumerant" : "TessellationPointSize", - "value" : 23, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "GeometryPointSize", - "value" : 24, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "ImageGatherExtended", - "value" : 25, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageMultisample", - "value" : 27, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "UniformBufferArrayDynamicIndexing", - "value" : 28, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SampledImageArrayDynamicIndexing", - "value" : 29, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageBufferArrayDynamicIndexing", - "value" : 30, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageArrayDynamicIndexing", - "value" : 31, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ClipDistance", - "value" : 32, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "CullDistance", - "value" : 33, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ImageCubeArray", - "value" : 34, - "capabilities" : [ "SampledCubeArray" ] - }, - { - "enumerant" : "SampleRateShading", - "value" : 35, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ImageRect", - "value" : 36, - "capabilities" : [ "SampledRect" ] - }, - { - "enumerant" : "SampledRect", - "value" : 37, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GenericPointer", - "value" : 38, - "capabilities" : [ "Addresses" ] - }, - { - "enumerant" : "Int8", - "value" : 39, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "InputAttachment", - "value" : 40, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SparseResidency", - "value" : 41, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "MinLod", - "value" : 42, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Sampled1D", - "value" : 43 - }, - { - "enumerant" : "Image1D", - "value" : 44, - "capabilities" : [ "Sampled1D" ] - }, - { - "enumerant" : "SampledCubeArray", - "value" : 45, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SampledBuffer", - "value" : 46 - }, - { - "enumerant" : "ImageBuffer", - "value" : 47, - "capabilities" : [ "SampledBuffer" ] - }, - { - "enumerant" : "ImageMSArray", - "value" : 48, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageExtendedFormats", - "value" : 49, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ImageQuery", - "value" : 50, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DerivativeControl", - "value" : 51, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InterpolationFunction", - "value" : 52, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "TransformFeedback", - "value" : 53, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GeometryStreams", - "value" : 54, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "StorageImageReadWithoutFormat", - "value" : 55, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageWriteWithoutFormat", - "value" : 56, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "MultiViewport", - "value" : 57, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "SubgroupDispatch", - "value" : 58, - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "enumerant" : "NamedBarrier", - "value" : 59, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "PipeStorage", - "value" : 60, - "capabilities" : [ "Pipes" ] - }, - { - "enumerant" : "SubgroupBallotKHR", - "value" : 4423, - "extensions" : [ "SPV_KHR_shader_ballot" ] - }, - { - "enumerant" : "DrawParameters", - "value" : 4427, - "extensions" : [ "SPV_KHR_shader_draw_parameters" ] - }, - { - "enumerant" : "SubgroupVoteKHR", - "value" : 4431, - "extensions" : [ "SPV_KHR_subgroup_vote" ] - }, - { - "enumerant" : "StorageBuffer16BitAccess", - "value" : 4433, - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "StorageUniformBufferBlock16", - "value" : 4433, - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "UniformAndStorageBuffer16BitAccess", - "value" : 4434, - "capabilities" : [ - "StorageBuffer16BitAccess", - "StorageUniformBufferBlock16" - ], - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "StorageUniform16", - "value" : 4434, - "capabilities" : [ - "StorageBuffer16BitAccess", - "StorageUniformBufferBlock16" - ], - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "StoragePushConstant16", - "value" : 4435, - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "StorageInputOutput16", - "value" : 4436, - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "DeviceGroup", - "value" : 4437, - "extensions" : [ "SPV_KHR_device_group" ] - }, - { - "enumerant" : "MultiView", - "value" : 4439, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_KHR_multiview" ] - }, - { - "enumerant" : "VariablePointersStorageBuffer", - "value" : 4441, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_KHR_variable_pointers" ] - }, - { - "enumerant" : "VariablePointers", - "value" : 4442, - "capabilities" : [ "VariablePointersStorageBuffer" ], - "extensions" : [ "SPV_KHR_variable_pointers" ] - }, - { - "enumerant": "AtomicStorageOps", - "value": 4445, - "extensions": [ "SPV_KHR_shader_atomic_counter_ops" ] - }, - { - "enumerant" : "SampleMaskPostDepthCoverage", - "value" : 4447, - "extensions" : [ "SPV_KHR_post_depth_coverage" ] - }, - { - "enumerant" : "ImageGatherBiasLodAMD", - "value" : 5009, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_AMD_texture_gather_bias_lod" ] - }, - { - "enumerant" : "FragmentMaskAMD", - "value" : 5010, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_AMD_shader_fragment_mask" ] - }, - { - "enumerant" : "StencilExportEXT", - "value" : 5013, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_EXT_shader_stencil_export" ] - }, - { - "enumerant" : "ImageReadWriteLodAMD", - "value" : 5015, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_AMD_shader_image_load_store_lod" ] - }, - { - "enumerant" : "SampleMaskOverrideCoverageNV", - "value" : 5249, - "capabilities" : [ "SampleRateShading" ], - "extensions" : [ "SPV_NV_sample_mask_override_coverage" ] - }, - { - "enumerant" : "GeometryShaderPassthroughNV", - "value" : 5251, - "capabilities" : [ "Geometry" ], - "extensions" : [ "SPV_NV_geometry_shader_passthrough" ] - }, - { - "enumerant" : "ShaderViewportIndexLayerEXT", - "value" : 5254, - "capabilities" : [ "MultiViewport" ], - "extensions" : [ "SPV_EXT_shader_viewport_index_layer" ] - }, - { - "enumerant" : "ShaderViewportIndexLayerNV", - "value" : 5254, - "capabilities" : [ "MultiViewport" ], - "extensions" : [ "SPV_NV_viewport_array2" ] - }, - { - "enumerant" : "ShaderViewportMaskNV", - "value" : 5255, - "capabilities" : [ "ShaderViewportIndexLayerNV" ], - "extensions" : [ "SPV_NV_viewport_array2" ] - }, - { - "enumerant" : "ShaderStereoViewNV", - "value" : 5259, - "capabilities" : [ "ShaderViewportMaskNV" ], - "extensions" : [ "SPV_NV_stereo_view_rendering" ] - }, - { - "enumerant" : "PerViewAttributesNV", - "value" : 5260, - "capabilities" : [ "MultiView" ], - "extensions" : [ "SPV_NVX_multiview_per_view_attributes" ] - }, - { - "enumerant" : "SubgroupShuffleINTEL", - "value" : 5568, - "extensions" : [ "SPV_INTEL_subgroups" ] - }, - { - "enumerant" : "SubgroupBufferBlockIOINTEL", - "value" : 5569, - "extensions" : [ "SPV_INTEL_subgroups" ] - }, - { - "enumerant" : "SubgroupImageBlockIOINTEL", - "value" : 5570, - "extensions" : [ "SPV_INTEL_subgroups" ] - } - ] - }, - { - "category" : "Id", - "kind" : "IdResultType", - "doc" : "Reference to an representing the result's type of the enclosing instruction" - }, - { - "category" : "Id", - "kind" : "IdResult", - "doc" : "Definition of an representing the result of the enclosing instruction" - }, - { - "category" : "Id", - "kind" : "IdMemorySemantics", - "doc" : "Reference to an representing a 32-bit integer that is a mask from the MemorySemantics operand kind" - }, - { - "category" : "Id", - "kind" : "IdScope", - "doc" : "Reference to an representing a 32-bit integer that is a mask from the Scope operand kind" - }, - { - "category" : "Id", - "kind" : "IdRef", - "doc" : "Reference to an " - }, - { - "category" : "Literal", - "kind" : "LiteralInteger", - "doc" : "An integer consuming one or more words" - }, - { - "category" : "Literal", - "kind" : "LiteralString", - "doc" : "A null-terminated stream of characters consuming an integral number of words" - }, - { - "category" : "Literal", - "kind" : "LiteralContextDependentNumber", - "doc" : "A literal number whose size and format are determined by a previous operand in the enclosing instruction" - }, - { - "category" : "Literal", - "kind" : "LiteralExtInstInteger", - "doc" : "A 32-bit unsigned integer indicating which instruction to use and determining the layout of following operands (for OpExtInst)" - }, - { - "category" : "Literal", - "kind" : "LiteralSpecConstantOpInteger", - "doc" : "An opcode indicating the operation to be performed and determining the layout of following operands (for OpSpecConstantOp)" - }, - { - "category" : "Composite", - "kind" : "PairLiteralIntegerIdRef", - "bases" : [ "LiteralInteger", "IdRef" ] - }, - { - "category" : "Composite", - "kind" : "PairIdRefLiteralInteger", - "bases" : [ "IdRef", "LiteralInteger" ] - }, - { - "category" : "Composite", - "kind" : "PairIdRefIdRef", - "bases" : [ "IdRef", "IdRef" ] - } - ] -} diff --git a/include/spirv/1.2/spirv.cs b/include/spirv/1.2/spirv.cs deleted file mode 100644 index 493303d6..00000000 --- a/include/spirv/1.2/spirv.cs +++ /dev/null @@ -1,1021 +0,0 @@ -// Copyright (c) 2014-2018 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -// This header is automatically generated by the same tool that creates -// the Binary Section of the SPIR-V specification. - -// Enumeration tokens for SPIR-V, in various styles: -// C, C++, C++11, JSON, Lua, Python, C# -// -// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -// - C# will use enum classes in the Specification class located in the "Spv" namespace, e.g.: Spv.Specification.SourceLanguage.GLSL -// -// Some tokens act like mask values, which can be OR'd together, -// while others are mutually exclusive. The mask-like ones have -// "Mask" in their name, and a parallel enum that has the shift -// amount (1 << x) for each corresponding enumerant. - -namespace Spv -{ - - public static class Specification - { - public const uint MagicNumber = 0x07230203; - public const uint Version = 0x00010200; - public const uint Revision = 2; - public const uint OpCodeMask = 0xffff; - public const uint WordCountShift = 16; - - public enum SourceLanguage - { - Unknown = 0, - ESSL = 1, - GLSL = 2, - OpenCL_C = 3, - OpenCL_CPP = 4, - HLSL = 5, - } - - public enum ExecutionModel - { - Vertex = 0, - TessellationControl = 1, - TessellationEvaluation = 2, - Geometry = 3, - Fragment = 4, - GLCompute = 5, - Kernel = 6, - } - - public enum AddressingModel - { - Logical = 0, - Physical32 = 1, - Physical64 = 2, - } - - public enum MemoryModel - { - Simple = 0, - GLSL450 = 1, - OpenCL = 2, - } - - public enum ExecutionMode - { - Invocations = 0, - SpacingEqual = 1, - SpacingFractionalEven = 2, - SpacingFractionalOdd = 3, - VertexOrderCw = 4, - VertexOrderCcw = 5, - PixelCenterInteger = 6, - OriginUpperLeft = 7, - OriginLowerLeft = 8, - EarlyFragmentTests = 9, - PointMode = 10, - Xfb = 11, - DepthReplacing = 12, - DepthGreater = 14, - DepthLess = 15, - DepthUnchanged = 16, - LocalSize = 17, - LocalSizeHint = 18, - InputPoints = 19, - InputLines = 20, - InputLinesAdjacency = 21, - Triangles = 22, - InputTrianglesAdjacency = 23, - Quads = 24, - Isolines = 25, - OutputVertices = 26, - OutputPoints = 27, - OutputLineStrip = 28, - OutputTriangleStrip = 29, - VecTypeHint = 30, - ContractionOff = 31, - Initializer = 33, - Finalizer = 34, - SubgroupSize = 35, - SubgroupsPerWorkgroup = 36, - SubgroupsPerWorkgroupId = 37, - LocalSizeId = 38, - LocalSizeHintId = 39, - PostDepthCoverage = 4446, - StencilRefReplacingEXT = 5027, - } - - public enum StorageClass - { - UniformConstant = 0, - Input = 1, - Uniform = 2, - Output = 3, - Workgroup = 4, - CrossWorkgroup = 5, - Private = 6, - Function = 7, - Generic = 8, - PushConstant = 9, - AtomicCounter = 10, - Image = 11, - StorageBuffer = 12, - } - - public enum Dim - { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - Cube = 3, - Rect = 4, - Buffer = 5, - SubpassData = 6, - } - - public enum SamplerAddressingMode - { - None = 0, - ClampToEdge = 1, - Clamp = 2, - Repeat = 3, - RepeatMirrored = 4, - } - - public enum SamplerFilterMode - { - Nearest = 0, - Linear = 1, - } - - public enum ImageFormat - { - Unknown = 0, - Rgba32f = 1, - Rgba16f = 2, - R32f = 3, - Rgba8 = 4, - Rgba8Snorm = 5, - Rg32f = 6, - Rg16f = 7, - R11fG11fB10f = 8, - R16f = 9, - Rgba16 = 10, - Rgb10A2 = 11, - Rg16 = 12, - Rg8 = 13, - R16 = 14, - R8 = 15, - Rgba16Snorm = 16, - Rg16Snorm = 17, - Rg8Snorm = 18, - R16Snorm = 19, - R8Snorm = 20, - Rgba32i = 21, - Rgba16i = 22, - Rgba8i = 23, - R32i = 24, - Rg32i = 25, - Rg16i = 26, - Rg8i = 27, - R16i = 28, - R8i = 29, - Rgba32ui = 30, - Rgba16ui = 31, - Rgba8ui = 32, - R32ui = 33, - Rgb10a2ui = 34, - Rg32ui = 35, - Rg16ui = 36, - Rg8ui = 37, - R16ui = 38, - R8ui = 39, - } - - public enum ImageChannelOrder - { - R = 0, - A = 1, - RG = 2, - RA = 3, - RGB = 4, - RGBA = 5, - BGRA = 6, - ARGB = 7, - Intensity = 8, - Luminance = 9, - Rx = 10, - RGx = 11, - RGBx = 12, - Depth = 13, - DepthStencil = 14, - sRGB = 15, - sRGBx = 16, - sRGBA = 17, - sBGRA = 18, - ABGR = 19, - } - - public enum ImageChannelDataType - { - SnormInt8 = 0, - SnormInt16 = 1, - UnormInt8 = 2, - UnormInt16 = 3, - UnormShort565 = 4, - UnormShort555 = 5, - UnormInt101010 = 6, - SignedInt8 = 7, - SignedInt16 = 8, - SignedInt32 = 9, - UnsignedInt8 = 10, - UnsignedInt16 = 11, - UnsignedInt32 = 12, - HalfFloat = 13, - Float = 14, - UnormInt24 = 15, - UnormInt101010_2 = 16, - } - - public enum ImageOperandsShift - { - Bias = 0, - Lod = 1, - Grad = 2, - ConstOffset = 3, - Offset = 4, - ConstOffsets = 5, - Sample = 6, - MinLod = 7, - } - - public enum ImageOperandsMask - { - MaskNone = 0, - Bias = 0x00000001, - Lod = 0x00000002, - Grad = 0x00000004, - ConstOffset = 0x00000008, - Offset = 0x00000010, - ConstOffsets = 0x00000020, - Sample = 0x00000040, - MinLod = 0x00000080, - } - - public enum FPFastMathModeShift - { - NotNaN = 0, - NotInf = 1, - NSZ = 2, - AllowRecip = 3, - Fast = 4, - } - - public enum FPFastMathModeMask - { - MaskNone = 0, - NotNaN = 0x00000001, - NotInf = 0x00000002, - NSZ = 0x00000004, - AllowRecip = 0x00000008, - Fast = 0x00000010, - } - - public enum FPRoundingMode - { - RTE = 0, - RTZ = 1, - RTP = 2, - RTN = 3, - } - - public enum LinkageType - { - Export = 0, - Import = 1, - } - - public enum AccessQualifier - { - ReadOnly = 0, - WriteOnly = 1, - ReadWrite = 2, - } - - public enum FunctionParameterAttribute - { - Zext = 0, - Sext = 1, - ByVal = 2, - Sret = 3, - NoAlias = 4, - NoCapture = 5, - NoWrite = 6, - NoReadWrite = 7, - } - - public enum Decoration - { - RelaxedPrecision = 0, - SpecId = 1, - Block = 2, - BufferBlock = 3, - RowMajor = 4, - ColMajor = 5, - ArrayStride = 6, - MatrixStride = 7, - GLSLShared = 8, - GLSLPacked = 9, - CPacked = 10, - BuiltIn = 11, - NoPerspective = 13, - Flat = 14, - Patch = 15, - Centroid = 16, - Sample = 17, - Invariant = 18, - Restrict = 19, - Aliased = 20, - Volatile = 21, - Constant = 22, - Coherent = 23, - NonWritable = 24, - NonReadable = 25, - Uniform = 26, - SaturatedConversion = 28, - Stream = 29, - Location = 30, - Component = 31, - Index = 32, - Binding = 33, - DescriptorSet = 34, - Offset = 35, - XfbBuffer = 36, - XfbStride = 37, - FuncParamAttr = 38, - FPRoundingMode = 39, - FPFastMathMode = 40, - LinkageAttributes = 41, - NoContraction = 42, - InputAttachmentIndex = 43, - Alignment = 44, - MaxByteOffset = 45, - AlignmentId = 46, - MaxByteOffsetId = 47, - ExplicitInterpAMD = 4999, - OverrideCoverageNV = 5248, - PassthroughNV = 5250, - ViewportRelativeNV = 5252, - SecondaryViewportRelativeNV = 5256, - HlslCounterBufferGOOGLE = 5634, - HlslSemanticGOOGLE = 5635, - } - - public enum BuiltIn - { - Position = 0, - PointSize = 1, - ClipDistance = 3, - CullDistance = 4, - VertexId = 5, - InstanceId = 6, - PrimitiveId = 7, - InvocationId = 8, - Layer = 9, - ViewportIndex = 10, - TessLevelOuter = 11, - TessLevelInner = 12, - TessCoord = 13, - PatchVertices = 14, - FragCoord = 15, - PointCoord = 16, - FrontFacing = 17, - SampleId = 18, - SamplePosition = 19, - SampleMask = 20, - FragDepth = 22, - HelperInvocation = 23, - NumWorkgroups = 24, - WorkgroupSize = 25, - WorkgroupId = 26, - LocalInvocationId = 27, - GlobalInvocationId = 28, - LocalInvocationIndex = 29, - WorkDim = 30, - GlobalSize = 31, - EnqueuedWorkgroupSize = 32, - GlobalOffset = 33, - GlobalLinearId = 34, - SubgroupSize = 36, - SubgroupMaxSize = 37, - NumSubgroups = 38, - NumEnqueuedSubgroups = 39, - SubgroupId = 40, - SubgroupLocalInvocationId = 41, - VertexIndex = 42, - InstanceIndex = 43, - SubgroupEqMaskKHR = 4416, - SubgroupGeMaskKHR = 4417, - SubgroupGtMaskKHR = 4418, - SubgroupLeMaskKHR = 4419, - SubgroupLtMaskKHR = 4420, - BaseVertex = 4424, - BaseInstance = 4425, - DrawIndex = 4426, - DeviceIndex = 4438, - ViewIndex = 4440, - BaryCoordNoPerspAMD = 4992, - BaryCoordNoPerspCentroidAMD = 4993, - BaryCoordNoPerspSampleAMD = 4994, - BaryCoordSmoothAMD = 4995, - BaryCoordSmoothCentroidAMD = 4996, - BaryCoordSmoothSampleAMD = 4997, - BaryCoordPullModelAMD = 4998, - FragStencilRefEXT = 5014, - ViewportMaskNV = 5253, - SecondaryPositionNV = 5257, - SecondaryViewportMaskNV = 5258, - PositionPerViewNV = 5261, - ViewportMaskPerViewNV = 5262, - } - - public enum SelectionControlShift - { - Flatten = 0, - DontFlatten = 1, - } - - public enum SelectionControlMask - { - MaskNone = 0, - Flatten = 0x00000001, - DontFlatten = 0x00000002, - } - - public enum LoopControlShift - { - Unroll = 0, - DontUnroll = 1, - DependencyInfinite = 2, - DependencyLength = 3, - } - - public enum LoopControlMask - { - MaskNone = 0, - Unroll = 0x00000001, - DontUnroll = 0x00000002, - DependencyInfinite = 0x00000004, - DependencyLength = 0x00000008, - } - - public enum FunctionControlShift - { - Inline = 0, - DontInline = 1, - Pure = 2, - Const = 3, - } - - public enum FunctionControlMask - { - MaskNone = 0, - Inline = 0x00000001, - DontInline = 0x00000002, - Pure = 0x00000004, - Const = 0x00000008, - } - - public enum MemorySemanticsShift - { - Acquire = 1, - Release = 2, - AcquireRelease = 3, - SequentiallyConsistent = 4, - UniformMemory = 6, - SubgroupMemory = 7, - WorkgroupMemory = 8, - CrossWorkgroupMemory = 9, - AtomicCounterMemory = 10, - ImageMemory = 11, - } - - public enum MemorySemanticsMask - { - MaskNone = 0, - Acquire = 0x00000002, - Release = 0x00000004, - AcquireRelease = 0x00000008, - SequentiallyConsistent = 0x00000010, - UniformMemory = 0x00000040, - SubgroupMemory = 0x00000080, - WorkgroupMemory = 0x00000100, - CrossWorkgroupMemory = 0x00000200, - AtomicCounterMemory = 0x00000400, - ImageMemory = 0x00000800, - } - - public enum MemoryAccessShift - { - Volatile = 0, - Aligned = 1, - Nontemporal = 2, - } - - public enum MemoryAccessMask - { - MaskNone = 0, - Volatile = 0x00000001, - Aligned = 0x00000002, - Nontemporal = 0x00000004, - } - - public enum Scope - { - CrossDevice = 0, - Device = 1, - Workgroup = 2, - Subgroup = 3, - Invocation = 4, - } - - public enum GroupOperation - { - Reduce = 0, - InclusiveScan = 1, - ExclusiveScan = 2, - } - - public enum KernelEnqueueFlags - { - NoWait = 0, - WaitKernel = 1, - WaitWorkGroup = 2, - } - - public enum KernelProfilingInfoShift - { - CmdExecTime = 0, - } - - public enum KernelProfilingInfoMask - { - MaskNone = 0, - CmdExecTime = 0x00000001, - } - - public enum Capability - { - Matrix = 0, - Shader = 1, - Geometry = 2, - Tessellation = 3, - Addresses = 4, - Linkage = 5, - Kernel = 6, - Vector16 = 7, - Float16Buffer = 8, - Float16 = 9, - Float64 = 10, - Int64 = 11, - Int64Atomics = 12, - ImageBasic = 13, - ImageReadWrite = 14, - ImageMipmap = 15, - Pipes = 17, - Groups = 18, - DeviceEnqueue = 19, - LiteralSampler = 20, - AtomicStorage = 21, - Int16 = 22, - TessellationPointSize = 23, - GeometryPointSize = 24, - ImageGatherExtended = 25, - StorageImageMultisample = 27, - UniformBufferArrayDynamicIndexing = 28, - SampledImageArrayDynamicIndexing = 29, - StorageBufferArrayDynamicIndexing = 30, - StorageImageArrayDynamicIndexing = 31, - ClipDistance = 32, - CullDistance = 33, - ImageCubeArray = 34, - SampleRateShading = 35, - ImageRect = 36, - SampledRect = 37, - GenericPointer = 38, - Int8 = 39, - InputAttachment = 40, - SparseResidency = 41, - MinLod = 42, - Sampled1D = 43, - Image1D = 44, - SampledCubeArray = 45, - SampledBuffer = 46, - ImageBuffer = 47, - ImageMSArray = 48, - StorageImageExtendedFormats = 49, - ImageQuery = 50, - DerivativeControl = 51, - InterpolationFunction = 52, - TransformFeedback = 53, - GeometryStreams = 54, - StorageImageReadWithoutFormat = 55, - StorageImageWriteWithoutFormat = 56, - MultiViewport = 57, - SubgroupDispatch = 58, - NamedBarrier = 59, - PipeStorage = 60, - SubgroupBallotKHR = 4423, - DrawParameters = 4427, - SubgroupVoteKHR = 4431, - StorageBuffer16BitAccess = 4433, - StorageUniformBufferBlock16 = 4433, - StorageUniform16 = 4434, - UniformAndStorageBuffer16BitAccess = 4434, - StoragePushConstant16 = 4435, - StorageInputOutput16 = 4436, - DeviceGroup = 4437, - MultiView = 4439, - VariablePointersStorageBuffer = 4441, - VariablePointers = 4442, - AtomicStorageOps = 4445, - SampleMaskPostDepthCoverage = 4447, - ImageGatherBiasLodAMD = 5009, - FragmentMaskAMD = 5010, - StencilExportEXT = 5013, - ImageReadWriteLodAMD = 5015, - SampleMaskOverrideCoverageNV = 5249, - GeometryShaderPassthroughNV = 5251, - ShaderViewportIndexLayerEXT = 5254, - ShaderViewportIndexLayerNV = 5254, - ShaderViewportMaskNV = 5255, - ShaderStereoViewNV = 5259, - PerViewAttributesNV = 5260, - SubgroupShuffleINTEL = 5568, - SubgroupBufferBlockIOINTEL = 5569, - SubgroupImageBlockIOINTEL = 5570, - } - - public enum Op - { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, - OpImageSparseRead = 320, - OpSizeOf = 321, - OpTypePipeStorage = 322, - OpConstantPipeStorage = 323, - OpCreatePipeFromPipeStorage = 324, - OpGetKernelLocalSizeForSubgroupCount = 325, - OpGetKernelMaxNumSubgroups = 326, - OpTypeNamedBarrier = 327, - OpNamedBarrierInitialize = 328, - OpMemoryNamedBarrier = 329, - OpModuleProcessed = 330, - OpExecutionModeId = 331, - OpDecorateId = 332, - OpSubgroupBallotKHR = 4421, - OpSubgroupFirstInvocationKHR = 4422, - OpSubgroupAllKHR = 4428, - OpSubgroupAnyKHR = 4429, - OpSubgroupAllEqualKHR = 4430, - OpSubgroupReadInvocationKHR = 4432, - OpGroupIAddNonUniformAMD = 5000, - OpGroupFAddNonUniformAMD = 5001, - OpGroupFMinNonUniformAMD = 5002, - OpGroupUMinNonUniformAMD = 5003, - OpGroupSMinNonUniformAMD = 5004, - OpGroupFMaxNonUniformAMD = 5005, - OpGroupUMaxNonUniformAMD = 5006, - OpGroupSMaxNonUniformAMD = 5007, - OpFragmentMaskFetchAMD = 5011, - OpFragmentFetchAMD = 5012, - OpSubgroupShuffleINTEL = 5571, - OpSubgroupShuffleDownINTEL = 5572, - OpSubgroupShuffleUpINTEL = 5573, - OpSubgroupShuffleXorINTEL = 5574, - OpSubgroupBlockReadINTEL = 5575, - OpSubgroupBlockWriteINTEL = 5576, - OpSubgroupImageBlockReadINTEL = 5577, - OpSubgroupImageBlockWriteINTEL = 5578, - OpDecorateStringGOOGLE = 5632, - OpMemberDecorateStringGOOGLE = 5633, - } - } -} - diff --git a/include/spirv/1.2/spirv.h b/include/spirv/1.2/spirv.h deleted file mode 100644 index 7c6d884d..00000000 --- a/include/spirv/1.2/spirv.h +++ /dev/null @@ -1,1021 +0,0 @@ -/* -** Copyright (c) 2014-2018 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a copy -** of this software and/or associated documentation files (the "Materials"), -** to deal in the Materials without restriction, including without limitation -** the rights to use, copy, modify, merge, publish, distribute, sublicense, -** and/or sell copies of the Materials, and to permit persons to whom the -** Materials are furnished to do so, subject to the following conditions: -** -** The above copyright notice and this permission notice shall be included in -** all copies or substantial portions of the Materials. -** -** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -** IN THE MATERIALS. -*/ - -/* -** This header is automatically generated by the same tool that creates -** the Binary Section of the SPIR-V specification. -*/ - -/* -** Enumeration tokens for SPIR-V, in various styles: -** C, C++, C++11, JSON, Lua, Python -** -** - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -** - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -** - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -** - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -** - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -** -** Some tokens act like mask values, which can be OR'd together, -** while others are mutually exclusive. The mask-like ones have -** "Mask" in their name, and a parallel enum that has the shift -** amount (1 << x) for each corresponding enumerant. -*/ - -#ifndef spirv_H -#define spirv_H - -typedef unsigned int SpvId; - -#define SPV_VERSION 0x10200 -#define SPV_REVISION 2 - -static const unsigned int SpvMagicNumber = 0x07230203; -static const unsigned int SpvVersion = 0x00010200; -static const unsigned int SpvRevision = 2; -static const unsigned int SpvOpCodeMask = 0xffff; -static const unsigned int SpvWordCountShift = 16; - -typedef enum SpvSourceLanguage_ { - SpvSourceLanguageUnknown = 0, - SpvSourceLanguageESSL = 1, - SpvSourceLanguageGLSL = 2, - SpvSourceLanguageOpenCL_C = 3, - SpvSourceLanguageOpenCL_CPP = 4, - SpvSourceLanguageHLSL = 5, - SpvSourceLanguageMax = 0x7fffffff, -} SpvSourceLanguage; - -typedef enum SpvExecutionModel_ { - SpvExecutionModelVertex = 0, - SpvExecutionModelTessellationControl = 1, - SpvExecutionModelTessellationEvaluation = 2, - SpvExecutionModelGeometry = 3, - SpvExecutionModelFragment = 4, - SpvExecutionModelGLCompute = 5, - SpvExecutionModelKernel = 6, - SpvExecutionModelMax = 0x7fffffff, -} SpvExecutionModel; - -typedef enum SpvAddressingModel_ { - SpvAddressingModelLogical = 0, - SpvAddressingModelPhysical32 = 1, - SpvAddressingModelPhysical64 = 2, - SpvAddressingModelMax = 0x7fffffff, -} SpvAddressingModel; - -typedef enum SpvMemoryModel_ { - SpvMemoryModelSimple = 0, - SpvMemoryModelGLSL450 = 1, - SpvMemoryModelOpenCL = 2, - SpvMemoryModelMax = 0x7fffffff, -} SpvMemoryModel; - -typedef enum SpvExecutionMode_ { - SpvExecutionModeInvocations = 0, - SpvExecutionModeSpacingEqual = 1, - SpvExecutionModeSpacingFractionalEven = 2, - SpvExecutionModeSpacingFractionalOdd = 3, - SpvExecutionModeVertexOrderCw = 4, - SpvExecutionModeVertexOrderCcw = 5, - SpvExecutionModePixelCenterInteger = 6, - SpvExecutionModeOriginUpperLeft = 7, - SpvExecutionModeOriginLowerLeft = 8, - SpvExecutionModeEarlyFragmentTests = 9, - SpvExecutionModePointMode = 10, - SpvExecutionModeXfb = 11, - SpvExecutionModeDepthReplacing = 12, - SpvExecutionModeDepthGreater = 14, - SpvExecutionModeDepthLess = 15, - SpvExecutionModeDepthUnchanged = 16, - SpvExecutionModeLocalSize = 17, - SpvExecutionModeLocalSizeHint = 18, - SpvExecutionModeInputPoints = 19, - SpvExecutionModeInputLines = 20, - SpvExecutionModeInputLinesAdjacency = 21, - SpvExecutionModeTriangles = 22, - SpvExecutionModeInputTrianglesAdjacency = 23, - SpvExecutionModeQuads = 24, - SpvExecutionModeIsolines = 25, - SpvExecutionModeOutputVertices = 26, - SpvExecutionModeOutputPoints = 27, - SpvExecutionModeOutputLineStrip = 28, - SpvExecutionModeOutputTriangleStrip = 29, - SpvExecutionModeVecTypeHint = 30, - SpvExecutionModeContractionOff = 31, - SpvExecutionModeInitializer = 33, - SpvExecutionModeFinalizer = 34, - SpvExecutionModeSubgroupSize = 35, - SpvExecutionModeSubgroupsPerWorkgroup = 36, - SpvExecutionModeSubgroupsPerWorkgroupId = 37, - SpvExecutionModeLocalSizeId = 38, - SpvExecutionModeLocalSizeHintId = 39, - SpvExecutionModePostDepthCoverage = 4446, - SpvExecutionModeStencilRefReplacingEXT = 5027, - SpvExecutionModeMax = 0x7fffffff, -} SpvExecutionMode; - -typedef enum SpvStorageClass_ { - SpvStorageClassUniformConstant = 0, - SpvStorageClassInput = 1, - SpvStorageClassUniform = 2, - SpvStorageClassOutput = 3, - SpvStorageClassWorkgroup = 4, - SpvStorageClassCrossWorkgroup = 5, - SpvStorageClassPrivate = 6, - SpvStorageClassFunction = 7, - SpvStorageClassGeneric = 8, - SpvStorageClassPushConstant = 9, - SpvStorageClassAtomicCounter = 10, - SpvStorageClassImage = 11, - SpvStorageClassStorageBuffer = 12, - SpvStorageClassMax = 0x7fffffff, -} SpvStorageClass; - -typedef enum SpvDim_ { - SpvDim1D = 0, - SpvDim2D = 1, - SpvDim3D = 2, - SpvDimCube = 3, - SpvDimRect = 4, - SpvDimBuffer = 5, - SpvDimSubpassData = 6, - SpvDimMax = 0x7fffffff, -} SpvDim; - -typedef enum SpvSamplerAddressingMode_ { - SpvSamplerAddressingModeNone = 0, - SpvSamplerAddressingModeClampToEdge = 1, - SpvSamplerAddressingModeClamp = 2, - SpvSamplerAddressingModeRepeat = 3, - SpvSamplerAddressingModeRepeatMirrored = 4, - SpvSamplerAddressingModeMax = 0x7fffffff, -} SpvSamplerAddressingMode; - -typedef enum SpvSamplerFilterMode_ { - SpvSamplerFilterModeNearest = 0, - SpvSamplerFilterModeLinear = 1, - SpvSamplerFilterModeMax = 0x7fffffff, -} SpvSamplerFilterMode; - -typedef enum SpvImageFormat_ { - SpvImageFormatUnknown = 0, - SpvImageFormatRgba32f = 1, - SpvImageFormatRgba16f = 2, - SpvImageFormatR32f = 3, - SpvImageFormatRgba8 = 4, - SpvImageFormatRgba8Snorm = 5, - SpvImageFormatRg32f = 6, - SpvImageFormatRg16f = 7, - SpvImageFormatR11fG11fB10f = 8, - SpvImageFormatR16f = 9, - SpvImageFormatRgba16 = 10, - SpvImageFormatRgb10A2 = 11, - SpvImageFormatRg16 = 12, - SpvImageFormatRg8 = 13, - SpvImageFormatR16 = 14, - SpvImageFormatR8 = 15, - SpvImageFormatRgba16Snorm = 16, - SpvImageFormatRg16Snorm = 17, - SpvImageFormatRg8Snorm = 18, - SpvImageFormatR16Snorm = 19, - SpvImageFormatR8Snorm = 20, - SpvImageFormatRgba32i = 21, - SpvImageFormatRgba16i = 22, - SpvImageFormatRgba8i = 23, - SpvImageFormatR32i = 24, - SpvImageFormatRg32i = 25, - SpvImageFormatRg16i = 26, - SpvImageFormatRg8i = 27, - SpvImageFormatR16i = 28, - SpvImageFormatR8i = 29, - SpvImageFormatRgba32ui = 30, - SpvImageFormatRgba16ui = 31, - SpvImageFormatRgba8ui = 32, - SpvImageFormatR32ui = 33, - SpvImageFormatRgb10a2ui = 34, - SpvImageFormatRg32ui = 35, - SpvImageFormatRg16ui = 36, - SpvImageFormatRg8ui = 37, - SpvImageFormatR16ui = 38, - SpvImageFormatR8ui = 39, - SpvImageFormatMax = 0x7fffffff, -} SpvImageFormat; - -typedef enum SpvImageChannelOrder_ { - SpvImageChannelOrderR = 0, - SpvImageChannelOrderA = 1, - SpvImageChannelOrderRG = 2, - SpvImageChannelOrderRA = 3, - SpvImageChannelOrderRGB = 4, - SpvImageChannelOrderRGBA = 5, - SpvImageChannelOrderBGRA = 6, - SpvImageChannelOrderARGB = 7, - SpvImageChannelOrderIntensity = 8, - SpvImageChannelOrderLuminance = 9, - SpvImageChannelOrderRx = 10, - SpvImageChannelOrderRGx = 11, - SpvImageChannelOrderRGBx = 12, - SpvImageChannelOrderDepth = 13, - SpvImageChannelOrderDepthStencil = 14, - SpvImageChannelOrdersRGB = 15, - SpvImageChannelOrdersRGBx = 16, - SpvImageChannelOrdersRGBA = 17, - SpvImageChannelOrdersBGRA = 18, - SpvImageChannelOrderABGR = 19, - SpvImageChannelOrderMax = 0x7fffffff, -} SpvImageChannelOrder; - -typedef enum SpvImageChannelDataType_ { - SpvImageChannelDataTypeSnormInt8 = 0, - SpvImageChannelDataTypeSnormInt16 = 1, - SpvImageChannelDataTypeUnormInt8 = 2, - SpvImageChannelDataTypeUnormInt16 = 3, - SpvImageChannelDataTypeUnormShort565 = 4, - SpvImageChannelDataTypeUnormShort555 = 5, - SpvImageChannelDataTypeUnormInt101010 = 6, - SpvImageChannelDataTypeSignedInt8 = 7, - SpvImageChannelDataTypeSignedInt16 = 8, - SpvImageChannelDataTypeSignedInt32 = 9, - SpvImageChannelDataTypeUnsignedInt8 = 10, - SpvImageChannelDataTypeUnsignedInt16 = 11, - SpvImageChannelDataTypeUnsignedInt32 = 12, - SpvImageChannelDataTypeHalfFloat = 13, - SpvImageChannelDataTypeFloat = 14, - SpvImageChannelDataTypeUnormInt24 = 15, - SpvImageChannelDataTypeUnormInt101010_2 = 16, - SpvImageChannelDataTypeMax = 0x7fffffff, -} SpvImageChannelDataType; - -typedef enum SpvImageOperandsShift_ { - SpvImageOperandsBiasShift = 0, - SpvImageOperandsLodShift = 1, - SpvImageOperandsGradShift = 2, - SpvImageOperandsConstOffsetShift = 3, - SpvImageOperandsOffsetShift = 4, - SpvImageOperandsConstOffsetsShift = 5, - SpvImageOperandsSampleShift = 6, - SpvImageOperandsMinLodShift = 7, - SpvImageOperandsMax = 0x7fffffff, -} SpvImageOperandsShift; - -typedef enum SpvImageOperandsMask_ { - SpvImageOperandsMaskNone = 0, - SpvImageOperandsBiasMask = 0x00000001, - SpvImageOperandsLodMask = 0x00000002, - SpvImageOperandsGradMask = 0x00000004, - SpvImageOperandsConstOffsetMask = 0x00000008, - SpvImageOperandsOffsetMask = 0x00000010, - SpvImageOperandsConstOffsetsMask = 0x00000020, - SpvImageOperandsSampleMask = 0x00000040, - SpvImageOperandsMinLodMask = 0x00000080, -} SpvImageOperandsMask; - -typedef enum SpvFPFastMathModeShift_ { - SpvFPFastMathModeNotNaNShift = 0, - SpvFPFastMathModeNotInfShift = 1, - SpvFPFastMathModeNSZShift = 2, - SpvFPFastMathModeAllowRecipShift = 3, - SpvFPFastMathModeFastShift = 4, - SpvFPFastMathModeMax = 0x7fffffff, -} SpvFPFastMathModeShift; - -typedef enum SpvFPFastMathModeMask_ { - SpvFPFastMathModeMaskNone = 0, - SpvFPFastMathModeNotNaNMask = 0x00000001, - SpvFPFastMathModeNotInfMask = 0x00000002, - SpvFPFastMathModeNSZMask = 0x00000004, - SpvFPFastMathModeAllowRecipMask = 0x00000008, - SpvFPFastMathModeFastMask = 0x00000010, -} SpvFPFastMathModeMask; - -typedef enum SpvFPRoundingMode_ { - SpvFPRoundingModeRTE = 0, - SpvFPRoundingModeRTZ = 1, - SpvFPRoundingModeRTP = 2, - SpvFPRoundingModeRTN = 3, - SpvFPRoundingModeMax = 0x7fffffff, -} SpvFPRoundingMode; - -typedef enum SpvLinkageType_ { - SpvLinkageTypeExport = 0, - SpvLinkageTypeImport = 1, - SpvLinkageTypeMax = 0x7fffffff, -} SpvLinkageType; - -typedef enum SpvAccessQualifier_ { - SpvAccessQualifierReadOnly = 0, - SpvAccessQualifierWriteOnly = 1, - SpvAccessQualifierReadWrite = 2, - SpvAccessQualifierMax = 0x7fffffff, -} SpvAccessQualifier; - -typedef enum SpvFunctionParameterAttribute_ { - SpvFunctionParameterAttributeZext = 0, - SpvFunctionParameterAttributeSext = 1, - SpvFunctionParameterAttributeByVal = 2, - SpvFunctionParameterAttributeSret = 3, - SpvFunctionParameterAttributeNoAlias = 4, - SpvFunctionParameterAttributeNoCapture = 5, - SpvFunctionParameterAttributeNoWrite = 6, - SpvFunctionParameterAttributeNoReadWrite = 7, - SpvFunctionParameterAttributeMax = 0x7fffffff, -} SpvFunctionParameterAttribute; - -typedef enum SpvDecoration_ { - SpvDecorationRelaxedPrecision = 0, - SpvDecorationSpecId = 1, - SpvDecorationBlock = 2, - SpvDecorationBufferBlock = 3, - SpvDecorationRowMajor = 4, - SpvDecorationColMajor = 5, - SpvDecorationArrayStride = 6, - SpvDecorationMatrixStride = 7, - SpvDecorationGLSLShared = 8, - SpvDecorationGLSLPacked = 9, - SpvDecorationCPacked = 10, - SpvDecorationBuiltIn = 11, - SpvDecorationNoPerspective = 13, - SpvDecorationFlat = 14, - SpvDecorationPatch = 15, - SpvDecorationCentroid = 16, - SpvDecorationSample = 17, - SpvDecorationInvariant = 18, - SpvDecorationRestrict = 19, - SpvDecorationAliased = 20, - SpvDecorationVolatile = 21, - SpvDecorationConstant = 22, - SpvDecorationCoherent = 23, - SpvDecorationNonWritable = 24, - SpvDecorationNonReadable = 25, - SpvDecorationUniform = 26, - SpvDecorationSaturatedConversion = 28, - SpvDecorationStream = 29, - SpvDecorationLocation = 30, - SpvDecorationComponent = 31, - SpvDecorationIndex = 32, - SpvDecorationBinding = 33, - SpvDecorationDescriptorSet = 34, - SpvDecorationOffset = 35, - SpvDecorationXfbBuffer = 36, - SpvDecorationXfbStride = 37, - SpvDecorationFuncParamAttr = 38, - SpvDecorationFPRoundingMode = 39, - SpvDecorationFPFastMathMode = 40, - SpvDecorationLinkageAttributes = 41, - SpvDecorationNoContraction = 42, - SpvDecorationInputAttachmentIndex = 43, - SpvDecorationAlignment = 44, - SpvDecorationMaxByteOffset = 45, - SpvDecorationAlignmentId = 46, - SpvDecorationMaxByteOffsetId = 47, - SpvDecorationExplicitInterpAMD = 4999, - SpvDecorationOverrideCoverageNV = 5248, - SpvDecorationPassthroughNV = 5250, - SpvDecorationViewportRelativeNV = 5252, - SpvDecorationSecondaryViewportRelativeNV = 5256, - SpvDecorationHlslCounterBufferGOOGLE = 5634, - SpvDecorationHlslSemanticGOOGLE = 5635, - SpvDecorationMax = 0x7fffffff, -} SpvDecoration; - -typedef enum SpvBuiltIn_ { - SpvBuiltInPosition = 0, - SpvBuiltInPointSize = 1, - SpvBuiltInClipDistance = 3, - SpvBuiltInCullDistance = 4, - SpvBuiltInVertexId = 5, - SpvBuiltInInstanceId = 6, - SpvBuiltInPrimitiveId = 7, - SpvBuiltInInvocationId = 8, - SpvBuiltInLayer = 9, - SpvBuiltInViewportIndex = 10, - SpvBuiltInTessLevelOuter = 11, - SpvBuiltInTessLevelInner = 12, - SpvBuiltInTessCoord = 13, - SpvBuiltInPatchVertices = 14, - SpvBuiltInFragCoord = 15, - SpvBuiltInPointCoord = 16, - SpvBuiltInFrontFacing = 17, - SpvBuiltInSampleId = 18, - SpvBuiltInSamplePosition = 19, - SpvBuiltInSampleMask = 20, - SpvBuiltInFragDepth = 22, - SpvBuiltInHelperInvocation = 23, - SpvBuiltInNumWorkgroups = 24, - SpvBuiltInWorkgroupSize = 25, - SpvBuiltInWorkgroupId = 26, - SpvBuiltInLocalInvocationId = 27, - SpvBuiltInGlobalInvocationId = 28, - SpvBuiltInLocalInvocationIndex = 29, - SpvBuiltInWorkDim = 30, - SpvBuiltInGlobalSize = 31, - SpvBuiltInEnqueuedWorkgroupSize = 32, - SpvBuiltInGlobalOffset = 33, - SpvBuiltInGlobalLinearId = 34, - SpvBuiltInSubgroupSize = 36, - SpvBuiltInSubgroupMaxSize = 37, - SpvBuiltInNumSubgroups = 38, - SpvBuiltInNumEnqueuedSubgroups = 39, - SpvBuiltInSubgroupId = 40, - SpvBuiltInSubgroupLocalInvocationId = 41, - SpvBuiltInVertexIndex = 42, - SpvBuiltInInstanceIndex = 43, - SpvBuiltInSubgroupEqMaskKHR = 4416, - SpvBuiltInSubgroupGeMaskKHR = 4417, - SpvBuiltInSubgroupGtMaskKHR = 4418, - SpvBuiltInSubgroupLeMaskKHR = 4419, - SpvBuiltInSubgroupLtMaskKHR = 4420, - SpvBuiltInBaseVertex = 4424, - SpvBuiltInBaseInstance = 4425, - SpvBuiltInDrawIndex = 4426, - SpvBuiltInDeviceIndex = 4438, - SpvBuiltInViewIndex = 4440, - SpvBuiltInBaryCoordNoPerspAMD = 4992, - SpvBuiltInBaryCoordNoPerspCentroidAMD = 4993, - SpvBuiltInBaryCoordNoPerspSampleAMD = 4994, - SpvBuiltInBaryCoordSmoothAMD = 4995, - SpvBuiltInBaryCoordSmoothCentroidAMD = 4996, - SpvBuiltInBaryCoordSmoothSampleAMD = 4997, - SpvBuiltInBaryCoordPullModelAMD = 4998, - SpvBuiltInFragStencilRefEXT = 5014, - SpvBuiltInViewportMaskNV = 5253, - SpvBuiltInSecondaryPositionNV = 5257, - SpvBuiltInSecondaryViewportMaskNV = 5258, - SpvBuiltInPositionPerViewNV = 5261, - SpvBuiltInViewportMaskPerViewNV = 5262, - SpvBuiltInMax = 0x7fffffff, -} SpvBuiltIn; - -typedef enum SpvSelectionControlShift_ { - SpvSelectionControlFlattenShift = 0, - SpvSelectionControlDontFlattenShift = 1, - SpvSelectionControlMax = 0x7fffffff, -} SpvSelectionControlShift; - -typedef enum SpvSelectionControlMask_ { - SpvSelectionControlMaskNone = 0, - SpvSelectionControlFlattenMask = 0x00000001, - SpvSelectionControlDontFlattenMask = 0x00000002, -} SpvSelectionControlMask; - -typedef enum SpvLoopControlShift_ { - SpvLoopControlUnrollShift = 0, - SpvLoopControlDontUnrollShift = 1, - SpvLoopControlDependencyInfiniteShift = 2, - SpvLoopControlDependencyLengthShift = 3, - SpvLoopControlMax = 0x7fffffff, -} SpvLoopControlShift; - -typedef enum SpvLoopControlMask_ { - SpvLoopControlMaskNone = 0, - SpvLoopControlUnrollMask = 0x00000001, - SpvLoopControlDontUnrollMask = 0x00000002, - SpvLoopControlDependencyInfiniteMask = 0x00000004, - SpvLoopControlDependencyLengthMask = 0x00000008, -} SpvLoopControlMask; - -typedef enum SpvFunctionControlShift_ { - SpvFunctionControlInlineShift = 0, - SpvFunctionControlDontInlineShift = 1, - SpvFunctionControlPureShift = 2, - SpvFunctionControlConstShift = 3, - SpvFunctionControlMax = 0x7fffffff, -} SpvFunctionControlShift; - -typedef enum SpvFunctionControlMask_ { - SpvFunctionControlMaskNone = 0, - SpvFunctionControlInlineMask = 0x00000001, - SpvFunctionControlDontInlineMask = 0x00000002, - SpvFunctionControlPureMask = 0x00000004, - SpvFunctionControlConstMask = 0x00000008, -} SpvFunctionControlMask; - -typedef enum SpvMemorySemanticsShift_ { - SpvMemorySemanticsAcquireShift = 1, - SpvMemorySemanticsReleaseShift = 2, - SpvMemorySemanticsAcquireReleaseShift = 3, - SpvMemorySemanticsSequentiallyConsistentShift = 4, - SpvMemorySemanticsUniformMemoryShift = 6, - SpvMemorySemanticsSubgroupMemoryShift = 7, - SpvMemorySemanticsWorkgroupMemoryShift = 8, - SpvMemorySemanticsCrossWorkgroupMemoryShift = 9, - SpvMemorySemanticsAtomicCounterMemoryShift = 10, - SpvMemorySemanticsImageMemoryShift = 11, - SpvMemorySemanticsMax = 0x7fffffff, -} SpvMemorySemanticsShift; - -typedef enum SpvMemorySemanticsMask_ { - SpvMemorySemanticsMaskNone = 0, - SpvMemorySemanticsAcquireMask = 0x00000002, - SpvMemorySemanticsReleaseMask = 0x00000004, - SpvMemorySemanticsAcquireReleaseMask = 0x00000008, - SpvMemorySemanticsSequentiallyConsistentMask = 0x00000010, - SpvMemorySemanticsUniformMemoryMask = 0x00000040, - SpvMemorySemanticsSubgroupMemoryMask = 0x00000080, - SpvMemorySemanticsWorkgroupMemoryMask = 0x00000100, - SpvMemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, - SpvMemorySemanticsAtomicCounterMemoryMask = 0x00000400, - SpvMemorySemanticsImageMemoryMask = 0x00000800, -} SpvMemorySemanticsMask; - -typedef enum SpvMemoryAccessShift_ { - SpvMemoryAccessVolatileShift = 0, - SpvMemoryAccessAlignedShift = 1, - SpvMemoryAccessNontemporalShift = 2, - SpvMemoryAccessMax = 0x7fffffff, -} SpvMemoryAccessShift; - -typedef enum SpvMemoryAccessMask_ { - SpvMemoryAccessMaskNone = 0, - SpvMemoryAccessVolatileMask = 0x00000001, - SpvMemoryAccessAlignedMask = 0x00000002, - SpvMemoryAccessNontemporalMask = 0x00000004, -} SpvMemoryAccessMask; - -typedef enum SpvScope_ { - SpvScopeCrossDevice = 0, - SpvScopeDevice = 1, - SpvScopeWorkgroup = 2, - SpvScopeSubgroup = 3, - SpvScopeInvocation = 4, - SpvScopeMax = 0x7fffffff, -} SpvScope; - -typedef enum SpvGroupOperation_ { - SpvGroupOperationReduce = 0, - SpvGroupOperationInclusiveScan = 1, - SpvGroupOperationExclusiveScan = 2, - SpvGroupOperationMax = 0x7fffffff, -} SpvGroupOperation; - -typedef enum SpvKernelEnqueueFlags_ { - SpvKernelEnqueueFlagsNoWait = 0, - SpvKernelEnqueueFlagsWaitKernel = 1, - SpvKernelEnqueueFlagsWaitWorkGroup = 2, - SpvKernelEnqueueFlagsMax = 0x7fffffff, -} SpvKernelEnqueueFlags; - -typedef enum SpvKernelProfilingInfoShift_ { - SpvKernelProfilingInfoCmdExecTimeShift = 0, - SpvKernelProfilingInfoMax = 0x7fffffff, -} SpvKernelProfilingInfoShift; - -typedef enum SpvKernelProfilingInfoMask_ { - SpvKernelProfilingInfoMaskNone = 0, - SpvKernelProfilingInfoCmdExecTimeMask = 0x00000001, -} SpvKernelProfilingInfoMask; - -typedef enum SpvCapability_ { - SpvCapabilityMatrix = 0, - SpvCapabilityShader = 1, - SpvCapabilityGeometry = 2, - SpvCapabilityTessellation = 3, - SpvCapabilityAddresses = 4, - SpvCapabilityLinkage = 5, - SpvCapabilityKernel = 6, - SpvCapabilityVector16 = 7, - SpvCapabilityFloat16Buffer = 8, - SpvCapabilityFloat16 = 9, - SpvCapabilityFloat64 = 10, - SpvCapabilityInt64 = 11, - SpvCapabilityInt64Atomics = 12, - SpvCapabilityImageBasic = 13, - SpvCapabilityImageReadWrite = 14, - SpvCapabilityImageMipmap = 15, - SpvCapabilityPipes = 17, - SpvCapabilityGroups = 18, - SpvCapabilityDeviceEnqueue = 19, - SpvCapabilityLiteralSampler = 20, - SpvCapabilityAtomicStorage = 21, - SpvCapabilityInt16 = 22, - SpvCapabilityTessellationPointSize = 23, - SpvCapabilityGeometryPointSize = 24, - SpvCapabilityImageGatherExtended = 25, - SpvCapabilityStorageImageMultisample = 27, - SpvCapabilityUniformBufferArrayDynamicIndexing = 28, - SpvCapabilitySampledImageArrayDynamicIndexing = 29, - SpvCapabilityStorageBufferArrayDynamicIndexing = 30, - SpvCapabilityStorageImageArrayDynamicIndexing = 31, - SpvCapabilityClipDistance = 32, - SpvCapabilityCullDistance = 33, - SpvCapabilityImageCubeArray = 34, - SpvCapabilitySampleRateShading = 35, - SpvCapabilityImageRect = 36, - SpvCapabilitySampledRect = 37, - SpvCapabilityGenericPointer = 38, - SpvCapabilityInt8 = 39, - SpvCapabilityInputAttachment = 40, - SpvCapabilitySparseResidency = 41, - SpvCapabilityMinLod = 42, - SpvCapabilitySampled1D = 43, - SpvCapabilityImage1D = 44, - SpvCapabilitySampledCubeArray = 45, - SpvCapabilitySampledBuffer = 46, - SpvCapabilityImageBuffer = 47, - SpvCapabilityImageMSArray = 48, - SpvCapabilityStorageImageExtendedFormats = 49, - SpvCapabilityImageQuery = 50, - SpvCapabilityDerivativeControl = 51, - SpvCapabilityInterpolationFunction = 52, - SpvCapabilityTransformFeedback = 53, - SpvCapabilityGeometryStreams = 54, - SpvCapabilityStorageImageReadWithoutFormat = 55, - SpvCapabilityStorageImageWriteWithoutFormat = 56, - SpvCapabilityMultiViewport = 57, - SpvCapabilitySubgroupDispatch = 58, - SpvCapabilityNamedBarrier = 59, - SpvCapabilityPipeStorage = 60, - SpvCapabilitySubgroupBallotKHR = 4423, - SpvCapabilityDrawParameters = 4427, - SpvCapabilitySubgroupVoteKHR = 4431, - SpvCapabilityStorageBuffer16BitAccess = 4433, - SpvCapabilityStorageUniformBufferBlock16 = 4433, - SpvCapabilityStorageUniform16 = 4434, - SpvCapabilityUniformAndStorageBuffer16BitAccess = 4434, - SpvCapabilityStoragePushConstant16 = 4435, - SpvCapabilityStorageInputOutput16 = 4436, - SpvCapabilityDeviceGroup = 4437, - SpvCapabilityMultiView = 4439, - SpvCapabilityVariablePointersStorageBuffer = 4441, - SpvCapabilityVariablePointers = 4442, - SpvCapabilityAtomicStorageOps = 4445, - SpvCapabilitySampleMaskPostDepthCoverage = 4447, - SpvCapabilityImageGatherBiasLodAMD = 5009, - SpvCapabilityFragmentMaskAMD = 5010, - SpvCapabilityStencilExportEXT = 5013, - SpvCapabilityImageReadWriteLodAMD = 5015, - SpvCapabilitySampleMaskOverrideCoverageNV = 5249, - SpvCapabilityGeometryShaderPassthroughNV = 5251, - SpvCapabilityShaderViewportIndexLayerEXT = 5254, - SpvCapabilityShaderViewportIndexLayerNV = 5254, - SpvCapabilityShaderViewportMaskNV = 5255, - SpvCapabilityShaderStereoViewNV = 5259, - SpvCapabilityPerViewAttributesNV = 5260, - SpvCapabilitySubgroupShuffleINTEL = 5568, - SpvCapabilitySubgroupBufferBlockIOINTEL = 5569, - SpvCapabilitySubgroupImageBlockIOINTEL = 5570, - SpvCapabilityMax = 0x7fffffff, -} SpvCapability; - -typedef enum SpvOp_ { - SpvOpNop = 0, - SpvOpUndef = 1, - SpvOpSourceContinued = 2, - SpvOpSource = 3, - SpvOpSourceExtension = 4, - SpvOpName = 5, - SpvOpMemberName = 6, - SpvOpString = 7, - SpvOpLine = 8, - SpvOpExtension = 10, - SpvOpExtInstImport = 11, - SpvOpExtInst = 12, - SpvOpMemoryModel = 14, - SpvOpEntryPoint = 15, - SpvOpExecutionMode = 16, - SpvOpCapability = 17, - SpvOpTypeVoid = 19, - SpvOpTypeBool = 20, - SpvOpTypeInt = 21, - SpvOpTypeFloat = 22, - SpvOpTypeVector = 23, - SpvOpTypeMatrix = 24, - SpvOpTypeImage = 25, - SpvOpTypeSampler = 26, - SpvOpTypeSampledImage = 27, - SpvOpTypeArray = 28, - SpvOpTypeRuntimeArray = 29, - SpvOpTypeStruct = 30, - SpvOpTypeOpaque = 31, - SpvOpTypePointer = 32, - SpvOpTypeFunction = 33, - SpvOpTypeEvent = 34, - SpvOpTypeDeviceEvent = 35, - SpvOpTypeReserveId = 36, - SpvOpTypeQueue = 37, - SpvOpTypePipe = 38, - SpvOpTypeForwardPointer = 39, - SpvOpConstantTrue = 41, - SpvOpConstantFalse = 42, - SpvOpConstant = 43, - SpvOpConstantComposite = 44, - SpvOpConstantSampler = 45, - SpvOpConstantNull = 46, - SpvOpSpecConstantTrue = 48, - SpvOpSpecConstantFalse = 49, - SpvOpSpecConstant = 50, - SpvOpSpecConstantComposite = 51, - SpvOpSpecConstantOp = 52, - SpvOpFunction = 54, - SpvOpFunctionParameter = 55, - SpvOpFunctionEnd = 56, - SpvOpFunctionCall = 57, - SpvOpVariable = 59, - SpvOpImageTexelPointer = 60, - SpvOpLoad = 61, - SpvOpStore = 62, - SpvOpCopyMemory = 63, - SpvOpCopyMemorySized = 64, - SpvOpAccessChain = 65, - SpvOpInBoundsAccessChain = 66, - SpvOpPtrAccessChain = 67, - SpvOpArrayLength = 68, - SpvOpGenericPtrMemSemantics = 69, - SpvOpInBoundsPtrAccessChain = 70, - SpvOpDecorate = 71, - SpvOpMemberDecorate = 72, - SpvOpDecorationGroup = 73, - SpvOpGroupDecorate = 74, - SpvOpGroupMemberDecorate = 75, - SpvOpVectorExtractDynamic = 77, - SpvOpVectorInsertDynamic = 78, - SpvOpVectorShuffle = 79, - SpvOpCompositeConstruct = 80, - SpvOpCompositeExtract = 81, - SpvOpCompositeInsert = 82, - SpvOpCopyObject = 83, - SpvOpTranspose = 84, - SpvOpSampledImage = 86, - SpvOpImageSampleImplicitLod = 87, - SpvOpImageSampleExplicitLod = 88, - SpvOpImageSampleDrefImplicitLod = 89, - SpvOpImageSampleDrefExplicitLod = 90, - SpvOpImageSampleProjImplicitLod = 91, - SpvOpImageSampleProjExplicitLod = 92, - SpvOpImageSampleProjDrefImplicitLod = 93, - SpvOpImageSampleProjDrefExplicitLod = 94, - SpvOpImageFetch = 95, - SpvOpImageGather = 96, - SpvOpImageDrefGather = 97, - SpvOpImageRead = 98, - SpvOpImageWrite = 99, - SpvOpImage = 100, - SpvOpImageQueryFormat = 101, - SpvOpImageQueryOrder = 102, - SpvOpImageQuerySizeLod = 103, - SpvOpImageQuerySize = 104, - SpvOpImageQueryLod = 105, - SpvOpImageQueryLevels = 106, - SpvOpImageQuerySamples = 107, - SpvOpConvertFToU = 109, - SpvOpConvertFToS = 110, - SpvOpConvertSToF = 111, - SpvOpConvertUToF = 112, - SpvOpUConvert = 113, - SpvOpSConvert = 114, - SpvOpFConvert = 115, - SpvOpQuantizeToF16 = 116, - SpvOpConvertPtrToU = 117, - SpvOpSatConvertSToU = 118, - SpvOpSatConvertUToS = 119, - SpvOpConvertUToPtr = 120, - SpvOpPtrCastToGeneric = 121, - SpvOpGenericCastToPtr = 122, - SpvOpGenericCastToPtrExplicit = 123, - SpvOpBitcast = 124, - SpvOpSNegate = 126, - SpvOpFNegate = 127, - SpvOpIAdd = 128, - SpvOpFAdd = 129, - SpvOpISub = 130, - SpvOpFSub = 131, - SpvOpIMul = 132, - SpvOpFMul = 133, - SpvOpUDiv = 134, - SpvOpSDiv = 135, - SpvOpFDiv = 136, - SpvOpUMod = 137, - SpvOpSRem = 138, - SpvOpSMod = 139, - SpvOpFRem = 140, - SpvOpFMod = 141, - SpvOpVectorTimesScalar = 142, - SpvOpMatrixTimesScalar = 143, - SpvOpVectorTimesMatrix = 144, - SpvOpMatrixTimesVector = 145, - SpvOpMatrixTimesMatrix = 146, - SpvOpOuterProduct = 147, - SpvOpDot = 148, - SpvOpIAddCarry = 149, - SpvOpISubBorrow = 150, - SpvOpUMulExtended = 151, - SpvOpSMulExtended = 152, - SpvOpAny = 154, - SpvOpAll = 155, - SpvOpIsNan = 156, - SpvOpIsInf = 157, - SpvOpIsFinite = 158, - SpvOpIsNormal = 159, - SpvOpSignBitSet = 160, - SpvOpLessOrGreater = 161, - SpvOpOrdered = 162, - SpvOpUnordered = 163, - SpvOpLogicalEqual = 164, - SpvOpLogicalNotEqual = 165, - SpvOpLogicalOr = 166, - SpvOpLogicalAnd = 167, - SpvOpLogicalNot = 168, - SpvOpSelect = 169, - SpvOpIEqual = 170, - SpvOpINotEqual = 171, - SpvOpUGreaterThan = 172, - SpvOpSGreaterThan = 173, - SpvOpUGreaterThanEqual = 174, - SpvOpSGreaterThanEqual = 175, - SpvOpULessThan = 176, - SpvOpSLessThan = 177, - SpvOpULessThanEqual = 178, - SpvOpSLessThanEqual = 179, - SpvOpFOrdEqual = 180, - SpvOpFUnordEqual = 181, - SpvOpFOrdNotEqual = 182, - SpvOpFUnordNotEqual = 183, - SpvOpFOrdLessThan = 184, - SpvOpFUnordLessThan = 185, - SpvOpFOrdGreaterThan = 186, - SpvOpFUnordGreaterThan = 187, - SpvOpFOrdLessThanEqual = 188, - SpvOpFUnordLessThanEqual = 189, - SpvOpFOrdGreaterThanEqual = 190, - SpvOpFUnordGreaterThanEqual = 191, - SpvOpShiftRightLogical = 194, - SpvOpShiftRightArithmetic = 195, - SpvOpShiftLeftLogical = 196, - SpvOpBitwiseOr = 197, - SpvOpBitwiseXor = 198, - SpvOpBitwiseAnd = 199, - SpvOpNot = 200, - SpvOpBitFieldInsert = 201, - SpvOpBitFieldSExtract = 202, - SpvOpBitFieldUExtract = 203, - SpvOpBitReverse = 204, - SpvOpBitCount = 205, - SpvOpDPdx = 207, - SpvOpDPdy = 208, - SpvOpFwidth = 209, - SpvOpDPdxFine = 210, - SpvOpDPdyFine = 211, - SpvOpFwidthFine = 212, - SpvOpDPdxCoarse = 213, - SpvOpDPdyCoarse = 214, - SpvOpFwidthCoarse = 215, - SpvOpEmitVertex = 218, - SpvOpEndPrimitive = 219, - SpvOpEmitStreamVertex = 220, - SpvOpEndStreamPrimitive = 221, - SpvOpControlBarrier = 224, - SpvOpMemoryBarrier = 225, - SpvOpAtomicLoad = 227, - SpvOpAtomicStore = 228, - SpvOpAtomicExchange = 229, - SpvOpAtomicCompareExchange = 230, - SpvOpAtomicCompareExchangeWeak = 231, - SpvOpAtomicIIncrement = 232, - SpvOpAtomicIDecrement = 233, - SpvOpAtomicIAdd = 234, - SpvOpAtomicISub = 235, - SpvOpAtomicSMin = 236, - SpvOpAtomicUMin = 237, - SpvOpAtomicSMax = 238, - SpvOpAtomicUMax = 239, - SpvOpAtomicAnd = 240, - SpvOpAtomicOr = 241, - SpvOpAtomicXor = 242, - SpvOpPhi = 245, - SpvOpLoopMerge = 246, - SpvOpSelectionMerge = 247, - SpvOpLabel = 248, - SpvOpBranch = 249, - SpvOpBranchConditional = 250, - SpvOpSwitch = 251, - SpvOpKill = 252, - SpvOpReturn = 253, - SpvOpReturnValue = 254, - SpvOpUnreachable = 255, - SpvOpLifetimeStart = 256, - SpvOpLifetimeStop = 257, - SpvOpGroupAsyncCopy = 259, - SpvOpGroupWaitEvents = 260, - SpvOpGroupAll = 261, - SpvOpGroupAny = 262, - SpvOpGroupBroadcast = 263, - SpvOpGroupIAdd = 264, - SpvOpGroupFAdd = 265, - SpvOpGroupFMin = 266, - SpvOpGroupUMin = 267, - SpvOpGroupSMin = 268, - SpvOpGroupFMax = 269, - SpvOpGroupUMax = 270, - SpvOpGroupSMax = 271, - SpvOpReadPipe = 274, - SpvOpWritePipe = 275, - SpvOpReservedReadPipe = 276, - SpvOpReservedWritePipe = 277, - SpvOpReserveReadPipePackets = 278, - SpvOpReserveWritePipePackets = 279, - SpvOpCommitReadPipe = 280, - SpvOpCommitWritePipe = 281, - SpvOpIsValidReserveId = 282, - SpvOpGetNumPipePackets = 283, - SpvOpGetMaxPipePackets = 284, - SpvOpGroupReserveReadPipePackets = 285, - SpvOpGroupReserveWritePipePackets = 286, - SpvOpGroupCommitReadPipe = 287, - SpvOpGroupCommitWritePipe = 288, - SpvOpEnqueueMarker = 291, - SpvOpEnqueueKernel = 292, - SpvOpGetKernelNDrangeSubGroupCount = 293, - SpvOpGetKernelNDrangeMaxSubGroupSize = 294, - SpvOpGetKernelWorkGroupSize = 295, - SpvOpGetKernelPreferredWorkGroupSizeMultiple = 296, - SpvOpRetainEvent = 297, - SpvOpReleaseEvent = 298, - SpvOpCreateUserEvent = 299, - SpvOpIsValidEvent = 300, - SpvOpSetUserEventStatus = 301, - SpvOpCaptureEventProfilingInfo = 302, - SpvOpGetDefaultQueue = 303, - SpvOpBuildNDRange = 304, - SpvOpImageSparseSampleImplicitLod = 305, - SpvOpImageSparseSampleExplicitLod = 306, - SpvOpImageSparseSampleDrefImplicitLod = 307, - SpvOpImageSparseSampleDrefExplicitLod = 308, - SpvOpImageSparseSampleProjImplicitLod = 309, - SpvOpImageSparseSampleProjExplicitLod = 310, - SpvOpImageSparseSampleProjDrefImplicitLod = 311, - SpvOpImageSparseSampleProjDrefExplicitLod = 312, - SpvOpImageSparseFetch = 313, - SpvOpImageSparseGather = 314, - SpvOpImageSparseDrefGather = 315, - SpvOpImageSparseTexelsResident = 316, - SpvOpNoLine = 317, - SpvOpAtomicFlagTestAndSet = 318, - SpvOpAtomicFlagClear = 319, - SpvOpImageSparseRead = 320, - SpvOpSizeOf = 321, - SpvOpTypePipeStorage = 322, - SpvOpConstantPipeStorage = 323, - SpvOpCreatePipeFromPipeStorage = 324, - SpvOpGetKernelLocalSizeForSubgroupCount = 325, - SpvOpGetKernelMaxNumSubgroups = 326, - SpvOpTypeNamedBarrier = 327, - SpvOpNamedBarrierInitialize = 328, - SpvOpMemoryNamedBarrier = 329, - SpvOpModuleProcessed = 330, - SpvOpExecutionModeId = 331, - SpvOpDecorateId = 332, - SpvOpSubgroupBallotKHR = 4421, - SpvOpSubgroupFirstInvocationKHR = 4422, - SpvOpSubgroupAllKHR = 4428, - SpvOpSubgroupAnyKHR = 4429, - SpvOpSubgroupAllEqualKHR = 4430, - SpvOpSubgroupReadInvocationKHR = 4432, - SpvOpGroupIAddNonUniformAMD = 5000, - SpvOpGroupFAddNonUniformAMD = 5001, - SpvOpGroupFMinNonUniformAMD = 5002, - SpvOpGroupUMinNonUniformAMD = 5003, - SpvOpGroupSMinNonUniformAMD = 5004, - SpvOpGroupFMaxNonUniformAMD = 5005, - SpvOpGroupUMaxNonUniformAMD = 5006, - SpvOpGroupSMaxNonUniformAMD = 5007, - SpvOpFragmentMaskFetchAMD = 5011, - SpvOpFragmentFetchAMD = 5012, - SpvOpSubgroupShuffleINTEL = 5571, - SpvOpSubgroupShuffleDownINTEL = 5572, - SpvOpSubgroupShuffleUpINTEL = 5573, - SpvOpSubgroupShuffleXorINTEL = 5574, - SpvOpSubgroupBlockReadINTEL = 5575, - SpvOpSubgroupBlockWriteINTEL = 5576, - SpvOpSubgroupImageBlockReadINTEL = 5577, - SpvOpSubgroupImageBlockWriteINTEL = 5578, - SpvOpDecorateStringGOOGLE = 5632, - SpvOpMemberDecorateStringGOOGLE = 5633, - SpvOpMax = 0x7fffffff, -} SpvOp; - -#endif // #ifndef spirv_H - diff --git a/include/spirv/1.2/spirv.hpp b/include/spirv/1.2/spirv.hpp deleted file mode 100644 index 57bd97a0..00000000 --- a/include/spirv/1.2/spirv.hpp +++ /dev/null @@ -1,1030 +0,0 @@ -// Copyright (c) 2014-2018 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -// This header is automatically generated by the same tool that creates -// the Binary Section of the SPIR-V specification. - -// Enumeration tokens for SPIR-V, in various styles: -// C, C++, C++11, JSON, Lua, Python -// -// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -// -// Some tokens act like mask values, which can be OR'd together, -// while others are mutually exclusive. The mask-like ones have -// "Mask" in their name, and a parallel enum that has the shift -// amount (1 << x) for each corresponding enumerant. - -#ifndef spirv_HPP -#define spirv_HPP - -namespace spv { - -typedef unsigned int Id; - -#define SPV_VERSION 0x10200 -#define SPV_REVISION 2 - -static const unsigned int MagicNumber = 0x07230203; -static const unsigned int Version = 0x00010200; -static const unsigned int Revision = 2; -static const unsigned int OpCodeMask = 0xffff; -static const unsigned int WordCountShift = 16; - -enum SourceLanguage { - SourceLanguageUnknown = 0, - SourceLanguageESSL = 1, - SourceLanguageGLSL = 2, - SourceLanguageOpenCL_C = 3, - SourceLanguageOpenCL_CPP = 4, - SourceLanguageHLSL = 5, - SourceLanguageMax = 0x7fffffff, -}; - -enum ExecutionModel { - ExecutionModelVertex = 0, - ExecutionModelTessellationControl = 1, - ExecutionModelTessellationEvaluation = 2, - ExecutionModelGeometry = 3, - ExecutionModelFragment = 4, - ExecutionModelGLCompute = 5, - ExecutionModelKernel = 6, - ExecutionModelMax = 0x7fffffff, -}; - -enum AddressingModel { - AddressingModelLogical = 0, - AddressingModelPhysical32 = 1, - AddressingModelPhysical64 = 2, - AddressingModelMax = 0x7fffffff, -}; - -enum MemoryModel { - MemoryModelSimple = 0, - MemoryModelGLSL450 = 1, - MemoryModelOpenCL = 2, - MemoryModelMax = 0x7fffffff, -}; - -enum ExecutionMode { - ExecutionModeInvocations = 0, - ExecutionModeSpacingEqual = 1, - ExecutionModeSpacingFractionalEven = 2, - ExecutionModeSpacingFractionalOdd = 3, - ExecutionModeVertexOrderCw = 4, - ExecutionModeVertexOrderCcw = 5, - ExecutionModePixelCenterInteger = 6, - ExecutionModeOriginUpperLeft = 7, - ExecutionModeOriginLowerLeft = 8, - ExecutionModeEarlyFragmentTests = 9, - ExecutionModePointMode = 10, - ExecutionModeXfb = 11, - ExecutionModeDepthReplacing = 12, - ExecutionModeDepthGreater = 14, - ExecutionModeDepthLess = 15, - ExecutionModeDepthUnchanged = 16, - ExecutionModeLocalSize = 17, - ExecutionModeLocalSizeHint = 18, - ExecutionModeInputPoints = 19, - ExecutionModeInputLines = 20, - ExecutionModeInputLinesAdjacency = 21, - ExecutionModeTriangles = 22, - ExecutionModeInputTrianglesAdjacency = 23, - ExecutionModeQuads = 24, - ExecutionModeIsolines = 25, - ExecutionModeOutputVertices = 26, - ExecutionModeOutputPoints = 27, - ExecutionModeOutputLineStrip = 28, - ExecutionModeOutputTriangleStrip = 29, - ExecutionModeVecTypeHint = 30, - ExecutionModeContractionOff = 31, - ExecutionModeInitializer = 33, - ExecutionModeFinalizer = 34, - ExecutionModeSubgroupSize = 35, - ExecutionModeSubgroupsPerWorkgroup = 36, - ExecutionModeSubgroupsPerWorkgroupId = 37, - ExecutionModeLocalSizeId = 38, - ExecutionModeLocalSizeHintId = 39, - ExecutionModePostDepthCoverage = 4446, - ExecutionModeStencilRefReplacingEXT = 5027, - ExecutionModeMax = 0x7fffffff, -}; - -enum StorageClass { - StorageClassUniformConstant = 0, - StorageClassInput = 1, - StorageClassUniform = 2, - StorageClassOutput = 3, - StorageClassWorkgroup = 4, - StorageClassCrossWorkgroup = 5, - StorageClassPrivate = 6, - StorageClassFunction = 7, - StorageClassGeneric = 8, - StorageClassPushConstant = 9, - StorageClassAtomicCounter = 10, - StorageClassImage = 11, - StorageClassStorageBuffer = 12, - StorageClassMax = 0x7fffffff, -}; - -enum Dim { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - DimCube = 3, - DimRect = 4, - DimBuffer = 5, - DimSubpassData = 6, - DimMax = 0x7fffffff, -}; - -enum SamplerAddressingMode { - SamplerAddressingModeNone = 0, - SamplerAddressingModeClampToEdge = 1, - SamplerAddressingModeClamp = 2, - SamplerAddressingModeRepeat = 3, - SamplerAddressingModeRepeatMirrored = 4, - SamplerAddressingModeMax = 0x7fffffff, -}; - -enum SamplerFilterMode { - SamplerFilterModeNearest = 0, - SamplerFilterModeLinear = 1, - SamplerFilterModeMax = 0x7fffffff, -}; - -enum ImageFormat { - ImageFormatUnknown = 0, - ImageFormatRgba32f = 1, - ImageFormatRgba16f = 2, - ImageFormatR32f = 3, - ImageFormatRgba8 = 4, - ImageFormatRgba8Snorm = 5, - ImageFormatRg32f = 6, - ImageFormatRg16f = 7, - ImageFormatR11fG11fB10f = 8, - ImageFormatR16f = 9, - ImageFormatRgba16 = 10, - ImageFormatRgb10A2 = 11, - ImageFormatRg16 = 12, - ImageFormatRg8 = 13, - ImageFormatR16 = 14, - ImageFormatR8 = 15, - ImageFormatRgba16Snorm = 16, - ImageFormatRg16Snorm = 17, - ImageFormatRg8Snorm = 18, - ImageFormatR16Snorm = 19, - ImageFormatR8Snorm = 20, - ImageFormatRgba32i = 21, - ImageFormatRgba16i = 22, - ImageFormatRgba8i = 23, - ImageFormatR32i = 24, - ImageFormatRg32i = 25, - ImageFormatRg16i = 26, - ImageFormatRg8i = 27, - ImageFormatR16i = 28, - ImageFormatR8i = 29, - ImageFormatRgba32ui = 30, - ImageFormatRgba16ui = 31, - ImageFormatRgba8ui = 32, - ImageFormatR32ui = 33, - ImageFormatRgb10a2ui = 34, - ImageFormatRg32ui = 35, - ImageFormatRg16ui = 36, - ImageFormatRg8ui = 37, - ImageFormatR16ui = 38, - ImageFormatR8ui = 39, - ImageFormatMax = 0x7fffffff, -}; - -enum ImageChannelOrder { - ImageChannelOrderR = 0, - ImageChannelOrderA = 1, - ImageChannelOrderRG = 2, - ImageChannelOrderRA = 3, - ImageChannelOrderRGB = 4, - ImageChannelOrderRGBA = 5, - ImageChannelOrderBGRA = 6, - ImageChannelOrderARGB = 7, - ImageChannelOrderIntensity = 8, - ImageChannelOrderLuminance = 9, - ImageChannelOrderRx = 10, - ImageChannelOrderRGx = 11, - ImageChannelOrderRGBx = 12, - ImageChannelOrderDepth = 13, - ImageChannelOrderDepthStencil = 14, - ImageChannelOrdersRGB = 15, - ImageChannelOrdersRGBx = 16, - ImageChannelOrdersRGBA = 17, - ImageChannelOrdersBGRA = 18, - ImageChannelOrderABGR = 19, - ImageChannelOrderMax = 0x7fffffff, -}; - -enum ImageChannelDataType { - ImageChannelDataTypeSnormInt8 = 0, - ImageChannelDataTypeSnormInt16 = 1, - ImageChannelDataTypeUnormInt8 = 2, - ImageChannelDataTypeUnormInt16 = 3, - ImageChannelDataTypeUnormShort565 = 4, - ImageChannelDataTypeUnormShort555 = 5, - ImageChannelDataTypeUnormInt101010 = 6, - ImageChannelDataTypeSignedInt8 = 7, - ImageChannelDataTypeSignedInt16 = 8, - ImageChannelDataTypeSignedInt32 = 9, - ImageChannelDataTypeUnsignedInt8 = 10, - ImageChannelDataTypeUnsignedInt16 = 11, - ImageChannelDataTypeUnsignedInt32 = 12, - ImageChannelDataTypeHalfFloat = 13, - ImageChannelDataTypeFloat = 14, - ImageChannelDataTypeUnormInt24 = 15, - ImageChannelDataTypeUnormInt101010_2 = 16, - ImageChannelDataTypeMax = 0x7fffffff, -}; - -enum ImageOperandsShift { - ImageOperandsBiasShift = 0, - ImageOperandsLodShift = 1, - ImageOperandsGradShift = 2, - ImageOperandsConstOffsetShift = 3, - ImageOperandsOffsetShift = 4, - ImageOperandsConstOffsetsShift = 5, - ImageOperandsSampleShift = 6, - ImageOperandsMinLodShift = 7, - ImageOperandsMax = 0x7fffffff, -}; - -enum ImageOperandsMask { - ImageOperandsMaskNone = 0, - ImageOperandsBiasMask = 0x00000001, - ImageOperandsLodMask = 0x00000002, - ImageOperandsGradMask = 0x00000004, - ImageOperandsConstOffsetMask = 0x00000008, - ImageOperandsOffsetMask = 0x00000010, - ImageOperandsConstOffsetsMask = 0x00000020, - ImageOperandsSampleMask = 0x00000040, - ImageOperandsMinLodMask = 0x00000080, -}; - -enum FPFastMathModeShift { - FPFastMathModeNotNaNShift = 0, - FPFastMathModeNotInfShift = 1, - FPFastMathModeNSZShift = 2, - FPFastMathModeAllowRecipShift = 3, - FPFastMathModeFastShift = 4, - FPFastMathModeMax = 0x7fffffff, -}; - -enum FPFastMathModeMask { - FPFastMathModeMaskNone = 0, - FPFastMathModeNotNaNMask = 0x00000001, - FPFastMathModeNotInfMask = 0x00000002, - FPFastMathModeNSZMask = 0x00000004, - FPFastMathModeAllowRecipMask = 0x00000008, - FPFastMathModeFastMask = 0x00000010, -}; - -enum FPRoundingMode { - FPRoundingModeRTE = 0, - FPRoundingModeRTZ = 1, - FPRoundingModeRTP = 2, - FPRoundingModeRTN = 3, - FPRoundingModeMax = 0x7fffffff, -}; - -enum LinkageType { - LinkageTypeExport = 0, - LinkageTypeImport = 1, - LinkageTypeMax = 0x7fffffff, -}; - -enum AccessQualifier { - AccessQualifierReadOnly = 0, - AccessQualifierWriteOnly = 1, - AccessQualifierReadWrite = 2, - AccessQualifierMax = 0x7fffffff, -}; - -enum FunctionParameterAttribute { - FunctionParameterAttributeZext = 0, - FunctionParameterAttributeSext = 1, - FunctionParameterAttributeByVal = 2, - FunctionParameterAttributeSret = 3, - FunctionParameterAttributeNoAlias = 4, - FunctionParameterAttributeNoCapture = 5, - FunctionParameterAttributeNoWrite = 6, - FunctionParameterAttributeNoReadWrite = 7, - FunctionParameterAttributeMax = 0x7fffffff, -}; - -enum Decoration { - DecorationRelaxedPrecision = 0, - DecorationSpecId = 1, - DecorationBlock = 2, - DecorationBufferBlock = 3, - DecorationRowMajor = 4, - DecorationColMajor = 5, - DecorationArrayStride = 6, - DecorationMatrixStride = 7, - DecorationGLSLShared = 8, - DecorationGLSLPacked = 9, - DecorationCPacked = 10, - DecorationBuiltIn = 11, - DecorationNoPerspective = 13, - DecorationFlat = 14, - DecorationPatch = 15, - DecorationCentroid = 16, - DecorationSample = 17, - DecorationInvariant = 18, - DecorationRestrict = 19, - DecorationAliased = 20, - DecorationVolatile = 21, - DecorationConstant = 22, - DecorationCoherent = 23, - DecorationNonWritable = 24, - DecorationNonReadable = 25, - DecorationUniform = 26, - DecorationSaturatedConversion = 28, - DecorationStream = 29, - DecorationLocation = 30, - DecorationComponent = 31, - DecorationIndex = 32, - DecorationBinding = 33, - DecorationDescriptorSet = 34, - DecorationOffset = 35, - DecorationXfbBuffer = 36, - DecorationXfbStride = 37, - DecorationFuncParamAttr = 38, - DecorationFPRoundingMode = 39, - DecorationFPFastMathMode = 40, - DecorationLinkageAttributes = 41, - DecorationNoContraction = 42, - DecorationInputAttachmentIndex = 43, - DecorationAlignment = 44, - DecorationMaxByteOffset = 45, - DecorationAlignmentId = 46, - DecorationMaxByteOffsetId = 47, - DecorationExplicitInterpAMD = 4999, - DecorationOverrideCoverageNV = 5248, - DecorationPassthroughNV = 5250, - DecorationViewportRelativeNV = 5252, - DecorationSecondaryViewportRelativeNV = 5256, - DecorationHlslCounterBufferGOOGLE = 5634, - DecorationHlslSemanticGOOGLE = 5635, - DecorationMax = 0x7fffffff, -}; - -enum BuiltIn { - BuiltInPosition = 0, - BuiltInPointSize = 1, - BuiltInClipDistance = 3, - BuiltInCullDistance = 4, - BuiltInVertexId = 5, - BuiltInInstanceId = 6, - BuiltInPrimitiveId = 7, - BuiltInInvocationId = 8, - BuiltInLayer = 9, - BuiltInViewportIndex = 10, - BuiltInTessLevelOuter = 11, - BuiltInTessLevelInner = 12, - BuiltInTessCoord = 13, - BuiltInPatchVertices = 14, - BuiltInFragCoord = 15, - BuiltInPointCoord = 16, - BuiltInFrontFacing = 17, - BuiltInSampleId = 18, - BuiltInSamplePosition = 19, - BuiltInSampleMask = 20, - BuiltInFragDepth = 22, - BuiltInHelperInvocation = 23, - BuiltInNumWorkgroups = 24, - BuiltInWorkgroupSize = 25, - BuiltInWorkgroupId = 26, - BuiltInLocalInvocationId = 27, - BuiltInGlobalInvocationId = 28, - BuiltInLocalInvocationIndex = 29, - BuiltInWorkDim = 30, - BuiltInGlobalSize = 31, - BuiltInEnqueuedWorkgroupSize = 32, - BuiltInGlobalOffset = 33, - BuiltInGlobalLinearId = 34, - BuiltInSubgroupSize = 36, - BuiltInSubgroupMaxSize = 37, - BuiltInNumSubgroups = 38, - BuiltInNumEnqueuedSubgroups = 39, - BuiltInSubgroupId = 40, - BuiltInSubgroupLocalInvocationId = 41, - BuiltInVertexIndex = 42, - BuiltInInstanceIndex = 43, - BuiltInSubgroupEqMaskKHR = 4416, - BuiltInSubgroupGeMaskKHR = 4417, - BuiltInSubgroupGtMaskKHR = 4418, - BuiltInSubgroupLeMaskKHR = 4419, - BuiltInSubgroupLtMaskKHR = 4420, - BuiltInBaseVertex = 4424, - BuiltInBaseInstance = 4425, - BuiltInDrawIndex = 4426, - BuiltInDeviceIndex = 4438, - BuiltInViewIndex = 4440, - BuiltInBaryCoordNoPerspAMD = 4992, - BuiltInBaryCoordNoPerspCentroidAMD = 4993, - BuiltInBaryCoordNoPerspSampleAMD = 4994, - BuiltInBaryCoordSmoothAMD = 4995, - BuiltInBaryCoordSmoothCentroidAMD = 4996, - BuiltInBaryCoordSmoothSampleAMD = 4997, - BuiltInBaryCoordPullModelAMD = 4998, - BuiltInFragStencilRefEXT = 5014, - BuiltInViewportMaskNV = 5253, - BuiltInSecondaryPositionNV = 5257, - BuiltInSecondaryViewportMaskNV = 5258, - BuiltInPositionPerViewNV = 5261, - BuiltInViewportMaskPerViewNV = 5262, - BuiltInMax = 0x7fffffff, -}; - -enum SelectionControlShift { - SelectionControlFlattenShift = 0, - SelectionControlDontFlattenShift = 1, - SelectionControlMax = 0x7fffffff, -}; - -enum SelectionControlMask { - SelectionControlMaskNone = 0, - SelectionControlFlattenMask = 0x00000001, - SelectionControlDontFlattenMask = 0x00000002, -}; - -enum LoopControlShift { - LoopControlUnrollShift = 0, - LoopControlDontUnrollShift = 1, - LoopControlDependencyInfiniteShift = 2, - LoopControlDependencyLengthShift = 3, - LoopControlMax = 0x7fffffff, -}; - -enum LoopControlMask { - LoopControlMaskNone = 0, - LoopControlUnrollMask = 0x00000001, - LoopControlDontUnrollMask = 0x00000002, - LoopControlDependencyInfiniteMask = 0x00000004, - LoopControlDependencyLengthMask = 0x00000008, -}; - -enum FunctionControlShift { - FunctionControlInlineShift = 0, - FunctionControlDontInlineShift = 1, - FunctionControlPureShift = 2, - FunctionControlConstShift = 3, - FunctionControlMax = 0x7fffffff, -}; - -enum FunctionControlMask { - FunctionControlMaskNone = 0, - FunctionControlInlineMask = 0x00000001, - FunctionControlDontInlineMask = 0x00000002, - FunctionControlPureMask = 0x00000004, - FunctionControlConstMask = 0x00000008, -}; - -enum MemorySemanticsShift { - MemorySemanticsAcquireShift = 1, - MemorySemanticsReleaseShift = 2, - MemorySemanticsAcquireReleaseShift = 3, - MemorySemanticsSequentiallyConsistentShift = 4, - MemorySemanticsUniformMemoryShift = 6, - MemorySemanticsSubgroupMemoryShift = 7, - MemorySemanticsWorkgroupMemoryShift = 8, - MemorySemanticsCrossWorkgroupMemoryShift = 9, - MemorySemanticsAtomicCounterMemoryShift = 10, - MemorySemanticsImageMemoryShift = 11, - MemorySemanticsMax = 0x7fffffff, -}; - -enum MemorySemanticsMask { - MemorySemanticsMaskNone = 0, - MemorySemanticsAcquireMask = 0x00000002, - MemorySemanticsReleaseMask = 0x00000004, - MemorySemanticsAcquireReleaseMask = 0x00000008, - MemorySemanticsSequentiallyConsistentMask = 0x00000010, - MemorySemanticsUniformMemoryMask = 0x00000040, - MemorySemanticsSubgroupMemoryMask = 0x00000080, - MemorySemanticsWorkgroupMemoryMask = 0x00000100, - MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, - MemorySemanticsAtomicCounterMemoryMask = 0x00000400, - MemorySemanticsImageMemoryMask = 0x00000800, -}; - -enum MemoryAccessShift { - MemoryAccessVolatileShift = 0, - MemoryAccessAlignedShift = 1, - MemoryAccessNontemporalShift = 2, - MemoryAccessMax = 0x7fffffff, -}; - -enum MemoryAccessMask { - MemoryAccessMaskNone = 0, - MemoryAccessVolatileMask = 0x00000001, - MemoryAccessAlignedMask = 0x00000002, - MemoryAccessNontemporalMask = 0x00000004, -}; - -enum Scope { - ScopeCrossDevice = 0, - ScopeDevice = 1, - ScopeWorkgroup = 2, - ScopeSubgroup = 3, - ScopeInvocation = 4, - ScopeMax = 0x7fffffff, -}; - -enum GroupOperation { - GroupOperationReduce = 0, - GroupOperationInclusiveScan = 1, - GroupOperationExclusiveScan = 2, - GroupOperationMax = 0x7fffffff, -}; - -enum KernelEnqueueFlags { - KernelEnqueueFlagsNoWait = 0, - KernelEnqueueFlagsWaitKernel = 1, - KernelEnqueueFlagsWaitWorkGroup = 2, - KernelEnqueueFlagsMax = 0x7fffffff, -}; - -enum KernelProfilingInfoShift { - KernelProfilingInfoCmdExecTimeShift = 0, - KernelProfilingInfoMax = 0x7fffffff, -}; - -enum KernelProfilingInfoMask { - KernelProfilingInfoMaskNone = 0, - KernelProfilingInfoCmdExecTimeMask = 0x00000001, -}; - -enum Capability { - CapabilityMatrix = 0, - CapabilityShader = 1, - CapabilityGeometry = 2, - CapabilityTessellation = 3, - CapabilityAddresses = 4, - CapabilityLinkage = 5, - CapabilityKernel = 6, - CapabilityVector16 = 7, - CapabilityFloat16Buffer = 8, - CapabilityFloat16 = 9, - CapabilityFloat64 = 10, - CapabilityInt64 = 11, - CapabilityInt64Atomics = 12, - CapabilityImageBasic = 13, - CapabilityImageReadWrite = 14, - CapabilityImageMipmap = 15, - CapabilityPipes = 17, - CapabilityGroups = 18, - CapabilityDeviceEnqueue = 19, - CapabilityLiteralSampler = 20, - CapabilityAtomicStorage = 21, - CapabilityInt16 = 22, - CapabilityTessellationPointSize = 23, - CapabilityGeometryPointSize = 24, - CapabilityImageGatherExtended = 25, - CapabilityStorageImageMultisample = 27, - CapabilityUniformBufferArrayDynamicIndexing = 28, - CapabilitySampledImageArrayDynamicIndexing = 29, - CapabilityStorageBufferArrayDynamicIndexing = 30, - CapabilityStorageImageArrayDynamicIndexing = 31, - CapabilityClipDistance = 32, - CapabilityCullDistance = 33, - CapabilityImageCubeArray = 34, - CapabilitySampleRateShading = 35, - CapabilityImageRect = 36, - CapabilitySampledRect = 37, - CapabilityGenericPointer = 38, - CapabilityInt8 = 39, - CapabilityInputAttachment = 40, - CapabilitySparseResidency = 41, - CapabilityMinLod = 42, - CapabilitySampled1D = 43, - CapabilityImage1D = 44, - CapabilitySampledCubeArray = 45, - CapabilitySampledBuffer = 46, - CapabilityImageBuffer = 47, - CapabilityImageMSArray = 48, - CapabilityStorageImageExtendedFormats = 49, - CapabilityImageQuery = 50, - CapabilityDerivativeControl = 51, - CapabilityInterpolationFunction = 52, - CapabilityTransformFeedback = 53, - CapabilityGeometryStreams = 54, - CapabilityStorageImageReadWithoutFormat = 55, - CapabilityStorageImageWriteWithoutFormat = 56, - CapabilityMultiViewport = 57, - CapabilitySubgroupDispatch = 58, - CapabilityNamedBarrier = 59, - CapabilityPipeStorage = 60, - CapabilitySubgroupBallotKHR = 4423, - CapabilityDrawParameters = 4427, - CapabilitySubgroupVoteKHR = 4431, - CapabilityStorageBuffer16BitAccess = 4433, - CapabilityStorageUniformBufferBlock16 = 4433, - CapabilityStorageUniform16 = 4434, - CapabilityUniformAndStorageBuffer16BitAccess = 4434, - CapabilityStoragePushConstant16 = 4435, - CapabilityStorageInputOutput16 = 4436, - CapabilityDeviceGroup = 4437, - CapabilityMultiView = 4439, - CapabilityVariablePointersStorageBuffer = 4441, - CapabilityVariablePointers = 4442, - CapabilityAtomicStorageOps = 4445, - CapabilitySampleMaskPostDepthCoverage = 4447, - CapabilityImageGatherBiasLodAMD = 5009, - CapabilityFragmentMaskAMD = 5010, - CapabilityStencilExportEXT = 5013, - CapabilityImageReadWriteLodAMD = 5015, - CapabilitySampleMaskOverrideCoverageNV = 5249, - CapabilityGeometryShaderPassthroughNV = 5251, - CapabilityShaderViewportIndexLayerEXT = 5254, - CapabilityShaderViewportIndexLayerNV = 5254, - CapabilityShaderViewportMaskNV = 5255, - CapabilityShaderStereoViewNV = 5259, - CapabilityPerViewAttributesNV = 5260, - CapabilitySubgroupShuffleINTEL = 5568, - CapabilitySubgroupBufferBlockIOINTEL = 5569, - CapabilitySubgroupImageBlockIOINTEL = 5570, - CapabilityMax = 0x7fffffff, -}; - -enum Op { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, - OpImageSparseRead = 320, - OpSizeOf = 321, - OpTypePipeStorage = 322, - OpConstantPipeStorage = 323, - OpCreatePipeFromPipeStorage = 324, - OpGetKernelLocalSizeForSubgroupCount = 325, - OpGetKernelMaxNumSubgroups = 326, - OpTypeNamedBarrier = 327, - OpNamedBarrierInitialize = 328, - OpMemoryNamedBarrier = 329, - OpModuleProcessed = 330, - OpExecutionModeId = 331, - OpDecorateId = 332, - OpSubgroupBallotKHR = 4421, - OpSubgroupFirstInvocationKHR = 4422, - OpSubgroupAllKHR = 4428, - OpSubgroupAnyKHR = 4429, - OpSubgroupAllEqualKHR = 4430, - OpSubgroupReadInvocationKHR = 4432, - OpGroupIAddNonUniformAMD = 5000, - OpGroupFAddNonUniformAMD = 5001, - OpGroupFMinNonUniformAMD = 5002, - OpGroupUMinNonUniformAMD = 5003, - OpGroupSMinNonUniformAMD = 5004, - OpGroupFMaxNonUniformAMD = 5005, - OpGroupUMaxNonUniformAMD = 5006, - OpGroupSMaxNonUniformAMD = 5007, - OpFragmentMaskFetchAMD = 5011, - OpFragmentFetchAMD = 5012, - OpSubgroupShuffleINTEL = 5571, - OpSubgroupShuffleDownINTEL = 5572, - OpSubgroupShuffleUpINTEL = 5573, - OpSubgroupShuffleXorINTEL = 5574, - OpSubgroupBlockReadINTEL = 5575, - OpSubgroupBlockWriteINTEL = 5576, - OpSubgroupImageBlockReadINTEL = 5577, - OpSubgroupImageBlockWriteINTEL = 5578, - OpDecorateStringGOOGLE = 5632, - OpMemberDecorateStringGOOGLE = 5633, - OpMax = 0x7fffffff, -}; - -// Overload operator| for mask bit combining - -inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } -inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } -inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } -inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } -inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } -inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } -inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } -inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } - -} // end namespace spv - -#endif // #ifndef spirv_HPP - diff --git a/include/spirv/1.2/spirv.hpp11 b/include/spirv/1.2/spirv.hpp11 deleted file mode 100644 index 7a875fdb..00000000 --- a/include/spirv/1.2/spirv.hpp11 +++ /dev/null @@ -1,1030 +0,0 @@ -// Copyright (c) 2014-2018 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -// This header is automatically generated by the same tool that creates -// the Binary Section of the SPIR-V specification. - -// Enumeration tokens for SPIR-V, in various styles: -// C, C++, C++11, JSON, Lua, Python -// -// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -// -// Some tokens act like mask values, which can be OR'd together, -// while others are mutually exclusive. The mask-like ones have -// "Mask" in their name, and a parallel enum that has the shift -// amount (1 << x) for each corresponding enumerant. - -#ifndef spirv_HPP -#define spirv_HPP - -namespace spv { - -typedef unsigned int Id; - -#define SPV_VERSION 0x10200 -#define SPV_REVISION 2 - -static const unsigned int MagicNumber = 0x07230203; -static const unsigned int Version = 0x00010200; -static const unsigned int Revision = 2; -static const unsigned int OpCodeMask = 0xffff; -static const unsigned int WordCountShift = 16; - -enum class SourceLanguage : unsigned { - Unknown = 0, - ESSL = 1, - GLSL = 2, - OpenCL_C = 3, - OpenCL_CPP = 4, - HLSL = 5, - Max = 0x7fffffff, -}; - -enum class ExecutionModel : unsigned { - Vertex = 0, - TessellationControl = 1, - TessellationEvaluation = 2, - Geometry = 3, - Fragment = 4, - GLCompute = 5, - Kernel = 6, - Max = 0x7fffffff, -}; - -enum class AddressingModel : unsigned { - Logical = 0, - Physical32 = 1, - Physical64 = 2, - Max = 0x7fffffff, -}; - -enum class MemoryModel : unsigned { - Simple = 0, - GLSL450 = 1, - OpenCL = 2, - Max = 0x7fffffff, -}; - -enum class ExecutionMode : unsigned { - Invocations = 0, - SpacingEqual = 1, - SpacingFractionalEven = 2, - SpacingFractionalOdd = 3, - VertexOrderCw = 4, - VertexOrderCcw = 5, - PixelCenterInteger = 6, - OriginUpperLeft = 7, - OriginLowerLeft = 8, - EarlyFragmentTests = 9, - PointMode = 10, - Xfb = 11, - DepthReplacing = 12, - DepthGreater = 14, - DepthLess = 15, - DepthUnchanged = 16, - LocalSize = 17, - LocalSizeHint = 18, - InputPoints = 19, - InputLines = 20, - InputLinesAdjacency = 21, - Triangles = 22, - InputTrianglesAdjacency = 23, - Quads = 24, - Isolines = 25, - OutputVertices = 26, - OutputPoints = 27, - OutputLineStrip = 28, - OutputTriangleStrip = 29, - VecTypeHint = 30, - ContractionOff = 31, - Initializer = 33, - Finalizer = 34, - SubgroupSize = 35, - SubgroupsPerWorkgroup = 36, - SubgroupsPerWorkgroupId = 37, - LocalSizeId = 38, - LocalSizeHintId = 39, - PostDepthCoverage = 4446, - StencilRefReplacingEXT = 5027, - Max = 0x7fffffff, -}; - -enum class StorageClass : unsigned { - UniformConstant = 0, - Input = 1, - Uniform = 2, - Output = 3, - Workgroup = 4, - CrossWorkgroup = 5, - Private = 6, - Function = 7, - Generic = 8, - PushConstant = 9, - AtomicCounter = 10, - Image = 11, - StorageBuffer = 12, - Max = 0x7fffffff, -}; - -enum class Dim : unsigned { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - Cube = 3, - Rect = 4, - Buffer = 5, - SubpassData = 6, - Max = 0x7fffffff, -}; - -enum class SamplerAddressingMode : unsigned { - None = 0, - ClampToEdge = 1, - Clamp = 2, - Repeat = 3, - RepeatMirrored = 4, - Max = 0x7fffffff, -}; - -enum class SamplerFilterMode : unsigned { - Nearest = 0, - Linear = 1, - Max = 0x7fffffff, -}; - -enum class ImageFormat : unsigned { - Unknown = 0, - Rgba32f = 1, - Rgba16f = 2, - R32f = 3, - Rgba8 = 4, - Rgba8Snorm = 5, - Rg32f = 6, - Rg16f = 7, - R11fG11fB10f = 8, - R16f = 9, - Rgba16 = 10, - Rgb10A2 = 11, - Rg16 = 12, - Rg8 = 13, - R16 = 14, - R8 = 15, - Rgba16Snorm = 16, - Rg16Snorm = 17, - Rg8Snorm = 18, - R16Snorm = 19, - R8Snorm = 20, - Rgba32i = 21, - Rgba16i = 22, - Rgba8i = 23, - R32i = 24, - Rg32i = 25, - Rg16i = 26, - Rg8i = 27, - R16i = 28, - R8i = 29, - Rgba32ui = 30, - Rgba16ui = 31, - Rgba8ui = 32, - R32ui = 33, - Rgb10a2ui = 34, - Rg32ui = 35, - Rg16ui = 36, - Rg8ui = 37, - R16ui = 38, - R8ui = 39, - Max = 0x7fffffff, -}; - -enum class ImageChannelOrder : unsigned { - R = 0, - A = 1, - RG = 2, - RA = 3, - RGB = 4, - RGBA = 5, - BGRA = 6, - ARGB = 7, - Intensity = 8, - Luminance = 9, - Rx = 10, - RGx = 11, - RGBx = 12, - Depth = 13, - DepthStencil = 14, - sRGB = 15, - sRGBx = 16, - sRGBA = 17, - sBGRA = 18, - ABGR = 19, - Max = 0x7fffffff, -}; - -enum class ImageChannelDataType : unsigned { - SnormInt8 = 0, - SnormInt16 = 1, - UnormInt8 = 2, - UnormInt16 = 3, - UnormShort565 = 4, - UnormShort555 = 5, - UnormInt101010 = 6, - SignedInt8 = 7, - SignedInt16 = 8, - SignedInt32 = 9, - UnsignedInt8 = 10, - UnsignedInt16 = 11, - UnsignedInt32 = 12, - HalfFloat = 13, - Float = 14, - UnormInt24 = 15, - UnormInt101010_2 = 16, - Max = 0x7fffffff, -}; - -enum class ImageOperandsShift : unsigned { - Bias = 0, - Lod = 1, - Grad = 2, - ConstOffset = 3, - Offset = 4, - ConstOffsets = 5, - Sample = 6, - MinLod = 7, - Max = 0x7fffffff, -}; - -enum class ImageOperandsMask : unsigned { - MaskNone = 0, - Bias = 0x00000001, - Lod = 0x00000002, - Grad = 0x00000004, - ConstOffset = 0x00000008, - Offset = 0x00000010, - ConstOffsets = 0x00000020, - Sample = 0x00000040, - MinLod = 0x00000080, -}; - -enum class FPFastMathModeShift : unsigned { - NotNaN = 0, - NotInf = 1, - NSZ = 2, - AllowRecip = 3, - Fast = 4, - Max = 0x7fffffff, -}; - -enum class FPFastMathModeMask : unsigned { - MaskNone = 0, - NotNaN = 0x00000001, - NotInf = 0x00000002, - NSZ = 0x00000004, - AllowRecip = 0x00000008, - Fast = 0x00000010, -}; - -enum class FPRoundingMode : unsigned { - RTE = 0, - RTZ = 1, - RTP = 2, - RTN = 3, - Max = 0x7fffffff, -}; - -enum class LinkageType : unsigned { - Export = 0, - Import = 1, - Max = 0x7fffffff, -}; - -enum class AccessQualifier : unsigned { - ReadOnly = 0, - WriteOnly = 1, - ReadWrite = 2, - Max = 0x7fffffff, -}; - -enum class FunctionParameterAttribute : unsigned { - Zext = 0, - Sext = 1, - ByVal = 2, - Sret = 3, - NoAlias = 4, - NoCapture = 5, - NoWrite = 6, - NoReadWrite = 7, - Max = 0x7fffffff, -}; - -enum class Decoration : unsigned { - RelaxedPrecision = 0, - SpecId = 1, - Block = 2, - BufferBlock = 3, - RowMajor = 4, - ColMajor = 5, - ArrayStride = 6, - MatrixStride = 7, - GLSLShared = 8, - GLSLPacked = 9, - CPacked = 10, - BuiltIn = 11, - NoPerspective = 13, - Flat = 14, - Patch = 15, - Centroid = 16, - Sample = 17, - Invariant = 18, - Restrict = 19, - Aliased = 20, - Volatile = 21, - Constant = 22, - Coherent = 23, - NonWritable = 24, - NonReadable = 25, - Uniform = 26, - SaturatedConversion = 28, - Stream = 29, - Location = 30, - Component = 31, - Index = 32, - Binding = 33, - DescriptorSet = 34, - Offset = 35, - XfbBuffer = 36, - XfbStride = 37, - FuncParamAttr = 38, - FPRoundingMode = 39, - FPFastMathMode = 40, - LinkageAttributes = 41, - NoContraction = 42, - InputAttachmentIndex = 43, - Alignment = 44, - MaxByteOffset = 45, - AlignmentId = 46, - MaxByteOffsetId = 47, - ExplicitInterpAMD = 4999, - OverrideCoverageNV = 5248, - PassthroughNV = 5250, - ViewportRelativeNV = 5252, - SecondaryViewportRelativeNV = 5256, - HlslCounterBufferGOOGLE = 5634, - HlslSemanticGOOGLE = 5635, - Max = 0x7fffffff, -}; - -enum class BuiltIn : unsigned { - Position = 0, - PointSize = 1, - ClipDistance = 3, - CullDistance = 4, - VertexId = 5, - InstanceId = 6, - PrimitiveId = 7, - InvocationId = 8, - Layer = 9, - ViewportIndex = 10, - TessLevelOuter = 11, - TessLevelInner = 12, - TessCoord = 13, - PatchVertices = 14, - FragCoord = 15, - PointCoord = 16, - FrontFacing = 17, - SampleId = 18, - SamplePosition = 19, - SampleMask = 20, - FragDepth = 22, - HelperInvocation = 23, - NumWorkgroups = 24, - WorkgroupSize = 25, - WorkgroupId = 26, - LocalInvocationId = 27, - GlobalInvocationId = 28, - LocalInvocationIndex = 29, - WorkDim = 30, - GlobalSize = 31, - EnqueuedWorkgroupSize = 32, - GlobalOffset = 33, - GlobalLinearId = 34, - SubgroupSize = 36, - SubgroupMaxSize = 37, - NumSubgroups = 38, - NumEnqueuedSubgroups = 39, - SubgroupId = 40, - SubgroupLocalInvocationId = 41, - VertexIndex = 42, - InstanceIndex = 43, - SubgroupEqMaskKHR = 4416, - SubgroupGeMaskKHR = 4417, - SubgroupGtMaskKHR = 4418, - SubgroupLeMaskKHR = 4419, - SubgroupLtMaskKHR = 4420, - BaseVertex = 4424, - BaseInstance = 4425, - DrawIndex = 4426, - DeviceIndex = 4438, - ViewIndex = 4440, - BaryCoordNoPerspAMD = 4992, - BaryCoordNoPerspCentroidAMD = 4993, - BaryCoordNoPerspSampleAMD = 4994, - BaryCoordSmoothAMD = 4995, - BaryCoordSmoothCentroidAMD = 4996, - BaryCoordSmoothSampleAMD = 4997, - BaryCoordPullModelAMD = 4998, - FragStencilRefEXT = 5014, - ViewportMaskNV = 5253, - SecondaryPositionNV = 5257, - SecondaryViewportMaskNV = 5258, - PositionPerViewNV = 5261, - ViewportMaskPerViewNV = 5262, - Max = 0x7fffffff, -}; - -enum class SelectionControlShift : unsigned { - Flatten = 0, - DontFlatten = 1, - Max = 0x7fffffff, -}; - -enum class SelectionControlMask : unsigned { - MaskNone = 0, - Flatten = 0x00000001, - DontFlatten = 0x00000002, -}; - -enum class LoopControlShift : unsigned { - Unroll = 0, - DontUnroll = 1, - DependencyInfinite = 2, - DependencyLength = 3, - Max = 0x7fffffff, -}; - -enum class LoopControlMask : unsigned { - MaskNone = 0, - Unroll = 0x00000001, - DontUnroll = 0x00000002, - DependencyInfinite = 0x00000004, - DependencyLength = 0x00000008, -}; - -enum class FunctionControlShift : unsigned { - Inline = 0, - DontInline = 1, - Pure = 2, - Const = 3, - Max = 0x7fffffff, -}; - -enum class FunctionControlMask : unsigned { - MaskNone = 0, - Inline = 0x00000001, - DontInline = 0x00000002, - Pure = 0x00000004, - Const = 0x00000008, -}; - -enum class MemorySemanticsShift : unsigned { - Acquire = 1, - Release = 2, - AcquireRelease = 3, - SequentiallyConsistent = 4, - UniformMemory = 6, - SubgroupMemory = 7, - WorkgroupMemory = 8, - CrossWorkgroupMemory = 9, - AtomicCounterMemory = 10, - ImageMemory = 11, - Max = 0x7fffffff, -}; - -enum class MemorySemanticsMask : unsigned { - MaskNone = 0, - Acquire = 0x00000002, - Release = 0x00000004, - AcquireRelease = 0x00000008, - SequentiallyConsistent = 0x00000010, - UniformMemory = 0x00000040, - SubgroupMemory = 0x00000080, - WorkgroupMemory = 0x00000100, - CrossWorkgroupMemory = 0x00000200, - AtomicCounterMemory = 0x00000400, - ImageMemory = 0x00000800, -}; - -enum class MemoryAccessShift : unsigned { - Volatile = 0, - Aligned = 1, - Nontemporal = 2, - Max = 0x7fffffff, -}; - -enum class MemoryAccessMask : unsigned { - MaskNone = 0, - Volatile = 0x00000001, - Aligned = 0x00000002, - Nontemporal = 0x00000004, -}; - -enum class Scope : unsigned { - CrossDevice = 0, - Device = 1, - Workgroup = 2, - Subgroup = 3, - Invocation = 4, - Max = 0x7fffffff, -}; - -enum class GroupOperation : unsigned { - Reduce = 0, - InclusiveScan = 1, - ExclusiveScan = 2, - Max = 0x7fffffff, -}; - -enum class KernelEnqueueFlags : unsigned { - NoWait = 0, - WaitKernel = 1, - WaitWorkGroup = 2, - Max = 0x7fffffff, -}; - -enum class KernelProfilingInfoShift : unsigned { - CmdExecTime = 0, - Max = 0x7fffffff, -}; - -enum class KernelProfilingInfoMask : unsigned { - MaskNone = 0, - CmdExecTime = 0x00000001, -}; - -enum class Capability : unsigned { - Matrix = 0, - Shader = 1, - Geometry = 2, - Tessellation = 3, - Addresses = 4, - Linkage = 5, - Kernel = 6, - Vector16 = 7, - Float16Buffer = 8, - Float16 = 9, - Float64 = 10, - Int64 = 11, - Int64Atomics = 12, - ImageBasic = 13, - ImageReadWrite = 14, - ImageMipmap = 15, - Pipes = 17, - Groups = 18, - DeviceEnqueue = 19, - LiteralSampler = 20, - AtomicStorage = 21, - Int16 = 22, - TessellationPointSize = 23, - GeometryPointSize = 24, - ImageGatherExtended = 25, - StorageImageMultisample = 27, - UniformBufferArrayDynamicIndexing = 28, - SampledImageArrayDynamicIndexing = 29, - StorageBufferArrayDynamicIndexing = 30, - StorageImageArrayDynamicIndexing = 31, - ClipDistance = 32, - CullDistance = 33, - ImageCubeArray = 34, - SampleRateShading = 35, - ImageRect = 36, - SampledRect = 37, - GenericPointer = 38, - Int8 = 39, - InputAttachment = 40, - SparseResidency = 41, - MinLod = 42, - Sampled1D = 43, - Image1D = 44, - SampledCubeArray = 45, - SampledBuffer = 46, - ImageBuffer = 47, - ImageMSArray = 48, - StorageImageExtendedFormats = 49, - ImageQuery = 50, - DerivativeControl = 51, - InterpolationFunction = 52, - TransformFeedback = 53, - GeometryStreams = 54, - StorageImageReadWithoutFormat = 55, - StorageImageWriteWithoutFormat = 56, - MultiViewport = 57, - SubgroupDispatch = 58, - NamedBarrier = 59, - PipeStorage = 60, - SubgroupBallotKHR = 4423, - DrawParameters = 4427, - SubgroupVoteKHR = 4431, - StorageBuffer16BitAccess = 4433, - StorageUniformBufferBlock16 = 4433, - StorageUniform16 = 4434, - UniformAndStorageBuffer16BitAccess = 4434, - StoragePushConstant16 = 4435, - StorageInputOutput16 = 4436, - DeviceGroup = 4437, - MultiView = 4439, - VariablePointersStorageBuffer = 4441, - VariablePointers = 4442, - AtomicStorageOps = 4445, - SampleMaskPostDepthCoverage = 4447, - ImageGatherBiasLodAMD = 5009, - FragmentMaskAMD = 5010, - StencilExportEXT = 5013, - ImageReadWriteLodAMD = 5015, - SampleMaskOverrideCoverageNV = 5249, - GeometryShaderPassthroughNV = 5251, - ShaderViewportIndexLayerEXT = 5254, - ShaderViewportIndexLayerNV = 5254, - ShaderViewportMaskNV = 5255, - ShaderStereoViewNV = 5259, - PerViewAttributesNV = 5260, - SubgroupShuffleINTEL = 5568, - SubgroupBufferBlockIOINTEL = 5569, - SubgroupImageBlockIOINTEL = 5570, - Max = 0x7fffffff, -}; - -enum class Op : unsigned { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, - OpImageSparseRead = 320, - OpSizeOf = 321, - OpTypePipeStorage = 322, - OpConstantPipeStorage = 323, - OpCreatePipeFromPipeStorage = 324, - OpGetKernelLocalSizeForSubgroupCount = 325, - OpGetKernelMaxNumSubgroups = 326, - OpTypeNamedBarrier = 327, - OpNamedBarrierInitialize = 328, - OpMemoryNamedBarrier = 329, - OpModuleProcessed = 330, - OpExecutionModeId = 331, - OpDecorateId = 332, - OpSubgroupBallotKHR = 4421, - OpSubgroupFirstInvocationKHR = 4422, - OpSubgroupAllKHR = 4428, - OpSubgroupAnyKHR = 4429, - OpSubgroupAllEqualKHR = 4430, - OpSubgroupReadInvocationKHR = 4432, - OpGroupIAddNonUniformAMD = 5000, - OpGroupFAddNonUniformAMD = 5001, - OpGroupFMinNonUniformAMD = 5002, - OpGroupUMinNonUniformAMD = 5003, - OpGroupSMinNonUniformAMD = 5004, - OpGroupFMaxNonUniformAMD = 5005, - OpGroupUMaxNonUniformAMD = 5006, - OpGroupSMaxNonUniformAMD = 5007, - OpFragmentMaskFetchAMD = 5011, - OpFragmentFetchAMD = 5012, - OpSubgroupShuffleINTEL = 5571, - OpSubgroupShuffleDownINTEL = 5572, - OpSubgroupShuffleUpINTEL = 5573, - OpSubgroupShuffleXorINTEL = 5574, - OpSubgroupBlockReadINTEL = 5575, - OpSubgroupBlockWriteINTEL = 5576, - OpSubgroupImageBlockReadINTEL = 5577, - OpSubgroupImageBlockWriteINTEL = 5578, - OpDecorateStringGOOGLE = 5632, - OpMemberDecorateStringGOOGLE = 5633, - Max = 0x7fffffff, -}; - -// Overload operator| for mask bit combining - -inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } -inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } -inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } -inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } -inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } -inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } -inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } -inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } - -} // end namespace spv - -#endif // #ifndef spirv_HPP - diff --git a/include/spirv/1.2/spirv.json b/include/spirv/1.2/spirv.json deleted file mode 100644 index 9c0ff0a4..00000000 --- a/include/spirv/1.2/spirv.json +++ /dev/null @@ -1,1046 +0,0 @@ -{ - "spv": - { - "meta": - { - "Comment": - [ - [ - "Copyright (c) 2014-2018 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - [ - "This header is automatically generated by the same tool that creates", - "the Binary Section of the SPIR-V specification." - ], - [ - "Enumeration tokens for SPIR-V, in various styles:", - " C, C++, C++11, JSON, Lua, Python", - "", - "- C will have tokens with a \"Spv\" prefix, e.g.: SpvSourceLanguageGLSL", - "- C++ will have tokens in the \"spv\" name space, e.g.: spv::SourceLanguageGLSL", - "- C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL", - "- Lua will use tables, e.g.: spv.SourceLanguage.GLSL", - "- Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL']", - "", - "Some tokens act like mask values, which can be OR'd together,", - "while others are mutually exclusive. The mask-like ones have", - "\"Mask\" in their name, and a parallel enum that has the shift", - "amount (1 << x) for each corresponding enumerant." - ] - ], - "MagicNumber": 119734787, - "Version": 66048, - "Revision": 2, - "OpCodeMask": 65535, - "WordCountShift": 16 - }, - "enum": - [ - { - "Name": "SourceLanguage", - "Type": "Value", - "Values": - { - "Unknown": 0, - "ESSL": 1, - "GLSL": 2, - "OpenCL_C": 3, - "OpenCL_CPP": 4, - "HLSL": 5 - } - }, - { - "Name": "ExecutionModel", - "Type": "Value", - "Values": - { - "Vertex": 0, - "TessellationControl": 1, - "TessellationEvaluation": 2, - "Geometry": 3, - "Fragment": 4, - "GLCompute": 5, - "Kernel": 6 - } - }, - { - "Name": "AddressingModel", - "Type": "Value", - "Values": - { - "Logical": 0, - "Physical32": 1, - "Physical64": 2 - } - }, - { - "Name": "MemoryModel", - "Type": "Value", - "Values": - { - "Simple": 0, - "GLSL450": 1, - "OpenCL": 2 - } - }, - { - "Name": "ExecutionMode", - "Type": "Value", - "Values": - { - "Invocations": 0, - "SpacingEqual": 1, - "SpacingFractionalEven": 2, - "SpacingFractionalOdd": 3, - "VertexOrderCw": 4, - "VertexOrderCcw": 5, - "PixelCenterInteger": 6, - "OriginUpperLeft": 7, - "OriginLowerLeft": 8, - "EarlyFragmentTests": 9, - "PointMode": 10, - "Xfb": 11, - "DepthReplacing": 12, - "DepthGreater": 14, - "DepthLess": 15, - "DepthUnchanged": 16, - "LocalSize": 17, - "LocalSizeHint": 18, - "InputPoints": 19, - "InputLines": 20, - "InputLinesAdjacency": 21, - "Triangles": 22, - "InputTrianglesAdjacency": 23, - "Quads": 24, - "Isolines": 25, - "OutputVertices": 26, - "OutputPoints": 27, - "OutputLineStrip": 28, - "OutputTriangleStrip": 29, - "VecTypeHint": 30, - "ContractionOff": 31, - "Initializer": 33, - "Finalizer": 34, - "SubgroupSize": 35, - "SubgroupsPerWorkgroup": 36, - "SubgroupsPerWorkgroupId": 37, - "LocalSizeId": 38, - "LocalSizeHintId": 39, - "PostDepthCoverage": 4446, - "StencilRefReplacingEXT": 5027 - } - }, - { - "Name": "StorageClass", - "Type": "Value", - "Values": - { - "UniformConstant": 0, - "Input": 1, - "Uniform": 2, - "Output": 3, - "Workgroup": 4, - "CrossWorkgroup": 5, - "Private": 6, - "Function": 7, - "Generic": 8, - "PushConstant": 9, - "AtomicCounter": 10, - "Image": 11, - "StorageBuffer": 12 - } - }, - { - "Name": "Dim", - "Type": "Value", - "Values": - { - "Dim1D": 0, - "Dim2D": 1, - "Dim3D": 2, - "Cube": 3, - "Rect": 4, - "Buffer": 5, - "SubpassData": 6 - } - }, - { - "Name": "SamplerAddressingMode", - "Type": "Value", - "Values": - { - "None": 0, - "ClampToEdge": 1, - "Clamp": 2, - "Repeat": 3, - "RepeatMirrored": 4 - } - }, - { - "Name": "SamplerFilterMode", - "Type": "Value", - "Values": - { - "Nearest": 0, - "Linear": 1 - } - }, - { - "Name": "ImageFormat", - "Type": "Value", - "Values": - { - "Unknown": 0, - "Rgba32f": 1, - "Rgba16f": 2, - "R32f": 3, - "Rgba8": 4, - "Rgba8Snorm": 5, - "Rg32f": 6, - "Rg16f": 7, - "R11fG11fB10f": 8, - "R16f": 9, - "Rgba16": 10, - "Rgb10A2": 11, - "Rg16": 12, - "Rg8": 13, - "R16": 14, - "R8": 15, - "Rgba16Snorm": 16, - "Rg16Snorm": 17, - "Rg8Snorm": 18, - "R16Snorm": 19, - "R8Snorm": 20, - "Rgba32i": 21, - "Rgba16i": 22, - "Rgba8i": 23, - "R32i": 24, - "Rg32i": 25, - "Rg16i": 26, - "Rg8i": 27, - "R16i": 28, - "R8i": 29, - "Rgba32ui": 30, - "Rgba16ui": 31, - "Rgba8ui": 32, - "R32ui": 33, - "Rgb10a2ui": 34, - "Rg32ui": 35, - "Rg16ui": 36, - "Rg8ui": 37, - "R16ui": 38, - "R8ui": 39 - } - }, - { - "Name": "ImageChannelOrder", - "Type": "Value", - "Values": - { - "R": 0, - "A": 1, - "RG": 2, - "RA": 3, - "RGB": 4, - "RGBA": 5, - "BGRA": 6, - "ARGB": 7, - "Intensity": 8, - "Luminance": 9, - "Rx": 10, - "RGx": 11, - "RGBx": 12, - "Depth": 13, - "DepthStencil": 14, - "sRGB": 15, - "sRGBx": 16, - "sRGBA": 17, - "sBGRA": 18, - "ABGR": 19 - } - }, - { - "Name": "ImageChannelDataType", - "Type": "Value", - "Values": - { - "SnormInt8": 0, - "SnormInt16": 1, - "UnormInt8": 2, - "UnormInt16": 3, - "UnormShort565": 4, - "UnormShort555": 5, - "UnormInt101010": 6, - "SignedInt8": 7, - "SignedInt16": 8, - "SignedInt32": 9, - "UnsignedInt8": 10, - "UnsignedInt16": 11, - "UnsignedInt32": 12, - "HalfFloat": 13, - "Float": 14, - "UnormInt24": 15, - "UnormInt101010_2": 16 - } - }, - { - "Name": "ImageOperands", - "Type": "Bit", - "Values": - { - "Bias": 0, - "Lod": 1, - "Grad": 2, - "ConstOffset": 3, - "Offset": 4, - "ConstOffsets": 5, - "Sample": 6, - "MinLod": 7 - } - }, - { - "Name": "FPFastMathMode", - "Type": "Bit", - "Values": - { - "NotNaN": 0, - "NotInf": 1, - "NSZ": 2, - "AllowRecip": 3, - "Fast": 4 - } - }, - { - "Name": "FPRoundingMode", - "Type": "Value", - "Values": - { - "RTE": 0, - "RTZ": 1, - "RTP": 2, - "RTN": 3 - } - }, - { - "Name": "LinkageType", - "Type": "Value", - "Values": - { - "Export": 0, - "Import": 1 - } - }, - { - "Name": "AccessQualifier", - "Type": "Value", - "Values": - { - "ReadOnly": 0, - "WriteOnly": 1, - "ReadWrite": 2 - } - }, - { - "Name": "FunctionParameterAttribute", - "Type": "Value", - "Values": - { - "Zext": 0, - "Sext": 1, - "ByVal": 2, - "Sret": 3, - "NoAlias": 4, - "NoCapture": 5, - "NoWrite": 6, - "NoReadWrite": 7 - } - }, - { - "Name": "Decoration", - "Type": "Value", - "Values": - { - "RelaxedPrecision": 0, - "SpecId": 1, - "Block": 2, - "BufferBlock": 3, - "RowMajor": 4, - "ColMajor": 5, - "ArrayStride": 6, - "MatrixStride": 7, - "GLSLShared": 8, - "GLSLPacked": 9, - "CPacked": 10, - "BuiltIn": 11, - "NoPerspective": 13, - "Flat": 14, - "Patch": 15, - "Centroid": 16, - "Sample": 17, - "Invariant": 18, - "Restrict": 19, - "Aliased": 20, - "Volatile": 21, - "Constant": 22, - "Coherent": 23, - "NonWritable": 24, - "NonReadable": 25, - "Uniform": 26, - "SaturatedConversion": 28, - "Stream": 29, - "Location": 30, - "Component": 31, - "Index": 32, - "Binding": 33, - "DescriptorSet": 34, - "Offset": 35, - "XfbBuffer": 36, - "XfbStride": 37, - "FuncParamAttr": 38, - "FPRoundingMode": 39, - "FPFastMathMode": 40, - "LinkageAttributes": 41, - "NoContraction": 42, - "InputAttachmentIndex": 43, - "Alignment": 44, - "MaxByteOffset": 45, - "AlignmentId": 46, - "MaxByteOffsetId": 47, - "ExplicitInterpAMD": 4999, - "OverrideCoverageNV": 5248, - "PassthroughNV": 5250, - "ViewportRelativeNV": 5252, - "SecondaryViewportRelativeNV": 5256, - "HlslCounterBufferGOOGLE": 5634, - "HlslSemanticGOOGLE": 5635 - } - }, - { - "Name": "BuiltIn", - "Type": "Value", - "Values": - { - "Position": 0, - "PointSize": 1, - "ClipDistance": 3, - "CullDistance": 4, - "VertexId": 5, - "InstanceId": 6, - "PrimitiveId": 7, - "InvocationId": 8, - "Layer": 9, - "ViewportIndex": 10, - "TessLevelOuter": 11, - "TessLevelInner": 12, - "TessCoord": 13, - "PatchVertices": 14, - "FragCoord": 15, - "PointCoord": 16, - "FrontFacing": 17, - "SampleId": 18, - "SamplePosition": 19, - "SampleMask": 20, - "FragDepth": 22, - "HelperInvocation": 23, - "NumWorkgroups": 24, - "WorkgroupSize": 25, - "WorkgroupId": 26, - "LocalInvocationId": 27, - "GlobalInvocationId": 28, - "LocalInvocationIndex": 29, - "WorkDim": 30, - "GlobalSize": 31, - "EnqueuedWorkgroupSize": 32, - "GlobalOffset": 33, - "GlobalLinearId": 34, - "SubgroupSize": 36, - "SubgroupMaxSize": 37, - "NumSubgroups": 38, - "NumEnqueuedSubgroups": 39, - "SubgroupId": 40, - "SubgroupLocalInvocationId": 41, - "VertexIndex": 42, - "InstanceIndex": 43, - "SubgroupEqMaskKHR": 4416, - "SubgroupGeMaskKHR": 4417, - "SubgroupGtMaskKHR": 4418, - "SubgroupLeMaskKHR": 4419, - "SubgroupLtMaskKHR": 4420, - "BaseVertex": 4424, - "BaseInstance": 4425, - "DrawIndex": 4426, - "DeviceIndex": 4438, - "ViewIndex": 4440, - "BaryCoordNoPerspAMD": 4992, - "BaryCoordNoPerspCentroidAMD": 4993, - "BaryCoordNoPerspSampleAMD": 4994, - "BaryCoordSmoothAMD": 4995, - "BaryCoordSmoothCentroidAMD": 4996, - "BaryCoordSmoothSampleAMD": 4997, - "BaryCoordPullModelAMD": 4998, - "FragStencilRefEXT": 5014, - "ViewportMaskNV": 5253, - "SecondaryPositionNV": 5257, - "SecondaryViewportMaskNV": 5258, - "PositionPerViewNV": 5261, - "ViewportMaskPerViewNV": 5262 - } - }, - { - "Name": "SelectionControl", - "Type": "Bit", - "Values": - { - "Flatten": 0, - "DontFlatten": 1 - } - }, - { - "Name": "LoopControl", - "Type": "Bit", - "Values": - { - "Unroll": 0, - "DontUnroll": 1, - "DependencyInfinite": 2, - "DependencyLength": 3 - } - }, - { - "Name": "FunctionControl", - "Type": "Bit", - "Values": - { - "Inline": 0, - "DontInline": 1, - "Pure": 2, - "Const": 3 - } - }, - { - "Name": "MemorySemantics", - "Type": "Bit", - "Values": - { - "Acquire": 1, - "Release": 2, - "AcquireRelease": 3, - "SequentiallyConsistent": 4, - "UniformMemory": 6, - "SubgroupMemory": 7, - "WorkgroupMemory": 8, - "CrossWorkgroupMemory": 9, - "AtomicCounterMemory": 10, - "ImageMemory": 11 - } - }, - { - "Name": "MemoryAccess", - "Type": "Bit", - "Values": - { - "Volatile": 0, - "Aligned": 1, - "Nontemporal": 2 - } - }, - { - "Name": "Scope", - "Type": "Value", - "Values": - { - "CrossDevice": 0, - "Device": 1, - "Workgroup": 2, - "Subgroup": 3, - "Invocation": 4 - } - }, - { - "Name": "GroupOperation", - "Type": "Value", - "Values": - { - "Reduce": 0, - "InclusiveScan": 1, - "ExclusiveScan": 2 - } - }, - { - "Name": "KernelEnqueueFlags", - "Type": "Value", - "Values": - { - "NoWait": 0, - "WaitKernel": 1, - "WaitWorkGroup": 2 - } - }, - { - "Name": "KernelProfilingInfo", - "Type": "Bit", - "Values": - { - "CmdExecTime": 0 - } - }, - { - "Name": "Capability", - "Type": "Value", - "Values": - { - "Matrix": 0, - "Shader": 1, - "Geometry": 2, - "Tessellation": 3, - "Addresses": 4, - "Linkage": 5, - "Kernel": 6, - "Vector16": 7, - "Float16Buffer": 8, - "Float16": 9, - "Float64": 10, - "Int64": 11, - "Int64Atomics": 12, - "ImageBasic": 13, - "ImageReadWrite": 14, - "ImageMipmap": 15, - "Pipes": 17, - "Groups": 18, - "DeviceEnqueue": 19, - "LiteralSampler": 20, - "AtomicStorage": 21, - "Int16": 22, - "TessellationPointSize": 23, - "GeometryPointSize": 24, - "ImageGatherExtended": 25, - "StorageImageMultisample": 27, - "UniformBufferArrayDynamicIndexing": 28, - "SampledImageArrayDynamicIndexing": 29, - "StorageBufferArrayDynamicIndexing": 30, - "StorageImageArrayDynamicIndexing": 31, - "ClipDistance": 32, - "CullDistance": 33, - "ImageCubeArray": 34, - "SampleRateShading": 35, - "ImageRect": 36, - "SampledRect": 37, - "GenericPointer": 38, - "Int8": 39, - "InputAttachment": 40, - "SparseResidency": 41, - "MinLod": 42, - "Sampled1D": 43, - "Image1D": 44, - "SampledCubeArray": 45, - "SampledBuffer": 46, - "ImageBuffer": 47, - "ImageMSArray": 48, - "StorageImageExtendedFormats": 49, - "ImageQuery": 50, - "DerivativeControl": 51, - "InterpolationFunction": 52, - "TransformFeedback": 53, - "GeometryStreams": 54, - "StorageImageReadWithoutFormat": 55, - "StorageImageWriteWithoutFormat": 56, - "MultiViewport": 57, - "SubgroupDispatch": 58, - "NamedBarrier": 59, - "PipeStorage": 60, - "SubgroupBallotKHR": 4423, - "DrawParameters": 4427, - "SubgroupVoteKHR": 4431, - "StorageBuffer16BitAccess": 4433, - "StorageUniformBufferBlock16": 4433, - "StorageUniform16": 4434, - "UniformAndStorageBuffer16BitAccess": 4434, - "StoragePushConstant16": 4435, - "StorageInputOutput16": 4436, - "DeviceGroup": 4437, - "MultiView": 4439, - "VariablePointersStorageBuffer": 4441, - "VariablePointers": 4442, - "AtomicStorageOps": 4445, - "SampleMaskPostDepthCoverage": 4447, - "ImageGatherBiasLodAMD": 5009, - "FragmentMaskAMD": 5010, - "StencilExportEXT": 5013, - "ImageReadWriteLodAMD": 5015, - "SampleMaskOverrideCoverageNV": 5249, - "GeometryShaderPassthroughNV": 5251, - "ShaderViewportIndexLayerEXT": 5254, - "ShaderViewportIndexLayerNV": 5254, - "ShaderViewportMaskNV": 5255, - "ShaderStereoViewNV": 5259, - "PerViewAttributesNV": 5260, - "SubgroupShuffleINTEL": 5568, - "SubgroupBufferBlockIOINTEL": 5569, - "SubgroupImageBlockIOINTEL": 5570 - } - }, - { - "Name": "Op", - "Type": "Value", - "Values": - { - "OpNop": 0, - "OpUndef": 1, - "OpSourceContinued": 2, - "OpSource": 3, - "OpSourceExtension": 4, - "OpName": 5, - "OpMemberName": 6, - "OpString": 7, - "OpLine": 8, - "OpExtension": 10, - "OpExtInstImport": 11, - "OpExtInst": 12, - "OpMemoryModel": 14, - "OpEntryPoint": 15, - "OpExecutionMode": 16, - "OpCapability": 17, - "OpTypeVoid": 19, - "OpTypeBool": 20, - "OpTypeInt": 21, - "OpTypeFloat": 22, - "OpTypeVector": 23, - "OpTypeMatrix": 24, - "OpTypeImage": 25, - "OpTypeSampler": 26, - "OpTypeSampledImage": 27, - "OpTypeArray": 28, - "OpTypeRuntimeArray": 29, - "OpTypeStruct": 30, - "OpTypeOpaque": 31, - "OpTypePointer": 32, - "OpTypeFunction": 33, - "OpTypeEvent": 34, - "OpTypeDeviceEvent": 35, - "OpTypeReserveId": 36, - "OpTypeQueue": 37, - "OpTypePipe": 38, - "OpTypeForwardPointer": 39, - "OpConstantTrue": 41, - "OpConstantFalse": 42, - "OpConstant": 43, - "OpConstantComposite": 44, - "OpConstantSampler": 45, - "OpConstantNull": 46, - "OpSpecConstantTrue": 48, - "OpSpecConstantFalse": 49, - "OpSpecConstant": 50, - "OpSpecConstantComposite": 51, - "OpSpecConstantOp": 52, - "OpFunction": 54, - "OpFunctionParameter": 55, - "OpFunctionEnd": 56, - "OpFunctionCall": 57, - "OpVariable": 59, - "OpImageTexelPointer": 60, - "OpLoad": 61, - "OpStore": 62, - "OpCopyMemory": 63, - "OpCopyMemorySized": 64, - "OpAccessChain": 65, - "OpInBoundsAccessChain": 66, - "OpPtrAccessChain": 67, - "OpArrayLength": 68, - "OpGenericPtrMemSemantics": 69, - "OpInBoundsPtrAccessChain": 70, - "OpDecorate": 71, - "OpMemberDecorate": 72, - "OpDecorationGroup": 73, - "OpGroupDecorate": 74, - "OpGroupMemberDecorate": 75, - "OpVectorExtractDynamic": 77, - "OpVectorInsertDynamic": 78, - "OpVectorShuffle": 79, - "OpCompositeConstruct": 80, - "OpCompositeExtract": 81, - "OpCompositeInsert": 82, - "OpCopyObject": 83, - "OpTranspose": 84, - "OpSampledImage": 86, - "OpImageSampleImplicitLod": 87, - "OpImageSampleExplicitLod": 88, - "OpImageSampleDrefImplicitLod": 89, - "OpImageSampleDrefExplicitLod": 90, - "OpImageSampleProjImplicitLod": 91, - "OpImageSampleProjExplicitLod": 92, - "OpImageSampleProjDrefImplicitLod": 93, - "OpImageSampleProjDrefExplicitLod": 94, - "OpImageFetch": 95, - "OpImageGather": 96, - "OpImageDrefGather": 97, - "OpImageRead": 98, - "OpImageWrite": 99, - "OpImage": 100, - "OpImageQueryFormat": 101, - "OpImageQueryOrder": 102, - "OpImageQuerySizeLod": 103, - "OpImageQuerySize": 104, - "OpImageQueryLod": 105, - "OpImageQueryLevels": 106, - "OpImageQuerySamples": 107, - "OpConvertFToU": 109, - "OpConvertFToS": 110, - "OpConvertSToF": 111, - "OpConvertUToF": 112, - "OpUConvert": 113, - "OpSConvert": 114, - "OpFConvert": 115, - "OpQuantizeToF16": 116, - "OpConvertPtrToU": 117, - "OpSatConvertSToU": 118, - "OpSatConvertUToS": 119, - "OpConvertUToPtr": 120, - "OpPtrCastToGeneric": 121, - "OpGenericCastToPtr": 122, - "OpGenericCastToPtrExplicit": 123, - "OpBitcast": 124, - "OpSNegate": 126, - "OpFNegate": 127, - "OpIAdd": 128, - "OpFAdd": 129, - "OpISub": 130, - "OpFSub": 131, - "OpIMul": 132, - "OpFMul": 133, - "OpUDiv": 134, - "OpSDiv": 135, - "OpFDiv": 136, - "OpUMod": 137, - "OpSRem": 138, - "OpSMod": 139, - "OpFRem": 140, - "OpFMod": 141, - "OpVectorTimesScalar": 142, - "OpMatrixTimesScalar": 143, - "OpVectorTimesMatrix": 144, - "OpMatrixTimesVector": 145, - "OpMatrixTimesMatrix": 146, - "OpOuterProduct": 147, - "OpDot": 148, - "OpIAddCarry": 149, - "OpISubBorrow": 150, - "OpUMulExtended": 151, - "OpSMulExtended": 152, - "OpAny": 154, - "OpAll": 155, - "OpIsNan": 156, - "OpIsInf": 157, - "OpIsFinite": 158, - "OpIsNormal": 159, - "OpSignBitSet": 160, - "OpLessOrGreater": 161, - "OpOrdered": 162, - "OpUnordered": 163, - "OpLogicalEqual": 164, - "OpLogicalNotEqual": 165, - "OpLogicalOr": 166, - "OpLogicalAnd": 167, - "OpLogicalNot": 168, - "OpSelect": 169, - "OpIEqual": 170, - "OpINotEqual": 171, - "OpUGreaterThan": 172, - "OpSGreaterThan": 173, - "OpUGreaterThanEqual": 174, - "OpSGreaterThanEqual": 175, - "OpULessThan": 176, - "OpSLessThan": 177, - "OpULessThanEqual": 178, - "OpSLessThanEqual": 179, - "OpFOrdEqual": 180, - "OpFUnordEqual": 181, - "OpFOrdNotEqual": 182, - "OpFUnordNotEqual": 183, - "OpFOrdLessThan": 184, - "OpFUnordLessThan": 185, - "OpFOrdGreaterThan": 186, - "OpFUnordGreaterThan": 187, - "OpFOrdLessThanEqual": 188, - "OpFUnordLessThanEqual": 189, - "OpFOrdGreaterThanEqual": 190, - "OpFUnordGreaterThanEqual": 191, - "OpShiftRightLogical": 194, - "OpShiftRightArithmetic": 195, - "OpShiftLeftLogical": 196, - "OpBitwiseOr": 197, - "OpBitwiseXor": 198, - "OpBitwiseAnd": 199, - "OpNot": 200, - "OpBitFieldInsert": 201, - "OpBitFieldSExtract": 202, - "OpBitFieldUExtract": 203, - "OpBitReverse": 204, - "OpBitCount": 205, - "OpDPdx": 207, - "OpDPdy": 208, - "OpFwidth": 209, - "OpDPdxFine": 210, - "OpDPdyFine": 211, - "OpFwidthFine": 212, - "OpDPdxCoarse": 213, - "OpDPdyCoarse": 214, - "OpFwidthCoarse": 215, - "OpEmitVertex": 218, - "OpEndPrimitive": 219, - "OpEmitStreamVertex": 220, - "OpEndStreamPrimitive": 221, - "OpControlBarrier": 224, - "OpMemoryBarrier": 225, - "OpAtomicLoad": 227, - "OpAtomicStore": 228, - "OpAtomicExchange": 229, - "OpAtomicCompareExchange": 230, - "OpAtomicCompareExchangeWeak": 231, - "OpAtomicIIncrement": 232, - "OpAtomicIDecrement": 233, - "OpAtomicIAdd": 234, - "OpAtomicISub": 235, - "OpAtomicSMin": 236, - "OpAtomicUMin": 237, - "OpAtomicSMax": 238, - "OpAtomicUMax": 239, - "OpAtomicAnd": 240, - "OpAtomicOr": 241, - "OpAtomicXor": 242, - "OpPhi": 245, - "OpLoopMerge": 246, - "OpSelectionMerge": 247, - "OpLabel": 248, - "OpBranch": 249, - "OpBranchConditional": 250, - "OpSwitch": 251, - "OpKill": 252, - "OpReturn": 253, - "OpReturnValue": 254, - "OpUnreachable": 255, - "OpLifetimeStart": 256, - "OpLifetimeStop": 257, - "OpGroupAsyncCopy": 259, - "OpGroupWaitEvents": 260, - "OpGroupAll": 261, - "OpGroupAny": 262, - "OpGroupBroadcast": 263, - "OpGroupIAdd": 264, - "OpGroupFAdd": 265, - "OpGroupFMin": 266, - "OpGroupUMin": 267, - "OpGroupSMin": 268, - "OpGroupFMax": 269, - "OpGroupUMax": 270, - "OpGroupSMax": 271, - "OpReadPipe": 274, - "OpWritePipe": 275, - "OpReservedReadPipe": 276, - "OpReservedWritePipe": 277, - "OpReserveReadPipePackets": 278, - "OpReserveWritePipePackets": 279, - "OpCommitReadPipe": 280, - "OpCommitWritePipe": 281, - "OpIsValidReserveId": 282, - "OpGetNumPipePackets": 283, - "OpGetMaxPipePackets": 284, - "OpGroupReserveReadPipePackets": 285, - "OpGroupReserveWritePipePackets": 286, - "OpGroupCommitReadPipe": 287, - "OpGroupCommitWritePipe": 288, - "OpEnqueueMarker": 291, - "OpEnqueueKernel": 292, - "OpGetKernelNDrangeSubGroupCount": 293, - "OpGetKernelNDrangeMaxSubGroupSize": 294, - "OpGetKernelWorkGroupSize": 295, - "OpGetKernelPreferredWorkGroupSizeMultiple": 296, - "OpRetainEvent": 297, - "OpReleaseEvent": 298, - "OpCreateUserEvent": 299, - "OpIsValidEvent": 300, - "OpSetUserEventStatus": 301, - "OpCaptureEventProfilingInfo": 302, - "OpGetDefaultQueue": 303, - "OpBuildNDRange": 304, - "OpImageSparseSampleImplicitLod": 305, - "OpImageSparseSampleExplicitLod": 306, - "OpImageSparseSampleDrefImplicitLod": 307, - "OpImageSparseSampleDrefExplicitLod": 308, - "OpImageSparseSampleProjImplicitLod": 309, - "OpImageSparseSampleProjExplicitLod": 310, - "OpImageSparseSampleProjDrefImplicitLod": 311, - "OpImageSparseSampleProjDrefExplicitLod": 312, - "OpImageSparseFetch": 313, - "OpImageSparseGather": 314, - "OpImageSparseDrefGather": 315, - "OpImageSparseTexelsResident": 316, - "OpNoLine": 317, - "OpAtomicFlagTestAndSet": 318, - "OpAtomicFlagClear": 319, - "OpImageSparseRead": 320, - "OpSizeOf": 321, - "OpTypePipeStorage": 322, - "OpConstantPipeStorage": 323, - "OpCreatePipeFromPipeStorage": 324, - "OpGetKernelLocalSizeForSubgroupCount": 325, - "OpGetKernelMaxNumSubgroups": 326, - "OpTypeNamedBarrier": 327, - "OpNamedBarrierInitialize": 328, - "OpMemoryNamedBarrier": 329, - "OpModuleProcessed": 330, - "OpExecutionModeId": 331, - "OpDecorateId": 332, - "OpSubgroupBallotKHR": 4421, - "OpSubgroupFirstInvocationKHR": 4422, - "OpSubgroupAllKHR": 4428, - "OpSubgroupAnyKHR": 4429, - "OpSubgroupAllEqualKHR": 4430, - "OpSubgroupReadInvocationKHR": 4432, - "OpGroupIAddNonUniformAMD": 5000, - "OpGroupFAddNonUniformAMD": 5001, - "OpGroupFMinNonUniformAMD": 5002, - "OpGroupUMinNonUniformAMD": 5003, - "OpGroupSMinNonUniformAMD": 5004, - "OpGroupFMaxNonUniformAMD": 5005, - "OpGroupUMaxNonUniformAMD": 5006, - "OpGroupSMaxNonUniformAMD": 5007, - "OpFragmentMaskFetchAMD": 5011, - "OpFragmentFetchAMD": 5012, - "OpSubgroupShuffleINTEL": 5571, - "OpSubgroupShuffleDownINTEL": 5572, - "OpSubgroupShuffleUpINTEL": 5573, - "OpSubgroupShuffleXorINTEL": 5574, - "OpSubgroupBlockReadINTEL": 5575, - "OpSubgroupBlockWriteINTEL": 5576, - "OpSubgroupImageBlockReadINTEL": 5577, - "OpSubgroupImageBlockWriteINTEL": 5578, - "OpDecorateStringGOOGLE": 5632, - "OpMemberDecorateStringGOOGLE": 5633 - } - } - ] - } -} - diff --git a/include/spirv/1.2/spirv.lua b/include/spirv/1.2/spirv.lua deleted file mode 100644 index 0de507d5..00000000 --- a/include/spirv/1.2/spirv.lua +++ /dev/null @@ -1,977 +0,0 @@ --- Copyright (c) 2014-2018 The Khronos Group Inc. --- --- Permission is hereby granted, free of charge, to any person obtaining a copy --- of this software and/or associated documentation files (the "Materials"), --- to deal in the Materials without restriction, including without limitation --- the rights to use, copy, modify, merge, publish, distribute, sublicense, --- and/or sell copies of the Materials, and to permit persons to whom the --- Materials are furnished to do so, subject to the following conditions: --- --- The above copyright notice and this permission notice shall be included in --- all copies or substantial portions of the Materials. --- --- MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS --- STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND --- HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ --- --- THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL --- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING --- FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS --- IN THE MATERIALS. - --- This header is automatically generated by the same tool that creates --- the Binary Section of the SPIR-V specification. - --- Enumeration tokens for SPIR-V, in various styles: --- C, C++, C++11, JSON, Lua, Python --- --- - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL --- - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL --- - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL --- - Lua will use tables, e.g.: spv.SourceLanguage.GLSL --- - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] --- --- Some tokens act like mask values, which can be OR'd together, --- while others are mutually exclusive. The mask-like ones have --- "Mask" in their name, and a parallel enum that has the shift --- amount (1 << x) for each corresponding enumerant. - -spv = { - MagicNumber = 0x07230203, - Version = 0x00010200, - Revision = 2, - OpCodeMask = 0xffff, - WordCountShift = 16, - - SourceLanguage = { - Unknown = 0, - ESSL = 1, - GLSL = 2, - OpenCL_C = 3, - OpenCL_CPP = 4, - HLSL = 5, - }, - - ExecutionModel = { - Vertex = 0, - TessellationControl = 1, - TessellationEvaluation = 2, - Geometry = 3, - Fragment = 4, - GLCompute = 5, - Kernel = 6, - }, - - AddressingModel = { - Logical = 0, - Physical32 = 1, - Physical64 = 2, - }, - - MemoryModel = { - Simple = 0, - GLSL450 = 1, - OpenCL = 2, - }, - - ExecutionMode = { - Invocations = 0, - SpacingEqual = 1, - SpacingFractionalEven = 2, - SpacingFractionalOdd = 3, - VertexOrderCw = 4, - VertexOrderCcw = 5, - PixelCenterInteger = 6, - OriginUpperLeft = 7, - OriginLowerLeft = 8, - EarlyFragmentTests = 9, - PointMode = 10, - Xfb = 11, - DepthReplacing = 12, - DepthGreater = 14, - DepthLess = 15, - DepthUnchanged = 16, - LocalSize = 17, - LocalSizeHint = 18, - InputPoints = 19, - InputLines = 20, - InputLinesAdjacency = 21, - Triangles = 22, - InputTrianglesAdjacency = 23, - Quads = 24, - Isolines = 25, - OutputVertices = 26, - OutputPoints = 27, - OutputLineStrip = 28, - OutputTriangleStrip = 29, - VecTypeHint = 30, - ContractionOff = 31, - Initializer = 33, - Finalizer = 34, - SubgroupSize = 35, - SubgroupsPerWorkgroup = 36, - SubgroupsPerWorkgroupId = 37, - LocalSizeId = 38, - LocalSizeHintId = 39, - PostDepthCoverage = 4446, - StencilRefReplacingEXT = 5027, - }, - - StorageClass = { - UniformConstant = 0, - Input = 1, - Uniform = 2, - Output = 3, - Workgroup = 4, - CrossWorkgroup = 5, - Private = 6, - Function = 7, - Generic = 8, - PushConstant = 9, - AtomicCounter = 10, - Image = 11, - StorageBuffer = 12, - }, - - Dim = { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - Cube = 3, - Rect = 4, - Buffer = 5, - SubpassData = 6, - }, - - SamplerAddressingMode = { - None = 0, - ClampToEdge = 1, - Clamp = 2, - Repeat = 3, - RepeatMirrored = 4, - }, - - SamplerFilterMode = { - Nearest = 0, - Linear = 1, - }, - - ImageFormat = { - Unknown = 0, - Rgba32f = 1, - Rgba16f = 2, - R32f = 3, - Rgba8 = 4, - Rgba8Snorm = 5, - Rg32f = 6, - Rg16f = 7, - R11fG11fB10f = 8, - R16f = 9, - Rgba16 = 10, - Rgb10A2 = 11, - Rg16 = 12, - Rg8 = 13, - R16 = 14, - R8 = 15, - Rgba16Snorm = 16, - Rg16Snorm = 17, - Rg8Snorm = 18, - R16Snorm = 19, - R8Snorm = 20, - Rgba32i = 21, - Rgba16i = 22, - Rgba8i = 23, - R32i = 24, - Rg32i = 25, - Rg16i = 26, - Rg8i = 27, - R16i = 28, - R8i = 29, - Rgba32ui = 30, - Rgba16ui = 31, - Rgba8ui = 32, - R32ui = 33, - Rgb10a2ui = 34, - Rg32ui = 35, - Rg16ui = 36, - Rg8ui = 37, - R16ui = 38, - R8ui = 39, - }, - - ImageChannelOrder = { - R = 0, - A = 1, - RG = 2, - RA = 3, - RGB = 4, - RGBA = 5, - BGRA = 6, - ARGB = 7, - Intensity = 8, - Luminance = 9, - Rx = 10, - RGx = 11, - RGBx = 12, - Depth = 13, - DepthStencil = 14, - sRGB = 15, - sRGBx = 16, - sRGBA = 17, - sBGRA = 18, - ABGR = 19, - }, - - ImageChannelDataType = { - SnormInt8 = 0, - SnormInt16 = 1, - UnormInt8 = 2, - UnormInt16 = 3, - UnormShort565 = 4, - UnormShort555 = 5, - UnormInt101010 = 6, - SignedInt8 = 7, - SignedInt16 = 8, - SignedInt32 = 9, - UnsignedInt8 = 10, - UnsignedInt16 = 11, - UnsignedInt32 = 12, - HalfFloat = 13, - Float = 14, - UnormInt24 = 15, - UnormInt101010_2 = 16, - }, - - ImageOperandsShift = { - Bias = 0, - Lod = 1, - Grad = 2, - ConstOffset = 3, - Offset = 4, - ConstOffsets = 5, - Sample = 6, - MinLod = 7, - }, - - ImageOperandsMask = { - MaskNone = 0, - Bias = 0x00000001, - Lod = 0x00000002, - Grad = 0x00000004, - ConstOffset = 0x00000008, - Offset = 0x00000010, - ConstOffsets = 0x00000020, - Sample = 0x00000040, - MinLod = 0x00000080, - }, - - FPFastMathModeShift = { - NotNaN = 0, - NotInf = 1, - NSZ = 2, - AllowRecip = 3, - Fast = 4, - }, - - FPFastMathModeMask = { - MaskNone = 0, - NotNaN = 0x00000001, - NotInf = 0x00000002, - NSZ = 0x00000004, - AllowRecip = 0x00000008, - Fast = 0x00000010, - }, - - FPRoundingMode = { - RTE = 0, - RTZ = 1, - RTP = 2, - RTN = 3, - }, - - LinkageType = { - Export = 0, - Import = 1, - }, - - AccessQualifier = { - ReadOnly = 0, - WriteOnly = 1, - ReadWrite = 2, - }, - - FunctionParameterAttribute = { - Zext = 0, - Sext = 1, - ByVal = 2, - Sret = 3, - NoAlias = 4, - NoCapture = 5, - NoWrite = 6, - NoReadWrite = 7, - }, - - Decoration = { - RelaxedPrecision = 0, - SpecId = 1, - Block = 2, - BufferBlock = 3, - RowMajor = 4, - ColMajor = 5, - ArrayStride = 6, - MatrixStride = 7, - GLSLShared = 8, - GLSLPacked = 9, - CPacked = 10, - BuiltIn = 11, - NoPerspective = 13, - Flat = 14, - Patch = 15, - Centroid = 16, - Sample = 17, - Invariant = 18, - Restrict = 19, - Aliased = 20, - Volatile = 21, - Constant = 22, - Coherent = 23, - NonWritable = 24, - NonReadable = 25, - Uniform = 26, - SaturatedConversion = 28, - Stream = 29, - Location = 30, - Component = 31, - Index = 32, - Binding = 33, - DescriptorSet = 34, - Offset = 35, - XfbBuffer = 36, - XfbStride = 37, - FuncParamAttr = 38, - FPRoundingMode = 39, - FPFastMathMode = 40, - LinkageAttributes = 41, - NoContraction = 42, - InputAttachmentIndex = 43, - Alignment = 44, - MaxByteOffset = 45, - AlignmentId = 46, - MaxByteOffsetId = 47, - ExplicitInterpAMD = 4999, - OverrideCoverageNV = 5248, - PassthroughNV = 5250, - ViewportRelativeNV = 5252, - SecondaryViewportRelativeNV = 5256, - HlslCounterBufferGOOGLE = 5634, - HlslSemanticGOOGLE = 5635, - }, - - BuiltIn = { - Position = 0, - PointSize = 1, - ClipDistance = 3, - CullDistance = 4, - VertexId = 5, - InstanceId = 6, - PrimitiveId = 7, - InvocationId = 8, - Layer = 9, - ViewportIndex = 10, - TessLevelOuter = 11, - TessLevelInner = 12, - TessCoord = 13, - PatchVertices = 14, - FragCoord = 15, - PointCoord = 16, - FrontFacing = 17, - SampleId = 18, - SamplePosition = 19, - SampleMask = 20, - FragDepth = 22, - HelperInvocation = 23, - NumWorkgroups = 24, - WorkgroupSize = 25, - WorkgroupId = 26, - LocalInvocationId = 27, - GlobalInvocationId = 28, - LocalInvocationIndex = 29, - WorkDim = 30, - GlobalSize = 31, - EnqueuedWorkgroupSize = 32, - GlobalOffset = 33, - GlobalLinearId = 34, - SubgroupSize = 36, - SubgroupMaxSize = 37, - NumSubgroups = 38, - NumEnqueuedSubgroups = 39, - SubgroupId = 40, - SubgroupLocalInvocationId = 41, - VertexIndex = 42, - InstanceIndex = 43, - SubgroupEqMaskKHR = 4416, - SubgroupGeMaskKHR = 4417, - SubgroupGtMaskKHR = 4418, - SubgroupLeMaskKHR = 4419, - SubgroupLtMaskKHR = 4420, - BaseVertex = 4424, - BaseInstance = 4425, - DrawIndex = 4426, - DeviceIndex = 4438, - ViewIndex = 4440, - BaryCoordNoPerspAMD = 4992, - BaryCoordNoPerspCentroidAMD = 4993, - BaryCoordNoPerspSampleAMD = 4994, - BaryCoordSmoothAMD = 4995, - BaryCoordSmoothCentroidAMD = 4996, - BaryCoordSmoothSampleAMD = 4997, - BaryCoordPullModelAMD = 4998, - FragStencilRefEXT = 5014, - ViewportMaskNV = 5253, - SecondaryPositionNV = 5257, - SecondaryViewportMaskNV = 5258, - PositionPerViewNV = 5261, - ViewportMaskPerViewNV = 5262, - }, - - SelectionControlShift = { - Flatten = 0, - DontFlatten = 1, - }, - - SelectionControlMask = { - MaskNone = 0, - Flatten = 0x00000001, - DontFlatten = 0x00000002, - }, - - LoopControlShift = { - Unroll = 0, - DontUnroll = 1, - DependencyInfinite = 2, - DependencyLength = 3, - }, - - LoopControlMask = { - MaskNone = 0, - Unroll = 0x00000001, - DontUnroll = 0x00000002, - DependencyInfinite = 0x00000004, - DependencyLength = 0x00000008, - }, - - FunctionControlShift = { - Inline = 0, - DontInline = 1, - Pure = 2, - Const = 3, - }, - - FunctionControlMask = { - MaskNone = 0, - Inline = 0x00000001, - DontInline = 0x00000002, - Pure = 0x00000004, - Const = 0x00000008, - }, - - MemorySemanticsShift = { - Acquire = 1, - Release = 2, - AcquireRelease = 3, - SequentiallyConsistent = 4, - UniformMemory = 6, - SubgroupMemory = 7, - WorkgroupMemory = 8, - CrossWorkgroupMemory = 9, - AtomicCounterMemory = 10, - ImageMemory = 11, - }, - - MemorySemanticsMask = { - MaskNone = 0, - Acquire = 0x00000002, - Release = 0x00000004, - AcquireRelease = 0x00000008, - SequentiallyConsistent = 0x00000010, - UniformMemory = 0x00000040, - SubgroupMemory = 0x00000080, - WorkgroupMemory = 0x00000100, - CrossWorkgroupMemory = 0x00000200, - AtomicCounterMemory = 0x00000400, - ImageMemory = 0x00000800, - }, - - MemoryAccessShift = { - Volatile = 0, - Aligned = 1, - Nontemporal = 2, - }, - - MemoryAccessMask = { - MaskNone = 0, - Volatile = 0x00000001, - Aligned = 0x00000002, - Nontemporal = 0x00000004, - }, - - Scope = { - CrossDevice = 0, - Device = 1, - Workgroup = 2, - Subgroup = 3, - Invocation = 4, - }, - - GroupOperation = { - Reduce = 0, - InclusiveScan = 1, - ExclusiveScan = 2, - }, - - KernelEnqueueFlags = { - NoWait = 0, - WaitKernel = 1, - WaitWorkGroup = 2, - }, - - KernelProfilingInfoShift = { - CmdExecTime = 0, - }, - - KernelProfilingInfoMask = { - MaskNone = 0, - CmdExecTime = 0x00000001, - }, - - Capability = { - Matrix = 0, - Shader = 1, - Geometry = 2, - Tessellation = 3, - Addresses = 4, - Linkage = 5, - Kernel = 6, - Vector16 = 7, - Float16Buffer = 8, - Float16 = 9, - Float64 = 10, - Int64 = 11, - Int64Atomics = 12, - ImageBasic = 13, - ImageReadWrite = 14, - ImageMipmap = 15, - Pipes = 17, - Groups = 18, - DeviceEnqueue = 19, - LiteralSampler = 20, - AtomicStorage = 21, - Int16 = 22, - TessellationPointSize = 23, - GeometryPointSize = 24, - ImageGatherExtended = 25, - StorageImageMultisample = 27, - UniformBufferArrayDynamicIndexing = 28, - SampledImageArrayDynamicIndexing = 29, - StorageBufferArrayDynamicIndexing = 30, - StorageImageArrayDynamicIndexing = 31, - ClipDistance = 32, - CullDistance = 33, - ImageCubeArray = 34, - SampleRateShading = 35, - ImageRect = 36, - SampledRect = 37, - GenericPointer = 38, - Int8 = 39, - InputAttachment = 40, - SparseResidency = 41, - MinLod = 42, - Sampled1D = 43, - Image1D = 44, - SampledCubeArray = 45, - SampledBuffer = 46, - ImageBuffer = 47, - ImageMSArray = 48, - StorageImageExtendedFormats = 49, - ImageQuery = 50, - DerivativeControl = 51, - InterpolationFunction = 52, - TransformFeedback = 53, - GeometryStreams = 54, - StorageImageReadWithoutFormat = 55, - StorageImageWriteWithoutFormat = 56, - MultiViewport = 57, - SubgroupDispatch = 58, - NamedBarrier = 59, - PipeStorage = 60, - SubgroupBallotKHR = 4423, - DrawParameters = 4427, - SubgroupVoteKHR = 4431, - StorageBuffer16BitAccess = 4433, - StorageUniformBufferBlock16 = 4433, - StorageUniform16 = 4434, - UniformAndStorageBuffer16BitAccess = 4434, - StoragePushConstant16 = 4435, - StorageInputOutput16 = 4436, - DeviceGroup = 4437, - MultiView = 4439, - VariablePointersStorageBuffer = 4441, - VariablePointers = 4442, - AtomicStorageOps = 4445, - SampleMaskPostDepthCoverage = 4447, - ImageGatherBiasLodAMD = 5009, - FragmentMaskAMD = 5010, - StencilExportEXT = 5013, - ImageReadWriteLodAMD = 5015, - SampleMaskOverrideCoverageNV = 5249, - GeometryShaderPassthroughNV = 5251, - ShaderViewportIndexLayerEXT = 5254, - ShaderViewportIndexLayerNV = 5254, - ShaderViewportMaskNV = 5255, - ShaderStereoViewNV = 5259, - PerViewAttributesNV = 5260, - SubgroupShuffleINTEL = 5568, - SubgroupBufferBlockIOINTEL = 5569, - SubgroupImageBlockIOINTEL = 5570, - }, - - Op = { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, - OpImageSparseRead = 320, - OpSizeOf = 321, - OpTypePipeStorage = 322, - OpConstantPipeStorage = 323, - OpCreatePipeFromPipeStorage = 324, - OpGetKernelLocalSizeForSubgroupCount = 325, - OpGetKernelMaxNumSubgroups = 326, - OpTypeNamedBarrier = 327, - OpNamedBarrierInitialize = 328, - OpMemoryNamedBarrier = 329, - OpModuleProcessed = 330, - OpExecutionModeId = 331, - OpDecorateId = 332, - OpSubgroupBallotKHR = 4421, - OpSubgroupFirstInvocationKHR = 4422, - OpSubgroupAllKHR = 4428, - OpSubgroupAnyKHR = 4429, - OpSubgroupAllEqualKHR = 4430, - OpSubgroupReadInvocationKHR = 4432, - OpGroupIAddNonUniformAMD = 5000, - OpGroupFAddNonUniformAMD = 5001, - OpGroupFMinNonUniformAMD = 5002, - OpGroupUMinNonUniformAMD = 5003, - OpGroupSMinNonUniformAMD = 5004, - OpGroupFMaxNonUniformAMD = 5005, - OpGroupUMaxNonUniformAMD = 5006, - OpGroupSMaxNonUniformAMD = 5007, - OpFragmentMaskFetchAMD = 5011, - OpFragmentFetchAMD = 5012, - OpSubgroupShuffleINTEL = 5571, - OpSubgroupShuffleDownINTEL = 5572, - OpSubgroupShuffleUpINTEL = 5573, - OpSubgroupShuffleXorINTEL = 5574, - OpSubgroupBlockReadINTEL = 5575, - OpSubgroupBlockWriteINTEL = 5576, - OpSubgroupImageBlockReadINTEL = 5577, - OpSubgroupImageBlockWriteINTEL = 5578, - OpDecorateStringGOOGLE = 5632, - OpMemberDecorateStringGOOGLE = 5633, - }, - -} - diff --git a/include/spirv/1.2/spirv.py b/include/spirv/1.2/spirv.py deleted file mode 100644 index cefee4d6..00000000 --- a/include/spirv/1.2/spirv.py +++ /dev/null @@ -1,977 +0,0 @@ -# Copyright (c) 2014-2018 The Khronos Group Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and/or associated documentation files (the "Materials"), -# to deal in the Materials without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Materials, and to permit persons to whom the -# Materials are furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Materials. -# -# MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -# STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -# HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -# -# THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -# IN THE MATERIALS. - -# This header is automatically generated by the same tool that creates -# the Binary Section of the SPIR-V specification. - -# Enumeration tokens for SPIR-V, in various styles: -# C, C++, C++11, JSON, Lua, Python -# -# - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -# - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -# - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -# - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -# - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -# -# Some tokens act like mask values, which can be OR'd together, -# while others are mutually exclusive. The mask-like ones have -# "Mask" in their name, and a parallel enum that has the shift -# amount (1 << x) for each corresponding enumerant. - -spv = { - 'MagicNumber' : 0x07230203, - 'Version' : 0x00010200, - 'Revision' : 2, - 'OpCodeMask' : 0xffff, - 'WordCountShift' : 16, - - 'SourceLanguage' : { - 'Unknown' : 0, - 'ESSL' : 1, - 'GLSL' : 2, - 'OpenCL_C' : 3, - 'OpenCL_CPP' : 4, - 'HLSL' : 5, - }, - - 'ExecutionModel' : { - 'Vertex' : 0, - 'TessellationControl' : 1, - 'TessellationEvaluation' : 2, - 'Geometry' : 3, - 'Fragment' : 4, - 'GLCompute' : 5, - 'Kernel' : 6, - }, - - 'AddressingModel' : { - 'Logical' : 0, - 'Physical32' : 1, - 'Physical64' : 2, - }, - - 'MemoryModel' : { - 'Simple' : 0, - 'GLSL450' : 1, - 'OpenCL' : 2, - }, - - 'ExecutionMode' : { - 'Invocations' : 0, - 'SpacingEqual' : 1, - 'SpacingFractionalEven' : 2, - 'SpacingFractionalOdd' : 3, - 'VertexOrderCw' : 4, - 'VertexOrderCcw' : 5, - 'PixelCenterInteger' : 6, - 'OriginUpperLeft' : 7, - 'OriginLowerLeft' : 8, - 'EarlyFragmentTests' : 9, - 'PointMode' : 10, - 'Xfb' : 11, - 'DepthReplacing' : 12, - 'DepthGreater' : 14, - 'DepthLess' : 15, - 'DepthUnchanged' : 16, - 'LocalSize' : 17, - 'LocalSizeHint' : 18, - 'InputPoints' : 19, - 'InputLines' : 20, - 'InputLinesAdjacency' : 21, - 'Triangles' : 22, - 'InputTrianglesAdjacency' : 23, - 'Quads' : 24, - 'Isolines' : 25, - 'OutputVertices' : 26, - 'OutputPoints' : 27, - 'OutputLineStrip' : 28, - 'OutputTriangleStrip' : 29, - 'VecTypeHint' : 30, - 'ContractionOff' : 31, - 'Initializer' : 33, - 'Finalizer' : 34, - 'SubgroupSize' : 35, - 'SubgroupsPerWorkgroup' : 36, - 'SubgroupsPerWorkgroupId' : 37, - 'LocalSizeId' : 38, - 'LocalSizeHintId' : 39, - 'PostDepthCoverage' : 4446, - 'StencilRefReplacingEXT' : 5027, - }, - - 'StorageClass' : { - 'UniformConstant' : 0, - 'Input' : 1, - 'Uniform' : 2, - 'Output' : 3, - 'Workgroup' : 4, - 'CrossWorkgroup' : 5, - 'Private' : 6, - 'Function' : 7, - 'Generic' : 8, - 'PushConstant' : 9, - 'AtomicCounter' : 10, - 'Image' : 11, - 'StorageBuffer' : 12, - }, - - 'Dim' : { - 'Dim1D' : 0, - 'Dim2D' : 1, - 'Dim3D' : 2, - 'Cube' : 3, - 'Rect' : 4, - 'Buffer' : 5, - 'SubpassData' : 6, - }, - - 'SamplerAddressingMode' : { - 'None' : 0, - 'ClampToEdge' : 1, - 'Clamp' : 2, - 'Repeat' : 3, - 'RepeatMirrored' : 4, - }, - - 'SamplerFilterMode' : { - 'Nearest' : 0, - 'Linear' : 1, - }, - - 'ImageFormat' : { - 'Unknown' : 0, - 'Rgba32f' : 1, - 'Rgba16f' : 2, - 'R32f' : 3, - 'Rgba8' : 4, - 'Rgba8Snorm' : 5, - 'Rg32f' : 6, - 'Rg16f' : 7, - 'R11fG11fB10f' : 8, - 'R16f' : 9, - 'Rgba16' : 10, - 'Rgb10A2' : 11, - 'Rg16' : 12, - 'Rg8' : 13, - 'R16' : 14, - 'R8' : 15, - 'Rgba16Snorm' : 16, - 'Rg16Snorm' : 17, - 'Rg8Snorm' : 18, - 'R16Snorm' : 19, - 'R8Snorm' : 20, - 'Rgba32i' : 21, - 'Rgba16i' : 22, - 'Rgba8i' : 23, - 'R32i' : 24, - 'Rg32i' : 25, - 'Rg16i' : 26, - 'Rg8i' : 27, - 'R16i' : 28, - 'R8i' : 29, - 'Rgba32ui' : 30, - 'Rgba16ui' : 31, - 'Rgba8ui' : 32, - 'R32ui' : 33, - 'Rgb10a2ui' : 34, - 'Rg32ui' : 35, - 'Rg16ui' : 36, - 'Rg8ui' : 37, - 'R16ui' : 38, - 'R8ui' : 39, - }, - - 'ImageChannelOrder' : { - 'R' : 0, - 'A' : 1, - 'RG' : 2, - 'RA' : 3, - 'RGB' : 4, - 'RGBA' : 5, - 'BGRA' : 6, - 'ARGB' : 7, - 'Intensity' : 8, - 'Luminance' : 9, - 'Rx' : 10, - 'RGx' : 11, - 'RGBx' : 12, - 'Depth' : 13, - 'DepthStencil' : 14, - 'sRGB' : 15, - 'sRGBx' : 16, - 'sRGBA' : 17, - 'sBGRA' : 18, - 'ABGR' : 19, - }, - - 'ImageChannelDataType' : { - 'SnormInt8' : 0, - 'SnormInt16' : 1, - 'UnormInt8' : 2, - 'UnormInt16' : 3, - 'UnormShort565' : 4, - 'UnormShort555' : 5, - 'UnormInt101010' : 6, - 'SignedInt8' : 7, - 'SignedInt16' : 8, - 'SignedInt32' : 9, - 'UnsignedInt8' : 10, - 'UnsignedInt16' : 11, - 'UnsignedInt32' : 12, - 'HalfFloat' : 13, - 'Float' : 14, - 'UnormInt24' : 15, - 'UnormInt101010_2' : 16, - }, - - 'ImageOperandsShift' : { - 'Bias' : 0, - 'Lod' : 1, - 'Grad' : 2, - 'ConstOffset' : 3, - 'Offset' : 4, - 'ConstOffsets' : 5, - 'Sample' : 6, - 'MinLod' : 7, - }, - - 'ImageOperandsMask' : { - 'MaskNone' : 0, - 'Bias' : 0x00000001, - 'Lod' : 0x00000002, - 'Grad' : 0x00000004, - 'ConstOffset' : 0x00000008, - 'Offset' : 0x00000010, - 'ConstOffsets' : 0x00000020, - 'Sample' : 0x00000040, - 'MinLod' : 0x00000080, - }, - - 'FPFastMathModeShift' : { - 'NotNaN' : 0, - 'NotInf' : 1, - 'NSZ' : 2, - 'AllowRecip' : 3, - 'Fast' : 4, - }, - - 'FPFastMathModeMask' : { - 'MaskNone' : 0, - 'NotNaN' : 0x00000001, - 'NotInf' : 0x00000002, - 'NSZ' : 0x00000004, - 'AllowRecip' : 0x00000008, - 'Fast' : 0x00000010, - }, - - 'FPRoundingMode' : { - 'RTE' : 0, - 'RTZ' : 1, - 'RTP' : 2, - 'RTN' : 3, - }, - - 'LinkageType' : { - 'Export' : 0, - 'Import' : 1, - }, - - 'AccessQualifier' : { - 'ReadOnly' : 0, - 'WriteOnly' : 1, - 'ReadWrite' : 2, - }, - - 'FunctionParameterAttribute' : { - 'Zext' : 0, - 'Sext' : 1, - 'ByVal' : 2, - 'Sret' : 3, - 'NoAlias' : 4, - 'NoCapture' : 5, - 'NoWrite' : 6, - 'NoReadWrite' : 7, - }, - - 'Decoration' : { - 'RelaxedPrecision' : 0, - 'SpecId' : 1, - 'Block' : 2, - 'BufferBlock' : 3, - 'RowMajor' : 4, - 'ColMajor' : 5, - 'ArrayStride' : 6, - 'MatrixStride' : 7, - 'GLSLShared' : 8, - 'GLSLPacked' : 9, - 'CPacked' : 10, - 'BuiltIn' : 11, - 'NoPerspective' : 13, - 'Flat' : 14, - 'Patch' : 15, - 'Centroid' : 16, - 'Sample' : 17, - 'Invariant' : 18, - 'Restrict' : 19, - 'Aliased' : 20, - 'Volatile' : 21, - 'Constant' : 22, - 'Coherent' : 23, - 'NonWritable' : 24, - 'NonReadable' : 25, - 'Uniform' : 26, - 'SaturatedConversion' : 28, - 'Stream' : 29, - 'Location' : 30, - 'Component' : 31, - 'Index' : 32, - 'Binding' : 33, - 'DescriptorSet' : 34, - 'Offset' : 35, - 'XfbBuffer' : 36, - 'XfbStride' : 37, - 'FuncParamAttr' : 38, - 'FPRoundingMode' : 39, - 'FPFastMathMode' : 40, - 'LinkageAttributes' : 41, - 'NoContraction' : 42, - 'InputAttachmentIndex' : 43, - 'Alignment' : 44, - 'MaxByteOffset' : 45, - 'AlignmentId' : 46, - 'MaxByteOffsetId' : 47, - 'ExplicitInterpAMD' : 4999, - 'OverrideCoverageNV' : 5248, - 'PassthroughNV' : 5250, - 'ViewportRelativeNV' : 5252, - 'SecondaryViewportRelativeNV' : 5256, - 'HlslCounterBufferGOOGLE' : 5634, - 'HlslSemanticGOOGLE' : 5635, - }, - - 'BuiltIn' : { - 'Position' : 0, - 'PointSize' : 1, - 'ClipDistance' : 3, - 'CullDistance' : 4, - 'VertexId' : 5, - 'InstanceId' : 6, - 'PrimitiveId' : 7, - 'InvocationId' : 8, - 'Layer' : 9, - 'ViewportIndex' : 10, - 'TessLevelOuter' : 11, - 'TessLevelInner' : 12, - 'TessCoord' : 13, - 'PatchVertices' : 14, - 'FragCoord' : 15, - 'PointCoord' : 16, - 'FrontFacing' : 17, - 'SampleId' : 18, - 'SamplePosition' : 19, - 'SampleMask' : 20, - 'FragDepth' : 22, - 'HelperInvocation' : 23, - 'NumWorkgroups' : 24, - 'WorkgroupSize' : 25, - 'WorkgroupId' : 26, - 'LocalInvocationId' : 27, - 'GlobalInvocationId' : 28, - 'LocalInvocationIndex' : 29, - 'WorkDim' : 30, - 'GlobalSize' : 31, - 'EnqueuedWorkgroupSize' : 32, - 'GlobalOffset' : 33, - 'GlobalLinearId' : 34, - 'SubgroupSize' : 36, - 'SubgroupMaxSize' : 37, - 'NumSubgroups' : 38, - 'NumEnqueuedSubgroups' : 39, - 'SubgroupId' : 40, - 'SubgroupLocalInvocationId' : 41, - 'VertexIndex' : 42, - 'InstanceIndex' : 43, - 'SubgroupEqMaskKHR' : 4416, - 'SubgroupGeMaskKHR' : 4417, - 'SubgroupGtMaskKHR' : 4418, - 'SubgroupLeMaskKHR' : 4419, - 'SubgroupLtMaskKHR' : 4420, - 'BaseVertex' : 4424, - 'BaseInstance' : 4425, - 'DrawIndex' : 4426, - 'DeviceIndex' : 4438, - 'ViewIndex' : 4440, - 'BaryCoordNoPerspAMD' : 4992, - 'BaryCoordNoPerspCentroidAMD' : 4993, - 'BaryCoordNoPerspSampleAMD' : 4994, - 'BaryCoordSmoothAMD' : 4995, - 'BaryCoordSmoothCentroidAMD' : 4996, - 'BaryCoordSmoothSampleAMD' : 4997, - 'BaryCoordPullModelAMD' : 4998, - 'FragStencilRefEXT' : 5014, - 'ViewportMaskNV' : 5253, - 'SecondaryPositionNV' : 5257, - 'SecondaryViewportMaskNV' : 5258, - 'PositionPerViewNV' : 5261, - 'ViewportMaskPerViewNV' : 5262, - }, - - 'SelectionControlShift' : { - 'Flatten' : 0, - 'DontFlatten' : 1, - }, - - 'SelectionControlMask' : { - 'MaskNone' : 0, - 'Flatten' : 0x00000001, - 'DontFlatten' : 0x00000002, - }, - - 'LoopControlShift' : { - 'Unroll' : 0, - 'DontUnroll' : 1, - 'DependencyInfinite' : 2, - 'DependencyLength' : 3, - }, - - 'LoopControlMask' : { - 'MaskNone' : 0, - 'Unroll' : 0x00000001, - 'DontUnroll' : 0x00000002, - 'DependencyInfinite' : 0x00000004, - 'DependencyLength' : 0x00000008, - }, - - 'FunctionControlShift' : { - 'Inline' : 0, - 'DontInline' : 1, - 'Pure' : 2, - 'Const' : 3, - }, - - 'FunctionControlMask' : { - 'MaskNone' : 0, - 'Inline' : 0x00000001, - 'DontInline' : 0x00000002, - 'Pure' : 0x00000004, - 'Const' : 0x00000008, - }, - - 'MemorySemanticsShift' : { - 'Acquire' : 1, - 'Release' : 2, - 'AcquireRelease' : 3, - 'SequentiallyConsistent' : 4, - 'UniformMemory' : 6, - 'SubgroupMemory' : 7, - 'WorkgroupMemory' : 8, - 'CrossWorkgroupMemory' : 9, - 'AtomicCounterMemory' : 10, - 'ImageMemory' : 11, - }, - - 'MemorySemanticsMask' : { - 'MaskNone' : 0, - 'Acquire' : 0x00000002, - 'Release' : 0x00000004, - 'AcquireRelease' : 0x00000008, - 'SequentiallyConsistent' : 0x00000010, - 'UniformMemory' : 0x00000040, - 'SubgroupMemory' : 0x00000080, - 'WorkgroupMemory' : 0x00000100, - 'CrossWorkgroupMemory' : 0x00000200, - 'AtomicCounterMemory' : 0x00000400, - 'ImageMemory' : 0x00000800, - }, - - 'MemoryAccessShift' : { - 'Volatile' : 0, - 'Aligned' : 1, - 'Nontemporal' : 2, - }, - - 'MemoryAccessMask' : { - 'MaskNone' : 0, - 'Volatile' : 0x00000001, - 'Aligned' : 0x00000002, - 'Nontemporal' : 0x00000004, - }, - - 'Scope' : { - 'CrossDevice' : 0, - 'Device' : 1, - 'Workgroup' : 2, - 'Subgroup' : 3, - 'Invocation' : 4, - }, - - 'GroupOperation' : { - 'Reduce' : 0, - 'InclusiveScan' : 1, - 'ExclusiveScan' : 2, - }, - - 'KernelEnqueueFlags' : { - 'NoWait' : 0, - 'WaitKernel' : 1, - 'WaitWorkGroup' : 2, - }, - - 'KernelProfilingInfoShift' : { - 'CmdExecTime' : 0, - }, - - 'KernelProfilingInfoMask' : { - 'MaskNone' : 0, - 'CmdExecTime' : 0x00000001, - }, - - 'Capability' : { - 'Matrix' : 0, - 'Shader' : 1, - 'Geometry' : 2, - 'Tessellation' : 3, - 'Addresses' : 4, - 'Linkage' : 5, - 'Kernel' : 6, - 'Vector16' : 7, - 'Float16Buffer' : 8, - 'Float16' : 9, - 'Float64' : 10, - 'Int64' : 11, - 'Int64Atomics' : 12, - 'ImageBasic' : 13, - 'ImageReadWrite' : 14, - 'ImageMipmap' : 15, - 'Pipes' : 17, - 'Groups' : 18, - 'DeviceEnqueue' : 19, - 'LiteralSampler' : 20, - 'AtomicStorage' : 21, - 'Int16' : 22, - 'TessellationPointSize' : 23, - 'GeometryPointSize' : 24, - 'ImageGatherExtended' : 25, - 'StorageImageMultisample' : 27, - 'UniformBufferArrayDynamicIndexing' : 28, - 'SampledImageArrayDynamicIndexing' : 29, - 'StorageBufferArrayDynamicIndexing' : 30, - 'StorageImageArrayDynamicIndexing' : 31, - 'ClipDistance' : 32, - 'CullDistance' : 33, - 'ImageCubeArray' : 34, - 'SampleRateShading' : 35, - 'ImageRect' : 36, - 'SampledRect' : 37, - 'GenericPointer' : 38, - 'Int8' : 39, - 'InputAttachment' : 40, - 'SparseResidency' : 41, - 'MinLod' : 42, - 'Sampled1D' : 43, - 'Image1D' : 44, - 'SampledCubeArray' : 45, - 'SampledBuffer' : 46, - 'ImageBuffer' : 47, - 'ImageMSArray' : 48, - 'StorageImageExtendedFormats' : 49, - 'ImageQuery' : 50, - 'DerivativeControl' : 51, - 'InterpolationFunction' : 52, - 'TransformFeedback' : 53, - 'GeometryStreams' : 54, - 'StorageImageReadWithoutFormat' : 55, - 'StorageImageWriteWithoutFormat' : 56, - 'MultiViewport' : 57, - 'SubgroupDispatch' : 58, - 'NamedBarrier' : 59, - 'PipeStorage' : 60, - 'SubgroupBallotKHR' : 4423, - 'DrawParameters' : 4427, - 'SubgroupVoteKHR' : 4431, - 'StorageBuffer16BitAccess' : 4433, - 'StorageUniformBufferBlock16' : 4433, - 'StorageUniform16' : 4434, - 'UniformAndStorageBuffer16BitAccess' : 4434, - 'StoragePushConstant16' : 4435, - 'StorageInputOutput16' : 4436, - 'DeviceGroup' : 4437, - 'MultiView' : 4439, - 'VariablePointersStorageBuffer' : 4441, - 'VariablePointers' : 4442, - 'AtomicStorageOps' : 4445, - 'SampleMaskPostDepthCoverage' : 4447, - 'ImageGatherBiasLodAMD' : 5009, - 'FragmentMaskAMD' : 5010, - 'StencilExportEXT' : 5013, - 'ImageReadWriteLodAMD' : 5015, - 'SampleMaskOverrideCoverageNV' : 5249, - 'GeometryShaderPassthroughNV' : 5251, - 'ShaderViewportIndexLayerEXT' : 5254, - 'ShaderViewportIndexLayerNV' : 5254, - 'ShaderViewportMaskNV' : 5255, - 'ShaderStereoViewNV' : 5259, - 'PerViewAttributesNV' : 5260, - 'SubgroupShuffleINTEL' : 5568, - 'SubgroupBufferBlockIOINTEL' : 5569, - 'SubgroupImageBlockIOINTEL' : 5570, - }, - - 'Op' : { - 'OpNop' : 0, - 'OpUndef' : 1, - 'OpSourceContinued' : 2, - 'OpSource' : 3, - 'OpSourceExtension' : 4, - 'OpName' : 5, - 'OpMemberName' : 6, - 'OpString' : 7, - 'OpLine' : 8, - 'OpExtension' : 10, - 'OpExtInstImport' : 11, - 'OpExtInst' : 12, - 'OpMemoryModel' : 14, - 'OpEntryPoint' : 15, - 'OpExecutionMode' : 16, - 'OpCapability' : 17, - 'OpTypeVoid' : 19, - 'OpTypeBool' : 20, - 'OpTypeInt' : 21, - 'OpTypeFloat' : 22, - 'OpTypeVector' : 23, - 'OpTypeMatrix' : 24, - 'OpTypeImage' : 25, - 'OpTypeSampler' : 26, - 'OpTypeSampledImage' : 27, - 'OpTypeArray' : 28, - 'OpTypeRuntimeArray' : 29, - 'OpTypeStruct' : 30, - 'OpTypeOpaque' : 31, - 'OpTypePointer' : 32, - 'OpTypeFunction' : 33, - 'OpTypeEvent' : 34, - 'OpTypeDeviceEvent' : 35, - 'OpTypeReserveId' : 36, - 'OpTypeQueue' : 37, - 'OpTypePipe' : 38, - 'OpTypeForwardPointer' : 39, - 'OpConstantTrue' : 41, - 'OpConstantFalse' : 42, - 'OpConstant' : 43, - 'OpConstantComposite' : 44, - 'OpConstantSampler' : 45, - 'OpConstantNull' : 46, - 'OpSpecConstantTrue' : 48, - 'OpSpecConstantFalse' : 49, - 'OpSpecConstant' : 50, - 'OpSpecConstantComposite' : 51, - 'OpSpecConstantOp' : 52, - 'OpFunction' : 54, - 'OpFunctionParameter' : 55, - 'OpFunctionEnd' : 56, - 'OpFunctionCall' : 57, - 'OpVariable' : 59, - 'OpImageTexelPointer' : 60, - 'OpLoad' : 61, - 'OpStore' : 62, - 'OpCopyMemory' : 63, - 'OpCopyMemorySized' : 64, - 'OpAccessChain' : 65, - 'OpInBoundsAccessChain' : 66, - 'OpPtrAccessChain' : 67, - 'OpArrayLength' : 68, - 'OpGenericPtrMemSemantics' : 69, - 'OpInBoundsPtrAccessChain' : 70, - 'OpDecorate' : 71, - 'OpMemberDecorate' : 72, - 'OpDecorationGroup' : 73, - 'OpGroupDecorate' : 74, - 'OpGroupMemberDecorate' : 75, - 'OpVectorExtractDynamic' : 77, - 'OpVectorInsertDynamic' : 78, - 'OpVectorShuffle' : 79, - 'OpCompositeConstruct' : 80, - 'OpCompositeExtract' : 81, - 'OpCompositeInsert' : 82, - 'OpCopyObject' : 83, - 'OpTranspose' : 84, - 'OpSampledImage' : 86, - 'OpImageSampleImplicitLod' : 87, - 'OpImageSampleExplicitLod' : 88, - 'OpImageSampleDrefImplicitLod' : 89, - 'OpImageSampleDrefExplicitLod' : 90, - 'OpImageSampleProjImplicitLod' : 91, - 'OpImageSampleProjExplicitLod' : 92, - 'OpImageSampleProjDrefImplicitLod' : 93, - 'OpImageSampleProjDrefExplicitLod' : 94, - 'OpImageFetch' : 95, - 'OpImageGather' : 96, - 'OpImageDrefGather' : 97, - 'OpImageRead' : 98, - 'OpImageWrite' : 99, - 'OpImage' : 100, - 'OpImageQueryFormat' : 101, - 'OpImageQueryOrder' : 102, - 'OpImageQuerySizeLod' : 103, - 'OpImageQuerySize' : 104, - 'OpImageQueryLod' : 105, - 'OpImageQueryLevels' : 106, - 'OpImageQuerySamples' : 107, - 'OpConvertFToU' : 109, - 'OpConvertFToS' : 110, - 'OpConvertSToF' : 111, - 'OpConvertUToF' : 112, - 'OpUConvert' : 113, - 'OpSConvert' : 114, - 'OpFConvert' : 115, - 'OpQuantizeToF16' : 116, - 'OpConvertPtrToU' : 117, - 'OpSatConvertSToU' : 118, - 'OpSatConvertUToS' : 119, - 'OpConvertUToPtr' : 120, - 'OpPtrCastToGeneric' : 121, - 'OpGenericCastToPtr' : 122, - 'OpGenericCastToPtrExplicit' : 123, - 'OpBitcast' : 124, - 'OpSNegate' : 126, - 'OpFNegate' : 127, - 'OpIAdd' : 128, - 'OpFAdd' : 129, - 'OpISub' : 130, - 'OpFSub' : 131, - 'OpIMul' : 132, - 'OpFMul' : 133, - 'OpUDiv' : 134, - 'OpSDiv' : 135, - 'OpFDiv' : 136, - 'OpUMod' : 137, - 'OpSRem' : 138, - 'OpSMod' : 139, - 'OpFRem' : 140, - 'OpFMod' : 141, - 'OpVectorTimesScalar' : 142, - 'OpMatrixTimesScalar' : 143, - 'OpVectorTimesMatrix' : 144, - 'OpMatrixTimesVector' : 145, - 'OpMatrixTimesMatrix' : 146, - 'OpOuterProduct' : 147, - 'OpDot' : 148, - 'OpIAddCarry' : 149, - 'OpISubBorrow' : 150, - 'OpUMulExtended' : 151, - 'OpSMulExtended' : 152, - 'OpAny' : 154, - 'OpAll' : 155, - 'OpIsNan' : 156, - 'OpIsInf' : 157, - 'OpIsFinite' : 158, - 'OpIsNormal' : 159, - 'OpSignBitSet' : 160, - 'OpLessOrGreater' : 161, - 'OpOrdered' : 162, - 'OpUnordered' : 163, - 'OpLogicalEqual' : 164, - 'OpLogicalNotEqual' : 165, - 'OpLogicalOr' : 166, - 'OpLogicalAnd' : 167, - 'OpLogicalNot' : 168, - 'OpSelect' : 169, - 'OpIEqual' : 170, - 'OpINotEqual' : 171, - 'OpUGreaterThan' : 172, - 'OpSGreaterThan' : 173, - 'OpUGreaterThanEqual' : 174, - 'OpSGreaterThanEqual' : 175, - 'OpULessThan' : 176, - 'OpSLessThan' : 177, - 'OpULessThanEqual' : 178, - 'OpSLessThanEqual' : 179, - 'OpFOrdEqual' : 180, - 'OpFUnordEqual' : 181, - 'OpFOrdNotEqual' : 182, - 'OpFUnordNotEqual' : 183, - 'OpFOrdLessThan' : 184, - 'OpFUnordLessThan' : 185, - 'OpFOrdGreaterThan' : 186, - 'OpFUnordGreaterThan' : 187, - 'OpFOrdLessThanEqual' : 188, - 'OpFUnordLessThanEqual' : 189, - 'OpFOrdGreaterThanEqual' : 190, - 'OpFUnordGreaterThanEqual' : 191, - 'OpShiftRightLogical' : 194, - 'OpShiftRightArithmetic' : 195, - 'OpShiftLeftLogical' : 196, - 'OpBitwiseOr' : 197, - 'OpBitwiseXor' : 198, - 'OpBitwiseAnd' : 199, - 'OpNot' : 200, - 'OpBitFieldInsert' : 201, - 'OpBitFieldSExtract' : 202, - 'OpBitFieldUExtract' : 203, - 'OpBitReverse' : 204, - 'OpBitCount' : 205, - 'OpDPdx' : 207, - 'OpDPdy' : 208, - 'OpFwidth' : 209, - 'OpDPdxFine' : 210, - 'OpDPdyFine' : 211, - 'OpFwidthFine' : 212, - 'OpDPdxCoarse' : 213, - 'OpDPdyCoarse' : 214, - 'OpFwidthCoarse' : 215, - 'OpEmitVertex' : 218, - 'OpEndPrimitive' : 219, - 'OpEmitStreamVertex' : 220, - 'OpEndStreamPrimitive' : 221, - 'OpControlBarrier' : 224, - 'OpMemoryBarrier' : 225, - 'OpAtomicLoad' : 227, - 'OpAtomicStore' : 228, - 'OpAtomicExchange' : 229, - 'OpAtomicCompareExchange' : 230, - 'OpAtomicCompareExchangeWeak' : 231, - 'OpAtomicIIncrement' : 232, - 'OpAtomicIDecrement' : 233, - 'OpAtomicIAdd' : 234, - 'OpAtomicISub' : 235, - 'OpAtomicSMin' : 236, - 'OpAtomicUMin' : 237, - 'OpAtomicSMax' : 238, - 'OpAtomicUMax' : 239, - 'OpAtomicAnd' : 240, - 'OpAtomicOr' : 241, - 'OpAtomicXor' : 242, - 'OpPhi' : 245, - 'OpLoopMerge' : 246, - 'OpSelectionMerge' : 247, - 'OpLabel' : 248, - 'OpBranch' : 249, - 'OpBranchConditional' : 250, - 'OpSwitch' : 251, - 'OpKill' : 252, - 'OpReturn' : 253, - 'OpReturnValue' : 254, - 'OpUnreachable' : 255, - 'OpLifetimeStart' : 256, - 'OpLifetimeStop' : 257, - 'OpGroupAsyncCopy' : 259, - 'OpGroupWaitEvents' : 260, - 'OpGroupAll' : 261, - 'OpGroupAny' : 262, - 'OpGroupBroadcast' : 263, - 'OpGroupIAdd' : 264, - 'OpGroupFAdd' : 265, - 'OpGroupFMin' : 266, - 'OpGroupUMin' : 267, - 'OpGroupSMin' : 268, - 'OpGroupFMax' : 269, - 'OpGroupUMax' : 270, - 'OpGroupSMax' : 271, - 'OpReadPipe' : 274, - 'OpWritePipe' : 275, - 'OpReservedReadPipe' : 276, - 'OpReservedWritePipe' : 277, - 'OpReserveReadPipePackets' : 278, - 'OpReserveWritePipePackets' : 279, - 'OpCommitReadPipe' : 280, - 'OpCommitWritePipe' : 281, - 'OpIsValidReserveId' : 282, - 'OpGetNumPipePackets' : 283, - 'OpGetMaxPipePackets' : 284, - 'OpGroupReserveReadPipePackets' : 285, - 'OpGroupReserveWritePipePackets' : 286, - 'OpGroupCommitReadPipe' : 287, - 'OpGroupCommitWritePipe' : 288, - 'OpEnqueueMarker' : 291, - 'OpEnqueueKernel' : 292, - 'OpGetKernelNDrangeSubGroupCount' : 293, - 'OpGetKernelNDrangeMaxSubGroupSize' : 294, - 'OpGetKernelWorkGroupSize' : 295, - 'OpGetKernelPreferredWorkGroupSizeMultiple' : 296, - 'OpRetainEvent' : 297, - 'OpReleaseEvent' : 298, - 'OpCreateUserEvent' : 299, - 'OpIsValidEvent' : 300, - 'OpSetUserEventStatus' : 301, - 'OpCaptureEventProfilingInfo' : 302, - 'OpGetDefaultQueue' : 303, - 'OpBuildNDRange' : 304, - 'OpImageSparseSampleImplicitLod' : 305, - 'OpImageSparseSampleExplicitLod' : 306, - 'OpImageSparseSampleDrefImplicitLod' : 307, - 'OpImageSparseSampleDrefExplicitLod' : 308, - 'OpImageSparseSampleProjImplicitLod' : 309, - 'OpImageSparseSampleProjExplicitLod' : 310, - 'OpImageSparseSampleProjDrefImplicitLod' : 311, - 'OpImageSparseSampleProjDrefExplicitLod' : 312, - 'OpImageSparseFetch' : 313, - 'OpImageSparseGather' : 314, - 'OpImageSparseDrefGather' : 315, - 'OpImageSparseTexelsResident' : 316, - 'OpNoLine' : 317, - 'OpAtomicFlagTestAndSet' : 318, - 'OpAtomicFlagClear' : 319, - 'OpImageSparseRead' : 320, - 'OpSizeOf' : 321, - 'OpTypePipeStorage' : 322, - 'OpConstantPipeStorage' : 323, - 'OpCreatePipeFromPipeStorage' : 324, - 'OpGetKernelLocalSizeForSubgroupCount' : 325, - 'OpGetKernelMaxNumSubgroups' : 326, - 'OpTypeNamedBarrier' : 327, - 'OpNamedBarrierInitialize' : 328, - 'OpMemoryNamedBarrier' : 329, - 'OpModuleProcessed' : 330, - 'OpExecutionModeId' : 331, - 'OpDecorateId' : 332, - 'OpSubgroupBallotKHR' : 4421, - 'OpSubgroupFirstInvocationKHR' : 4422, - 'OpSubgroupAllKHR' : 4428, - 'OpSubgroupAnyKHR' : 4429, - 'OpSubgroupAllEqualKHR' : 4430, - 'OpSubgroupReadInvocationKHR' : 4432, - 'OpGroupIAddNonUniformAMD' : 5000, - 'OpGroupFAddNonUniformAMD' : 5001, - 'OpGroupFMinNonUniformAMD' : 5002, - 'OpGroupUMinNonUniformAMD' : 5003, - 'OpGroupSMinNonUniformAMD' : 5004, - 'OpGroupFMaxNonUniformAMD' : 5005, - 'OpGroupUMaxNonUniformAMD' : 5006, - 'OpGroupSMaxNonUniformAMD' : 5007, - 'OpFragmentMaskFetchAMD' : 5011, - 'OpFragmentFetchAMD' : 5012, - 'OpSubgroupShuffleINTEL' : 5571, - 'OpSubgroupShuffleDownINTEL' : 5572, - 'OpSubgroupShuffleUpINTEL' : 5573, - 'OpSubgroupShuffleXorINTEL' : 5574, - 'OpSubgroupBlockReadINTEL' : 5575, - 'OpSubgroupBlockWriteINTEL' : 5576, - 'OpSubgroupImageBlockReadINTEL' : 5577, - 'OpSubgroupImageBlockWriteINTEL' : 5578, - 'OpDecorateStringGOOGLE' : 5632, - 'OpMemberDecorateStringGOOGLE' : 5633, - }, - -} - diff --git a/include/spirv/spir-v.xml b/include/spirv/spir-v.xml deleted file mode 100644 index 525c97dd..00000000 --- a/include/spirv/spir-v.xml +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/include/spirv/unified1/AMD_gcn_shader.h b/include/spirv/unified1/AMD_gcn_shader.h deleted file mode 100644 index 80165ae5..00000000 --- a/include/spirv/unified1/AMD_gcn_shader.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2020 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and/or associated documentation files (the -// "Materials"), to deal in the Materials without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Materials, and to -// permit persons to whom the Materials are furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS -// KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS -// SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT -// https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -// - -#ifndef SPIRV_UNIFIED1_AMD_gcn_shader_H_ -#define SPIRV_UNIFIED1_AMD_gcn_shader_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -enum { - AMD_gcn_shaderRevision = 2, - AMD_gcn_shaderRevision_BitWidthPadding = 0x7fffffff -}; - -enum AMD_gcn_shaderInstructions { - AMD_gcn_shaderCubeFaceIndexAMD = 1, - AMD_gcn_shaderCubeFaceCoordAMD = 2, - AMD_gcn_shaderTimeAMD = 3, - AMD_gcn_shaderInstructionsMax = 0x7fffffff -}; - - -#ifdef __cplusplus -} -#endif - -#endif // SPIRV_UNIFIED1_AMD_gcn_shader_H_ diff --git a/include/spirv/unified1/AMD_shader_ballot.h b/include/spirv/unified1/AMD_shader_ballot.h deleted file mode 100644 index 8a8bb6ec..00000000 --- a/include/spirv/unified1/AMD_shader_ballot.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) 2020 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and/or associated documentation files (the -// "Materials"), to deal in the Materials without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Materials, and to -// permit persons to whom the Materials are furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS -// KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS -// SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT -// https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -// - -#ifndef SPIRV_UNIFIED1_AMD_shader_ballot_H_ -#define SPIRV_UNIFIED1_AMD_shader_ballot_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -enum { - AMD_shader_ballotRevision = 5, - AMD_shader_ballotRevision_BitWidthPadding = 0x7fffffff -}; - -enum AMD_shader_ballotInstructions { - AMD_shader_ballotSwizzleInvocationsAMD = 1, - AMD_shader_ballotSwizzleInvocationsMaskedAMD = 2, - AMD_shader_ballotWriteInvocationAMD = 3, - AMD_shader_ballotMbcntAMD = 4, - AMD_shader_ballotInstructionsMax = 0x7fffffff -}; - - -#ifdef __cplusplus -} -#endif - -#endif // SPIRV_UNIFIED1_AMD_shader_ballot_H_ diff --git a/include/spirv/unified1/AMD_shader_explicit_vertex_parameter.h b/include/spirv/unified1/AMD_shader_explicit_vertex_parameter.h deleted file mode 100644 index 12b6480f..00000000 --- a/include/spirv/unified1/AMD_shader_explicit_vertex_parameter.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2020 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and/or associated documentation files (the -// "Materials"), to deal in the Materials without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Materials, and to -// permit persons to whom the Materials are furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS -// KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS -// SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT -// https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -// - -#ifndef SPIRV_UNIFIED1_AMD_shader_explicit_vertex_parameter_H_ -#define SPIRV_UNIFIED1_AMD_shader_explicit_vertex_parameter_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -enum { - AMD_shader_explicit_vertex_parameterRevision = 4, - AMD_shader_explicit_vertex_parameterRevision_BitWidthPadding = 0x7fffffff -}; - -enum AMD_shader_explicit_vertex_parameterInstructions { - AMD_shader_explicit_vertex_parameterInterpolateAtVertexAMD = 1, - AMD_shader_explicit_vertex_parameterInstructionsMax = 0x7fffffff -}; - - -#ifdef __cplusplus -} -#endif - -#endif // SPIRV_UNIFIED1_AMD_shader_explicit_vertex_parameter_H_ diff --git a/include/spirv/unified1/AMD_shader_trinary_minmax.h b/include/spirv/unified1/AMD_shader_trinary_minmax.h deleted file mode 100644 index 1b14997d..00000000 --- a/include/spirv/unified1/AMD_shader_trinary_minmax.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) 2020 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and/or associated documentation files (the -// "Materials"), to deal in the Materials without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Materials, and to -// permit persons to whom the Materials are furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS -// KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS -// SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT -// https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -// - -#ifndef SPIRV_UNIFIED1_AMD_shader_trinary_minmax_H_ -#define SPIRV_UNIFIED1_AMD_shader_trinary_minmax_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -enum { - AMD_shader_trinary_minmaxRevision = 4, - AMD_shader_trinary_minmaxRevision_BitWidthPadding = 0x7fffffff -}; - -enum AMD_shader_trinary_minmaxInstructions { - AMD_shader_trinary_minmaxFMin3AMD = 1, - AMD_shader_trinary_minmaxUMin3AMD = 2, - AMD_shader_trinary_minmaxSMin3AMD = 3, - AMD_shader_trinary_minmaxFMax3AMD = 4, - AMD_shader_trinary_minmaxUMax3AMD = 5, - AMD_shader_trinary_minmaxSMax3AMD = 6, - AMD_shader_trinary_minmaxFMid3AMD = 7, - AMD_shader_trinary_minmaxUMid3AMD = 8, - AMD_shader_trinary_minmaxSMid3AMD = 9, - AMD_shader_trinary_minmaxInstructionsMax = 0x7fffffff -}; - - -#ifdef __cplusplus -} -#endif - -#endif // SPIRV_UNIFIED1_AMD_shader_trinary_minmax_H_ diff --git a/include/spirv/unified1/DebugInfo.h b/include/spirv/unified1/DebugInfo.h deleted file mode 100644 index 4657556b..00000000 --- a/include/spirv/unified1/DebugInfo.h +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -#ifndef SPIRV_UNIFIED1_DebugInfo_H_ -#define SPIRV_UNIFIED1_DebugInfo_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -enum { - DebugInfoVersion = 100, - DebugInfoVersion_BitWidthPadding = 0x7fffffff -}; -enum { - DebugInfoRevision = 1, - DebugInfoRevision_BitWidthPadding = 0x7fffffff -}; - -enum DebugInfoInstructions { - DebugInfoDebugInfoNone = 0, - DebugInfoDebugCompilationUnit = 1, - DebugInfoDebugTypeBasic = 2, - DebugInfoDebugTypePointer = 3, - DebugInfoDebugTypeQualifier = 4, - DebugInfoDebugTypeArray = 5, - DebugInfoDebugTypeVector = 6, - DebugInfoDebugTypedef = 7, - DebugInfoDebugTypeFunction = 8, - DebugInfoDebugTypeEnum = 9, - DebugInfoDebugTypeComposite = 10, - DebugInfoDebugTypeMember = 11, - DebugInfoDebugTypeInheritance = 12, - DebugInfoDebugTypePtrToMember = 13, - DebugInfoDebugTypeTemplate = 14, - DebugInfoDebugTypeTemplateParameter = 15, - DebugInfoDebugTypeTemplateTemplateParameter = 16, - DebugInfoDebugTypeTemplateParameterPack = 17, - DebugInfoDebugGlobalVariable = 18, - DebugInfoDebugFunctionDeclaration = 19, - DebugInfoDebugFunction = 20, - DebugInfoDebugLexicalBlock = 21, - DebugInfoDebugLexicalBlockDiscriminator = 22, - DebugInfoDebugScope = 23, - DebugInfoDebugNoScope = 24, - DebugInfoDebugInlinedAt = 25, - DebugInfoDebugLocalVariable = 26, - DebugInfoDebugInlinedVariable = 27, - DebugInfoDebugDeclare = 28, - DebugInfoDebugValue = 29, - DebugInfoDebugOperation = 30, - DebugInfoDebugExpression = 31, - DebugInfoDebugMacroDef = 32, - DebugInfoDebugMacroUndef = 33, - DebugInfoInstructionsMax = 0x7fffffff -}; - - -enum DebugInfoDebugInfoFlags { - DebugInfoNone = 0x0000, - DebugInfoFlagIsProtected = 0x01, - DebugInfoFlagIsPrivate = 0x02, - DebugInfoFlagIsPublic = 0x03, - DebugInfoFlagIsLocal = 0x04, - DebugInfoFlagIsDefinition = 0x08, - DebugInfoFlagFwdDecl = 0x10, - DebugInfoFlagArtificial = 0x20, - DebugInfoFlagExplicit = 0x40, - DebugInfoFlagPrototyped = 0x80, - DebugInfoFlagObjectPointer = 0x100, - DebugInfoFlagStaticMember = 0x200, - DebugInfoFlagIndirectVariable = 0x400, - DebugInfoFlagLValueReference = 0x800, - DebugInfoFlagRValueReference = 0x1000, - DebugInfoFlagIsOptimized = 0x2000, - DebugInfoDebugInfoFlagsMax = 0x7fffffff -}; - -enum DebugInfoDebugBaseTypeAttributeEncoding { - DebugInfoUnspecified = 0, - DebugInfoAddress = 1, - DebugInfoBoolean = 2, - DebugInfoFloat = 4, - DebugInfoSigned = 5, - DebugInfoSignedChar = 6, - DebugInfoUnsigned = 7, - DebugInfoUnsignedChar = 8, - DebugInfoDebugBaseTypeAttributeEncodingMax = 0x7fffffff -}; - -enum DebugInfoDebugCompositeType { - DebugInfoClass = 0, - DebugInfoStructure = 1, - DebugInfoUnion = 2, - DebugInfoDebugCompositeTypeMax = 0x7fffffff -}; - -enum DebugInfoDebugTypeQualifier { - DebugInfoConstType = 0, - DebugInfoVolatileType = 1, - DebugInfoRestrictType = 2, - DebugInfoDebugTypeQualifierMax = 0x7fffffff -}; - -enum DebugInfoDebugOperation { - DebugInfoDeref = 0, - DebugInfoPlus = 1, - DebugInfoMinus = 2, - DebugInfoPlusUconst = 3, - DebugInfoBitPiece = 4, - DebugInfoSwap = 5, - DebugInfoXderef = 6, - DebugInfoStackValue = 7, - DebugInfoConstu = 8, - DebugInfoDebugOperationMax = 0x7fffffff -}; - - -#ifdef __cplusplus -} -#endif - -#endif // SPIRV_UNIFIED1_DebugInfo_H_ diff --git a/include/spirv/unified1/NonSemanticClspvReflection.h b/include/spirv/unified1/NonSemanticClspvReflection.h deleted file mode 100644 index fa7061d8..00000000 --- a/include/spirv/unified1/NonSemanticClspvReflection.h +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) 2020 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and/or associated documentation files (the -// "Materials"), to deal in the Materials without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Materials, and to -// permit persons to whom the Materials are furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS -// KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS -// SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT -// https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -// - -#ifndef SPIRV_UNIFIED1_NonSemanticClspvReflection_H_ -#define SPIRV_UNIFIED1_NonSemanticClspvReflection_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -enum { - NonSemanticClspvReflectionRevision = 1, - NonSemanticClspvReflectionRevision_BitWidthPadding = 0x7fffffff -}; - -enum NonSemanticClspvReflectionInstructions { - NonSemanticClspvReflectionKernel = 1, - NonSemanticClspvReflectionArgumentInfo = 2, - NonSemanticClspvReflectionArgumentStorageBuffer = 3, - NonSemanticClspvReflectionArgumentUniform = 4, - NonSemanticClspvReflectionArgumentPodStorageBuffer = 5, - NonSemanticClspvReflectionArgumentPodUniform = 6, - NonSemanticClspvReflectionArgumentPodPushConstant = 7, - NonSemanticClspvReflectionArgumentSampledImage = 8, - NonSemanticClspvReflectionArgumentStorageImage = 9, - NonSemanticClspvReflectionArgumentSampler = 10, - NonSemanticClspvReflectionArgumentWorkgroup = 11, - NonSemanticClspvReflectionSpecConstantWorkgroupSize = 12, - NonSemanticClspvReflectionSpecConstantGlobalOffset = 13, - NonSemanticClspvReflectionSpecConstantWorkDim = 14, - NonSemanticClspvReflectionPushConstantGlobalOffset = 15, - NonSemanticClspvReflectionPushConstantEnqueuedLocalSize = 16, - NonSemanticClspvReflectionPushConstantGlobalSize = 17, - NonSemanticClspvReflectionPushConstantRegionOffset = 18, - NonSemanticClspvReflectionPushConstantNumWorkgroups = 19, - NonSemanticClspvReflectionPushConstantRegionGroupOffset = 20, - NonSemanticClspvReflectionConstantDataStorageBuffer = 21, - NonSemanticClspvReflectionConstantDataUniform = 22, - NonSemanticClspvReflectionLiteralSampler = 23, - NonSemanticClspvReflectionPropertyRequiredWorkgroupSize = 24, - NonSemanticClspvReflectionInstructionsMax = 0x7fffffff -}; - - -#ifdef __cplusplus -} -#endif - -#endif // SPIRV_UNIFIED1_NonSemanticClspvReflection_H_ diff --git a/include/spirv/unified1/NonSemanticShaderDebugInfo100.h b/include/spirv/unified1/NonSemanticShaderDebugInfo100.h deleted file mode 100644 index c52f32f8..00000000 --- a/include/spirv/unified1/NonSemanticShaderDebugInfo100.h +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright (c) 2018 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -#ifndef SPIRV_UNIFIED1_NonSemanticShaderDebugInfo100_H_ -#define SPIRV_UNIFIED1_NonSemanticShaderDebugInfo100_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -enum { - NonSemanticShaderDebugInfo100Version = 100, - NonSemanticShaderDebugInfo100Version_BitWidthPadding = 0x7fffffff -}; -enum { - NonSemanticShaderDebugInfo100Revision = 6, - NonSemanticShaderDebugInfo100Revision_BitWidthPadding = 0x7fffffff -}; - -enum NonSemanticShaderDebugInfo100Instructions { - NonSemanticShaderDebugInfo100DebugInfoNone = 0, - NonSemanticShaderDebugInfo100DebugCompilationUnit = 1, - NonSemanticShaderDebugInfo100DebugTypeBasic = 2, - NonSemanticShaderDebugInfo100DebugTypePointer = 3, - NonSemanticShaderDebugInfo100DebugTypeQualifier = 4, - NonSemanticShaderDebugInfo100DebugTypeArray = 5, - NonSemanticShaderDebugInfo100DebugTypeVector = 6, - NonSemanticShaderDebugInfo100DebugTypedef = 7, - NonSemanticShaderDebugInfo100DebugTypeFunction = 8, - NonSemanticShaderDebugInfo100DebugTypeEnum = 9, - NonSemanticShaderDebugInfo100DebugTypeComposite = 10, - NonSemanticShaderDebugInfo100DebugTypeMember = 11, - NonSemanticShaderDebugInfo100DebugTypeInheritance = 12, - NonSemanticShaderDebugInfo100DebugTypePtrToMember = 13, - NonSemanticShaderDebugInfo100DebugTypeTemplate = 14, - NonSemanticShaderDebugInfo100DebugTypeTemplateParameter = 15, - NonSemanticShaderDebugInfo100DebugTypeTemplateTemplateParameter = 16, - NonSemanticShaderDebugInfo100DebugTypeTemplateParameterPack = 17, - NonSemanticShaderDebugInfo100DebugGlobalVariable = 18, - NonSemanticShaderDebugInfo100DebugFunctionDeclaration = 19, - NonSemanticShaderDebugInfo100DebugFunction = 20, - NonSemanticShaderDebugInfo100DebugLexicalBlock = 21, - NonSemanticShaderDebugInfo100DebugLexicalBlockDiscriminator = 22, - NonSemanticShaderDebugInfo100DebugScope = 23, - NonSemanticShaderDebugInfo100DebugNoScope = 24, - NonSemanticShaderDebugInfo100DebugInlinedAt = 25, - NonSemanticShaderDebugInfo100DebugLocalVariable = 26, - NonSemanticShaderDebugInfo100DebugInlinedVariable = 27, - NonSemanticShaderDebugInfo100DebugDeclare = 28, - NonSemanticShaderDebugInfo100DebugValue = 29, - NonSemanticShaderDebugInfo100DebugOperation = 30, - NonSemanticShaderDebugInfo100DebugExpression = 31, - NonSemanticShaderDebugInfo100DebugMacroDef = 32, - NonSemanticShaderDebugInfo100DebugMacroUndef = 33, - NonSemanticShaderDebugInfo100DebugImportedEntity = 34, - NonSemanticShaderDebugInfo100DebugSource = 35, - NonSemanticShaderDebugInfo100DebugFunctionDefinition = 101, - NonSemanticShaderDebugInfo100DebugSourceContinued = 102, - NonSemanticShaderDebugInfo100DebugLine = 103, - NonSemanticShaderDebugInfo100DebugNoLine = 104, - NonSemanticShaderDebugInfo100DebugBuildIdentifier = 105, - NonSemanticShaderDebugInfo100DebugStoragePath = 106, - NonSemanticShaderDebugInfo100DebugEntryPoint = 107, - NonSemanticShaderDebugInfo100DebugTypeMatrix = 108, - NonSemanticShaderDebugInfo100InstructionsMax = 0x7fffffff -}; - - -enum NonSemanticShaderDebugInfo100DebugInfoFlags { - NonSemanticShaderDebugInfo100None = 0x0000, - NonSemanticShaderDebugInfo100FlagIsProtected = 0x01, - NonSemanticShaderDebugInfo100FlagIsPrivate = 0x02, - NonSemanticShaderDebugInfo100FlagIsPublic = 0x03, - NonSemanticShaderDebugInfo100FlagIsLocal = 0x04, - NonSemanticShaderDebugInfo100FlagIsDefinition = 0x08, - NonSemanticShaderDebugInfo100FlagFwdDecl = 0x10, - NonSemanticShaderDebugInfo100FlagArtificial = 0x20, - NonSemanticShaderDebugInfo100FlagExplicit = 0x40, - NonSemanticShaderDebugInfo100FlagPrototyped = 0x80, - NonSemanticShaderDebugInfo100FlagObjectPointer = 0x100, - NonSemanticShaderDebugInfo100FlagStaticMember = 0x200, - NonSemanticShaderDebugInfo100FlagIndirectVariable = 0x400, - NonSemanticShaderDebugInfo100FlagLValueReference = 0x800, - NonSemanticShaderDebugInfo100FlagRValueReference = 0x1000, - NonSemanticShaderDebugInfo100FlagIsOptimized = 0x2000, - NonSemanticShaderDebugInfo100FlagIsEnumClass = 0x4000, - NonSemanticShaderDebugInfo100FlagTypePassByValue = 0x8000, - NonSemanticShaderDebugInfo100FlagTypePassByReference = 0x10000, - NonSemanticShaderDebugInfo100FlagUnknownPhysicalLayout = 0x20000, - NonSemanticShaderDebugInfo100DebugInfoFlagsMax = 0x7fffffff -}; - -enum NonSemanticShaderDebugInfo100BuildIdentifierFlags { - NonSemanticShaderDebugInfo100IdentifierPossibleDuplicates = 0x01, - NonSemanticShaderDebugInfo100BuildIdentifierFlagsMax = 0x7fffffff -}; - -enum NonSemanticShaderDebugInfo100DebugBaseTypeAttributeEncoding { - NonSemanticShaderDebugInfo100Unspecified = 0, - NonSemanticShaderDebugInfo100Address = 1, - NonSemanticShaderDebugInfo100Boolean = 2, - NonSemanticShaderDebugInfo100Float = 3, - NonSemanticShaderDebugInfo100Signed = 4, - NonSemanticShaderDebugInfo100SignedChar = 5, - NonSemanticShaderDebugInfo100Unsigned = 6, - NonSemanticShaderDebugInfo100UnsignedChar = 7, - NonSemanticShaderDebugInfo100DebugBaseTypeAttributeEncodingMax = 0x7fffffff -}; - -enum NonSemanticShaderDebugInfo100DebugCompositeType { - NonSemanticShaderDebugInfo100Class = 0, - NonSemanticShaderDebugInfo100Structure = 1, - NonSemanticShaderDebugInfo100Union = 2, - NonSemanticShaderDebugInfo100DebugCompositeTypeMax = 0x7fffffff -}; - -enum NonSemanticShaderDebugInfo100DebugTypeQualifier { - NonSemanticShaderDebugInfo100ConstType = 0, - NonSemanticShaderDebugInfo100VolatileType = 1, - NonSemanticShaderDebugInfo100RestrictType = 2, - NonSemanticShaderDebugInfo100AtomicType = 3, - NonSemanticShaderDebugInfo100DebugTypeQualifierMax = 0x7fffffff -}; - -enum NonSemanticShaderDebugInfo100DebugOperation { - NonSemanticShaderDebugInfo100Deref = 0, - NonSemanticShaderDebugInfo100Plus = 1, - NonSemanticShaderDebugInfo100Minus = 2, - NonSemanticShaderDebugInfo100PlusUconst = 3, - NonSemanticShaderDebugInfo100BitPiece = 4, - NonSemanticShaderDebugInfo100Swap = 5, - NonSemanticShaderDebugInfo100Xderef = 6, - NonSemanticShaderDebugInfo100StackValue = 7, - NonSemanticShaderDebugInfo100Constu = 8, - NonSemanticShaderDebugInfo100Fragment = 9, - NonSemanticShaderDebugInfo100DebugOperationMax = 0x7fffffff -}; - -enum NonSemanticShaderDebugInfo100DebugImportedEntity { - NonSemanticShaderDebugInfo100ImportedModule = 0, - NonSemanticShaderDebugInfo100ImportedDeclaration = 1, - NonSemanticShaderDebugInfo100DebugImportedEntityMax = 0x7fffffff -}; - - -#ifdef __cplusplus -} -#endif - -#endif // SPIRV_UNIFIED1_NonSemanticShaderDebugInfo100_H_ diff --git a/include/spirv/unified1/OpenCLDebugInfo100.h b/include/spirv/unified1/OpenCLDebugInfo100.h deleted file mode 100644 index e3847c90..00000000 --- a/include/spirv/unified1/OpenCLDebugInfo100.h +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) 2018 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -#ifndef SPIRV_UNIFIED1_OpenCLDebugInfo100_H_ -#define SPIRV_UNIFIED1_OpenCLDebugInfo100_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -enum { - OpenCLDebugInfo100Version = 200, - OpenCLDebugInfo100Version_BitWidthPadding = 0x7fffffff -}; -enum { - OpenCLDebugInfo100Revision = 2, - OpenCLDebugInfo100Revision_BitWidthPadding = 0x7fffffff -}; - -enum OpenCLDebugInfo100Instructions { - OpenCLDebugInfo100DebugInfoNone = 0, - OpenCLDebugInfo100DebugCompilationUnit = 1, - OpenCLDebugInfo100DebugTypeBasic = 2, - OpenCLDebugInfo100DebugTypePointer = 3, - OpenCLDebugInfo100DebugTypeQualifier = 4, - OpenCLDebugInfo100DebugTypeArray = 5, - OpenCLDebugInfo100DebugTypeVector = 6, - OpenCLDebugInfo100DebugTypedef = 7, - OpenCLDebugInfo100DebugTypeFunction = 8, - OpenCLDebugInfo100DebugTypeEnum = 9, - OpenCLDebugInfo100DebugTypeComposite = 10, - OpenCLDebugInfo100DebugTypeMember = 11, - OpenCLDebugInfo100DebugTypeInheritance = 12, - OpenCLDebugInfo100DebugTypePtrToMember = 13, - OpenCLDebugInfo100DebugTypeTemplate = 14, - OpenCLDebugInfo100DebugTypeTemplateParameter = 15, - OpenCLDebugInfo100DebugTypeTemplateTemplateParameter = 16, - OpenCLDebugInfo100DebugTypeTemplateParameterPack = 17, - OpenCLDebugInfo100DebugGlobalVariable = 18, - OpenCLDebugInfo100DebugFunctionDeclaration = 19, - OpenCLDebugInfo100DebugFunction = 20, - OpenCLDebugInfo100DebugLexicalBlock = 21, - OpenCLDebugInfo100DebugLexicalBlockDiscriminator = 22, - OpenCLDebugInfo100DebugScope = 23, - OpenCLDebugInfo100DebugNoScope = 24, - OpenCLDebugInfo100DebugInlinedAt = 25, - OpenCLDebugInfo100DebugLocalVariable = 26, - OpenCLDebugInfo100DebugInlinedVariable = 27, - OpenCLDebugInfo100DebugDeclare = 28, - OpenCLDebugInfo100DebugValue = 29, - OpenCLDebugInfo100DebugOperation = 30, - OpenCLDebugInfo100DebugExpression = 31, - OpenCLDebugInfo100DebugMacroDef = 32, - OpenCLDebugInfo100DebugMacroUndef = 33, - OpenCLDebugInfo100DebugImportedEntity = 34, - OpenCLDebugInfo100DebugSource = 35, - OpenCLDebugInfo100DebugModuleINTEL = 36, - OpenCLDebugInfo100InstructionsMax = 0x7fffffff -}; - - -enum OpenCLDebugInfo100DebugInfoFlags { - OpenCLDebugInfo100None = 0x0000, - OpenCLDebugInfo100FlagIsProtected = 0x01, - OpenCLDebugInfo100FlagIsPrivate = 0x02, - OpenCLDebugInfo100FlagIsPublic = 0x03, - OpenCLDebugInfo100FlagIsLocal = 0x04, - OpenCLDebugInfo100FlagIsDefinition = 0x08, - OpenCLDebugInfo100FlagFwdDecl = 0x10, - OpenCLDebugInfo100FlagArtificial = 0x20, - OpenCLDebugInfo100FlagExplicit = 0x40, - OpenCLDebugInfo100FlagPrototyped = 0x80, - OpenCLDebugInfo100FlagObjectPointer = 0x100, - OpenCLDebugInfo100FlagStaticMember = 0x200, - OpenCLDebugInfo100FlagIndirectVariable = 0x400, - OpenCLDebugInfo100FlagLValueReference = 0x800, - OpenCLDebugInfo100FlagRValueReference = 0x1000, - OpenCLDebugInfo100FlagIsOptimized = 0x2000, - OpenCLDebugInfo100FlagIsEnumClass = 0x4000, - OpenCLDebugInfo100FlagTypePassByValue = 0x8000, - OpenCLDebugInfo100FlagTypePassByReference = 0x10000, - OpenCLDebugInfo100DebugInfoFlagsMax = 0x7fffffff -}; - -enum OpenCLDebugInfo100DebugBaseTypeAttributeEncoding { - OpenCLDebugInfo100Unspecified = 0, - OpenCLDebugInfo100Address = 1, - OpenCLDebugInfo100Boolean = 2, - OpenCLDebugInfo100Float = 3, - OpenCLDebugInfo100Signed = 4, - OpenCLDebugInfo100SignedChar = 5, - OpenCLDebugInfo100Unsigned = 6, - OpenCLDebugInfo100UnsignedChar = 7, - OpenCLDebugInfo100DebugBaseTypeAttributeEncodingMax = 0x7fffffff -}; - -enum OpenCLDebugInfo100DebugCompositeType { - OpenCLDebugInfo100Class = 0, - OpenCLDebugInfo100Structure = 1, - OpenCLDebugInfo100Union = 2, - OpenCLDebugInfo100DebugCompositeTypeMax = 0x7fffffff -}; - -enum OpenCLDebugInfo100DebugTypeQualifier { - OpenCLDebugInfo100ConstType = 0, - OpenCLDebugInfo100VolatileType = 1, - OpenCLDebugInfo100RestrictType = 2, - OpenCLDebugInfo100AtomicType = 3, - OpenCLDebugInfo100DebugTypeQualifierMax = 0x7fffffff -}; - -enum OpenCLDebugInfo100DebugOperation { - OpenCLDebugInfo100Deref = 0, - OpenCLDebugInfo100Plus = 1, - OpenCLDebugInfo100Minus = 2, - OpenCLDebugInfo100PlusUconst = 3, - OpenCLDebugInfo100BitPiece = 4, - OpenCLDebugInfo100Swap = 5, - OpenCLDebugInfo100Xderef = 6, - OpenCLDebugInfo100StackValue = 7, - OpenCLDebugInfo100Constu = 8, - OpenCLDebugInfo100Fragment = 9, - OpenCLDebugInfo100DebugOperationMax = 0x7fffffff -}; - -enum OpenCLDebugInfo100DebugImportedEntity { - OpenCLDebugInfo100ImportedModule = 0, - OpenCLDebugInfo100ImportedDeclaration = 1, - OpenCLDebugInfo100DebugImportedEntityMax = 0x7fffffff -}; - - -#ifdef __cplusplus -} -#endif - -#endif // SPIRV_UNIFIED1_OpenCLDebugInfo100_H_ diff --git a/include/spirv/unified1/extinst.debuginfo.grammar.json b/include/spirv/unified1/extinst.debuginfo.grammar.json deleted file mode 100644 index 7d6e8e5b..00000000 --- a/include/spirv/unified1/extinst.debuginfo.grammar.json +++ /dev/null @@ -1,572 +0,0 @@ -{ - "copyright" : [ - "Copyright (c) 2017 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - "version" : 100, - "revision" : 1, - "instructions" : [ - { - "opname" : "DebugInfoNone", - "opcode" : 0 - }, - { - "opname" : "DebugCompilationUnit", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Version'" }, - { "kind" : "LiteralInteger", "name" : "'DWARF Version'" } - ] - }, - { - "opname" : "DebugTypeBasic", - "opcode" : 2, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "DebugBaseTypeAttributeEncoding", "name" : "'Encoding'" } - ] - }, - { - "opname" : "DebugTypePointer", - "opcode" : 3, - "operands" : [ - { "kind" : "IdRef", "name" : "'Base Type'" }, - { "kind" : "StorageClass", "name" : "'Storage Class'" }, - { "kind" : "DebugInfoFlags", "name" : "'Literal Flags'" } - ] - }, - { - "opname" : "DebugTypeQualifier", - "opcode" : 4, - "operands" : [ - { "kind" : "IdRef", "name" : "'Base Type'" }, - { "kind" : "DebugTypeQualifier", "name" : "'Type Qualifier'" } - ] - }, - { - "opname" : "DebugTypeArray", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'Base Type'" }, - { "kind" : "IdRef", "name" : "'Component Counts'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugTypeVector", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'Base Type'" }, - { "kind" : "LiteralInteger", "name" : "'Component Count'" } - ] - }, - { - "opname" : "DebugTypedef", - "opcode" : 7, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Base Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" } - ] - }, - { - "opname" : "DebugTypeFunction", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "'Return Type'" }, - { "kind" : "IdRef", "name" : "'Paramter Types'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugTypeEnum", - "opcode" : 9, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Underlying Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "DebugInfoFlags", "name" : "'Flags'" }, - { "kind" : "PairIdRefIdRef", "name" : "'Value, Name, Value, Name, ...'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugTypeComposite", - "opcode" : 10, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "DebugCompositeType", "name" : "'Tag'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "DebugInfoFlags", "name" : "'Flags'" }, - { "kind" : "IdRef", "name" : "'Members'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugTypeMember", - "opcode" : 11, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "DebugInfoFlags", "name" : "'Flags'" }, - { "kind" : "IdRef", "name" : "'Value'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugTypeInheritance", - "opcode" : 12, - "operands" : [ - { "kind" : "IdRef", "name" : "'Child'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "DebugInfoFlags", "name" : "'Flags'" } - ] - }, - { - "opname" : "DebugTypePtrToMember", - "opcode" : 13, - "operands" : [ - { "kind" : "IdRef", "name" : "'Member Type'" }, - { "kind" : "IdRef", "name" : "'Parent'" } - ] - }, - { - "opname" : "DebugTypeTemplate", - "opcode" : 14, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "IdRef", "name" : "'Parameters'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugTypeTemplateParameter", - "opcode" : 15, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Actual Type'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" } - ] - }, - { - "opname" : "DebugTypeTemplateTemplateParameter", - "opcode" : 16, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Template Name'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" } - ] - }, - { - "opname" : "DebugTypeTemplateParameterPack", - "opcode" : 17, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Template Parameters'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugGlobalVariable", - "opcode" : 18, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Linkage Name'" }, - { "kind" : "IdRef", "name" : "'Variable'" }, - { "kind" : "DebugInfoFlags", "name" : "'Flags'" }, - { "kind" : "IdRef", "name" : "'Static Member Declaration'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugFunctionDeclaration", - "opcode" : 19, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Linkage Name'" }, - { "kind" : "DebugInfoFlags", "name" : "'Flags'" } - ] - }, - { - "opname" : "DebugFunction", - "opcode" : 20, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Linkage Name'" }, - { "kind" : "DebugInfoFlags", "name" : "'Flags'" }, - { "kind" : "LiteralInteger", "name" : "'Scope Line'" }, - { "kind" : "IdRef", "name" : "'Function'" }, - { "kind" : "IdRef", "name" : "'Declaration'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugLexicalBlock", - "opcode" : 21, - "operands" : [ - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Name'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugLexicalBlockDiscriminator", - "opcode" : 22, - "operands" : [ - { "kind" : "IdRef", "name" : "'Scope'" }, - { "kind" : "LiteralInteger", "name" : "'Discriminator'" }, - { "kind" : "IdRef", "name" : "'Parent'" } - ] - }, - { - "opname" : "DebugScope", - "opcode" : 23, - "operands" : [ - { "kind" : "IdRef", "name" : "'Scope'" }, - { "kind" : "IdRef", "name" : "'Inlined At'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugNoScope", - "opcode" : 24 - }, - { - "opname" : "DebugInlinedAt", - "opcode" : 25, - "operands" : [ - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Scope'" }, - { "kind" : "IdRef", "name" : "'Inlined'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugLocalVariable", - "opcode" : 26, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "LiteralInteger", "name" : "'Arg Number'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugInlinedVariable", - "opcode" : 27, - "operands" : [ - { "kind" : "IdRef", "name" : "'Variable'" }, - { "kind" : "IdRef", "name" : "'Inlined'" } - ] - }, - { - "opname" : "DebugDeclare", - "opcode" : 28, - "operands" : [ - { "kind" : "IdRef", "name" : "'Local Variable'" }, - { "kind" : "IdRef", "name" : "'Variable'" }, - { "kind" : "IdRef", "name" : "'Expression'" } - ] - }, - { - "opname" : "DebugValue", - "opcode" : 29, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Expression'" }, - { "kind" : "IdRef", "name" : "'Indexes'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugOperation", - "opcode" : 30, - "operands" : [ - { "kind" : "DebugOperation", "name" : "'OpCode'" }, - { "kind" : "LiteralInteger", "name" : "'Operands ...'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugExpression", - "opcode" : 31, - "operands" : [ - { "kind" : "IdRef", "name" : "'Operands ...'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugMacroDef", - "opcode" : 32, - "operands" : [ - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Value'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugMacroUndef", - "opcode" : 33, - "operands" : [ - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Macro'" } - ] - } - ], - "operand_kinds" : [ - { - "category" : "BitEnum", - "kind" : "DebugInfoFlags", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "FlagIsProtected", - "value" : "0x01" - }, - { - "enumerant" : "FlagIsPrivate", - "value" : "0x02" - }, - { - "enumerant" : "FlagIsPublic", - "value" : "0x03" - }, - { - "enumerant" : "FlagIsLocal", - "value" : "0x04" - }, - { - "enumerant" : "FlagIsDefinition", - "value" : "0x08" - }, - { - "enumerant" : "FlagFwdDecl", - "value" : "0x10" - }, - { - "enumerant" : "FlagArtificial", - "value" : "0x20" - }, - { - "enumerant" : "FlagExplicit", - "value" : "0x40" - }, - { - "enumerant" : "FlagPrototyped", - "value" : "0x80" - }, - { - "enumerant" : "FlagObjectPointer", - "value" : "0x100" - }, - { - "enumerant" : "FlagStaticMember", - "value" : "0x200" - }, - { - "enumerant" : "FlagIndirectVariable", - "value" : "0x400" - }, - { - "enumerant" : "FlagLValueReference", - "value" : "0x800" - }, - { - "enumerant" : "FlagRValueReference", - "value" : "0x1000" - }, - { - "enumerant" : "FlagIsOptimized", - "value" : "0x2000" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "DebugBaseTypeAttributeEncoding", - "enumerants" : [ - { - "enumerant" : "Unspecified", - "value" : "0" - }, - { - "enumerant" : "Address", - "value" : "1" - }, - { - "enumerant" : "Boolean", - "value" : "2" - }, - { - "enumerant" : "Float", - "value" : "4" - }, - { - "enumerant" : "Signed", - "value" : "5" - }, - { - "enumerant" : "SignedChar", - "value" : "6" - }, - { - "enumerant" : "Unsigned", - "value" : "7" - }, - { - "enumerant" : "UnsignedChar", - "value" : "8" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "DebugCompositeType", - "enumerants" : [ - { - "enumerant" : "Class", - "value" : "0" - }, - { - "enumerant" : "Structure", - "value" : "1" - }, - { - "enumerant" : "Union", - "value" : "2" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "DebugTypeQualifier", - "enumerants" : [ - { - "enumerant" : "ConstType", - "value" : "0" - }, - { - "enumerant" : "VolatileType", - "value" : "1" - }, - { - "enumerant" : "RestrictType", - "value" : "2" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "DebugOperation", - "enumerants" : [ - { - "enumerant" : "Deref", - "value" : "0" - }, - { - "enumerant" : "Plus", - "value" : "1" - }, - { - "enumerant" : "Minus", - "value" : "2" - }, - { - "enumerant" : "PlusUconst", - "value" : "3", - "parameters" : [ - { "kind" : "LiteralInteger" } - ] - }, - { - "enumerant" : "BitPiece", - "value" : "4", - "parameters" : [ - { "kind" : "LiteralInteger" }, - { "kind" : "LiteralInteger" } - ] - }, - { - "enumerant" : "Swap", - "value" : "5" - }, - { - "enumerant" : "Xderef", - "value" : "6" - }, - { - "enumerant" : "StackValue", - "value" : "7" - }, - { - "enumerant" : "Constu", - "value" : "8", - "parameters" : [ - { "kind" : "LiteralInteger" } - ] - } - ] - } - ] -} diff --git a/include/spirv/unified1/extinst.glsl.std.450.grammar.json b/include/spirv/unified1/extinst.glsl.std.450.grammar.json deleted file mode 100644 index 3d9f39e7..00000000 --- a/include/spirv/unified1/extinst.glsl.std.450.grammar.json +++ /dev/null @@ -1,642 +0,0 @@ -{ - "copyright" : [ - "Copyright (c) 2014-2016 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - "version" : 100, - "revision" : 2, - "instructions" : [ - { - "opname" : "Round", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "RoundEven", - "opcode" : 2, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Trunc", - "opcode" : 3, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FAbs", - "opcode" : 4, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "SAbs", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FSign", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "SSign", - "opcode" : 7, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Floor", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Ceil", - "opcode" : 9, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Fract", - "opcode" : 10, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Radians", - "opcode" : 11, - "operands" : [ - { "kind" : "IdRef", "name" : "'degrees'" } - ] - }, - { - "opname" : "Degrees", - "opcode" : 12, - "operands" : [ - { "kind" : "IdRef", "name" : "'radians'" } - ] - }, - { - "opname" : "Sin", - "opcode" : 13, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Cos", - "opcode" : 14, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Tan", - "opcode" : 15, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Asin", - "opcode" : 16, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Acos", - "opcode" : 17, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Atan", - "opcode" : 18, - "operands" : [ - { "kind" : "IdRef", "name" : "'y_over_x'" } - ] - }, - { - "opname" : "Sinh", - "opcode" : 19, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Cosh", - "opcode" : 20, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Tanh", - "opcode" : 21, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Asinh", - "opcode" : 22, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Acosh", - "opcode" : 23, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Atanh", - "opcode" : 24, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Atan2", - "opcode" : 25, - "operands" : [ - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Pow", - "opcode" : 26, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "Exp", - "opcode" : 27, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Log", - "opcode" : 28, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Exp2", - "opcode" : 29, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Log2", - "opcode" : 30, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Sqrt", - "opcode" : 31, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "InverseSqrt", - "opcode" : 32, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Determinant", - "opcode" : 33, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "MatrixInverse", - "opcode" : 34, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Modf", - "opcode" : 35, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'i'" } - ] - }, - { - "opname" : "ModfStruct", - "opcode" : 36, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FMin", - "opcode" : 37, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "UMin", - "opcode" : 38, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "SMin", - "opcode" : 39, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "FMax", - "opcode" : 40, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "UMax", - "opcode" : 41, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "SMax", - "opcode" : 42, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "FClamp", - "opcode" : 43, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - }, - { - "opname" : "UClamp", - "opcode" : 44, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - }, - { - "opname" : "SClamp", - "opcode" : 45, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - }, - { - "opname" : "FMix", - "opcode" : 46, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'a'" } - ] - }, - { - "opname" : "IMix", - "opcode" : 47, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'a'" } - ] - }, - { - "opname" : "Step", - "opcode" : 48, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "SmoothStep", - "opcode" : 49, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge0'" }, - { "kind" : "IdRef", "name" : "'edge1'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Fma", - "opcode" : 50, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "Frexp", - "opcode" : 51, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'exp'" } - ] - }, - { - "opname" : "FrexpStruct", - "opcode" : 52, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Ldexp", - "opcode" : 53, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'exp'" } - ] - }, - { - "opname" : "PackSnorm4x8", - "opcode" : 54, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackUnorm4x8", - "opcode" : 55, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackSnorm2x16", - "opcode" : 56, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackUnorm2x16", - "opcode" : 57, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackHalf2x16", - "opcode" : 58, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackDouble2x32", - "opcode" : 59, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ], - "capabilities" : [ "Float64" ] - }, - { - "opname" : "UnpackSnorm2x16", - "opcode" : 60, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackUnorm2x16", - "opcode" : 61, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackHalf2x16", - "opcode" : 62, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "UnpackSnorm4x8", - "opcode" : 63, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackUnorm4x8", - "opcode" : 64, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackDouble2x32", - "opcode" : 65, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ], - "capabilities" : [ "Float64" ] - }, - { - "opname" : "Length", - "opcode" : 66, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Distance", - "opcode" : 67, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "Cross", - "opcode" : 68, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "Normalize", - "opcode" : 69, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FaceForward", - "opcode" : 70, - "operands" : [ - { "kind" : "IdRef", "name" : "'N'" }, - { "kind" : "IdRef", "name" : "'I'" }, - { "kind" : "IdRef", "name" : "'Nref'" } - ] - }, - { - "opname" : "Reflect", - "opcode" : 71, - "operands" : [ - { "kind" : "IdRef", "name" : "'I'" }, - { "kind" : "IdRef", "name" : "'N'" } - ] - }, - { - "opname" : "Refract", - "opcode" : 72, - "operands" : [ - { "kind" : "IdRef", "name" : "'I'" }, - { "kind" : "IdRef", "name" : "'N'" }, - { "kind" : "IdRef", "name" : "'eta'" } - ] - }, - { - "opname" : "FindILsb", - "opcode" : 73, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "FindSMsb", - "opcode" : 74, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "FindUMsb", - "opcode" : 75, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "InterpolateAtCentroid", - "opcode" : 76, - "operands" : [ - { "kind" : "IdRef", "name" : "'interpolant'" } - ], - "capabilities" : [ "InterpolationFunction" ] - }, - { - "opname" : "InterpolateAtSample", - "opcode" : 77, - "operands" : [ - { "kind" : "IdRef", "name" : "'interpolant'" }, - { "kind" : "IdRef", "name" : "'sample'" } - ], - "capabilities" : [ "InterpolationFunction" ] - }, - { - "opname" : "InterpolateAtOffset", - "opcode" : 78, - "operands" : [ - { "kind" : "IdRef", "name" : "'interpolant'" }, - { "kind" : "IdRef", "name" : "'offset'" } - ], - "capabilities" : [ "InterpolationFunction" ] - }, - { - "opname" : "NMin", - "opcode" : 79, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "NMax", - "opcode" : 80, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "NClamp", - "opcode" : 81, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - } - ] -} diff --git a/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json b/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json deleted file mode 100644 index 15e56990..00000000 --- a/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json +++ /dev/null @@ -1,237 +0,0 @@ -{ - "revision" : 1, - "instructions" : [ - { - "opname" : "Kernel", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "Kernel" }, - { "kind" : "IdRef", "name" : "Name" } - ] - }, - { - "opname" : "ArgumentInfo", - "opcode" : 2, - "operands" : [ - { "kind" : "IdRef", "name" : "Name" }, - { "kind" : "IdRef", "name" : "Type Name", "quantifier" : "?" }, - { "kind" : "IdRef", "name" : "Address Qualifier", "quantifier" : "?" }, - { "kind" : "IdRef", "name" : "Access Qualifier", "quantifier" : "?" }, - { "kind" : "IdRef", "name" : "Type Qualifier", "quantifier" : "?" } - ] - }, - { - "opname" : "ArgumentStorageBuffer", - "opcode" : 3, - "operands" : [ - { "kind" : "IdRef", "name" : "Decl" }, - { "kind" : "IdRef", "name" : "Ordinal" }, - { "kind" : "IdRef", "name" : "DescriptorSet" }, - { "kind" : "IdRef", "name" : "Binding" }, - { "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" } - ] - }, - { - "opname" : "ArgumentUniform", - "opcode" : 4, - "operands" : [ - { "kind" : "IdRef", "name" : "Decl" }, - { "kind" : "IdRef", "name" : "Ordinal" }, - { "kind" : "IdRef", "name" : "DescriptorSet" }, - { "kind" : "IdRef", "name" : "Binding" }, - { "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" } - ] - }, - { - "opname" : "ArgumentPodStorageBuffer", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "Decl" }, - { "kind" : "IdRef", "name" : "Ordinal" }, - { "kind" : "IdRef", "name" : "DescriptorSet" }, - { "kind" : "IdRef", "name" : "Binding" }, - { "kind" : "IdRef", "name" : "Offset" }, - { "kind" : "IdRef", "name" : "Size" }, - { "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" } - ] - }, - { - "opname" : "ArgumentPodUniform", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "Decl" }, - { "kind" : "IdRef", "name" : "Ordinal" }, - { "kind" : "IdRef", "name" : "DescriptorSet" }, - { "kind" : "IdRef", "name" : "Binding" }, - { "kind" : "IdRef", "name" : "Offset" }, - { "kind" : "IdRef", "name" : "Size" }, - { "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" } - ] - }, - { - "opname" : "ArgumentPodPushConstant", - "opcode" : 7, - "operands" : [ - { "kind" : "IdRef", "name" : "Decl" }, - { "kind" : "IdRef", "name" : "Ordinal" }, - { "kind" : "IdRef", "name" : "Offset" }, - { "kind" : "IdRef", "name" : "Size" }, - { "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" } - ] - }, - { - "opname" : "ArgumentSampledImage", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "Decl" }, - { "kind" : "IdRef", "name" : "Ordinal" }, - { "kind" : "IdRef", "name" : "DescriptorSet" }, - { "kind" : "IdRef", "name" : "Binding" }, - { "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" } - ] - }, - { - "opname" : "ArgumentStorageImage", - "opcode" : 9, - "operands" : [ - { "kind" : "IdRef", "name" : "Decl" }, - { "kind" : "IdRef", "name" : "Ordinal" }, - { "kind" : "IdRef", "name" : "DescriptorSet" }, - { "kind" : "IdRef", "name" : "Binding" }, - { "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" } - ] - }, - { - "opname" : "ArgumentSampler", - "opcode" : 10, - "operands" : [ - { "kind" : "IdRef", "name" : "Decl" }, - { "kind" : "IdRef", "name" : "Ordinal" }, - { "kind" : "IdRef", "name" : "DescriptorSet" }, - { "kind" : "IdRef", "name" : "Binding" }, - { "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" } - ] - }, - { - "opname" : "ArgumentWorkgroup", - "opcode" : 11, - "operands" : [ - { "kind" : "IdRef", "name" : "Decl" }, - { "kind" : "IdRef", "name" : "Ordinal" }, - { "kind" : "IdRef", "name" : "SpecId" }, - { "kind" : "IdRef", "name" : "ElemSize" }, - { "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" } - ] - }, - { - "opname" : "SpecConstantWorkgroupSize", - "opcode" : 12, - "operands" : [ - { "kind" : "IdRef", "name" : "X" }, - { "kind" : "IdRef", "name" : "Y" }, - { "kind" : "IdRef", "name" : "Z" } - ] - }, - { - "opname" : "SpecConstantGlobalOffset", - "opcode" : 13, - "operands" : [ - { "kind" : "IdRef", "name" : "X" }, - { "kind" : "IdRef", "name" : "Y" }, - { "kind" : "IdRef", "name" : "Z" } - ] - }, - { - "opname" : "SpecConstantWorkDim", - "opcode" : 14, - "operands" : [ - { "kind" : "IdRef", "name" : "Dim" } - ] - }, - { - "opname" : "PushConstantGlobalOffset", - "opcode" : 15, - "operands" : [ - { "kind" : "IdRef", "name" : "Offset" }, - { "kind" : "IdRef", "name" : "Size" } - ] - }, - { - "opname" : "PushConstantEnqueuedLocalSize", - "opcode" : 16, - "operands" : [ - { "kind" : "IdRef", "name" : "Offset" }, - { "kind" : "IdRef", "name" : "Size" } - ] - }, - { - "opname" : "PushConstantGlobalSize", - "opcode" : 17, - "operands" : [ - { "kind" : "IdRef", "name" : "Offset" }, - { "kind" : "IdRef", "name" : "Size" } - ] - }, - { - "opname" : "PushConstantRegionOffset", - "opcode" : 18, - "operands" : [ - { "kind" : "IdRef", "name" : "Offset" }, - { "kind" : "IdRef", "name" : "Size" } - ] - }, - { - "opname" : "PushConstantNumWorkgroups", - "opcode" : 19, - "operands" : [ - { "kind" : "IdRef", "name" : "Offset" }, - { "kind" : "IdRef", "name" : "Size" } - ] - }, - { - "opname" : "PushConstantRegionGroupOffset", - "opcode" : 20, - "operands" : [ - { "kind" : "IdRef", "name" : "Offset" }, - { "kind" : "IdRef", "name" : "Size" } - ] - }, - { - "opname" : "ConstantDataStorageBuffer", - "opcode" : 21, - "operands" : [ - { "kind" : "IdRef", "name" : "DescriptorSet" }, - { "kind" : "IdRef", "name" : "Binding" }, - { "kind" : "IdRef", "name" : "Data" } - ] - }, - { - "opname" : "ConstantDataUniform", - "opcode" : 22, - "operands" : [ - { "kind" : "IdRef", "name" : "DescriptorSet" }, - { "kind" : "IdRef", "name" : "Binding" }, - { "kind" : "IdRef", "name" : "Data" } - ] - }, - { - "opname" : "LiteralSampler", - "opcode" : 23, - "operands" : [ - { "kind" : "IdRef", "name" : "DescriptorSet" }, - { "kind" : "IdRef", "name" : "Binding" }, - { "kind" : "IdRef", "name" : "Mask" } - ] - }, - { - "opname" : "PropertyRequiredWorkgroupSize", - "opcode" : 24, - "operands" : [ - { "kind" : "IdRef", "name" : "Kernel" }, - { "kind" : "IdRef", "name" : "X" }, - { "kind" : "IdRef", "name" : "Y" }, - { "kind" : "IdRef", "name" : "Z" } - ] - } - ] -} diff --git a/include/spirv/unified1/extinst.nonsemantic.debugprintf.grammar.json b/include/spirv/unified1/extinst.nonsemantic.debugprintf.grammar.json deleted file mode 100644 index 71fa7112..00000000 --- a/include/spirv/unified1/extinst.nonsemantic.debugprintf.grammar.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "revision" : 1, - "instructions" : [ - { - "opname" : "DebugPrintf", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'Format'" }, - { "kind" : "IdRef", "quantifier" : "*" } - ] - } - ] -} diff --git a/include/spirv/unified1/extinst.nonsemantic.shader.debuginfo.100.grammar.json b/include/spirv/unified1/extinst.nonsemantic.shader.debuginfo.100.grammar.json deleted file mode 100644 index f3621b0b..00000000 --- a/include/spirv/unified1/extinst.nonsemantic.shader.debuginfo.100.grammar.json +++ /dev/null @@ -1,713 +0,0 @@ -{ - "copyright" : [ - "Copyright (c) 2018 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - "version" : 100, - "revision" : 6, - "instructions" : [ - { - "opname" : "DebugInfoNone", - "opcode" : 0 - }, - { - "opname" : "DebugCompilationUnit", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'Version'" }, - { "kind" : "IdRef", "name" : "'DWARF Version'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Language'" } - ] - }, - { - "opname" : "DebugTypeBasic", - "opcode" : 2, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "IdRef", "name" : "'Encoding'" }, - { "kind" : "IdRef", "name" : "'Flags'" } - ] - }, - { - "opname" : "DebugTypePointer", - "opcode" : 3, - "operands" : [ - { "kind" : "IdRef", "name" : "'Base Type'" }, - { "kind" : "IdRef", "name" : "'Storage Class'" }, - { "kind" : "IdRef", "name" : "'Flags'" } - ] - }, - { - "opname" : "DebugTypeQualifier", - "opcode" : 4, - "operands" : [ - { "kind" : "IdRef", "name" : "'Base Type'" }, - { "kind" : "IdRef", "name" : "'Type Qualifier'" } - ] - }, - { - "opname" : "DebugTypeArray", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'Base Type'" }, - { "kind" : "IdRef", "name" : "'Component Counts'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugTypeVector", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'Base Type'" }, - { "kind" : "IdRef", "name" : "'Component Count'" } - ] - }, - { - "opname" : "DebugTypedef", - "opcode" : 7, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Base Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" } - ] - }, - { - "opname" : "DebugTypeFunction", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "'Flags'" }, - { "kind" : "IdRef", "name" : "'Return Type'" }, - { "kind" : "IdRef", "name" : "'Parameter Types'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugTypeEnum", - "opcode" : 9, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Underlying Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "IdRef", "name" : "'Flags'" }, - { "kind" : "PairIdRefIdRef", "name" : "'Value, Name, Value, Name, ...'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugTypeComposite", - "opcode" : 10, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Tag'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Linkage Name'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "IdRef", "name" : "'Flags'" }, - { "kind" : "IdRef", "name" : "'Members'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugTypeMember", - "opcode" : 11, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "IdRef", "name" : "'Flags'" }, - { "kind" : "IdRef", "name" : "'Value'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugTypeInheritance", - "opcode" : 12, - "operands" : [ - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "IdRef", "name" : "'Flags'" } - ] - }, - { - "opname" : "DebugTypePtrToMember", - "opcode" : 13, - "operands" : [ - { "kind" : "IdRef", "name" : "'Member Type'" }, - { "kind" : "IdRef", "name" : "'Parent'" } - ] - }, - { - "opname" : "DebugTypeTemplate", - "opcode" : 14, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "IdRef", "name" : "'Parameters'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugTypeTemplateParameter", - "opcode" : 15, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Actual Type'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Column'" } - ] - }, - { - "opname" : "DebugTypeTemplateTemplateParameter", - "opcode" : 16, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Template Name'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Column'" } - ] - }, - { - "opname" : "DebugTypeTemplateParameterPack", - "opcode" : 17, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Template Parameters'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugGlobalVariable", - "opcode" : 18, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Linkage Name'" }, - { "kind" : "IdRef", "name" : "'Variable'" }, - { "kind" : "IdRef", "name" : "'Flags'" }, - { "kind" : "IdRef", "name" : "'Static Member Declaration'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugFunctionDeclaration", - "opcode" : 19, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Linkage Name'" }, - { "kind" : "IdRef", "name" : "'Flags'" } - ] - }, - { - "opname" : "DebugFunction", - "opcode" : 20, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Linkage Name'" }, - { "kind" : "IdRef", "name" : "'Flags'" }, - { "kind" : "IdRef", "name" : "'Scope Line'" }, - { "kind" : "IdRef", "name" : "'Declaration'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugLexicalBlock", - "opcode" : 21, - "operands" : [ - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Name'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugLexicalBlockDiscriminator", - "opcode" : 22, - "operands" : [ - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Discriminator'" }, - { "kind" : "IdRef", "name" : "'Parent'" } - ] - }, - { - "opname" : "DebugScope", - "opcode" : 23, - "operands" : [ - { "kind" : "IdRef", "name" : "'Scope'" }, - { "kind" : "IdRef", "name" : "'Inlined At'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugNoScope", - "opcode" : 24 - }, - { - "opname" : "DebugInlinedAt", - "opcode" : 25, - "operands" : [ - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Scope'" }, - { "kind" : "IdRef", "name" : "'Inlined'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugLocalVariable", - "opcode" : 26, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Flags'" }, - { "kind" : "IdRef", "name" : "'Arg Number'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugInlinedVariable", - "opcode" : 27, - "operands" : [ - { "kind" : "IdRef", "name" : "'Variable'" }, - { "kind" : "IdRef", "name" : "'Inlined'" } - ] - }, - { - "opname" : "DebugDeclare", - "opcode" : 28, - "operands" : [ - { "kind" : "IdRef", "name" : "'Local Variable'" }, - { "kind" : "IdRef", "name" : "'Variable'" }, - { "kind" : "IdRef", "name" : "'Expression'" }, - { "kind" : "IdRef", "name" : "'Indexes'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugValue", - "opcode" : 29, - "operands" : [ - { "kind" : "IdRef", "name" : "'Local Variable'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Expression'" }, - { "kind" : "IdRef", "name" : "'Indexes'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugOperation", - "opcode" : 30, - "operands" : [ - { "kind" : "IdRef", "name" : "'OpCode'" }, - { "kind" : "IdRef", "name" : "'Operands ...'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugExpression", - "opcode" : 31, - "operands" : [ - { "kind" : "IdRef", "name" : "'Operands ...'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugMacroDef", - "opcode" : 32, - "operands" : [ - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Value'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugMacroUndef", - "opcode" : 33, - "operands" : [ - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Macro'" } - ] - }, - { - "opname" : "DebugImportedEntity", - "opcode" : 34, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Tag'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Entity'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" } - ] - }, - { - "opname" : "DebugSource", - "opcode" : 35, - "operands" : [ - { "kind" : "IdRef", "name" : "'File'" }, - { "kind" : "IdRef", "name" : "'Text'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugFunctionDefinition", - "opcode" : 101, - "operands" : [ - { "kind" : "IdRef", "name" : "'Function'" }, - { "kind" : "IdRef", "name" : "'Definition'" } - ] - }, - { - "opname" : "DebugSourceContinued", - "opcode" : 102, - "operands" : [ - { "kind" : "IdRef", "name" : "'Text'" } - ] - }, - { - "opname" : "DebugLine", - "opcode" : 103, - "operands" : [ - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line Start'" }, - { "kind" : "IdRef", "name" : "'Line End'" }, - { "kind" : "IdRef", "name" : "'Column Start'" }, - { "kind" : "IdRef", "name" : "'Column End'" } - ] - }, - { - "opname" : "DebugNoLine", - "opcode" : 104 - }, - { - "opname" : "DebugBuildIdentifier", - "opcode" : 105, - "operands" : [ - { "kind" : "IdRef", "name" : "'Identifier'" }, - { "kind" : "IdRef", "name" : "'Flags'" } - ] - }, - { - "opname" : "DebugStoragePath", - "opcode" : 106, - "operands" : [ - { "kind" : "IdRef", "name" : "'Path'" } - ] - }, - { - "opname" : "DebugEntryPoint", - "opcode" : 107, - "operands" : [ - { "kind" : "IdRef", "name" : "'Entry Point'" }, - { "kind" : "IdRef", "name" : "'Compilation Unit'" }, - { "kind" : "IdRef", "name" : "'Compiler Signature'" }, - { "kind" : "IdRef", "name" : "'Command-line Arguments'" } - ] - }, - { - "opname" : "DebugTypeMatrix", - "opcode" : 108, - "operands" : [ - { "kind" : "IdRef", "name" : "'Vector Type'" }, - { "kind" : "IdRef", "name" : "'Vector Count'" }, - { "kind" : "IdRef", "name" : "'Column Major'" } - ] - } - ], - "operand_kinds" : [ - { - "category" : "BitEnum", - "kind" : "DebugInfoFlags", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "FlagIsProtected", - "value" : "0x01" - }, - { - "enumerant" : "FlagIsPrivate", - "value" : "0x02" - }, - { - "enumerant" : "FlagIsPublic", - "value" : "0x03" - }, - { - "enumerant" : "FlagIsLocal", - "value" : "0x04" - }, - { - "enumerant" : "FlagIsDefinition", - "value" : "0x08" - }, - { - "enumerant" : "FlagFwdDecl", - "value" : "0x10" - }, - { - "enumerant" : "FlagArtificial", - "value" : "0x20" - }, - { - "enumerant" : "FlagExplicit", - "value" : "0x40" - }, - { - "enumerant" : "FlagPrototyped", - "value" : "0x80" - }, - { - "enumerant" : "FlagObjectPointer", - "value" : "0x100" - }, - { - "enumerant" : "FlagStaticMember", - "value" : "0x200" - }, - { - "enumerant" : "FlagIndirectVariable", - "value" : "0x400" - }, - { - "enumerant" : "FlagLValueReference", - "value" : "0x800" - }, - { - "enumerant" : "FlagRValueReference", - "value" : "0x1000" - }, - { - "enumerant" : "FlagIsOptimized", - "value" : "0x2000" - }, - { - "enumerant" : "FlagIsEnumClass", - "value" : "0x4000" - }, - { - "enumerant" : "FlagTypePassByValue", - "value" : "0x8000" - }, - { - "enumerant" : "FlagTypePassByReference", - "value" : "0x10000" - }, - { - "enumerant" : "FlagUnknownPhysicalLayout", - "value" : "0x20000" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "BuildIdentifierFlags", - "enumerants" : [ - { - "enumerant" : "IdentifierPossibleDuplicates", - "value" : "0x01" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "DebugBaseTypeAttributeEncoding", - "enumerants" : [ - { - "enumerant" : "Unspecified", - "value" : "0" - }, - { - "enumerant" : "Address", - "value" : "1" - }, - { - "enumerant" : "Boolean", - "value" : "2" - }, - { - "enumerant" : "Float", - "value" : "3" - }, - { - "enumerant" : "Signed", - "value" : "4" - }, - { - "enumerant" : "SignedChar", - "value" : "5" - }, - { - "enumerant" : "Unsigned", - "value" : "6" - }, - { - "enumerant" : "UnsignedChar", - "value" : "7" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "DebugCompositeType", - "enumerants" : [ - { - "enumerant" : "Class", - "value" : "0" - }, - { - "enumerant" : "Structure", - "value" : "1" - }, - { - "enumerant" : "Union", - "value" : "2" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "DebugTypeQualifier", - "enumerants" : [ - { - "enumerant" : "ConstType", - "value" : "0" - }, - { - "enumerant" : "VolatileType", - "value" : "1" - }, - { - "enumerant" : "RestrictType", - "value" : "2" - }, - { - "enumerant" : "AtomicType", - "value" : "3" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "DebugOperation", - "enumerants" : [ - { - "enumerant" : "Deref", - "value" : "0" - }, - { - "enumerant" : "Plus", - "value" : "1" - }, - { - "enumerant" : "Minus", - "value" : "2" - }, - { - "enumerant" : "PlusUconst", - "value" : "3", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "BitPiece", - "value" : "4", - "parameters" : [ - { "kind" : "IdRef" }, - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Swap", - "value" : "5" - }, - { - "enumerant" : "Xderef", - "value" : "6" - }, - { - "enumerant" : "StackValue", - "value" : "7" - }, - { - "enumerant" : "Constu", - "value" : "8", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Fragment", - "value" : "9", - "parameters" : [ - { "kind" : "IdRef" }, - { "kind" : "IdRef" } - ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "DebugImportedEntity", - "enumerants" : [ - { - "enumerant" : "ImportedModule", - "value" : "0" - }, - { - "enumerant" : "ImportedDeclaration", - "value" : "1" - } - ] - } - ] -} diff --git a/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json b/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json deleted file mode 100644 index 699fe403..00000000 --- a/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json +++ /dev/null @@ -1,651 +0,0 @@ -{ - "copyright" : [ - "Copyright (c) 2018 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - "version" : 200, - "revision" : 2, - "instructions" : [ - { - "opname" : "DebugInfoNone", - "opcode" : 0 - }, - { - "opname" : "DebugCompilationUnit", - "opcode" : 1, - "operands" : [ - { "kind" : "LiteralInteger", "name" : "'Version'" }, - { "kind" : "LiteralInteger", "name" : "'DWARF Version'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "SourceLanguage", "name" : "'Language'" } - ] - }, - { - "opname" : "DebugTypeBasic", - "opcode" : 2, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "DebugBaseTypeAttributeEncoding", "name" : "'Encoding'" } - ] - }, - { - "opname" : "DebugTypePointer", - "opcode" : 3, - "operands" : [ - { "kind" : "IdRef", "name" : "'Base Type'" }, - { "kind" : "StorageClass", "name" : "'Storage Class'" }, - { "kind" : "DebugInfoFlags", "name" : "'Flags'" } - ] - }, - { - "opname" : "DebugTypeQualifier", - "opcode" : 4, - "operands" : [ - { "kind" : "IdRef", "name" : "'Base Type'" }, - { "kind" : "DebugTypeQualifier", "name" : "'Type Qualifier'" } - ] - }, - { - "opname" : "DebugTypeArray", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'Base Type'" }, - { "kind" : "IdRef", "name" : "'Component Counts'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugTypeVector", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'Base Type'" }, - { "kind" : "LiteralInteger", "name" : "'Component Count'" } - ] - }, - { - "opname" : "DebugTypedef", - "opcode" : 7, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Base Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" } - ] - }, - { - "opname" : "DebugTypeFunction", - "opcode" : 8, - "operands" : [ - { "kind" : "DebugInfoFlags", "name" : "'Flags'" }, - { "kind" : "IdRef", "name" : "'Return Type'" }, - { "kind" : "IdRef", "name" : "'Parameter Types'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugTypeEnum", - "opcode" : 9, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Underlying Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "DebugInfoFlags", "name" : "'Flags'" }, - { "kind" : "PairIdRefIdRef", "name" : "'Value, Name, Value, Name, ...'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugTypeComposite", - "opcode" : 10, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "DebugCompositeType", "name" : "'Tag'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Linkage Name'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "DebugInfoFlags", "name" : "'Flags'" }, - { "kind" : "IdRef", "name" : "'Members'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugTypeMember", - "opcode" : 11, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "DebugInfoFlags", "name" : "'Flags'" }, - { "kind" : "IdRef", "name" : "'Value'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugTypeInheritance", - "opcode" : 12, - "operands" : [ - { "kind" : "IdRef", "name" : "'Child'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "DebugInfoFlags", "name" : "'Flags'" } - ] - }, - { - "opname" : "DebugTypePtrToMember", - "opcode" : 13, - "operands" : [ - { "kind" : "IdRef", "name" : "'Member Type'" }, - { "kind" : "IdRef", "name" : "'Parent'" } - ] - }, - { - "opname" : "DebugTypeTemplate", - "opcode" : 14, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "IdRef", "name" : "'Parameters'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugTypeTemplateParameter", - "opcode" : 15, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Actual Type'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" } - ] - }, - { - "opname" : "DebugTypeTemplateTemplateParameter", - "opcode" : 16, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Template Name'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" } - ] - }, - { - "opname" : "DebugTypeTemplateParameterPack", - "opcode" : 17, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Template Parameters'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugGlobalVariable", - "opcode" : 18, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Linkage Name'" }, - { "kind" : "IdRef", "name" : "'Variable'" }, - { "kind" : "DebugInfoFlags", "name" : "'Flags'" }, - { "kind" : "IdRef", "name" : "'Static Member Declaration'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugFunctionDeclaration", - "opcode" : 19, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Linkage Name'" }, - { "kind" : "DebugInfoFlags", "name" : "'Flags'" } - ] - }, - { - "opname" : "DebugFunction", - "opcode" : 20, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Linkage Name'" }, - { "kind" : "DebugInfoFlags", "name" : "'Flags'" }, - { "kind" : "LiteralInteger", "name" : "'Scope Line'" }, - { "kind" : "IdRef", "name" : "'Function'" }, - { "kind" : "IdRef", "name" : "'Declaration'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugLexicalBlock", - "opcode" : 21, - "operands" : [ - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Name'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugLexicalBlockDiscriminator", - "opcode" : 22, - "operands" : [ - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Discriminator'" }, - { "kind" : "IdRef", "name" : "'Parent'" } - ] - }, - { - "opname" : "DebugScope", - "opcode" : 23, - "operands" : [ - { "kind" : "IdRef", "name" : "'Scope'" }, - { "kind" : "IdRef", "name" : "'Inlined At'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugNoScope", - "opcode" : 24 - }, - { - "opname" : "DebugInlinedAt", - "opcode" : 25, - "operands" : [ - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Scope'" }, - { "kind" : "IdRef", "name" : "'Inlined'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugLocalVariable", - "opcode" : 26, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "DebugInfoFlags", "name" : "'Flags'" }, - { "kind" : "LiteralInteger", "name" : "'Arg Number'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugInlinedVariable", - "opcode" : 27, - "operands" : [ - { "kind" : "IdRef", "name" : "'Variable'" }, - { "kind" : "IdRef", "name" : "'Inlined'" } - ] - }, - { - "opname" : "DebugDeclare", - "opcode" : 28, - "operands" : [ - { "kind" : "IdRef", "name" : "'Local Variable'" }, - { "kind" : "IdRef", "name" : "'Variable'" }, - { "kind" : "IdRef", "name" : "'Expression'" } - ] - }, - { - "opname" : "DebugValue", - "opcode" : 29, - "operands" : [ - { "kind" : "IdRef", "name" : "'Local Variable'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Expression'" }, - { "kind" : "IdRef", "name" : "'Indexes'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugOperation", - "opcode" : 30, - "operands" : [ - { "kind" : "DebugOperation", "name" : "'OpCode'" }, - { "kind" : "LiteralInteger", "name" : "'Operands ...'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugExpression", - "opcode" : 31, - "operands" : [ - { "kind" : "IdRef", "name" : "'Operands ...'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugMacroDef", - "opcode" : 32, - "operands" : [ - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Value'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugMacroUndef", - "opcode" : 33, - "operands" : [ - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Macro'" } - ] - }, - { - "opname" : "DebugImportedEntity", - "opcode" : 34, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "DebugImportedEntity", "name" : "'Tag'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Entity'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" } - ] - }, - { - "opname" : "DebugSource", - "opcode" : 35, - "operands" : [ - { "kind" : "IdRef", "name" : "'File'" }, - { "kind" : "IdRef", "name" : "'Text'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugModuleINTEL", - "opcode" : 36, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'ConfigurationMacros'" }, - { "kind" : "IdRef", "name" : "'IncludePath'" }, - { "kind" : "IdRef", "name" : "'APINotesFile'" }, - { "kind" : "LiteralInteger", "name" : "'IsDeclaration'" } - ], - "capability" : "DebugInfoModuleINTEL" - } - ], - "operand_kinds" : [ - { - "category" : "BitEnum", - "kind" : "DebugInfoFlags", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "FlagIsProtected", - "value" : "0x01" - }, - { - "enumerant" : "FlagIsPrivate", - "value" : "0x02" - }, - { - "enumerant" : "FlagIsPublic", - "value" : "0x03" - }, - { - "enumerant" : "FlagIsLocal", - "value" : "0x04" - }, - { - "enumerant" : "FlagIsDefinition", - "value" : "0x08" - }, - { - "enumerant" : "FlagFwdDecl", - "value" : "0x10" - }, - { - "enumerant" : "FlagArtificial", - "value" : "0x20" - }, - { - "enumerant" : "FlagExplicit", - "value" : "0x40" - }, - { - "enumerant" : "FlagPrototyped", - "value" : "0x80" - }, - { - "enumerant" : "FlagObjectPointer", - "value" : "0x100" - }, - { - "enumerant" : "FlagStaticMember", - "value" : "0x200" - }, - { - "enumerant" : "FlagIndirectVariable", - "value" : "0x400" - }, - { - "enumerant" : "FlagLValueReference", - "value" : "0x800" - }, - { - "enumerant" : "FlagRValueReference", - "value" : "0x1000" - }, - { - "enumerant" : "FlagIsOptimized", - "value" : "0x2000" - }, - { - "enumerant" : "FlagIsEnumClass", - "value" : "0x4000" - }, - { - "enumerant" : "FlagTypePassByValue", - "value" : "0x8000" - }, - { - "enumerant" : "FlagTypePassByReference", - "value" : "0x10000" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "DebugBaseTypeAttributeEncoding", - "enumerants" : [ - { - "enumerant" : "Unspecified", - "value" : "0" - }, - { - "enumerant" : "Address", - "value" : "1" - }, - { - "enumerant" : "Boolean", - "value" : "2" - }, - { - "enumerant" : "Float", - "value" : "3" - }, - { - "enumerant" : "Signed", - "value" : "4" - }, - { - "enumerant" : "SignedChar", - "value" : "5" - }, - { - "enumerant" : "Unsigned", - "value" : "6" - }, - { - "enumerant" : "UnsignedChar", - "value" : "7" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "DebugCompositeType", - "enumerants" : [ - { - "enumerant" : "Class", - "value" : "0" - }, - { - "enumerant" : "Structure", - "value" : "1" - }, - { - "enumerant" : "Union", - "value" : "2" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "DebugTypeQualifier", - "enumerants" : [ - { - "enumerant" : "ConstType", - "value" : "0" - }, - { - "enumerant" : "VolatileType", - "value" : "1" - }, - { - "enumerant" : "RestrictType", - "value" : "2" - }, - { - "enumerant" : "AtomicType", - "value" : "3" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "DebugOperation", - "enumerants" : [ - { - "enumerant" : "Deref", - "value" : "0" - }, - { - "enumerant" : "Plus", - "value" : "1" - }, - { - "enumerant" : "Minus", - "value" : "2" - }, - { - "enumerant" : "PlusUconst", - "value" : "3", - "parameters" : [ - { "kind" : "LiteralInteger" } - ] - }, - { - "enumerant" : "BitPiece", - "value" : "4", - "parameters" : [ - { "kind" : "LiteralInteger" }, - { "kind" : "LiteralInteger" } - ] - }, - { - "enumerant" : "Swap", - "value" : "5" - }, - { - "enumerant" : "Xderef", - "value" : "6" - }, - { - "enumerant" : "StackValue", - "value" : "7" - }, - { - "enumerant" : "Constu", - "value" : "8", - "parameters" : [ - { "kind" : "LiteralInteger" } - ] - }, - { - "enumerant" : "Fragment", - "value" : "9", - "parameters" : [ - { "kind" : "LiteralInteger" }, - { "kind" : "LiteralInteger" } - ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "DebugImportedEntity", - "enumerants" : [ - { - "enumerant" : "ImportedModule", - "value" : "0" - }, - { - "enumerant" : "ImportedDeclaration", - "value" : "1" - } - ] - } - ] -} diff --git a/include/spirv/unified1/extinst.opencl.std.100.grammar.json b/include/spirv/unified1/extinst.opencl.std.100.grammar.json deleted file mode 100644 index 4fe45060..00000000 --- a/include/spirv/unified1/extinst.opencl.std.100.grammar.json +++ /dev/null @@ -1,1279 +0,0 @@ -{ - "copyright" : [ - "Copyright (c) 2014-2016 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - "version" : 100, - "revision" : 2, - "instructions" : [ - { - "opname" : "acos", - "opcode" : 0, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "acosh", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "acospi", - "opcode" : 2, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "asin", - "opcode" : 3, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "asinh", - "opcode" : 4, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "asinpi", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atan", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atan2", - "opcode" : 7, - "operands" : [ - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atanh", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atanpi", - "opcode" : 9, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atan2pi", - "opcode" : 10, - "operands" : [ - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cbrt", - "opcode" : 11, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "ceil", - "opcode" : 12, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "copysign", - "opcode" : 13, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "cos", - "opcode" : 14, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cosh", - "opcode" : 15, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cospi", - "opcode" : 16, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "erfc", - "opcode" : 17, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "erf", - "opcode" : 18, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "exp", - "opcode" : 19, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "exp2", - "opcode" : 20, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "exp10", - "opcode" : 21, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "expm1", - "opcode" : 22, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "fabs", - "opcode" : 23, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "fdim", - "opcode" : 24, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "floor", - "opcode" : 25, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "fma", - "opcode" : 26, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "fmax", - "opcode" : 27, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fmin", - "opcode" : 28, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fmod", - "opcode" : 29, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fract", - "opcode" : 30, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'ptr'" } - ] - }, - { - "opname" : "frexp", - "opcode" : 31, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'exp'" } - ] - }, - { - "opname" : "hypot", - "opcode" : 32, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "ilogb", - "opcode" : 33, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "ldexp", - "opcode" : 34, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'k'" } - ] - }, - { - "opname" : "lgamma", - "opcode" : 35, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "lgamma_r", - "opcode" : 36, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'signp'" } - ] - }, - { - "opname" : "log", - "opcode" : 37, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "log2", - "opcode" : 38, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "log10", - "opcode" : 39, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "log1p", - "opcode" : 40, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "logb", - "opcode" : 41, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "mad", - "opcode" : 42, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "maxmag", - "opcode" : 43, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "minmag", - "opcode" : 44, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "modf", - "opcode" : 45, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'iptr'" } - ] - }, - { - "opname" : "nan", - "opcode" : 46, - "operands" : [ - { "kind" : "IdRef", "name" : "'nancode'" } - ] - }, - { - "opname" : "nextafter", - "opcode" : 47, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "pow", - "opcode" : 48, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y" } - ] - }, - { - "opname" : "pown", - "opcode" : 49, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "powr", - "opcode" : 50, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "remainder", - "opcode" : 51, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "remquo", - "opcode" : 52, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'quo'" } - ] - }, - { - "opname" : "rint", - "opcode" : 53, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "rootn", - "opcode" : 54, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "round", - "opcode" : 55, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "rsqrt", - "opcode" : 56, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sin", - "opcode" : 57, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sincos", - "opcode" : 58, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'cosval'" } - ] - }, - { - "opname" : "sinh", - "opcode" : 59, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sinpi", - "opcode" : 60, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sqrt", - "opcode" : 61, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tan", - "opcode" : 62, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tanh", - "opcode" : 63, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tanpi", - "opcode" : 64, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tgamma", - "opcode" : 65, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "trunc", - "opcode" : 66, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_cos", - "opcode" : 67, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_divide", - "opcode" : 68, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "half_exp", - "opcode" : 69, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_exp2", - "opcode" : 70, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_exp10", - "opcode" : 71, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_log", - "opcode" : 72, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_log2", - "opcode" : 73, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_log10", - "opcode" : 74, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_powr", - "opcode" : 75, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "half_recip", - "opcode" : 76, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_rsqrt", - "opcode" : 77, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_sin", - "opcode" : 78, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_sqrt", - "opcode" : 79, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_tan", - "opcode" : 80, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_cos", - "opcode" : 81, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_divide", - "opcode" : 82, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "native_exp", - "opcode" : 83, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_exp2", - "opcode" : 84, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_exp10", - "opcode" : 85, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_log", - "opcode" : 86, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_log2", - "opcode" : 87, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_log10", - "opcode" : 88, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_powr", - "opcode" : 89, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "native_recip", - "opcode" : 90, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_rsqrt", - "opcode" : 91, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_sin", - "opcode" : 92, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_sqrt", - "opcode" : 93, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_tan", - "opcode" : 94, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_abs", - "opcode" : 141, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_abs_diff", - "opcode" : 142, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_add_sat", - "opcode" : 143, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_add_sat", - "opcode" : 144, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_hadd", - "opcode" : 145, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_hadd", - "opcode" : 146, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_rhadd", - "opcode" : 147, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_rhadd", - "opcode" : 148, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_clamp", - "opcode" : 149, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minval'" }, - { "kind" : "IdRef", "name" : "'maxval'" } - ] - }, - { - "opname" : "u_clamp", - "opcode" : 150, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minval'" }, - { "kind" : "IdRef", "name" : "'maxval'" } - ] - }, - { - "opname" : "clz", - "opcode" : 151, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "ctz", - "opcode" : 152, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_mad_hi", - "opcode" : 153, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "u_mad_sat", - "opcode" : 154, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "s_mad_sat", - "opcode" : 155, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "s_max", - "opcode" : 156, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_max", - "opcode" : 157, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_min", - "opcode" : 158, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_min", - "opcode" : 159, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_mul_hi", - "opcode" : 160, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "rotate", - "opcode" : 161, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" }, - { "kind" : "IdRef", "name" : "'i'" } - ] - }, - { - "opname" : "s_sub_sat", - "opcode" : 162, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_sub_sat", - "opcode" : 163, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_upsample", - "opcode" : 164, - "operands" : [ - { "kind" : "IdRef", "name" : "'hi'" }, - { "kind" : "IdRef", "name" : "'lo'" } - ] - }, - { - "opname" : "s_upsample", - "opcode" : 165, - "operands" : [ - { "kind" : "IdRef", "name" : "'hi'" }, - { "kind" : "IdRef", "name" : "'lo'" } - ] - }, - { - "opname" : "popcount", - "opcode" : 166, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_mad24", - "opcode" : 167, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "u_mad24", - "opcode" : 168, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "s_mul24", - "opcode" : 169, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_mul24", - "opcode" : 170, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_abs", - "opcode" : 201, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "u_abs_diff", - "opcode" : 202, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_mul_hi", - "opcode" : 203, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_mad_hi", - "opcode" : 204, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "fclamp", - "opcode" : 95, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minval'" }, - { "kind" : "IdRef", "name" : "'maxval'" } - ] - }, - { - "opname" : "degrees", - "opcode" :96, - "operands" : [ - { "kind" : "IdRef", "name" : "'radians'" } - ] - }, - { - "opname" : "fmax_common", - "opcode" : 97, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fmin_common", - "opcode" : 98, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "mix", - "opcode" : 99, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'a'" } - ] - }, - { - "opname" : "radians", - "opcode" : 100, - "operands" : [ - { "kind" : "IdRef", "name" : "'degrees'" } - ] - }, - { - "opname" : "step", - "opcode" : 101, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "smoothstep", - "opcode" : 102, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge0'" }, - { "kind" : "IdRef", "name" : "'edge1'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sign", - "opcode" : 103, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cross", - "opcode" : 104, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "distance", - "opcode" : 105, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "length", - "opcode" : 106, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "normalize", - "opcode" : 107, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "fast_distance", - "opcode" : 108, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "fast_length", - "opcode" : 109, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "fast_normalize", - "opcode" : 110, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "bitselect", - "opcode" : 186, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "select", - "opcode" : 187, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "vloadn", - "opcode" : 171, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "LiteralInteger", "name" : "'n'" } - ] - }, - { - "opname" : "vstoren", - "opcode" : 172, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vload_half", - "opcode" : 173, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vload_halfn", - "opcode" : 174, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "LiteralInteger", "name" : "'n'" } - ] - }, - { - "opname" : "vstore_half", - "opcode" : 175, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vstore_half_r", - "opcode" : 176, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "FPRoundingMode", "name" : "'mode'" } - ] - }, - { - "opname" : "vstore_halfn", - "opcode" : 177, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vstore_halfn_r", - "opcode" : 178, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "FPRoundingMode", "name" : "'mode'" } - ] - }, - { - "opname" : "vloada_halfn", - "opcode" : 179, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "LiteralInteger", "name" : "'n'" } - ] - }, - { - "opname" : "vstorea_halfn", - "opcode" : 180, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vstorea_halfn_r", - "opcode" : 181, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "FPRoundingMode", "name" : "'mode'" } - ] - }, - { - "opname" : "shuffle", - "opcode" : 182, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'shuffle mask'" } - ] - }, - { - "opname" : "shuffle2", - "opcode" : 183, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'shuffle mask'" } - ] - }, - { - "opname" : "printf", - "opcode" : 184, - "operands" : [ - { "kind" : "IdRef", "name" : "'format'" }, - { "kind" : "IdRef", "name" : "'additional arguments'", "quantifier" : "*" } - ] - }, - { - "opname" : "prefetch", - "opcode" : 185, - "operands" : [ - { "kind" : "IdRef", "name" : "'ptr'" }, - { "kind" : "IdRef", "name" : "'num elements'" } - ] - } - ] -} diff --git a/include/spirv/unified1/extinst.spv-amd-gcn-shader.grammar.json b/include/spirv/unified1/extinst.spv-amd-gcn-shader.grammar.json deleted file mode 100644 index e18251bb..00000000 --- a/include/spirv/unified1/extinst.spv-amd-gcn-shader.grammar.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "revision" : 2, - "instructions" : [ - { - "opname" : "CubeFaceIndexAMD", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'P'" } - ], - "extensions" : [ "SPV_AMD_gcn_shader" ] - }, - { - "opname" : "CubeFaceCoordAMD", - "opcode" : 2, - "operands" : [ - { "kind" : "IdRef", "name" : "'P'" } - ], - "extensions" : [ "SPV_AMD_gcn_shader" ] - }, - { - "opname" : "TimeAMD", - "opcode" : 3, - "extensions" : [ "SPV_AMD_gcn_shader" ] - } - ] -} diff --git a/include/spirv/unified1/extinst.spv-amd-shader-ballot.grammar.json b/include/spirv/unified1/extinst.spv-amd-shader-ballot.grammar.json deleted file mode 100644 index 62a470ee..00000000 --- a/include/spirv/unified1/extinst.spv-amd-shader-ballot.grammar.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "revision" : 5, - "instructions" : [ - { - "opname" : "SwizzleInvocationsAMD", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" } - ], - "extensions" : [ "SPV_AMD_shader_ballot" ] - }, - { - "opname" : "SwizzleInvocationsMaskedAMD", - "opcode" : 2, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'mask'" } - ], - "extensions" : [ "SPV_AMD_shader_ballot" ] - }, - { - "opname" : "WriteInvocationAMD", - "opcode" : 3, - "operands" : [ - { "kind" : "IdRef", "name" : "'inputValue'" }, - { "kind" : "IdRef", "name" : "'writeValue'" }, - { "kind" : "IdRef", "name" : "'invocationIndex'" } - ], - "extensions" : [ "SPV_AMD_shader_ballot" ] - }, - { - "opname" : "MbcntAMD", - "opcode" : 4, - "operands" : [ - { "kind" : "IdRef", "name" : "'mask'" } - ], - "extensions" : [ "SPV_AMD_shader_ballot" ] - } - ] -} diff --git a/include/spirv/unified1/extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json b/include/spirv/unified1/extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json deleted file mode 100644 index e156b1b6..00000000 --- a/include/spirv/unified1/extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "revision" : 4, - "instructions" : [ - { - "opname" : "InterpolateAtVertexAMD", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'interpolant'" }, - { "kind" : "IdRef", "name" : "'vertexIdx'" } - ], - "extensions" : [ "SPV_AMD_shader_explicit_vertex_parameter" ] - } - ] -} diff --git a/include/spirv/unified1/extinst.spv-amd-shader-trinary-minmax.grammar.json b/include/spirv/unified1/extinst.spv-amd-shader-trinary-minmax.grammar.json deleted file mode 100644 index c681976f..00000000 --- a/include/spirv/unified1/extinst.spv-amd-shader-trinary-minmax.grammar.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "revision" : 4, - "instructions" : [ - { - "opname" : "FMin3AMD", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ], - "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] - }, - { - "opname" : "UMin3AMD", - "opcode" : 2, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ], - "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] - }, - { - "opname" : "SMin3AMD", - "opcode" : 3, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ], - "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] - }, - { - "opname" : "FMax3AMD", - "opcode" : 4, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ], - "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] - }, - { - "opname" : "UMax3AMD", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ], - "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] - }, - { - "opname" : "SMax3AMD", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ], - "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] - }, - { - "opname" : "FMid3AMD", - "opcode" : 7, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ], - "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] - }, - { - "opname" : "UMid3AMD", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ], - "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] - }, - { - "opname" : "SMid3AMD", - "opcode" : 9, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ], - "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] - } - ] -} diff --git a/include/spirv/unified1/spirv.core.grammar.json b/include/spirv/unified1/spirv.core.grammar.json deleted file mode 100644 index 33ca8725..00000000 --- a/include/spirv/unified1/spirv.core.grammar.json +++ /dev/null @@ -1,13663 +0,0 @@ -{ - "copyright" : [ - "Copyright (c) 2014-2020 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - "magic_number" : "0x07230203", - "major_version" : 1, - "minor_version" : 5, - "revision" : 4, - "instruction_printing_class" : [ - { - "tag" : "@exclude" - }, - { - "tag" : "Miscellaneous", - "heading" : "Miscellaneous Instructions" - }, - { - "tag" : "Debug", - "heading" : "Debug Instructions" - }, - { - "tag" : "Annotation", - "heading" : "Annotation Instructions" - }, - { - "tag" : "Extension", - "heading" : "Extension Instructions" - }, - { - "tag" : "Mode-Setting", - "heading" : "Mode-Setting Instructions" - }, - { - "tag" : "Type-Declaration", - "heading" : "Type-Declaration Instructions" - }, - { - "tag" : "Constant-Creation", - "heading" : "Constant-Creation Instructions" - }, - { - "tag" : "Memory", - "heading" : "Memory Instructions" - }, - { - "tag" : "Function", - "heading" : "Function Instructions" - }, - { - "tag" : "Image", - "heading" : "Image Instructions" - }, - { - "tag" : "Conversion", - "heading" : "Conversion Instructions" - }, - { - "tag" : "Composite", - "heading" : "Composite Instructions" - }, - { - "tag" : "Arithmetic", - "heading" : "Arithmetic Instructions" - }, - { - "tag" : "Bit", - "heading" : "Bit Instructions" - }, - { - "tag" : "Relational_and_Logical", - "heading" : "Relational and Logical Instructions" - }, - { - "tag" : "Derivative", - "heading" : "Derivative Instructions" - }, - { - "tag" : "Control-Flow", - "heading" : "Control-Flow Instructions" - }, - { - "tag" : "Atomic", - "heading" : "Atomic Instructions" - }, - { - "tag" : "Primitive", - "heading" : "Primitive Instructions" - }, - { - "tag" : "Barrier", - "heading" : "Barrier Instructions" - }, - { - "tag" : "Group", - "heading" : "Group and Subgroup Instructions" - }, - { - "tag" : "Device-Side_Enqueue", - "heading" : "Device-Side Enqueue Instructions" - }, - { - "tag" : "Pipe", - "heading" : "Pipe Instructions" - }, - { - "tag" : "Non-Uniform", - "heading" : "Non-Uniform Instructions" - }, - { - "tag" : "Reserved", - "heading" : "Reserved Instructions" - } - ], - "instructions" : [ - { - "opname" : "OpNop", - "class" : "Miscellaneous", - "opcode" : 0 - }, - { - "opname" : "OpUndef", - "class" : "Miscellaneous", - "opcode" : 1, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSourceContinued", - "class" : "Debug", - "opcode" : 2, - "operands" : [ - { "kind" : "LiteralString", "name" : "'Continued Source'" } - ] - }, - { - "opname" : "OpSource", - "class" : "Debug", - "opcode" : 3, - "operands" : [ - { "kind" : "SourceLanguage" }, - { "kind" : "LiteralInteger", "name" : "'Version'" }, - { "kind" : "IdRef", "quantifier" : "?", "name" : "'File'" }, - { "kind" : "LiteralString", "quantifier" : "?", "name" : "'Source'" } - ] - }, - { - "opname" : "OpSourceExtension", - "class" : "Debug", - "opcode" : 4, - "operands" : [ - { "kind" : "LiteralString", "name" : "'Extension'" } - ] - }, - { - "opname" : "OpName", - "class" : "Debug", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpMemberName", - "class" : "Debug", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "LiteralInteger", "name" : "'Member'" }, - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpString", - "class" : "Debug", - "opcode" : 7, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralString", "name" : "'String'" } - ] - }, - { - "opname" : "OpLine", - "class" : "Debug", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "'File'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" } - ] - }, - { - "opname" : "OpExtension", - "class" : "Extension", - "opcode" : 10, - "operands" : [ - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpExtInstImport", - "class" : "Extension", - "opcode" : 11, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpExtInst", - "class" : "Extension", - "opcode" : 12, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Set'" }, - { "kind" : "LiteralExtInstInteger", "name" : "'Instruction'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Operand 1', +\n'Operand 2', +\n..." } - ] - }, - { - "opname" : "OpMemoryModel", - "class" : "Mode-Setting", - "opcode" : 14, - "operands" : [ - { "kind" : "AddressingModel" }, - { "kind" : "MemoryModel" } - ] - }, - { - "opname" : "OpEntryPoint", - "class" : "Mode-Setting", - "opcode" : 15, - "operands" : [ - { "kind" : "ExecutionModel" }, - { "kind" : "IdRef", "name" : "'Entry Point'" }, - { "kind" : "LiteralString", "name" : "'Name'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Interface'" } - ] - }, - { - "opname" : "OpExecutionMode", - "class" : "Mode-Setting", - "opcode" : 16, - "operands" : [ - { "kind" : "IdRef", "name" : "'Entry Point'" }, - { "kind" : "ExecutionMode", "name" : "'Mode'" } - ] - }, - { - "opname" : "OpCapability", - "class" : "Mode-Setting", - "opcode" : 17, - "operands" : [ - { "kind" : "Capability", "name" : "'Capability'" } - ] - }, - { - "opname" : "OpTypeVoid", - "class" : "Type-Declaration", - "opcode" : 19, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpTypeBool", - "class" : "Type-Declaration", - "opcode" : 20, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpTypeInt", - "class" : "Type-Declaration", - "opcode" : 21, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralInteger", "name" : "'Width'" }, - { "kind" : "LiteralInteger", "name" : "'Signedness'" } - ] - }, - { - "opname" : "OpTypeFloat", - "class" : "Type-Declaration", - "opcode" : 22, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralInteger", "name" : "'Width'" } - ] - }, - { - "opname" : "OpTypeVector", - "class" : "Type-Declaration", - "opcode" : 23, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Component Type'" }, - { "kind" : "LiteralInteger", "name" : "'Component Count'" } - ] - }, - { - "opname" : "OpTypeMatrix", - "class" : "Type-Declaration", - "opcode" : 24, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Column Type'" }, - { "kind" : "LiteralInteger", "name" : "'Column Count'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpTypeImage", - "class" : "Type-Declaration", - "opcode" : 25, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Type'" }, - { "kind" : "Dim" }, - { "kind" : "LiteralInteger", "name" : "'Depth'" }, - { "kind" : "LiteralInteger", "name" : "'Arrayed'" }, - { "kind" : "LiteralInteger", "name" : "'MS'" }, - { "kind" : "LiteralInteger", "name" : "'Sampled'" }, - { "kind" : "ImageFormat" }, - { "kind" : "AccessQualifier", "quantifier" : "?" } - ] - }, - { - "opname" : "OpTypeSampler", - "class" : "Type-Declaration", - "opcode" : 26, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpTypeSampledImage", - "class" : "Type-Declaration", - "opcode" : 27, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image Type'" } - ] - }, - { - "opname" : "OpTypeArray", - "class" : "Type-Declaration", - "opcode" : 28, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Element Type'" }, - { "kind" : "IdRef", "name" : "'Length'" } - ] - }, - { - "opname" : "OpTypeRuntimeArray", - "class" : "Type-Declaration", - "opcode" : 29, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Element Type'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpTypeStruct", - "class" : "Type-Declaration", - "opcode" : 30, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Member 0 type', +\n'member 1 type', +\n..." } - ] - }, - { - "opname" : "OpTypeOpaque", - "class" : "Type-Declaration", - "opcode" : 31, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralString", "name" : "The name of the opaque type." } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpTypePointer", - "class" : "Type-Declaration", - "opcode" : 32, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "StorageClass" }, - { "kind" : "IdRef", "name" : "'Type'" } - ] - }, - { - "opname" : "OpTypeFunction", - "class" : "Type-Declaration", - "opcode" : 33, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Return Type'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Parameter 0 Type', +\n'Parameter 1 Type', +\n..." } - ] - }, - { - "opname" : "OpTypeEvent", - "class" : "Type-Declaration", - "opcode" : 34, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpTypeDeviceEvent", - "class" : "Type-Declaration", - "opcode" : 35, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpTypeReserveId", - "class" : "Type-Declaration", - "opcode" : 36, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpTypeQueue", - "class" : "Type-Declaration", - "opcode" : 37, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpTypePipe", - "class" : "Type-Declaration", - "opcode" : 38, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "AccessQualifier", "name" : "'Qualifier'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpTypeForwardPointer", - "class" : "Type-Declaration", - "opcode" : 39, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer Type'" }, - { "kind" : "StorageClass" } - ], - "capabilities" : [ - "Addresses", - "PhysicalStorageBufferAddresses" - ] - }, - { - "opname" : "OpConstantTrue", - "class" : "Constant-Creation", - "opcode" : 41, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpConstantFalse", - "class" : "Constant-Creation", - "opcode" : 42, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpConstant", - "class" : "Constant-Creation", - "opcode" : 43, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralContextDependentNumber", "name" : "'Value'" } - ] - }, - { - "opname" : "OpConstantComposite", - "class" : "Constant-Creation", - "opcode" : 44, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } - ] - }, - { - "opname" : "OpConstantSampler", - "class" : "Constant-Creation", - "opcode" : 45, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "SamplerAddressingMode" }, - { "kind" : "LiteralInteger", "name" : "'Param'" }, - { "kind" : "SamplerFilterMode" } - ], - "capabilities" : [ "LiteralSampler" ] - }, - { - "opname" : "OpConstantNull", - "class" : "Constant-Creation", - "opcode" : 46, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSpecConstantTrue", - "class" : "Constant-Creation", - "opcode" : 48, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSpecConstantFalse", - "class" : "Constant-Creation", - "opcode" : 49, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSpecConstant", - "class" : "Constant-Creation", - "opcode" : 50, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralContextDependentNumber", "name" : "'Value'" } - ] - }, - { - "opname" : "OpSpecConstantComposite", - "class" : "Constant-Creation", - "opcode" : 51, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } - ] - }, - { - "opname" : "OpSpecConstantOp", - "class" : "Constant-Creation", - "opcode" : 52, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralSpecConstantOpInteger", "name" : "'Opcode'" } - ] - }, - { - "opname" : "OpFunction", - "class" : "Function", - "opcode" : 54, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "FunctionControl" }, - { "kind" : "IdRef", "name" : "'Function Type'" } - ] - }, - { - "opname" : "OpFunctionParameter", - "class" : "Function", - "opcode" : 55, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpFunctionEnd", - "class" : "Function", - "opcode" : 56 - }, - { - "opname" : "OpFunctionCall", - "class" : "Function", - "opcode" : 57, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Function'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Argument 0', +\n'Argument 1', +\n..." } - ] - }, - { - "opname" : "OpVariable", - "class" : "Memory", - "opcode" : 59, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "StorageClass" }, - { "kind" : "IdRef", "quantifier" : "?", "name" : "'Initializer'" } - ] - }, - { - "opname" : "OpImageTexelPointer", - "class" : "Memory", - "opcode" : 60, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Sample'" } - ] - }, - { - "opname" : "OpLoad", - "class" : "Memory", - "opcode" : 61, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ] - }, - { - "opname" : "OpStore", - "class" : "Memory", - "opcode" : 62, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Object'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ] - }, - { - "opname" : "OpCopyMemory", - "class" : "Memory", - "opcode" : 63, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ] - }, - { - "opname" : "OpCopyMemorySized", - "class" : "Memory", - "opcode" : 64, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpAccessChain", - "class" : "Memory", - "opcode" : 65, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpInBoundsAccessChain", - "class" : "Memory", - "opcode" : 66, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpPtrAccessChain", - "class" : "Memory", - "opcode" : 67, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Element'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ], - "capabilities" : [ - "Addresses", - "VariablePointers", - "VariablePointersStorageBuffer", - "PhysicalStorageBufferAddresses" - ] - }, - { - "opname" : "OpArrayLength", - "class" : "Memory", - "opcode" : 68, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Structure'" }, - { "kind" : "LiteralInteger", "name" : "'Array member'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpGenericPtrMemSemantics", - "class" : "Memory", - "opcode" : 69, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpInBoundsPtrAccessChain", - "class" : "Memory", - "opcode" : 70, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Element'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpDecorate", - "class" : "Annotation", - "opcode" : 71, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "Decoration" } - ] - }, - { - "opname" : "OpMemberDecorate", - "class" : "Annotation", - "opcode" : 72, - "operands" : [ - { "kind" : "IdRef", "name" : "'Structure Type'" }, - { "kind" : "LiteralInteger", "name" : "'Member'" }, - { "kind" : "Decoration" } - ] - }, - { - "opname" : "OpDecorationGroup", - "class" : "Annotation", - "opcode" : 73, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpGroupDecorate", - "class" : "Annotation", - "opcode" : 74, - "operands" : [ - { "kind" : "IdRef", "name" : "'Decoration Group'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Targets'" } - ] - }, - { - "opname" : "OpGroupMemberDecorate", - "class" : "Annotation", - "opcode" : 75, - "operands" : [ - { "kind" : "IdRef", "name" : "'Decoration Group'" }, - { "kind" : "PairIdRefLiteralInteger", "quantifier" : "*", "name" : "'Targets'" } - ] - }, - { - "opname" : "OpVectorExtractDynamic", - "class" : "Composite", - "opcode" : 77, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Index'" } - ] - }, - { - "opname" : "OpVectorInsertDynamic", - "class" : "Composite", - "opcode" : 78, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Component'" }, - { "kind" : "IdRef", "name" : "'Index'" } - ] - }, - { - "opname" : "OpVectorShuffle", - "class" : "Composite", - "opcode" : 79, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Components'" } - ] - }, - { - "opname" : "OpCompositeConstruct", - "class" : "Composite", - "opcode" : 80, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } - ] - }, - { - "opname" : "OpCompositeExtract", - "class" : "Composite", - "opcode" : 81, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Composite'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpCompositeInsert", - "class" : "Composite", - "opcode" : 82, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Object'" }, - { "kind" : "IdRef", "name" : "'Composite'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpCopyObject", - "class" : "Composite", - "opcode" : 83, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpTranspose", - "class" : "Composite", - "opcode" : 84, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Matrix'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpSampledImage", - "class" : "Image", - "opcode" : 86, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Sampler'" } - ] - }, - { - "opname" : "OpImageSampleImplicitLod", - "class" : "Image", - "opcode" : 87, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleExplicitLod", - "class" : "Image", - "opcode" : 88, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ] - }, - { - "opname" : "OpImageSampleDrefImplicitLod", - "class" : "Image", - "opcode" : 89, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleDrefExplicitLod", - "class" : "Image", - "opcode" : 90, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjImplicitLod", - "class" : "Image", - "opcode" : 91, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjExplicitLod", - "class" : "Image", - "opcode" : 92, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjDrefImplicitLod", - "class" : "Image", - "opcode" : 93, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjDrefExplicitLod", - "class" : "Image", - "opcode" : 94, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageFetch", - "class" : "Image", - "opcode" : 95, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ] - }, - { - "opname" : "OpImageGather", - "class" : "Image", - "opcode" : 96, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Component'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageDrefGather", - "class" : "Image", - "opcode" : 97, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageRead", - "class" : "Image", - "opcode" : 98, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ] - }, - { - "opname" : "OpImageWrite", - "class" : "Image", - "opcode" : 99, - "operands" : [ - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Texel'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ] - }, - { - "opname" : "OpImage", - "class" : "Image", - "opcode" : 100, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" } - ] - }, - { - "opname" : "OpImageQueryFormat", - "class" : "Image", - "opcode" : 101, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpImageQueryOrder", - "class" : "Image", - "opcode" : 102, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpImageQuerySizeLod", - "class" : "Image", - "opcode" : 103, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Level of Detail'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpImageQuerySize", - "class" : "Image", - "opcode" : 104, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpImageQueryLod", - "class" : "Image", - "opcode" : 105, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" } - ], - "capabilities" : [ "ImageQuery" ] - }, - { - "opname" : "OpImageQueryLevels", - "class" : "Image", - "opcode" : 106, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpImageQuerySamples", - "class" : "Image", - "opcode" : 107, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpConvertFToU", - "class" : "Conversion", - "opcode" : 109, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Float Value'" } - ] - }, - { - "opname" : "OpConvertFToS", - "class" : "Conversion", - "opcode" : 110, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Float Value'" } - ] - }, - { - "opname" : "OpConvertSToF", - "class" : "Conversion", - "opcode" : 111, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Signed Value'" } - ] - }, - { - "opname" : "OpConvertUToF", - "class" : "Conversion", - "opcode" : 112, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Unsigned Value'" } - ] - }, - { - "opname" : "OpUConvert", - "class" : "Conversion", - "opcode" : 113, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Unsigned Value'" } - ] - }, - { - "opname" : "OpSConvert", - "class" : "Conversion", - "opcode" : 114, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Signed Value'" } - ] - }, - { - "opname" : "OpFConvert", - "class" : "Conversion", - "opcode" : 115, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Float Value'" } - ] - }, - { - "opname" : "OpQuantizeToF16", - "class" : "Conversion", - "opcode" : 116, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpConvertPtrToU", - "class" : "Conversion", - "opcode" : 117, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ - "Addresses", - "PhysicalStorageBufferAddresses" - ] - }, - { - "opname" : "OpSatConvertSToU", - "class" : "Conversion", - "opcode" : 118, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Signed Value'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpSatConvertUToS", - "class" : "Conversion", - "opcode" : 119, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Unsigned Value'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpConvertUToPtr", - "class" : "Conversion", - "opcode" : 120, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Integer Value'" } - ], - "capabilities" : [ - "Addresses", - "PhysicalStorageBufferAddresses" - ] - }, - { - "opname" : "OpPtrCastToGeneric", - "class" : "Conversion", - "opcode" : 121, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGenericCastToPtr", - "class" : "Conversion", - "opcode" : 122, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGenericCastToPtrExplicit", - "class" : "Conversion", - "opcode" : 123, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "StorageClass", "name" : "'Storage'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpBitcast", - "class" : "Conversion", - "opcode" : 124, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpSNegate", - "class" : "Arithmetic", - "opcode" : 126, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpFNegate", - "class" : "Arithmetic", - "opcode" : 127, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpIAdd", - "class" : "Arithmetic", - "opcode" : 128, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFAdd", - "class" : "Arithmetic", - "opcode" : 129, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpISub", - "class" : "Arithmetic", - "opcode" : 130, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFSub", - "class" : "Arithmetic", - "opcode" : 131, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpIMul", - "class" : "Arithmetic", - "opcode" : 132, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFMul", - "class" : "Arithmetic", - "opcode" : 133, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUDiv", - "class" : "Arithmetic", - "opcode" : 134, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSDiv", - "class" : "Arithmetic", - "opcode" : 135, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFDiv", - "class" : "Arithmetic", - "opcode" : 136, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUMod", - "class" : "Arithmetic", - "opcode" : 137, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSRem", - "class" : "Arithmetic", - "opcode" : 138, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSMod", - "class" : "Arithmetic", - "opcode" : 139, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFRem", - "class" : "Arithmetic", - "opcode" : 140, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFMod", - "class" : "Arithmetic", - "opcode" : 141, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpVectorTimesScalar", - "class" : "Arithmetic", - "opcode" : 142, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Scalar'" } - ] - }, - { - "opname" : "OpMatrixTimesScalar", - "class" : "Arithmetic", - "opcode" : 143, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Matrix'" }, - { "kind" : "IdRef", "name" : "'Scalar'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpVectorTimesMatrix", - "class" : "Arithmetic", - "opcode" : 144, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Matrix'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpMatrixTimesVector", - "class" : "Arithmetic", - "opcode" : 145, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Matrix'" }, - { "kind" : "IdRef", "name" : "'Vector'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpMatrixTimesMatrix", - "class" : "Arithmetic", - "opcode" : 146, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'LeftMatrix'" }, - { "kind" : "IdRef", "name" : "'RightMatrix'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpOuterProduct", - "class" : "Arithmetic", - "opcode" : 147, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpDot", - "class" : "Arithmetic", - "opcode" : 148, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" } - ] - }, - { - "opname" : "OpIAddCarry", - "class" : "Arithmetic", - "opcode" : 149, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpISubBorrow", - "class" : "Arithmetic", - "opcode" : 150, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUMulExtended", - "class" : "Arithmetic", - "opcode" : 151, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSMulExtended", - "class" : "Arithmetic", - "opcode" : 152, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpAny", - "class" : "Relational_and_Logical", - "opcode" : 154, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" } - ] - }, - { - "opname" : "OpAll", - "class" : "Relational_and_Logical", - "opcode" : 155, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" } - ] - }, - { - "opname" : "OpIsNan", - "class" : "Relational_and_Logical", - "opcode" : 156, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "OpIsInf", - "class" : "Relational_and_Logical", - "opcode" : 157, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "OpIsFinite", - "class" : "Relational_and_Logical", - "opcode" : 158, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpIsNormal", - "class" : "Relational_and_Logical", - "opcode" : 159, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpSignBitSet", - "class" : "Relational_and_Logical", - "opcode" : 160, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpLessOrGreater", - "class" : "Relational_and_Logical", - "opcode" : 161, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpOrdered", - "class" : "Relational_and_Logical", - "opcode" : 162, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpUnordered", - "class" : "Relational_and_Logical", - "opcode" : 163, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpLogicalEqual", - "class" : "Relational_and_Logical", - "opcode" : 164, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalNotEqual", - "class" : "Relational_and_Logical", - "opcode" : 165, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalOr", - "class" : "Relational_and_Logical", - "opcode" : 166, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalAnd", - "class" : "Relational_and_Logical", - "opcode" : 167, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalNot", - "class" : "Relational_and_Logical", - "opcode" : 168, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpSelect", - "class" : "Relational_and_Logical", - "opcode" : 169, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Condition'" }, - { "kind" : "IdRef", "name" : "'Object 1'" }, - { "kind" : "IdRef", "name" : "'Object 2'" } - ] - }, - { - "opname" : "OpIEqual", - "class" : "Relational_and_Logical", - "opcode" : 170, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpINotEqual", - "class" : "Relational_and_Logical", - "opcode" : 171, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUGreaterThan", - "class" : "Relational_and_Logical", - "opcode" : 172, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSGreaterThan", - "class" : "Relational_and_Logical", - "opcode" : 173, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUGreaterThanEqual", - "class" : "Relational_and_Logical", - "opcode" : 174, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSGreaterThanEqual", - "class" : "Relational_and_Logical", - "opcode" : 175, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpULessThan", - "class" : "Relational_and_Logical", - "opcode" : 176, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSLessThan", - "class" : "Relational_and_Logical", - "opcode" : 177, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpULessThanEqual", - "class" : "Relational_and_Logical", - "opcode" : 178, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSLessThanEqual", - "class" : "Relational_and_Logical", - "opcode" : 179, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdEqual", - "class" : "Relational_and_Logical", - "opcode" : 180, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordEqual", - "class" : "Relational_and_Logical", - "opcode" : 181, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdNotEqual", - "class" : "Relational_and_Logical", - "opcode" : 182, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordNotEqual", - "class" : "Relational_and_Logical", - "opcode" : 183, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdLessThan", - "class" : "Relational_and_Logical", - "opcode" : 184, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordLessThan", - "class" : "Relational_and_Logical", - "opcode" : 185, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdGreaterThan", - "class" : "Relational_and_Logical", - "opcode" : 186, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordGreaterThan", - "class" : "Relational_and_Logical", - "opcode" : 187, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdLessThanEqual", - "class" : "Relational_and_Logical", - "opcode" : 188, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordLessThanEqual", - "class" : "Relational_and_Logical", - "opcode" : 189, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdGreaterThanEqual", - "class" : "Relational_and_Logical", - "opcode" : 190, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordGreaterThanEqual", - "class" : "Relational_and_Logical", - "opcode" : 191, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpShiftRightLogical", - "class" : "Bit", - "opcode" : 194, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Shift'" } - ] - }, - { - "opname" : "OpShiftRightArithmetic", - "class" : "Bit", - "opcode" : 195, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Shift'" } - ] - }, - { - "opname" : "OpShiftLeftLogical", - "class" : "Bit", - "opcode" : 196, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Shift'" } - ] - }, - { - "opname" : "OpBitwiseOr", - "class" : "Bit", - "opcode" : 197, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpBitwiseXor", - "class" : "Bit", - "opcode" : 198, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpBitwiseAnd", - "class" : "Bit", - "opcode" : 199, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpNot", - "class" : "Bit", - "opcode" : 200, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpBitFieldInsert", - "class" : "Bit", - "opcode" : 201, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Insert'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Count'" } - ], - "capabilities" : [ "Shader", "BitInstructions" ] - }, - { - "opname" : "OpBitFieldSExtract", - "class" : "Bit", - "opcode" : 202, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Count'" } - ], - "capabilities" : [ "Shader", "BitInstructions" ] - }, - { - "opname" : "OpBitFieldUExtract", - "class" : "Bit", - "opcode" : 203, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Count'" } - ], - "capabilities" : [ "Shader", "BitInstructions" ] - }, - { - "opname" : "OpBitReverse", - "class" : "Bit", - "opcode" : 204, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" } - ], - "capabilities" : [ "Shader", "BitInstructions" ] - }, - { - "opname" : "OpBitCount", - "class" : "Bit", - "opcode" : 205, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" } - ] - }, - { - "opname" : "OpDPdx", - "class" : "Derivative", - "opcode" : 207, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpDPdy", - "class" : "Derivative", - "opcode" : 208, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpFwidth", - "class" : "Derivative", - "opcode" : 209, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpDPdxFine", - "class" : "Derivative", - "opcode" : 210, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpDPdyFine", - "class" : "Derivative", - "opcode" : 211, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpFwidthFine", - "class" : "Derivative", - "opcode" : 212, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpDPdxCoarse", - "class" : "Derivative", - "opcode" : 213, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpDPdyCoarse", - "class" : "Derivative", - "opcode" : 214, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpFwidthCoarse", - "class" : "Derivative", - "opcode" : 215, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpEmitVertex", - "class" : "Primitive", - "opcode" : 218, - "capabilities" : [ "Geometry" ] - }, - { - "opname" : "OpEndPrimitive", - "class" : "Primitive", - "opcode" : 219, - "capabilities" : [ "Geometry" ] - }, - { - "opname" : "OpEmitStreamVertex", - "class" : "Primitive", - "opcode" : 220, - "operands" : [ - { "kind" : "IdRef", "name" : "'Stream'" } - ], - "capabilities" : [ "GeometryStreams" ] - }, - { - "opname" : "OpEndStreamPrimitive", - "class" : "Primitive", - "opcode" : 221, - "operands" : [ - { "kind" : "IdRef", "name" : "'Stream'" } - ], - "capabilities" : [ "GeometryStreams" ] - }, - { - "opname" : "OpControlBarrier", - "class" : "Barrier", - "opcode" : 224, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpMemoryBarrier", - "class" : "Barrier", - "opcode" : 225, - "operands" : [ - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicLoad", - "class" : "Atomic", - "opcode" : 227, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicStore", - "class" : "Atomic", - "opcode" : 228, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicExchange", - "class" : "Atomic", - "opcode" : 229, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicCompareExchange", - "class" : "Atomic", - "opcode" : 230, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Equal'" }, - { "kind" : "IdMemorySemantics", "name" : "'Unequal'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Comparator'" } - ] - }, - { - "opname" : "OpAtomicCompareExchangeWeak", - "class" : "Atomic", - "opcode" : 231, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Equal'" }, - { "kind" : "IdMemorySemantics", "name" : "'Unequal'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Comparator'" } - ], - "capabilities" : [ "Kernel" ], - "lastVersion" : "1.3" - }, - { - "opname" : "OpAtomicIIncrement", - "class" : "Atomic", - "opcode" : 232, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicIDecrement", - "class" : "Atomic", - "opcode" : 233, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicIAdd", - "class" : "Atomic", - "opcode" : 234, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicISub", - "class" : "Atomic", - "opcode" : 235, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicSMin", - "class" : "Atomic", - "opcode" : 236, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicUMin", - "class" : "Atomic", - "opcode" : 237, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicSMax", - "class" : "Atomic", - "opcode" : 238, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicUMax", - "class" : "Atomic", - "opcode" : 239, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicAnd", - "class" : "Atomic", - "opcode" : 240, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicOr", - "class" : "Atomic", - "opcode" : 241, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicXor", - "class" : "Atomic", - "opcode" : 242, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpPhi", - "class" : "Control-Flow", - "opcode" : 245, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "PairIdRefIdRef", "quantifier" : "*", "name" : "'Variable, Parent, ...'" } - ] - }, - { - "opname" : "OpLoopMerge", - "class" : "Control-Flow", - "opcode" : 246, - "operands" : [ - { "kind" : "IdRef", "name" : "'Merge Block'" }, - { "kind" : "IdRef", "name" : "'Continue Target'" }, - { "kind" : "LoopControl" } - ] - }, - { - "opname" : "OpSelectionMerge", - "class" : "Control-Flow", - "opcode" : 247, - "operands" : [ - { "kind" : "IdRef", "name" : "'Merge Block'" }, - { "kind" : "SelectionControl" } - ] - }, - { - "opname" : "OpLabel", - "class" : "Control-Flow", - "opcode" : 248, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpBranch", - "class" : "Control-Flow", - "opcode" : 249, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target Label'" } - ] - }, - { - "opname" : "OpBranchConditional", - "class" : "Control-Flow", - "opcode" : 250, - "operands" : [ - { "kind" : "IdRef", "name" : "'Condition'" }, - { "kind" : "IdRef", "name" : "'True Label'" }, - { "kind" : "IdRef", "name" : "'False Label'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Branch weights'" } - ] - }, - { - "opname" : "OpSwitch", - "class" : "Control-Flow", - "opcode" : 251, - "operands" : [ - { "kind" : "IdRef", "name" : "'Selector'" }, - { "kind" : "IdRef", "name" : "'Default'" }, - { "kind" : "PairLiteralIntegerIdRef", "quantifier" : "*", "name" : "'Target'" } - ] - }, - { - "opname" : "OpKill", - "class" : "Control-Flow", - "opcode" : 252, - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpReturn", - "class" : "Control-Flow", - "opcode" : 253 - }, - { - "opname" : "OpReturnValue", - "class" : "Control-Flow", - "opcode" : 254, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpUnreachable", - "class" : "Control-Flow", - "opcode" : 255 - }, - { - "opname" : "OpLifetimeStart", - "class" : "Control-Flow", - "opcode" : 256, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "LiteralInteger", "name" : "'Size'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpLifetimeStop", - "class" : "Control-Flow", - "opcode" : 257, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "LiteralInteger", "name" : "'Size'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGroupAsyncCopy", - "class" : "Group", - "opcode" : 259, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Destination'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Num Elements'" }, - { "kind" : "IdRef", "name" : "'Stride'" }, - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGroupWaitEvents", - "class" : "Group", - "opcode" : 260, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Num Events'" }, - { "kind" : "IdRef", "name" : "'Events List'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGroupAll", - "class" : "Group", - "opcode" : 261, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupAny", - "class" : "Group", - "opcode" : 262, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupBroadcast", - "class" : "Group", - "opcode" : 263, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'LocalId'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupIAdd", - "class" : "Group", - "opcode" : 264, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFAdd", - "class" : "Group", - "opcode" : 265, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFMin", - "class" : "Group", - "opcode" : 266, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupUMin", - "class" : "Group", - "opcode" : 267, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupSMin", - "class" : "Group", - "opcode" : 268, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFMax", - "class" : "Group", - "opcode" : 269, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupUMax", - "class" : "Group", - "opcode" : 270, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupSMax", - "class" : "Group", - "opcode" : 271, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpReadPipe", - "class" : "Pipe", - "opcode" : 274, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpWritePipe", - "class" : "Pipe", - "opcode" : 275, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReservedReadPipe", - "class" : "Pipe", - "opcode" : 276, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Index'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReservedWritePipe", - "class" : "Pipe", - "opcode" : 277, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Index'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReserveReadPipePackets", - "class" : "Pipe", - "opcode" : 278, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReserveWritePipePackets", - "class" : "Pipe", - "opcode" : 279, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpCommitReadPipe", - "class" : "Pipe", - "opcode" : 280, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpCommitWritePipe", - "class" : "Pipe", - "opcode" : 281, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpIsValidReserveId", - "class" : "Pipe", - "opcode" : 282, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGetNumPipePackets", - "class" : "Pipe", - "opcode" : 283, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGetMaxPipePackets", - "class" : "Pipe", - "opcode" : 284, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupReserveReadPipePackets", - "class" : "Pipe", - "opcode" : 285, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupReserveWritePipePackets", - "class" : "Pipe", - "opcode" : 286, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupCommitReadPipe", - "class" : "Pipe", - "opcode" : 287, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupCommitWritePipe", - "class" : "Pipe", - "opcode" : 288, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpEnqueueMarker", - "class" : "Device-Side_Enqueue", - "opcode" : 291, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Queue'" }, - { "kind" : "IdRef", "name" : "'Num Events'" }, - { "kind" : "IdRef", "name" : "'Wait Events'" }, - { "kind" : "IdRef", "name" : "'Ret Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpEnqueueKernel", - "class" : "Device-Side_Enqueue", - "opcode" : 292, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Queue'" }, - { "kind" : "IdRef", "name" : "'Flags'" }, - { "kind" : "IdRef", "name" : "'ND Range'" }, - { "kind" : "IdRef", "name" : "'Num Events'" }, - { "kind" : "IdRef", "name" : "'Wait Events'" }, - { "kind" : "IdRef", "name" : "'Ret Event'" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Local Size'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelNDrangeSubGroupCount", - "class" : "Device-Side_Enqueue", - "opcode" : 293, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'ND Range'" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelNDrangeMaxSubGroupSize", - "class" : "Device-Side_Enqueue", - "opcode" : 294, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'ND Range'" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelWorkGroupSize", - "class" : "Device-Side_Enqueue", - "opcode" : 295, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelPreferredWorkGroupSizeMultiple", - "class" : "Device-Side_Enqueue", - "opcode" : 296, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpRetainEvent", - "class" : "Device-Side_Enqueue", - "opcode" : 297, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpReleaseEvent", - "class" : "Device-Side_Enqueue", - "opcode" : 298, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpCreateUserEvent", - "class" : "Device-Side_Enqueue", - "opcode" : 299, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpIsValidEvent", - "class" : "Device-Side_Enqueue", - "opcode" : 300, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpSetUserEventStatus", - "class" : "Device-Side_Enqueue", - "opcode" : 301, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" }, - { "kind" : "IdRef", "name" : "'Status'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpCaptureEventProfilingInfo", - "class" : "Device-Side_Enqueue", - "opcode" : 302, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" }, - { "kind" : "IdRef", "name" : "'Profiling Info'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetDefaultQueue", - "class" : "Device-Side_Enqueue", - "opcode" : 303, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpBuildNDRange", - "class" : "Device-Side_Enqueue", - "opcode" : 304, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'GlobalWorkSize'" }, - { "kind" : "IdRef", "name" : "'LocalWorkSize'" }, - { "kind" : "IdRef", "name" : "'GlobalWorkOffset'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpImageSparseSampleImplicitLod", - "class" : "Image", - "opcode" : 305, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleExplicitLod", - "class" : "Image", - "opcode" : 306, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleDrefImplicitLod", - "class" : "Image", - "opcode" : 307, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleDrefExplicitLod", - "class" : "Image", - "opcode" : 308, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleProjImplicitLod", - "class" : "Image", - "opcode" : 309, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ], - "version" : "None" - }, - { - "opname" : "OpImageSparseSampleProjExplicitLod", - "class" : "Image", - "opcode" : 310, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ], - "version" : "None" - }, - { - "opname" : "OpImageSparseSampleProjDrefImplicitLod", - "class" : "Image", - "opcode" : 311, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ], - "version" : "None" - }, - { - "opname" : "OpImageSparseSampleProjDrefExplicitLod", - "class" : "Image", - "opcode" : 312, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ], - "version" : "None" - }, - { - "opname" : "OpImageSparseFetch", - "class" : "Image", - "opcode" : 313, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseGather", - "class" : "Image", - "opcode" : 314, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Component'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseDrefGather", - "class" : "Image", - "opcode" : 315, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseTexelsResident", - "class" : "Image", - "opcode" : 316, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Resident Code'" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpNoLine", - "class" : "Debug", - "opcode" : 317 - }, - { - "opname" : "OpAtomicFlagTestAndSet", - "class" : "Atomic", - "opcode" : 318, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpAtomicFlagClear", - "class" : "Atomic", - "opcode" : 319, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpImageSparseRead", - "class" : "Image", - "opcode" : 320, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpSizeOf", - "class" : "Miscellaneous", - "opcode" : 321, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Addresses" ], - "version" : "1.1" - }, - { - "opname" : "OpTypePipeStorage", - "class" : "Type-Declaration", - "opcode" : 322, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "PipeStorage" ], - "version" : "1.1" - }, - { - "opname" : "OpConstantPipeStorage", - "class" : "Pipe", - "opcode" : 323, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralInteger", "name" : "'Packet Size'" }, - { "kind" : "LiteralInteger", "name" : "'Packet Alignment'" }, - { "kind" : "LiteralInteger", "name" : "'Capacity'" } - ], - "capabilities" : [ "PipeStorage" ], - "version" : "1.1" - }, - { - "opname" : "OpCreatePipeFromPipeStorage", - "class" : "Pipe", - "opcode" : 324, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe Storage'" } - ], - "capabilities" : [ "PipeStorage" ], - "version" : "1.1" - }, - { - "opname" : "OpGetKernelLocalSizeForSubgroupCount", - "class" : "Device-Side_Enqueue", - "opcode" : 325, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Subgroup Count'" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "SubgroupDispatch" ], - "version" : "1.1" - }, - { - "opname" : "OpGetKernelMaxNumSubgroups", - "class" : "Device-Side_Enqueue", - "opcode" : 326, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "SubgroupDispatch" ], - "version" : "1.1" - }, - { - "opname" : "OpTypeNamedBarrier", - "class" : "Type-Declaration", - "opcode" : 327, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "NamedBarrier" ], - "version" : "1.1" - }, - { - "opname" : "OpNamedBarrierInitialize", - "class" : "Barrier", - "opcode" : 328, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Subgroup Count'" } - ], - "capabilities" : [ "NamedBarrier" ], - "version" : "1.1" - }, - { - "opname" : "OpMemoryNamedBarrier", - "class" : "Barrier", - "opcode" : 329, - "operands" : [ - { "kind" : "IdRef", "name" : "'Named Barrier'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ], - "capabilities" : [ "NamedBarrier" ], - "version" : "1.1" - }, - { - "opname" : "OpModuleProcessed", - "class" : "Debug", - "opcode" : 330, - "operands" : [ - { "kind" : "LiteralString", "name" : "'Process'" } - ], - "version" : "1.1" - }, - { - "opname" : "OpExecutionModeId", - "class" : "Mode-Setting", - "opcode" : 331, - "operands" : [ - { "kind" : "IdRef", "name" : "'Entry Point'" }, - { "kind" : "ExecutionMode", "name" : "'Mode'" } - ], - "version" : "1.2" - }, - { - "opname" : "OpDecorateId", - "class" : "Annotation", - "opcode" : 332, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "Decoration" } - ], - "extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ], - "version" : "1.2" - }, - { - "opname" : "OpGroupNonUniformElect", - "class" : "Non-Uniform", - "opcode" : 333, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" } - ], - "capabilities" : [ "GroupNonUniform" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformAll", - "class" : "Non-Uniform", - "opcode" : 334, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "GroupNonUniformVote" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformAny", - "class" : "Non-Uniform", - "opcode" : 335, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "GroupNonUniformVote" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformAllEqual", - "class" : "Non-Uniform", - "opcode" : 336, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "GroupNonUniformVote" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformBroadcast", - "class" : "Non-Uniform", - "opcode" : 337, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Id'" } - ], - "capabilities" : [ "GroupNonUniformBallot" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformBroadcastFirst", - "class" : "Non-Uniform", - "opcode" : 338, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "GroupNonUniformBallot" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformBallot", - "class" : "Non-Uniform", - "opcode" : 339, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "GroupNonUniformBallot" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformInverseBallot", - "class" : "Non-Uniform", - "opcode" : 340, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "GroupNonUniformBallot" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformBallotBitExtract", - "class" : "Non-Uniform", - "opcode" : 341, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Index'" } - ], - "capabilities" : [ "GroupNonUniformBallot" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformBallotBitCount", - "class" : "Non-Uniform", - "opcode" : 342, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "GroupNonUniformBallot" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformBallotFindLSB", - "class" : "Non-Uniform", - "opcode" : 343, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "GroupNonUniformBallot" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformBallotFindMSB", - "class" : "Non-Uniform", - "opcode" : 344, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "GroupNonUniformBallot" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformShuffle", - "class" : "Non-Uniform", - "opcode" : 345, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Id'" } - ], - "capabilities" : [ "GroupNonUniformShuffle" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformShuffleXor", - "class" : "Non-Uniform", - "opcode" : 346, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Mask'" } - ], - "capabilities" : [ "GroupNonUniformShuffle" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformShuffleUp", - "class" : "Non-Uniform", - "opcode" : 347, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Delta'" } - ], - "capabilities" : [ "GroupNonUniformShuffleRelative" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformShuffleDown", - "class" : "Non-Uniform", - "opcode" : 348, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Delta'" } - ], - "capabilities" : [ "GroupNonUniformShuffleRelative" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformIAdd", - "class" : "Non-Uniform", - "opcode" : 349, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } - ], - "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformFAdd", - "class" : "Non-Uniform", - "opcode" : 350, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } - ], - "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformIMul", - "class" : "Non-Uniform", - "opcode" : 351, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } - ], - "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformFMul", - "class" : "Non-Uniform", - "opcode" : 352, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } - ], - "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformSMin", - "class" : "Non-Uniform", - "opcode" : 353, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } - ], - "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformUMin", - "class" : "Non-Uniform", - "opcode" : 354, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } - ], - "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformFMin", - "class" : "Non-Uniform", - "opcode" : 355, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } - ], - "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformSMax", - "class" : "Non-Uniform", - "opcode" : 356, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } - ], - "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformUMax", - "class" : "Non-Uniform", - "opcode" : 357, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } - ], - "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformFMax", - "class" : "Non-Uniform", - "opcode" : 358, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } - ], - "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformBitwiseAnd", - "class" : "Non-Uniform", - "opcode" : 359, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } - ], - "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformBitwiseOr", - "class" : "Non-Uniform", - "opcode" : 360, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } - ], - "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformBitwiseXor", - "class" : "Non-Uniform", - "opcode" : 361, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } - ], - "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformLogicalAnd", - "class" : "Non-Uniform", - "opcode" : 362, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } - ], - "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformLogicalOr", - "class" : "Non-Uniform", - "opcode" : 363, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } - ], - "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformLogicalXor", - "class" : "Non-Uniform", - "opcode" : 364, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } - ], - "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformQuadBroadcast", - "class" : "Non-Uniform", - "opcode" : 365, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Index'" } - ], - "capabilities" : [ "GroupNonUniformQuad" ], - "version" : "1.3" - }, - { - "opname" : "OpGroupNonUniformQuadSwap", - "class" : "Non-Uniform", - "opcode" : 366, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Direction'" } - ], - "capabilities" : [ "GroupNonUniformQuad" ], - "version" : "1.3" - }, - { - "opname" : "OpCopyLogical", - "class" : "Composite", - "opcode" : 400, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ], - "version" : "1.4" - }, - { - "opname" : "OpPtrEqual", - "class" : "Memory", - "opcode" : 401, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ], - "version" : "1.4" - }, - { - "opname" : "OpPtrNotEqual", - "class" : "Memory", - "opcode" : 402, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ], - "version" : "1.4" - }, - { - "opname" : "OpPtrDiff", - "class" : "Memory", - "opcode" : 403, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ], - "capabilities" : [ "Addresses", "VariablePointers", "VariablePointersStorageBuffer" ], - "version" : "1.4" - }, - { - "opname" : "OpTerminateInvocation", - "class" : "Control-Flow", - "opcode" : 4416, - "extensions" : [ - "SPV_KHR_terminate_invocation" - ], - "capabilities" : [ "Shader" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupBallotKHR", - "class" : "Group", - "opcode" : 4421, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "SubgroupBallotKHR" ], - "extensions" : [ "SPV_KHR_shader_ballot" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupFirstInvocationKHR", - "class" : "Group", - "opcode" : 4422, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "SubgroupBallotKHR" ], - "extensions" : [ "SPV_KHR_shader_ballot" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAllKHR", - "class" : "Group", - "opcode" : 4428, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "extensions" : [ - "SPV_KHR_subgroup_vote" - ], - "capabilities" : [ "SubgroupVoteKHR" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAnyKHR", - "class" : "Group", - "opcode" : 4429, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "extensions" : [ - "SPV_KHR_subgroup_vote" - ], - "capabilities" : [ "SubgroupVoteKHR" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAllEqualKHR", - "class" : "Group", - "opcode" : 4430, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "extensions" : [ - "SPV_KHR_subgroup_vote" - ], - "capabilities" : [ "SubgroupVoteKHR" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupReadInvocationKHR", - "class" : "Group", - "opcode" : 4432, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Index'" } - ], - "capabilities" : [ "SubgroupBallotKHR" ], - "extensions" : [ "SPV_KHR_shader_ballot" ], - "version" : "None" - }, - { - "opname" : "OpTraceRayKHR", - "class" : "Reserved", - "opcode" : 4445, - "operands" : [ - - { "kind" : "IdRef", "name" : "'Accel'" }, - { "kind" : "IdRef", "name" : "'Ray Flags'" }, - { "kind" : "IdRef", "name" : "'Cull Mask'" }, - { "kind" : "IdRef", "name" : "'SBT Offset'" }, - { "kind" : "IdRef", "name" : "'SBT Stride'" }, - { "kind" : "IdRef", "name" : "'Miss Index'" }, - { "kind" : "IdRef", "name" : "'Ray Origin'" }, - { "kind" : "IdRef", "name" : "'Ray Tmin'" }, - { "kind" : "IdRef", "name" : "'Ray Direction'" }, - { "kind" : "IdRef", "name" : "'Ray Tmax'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "RayTracingKHR" ], - "extensions" : [ "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "opname" : "OpExecuteCallableKHR", - "class" : "Reserved", - "opcode" : 4446, - "operands" : [ - - { "kind" : "IdRef", "name" : "'SBT Index'" }, - { "kind" : "IdRef", "name" : "'Callable Data'" } - ], - "capabilities" : [ "RayTracingKHR" ], - "extensions" : [ "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "opname" : "OpConvertUToAccelerationStructureKHR", - "class" : "Reserved", - "opcode" : 4447, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Accel'" } - ], - "capabilities" : [ "RayTracingKHR", "RayQueryKHR" ], - "extensions" : [ "SPV_KHR_ray_tracing", "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpIgnoreIntersectionKHR", - "class" : "Reserved", - "opcode" : 4448, - "capabilities" : [ "RayTracingKHR" ], - "extensions" : [ "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "opname" : "OpTerminateRayKHR", - "class" : "Reserved", - "opcode" : 4449, - "capabilities" : [ "RayTracingKHR" ], - "extensions" : [ "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "opname" : "OpSDotKHR", - "class" : "Arithmetic", - "opcode" : 4450, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" }, - { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" } - ], - "capabilities" : [ "DotProductKHR" ], - "version" : "None" - }, - { - "opname" : "OpUDotKHR", - "class" : "Arithmetic", - "opcode" : 4451, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" }, - { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" } - ], - "capabilities" : [ "DotProductKHR" ], - "version" : "None" - }, - { - "opname" : "OpSUDotKHR", - "class" : "Arithmetic", - "opcode" : 4452, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" }, - { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" } - ], - "capabilities" : [ "DotProductKHR" ], - "version" : "None" - }, - { - "opname" : "OpSDotAccSatKHR", - "class" : "Arithmetic", - "opcode" : 4453, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" }, - { "kind" : "IdRef", "name" : "'Accumulator'" }, - { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" } - ], - "capabilities" : [ "DotProductKHR" ], - "version" : "None" - }, - { - "opname" : "OpUDotAccSatKHR", - "class" : "Arithmetic", - "opcode" : 4454, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" }, - { "kind" : "IdRef", "name" : "'Accumulator'" }, - { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" } - ], - "capabilities" : [ "DotProductKHR" ], - "version" : "None" - }, - { - "opname" : "OpSUDotAccSatKHR", - "class" : "Arithmetic", - "opcode" : 4455, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" }, - { "kind" : "IdRef", "name" : "'Accumulator'" }, - { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" } - ], - "capabilities" : [ "DotProductKHR" ], - "version" : "None" - }, - { - "opname" : "OpTypeRayQueryKHR", - "class" : "Reserved", - "opcode" : 4472, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "RayQueryKHR" ], - "extensions" : [ "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpRayQueryInitializeKHR", - "class" : "Reserved", - "opcode" : 4473, - "operands" : [ - { - "kind" : "IdRef", - "name" : "'RayQuery'" - }, - { - "kind" : "IdRef", - "name" : "'Accel'" - }, - { - "kind" : "IdRef", - "name" : "'RayFlags'" - }, - { - "kind" : "IdRef", - "name" : "'CullMask'" - }, - { - "kind" : "IdRef", - "name" : "'RayOrigin'" - }, - { - "kind" : "IdRef", - "name" : "'RayTMin'" - }, - { - "kind" : "IdRef", - "name" : "'RayDirection'" - }, - { - "kind" : "IdRef", - "name" : "'RayTMax'" - } - - ], - "capabilities" : [ "RayQueryKHR" ], - "extensions" : [ "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpRayQueryTerminateKHR", - "class" : "Reserved", - "opcode" : 4474, - "operands" : [ - { - "kind" : "IdRef", - "name" : "'RayQuery'" - } - ], - "capabilities" : [ "RayQueryKHR" ], - "extensions" : [ "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpRayQueryGenerateIntersectionKHR", - "class" : "Reserved", - "opcode" : 4475, - "operands" : [ - { - "kind" : "IdRef", - "name" : "'RayQuery'" - }, - { - "kind" : "IdRef", - "name" : "'HitT'" - } - ], - "capabilities" : [ "RayQueryKHR" ], - "extensions" : [ "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpRayQueryConfirmIntersectionKHR", - "class" : "Reserved", - "opcode" : 4476, - "operands" : [ - { - "kind" : "IdRef", - "name" : "'RayQuery'" - } - ], - "capabilities" : [ "RayQueryKHR" ], - "extensions" : [ "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpRayQueryProceedKHR", - "class" : "Reserved", - "opcode" : 4477, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { - "kind" : "IdRef", - "name" : "'RayQuery'" - } - ], - "capabilities" : [ "RayQueryKHR" ], - "extensions" : [ "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpRayQueryGetIntersectionTypeKHR", - "class" : "Reserved", - "opcode" : 4479, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { - "kind" : "IdRef", - "name" : "'RayQuery'" - }, - { - "kind" : "IdRef", - "name" : "'Intersection'" - } - ], - "capabilities" : [ "RayQueryKHR" ], - "extensions" : [ "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpGroupIAddNonUniformAMD", - "class" : "Group", - "opcode" : 5000, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ], - "extensions" : [ "SPV_AMD_shader_ballot" ], - "version" : "None" - }, - { - "opname" : "OpGroupFAddNonUniformAMD", - "class" : "Group", - "opcode" : 5001, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ], - "extensions" : [ "SPV_AMD_shader_ballot" ], - "version" : "None" - }, - { - "opname" : "OpGroupFMinNonUniformAMD", - "class" : "Group", - "opcode" : 5002, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ], - "extensions" : [ "SPV_AMD_shader_ballot" ], - "version" : "None" - }, - { - "opname" : "OpGroupUMinNonUniformAMD", - "class" : "Group", - "opcode" : 5003, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ], - "extensions" : [ "SPV_AMD_shader_ballot" ], - "version" : "None" - }, - { - "opname" : "OpGroupSMinNonUniformAMD", - "class" : "Group", - "opcode" : 5004, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ], - "extensions" : [ "SPV_AMD_shader_ballot" ], - "version" : "None" - }, - { - "opname" : "OpGroupFMaxNonUniformAMD", - "class" : "Group", - "opcode" : 5005, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ], - "extensions" : [ "SPV_AMD_shader_ballot" ], - "version" : "None" - }, - { - "opname" : "OpGroupUMaxNonUniformAMD", - "class" : "Group", - "opcode" : 5006, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ], - "extensions" : [ "SPV_AMD_shader_ballot" ], - "version" : "None" - }, - { - "opname" : "OpGroupSMaxNonUniformAMD", - "class" : "Group", - "opcode" : 5007, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ], - "extensions" : [ "SPV_AMD_shader_ballot" ], - "version" : "None" - }, - { - "opname" : "OpFragmentMaskFetchAMD", - "class" : "Reserved", - "opcode" : 5011, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" } - ], - "capabilities" : [ "FragmentMaskAMD" ], - "extensions" : [ "SPV_AMD_shader_fragment_mask" ], - "version" : "None" - }, - { - "opname" : "OpFragmentFetchAMD", - "class" : "Reserved", - "opcode" : 5012, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Fragment Index'" } - ], - "capabilities" : [ "FragmentMaskAMD" ], - "extensions" : [ "SPV_AMD_shader_fragment_mask" ], - "version" : "None" - }, - { - "opname" : "OpReadClockKHR", - "class" : "Reserved", - "opcode" : 5056, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Scope'" } - ], - "capabilities" : [ "ShaderClockKHR" ], - "extensions" : [ "SPV_KHR_shader_clock" ], - "version" : "None" - }, - { - "opname" : "OpImageSampleFootprintNV", - "class" : "Image", - "opcode" : 5283, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Granularity'" }, - { "kind" : "IdRef", "name" : "'Coarse'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "ImageFootprintNV" ], - "extensions" : [ "SPV_NV_shader_image_footprint" ], - "version" : "None" - }, - { - "opname" : "OpGroupNonUniformPartitionNV", - "class" : "Non-Uniform", - "opcode" : 5296, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "GroupNonUniformPartitionedNV" ], - "extensions" : [ "SPV_NV_shader_subgroup_partitioned" ], - "version" : "None" - }, - { - "opname" : "OpWritePackedPrimitiveIndices4x8NV", - "class" : "Reserved", - "opcode" : 5299, - "operands" : [ - { "kind" : "IdRef", "name" : "'Index Offset'" }, - { "kind" : "IdRef", "name" : "'Packed Indices'" } - ], - "capabilities" : [ "MeshShadingNV" ], - "extensions" : [ "SPV_NV_mesh_shader" ], - "version" : "None" - }, - { - "opname" : "OpReportIntersectionNV", - "class" : "Reserved", - "opcode" : 5334, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Hit'" }, - { "kind" : "IdRef", "name" : "'HitKind'" } - ], - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "opname" : "OpReportIntersectionKHR", - "class" : "Reserved", - "opcode" : 5334, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Hit'" }, - { "kind" : "IdRef", "name" : "'HitKind'" } - ], - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "opname" : "OpIgnoreIntersectionNV", - "class" : "Reserved", - "opcode" : 5335, - "capabilities" : [ "RayTracingNV" ], - "extensions" : [ "SPV_NV_ray_tracing" ], - "version" : "None" - }, - { - "opname" : "OpTerminateRayNV", - "class" : "Reserved", - "opcode" : 5336, - "capabilities" : [ "RayTracingNV" ], - "extensions" : [ "SPV_NV_ray_tracing" ], - "version" : "None" - }, - { - "opname" : "OpTraceNV", - "class" : "Reserved", - "opcode" : 5337, - "operands" : [ - - { "kind" : "IdRef", "name" : "'Accel'" }, - { "kind" : "IdRef", "name" : "'Ray Flags'" }, - { "kind" : "IdRef", "name" : "'Cull Mask'" }, - { "kind" : "IdRef", "name" : "'SBT Offset'" }, - { "kind" : "IdRef", "name" : "'SBT Stride'" }, - { "kind" : "IdRef", "name" : "'Miss Index'" }, - { "kind" : "IdRef", "name" : "'Ray Origin'" }, - { "kind" : "IdRef", "name" : "'Ray Tmin'" }, - { "kind" : "IdRef", "name" : "'Ray Direction'" }, - { "kind" : "IdRef", "name" : "'Ray Tmax'" }, - { "kind" : "IdRef", "name" : "'PayloadId'" } - ], - "capabilities" : [ "RayTracingNV" ], - "extensions" : [ "SPV_NV_ray_tracing" ], - "version" : "None" - }, - { - "opname" : "OpTraceMotionNV", - "class" : "Reserved", - "opcode" : 5338, - "operands" : [ - - { "kind" : "IdRef", "name" : "'Accel'" }, - { "kind" : "IdRef", "name" : "'Ray Flags'" }, - { "kind" : "IdRef", "name" : "'Cull Mask'" }, - { "kind" : "IdRef", "name" : "'SBT Offset'" }, - { "kind" : "IdRef", "name" : "'SBT Stride'" }, - { "kind" : "IdRef", "name" : "'Miss Index'" }, - { "kind" : "IdRef", "name" : "'Ray Origin'" }, - { "kind" : "IdRef", "name" : "'Ray Tmin'" }, - { "kind" : "IdRef", "name" : "'Ray Direction'" }, - { "kind" : "IdRef", "name" : "'Ray Tmax'" }, - { "kind" : "IdRef", "name" : "'Time'" }, - { "kind" : "IdRef", "name" : "'PayloadId'" } - ], - "capabilities" : [ "RayTracingMotionBlurNV" ], - "extensions" : [ "SPV_NV_ray_tracing_motion_blur" ], - "version" : "None" - }, - { - "opname" : "OpTraceRayMotionNV", - "class" : "Reserved", - "opcode" : 5339, - "operands" : [ - - { "kind" : "IdRef", "name" : "'Accel'" }, - { "kind" : "IdRef", "name" : "'Ray Flags'" }, - { "kind" : "IdRef", "name" : "'Cull Mask'" }, - { "kind" : "IdRef", "name" : "'SBT Offset'" }, - { "kind" : "IdRef", "name" : "'SBT Stride'" }, - { "kind" : "IdRef", "name" : "'Miss Index'" }, - { "kind" : "IdRef", "name" : "'Ray Origin'" }, - { "kind" : "IdRef", "name" : "'Ray Tmin'" }, - { "kind" : "IdRef", "name" : "'Ray Direction'" }, - { "kind" : "IdRef", "name" : "'Ray Tmax'" }, - { "kind" : "IdRef", "name" : "'Time'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "RayTracingMotionBlurNV" ], - "extensions" : [ "SPV_NV_ray_tracing_motion_blur" ], - "version" : "None" - }, - { - "opname" : "OpTypeAccelerationStructureNV", - "class" : "Reserved", - "opcode" : 5341, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "RayTracingNV" , "RayTracingKHR", "RayQueryKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing", "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpTypeAccelerationStructureKHR", - "class" : "Reserved", - "opcode" : 5341, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "RayTracingNV" , "RayTracingKHR", "RayQueryKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing", "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpExecuteCallableNV", - "class" : "Reserved", - "opcode" : 5344, - "operands" : [ - - { "kind" : "IdRef", "name" : "'SBT Index'" }, - { "kind" : "IdRef", "name" : "'Callable DataId'" } - ], - "capabilities" : [ "RayTracingNV" ], - "extensions" : [ "SPV_NV_ray_tracing" ], - "version" : "None" - }, - { - "opname" : "OpTypeCooperativeMatrixNV", - "class" : "Reserved", - "opcode" : 5358, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Component Type'" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Rows'" }, - { "kind" : "IdRef", "name" : "'Columns'" } - ], - "capabilities" : [ "CooperativeMatrixNV" ], - "extensions" : [ "SPV_NV_cooperative_matrix" ], - "version" : "None" - }, - { - "opname" : "OpCooperativeMatrixLoadNV", - "class" : "Reserved", - "opcode" : 5359, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Stride'" }, - { "kind" : "IdRef", "name" : "'Column Major'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ], - "capabilities" : [ "CooperativeMatrixNV" ], - "extensions" : [ "SPV_NV_cooperative_matrix" ], - "version" : "None" - }, - { - "opname" : "OpCooperativeMatrixStoreNV", - "class" : "Reserved", - "opcode" : 5360, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Object'" }, - { "kind" : "IdRef", "name" : "'Stride'" }, - { "kind" : "IdRef", "name" : "'Column Major'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ], - "capabilities" : [ "CooperativeMatrixNV" ], - "extensions" : [ "SPV_NV_cooperative_matrix" ], - "version" : "None" - }, - { - "opname" : "OpCooperativeMatrixMulAddNV", - "class" : "Reserved", - "opcode" : 5361, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "IdRef", "name" : "'B'" }, - { "kind" : "IdRef", "name" : "'C'" } - ], - "capabilities" : [ "CooperativeMatrixNV" ], - "extensions" : [ "SPV_NV_cooperative_matrix" ], - "version" : "None" - }, - { - "opname" : "OpCooperativeMatrixLengthNV", - "class" : "Reserved", - "opcode" : 5362, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Type'" } - ], - "capabilities" : [ "CooperativeMatrixNV" ], - "extensions" : [ "SPV_NV_cooperative_matrix" ], - "version" : "None" - }, - { - "opname" : "OpBeginInvocationInterlockEXT", - "class" : "Reserved", - "opcode" : 5364, - "capabilities" : [ "FragmentShaderSampleInterlockEXT", "FragmentShaderPixelInterlockEXT", "FragmentShaderShadingRateInterlockEXT" ], - "extensions" : [ "SPV_EXT_fragment_shader_interlock" ], - "version" : "None" - }, - { - "opname" : "OpEndInvocationInterlockEXT", - "class" : "Reserved", - "opcode" : 5365, - "capabilities" : [ "FragmentShaderSampleInterlockEXT", "FragmentShaderPixelInterlockEXT", "FragmentShaderShadingRateInterlockEXT" ], - "extensions" : [ "SPV_EXT_fragment_shader_interlock" ], - "version" : "None" - }, - { - "opname" : "OpDemoteToHelperInvocationEXT", - "class" : "Reserved", - "opcode" : 5380, - "capabilities" : [ "DemoteToHelperInvocationEXT" ], - "extensions" : [ "SPV_EXT_demote_to_helper_invocation" ], - "version" : "None" - }, - { - "opname" : "OpIsHelperInvocationEXT", - "class" : "Reserved", - "opcode" : 5381, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ], - "capabilities" : [ "DemoteToHelperInvocationEXT" ], - "extensions" : [ "SPV_EXT_demote_to_helper_invocation" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupShuffleINTEL", - "class" : "Group", - "opcode" : 5571, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Data'" }, - { "kind" : "IdRef", "name" : "'InvocationId'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupShuffleDownINTEL", - "class" : "Group", - "opcode" : 5572, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Current'" }, - { "kind" : "IdRef", "name" : "'Next'" }, - { "kind" : "IdRef", "name" : "'Delta'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupShuffleUpINTEL", - "class" : "Group", - "opcode" : 5573, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Previous'" }, - { "kind" : "IdRef", "name" : "'Current'" }, - { "kind" : "IdRef", "name" : "'Delta'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupShuffleXorINTEL", - "class" : "Group", - "opcode" : 5574, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Data'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupBlockReadINTEL", - "class" : "Group", - "opcode" : 5575, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Ptr'" } - ], - "capabilities" : [ "SubgroupBufferBlockIOINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupBlockWriteINTEL", - "class" : "Group", - "opcode" : 5576, - "operands" : [ - { "kind" : "IdRef", "name" : "'Ptr'" }, - { "kind" : "IdRef", "name" : "'Data'" } - ], - "capabilities" : [ "SubgroupBufferBlockIOINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupImageBlockReadINTEL", - "class" : "Group", - "opcode" : 5577, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" } - ], - "capabilities" : [ "SubgroupImageBlockIOINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupImageBlockWriteINTEL", - "class" : "Group", - "opcode" : 5578, - "operands" : [ - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Data'" } - ], - "capabilities" : [ "SubgroupImageBlockIOINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupImageMediaBlockReadINTEL", - "class" : "Group", - "opcode" : 5580, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Width'" }, - { "kind" : "IdRef", "name" : "'Height'" } - ], - "capabilities" : [ "SubgroupImageMediaBlockIOINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupImageMediaBlockWriteINTEL", - "class" : "Group", - "opcode" : 5581, - "operands" : [ - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Width'" }, - { "kind" : "IdRef", "name" : "'Height'" }, - { "kind" : "IdRef", "name" : "'Data'" } - ], - "capabilities" : [ "SubgroupImageMediaBlockIOINTEL" ], - "version" : "None" - }, - { - "opname" : "OpUCountLeadingZerosINTEL", - "class" : "Reserved", - "opcode" : 5585, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ], - "capabilities" : [ "IntegerFunctions2INTEL" ], - "version" : "None" - }, - { - "opname" : "OpUCountTrailingZerosINTEL", - "class" : "Reserved", - "opcode" : 5586, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ], - "capabilities" : [ "IntegerFunctions2INTEL" ], - "version" : "None" - }, - { - "opname" : "OpAbsISubINTEL", - "class" : "Reserved", - "opcode" : 5587, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ], - "capabilities" : [ "IntegerFunctions2INTEL" ], - "version" : "None" - }, - { - "opname" : "OpAbsUSubINTEL", - "class" : "Reserved", - "opcode" : 5588, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ], - "capabilities" : [ "IntegerFunctions2INTEL" ], - "version" : "None" - }, - { - "opname" : "OpIAddSatINTEL", - "class" : "Reserved", - "opcode" : 5589, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ], - "capabilities" : [ "IntegerFunctions2INTEL" ], - "version" : "None" - }, - { - "opname" : "OpUAddSatINTEL", - "class" : "Reserved", - "opcode" : 5590, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ], - "capabilities" : [ "IntegerFunctions2INTEL" ], - "version" : "None" - }, - { - "opname" : "OpIAverageINTEL", - "class" : "Reserved", - "opcode" : 5591, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ], - "capabilities" : [ "IntegerFunctions2INTEL" ], - "version" : "None" - }, - { - "opname" : "OpUAverageINTEL", - "class" : "Reserved", - "opcode" : 5592, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ], - "capabilities" : [ "IntegerFunctions2INTEL" ], - "version" : "None" - }, - { - "opname" : "OpIAverageRoundedINTEL", - "class" : "Reserved", - "opcode" : 5593, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ], - "capabilities" : [ "IntegerFunctions2INTEL" ], - "version" : "None" - }, - { - "opname" : "OpUAverageRoundedINTEL", - "class" : "Reserved", - "opcode" : 5594, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ], - "capabilities" : [ "IntegerFunctions2INTEL" ], - "version" : "None" - }, - { - "opname" : "OpISubSatINTEL", - "class" : "Reserved", - "opcode" : 5595, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ], - "capabilities" : [ "IntegerFunctions2INTEL" ], - "version" : "None" - }, - { - "opname" : "OpUSubSatINTEL", - "class" : "Reserved", - "opcode" : 5596, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ], - "capabilities" : [ "IntegerFunctions2INTEL" ], - "version" : "None" - }, - { - "opname" : "OpIMul32x16INTEL", - "class" : "Reserved", - "opcode" : 5597, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ], - "capabilities" : [ "IntegerFunctions2INTEL" ], - "version" : "None" - }, - { - "opname" : "OpUMul32x16INTEL", - "class" : "Reserved", - "opcode" : 5598, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ], - "capabilities" : [ "IntegerFunctions2INTEL" ], - "version" : "None" - }, - { - "opname" : "OpConstFunctionPointerINTEL", - "class" : "@exclude", - "opcode" : 5600, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Function'" } - ], - "capabilities" : [ "FunctionPointersINTEL" ], - "extensions" : [ "SPV_INTEL_function_pointers" ], - "version" : "None" - }, - { - "opname" : "OpFunctionPointerCallINTEL", - "class" : "@exclude", - "opcode" : 5601, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Operand 1'" } - ], - "capabilities" : [ "FunctionPointersINTEL" ], - "extensions" : [ "SPV_INTEL_function_pointers" ], - "version" : "None" - }, - { - "opname" : "OpAsmTargetINTEL", - "class" : "@exclude", - "opcode" : 5609, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralString", "name" : "'Asm target'" } - ], - "capabilities" : [ "AsmINTEL" ], - "version" : "None" - }, - { - "opname" : "OpAsmINTEL", - "class" : "@exclude", - "opcode" : 5610, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Asm type'" }, - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "LiteralString", "name" : "'Asm instructions'" }, - { "kind" : "LiteralString", "name" : "'Constraints'" } - ], - "capabilities" : [ "AsmINTEL" ], - "version" : "None" - }, - { - "opname" : "OpAsmCallINTEL", - "class" : "@exclude", - "opcode" : 5611, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Asm'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Argument 0'" } - ], - "capabilities" : [ "AsmINTEL" ], - "version" : "None" - }, - { - "opname" : "OpAtomicFMinEXT", - "class" : "Atomic", - "opcode" : 5614, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "AtomicFloat16MinMaxEXT", "AtomicFloat32MinMaxEXT", "AtomicFloat64MinMaxEXT" ], - "version" : "None" - }, - { - "opname" : "OpAtomicFMaxEXT", - "class" : "Atomic", - "opcode" : 5615, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "AtomicFloat16MinMaxEXT", "AtomicFloat32MinMaxEXT", "AtomicFloat64MinMaxEXT" ], - "version" : "None" - }, - { - "opname" : "OpAssumeTrueKHR", - "class" : "Miscellaneous", - "opcode" : 5630, - "operands" : [ - { "kind" : "IdRef", "name" : "'Condition'" } - ], - "capabilities" : [ "ExpectAssumeKHR" ], - "extensions" : [ "SPV_KHR_expect_assume" ], - "version" : "None" - }, - { - "opname" : "OpExpectKHR", - "class" : "Miscellaneous", - "opcode" : 5631, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'ExpectedValue'" } - ], - "capabilities" : [ "ExpectAssumeKHR" ], - "extensions" : [ "SPV_KHR_expect_assume" ], - "version" : "None" - }, - { - "opname" : "OpDecorateString", - "class" : "Annotation", - "opcode" : 5632, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "Decoration" } - ], - "extensions" : [ "SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1" ], - "version" : "1.4" - }, - { - "opname" : "OpDecorateStringGOOGLE", - "class" : "Annotation", - "opcode" : 5632, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "Decoration" } - ], - "extensions" : [ "SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1" ], - "version" : "1.4" - }, - { - "opname" : "OpMemberDecorateString", - "class" : "Annotation", - "opcode" : 5633, - "operands" : [ - { "kind" : "IdRef", "name" : "'Struct Type'" }, - { "kind" : "LiteralInteger", "name" : "'Member'" }, - { "kind" : "Decoration" } - ], - "extensions" : [ "SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1" ], - "version" : "1.4" - }, - { - "opname" : "OpMemberDecorateStringGOOGLE", - "class" : "Annotation", - "opcode" : 5633, - "operands" : [ - { "kind" : "IdRef", "name" : "'Struct Type'" }, - { "kind" : "LiteralInteger", "name" : "'Member'" }, - { "kind" : "Decoration" } - ], - "extensions" : [ "SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1" ], - "version" : "1.4" - }, - { - "opname" : "OpVmeImageINTEL", - "class" : "@exclude", - "opcode" : 5699, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image Type'" }, - { "kind" : "IdRef", "name" : "'Sampler'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpTypeVmeImageINTEL", - "class" : "@exclude", - "opcode" : 5700, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image Type'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpTypeAvcImePayloadINTEL", - "class" : "@exclude", - "opcode" : 5701, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpTypeAvcRefPayloadINTEL", - "class" : "@exclude", - "opcode" : 5702, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpTypeAvcSicPayloadINTEL", - "class" : "@exclude", - "opcode" : 5703, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpTypeAvcMcePayloadINTEL", - "class" : "@exclude", - "opcode" : 5704, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpTypeAvcMceResultINTEL", - "class" : "@exclude", - "opcode" : 5705, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpTypeAvcImeResultINTEL", - "class" : "@exclude", - "opcode" : 5706, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpTypeAvcImeResultSingleReferenceStreamoutINTEL", - "class" : "@exclude", - "opcode" : 5707, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpTypeAvcImeResultDualReferenceStreamoutINTEL", - "class" : "@exclude", - "opcode" : 5708, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpTypeAvcImeSingleReferenceStreaminINTEL", - "class" : "@exclude", - "opcode" : 5709, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpTypeAvcImeDualReferenceStreaminINTEL", - "class" : "@exclude", - "opcode" : 5710, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpTypeAvcRefResultINTEL", - "class" : "@exclude", - "opcode" : 5711, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpTypeAvcSicResultINTEL", - "class" : "@exclude", - "opcode" : 5712, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL", - "class" : "@exclude", - "opcode" : 5713, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Slice Type'" }, - { "kind" : "IdRef", "name" : "'Qp'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL", - "class" : "@exclude", - "opcode" : 5714, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Reference Base Penalty'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL", - "class" : "@exclude", - "opcode" : 5715, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Slice Type'" }, - { "kind" : "IdRef", "name" : "'Qp'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceSetInterShapePenaltyINTEL", - "class" : "@exclude", - "opcode" : 5716, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Packed Shape Penalty'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL", - "class" : "@exclude", - "opcode" : 5717, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Slice Type'" }, - { "kind" : "IdRef", "name" : "'Qp'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceSetInterDirectionPenaltyINTEL", - "class" : "@exclude", - "opcode" : 5718, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Direction Cost'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL", - "class" : "@exclude", - "opcode" : 5719, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Slice Type'" }, - { "kind" : "IdRef", "name" : "'Qp'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationIntraINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL", - "class" : "@exclude", - "opcode" : 5720, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Slice Type'" }, - { "kind" : "IdRef", "name" : "'Qp'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL", - "class" : "@exclude", - "opcode" : 5721, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL", - "class" : "@exclude", - "opcode" : 5722, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL", - "class" : "@exclude", - "opcode" : 5723, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL", - "class" : "@exclude", - "opcode" : 5724, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Packed Cost Center Delta'" }, - { "kind" : "IdRef", "name" : "'Packed Cost Table'" }, - { "kind" : "IdRef", "name" : "'Cost Precision'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL", - "class" : "@exclude", - "opcode" : 5725, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Slice Type'" }, - { "kind" : "IdRef", "name" : "'Qp'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationIntraINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL", - "class" : "@exclude", - "opcode" : 5726, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationIntraINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL", - "class" : "@exclude", - "opcode" : 5727, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationChromaINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceSetAcOnlyHaarINTEL", - "class" : "@exclude", - "opcode" : 5728, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL", - "class" : "@exclude", - "opcode" : 5729, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Source Field Polarity'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL", - "class" : "@exclude", - "opcode" : 5730, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Reference Field Polarity'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL", - "class" : "@exclude", - "opcode" : 5731, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Forward Reference Field Polarity'" }, - { "kind" : "IdRef", "name" : "'Backward Reference Field Polarity'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceConvertToImePayloadINTEL", - "class" : "@exclude", - "opcode" : 5732, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceConvertToImeResultINTEL", - "class" : "@exclude", - "opcode" : 5733, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceConvertToRefPayloadINTEL", - "class" : "@exclude", - "opcode" : 5734, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceConvertToRefResultINTEL", - "class" : "@exclude", - "opcode" : 5735, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceConvertToSicPayloadINTEL", - "class" : "@exclude", - "opcode" : 5736, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceConvertToSicResultINTEL", - "class" : "@exclude", - "opcode" : 5737, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceGetMotionVectorsINTEL", - "class" : "@exclude", - "opcode" : 5738, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceGetInterDistortionsINTEL", - "class" : "@exclude", - "opcode" : 5739, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceGetBestInterDistortionsINTEL", - "class" : "@exclude", - "opcode" : 5740, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceGetInterMajorShapeINTEL", - "class" : "@exclude", - "opcode" : 5741, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceGetInterMinorShapeINTEL", - "class" : "@exclude", - "opcode" : 5742, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceGetInterDirectionsINTEL", - "class" : "@exclude", - "opcode" : 5743, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceGetInterMotionVectorCountINTEL", - "class" : "@exclude", - "opcode" : 5744, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceGetInterReferenceIdsINTEL", - "class" : "@exclude", - "opcode" : 5745, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL", - "class" : "@exclude", - "opcode" : 5746, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Packed Reference Ids'" }, - { "kind" : "IdRef", "name" : "'Packed Reference Parameter Field Polarities'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeInitializeINTEL", - "class" : "@exclude", - "opcode" : 5747, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Src Coord'" }, - { "kind" : "IdRef", "name" : "'Partition Mask'" }, - { "kind" : "IdRef", "name" : "'SAD Adjustment'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeSetSingleReferenceINTEL", - "class" : "@exclude", - "opcode" : 5748, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Ref Offset'" }, - { "kind" : "IdRef", "name" : "'Search Window Config'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeSetDualReferenceINTEL", - "class" : "@exclude", - "opcode" : 5749, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Fwd Ref Offset'" }, - { "kind" : "IdRef", "name" : "'Bwd Ref Offset'" }, - { "kind" : "IdRef", "name" : "'id> Search Window Config'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeRefWindowSizeINTEL", - "class" : "@exclude", - "opcode" : 5750, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Search Window Config'" }, - { "kind" : "IdRef", "name" : "'Dual Ref'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeAdjustRefOffsetINTEL", - "class" : "@exclude", - "opcode" : 5751, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Ref Offset'" }, - { "kind" : "IdRef", "name" : "'Src Coord'" }, - { "kind" : "IdRef", "name" : "'Ref Window Size'" }, - { "kind" : "IdRef", "name" : "'Image Size'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeConvertToMcePayloadINTEL", - "class" : "@exclude", - "opcode" : 5752, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeSetMaxMotionVectorCountINTEL", - "class" : "@exclude", - "opcode" : 5753, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Max Motion Vector Count'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL", - "class" : "@exclude", - "opcode" : 5754, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL", - "class" : "@exclude", - "opcode" : 5755, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Threshold'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeSetWeightedSadINTEL", - "class" : "@exclude", - "opcode" : 5756, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Packed Sad Weights'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL", - "class" : "@exclude", - "opcode" : 5757, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Src Image'" }, - { "kind" : "IdRef", "name" : "'Ref Image'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeEvaluateWithDualReferenceINTEL", - "class" : "@exclude", - "opcode" : 5758, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Src Image'" }, - { "kind" : "IdRef", "name" : "'Fwd Ref Image'" }, - { "kind" : "IdRef", "name" : "'Bwd Ref Image'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL", - "class" : "@exclude", - "opcode" : 5759, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Src Image'" }, - { "kind" : "IdRef", "name" : "'Ref Image'" }, - { "kind" : "IdRef", "name" : "'Payload'" }, - { "kind" : "IdRef", "name" : "'Streamin Components'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL", - "class" : "@exclude", - "opcode" : 5760, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Src Image'" }, - { "kind" : "IdRef", "name" : "'Fwd Ref Image'" }, - { "kind" : "IdRef", "name" : "'Bwd Ref Image'" }, - { "kind" : "IdRef", "name" : "'Payload'" }, - { "kind" : "IdRef", "name" : "'Streamin Components'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL", - "class" : "@exclude", - "opcode" : 5761, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Src Image'" }, - { "kind" : "IdRef", "name" : "'Ref Image'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL", - "class" : "@exclude", - "opcode" : 5762, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Src Image'" }, - { "kind" : "IdRef", "name" : "'Fwd Ref Image'" }, - { "kind" : "IdRef", "name" : "'Bwd Ref Image'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL", - "class" : "@exclude", - "opcode" : 5763, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Src Image'" }, - { "kind" : "IdRef", "name" : "'Ref Image'" }, - { "kind" : "IdRef", "name" : "'Payload'" }, - { "kind" : "IdRef", "name" : "'Streamin Components'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL", - "class" : "@exclude", - "opcode" : 5764, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Src Image'" }, - { "kind" : "IdRef", "name" : "'Fwd Ref Image'" }, - { "kind" : "IdRef", "name" : "'Bwd Ref Image'" }, - { "kind" : "IdRef", "name" : "'Payload'" }, - { "kind" : "IdRef", "name" : "'Streamin Components'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeConvertToMceResultINTEL", - "class" : "@exclude", - "opcode" : 5765, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeGetSingleReferenceStreaminINTEL", - "class" : "@exclude", - "opcode" : 5766, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeGetDualReferenceStreaminINTEL", - "class" : "@exclude", - "opcode" : 5767, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL", - "class" : "@exclude", - "opcode" : 5768, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeStripDualReferenceStreamoutINTEL", - "class" : "@exclude", - "opcode" : 5769, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL", - "class" : "@exclude", - "opcode" : 5770, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" }, - { "kind" : "IdRef", "name" : "'Major Shape'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL", - "class" : "@exclude", - "opcode" : 5771, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" }, - { "kind" : "IdRef", "name" : "'Major Shape'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL", - "class" : "@exclude", - "opcode" : 5772, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" }, - { "kind" : "IdRef", "name" : "'Major Shape'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL", - "class" : "@exclude", - "opcode" : 5773, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" }, - { "kind" : "IdRef", "name" : "'Major Shape'" }, - { "kind" : "IdRef", "name" : "'Direction'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL", - "class" : "@exclude", - "opcode" : 5774, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" }, - { "kind" : "IdRef", "name" : "'Major Shape'" }, - { "kind" : "IdRef", "name" : "'Direction'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL", - "class" : "@exclude", - "opcode" : 5775, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" }, - { "kind" : "IdRef", "name" : "'Major Shape'" }, - { "kind" : "IdRef", "name" : "'Direction'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeGetBorderReachedINTEL", - "class" : "@exclude", - "opcode" : 5776, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image Select'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL", - "class" : "@exclude", - "opcode" : 5777, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL", - "class" : "@exclude", - "opcode" : 5778, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL", - "class" : "@exclude", - "opcode" : 5779, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL", - "class" : "@exclude", - "opcode" : 5780, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcFmeInitializeINTEL", - "class" : "@exclude", - "opcode" : 5781, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Src Coord'" }, - { "kind" : "IdRef", "name" : "'Motion Vectors'" }, - { "kind" : "IdRef", "name" : "'Major Shapes'" }, - { "kind" : "IdRef", "name" : "'Minor Shapes'" }, - { "kind" : "IdRef", "name" : "'Direction'" }, - { "kind" : "IdRef", "name" : "'Pixel Resolution'" }, - { "kind" : "IdRef", "name" : "'Sad Adjustment'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcBmeInitializeINTEL", - "class" : "@exclude", - "opcode" : 5782, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Src Coord'" }, - { "kind" : "IdRef", "name" : "'Motion Vectors'" }, - { "kind" : "IdRef", "name" : "'Major Shapes'" }, - { "kind" : "IdRef", "name" : "'Minor Shapes'" }, - { "kind" : "IdRef", "name" : "'Direction'" }, - { "kind" : "IdRef", "name" : "'Pixel Resolution'" }, - { "kind" : "IdRef", "name" : "'Bidirectional Weight'" }, - { "kind" : "IdRef", "name" : "'Sad Adjustment'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcRefConvertToMcePayloadINTEL", - "class" : "@exclude", - "opcode" : 5783, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcRefSetBidirectionalMixDisableINTEL", - "class" : "@exclude", - "opcode" : 5784, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcRefSetBilinearFilterEnableINTEL", - "class" : "@exclude", - "opcode" : 5785, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL", - "class" : "@exclude", - "opcode" : 5786, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Src Image'" }, - { "kind" : "IdRef", "name" : "'Ref Image'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcRefEvaluateWithDualReferenceINTEL", - "class" : "@exclude", - "opcode" : 5787, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Src Image'" }, - { "kind" : "IdRef", "name" : "'Fwd Ref Image'" }, - { "kind" : "IdRef", "name" : "'Bwd Ref Image'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL", - "class" : "@exclude", - "opcode" : 5788, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Src Image'" }, - { "kind" : "IdRef", "name" : "'Packed Reference Ids'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL", - "class" : "@exclude", - "opcode" : 5789, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Src Image'" }, - { "kind" : "IdRef", "name" : "'Packed Reference Ids'" }, - { "kind" : "IdRef", "name" : "'Packed Reference Field Polarities'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcRefConvertToMceResultINTEL", - "class" : "@exclude", - "opcode" : 5790, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcSicInitializeINTEL", - "class" : "@exclude", - "opcode" : 5791, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Src Coord'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcSicConfigureSkcINTEL", - "class" : "@exclude", - "opcode" : 5792, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Skip Block Partition Type'" }, - { "kind" : "IdRef", "name" : "'Skip Motion Vector Mask'" }, - { "kind" : "IdRef", "name" : "'Motion Vectors'" }, - { "kind" : "IdRef", "name" : "'Bidirectional Weight'" }, - { "kind" : "IdRef", "name" : "'Sad Adjustment'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcSicConfigureIpeLumaINTEL", - "class" : "@exclude", - "opcode" : 5793, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Luma Intra Partition Mask'" }, - { "kind" : "IdRef", "name" : "'Intra Neighbour Availabilty'" }, - { "kind" : "IdRef", "name" : "'Left Edge Luma Pixels'" }, - { "kind" : "IdRef", "name" : "'Upper Left Corner Luma Pixel'" }, - { "kind" : "IdRef", "name" : "'Upper Edge Luma Pixels'" }, - { "kind" : "IdRef", "name" : "'Upper Right Edge Luma Pixels'" }, - { "kind" : "IdRef", "name" : "'Sad Adjustment'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationIntraINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcSicConfigureIpeLumaChromaINTEL", - "class" : "@exclude", - "opcode" : 5794, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Luma Intra Partition Mask'" }, - { "kind" : "IdRef", "name" : "'Intra Neighbour Availabilty'" }, - { "kind" : "IdRef", "name" : "'Left Edge Luma Pixels'" }, - { "kind" : "IdRef", "name" : "'Upper Left Corner Luma Pixel'" }, - { "kind" : "IdRef", "name" : "'Upper Edge Luma Pixels'" }, - { "kind" : "IdRef", "name" : "'Upper Right Edge Luma Pixels'" }, - { "kind" : "IdRef", "name" : "'Left Edge Chroma Pixels'" }, - { "kind" : "IdRef", "name" : "'Upper Left Corner Chroma Pixel'" }, - { "kind" : "IdRef", "name" : "'Upper Edge Chroma Pixels'" }, - { "kind" : "IdRef", "name" : "'Sad Adjustment'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationChromaINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcSicGetMotionVectorMaskINTEL", - "class" : "@exclude", - "opcode" : 5795, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Skip Block Partition Type'" }, - { "kind" : "IdRef", "name" : "'Direction'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcSicConvertToMcePayloadINTEL", - "class" : "@exclude", - "opcode" : 5796, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL", - "class" : "@exclude", - "opcode" : 5797, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Packed Shape Penalty'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL", - "class" : "@exclude", - "opcode" : 5798, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Luma Mode Penalty'" }, - { "kind" : "IdRef", "name" : "'Luma Packed Neighbor Modes'" }, - { "kind" : "IdRef", "name" : "'Luma Packed Non Dc Penalty'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationIntraINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL", - "class" : "@exclude", - "opcode" : 5799, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Chroma Mode Base Penalty'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationChromaINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcSicSetBilinearFilterEnableINTEL", - "class" : "@exclude", - "opcode" : 5800, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL", - "class" : "@exclude", - "opcode" : 5801, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Packed Sad Coefficients'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL", - "class" : "@exclude", - "opcode" : 5802, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Block Based Skip Type'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcSicEvaluateIpeINTEL", - "class" : "@exclude", - "opcode" : 5803, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Src Image'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationIntraINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL", - "class" : "@exclude", - "opcode" : 5804, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Src Image'" }, - { "kind" : "IdRef", "name" : "'Ref Image'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcSicEvaluateWithDualReferenceINTEL", - "class" : "@exclude", - "opcode" : 5805, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Src Image'" }, - { "kind" : "IdRef", "name" : "'Fwd Ref Image'" }, - { "kind" : "IdRef", "name" : "'Bwd Ref Image'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL", - "class" : "@exclude", - "opcode" : 5806, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Src Image'" }, - { "kind" : "IdRef", "name" : "'Packed Reference Ids'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL", - "class" : "@exclude", - "opcode" : 5807, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Src Image'" }, - { "kind" : "IdRef", "name" : "'Packed Reference Ids'" }, - { "kind" : "IdRef", "name" : "'Packed Reference Field Polarities'" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcSicConvertToMceResultINTEL", - "class" : "@exclude", - "opcode" : 5808, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcSicGetIpeLumaShapeINTEL", - "class" : "@exclude", - "opcode" : 5809, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationIntraINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL", - "class" : "@exclude", - "opcode" : 5810, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationIntraINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL", - "class" : "@exclude", - "opcode" : 5811, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcSicGetPackedIpeLumaModesINTEL", - "class" : "@exclude", - "opcode" : 5812, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationIntraINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcSicGetIpeChromaModeINTEL", - "class" : "@exclude", - "opcode" : 5813, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationChromaINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL", - "class" : "@exclude", - "opcode" : 5814, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationIntraINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL", - "class" : "@exclude", - "opcode" : 5815, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationIntraINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSubgroupAvcSicGetInterRawSadsINTEL", - "class" : "@exclude", - "opcode" : 5816, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Payload'" } - ], - "capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ], - "version" : "None" - }, - { - "opname" : "OpVariableLengthArrayINTEL", - "class" : "@exclude", - "opcode" : 5818, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Lenght'" } - ], - "capabilities" : [ "VariableLengthArrayINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSaveMemoryINTEL", - "class" : "@exclude", - "opcode" : 5819, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ], - "capabilities" : [ "VariableLengthArrayINTEL" ], - "version" : "None" - }, - { - "opname" : "OpRestoreMemoryINTEL", - "class" : "@exclude", - "opcode" : 5820, - "operands" : [ - { "kind" : "IdRef", "name" : "'Ptr'" } - ], - "capabilities" : [ "VariableLengthArrayINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatSinCosPiINTEL", - "class" : "@exclude", - "opcode" : 5840, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'FromSign'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatCastINTEL", - "class" : "@exclude", - "opcode" : 5841, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatCastFromIntINTEL", - "class" : "@exclude", - "opcode" : 5842, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'FromSign'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatCastToIntINTEL", - "class" : "@exclude", - "opcode" : 5843, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatAddINTEL", - "class" : "@exclude", - "opcode" : 5846, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "IdRef", "name" : "'B'" }, - { "kind" : "LiteralInteger", "name" : "'M2'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatSubINTEL", - "class" : "@exclude", - "opcode" : 5847, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "IdRef", "name" : "'B'" }, - { "kind" : "LiteralInteger", "name" : "'M2'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatMulINTEL", - "class" : "@exclude", - "opcode" : 5848, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "IdRef", "name" : "'B'" }, - { "kind" : "LiteralInteger", "name" : "'M2'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatDivINTEL", - "class" : "@exclude", - "opcode" : 5849, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "IdRef", "name" : "'B'" }, - { "kind" : "LiteralInteger", "name" : "'M2'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatGTINTEL", - "class" : "@exclude", - "opcode" : 5850, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "IdRef", "name" : "'B'" }, - { "kind" : "LiteralInteger", "name" : "'M2'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatGEINTEL", - "class" : "@exclude", - "opcode" : 5851, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "IdRef", "name" : "'B'" }, - { "kind" : "LiteralInteger", "name" : "'M2'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatLTINTEL", - "class" : "@exclude", - "opcode" : 5852, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "IdRef", "name" : "'B'" }, - { "kind" : "LiteralInteger", "name" : "'M2'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatLEINTEL", - "class" : "@exclude", - "opcode" : 5853, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "IdRef", "name" : "'B'" }, - { "kind" : "LiteralInteger", "name" : "'M2'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatEQINTEL", - "class" : "@exclude", - "opcode" : 5854, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "IdRef", "name" : "'B'" }, - { "kind" : "LiteralInteger", "name" : "'M2'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatRecipINTEL", - "class" : "@exclude", - "opcode" : 5855, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatRSqrtINTEL", - "class" : "@exclude", - "opcode" : 5856, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatCbrtINTEL", - "class" : "@exclude", - "opcode" : 5857, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatHypotINTEL", - "class" : "@exclude", - "opcode" : 5858, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "IdRef", "name" : "'B'" }, - { "kind" : "LiteralInteger", "name" : "'M2'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatSqrtINTEL", - "class" : "@exclude", - "opcode" : 5859, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatLogINTEL", - "class" : "@exclude", - "opcode" : 5860, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatLog2INTEL", - "class" : "@exclude", - "opcode" : 5861, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatLog10INTEL", - "class" : "@exclude", - "opcode" : 5862, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatLog1pINTEL", - "class" : "@exclude", - "opcode" : 5863, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatExpINTEL", - "class" : "@exclude", - "opcode" : 5864, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatExp2INTEL", - "class" : "@exclude", - "opcode" : 5865, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatExp10INTEL", - "class" : "@exclude", - "opcode" : 5866, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatExpm1INTEL", - "class" : "@exclude", - "opcode" : 5867, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatSinINTEL", - "class" : "@exclude", - "opcode" : 5868, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatCosINTEL", - "class" : "@exclude", - "opcode" : 5869, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatSinCosINTEL", - "class" : "@exclude", - "opcode" : 5870, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatSinPiINTEL", - "class" : "@exclude", - "opcode" : 5871, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatCosPiINTEL", - "class" : "@exclude", - "opcode" : 5872, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatASinINTEL", - "class" : "@exclude", - "opcode" : 5873, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatASinPiINTEL", - "class" : "@exclude", - "opcode" : 5874, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatACosINTEL", - "class" : "@exclude", - "opcode" : 5875, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatACosPiINTEL", - "class" : "@exclude", - "opcode" : 5876, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatATanINTEL", - "class" : "@exclude", - "opcode" : 5877, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatATanPiINTEL", - "class" : "@exclude", - "opcode" : 5878, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatATan2INTEL", - "class" : "@exclude", - "opcode" : 5879, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "IdRef", "name" : "'B'" }, - { "kind" : "LiteralInteger", "name" : "'M2'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatPowINTEL", - "class" : "@exclude", - "opcode" : 5880, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "IdRef", "name" : "'B'" }, - { "kind" : "LiteralInteger", "name" : "'M2'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatPowRINTEL", - "class" : "@exclude", - "opcode" : 5881, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "IdRef", "name" : "'B'" }, - { "kind" : "LiteralInteger", "name" : "'M2'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpArbitraryFloatPowNINTEL", - "class" : "@exclude", - "opcode" : 5882, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'A'" }, - { "kind" : "LiteralInteger", "name" : "'M1'" }, - { "kind" : "IdRef", "name" : "'B'" }, - { "kind" : "LiteralInteger", "name" : "'Mout'" }, - { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingMode'" }, - { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" } - ], - "capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpLoopControlINTEL", - "class" : "Reserved", - "opcode" : 5887, - "operands" : [ - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Loop Control Parameters'" } - ], - "capabilities" : [ "UnstructuredLoopControlsINTEL" ], - "extensions" : [ "SPV_INTEL_unstructured_loop_controls" ], - "version" : "None" - }, - { - "opname" : "OpFixedSqrtINTEL", - "class" : "@exclude", - "opcode" : 5923, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Input Type'" }, - { "kind" : "IdRef", "name" : "'Input'" }, - { "kind" : "LiteralInteger", "name" : "'S'" }, - { "kind" : "LiteralInteger", "name" : "'I'" }, - { "kind" : "LiteralInteger", "name" : "'rI'" }, - { "kind" : "LiteralInteger", "name" : "'Q'" }, - { "kind" : "LiteralInteger", "name" : "'O'" } - ], - "capabilities" : [ "ArbitraryPrecisionFixedPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpFixedRecipINTEL", - "class" : "@exclude", - "opcode" : 5924, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Input Type'" }, - { "kind" : "IdRef", "name" : "'Input'" }, - { "kind" : "LiteralInteger", "name" : "'S'" }, - { "kind" : "LiteralInteger", "name" : "'I'" }, - { "kind" : "LiteralInteger", "name" : "'rI'" }, - { "kind" : "LiteralInteger", "name" : "'Q'" }, - { "kind" : "LiteralInteger", "name" : "'O'" } - ], - "capabilities" : [ "ArbitraryPrecisionFixedPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpFixedRsqrtINTEL", - "class" : "@exclude", - "opcode" : 5925, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Input Type'" }, - { "kind" : "IdRef", "name" : "'Input'" }, - { "kind" : "LiteralInteger", "name" : "'S'" }, - { "kind" : "LiteralInteger", "name" : "'I'" }, - { "kind" : "LiteralInteger", "name" : "'rI'" }, - { "kind" : "LiteralInteger", "name" : "'Q'" }, - { "kind" : "LiteralInteger", "name" : "'O'" } - ], - "capabilities" : [ "ArbitraryPrecisionFixedPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpFixedSinINTEL", - "class" : "@exclude", - "opcode" : 5926, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Input Type'" }, - { "kind" : "IdRef", "name" : "'Input'" }, - { "kind" : "LiteralInteger", "name" : "'S'" }, - { "kind" : "LiteralInteger", "name" : "'I'" }, - { "kind" : "LiteralInteger", "name" : "'rI'" }, - { "kind" : "LiteralInteger", "name" : "'Q'" }, - { "kind" : "LiteralInteger", "name" : "'O'" } - ], - "capabilities" : [ "ArbitraryPrecisionFixedPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpFixedCosINTEL", - "class" : "@exclude", - "opcode" : 5927, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Input Type'" }, - { "kind" : "IdRef", "name" : "'Input'" }, - { "kind" : "LiteralInteger", "name" : "'S'" }, - { "kind" : "LiteralInteger", "name" : "'I'" }, - { "kind" : "LiteralInteger", "name" : "'rI'" }, - { "kind" : "LiteralInteger", "name" : "'Q'" }, - { "kind" : "LiteralInteger", "name" : "'O'" } - ], - "capabilities" : [ "ArbitraryPrecisionFixedPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpFixedSinCosINTEL", - "class" : "@exclude", - "opcode" : 5928, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Input Type'" }, - { "kind" : "IdRef", "name" : "'Input'" }, - { "kind" : "LiteralInteger", "name" : "'S'" }, - { "kind" : "LiteralInteger", "name" : "'I'" }, - { "kind" : "LiteralInteger", "name" : "'rI'" }, - { "kind" : "LiteralInteger", "name" : "'Q'" }, - { "kind" : "LiteralInteger", "name" : "'O'" } - ], - "capabilities" : [ "ArbitraryPrecisionFixedPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpFixedSinPiINTEL", - "class" : "@exclude", - "opcode" : 5929, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Input Type'" }, - { "kind" : "IdRef", "name" : "'Input'" }, - { "kind" : "LiteralInteger", "name" : "'S'" }, - { "kind" : "LiteralInteger", "name" : "'I'" }, - { "kind" : "LiteralInteger", "name" : "'rI'" }, - { "kind" : "LiteralInteger", "name" : "'Q'" }, - { "kind" : "LiteralInteger", "name" : "'O'" } - ], - "capabilities" : [ "ArbitraryPrecisionFixedPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpFixedCosPiINTEL", - "class" : "@exclude", - "opcode" : 5930, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Input Type'" }, - { "kind" : "IdRef", "name" : "'Input'" }, - { "kind" : "LiteralInteger", "name" : "'S'" }, - { "kind" : "LiteralInteger", "name" : "'I'" }, - { "kind" : "LiteralInteger", "name" : "'rI'" }, - { "kind" : "LiteralInteger", "name" : "'Q'" }, - { "kind" : "LiteralInteger", "name" : "'O'" } - ], - "capabilities" : [ "ArbitraryPrecisionFixedPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpFixedSinCosPiINTEL", - "class" : "@exclude", - "opcode" : 5931, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Input Type'" }, - { "kind" : "IdRef", "name" : "'Input'" }, - { "kind" : "LiteralInteger", "name" : "'S'" }, - { "kind" : "LiteralInteger", "name" : "'I'" }, - { "kind" : "LiteralInteger", "name" : "'rI'" }, - { "kind" : "LiteralInteger", "name" : "'Q'" }, - { "kind" : "LiteralInteger", "name" : "'O'" } - ], - "capabilities" : [ "ArbitraryPrecisionFixedPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpFixedLogINTEL", - "class" : "@exclude", - "opcode" : 5932, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Input Type'" }, - { "kind" : "IdRef", "name" : "'Input'" }, - { "kind" : "LiteralInteger", "name" : "'S'" }, - { "kind" : "LiteralInteger", "name" : "'I'" }, - { "kind" : "LiteralInteger", "name" : "'rI'" }, - { "kind" : "LiteralInteger", "name" : "'Q'" }, - { "kind" : "LiteralInteger", "name" : "'O'" } - ], - "capabilities" : [ "ArbitraryPrecisionFixedPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpFixedExpINTEL", - "class" : "@exclude", - "opcode" : 5933, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Input Type'" }, - { "kind" : "IdRef", "name" : "'Input'" }, - { "kind" : "LiteralInteger", "name" : "'S'" }, - { "kind" : "LiteralInteger", "name" : "'I'" }, - { "kind" : "LiteralInteger", "name" : "'rI'" }, - { "kind" : "LiteralInteger", "name" : "'Q'" }, - { "kind" : "LiteralInteger", "name" : "'O'" } - ], - "capabilities" : [ "ArbitraryPrecisionFixedPointINTEL" ], - "version" : "None" - }, - { - "opname" : "OpPtrCastToCrossWorkgroupINTEL", - "class" : "@exclude", - "opcode" : 5934, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "USMStorageClassesINTEL" ], - "version" : "None" - }, - { - "opname" : "OpCrossWorkgroupCastToPtrINTEL", - "class" : "@exclude", - "opcode" : 5938, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "USMStorageClassesINTEL" ], - "version" : "None" - }, - { - "opname" : "OpReadPipeBlockingINTEL", - "class" : "Pipe", - "opcode" : 5946, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "BlockingPipesINTEL" ], - "extensions" : [ "SPV_INTEL_blocking_pipes" ], - "version" : "None" - }, - { - "opname" : "OpWritePipeBlockingINTEL", - "class" : "Pipe", - "opcode" : 5947, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "BlockingPipesINTEL" ], - "extensions" : [ "SPV_INTEL_blocking_pipes" ], - "version" : "None" - }, - { - "opname" : "OpFPGARegINTEL", - "class" : "Reserved", - "opcode" : 5949, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Result'" }, - { "kind" : "IdRef", "name" : "'Input'" } - ], - "capabilities" : [ "FPGARegINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_reg" ], - "version" : "None" - }, - { - "opname" : "OpRayQueryGetRayTMinKHR", - "class" : "Reserved", - "opcode" : 6016, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { - "kind" : "IdRef", - "name" : "'RayQuery'" - } - ], - "capabilities" : [ "RayQueryKHR" ], - "extensions" : [ "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpRayQueryGetRayFlagsKHR", - "class" : "Reserved", - "opcode" : 6017, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { - "kind" : "IdRef", - "name" : "'RayQuery'" - } - ], - "capabilities" : [ "RayQueryKHR" ], - "extensions" : [ "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpRayQueryGetIntersectionTKHR", - "class" : "Reserved", - "opcode" : 6018, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { - "kind" : "IdRef", - "name" : "'RayQuery'" - }, - { - "kind" : "IdRef", - "name" : "'Intersection'" - } - ], - "capabilities" : [ "RayQueryKHR" ], - "extensions" : [ "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpRayQueryGetIntersectionInstanceCustomIndexKHR", - "class" : "Reserved", - "opcode" : 6019, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { - "kind" : "IdRef", - "name" : "'RayQuery'" - }, - { - "kind" : "IdRef", - "name" : "'Intersection'" - } - ], - "capabilities" : [ "RayQueryKHR" ], - "extensions" : [ "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpRayQueryGetIntersectionInstanceIdKHR", - "class" : "Reserved", - "opcode" : 6020, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { - "kind" : "IdRef", - "name" : "'RayQuery'" - }, - { - "kind" : "IdRef", - "name" : "'Intersection'" - } - ], - "capabilities" : [ "RayQueryKHR" ], - "extensions" : [ "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR", - "class" : "Reserved", - "opcode" : 6021, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { - "kind" : "IdRef", - "name" : "'RayQuery'" - }, - { - "kind" : "IdRef", - "name" : "'Intersection'" - } - ], - "capabilities" : [ "RayQueryKHR" ], - "extensions" : [ "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpRayQueryGetIntersectionGeometryIndexKHR", - "class" : "Reserved", - "opcode" : 6022, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { - "kind" : "IdRef", - "name" : "'RayQuery'" - }, - { - "kind" : "IdRef", - "name" : "'Intersection'" - } - ], - "capabilities" : [ "RayQueryKHR" ], - "extensions" : [ "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpRayQueryGetIntersectionPrimitiveIndexKHR", - "class" : "Reserved", - "opcode" : 6023, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { - "kind" : "IdRef", - "name" : "'RayQuery'" - }, - { - "kind" : "IdRef", - "name" : "'Intersection'" - } - ], - "capabilities" : [ "RayQueryKHR" ], - "extensions" : [ "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpRayQueryGetIntersectionBarycentricsKHR", - "class" : "Reserved", - "opcode" : 6024, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { - "kind" : "IdRef", - "name" : "'RayQuery'" - }, - { - "kind" : "IdRef", - "name" : "'Intersection'" - } - ], - "capabilities" : [ "RayQueryKHR" ], - "extensions" : [ "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpRayQueryGetIntersectionFrontFaceKHR", - "class" : "Reserved", - "opcode" : 6025, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { - "kind" : "IdRef", - "name" : "'RayQuery'" - }, - { - "kind" : "IdRef", - "name" : "'Intersection'" - } - ], - "capabilities" : [ "RayQueryKHR" ], - "extensions" : [ "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpRayQueryGetIntersectionCandidateAABBOpaqueKHR", - "class" : "Reserved", - "opcode" : 6026, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { - "kind" : "IdRef", - "name" : "'RayQuery'" - } - ], - "capabilities" : [ "RayQueryKHR" ], - "extensions" : [ "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpRayQueryGetIntersectionObjectRayDirectionKHR", - "class" : "Reserved", - "opcode" : 6027, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { - "kind" : "IdRef", - "name" : "'RayQuery'" - }, - { - "kind" : "IdRef", - "name" : "'Intersection'" - } - ], - "capabilities" : [ "RayQueryKHR" ], - "extensions" : [ "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpRayQueryGetIntersectionObjectRayOriginKHR", - "class" : "Reserved", - "opcode" : 6028, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { - "kind" : "IdRef", - "name" : "'RayQuery'" - }, - { - "kind" : "IdRef", - "name" : "'Intersection'" - } - ], - "capabilities" : [ "RayQueryKHR" ], - "extensions" : [ "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpRayQueryGetWorldRayDirectionKHR", - "class" : "Reserved", - "opcode" : 6029, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { - "kind" : "IdRef", - "name" : "'RayQuery'" - } - ], - "capabilities" : [ "RayQueryKHR" ], - "extensions" : [ "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpRayQueryGetWorldRayOriginKHR", - "class" : "Reserved", - "opcode" : 6030, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { - "kind" : "IdRef", - "name" : "'RayQuery'" - } - ], - "capabilities" : [ "RayQueryKHR" ], - "extensions" : [ "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpRayQueryGetIntersectionObjectToWorldKHR", - "class" : "Reserved", - "opcode" : 6031, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { - "kind" : "IdRef", - "name" : "'RayQuery'" - }, - { - "kind" : "IdRef", - "name" : "'Intersection'" - } - ], - "capabilities" : [ "RayQueryKHR" ], - "extensions" : [ "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpRayQueryGetIntersectionWorldToObjectKHR", - "class" : "Reserved", - "opcode" : 6032, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { - "kind" : "IdRef", - "name" : "'RayQuery'" - }, - { - "kind" : "IdRef", - "name" : "'Intersection'" - } - ], - "capabilities" : [ "RayQueryKHR" ], - "extensions" : [ "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "opname" : "OpAtomicFAddEXT", - "class" : "Atomic", - "opcode" : 6035, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "AtomicFloat16AddEXT", "AtomicFloat32AddEXT", "AtomicFloat64AddEXT" ], - "extensions" : [ "SPV_EXT_shader_atomic_float_add" ], - "version" : "None" - }, - { - "opname" : "OpTypeBufferSurfaceINTEL", - "class" : "Type-Declaration", - "opcode" : 6086, - "operands" : [ - { "kind" : "IdResult" }, - { - "kind" : "AccessQualifier", - "name" : "'AccessQualifier'" - } - ], - "capabilities" : [ "VectorComputeINTEL" ], - "version" : "None" - }, - { - "opname" : "OpTypeStructContinuedINTEL", - "class" : "Type-Declaration", - "opcode" : 6090, - "operands" : [ - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Member 0 type', +\n'member 1 type', +\n..." } - ], - "capabilities" : [ "LongConstantCompositeINTEL" ], - "version" : "None" - }, - { - "opname" : "OpConstantCompositeContinuedINTEL", - "class" : "Constant-Creation", - "opcode" : 6091, - "operands" : [ - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } - ], - "capabilities" : [ "LongConstantCompositeINTEL" ], - "version" : "None" - }, - { - "opname" : "OpSpecConstantCompositeContinuedINTEL", - "class" : "Constant-Creation", - "opcode" : 6092, - "operands" : [ - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } - ], - "capabilities" : [ "LongConstantCompositeINTEL" ], - "version" : "None" - } - ], - "operand_kinds" : [ - { - "category" : "BitEnum", - "kind" : "ImageOperands", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Bias", - "value" : "0x0001", - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Lod", - "value" : "0x0002", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Grad", - "value" : "0x0004", - "parameters" : [ - { "kind" : "IdRef" }, - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "ConstOffset", - "value" : "0x0008", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Offset", - "value" : "0x0010", - "capabilities" : [ "ImageGatherExtended" ], - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "ConstOffsets", - "value" : "0x0020", - "capabilities" : [ "ImageGatherExtended" ], - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Sample", - "value" : "0x0040", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "MinLod", - "value" : "0x0080", - "capabilities" : [ "MinLod" ], - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "MakeTexelAvailable", - "value" : "0x0100", - "capabilities" : [ "VulkanMemoryModel" ], - "parameters" : [ - { "kind" : "IdScope" } - ], - "version" : "1.5" - }, - { - "enumerant" : "MakeTexelAvailableKHR", - "value" : "0x0100", - "capabilities" : [ "VulkanMemoryModel" ], - "parameters" : [ - { "kind" : "IdScope" } - ], - "extensions" : [ "SPV_KHR_vulkan_memory_model" ], - "version" : "1.5" - }, - { - "enumerant" : "MakeTexelVisible", - "value" : "0x0200", - "capabilities" : [ "VulkanMemoryModel" ], - "parameters" : [ - { "kind" : "IdScope" } - ], - "version" : "1.5" - }, - { - "enumerant" : "MakeTexelVisibleKHR", - "value" : "0x0200", - "capabilities" : [ "VulkanMemoryModel" ], - "parameters" : [ - { "kind" : "IdScope" } - ], - "extensions" : [ "SPV_KHR_vulkan_memory_model" ], - "version" : "1.5" - }, - { - "enumerant" : "NonPrivateTexel", - "value" : "0x0400", - "capabilities" : [ "VulkanMemoryModel" ], - "version" : "1.5" - }, - { - "enumerant" : "NonPrivateTexelKHR", - "value" : "0x0400", - "capabilities" : [ "VulkanMemoryModel" ], - "extensions" : [ "SPV_KHR_vulkan_memory_model" ], - "version" : "1.5" - }, - { - "enumerant" : "VolatileTexel", - "value" : "0x0800", - "capabilities" : [ "VulkanMemoryModel" ], - "version" : "1.5" - }, - { - "enumerant" : "VolatileTexelKHR", - "value" : "0x0800", - "capabilities" : [ "VulkanMemoryModel" ], - "extensions" : [ "SPV_KHR_vulkan_memory_model" ], - "version" : "1.5" - }, - { - "enumerant" : "SignExtend", - "value" : "0x1000", - "version" : "1.4" - }, - { - "enumerant" : "ZeroExtend", - "value" : "0x2000", - "version" : "1.4" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "FPFastMathMode", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "NotNaN", - "value" : "0x0001", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NotInf", - "value" : "0x0002", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NSZ", - "value" : "0x0004", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "AllowRecip", - "value" : "0x0008", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Fast", - "value" : "0x0010", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "AllowContractFastINTEL", - "value" : "0x10000", - "capabilities" : [ "FPFastMathModeINTEL" ], - "version" : "None" - }, - { - "enumerant" : "AllowReassocINTEL", - "value" : "0x20000", - "capabilities" : [ "FPFastMathModeINTEL" ], - "version" : "None" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "SelectionControl", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Flatten", - "value" : "0x0001" - }, - { - "enumerant" : "DontFlatten", - "value" : "0x0002" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "LoopControl", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Unroll", - "value" : "0x0001" - }, - { - "enumerant" : "DontUnroll", - "value" : "0x0002" - }, - { - "enumerant" : "DependencyInfinite", - "value" : "0x0004", - "version" : "1.1" - }, - { - "enumerant" : "DependencyLength", - "value" : "0x0008", - "parameters" : [ - { "kind" : "LiteralInteger" } - ], - "version" : "1.1" - }, - { - "enumerant" : "MinIterations", - "value" : "0x0010", - "parameters" : [ - { "kind" : "LiteralInteger" } - ], - "version" : "1.4" - }, - { - "enumerant" : "MaxIterations", - "value" : "0x0020", - "parameters" : [ - { "kind" : "LiteralInteger" } - ], - "version" : "1.4" - }, - { - "enumerant" : "IterationMultiple", - "value" : "0x0040", - "parameters" : [ - { "kind" : "LiteralInteger" } - ], - "version" : "1.4" - }, - { - "enumerant" : "PeelCount", - "value" : "0x0080", - "parameters" : [ - { "kind" : "LiteralInteger" } - ], - "version" : "1.4" - }, - { - "enumerant" : "PartialCount", - "value" : "0x0100", - "parameters" : [ - { "kind" : "LiteralInteger" } - ], - "version" : "1.4" - }, - { - "enumerant" : "InitiationIntervalINTEL", - "value" : "0x10000", - "parameters" : [ - { "kind" : "LiteralInteger" } - ], - "capabilities" : [ "FPGALoopControlsINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_loop_controls" ], - "version" : "None" - }, - { - "enumerant" : "MaxConcurrencyINTEL", - "value" : "0x20000", - "parameters" : [ - { "kind" : "LiteralInteger" } - ], - "capabilities" : [ "FPGALoopControlsINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_loop_controls" ], - "version" : "None" - }, - { - "enumerant" : "DependencyArrayINTEL", - "value" : "0x40000", - "parameters" : [ - { "kind" : "LiteralInteger" } - ], - "capabilities" : [ "FPGALoopControlsINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_loop_controls" ], - "version" : "None" - }, - { - "enumerant" : "PipelineEnableINTEL", - "value" : "0x80000", - "parameters" : [ - { "kind" : "LiteralInteger" } - ], - "capabilities" : [ "FPGALoopControlsINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_loop_controls" ], - "version" : "None" - }, - { - "enumerant" : "LoopCoalesceINTEL", - "value" : "0x100000", - "parameters" : [ - { "kind" : "LiteralInteger" } - ], - "capabilities" : [ "FPGALoopControlsINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_loop_controls" ], - "version" : "None" - }, - { - "enumerant" : "MaxInterleavingINTEL", - "value" : "0x200000", - "parameters" : [ - { "kind" : "LiteralInteger" } - ], - "capabilities" : [ "FPGALoopControlsINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_loop_controls" ], - "version" : "None" - }, - { - "enumerant" : "SpeculatedIterationsINTEL", - "value" : "0x400000", - "parameters" : [ - { "kind" : "LiteralInteger" } - ], - "capabilities" : [ "FPGALoopControlsINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_loop_controls" ], - "version" : "None" - }, - { - "enumerant" : "NoFusionINTEL", - "value" : "0x800000", - "parameters" : [ - { "kind" : "LiteralInteger" } - ], - "capabilities" : [ "FPGALoopControlsINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_loop_controls" ], - "version" : "None" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "FunctionControl", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Inline", - "value" : "0x0001" - }, - { - "enumerant" : "DontInline", - "value" : "0x0002" - }, - { - "enumerant" : "Pure", - "value" : "0x0004" - }, - { - "enumerant" : "Const", - "value" : "0x0008" - }, - { - "enumerant" : "OptNoneINTEL", - "value" : "0x10000", - "capabilities" : [ "OptNoneINTEL" ], - "version" : "None" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "MemorySemantics", - "enumerants" : [ - { - "enumerant" : "Relaxed", - "value" : "0x0000" - }, - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Acquire", - "value" : "0x0002" - }, - { - "enumerant" : "Release", - "value" : "0x0004" - }, - { - "enumerant" : "AcquireRelease", - "value" : "0x0008" - }, - { - "enumerant" : "SequentiallyConsistent", - "value" : "0x0010" - }, - { - "enumerant" : "UniformMemory", - "value" : "0x0040", - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SubgroupMemory", - "value" : "0x0080" - }, - { - "enumerant" : "WorkgroupMemory", - "value" : "0x0100" - }, - { - "enumerant" : "CrossWorkgroupMemory", - "value" : "0x0200" - }, - { - "enumerant" : "AtomicCounterMemory", - "value" : "0x0400", - "capabilities" : [ "AtomicStorage" ] - }, - { - "enumerant" : "ImageMemory", - "value" : "0x0800" - }, - { - "enumerant" : "OutputMemory", - "value" : "0x1000", - "capabilities" : [ "VulkanMemoryModel" ], - "version" : "1.5" - }, - { - "enumerant" : "OutputMemoryKHR", - "value" : "0x1000", - "capabilities" : [ "VulkanMemoryModel" ], - "extensions" : [ "SPV_KHR_vulkan_memory_model" ], - "version" : "1.5" - }, - { - "enumerant" : "MakeAvailable", - "value" : "0x2000", - "capabilities" : [ "VulkanMemoryModel" ], - "version" : "1.5" - }, - { - "enumerant" : "MakeAvailableKHR", - "value" : "0x2000", - "capabilities" : [ "VulkanMemoryModel" ], - "extensions" : [ "SPV_KHR_vulkan_memory_model" ], - "version" : "1.5" - }, - { - "enumerant" : "MakeVisible", - "value" : "0x4000", - "capabilities" : [ "VulkanMemoryModel" ], - "version" : "1.5" - }, - { - "enumerant" : "MakeVisibleKHR", - "value" : "0x4000", - "capabilities" : [ "VulkanMemoryModel" ], - "extensions" : [ "SPV_KHR_vulkan_memory_model" ], - "version" : "1.5" - }, - { - "enumerant" : "Volatile", - "value" : "0x8000", - "capabilities" : [ "VulkanMemoryModel" ], - "extensions" : [ "SPV_KHR_vulkan_memory_model" ], - "version" : "1.5" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "MemoryAccess", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Volatile", - "value" : "0x0001" - }, - { - "enumerant" : "Aligned", - "value" : "0x0002", - "parameters" : [ - { "kind" : "LiteralInteger" } - ] - }, - { - "enumerant" : "Nontemporal", - "value" : "0x0004" - }, - { - "enumerant" : "MakePointerAvailable", - "value" : "0x0008", - "parameters" : [ - { "kind" : "IdScope" } - ], - "capabilities" : [ "VulkanMemoryModel" ], - "version" : "1.5" - }, - { - "enumerant" : "MakePointerAvailableKHR", - "value" : "0x0008", - "parameters" : [ - { "kind" : "IdScope" } - ], - "capabilities" : [ "VulkanMemoryModel" ], - "extensions" : [ "SPV_KHR_vulkan_memory_model" ], - "version" : "1.5" - }, - { - "enumerant" : "MakePointerVisible", - "value" : "0x0010", - "parameters" : [ - { "kind" : "IdScope" } - ], - "capabilities" : [ "VulkanMemoryModel" ], - "version" : "1.5" - }, - { - "enumerant" : "MakePointerVisibleKHR", - "value" : "0x0010", - "parameters" : [ - { "kind" : "IdScope" } - ], - "capabilities" : [ "VulkanMemoryModel" ], - "extensions" : [ "SPV_KHR_vulkan_memory_model" ], - "version" : "1.5" - }, - { - "enumerant" : "NonPrivatePointer", - "value" : "0x0020", - "capabilities" : [ "VulkanMemoryModel" ], - "version" : "1.5" - }, - { - "enumerant" : "NonPrivatePointerKHR", - "value" : "0x0020", - "capabilities" : [ "VulkanMemoryModel" ], - "extensions" : [ "SPV_KHR_vulkan_memory_model" ], - "version" : "1.5" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "KernelProfilingInfo", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "CmdExecTime", - "value" : "0x0001", - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "BitEnum", - "kind" : "RayFlags", - "enumerants" : [ - { - "enumerant" : "NoneKHR", - "value" : "0x0000", - "capabilities" : [ "RayQueryKHR","RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "OpaqueKHR", - "value" : "0x0001", - "capabilities" : [ "RayQueryKHR","RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "NoOpaqueKHR", - "value" : "0x0002", - "capabilities" : [ "RayQueryKHR","RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "TerminateOnFirstHitKHR", - "value" : "0x0004", - "capabilities" : [ "RayQueryKHR","RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "SkipClosestHitShaderKHR", - "value" : "0x0008", - "capabilities" : [ "RayQueryKHR","RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "CullBackFacingTrianglesKHR", - "value" : "0x0010", - "capabilities" : [ "RayQueryKHR","RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "CullFrontFacingTrianglesKHR", - "value" : "0x0020", - "capabilities" : [ "RayQueryKHR","RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "CullOpaqueKHR", - "value" : "0x0040", - "capabilities" : [ "RayQueryKHR","RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "CullNoOpaqueKHR", - "value" : "0x0080", - "capabilities" : [ "RayQueryKHR","RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "SkipTrianglesKHR", - "value" : "0x0100", - "capabilities" : [ "RayTraversalPrimitiveCullingKHR" ], - "version" : "None" - }, - { - "enumerant" : "SkipAABBsKHR", - "value" : "0x0200", - "capabilities" : [ "RayTraversalPrimitiveCullingKHR" ], - "version" : "None" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "FragmentShadingRate", - "enumerants" : [ - { - "enumerant" : "Vertical2Pixels", - "value" : "0x0001", - "capabilities" : [ "FragmentShadingRateKHR" ], - "version" : "None" - }, - { - "enumerant" : "Vertical4Pixels", - "value" : "0x0002", - "capabilities" : [ "FragmentShadingRateKHR" ], - "version" : "None" - }, - { - "enumerant" : "Horizontal2Pixels", - "value" : "0x0004", - "capabilities" : [ "FragmentShadingRateKHR" ], - "version" : "None" - }, - { - "enumerant" : "Horizontal4Pixels", - "value" : "0x0008", - "capabilities" : [ "FragmentShadingRateKHR" ], - "version" : "None" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "SourceLanguage", - "enumerants" : [ - { - "enumerant" : "Unknown", - "value" : 0 - }, - { - "enumerant" : "ESSL", - "value" : 1 - }, - { - "enumerant" : "GLSL", - "value" : 2 - }, - { - "enumerant" : "OpenCL_C", - "value" : 3 - }, - { - "enumerant" : "OpenCL_CPP", - "value" : 4 - }, - { - "enumerant" : "HLSL", - "value" : 5 - }, - { - "enumerant" : "CPP_for_OpenCL", - "value" : 6 - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ExecutionModel", - "enumerants" : [ - { - "enumerant" : "Vertex", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "TessellationControl", - "value" : 1, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "TessellationEvaluation", - "value" : 2, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Geometry", - "value" : 3, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "Fragment", - "value" : 4, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GLCompute", - "value" : 5, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Kernel", - "value" : 6, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "TaskNV", - "value" : 5267, - "capabilities" : [ "MeshShadingNV" ], - "version" : "None" - }, - { - "enumerant" : "MeshNV", - "value" : 5268, - "capabilities" : [ "MeshShadingNV" ], - "version" : "None" - }, - { - "enumerant" : "RayGenerationNV", - "value" : 5313, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "RayGenerationKHR", - "value" : 5313, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "IntersectionNV", - "value" : 5314, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "IntersectionKHR", - "value" : 5314, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "AnyHitNV", - "value" : 5315, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "AnyHitKHR", - "value" : 5315, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "ClosestHitNV", - "value" : 5316, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "ClosestHitKHR", - "value" : 5316, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "MissNV", - "value" : 5317, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "MissKHR", - "value" : 5317, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "CallableNV", - "value" : 5318, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "CallableKHR", - "value" : 5318, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "AddressingModel", - "enumerants" : [ - { - "enumerant" : "Logical", - "value" : 0 - }, - { - "enumerant" : "Physical32", - "value" : 1, - "capabilities" : [ "Addresses" ] - }, - { - "enumerant" : "Physical64", - "value" : 2, - "capabilities" : [ "Addresses" ] - }, - { - "enumerant" : "PhysicalStorageBuffer64", - "value" : 5348, - "extensions" : [ "SPV_EXT_physical_storage_buffer", "SPV_KHR_physical_storage_buffer" ], - "capabilities" : [ "PhysicalStorageBufferAddresses" ], - "version" : "1.5" - }, - { - "enumerant" : "PhysicalStorageBuffer64EXT", - "value" : 5348, - "extensions" : [ "SPV_EXT_physical_storage_buffer" ], - "capabilities" : [ "PhysicalStorageBufferAddresses" ], - "version" : "1.5" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "MemoryModel", - "enumerants" : [ - { - "enumerant" : "Simple", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GLSL450", - "value" : 1, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "OpenCL", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Vulkan", - "value" : 3, - "capabilities" : [ "VulkanMemoryModel" ], - "version" : "1.5" - }, - { - "enumerant" : "VulkanKHR", - "value" : 3, - "capabilities" : [ "VulkanMemoryModel" ], - "extensions" : [ "SPV_KHR_vulkan_memory_model" ], - "version" : "1.5" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ExecutionMode", - "enumerants" : [ - { - "enumerant" : "Invocations", - "value" : 0, - "capabilities" : [ "Geometry" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Number of <>'" } - ] - }, - { - "enumerant" : "SpacingEqual", - "value" : 1, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "SpacingFractionalEven", - "value" : 2, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "SpacingFractionalOdd", - "value" : 3, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "VertexOrderCw", - "value" : 4, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "VertexOrderCcw", - "value" : 5, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "PixelCenterInteger", - "value" : 6, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "OriginUpperLeft", - "value" : 7, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "OriginLowerLeft", - "value" : 8, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "EarlyFragmentTests", - "value" : 9, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PointMode", - "value" : 10, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Xfb", - "value" : 11, - "capabilities" : [ "TransformFeedback" ] - }, - { - "enumerant" : "DepthReplacing", - "value" : 12, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DepthGreater", - "value" : 14, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DepthLess", - "value" : 15, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DepthUnchanged", - "value" : 16, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "LocalSize", - "value" : 17, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'x size'" }, - { "kind" : "LiteralInteger", "name" : "'y size'" }, - { "kind" : "LiteralInteger", "name" : "'z size'" } - ] - }, - { - "enumerant" : "LocalSizeHint", - "value" : 18, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'x size'" }, - { "kind" : "LiteralInteger", "name" : "'y size'" }, - { "kind" : "LiteralInteger", "name" : "'z size'" } - ] - }, - { - "enumerant" : "InputPoints", - "value" : 19, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "InputLines", - "value" : 20, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "InputLinesAdjacency", - "value" : 21, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "Triangles", - "value" : 22, - "capabilities" : [ "Geometry", "Tessellation" ] - }, - { - "enumerant" : "InputTrianglesAdjacency", - "value" : 23, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "Quads", - "value" : 24, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Isolines", - "value" : 25, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "OutputVertices", - "value" : 26, - "capabilities" : [ "Geometry", "Tessellation", "MeshShadingNV" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Vertex count'" } - ] - }, - { - "enumerant" : "OutputPoints", - "value" : 27, - "capabilities" : [ "Geometry", "MeshShadingNV" ] - }, - { - "enumerant" : "OutputLineStrip", - "value" : 28, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "OutputTriangleStrip", - "value" : 29, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "VecTypeHint", - "value" : 30, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Vector type'" } - ] - }, - { - "enumerant" : "ContractionOff", - "value" : 31, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Initializer", - "value" : 33, - "capabilities" : [ "Kernel" ], - "version" : "1.1" - }, - { - "enumerant" : "Finalizer", - "value" : 34, - "capabilities" : [ "Kernel" ], - "version" : "1.1" - }, - { - "enumerant" : "SubgroupSize", - "value" : 35, - "capabilities" : [ "SubgroupDispatch" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Subgroup Size'" } - ], - "version" : "1.1" - }, - { - "enumerant" : "SubgroupsPerWorkgroup", - "value" : 36, - "capabilities" : [ "SubgroupDispatch" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Subgroups Per Workgroup'" } - ], - "version" : "1.1" - }, - { - "enumerant" : "SubgroupsPerWorkgroupId", - "value" : 37, - "capabilities" : [ "SubgroupDispatch" ], - "parameters" : [ - { "kind" : "IdRef", "name" : "'Subgroups Per Workgroup'" } - ], - "version" : "1.2" - }, - { - "enumerant" : "LocalSizeId", - "value" : 38, - "parameters" : [ - { "kind" : "IdRef", "name" : "'x size'" }, - { "kind" : "IdRef", "name" : "'y size'" }, - { "kind" : "IdRef", "name" : "'z size'" } - ], - "version" : "1.2" - }, - { - "enumerant" : "LocalSizeHintId", - "value" : 39, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "IdRef", "name" : "'x size hint'" }, - { "kind" : "IdRef", "name" : "'y size hint'" }, - { "kind" : "IdRef", "name" : "'z size hint'" } - ], - "version" : "1.2" - }, - { - "enumerant" : "SubgroupUniformControlFlowKHR", - "value" : 4421, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_KHR_subgroup_uniform_control_flow" ], - "version" : "None" - }, - { - "enumerant" : "PostDepthCoverage", - "value" : 4446, - "capabilities" : [ "SampleMaskPostDepthCoverage" ], - "extensions" : [ "SPV_KHR_post_depth_coverage" ], - "version" : "None" - }, - { - "enumerant" : "DenormPreserve", - "value" : 4459, - "capabilities" : [ "DenormPreserve" ], - "extensions" : [ "SPV_KHR_float_controls" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Target Width'" } - ], - "version" : "1.4" - }, - { - "enumerant" : "DenormFlushToZero", - "value" : 4460, - "capabilities" : [ "DenormFlushToZero" ], - "extensions" : [ "SPV_KHR_float_controls" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Target Width'" } - ], - "version" : "1.4" - }, - { - "enumerant" : "SignedZeroInfNanPreserve", - "value" : 4461, - "capabilities" : [ "SignedZeroInfNanPreserve" ], - "extensions" : [ "SPV_KHR_float_controls" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Target Width'" } - ], - "version" : "1.4" - }, - { - "enumerant" : "RoundingModeRTE", - "value" : 4462, - "capabilities" : [ "RoundingModeRTE" ], - "extensions" : [ "SPV_KHR_float_controls" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Target Width'" } - ], - "version" : "1.4" - }, - { - "enumerant" : "RoundingModeRTZ", - "value" : 4463, - "capabilities" : [ "RoundingModeRTZ" ], - "extensions" : [ "SPV_KHR_float_controls" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Target Width'" } - ], - "version" : "1.4" - }, - { - "enumerant" : "StencilRefReplacingEXT", - "value" : 5027, - "capabilities" : [ "StencilExportEXT" ], - "extensions" : [ "SPV_EXT_shader_stencil_export" ], - "version" : "None" - }, - { - "enumerant" : "OutputLinesNV", - "value" : 5269, - "capabilities" : [ "MeshShadingNV" ], - "extensions" : [ "SPV_NV_mesh_shader" ], - "version" : "None" - }, - { - "enumerant" : "OutputPrimitivesNV", - "value" : 5270, - "capabilities" : [ "MeshShadingNV" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Primitive count'" } - ], - "extensions" : [ "SPV_NV_mesh_shader" ], - "version" : "None" - }, - { - "enumerant" : "DerivativeGroupQuadsNV", - "value" : 5289, - "capabilities" : [ "ComputeDerivativeGroupQuadsNV" ], - "extensions" : [ "SPV_NV_compute_shader_derivatives" ], - "version" : "None" - }, - { - "enumerant" : "DerivativeGroupLinearNV", - "value" : 5290, - "capabilities" : [ "ComputeDerivativeGroupLinearNV" ], - "extensions" : [ "SPV_NV_compute_shader_derivatives" ], - "version" : "None" - }, - { - "enumerant" : "OutputTrianglesNV", - "value" : 5298, - "capabilities" : [ "MeshShadingNV" ], - "extensions" : [ "SPV_NV_mesh_shader" ], - "version" : "None" - }, - { - "enumerant" : "PixelInterlockOrderedEXT", - "value" : 5366, - "capabilities" : [ "FragmentShaderPixelInterlockEXT" ], - "extensions" : [ "SPV_EXT_fragment_shader_interlock" ], - "version" : "None" - }, - { - "enumerant" : "PixelInterlockUnorderedEXT", - "value" : 5367, - "capabilities" : [ "FragmentShaderPixelInterlockEXT" ], - "extensions" : [ "SPV_EXT_fragment_shader_interlock" ], - "version" : "None" - }, - { - "enumerant" : "SampleInterlockOrderedEXT", - "value" : 5368, - "capabilities" : [ "FragmentShaderSampleInterlockEXT" ], - "extensions" : [ "SPV_EXT_fragment_shader_interlock" ], - "version" : "None" - }, - { - "enumerant" : "SampleInterlockUnorderedEXT", - "value" : 5369, - "capabilities" : [ "FragmentShaderSampleInterlockEXT" ], - "extensions" : [ "SPV_EXT_fragment_shader_interlock" ], - "version" : "None" - }, - { - "enumerant" : "ShadingRateInterlockOrderedEXT", - "value" : 5370, - "capabilities" : [ "FragmentShaderShadingRateInterlockEXT" ], - "extensions" : [ "SPV_EXT_fragment_shader_interlock" ], - "version" : "None" - }, - { - "enumerant" : "ShadingRateInterlockUnorderedEXT", - "value" : 5371, - "capabilities" : [ "FragmentShaderShadingRateInterlockEXT" ], - "extensions" : [ "SPV_EXT_fragment_shader_interlock" ], - "version" : "None" - }, - { - "enumerant" : "SharedLocalMemorySizeINTEL", - "value" : 5618, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Size'" } - ], - "capabilities" : [ "VectorComputeINTEL" ], - "version" : "None" - }, - { - "enumerant" : "RoundingModeRTPINTEL", - "value" : 5620, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Target Width'" } - ], - "capabilities" : [ "RoundToInfinityINTEL" ], - "version" : "None" - }, - { - "enumerant" : "RoundingModeRTNINTEL", - "value" : 5621, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Target Width'" } - ], - "capabilities" : [ "RoundToInfinityINTEL" ], - "version" : "None" - }, - { - "enumerant" : "FloatingPointModeALTINTEL", - "value" : 5622, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Target Width'" } - ], - "capabilities" : [ "RoundToInfinityINTEL" ], - "version" : "None" - }, - { - "enumerant" : "FloatingPointModeIEEEINTEL", - "value" : 5623, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Target Width'" } - ], - "capabilities" : [ "RoundToInfinityINTEL" ], - "version" : "None" - }, - { - "enumerant" : "MaxWorkgroupSizeINTEL", - "value" : 5893, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'max_x_size'" }, - { "kind" : "LiteralInteger", "name" : "'max_y_size'" }, - { "kind" : "LiteralInteger", "name" : "'max_z_size'" } - ], - "capabilities" : [ "KernelAttributesINTEL" ], - "extensions" : [ "SPV_INTEL_kernel_attributes" ], - "version" : "None" - }, - { - "enumerant" : "MaxWorkDimINTEL", - "value" : 5894, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'max_dimensions'" } - ], - "capabilities" : [ "KernelAttributesINTEL" ], - "extensions" : [ "SPV_INTEL_kernel_attributes" ], - "version" : "None" - }, - { - "enumerant" : "NoGlobalOffsetINTEL", - "value" : 5895, - "capabilities" : [ "KernelAttributesINTEL" ], - "extensions" : [ "SPV_INTEL_kernel_attributes" ], - "version" : "None" - }, - { - "enumerant" : "NumSIMDWorkitemsINTEL", - "value" : 5896, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'vector_width'" } - ], - "capabilities" : [ "FPGAKernelAttributesINTEL" ], - "extensions" : [ "SPV_INTEL_kernel_attributes" ], - "version" : "None" - }, - { - "enumerant" : "SchedulerTargetFmaxMhzINTEL", - "value" : 5903, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'target_fmax'" } - ], - "capabilities" : [ "FPGAKernelAttributesINTEL" ], - "version" : "None" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "StorageClass", - "enumerants" : [ - { - "enumerant" : "UniformConstant", - "value" : 0 - }, - { - "enumerant" : "Input", - "value" : 1 - }, - { - "enumerant" : "Uniform", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Output", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Workgroup", - "value" : 4 - }, - { - "enumerant" : "CrossWorkgroup", - "value" : 5 - }, - { - "enumerant" : "Private", - "value" : 6, - "capabilities" : [ "Shader", "VectorComputeINTEL" ] - }, - { - "enumerant" : "Function", - "value" : 7 - }, - { - "enumerant" : "Generic", - "value" : 8, - "capabilities" : [ "GenericPointer" ] - }, - { - "enumerant" : "PushConstant", - "value" : 9, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "AtomicCounter", - "value" : 10, - "capabilities" : [ "AtomicStorage" ] - }, - { - "enumerant" : "Image", - "value" : 11 - }, - { - "enumerant" : "StorageBuffer", - "value" : 12, - "extensions" : [ - "SPV_KHR_storage_buffer_storage_class", - "SPV_KHR_variable_pointers" - ], - "capabilities" : [ "Shader" ], - "version" : "1.3" - }, - { - "enumerant" : "CallableDataNV", - "value" : 5328, - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "CallableDataKHR", - "value" : 5328, - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "IncomingCallableDataNV", - "value" : 5329, - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "IncomingCallableDataKHR", - "value" : 5329, - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "RayPayloadNV", - "value" : 5338, - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "RayPayloadKHR", - "value" : 5338, - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "HitAttributeNV", - "value" : 5339, - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "HitAttributeKHR", - "value" : 5339, - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "IncomingRayPayloadNV", - "value" : 5342, - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "IncomingRayPayloadKHR", - "value" : 5342, - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "ShaderRecordBufferNV", - "value" : 5343, - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "ShaderRecordBufferKHR", - "value" : 5343, - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "PhysicalStorageBuffer", - "value" : 5349, - "extensions" : [ "SPV_EXT_physical_storage_buffer", "SPV_KHR_physical_storage_buffer" ], - "capabilities" : [ "PhysicalStorageBufferAddresses" ], - "version" : "1.5" - }, - { - "enumerant" : "PhysicalStorageBufferEXT", - "value" : 5349, - "extensions" : [ "SPV_EXT_physical_storage_buffer" ], - "capabilities" : [ "PhysicalStorageBufferAddresses" ], - "version" : "1.5" - }, - { - "enumerant" : "CodeSectionINTEL", - "value" : 5605, - "extensions" : [ "SPV_INTEL_function_pointers" ], - "capabilities" : [ "FunctionPointersINTEL" ], - "version" : "None" - }, - { - "enumerant" : "DeviceOnlyINTEL", - "value" : 5936, - "extensions" : [ - "SPV_INTEL_usm_storage_classes" - ], - "capabilities" : [ "USMStorageClassesINTEL" ], - "version" : "None" - }, - { - "enumerant" : "HostOnlyINTEL", - "value" : 5937, - "extensions" : [ - "SPV_INTEL_usm_storage_classes" - ], - "capabilities" : [ "USMStorageClassesINTEL" ], - "version" : "None" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Dim", - "enumerants" : [ - { - "enumerant" : "1D", - "value" : 0, - "capabilities" : [ "Sampled1D", "Image1D" ] - }, - { - "enumerant" : "2D", - "value" : 1, - "capabilities" : [ "Shader", "Kernel", "ImageMSArray" ] - }, - { - "enumerant" : "3D", - "value" : 2 - }, - { - "enumerant" : "Cube", - "value" : 3, - "capabilities" : [ "Shader", "ImageCubeArray" ] - }, - { - "enumerant" : "Rect", - "value" : 4, - "capabilities" : [ "SampledRect", "ImageRect" ] - }, - { - "enumerant" : "Buffer", - "value" : 5, - "capabilities" : [ "SampledBuffer", "ImageBuffer" ] - }, - { - "enumerant" : "SubpassData", - "value" : 6, - "capabilities" : [ "InputAttachment" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "SamplerAddressingMode", - "enumerants" : [ - { - "enumerant" : "None", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ClampToEdge", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Clamp", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Repeat", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RepeatMirrored", - "value" : 4, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "SamplerFilterMode", - "enumerants" : [ - { - "enumerant" : "Nearest", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Linear", - "value" : 1, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ImageFormat", - "enumerants" : [ - { - "enumerant" : "Unknown", - "value" : 0 - }, - { - "enumerant" : "Rgba32f", - "value" : 1, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba16f", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "R32f", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8", - "value" : 4, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8Snorm", - "value" : 5, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rg32f", - "value" : 6, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16f", - "value" : 7, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R11fG11fB10f", - "value" : 8, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16f", - "value" : 9, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba16", - "value" : 10, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgb10A2", - "value" : 11, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16", - "value" : 12, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8", - "value" : 13, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16", - "value" : 14, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8", - "value" : 15, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba16Snorm", - "value" : 16, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16Snorm", - "value" : 17, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8Snorm", - "value" : 18, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16Snorm", - "value" : 19, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8Snorm", - "value" : 20, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba32i", - "value" : 21, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba16i", - "value" : 22, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8i", - "value" : 23, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "R32i", - "value" : 24, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rg32i", - "value" : 25, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16i", - "value" : 26, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8i", - "value" : 27, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16i", - "value" : 28, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8i", - "value" : 29, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba32ui", - "value" : 30, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba16ui", - "value" : 31, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8ui", - "value" : 32, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "R32ui", - "value" : 33, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgb10a2ui", - "value" : 34, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg32ui", - "value" : 35, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16ui", - "value" : 36, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8ui", - "value" : 37, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16ui", - "value" : 38, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8ui", - "value" : 39, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R64ui", - "value" : 40, - "capabilities" : [ "Int64ImageEXT" ] - }, - { - "enumerant" : "R64i", - "value" : 41, - "capabilities" : [ "Int64ImageEXT" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ImageChannelOrder", - "enumerants" : [ - { - "enumerant" : "R", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "A", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RG", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RA", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGB", - "value" : 4, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGBA", - "value" : 5, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "BGRA", - "value" : 6, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ARGB", - "value" : 7, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Intensity", - "value" : 8, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Luminance", - "value" : 9, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Rx", - "value" : 10, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGx", - "value" : 11, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGBx", - "value" : 12, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Depth", - "value" : 13, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "DepthStencil", - "value" : 14, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sRGB", - "value" : 15, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sRGBx", - "value" : 16, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sRGBA", - "value" : 17, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sBGRA", - "value" : 18, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ABGR", - "value" : 19, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ImageChannelDataType", - "enumerants" : [ - { - "enumerant" : "SnormInt8", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SnormInt16", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt8", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt16", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormShort565", - "value" : 4, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormShort555", - "value" : 5, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt101010", - "value" : 6, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SignedInt8", - "value" : 7, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SignedInt16", - "value" : 8, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SignedInt32", - "value" : 9, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnsignedInt8", - "value" : 10, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnsignedInt16", - "value" : 11, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnsignedInt32", - "value" : 12, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "HalfFloat", - "value" : 13, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Float", - "value" : 14, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt24", - "value" : 15, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt101010_2", - "value" : 16, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "FPRoundingMode", - "enumerants" : [ - { - "enumerant" : "RTE", - "value" : 0 - }, - { - "enumerant" : "RTZ", - "value" : 1 - }, - { - "enumerant" : "RTP", - "value" : 2 - }, - { - "enumerant" : "RTN", - "value" : 3 - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "FPDenormMode", - "enumerants" : [ - { - "enumerant" : "Preserve", - "value" : 0, - "capabilities" : [ "FunctionFloatControlINTEL" ], - "version" : "None" - }, - { - "enumerant" : "FlushToZero", - "value" : 1, - "capabilities" : [ "FunctionFloatControlINTEL" ], - "version" : "None" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "QuantizationModes", - "enumerants" : [ - { - "enumerant" : "TRN", - "value" : 0, - "capabilities" : [ "ArbitraryPrecisionFixedPointINTEL"], - "version" : "None" - }, - { - "enumerant" : "TRN_ZERO", - "value" : 1, - "capabilities" : [ "ArbitraryPrecisionFixedPointINTEL"], - "version" : "None" - }, - { - "enumerant" : "RND", - "value" : 2, - "capabilities" : [ "ArbitraryPrecisionFixedPointINTEL"], - "version" : "None" - }, - { - "enumerant" : "RND_ZERO", - "value" : 3, - "capabilities" : [ "ArbitraryPrecisionFixedPointINTEL"], - "version" : "None" - }, - { - "enumerant" : "RND_INF", - "value" : 4, - "capabilities" : [ "ArbitraryPrecisionFixedPointINTEL"], - "version" : "None" - }, - { - "enumerant" : "RND_MIN_INF", - "value" : 5, - "capabilities" : [ "ArbitraryPrecisionFixedPointINTEL"], - "version" : "None" - }, - { - "enumerant" : "RND_CONV", - "value" : 6, - "capabilities" : [ "ArbitraryPrecisionFixedPointINTEL"], - "version" : "None" - }, - { - "enumerant" : "RND_CONV_ODD", - "value" : 7, - "capabilities" : [ "ArbitraryPrecisionFixedPointINTEL"], - "version" : "None" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "FPOperationMode", - "enumerants" : [ - { - "enumerant" : "IEEE", - "value" : 0, - "capabilities" : [ "FunctionFloatControlINTEL" ], - "version" : "None" - }, - { - "enumerant" : "ALT", - "value" : 1, - "capabilities" : [ "FunctionFloatControlINTEL" ], - "version" : "None" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "OverflowModes", - "enumerants" : [ - { - "enumerant" : "WRAP", - "value" : 0, - "capabilities" : [ "ArbitraryPrecisionFixedPointINTEL"], - "version" : "None" - }, - { - "enumerant" : "SAT", - "value" : 1, - "capabilities" : [ "ArbitraryPrecisionFixedPointINTEL"], - "version" : "None" - }, - { - "enumerant" : "SAT_ZERO", - "value" : 2, - "capabilities" : [ "ArbitraryPrecisionFixedPointINTEL"], - "version" : "None" - }, - { - "enumerant" : "SAT_SYM", - "value" : 3, - "capabilities" : [ "ArbitraryPrecisionFixedPointINTEL"], - "version" : "None" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "LinkageType", - "enumerants" : [ - { - "enumerant" : "Export", - "value" : 0, - "capabilities" : [ "Linkage" ] - }, - { - "enumerant" : "Import", - "value" : 1, - "capabilities" : [ "Linkage" ] - }, - { - "enumerant" : "LinkOnceODR", - "value" : 2, - "capabilities" : [ "Linkage" ], - "extensions" : [ "SPV_KHR_linkonce_odr" ], - "version" : "None" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "AccessQualifier", - "enumerants" : [ - { - "enumerant" : "ReadOnly", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "WriteOnly", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ReadWrite", - "value" : 2, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "FunctionParameterAttribute", - "enumerants" : [ - { - "enumerant" : "Zext", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Sext", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ByVal", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Sret", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoAlias", - "value" : 4, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoCapture", - "value" : 5, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoWrite", - "value" : 6, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoReadWrite", - "value" : 7, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Decoration", - "enumerants" : [ - { - "enumerant" : "RelaxedPrecision", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SpecId", - "value" : 1, - "capabilities" : [ "Shader", "Kernel" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Specialization Constant ID'" } - ] - }, - { - "enumerant" : "Block", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "BufferBlock", - "value" : 3, - "capabilities" : [ "Shader" ], - "lastVersion" : "1.3" - }, - { - "enumerant" : "RowMajor", - "value" : 4, - "capabilities" : [ "Matrix" ] - }, - { - "enumerant" : "ColMajor", - "value" : 5, - "capabilities" : [ "Matrix" ] - }, - { - "enumerant" : "ArrayStride", - "value" : 6, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Array Stride'" } - ] - }, - { - "enumerant" : "MatrixStride", - "value" : 7, - "capabilities" : [ "Matrix" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Matrix Stride'" } - ] - }, - { - "enumerant" : "GLSLShared", - "value" : 8, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GLSLPacked", - "value" : 9, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "CPacked", - "value" : 10, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "BuiltIn", - "value" : 11, - "parameters" : [ - { "kind" : "BuiltIn" } - ] - }, - { - "enumerant" : "NoPerspective", - "value" : 13, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Flat", - "value" : 14, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Patch", - "value" : 15, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Centroid", - "value" : 16, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Sample", - "value" : 17, - "capabilities" : [ "SampleRateShading" ] - }, - { - "enumerant" : "Invariant", - "value" : 18, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Restrict", - "value" : 19 - }, - { - "enumerant" : "Aliased", - "value" : 20 - }, - { - "enumerant" : "Volatile", - "value" : 21 - }, - { - "enumerant" : "Constant", - "value" : 22, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Coherent", - "value" : 23 - }, - { - "enumerant" : "NonWritable", - "value" : 24 - }, - { - "enumerant" : "NonReadable", - "value" : 25 - }, - { - "enumerant" : "Uniform", - "value" : 26, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "UniformId", - "value" : 27, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "IdScope", "name" : "'Execution'" } - ], - "version" : "1.4" - }, - { - "enumerant" : "SaturatedConversion", - "value" : 28, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Stream", - "value" : 29, - "capabilities" : [ "GeometryStreams" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Stream Number'" } - ] - }, - { - "enumerant" : "Location", - "value" : 30, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Location'" } - ] - }, - { - "enumerant" : "Component", - "value" : 31, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Component'" } - ] - }, - { - "enumerant" : "Index", - "value" : 32, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Index'" } - ] - }, - { - "enumerant" : "Binding", - "value" : 33, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Binding Point'" } - ] - }, - { - "enumerant" : "DescriptorSet", - "value" : 34, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Descriptor Set'" } - ] - }, - { - "enumerant" : "Offset", - "value" : 35, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Byte Offset'" } - ] - }, - { - "enumerant" : "XfbBuffer", - "value" : 36, - "capabilities" : [ "TransformFeedback" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'XFB Buffer Number'" } - ] - }, - { - "enumerant" : "XfbStride", - "value" : 37, - "capabilities" : [ "TransformFeedback" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'XFB Stride'" } - ] - }, - { - "enumerant" : "FuncParamAttr", - "value" : 38, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "FunctionParameterAttribute", "name" : "'Function Parameter Attribute'" } - ] - }, - { - "enumerant" : "FPRoundingMode", - "value" : 39, - "parameters" : [ - { "kind" : "FPRoundingMode", "name" : "'Floating-Point Rounding Mode'" } - ] - }, - { - "enumerant" : "FPFastMathMode", - "value" : 40, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "FPFastMathMode", "name" : "'Fast-Math Mode'" } - ] - }, - { - "enumerant" : "LinkageAttributes", - "value" : 41, - "capabilities" : [ "Linkage" ], - "parameters" : [ - { "kind" : "LiteralString", "name" : "'Name'" }, - { "kind" : "LinkageType", "name" : "'Linkage Type'" } - ] - }, - { - "enumerant" : "NoContraction", - "value" : 42, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InputAttachmentIndex", - "value" : 43, - "capabilities" : [ "InputAttachment" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Attachment Index'" } - ] - }, - { - "enumerant" : "Alignment", - "value" : 44, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Alignment'" } - ] - }, - { - "enumerant" : "MaxByteOffset", - "value" : 45, - "capabilities" : [ "Addresses" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Max Byte Offset'" } - ], - "version" : "1.1" - }, - { - "enumerant" : "AlignmentId", - "value" : 46, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "IdRef", "name" : "'Alignment'" } - ], - "version" : "1.2" - }, - { - "enumerant" : "MaxByteOffsetId", - "value" : 47, - "capabilities" : [ "Addresses" ], - "parameters" : [ - { "kind" : "IdRef", "name" : "'Max Byte Offset'" } - ], - "version" : "1.2" - }, - { - "enumerant" : "NoSignedWrap", - "value" : 4469, - "extensions" : [ "SPV_KHR_no_integer_wrap_decoration" ], - "version" : "1.4" - }, - { - "enumerant" : "NoUnsignedWrap", - "value" : 4470, - "extensions" : [ "SPV_KHR_no_integer_wrap_decoration" ], - "version" : "1.4" - }, - { - "enumerant" : "ExplicitInterpAMD", - "value" : 4999, - "extensions" : [ "SPV_AMD_shader_explicit_vertex_parameter" ], - "version" : "None" - }, - { - "enumerant" : "OverrideCoverageNV", - "value" : 5248, - "capabilities" : [ "SampleMaskOverrideCoverageNV" ], - "extensions" : [ "SPV_NV_sample_mask_override_coverage" ], - "version" : "None" - }, - { - "enumerant" : "PassthroughNV", - "value" : 5250, - "capabilities" : [ "GeometryShaderPassthroughNV" ], - "extensions" : [ "SPV_NV_geometry_shader_passthrough" ], - "version" : "None" - }, - { - "enumerant" : "ViewportRelativeNV", - "value" : 5252, - "capabilities" : [ "ShaderViewportMaskNV" ], - "version" : "None" - }, - { - "enumerant" : "SecondaryViewportRelativeNV", - "value" : 5256, - "capabilities" : [ "ShaderStereoViewNV" ], - "extensions" : [ "SPV_NV_stereo_view_rendering" ], - "version" : "None", - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Offset'" } - ] - }, - { - "enumerant" : "PerPrimitiveNV", - "value" : 5271, - "capabilities" : [ "MeshShadingNV" ], - "extensions" : [ "SPV_NV_mesh_shader" ], - "version" : "None" - }, - { - "enumerant" : "PerViewNV", - "value" : 5272, - "capabilities" : [ "MeshShadingNV" ], - "extensions" : [ "SPV_NV_mesh_shader" ], - "version" : "None" - }, - { - "enumerant" : "PerTaskNV", - "value" : 5273, - "capabilities" : [ "MeshShadingNV" ], - "extensions" : [ "SPV_NV_mesh_shader" ], - "version" : "None" - }, - { - "enumerant" : "PerVertexNV", - "value" : 5285, - "capabilities" : [ "FragmentBarycentricNV" ], - "extensions" : [ "SPV_NV_fragment_shader_barycentric" ], - "version" : "None" - }, - { - "enumerant" : "NonUniform", - "value" : 5300, - "capabilities" : [ "ShaderNonUniform" ], - "version" : "1.5" - }, - { - "enumerant" : "NonUniformEXT", - "value" : 5300, - "capabilities" : [ "ShaderNonUniform" ], - "extensions" : [ "SPV_EXT_descriptor_indexing" ], - "version" : "1.5" - }, - { - "enumerant" : "RestrictPointer", - "value" : 5355, - "capabilities" : [ "PhysicalStorageBufferAddresses" ], - "extensions" : [ "SPV_EXT_physical_storage_buffer", "SPV_KHR_physical_storage_buffer" ], - "version" : "1.5" - }, - { - "enumerant" : "RestrictPointerEXT", - "value" : 5355, - "capabilities" : [ "PhysicalStorageBufferAddresses" ], - "extensions" : [ "SPV_EXT_physical_storage_buffer" ], - "version" : "1.5" - }, - { - "enumerant" : "AliasedPointer", - "value" : 5356, - "capabilities" : [ "PhysicalStorageBufferAddresses" ], - "extensions" : [ "SPV_EXT_physical_storage_buffer", "SPV_KHR_physical_storage_buffer" ], - "version" : "1.5" - }, - { - "enumerant" : "AliasedPointerEXT", - "value" : 5356, - "capabilities" : [ "PhysicalStorageBufferAddresses" ], - "extensions" : [ "SPV_EXT_physical_storage_buffer" ], - "version" : "1.5" - }, - { - "enumerant" : "SIMTCallINTEL", - "value" : 5599, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'N'" } - ], - "capabilities" : [ "VectorComputeINTEL" ], - "version" : "None" - }, - { - "enumerant" : "ReferencedIndirectlyINTEL", - "value" : 5602, - "capabilities" : [ "IndirectReferencesINTEL" ], - "extensions" : [ "SPV_INTEL_function_pointers" ], - "version" : "None" - }, - { - "enumerant" : "ClobberINTEL", - "value" : 5607, - "parameters" : [ - { "kind" : "LiteralString", "name" : "'Register'" } - ], - "capabilities" : [ "AsmINTEL" ], - "version" : "None" - }, - { - "enumerant" : "SideEffectsINTEL", - "value" : 5608, - "capabilities" : [ "AsmINTEL" ], - "version" : "None" - }, - { - "enumerant" : "VectorComputeVariableINTEL", - "value" : 5624, - "capabilities" : [ "VectorComputeINTEL" ], - "version" : "None" - }, - { - "enumerant" : "FuncParamIOKindINTEL", - "value" : 5625, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Kind'" } - ], - "capabilities" : [ "VectorComputeINTEL" ], - "version" : "None" - }, - { - "enumerant" : "VectorComputeFunctionINTEL", - "value" : 5626, - "capabilities" : [ "VectorComputeINTEL" ], - "version" : "None" - }, - { - "enumerant" : "StackCallINTEL", - "value" : 5627, - "capabilities" : [ "VectorComputeINTEL" ], - "version" : "None" - }, - { - "enumerant" : "GlobalVariableOffsetINTEL", - "value" : 5628, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Offset'" } - ], - "capabilities" : [ "VectorComputeINTEL" ], - "version" : "None" - }, - { - "enumerant" : "CounterBuffer", - "value" : 5634, - "parameters" : [ - { "kind" : "IdRef", "name" : "'Counter Buffer'" } - ], - "version" : "1.4" - }, - { - "enumerant" : "HlslCounterBufferGOOGLE", - "value" : 5634, - "parameters" : [ - { "kind" : "IdRef", "name" : "'Counter Buffer'" } - ], - "extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ], - "version" : "None" - }, - { - "enumerant" : "UserSemantic", - "value" : 5635, - "parameters" : [ - { "kind" : "LiteralString", "name" : "'Semantic'" } - ], - "version" : "1.4" - }, - { - "enumerant" : "HlslSemanticGOOGLE", - "value" : 5635, - "parameters" : [ - { "kind" : "LiteralString", "name" : "'Semantic'" } - ], - "extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ], - "version" : "None" - }, - { - "enumerant" : "UserTypeGOOGLE", - "value" : 5636, - "parameters" : [ - { "kind" : "LiteralString", "name" : "'User Type'" } - ], - "extensions" : [ "SPV_GOOGLE_user_type" ], - "version" : "None" - }, - { - "enumerant" : "FunctionRoundingModeINTEL", - "value" : 5822, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Target Width'" }, - { "kind" : "FPRoundingMode", "name" : "'FP Rounding Mode'" } - ], - "capabilities" : [ "FunctionFloatControlINTEL" ], - "version" : "None" - }, - { - "enumerant" : "FunctionDenormModeINTEL", - "value" : 5823, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Target Width'" }, - { "kind" : "FPDenormMode", "name" : "'FP Denorm Mode'" } - ], - "capabilities" : [ "FunctionFloatControlINTEL" ], - "version" : "None" - }, - { - "enumerant" : "RegisterINTEL", - "value" : 5825, - "capabilities" : [ "FPGAMemoryAttributesINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_memory_attributes" ], - "version" : "None" - }, - { - "enumerant" : "MemoryINTEL", - "value" : 5826, - "parameters" : [ - { "kind" : "LiteralString", "name" : "'Memory Type'" } - ], - "capabilities" : [ "FPGAMemoryAttributesINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_memory_attributes" ], - "version" : "None" - }, - { - "enumerant" : "NumbanksINTEL", - "value" : 5827, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Banks'" } - ], - "capabilities" : [ "FPGAMemoryAttributesINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_memory_attributes" ], - "version" : "None" - }, - { - "enumerant" : "BankwidthINTEL", - "value" : 5828, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Bank Width'" } - ], - "capabilities" : [ "FPGAMemoryAttributesINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_memory_attributes" ], - "version" : "None" - }, - { - "enumerant" : "MaxPrivateCopiesINTEL", - "value" : 5829, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Maximum Copies'" } - ], - "capabilities" : [ "FPGAMemoryAttributesINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_memory_attributes" ], - "version" : "None" - }, - { - "enumerant" : "SinglepumpINTEL", - "value" : 5830, - "capabilities" : [ "FPGAMemoryAttributesINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_memory_attributes" ], - "version" : "None" - }, - { - "enumerant" : "DoublepumpINTEL", - "value" : 5831, - "capabilities" : [ "FPGAMemoryAttributesINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_memory_attributes" ], - "version" : "None" - }, - { - "enumerant" : "MaxReplicatesINTEL", - "value" : 5832, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Maximum Replicates'" } - ], - "capabilities" : [ "FPGAMemoryAttributesINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_memory_attributes" ], - "version" : "None" - }, - { - "enumerant" : "SimpleDualPortINTEL", - "value" : 5833, - "capabilities" : [ "FPGAMemoryAttributesINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_memory_attributes" ], - "version" : "None" - }, - { - "enumerant" : "MergeINTEL", - "value" : 5834, - "parameters" : [ - { "kind" : "LiteralString", "name" : "'Merge Key'" }, - { "kind" : "LiteralString", "name" : "'Merge Type'" } - ], - "capabilities" : [ "FPGAMemoryAttributesINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_memory_attributes" ], - "version" : "None" - }, - { - "enumerant" : "BankBitsINTEL", - "value" : 5835, - "parameters" : [ - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Bank Bits'" } - ], - "capabilities" : [ "FPGAMemoryAttributesINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_memory_attributes" ], - "version" : "None" - }, - { - "enumerant" : "ForcePow2DepthINTEL", - "value" : 5836, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Force Key'" } - ], - "capabilities" : [ "FPGAMemoryAttributesINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_memory_attributes" ], - "version" : "None" - }, - { - "enumerant" : "BurstCoalesceINTEL", - "value" : 5899, - "capabilities" : [ "FPGAMemoryAccessesINTEL" ], - "version" : "None" - }, - { - "enumerant" : "CacheSizeINTEL", - "value" : 5900, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Cache Size in bytes'" } - ], - "capabilities" : [ "FPGAMemoryAccessesINTEL" ], - "version" : "None" - }, - { - "enumerant" : "DontStaticallyCoalesceINTEL", - "value" : 5901, - "capabilities" : [ "FPGAMemoryAccessesINTEL" ], - "version" : "None" - }, - { - "enumerant" : "PrefetchINTEL", - "value" : 5902, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Prefetcher Size in bytes'" } - ], - "capabilities" : [ "FPGAMemoryAccessesINTEL" ], - "version" : "None" - }, - { - "enumerant" : "StallEnableINTEL", - "value" : 5905, - "capabilities" : [ "FPGAClusterAttributesINTEL" ], - "version" : "None" - }, - { - "enumerant" : "FuseLoopsInFunctionINTEL", - "value" : 5907, - "capabilities" : [ "LoopFuseINTEL" ], - "version" : "None" - }, - { - "enumerant" : "BufferLocationINTEL", - "value" : 5921, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Buffer Location ID'" } - ], - "capabilities" : [ "FPGABufferLocationINTEL" ], - "version" : "None" - }, - { - "enumerant" : "IOPipeStorageINTEL", - "value" : 5944, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'IO Pipe ID'" } - ], - "capabilities" : [ "IOPipesINTEL" ], - "version" : "None" - }, - { - "enumerant" : "FunctionFloatingPointModeINTEL", - "value" : 6080, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Target Width'" }, - { "kind" : "FPOperationMode", "name" : "'FP Operation Mode'" } - ], - "capabilities" : [ "FunctionFloatControlINTEL" ], - "version" : "None" - }, - { - "enumerant" : "SingleElementVectorINTEL", - "value" : 6085, - "capabilities" : [ "VectorComputeINTEL" ], - "version" : "None" - }, - { - "enumerant" : "VectorComputeCallableFunctionINTEL", - "value" : 6087, - "capabilities" : [ "VectorComputeINTEL" ], - "version" : "None" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "BuiltIn", - "enumerants" : [ - { - "enumerant" : "Position", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PointSize", - "value" : 1, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ClipDistance", - "value" : 3, - "capabilities" : [ "ClipDistance" ] - }, - { - "enumerant" : "CullDistance", - "value" : 4, - "capabilities" : [ "CullDistance" ] - }, - { - "enumerant" : "VertexId", - "value" : 5, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InstanceId", - "value" : 6, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PrimitiveId", - "value" : 7, - "capabilities" : [ "Geometry", "Tessellation", "RayTracingNV", "RayTracingKHR", "MeshShadingNV" ] - }, - { - "enumerant" : "InvocationId", - "value" : 8, - "capabilities" : [ "Geometry", "Tessellation" ] - }, - { - "enumerant" : "Layer", - "value" : 9, - "capabilities" : [ "Geometry", "ShaderLayer", "ShaderViewportIndexLayerEXT", "MeshShadingNV" ] - }, - { - "enumerant" : "ViewportIndex", - "value" : 10, - "capabilities" : [ "MultiViewport", "ShaderViewportIndex", "ShaderViewportIndexLayerEXT", "MeshShadingNV" ] - }, - { - "enumerant" : "TessLevelOuter", - "value" : 11, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "TessLevelInner", - "value" : 12, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "TessCoord", - "value" : 13, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "PatchVertices", - "value" : 14, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "FragCoord", - "value" : 15, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PointCoord", - "value" : 16, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "FrontFacing", - "value" : 17, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SampleId", - "value" : 18, - "capabilities" : [ "SampleRateShading" ] - }, - { - "enumerant" : "SamplePosition", - "value" : 19, - "capabilities" : [ "SampleRateShading" ] - }, - { - "enumerant" : "SampleMask", - "value" : 20, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "FragDepth", - "value" : 22, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "HelperInvocation", - "value" : 23, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "NumWorkgroups", - "value" : 24 - }, - { - "enumerant" : "WorkgroupSize", - "value" : 25 - }, - { - "enumerant" : "WorkgroupId", - "value" : 26 - }, - { - "enumerant" : "LocalInvocationId", - "value" : 27 - }, - { - "enumerant" : "GlobalInvocationId", - "value" : 28 - }, - { - "enumerant" : "LocalInvocationIndex", - "value" : 29 - }, - { - "enumerant" : "WorkDim", - "value" : 30, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "GlobalSize", - "value" : 31, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "EnqueuedWorkgroupSize", - "value" : 32, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "GlobalOffset", - "value" : 33, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "GlobalLinearId", - "value" : 34, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupSize", - "value" : 36, - "capabilities" : [ "Kernel", "GroupNonUniform", "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupMaxSize", - "value" : 37, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NumSubgroups", - "value" : 38, - "capabilities" : [ "Kernel", "GroupNonUniform" ] - }, - { - "enumerant" : "NumEnqueuedSubgroups", - "value" : 39, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupId", - "value" : 40, - "capabilities" : [ "Kernel", "GroupNonUniform" ] - }, - { - "enumerant" : "SubgroupLocalInvocationId", - "value" : 41, - "capabilities" : [ "Kernel", "GroupNonUniform", "SubgroupBallotKHR" ] - }, - { - "enumerant" : "VertexIndex", - "value" : 42, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InstanceIndex", - "value" : 43, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SubgroupEqMask", - "value" : 4416, - "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], - "version" : "1.3" - }, - { - "enumerant" : "SubgroupEqMaskKHR", - "value" : 4416, - "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], - "extensions" : [ "SPV_KHR_shader_ballot" ], - "version" : "1.3" - }, - { - "enumerant" : "SubgroupGeMask", - "value" : 4417, - "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], - "version" : "1.3" - }, - { - "enumerant" : "SubgroupGeMaskKHR", - "value" : 4417, - "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], - "extensions" : [ "SPV_KHR_shader_ballot" ], - "version" : "1.3" - }, - { - "enumerant" : "SubgroupGtMask", - "value" : 4418, - "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], - "version" : "1.3" - }, - { - "enumerant" : "SubgroupGtMaskKHR", - "value" : 4418, - "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], - "extensions" : [ "SPV_KHR_shader_ballot" ], - "version" : "1.3" - }, - { - "enumerant" : "SubgroupLeMask", - "value" : 4419, - "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], - "version" : "1.3" - }, - { - "enumerant" : "SubgroupLeMaskKHR", - "value" : 4419, - "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], - "extensions" : [ "SPV_KHR_shader_ballot" ], - "version" : "1.3" - }, - { - "enumerant" : "SubgroupLtMask", - "value" : 4420, - "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], - "version" : "1.3" - }, - { - "enumerant" : "SubgroupLtMaskKHR", - "value" : 4420, - "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], - "extensions" : [ "SPV_KHR_shader_ballot" ], - "version" : "1.3" - }, - { - "enumerant" : "BaseVertex", - "value" : 4424, - "capabilities" : [ "DrawParameters" ], - "extensions" : [ "SPV_KHR_shader_draw_parameters" ], - "version" : "1.3" - }, - { - "enumerant" : "BaseInstance", - "value" : 4425, - "capabilities" : [ "DrawParameters" ], - "extensions" : [ "SPV_KHR_shader_draw_parameters" ], - "version" : "1.3" - }, - { - "enumerant" : "DrawIndex", - "value" : 4426, - "capabilities" : [ "DrawParameters", "MeshShadingNV" ], - "extensions" : [ "SPV_KHR_shader_draw_parameters", "SPV_NV_mesh_shader" ], - "version" : "1.3" - }, - { - "enumerant" : "PrimitiveShadingRateKHR", - "value" : 4432, - "capabilities" : [ "FragmentShadingRateKHR" ], - "extensions" : [ "SPV_KHR_fragment_shading_rate" ], - "version" : "None" - }, - { - "enumerant" : "DeviceIndex", - "value" : 4438, - "capabilities" : [ "DeviceGroup" ], - "extensions" : [ "SPV_KHR_device_group" ], - "version" : "1.3" - }, - { - "enumerant" : "ViewIndex", - "value" : 4440, - "capabilities" : [ "MultiView" ], - "extensions" : [ "SPV_KHR_multiview" ], - "version" : "1.3" - }, - { - "enumerant" : "ShadingRateKHR", - "value" : 4444, - "capabilities" : [ "FragmentShadingRateKHR" ], - "extensions" : [ "SPV_KHR_fragment_shading_rate" ], - "version" : "None" - }, - { - "enumerant" : "BaryCoordNoPerspAMD", - "value" : 4992, - "extensions" : [ "SPV_AMD_shader_explicit_vertex_parameter" ], - "version" : "None" - }, - { - "enumerant" : "BaryCoordNoPerspCentroidAMD", - "value" : 4993, - "extensions" : [ "SPV_AMD_shader_explicit_vertex_parameter" ], - "version" : "None" - }, - { - "enumerant" : "BaryCoordNoPerspSampleAMD", - "value" : 4994, - "extensions" : [ "SPV_AMD_shader_explicit_vertex_parameter" ], - "version" : "None" - }, - { - "enumerant" : "BaryCoordSmoothAMD", - "value" : 4995, - "extensions" : [ "SPV_AMD_shader_explicit_vertex_parameter" ], - "version" : "None" - }, - { - "enumerant" : "BaryCoordSmoothCentroidAMD", - "value" : 4996, - "extensions" : [ "SPV_AMD_shader_explicit_vertex_parameter" ], - "version" : "None" - }, - { - "enumerant" : "BaryCoordSmoothSampleAMD", - "value" : 4997, - "extensions" : [ "SPV_AMD_shader_explicit_vertex_parameter" ], - "version" : "None" - }, - { - "enumerant" : "BaryCoordPullModelAMD", - "value" : 4998, - "extensions" : [ "SPV_AMD_shader_explicit_vertex_parameter" ], - "version" : "None" - }, - { - "enumerant" : "FragStencilRefEXT", - "value" : 5014, - "capabilities" : [ "StencilExportEXT" ], - "extensions" : [ "SPV_EXT_shader_stencil_export" ], - "version" : "None" - }, - { - "enumerant" : "ViewportMaskNV", - "value" : 5253, - "capabilities" : [ "ShaderViewportMaskNV", "MeshShadingNV" ], - "extensions" : [ "SPV_NV_viewport_array2", "SPV_NV_mesh_shader" ], - "version" : "None" - }, - { - "enumerant" : "SecondaryPositionNV", - "value" : 5257, - "capabilities" : [ "ShaderStereoViewNV" ], - "extensions" : [ "SPV_NV_stereo_view_rendering" ], - "version" : "None" - }, - { - "enumerant" : "SecondaryViewportMaskNV", - "value" : 5258, - "capabilities" : [ "ShaderStereoViewNV" ], - "extensions" : [ "SPV_NV_stereo_view_rendering" ], - "version" : "None" - }, - { - "enumerant" : "PositionPerViewNV", - "value" : 5261, - "capabilities" : [ "PerViewAttributesNV", "MeshShadingNV" ], - "extensions" : [ "SPV_NVX_multiview_per_view_attributes", "SPV_NV_mesh_shader" ], - "version" : "None" - }, - { - "enumerant" : "ViewportMaskPerViewNV", - "value" : 5262, - "capabilities" : [ "PerViewAttributesNV", "MeshShadingNV" ], - "extensions" : [ "SPV_NVX_multiview_per_view_attributes", "SPV_NV_mesh_shader" ], - "version" : "None" - }, - { - "enumerant" : "FullyCoveredEXT", - "value" : 5264, - "capabilities" : [ "FragmentFullyCoveredEXT" ], - "extensions" : [ "SPV_EXT_fragment_fully_covered" ], - "version" : "None" - }, - { - "enumerant" : "TaskCountNV", - "value" : 5274, - "capabilities" : [ "MeshShadingNV" ], - "extensions" : [ "SPV_NV_mesh_shader" ], - "version" : "None" - }, - { - "enumerant" : "PrimitiveCountNV", - "value" : 5275, - "capabilities" : [ "MeshShadingNV" ], - "extensions" : [ "SPV_NV_mesh_shader" ], - "version" : "None" - }, - { - "enumerant" : "PrimitiveIndicesNV", - "value" : 5276, - "capabilities" : [ "MeshShadingNV" ], - "extensions" : [ "SPV_NV_mesh_shader" ], - "version" : "None" - }, - { - "enumerant" : "ClipDistancePerViewNV", - "value" : 5277, - "capabilities" : [ "MeshShadingNV" ], - "extensions" : [ "SPV_NV_mesh_shader" ], - "version" : "None" - }, - { - "enumerant" : "CullDistancePerViewNV", - "value" : 5278, - "capabilities" : [ "MeshShadingNV" ], - "extensions" : [ "SPV_NV_mesh_shader" ], - "version" : "None" - }, - { - "enumerant" : "LayerPerViewNV", - "value" : 5279, - "capabilities" : [ "MeshShadingNV" ], - "extensions" : [ "SPV_NV_mesh_shader" ], - "version" : "None" - }, - { - "enumerant" : "MeshViewCountNV", - "value" : 5280, - "capabilities" : [ "MeshShadingNV" ], - "extensions" : [ "SPV_NV_mesh_shader" ], - "version" : "None" - }, - { - "enumerant" : "MeshViewIndicesNV", - "value" : 5281, - "capabilities" : [ "MeshShadingNV" ], - "extensions" : [ "SPV_NV_mesh_shader" ], - "version" : "None" - }, - { - "enumerant" : "BaryCoordNV", - "value" : 5286, - "capabilities" : [ "FragmentBarycentricNV" ], - "extensions" : [ "SPV_NV_fragment_shader_barycentric" ], - "version" : "None" - }, - { - "enumerant" : "BaryCoordNoPerspNV", - "value" : 5287, - "capabilities" : [ "FragmentBarycentricNV" ], - "extensions" : [ "SPV_NV_fragment_shader_barycentric" ], - "version" : "None" - }, - { - "enumerant" : "FragSizeEXT", - "value" : 5292 , - "capabilities" : [ "FragmentDensityEXT", "ShadingRateNV" ], - "extensions" : [ "SPV_EXT_fragment_invocation_density", "SPV_NV_shading_rate" ], - "version" : "None" - }, - { - "enumerant" : "FragmentSizeNV", - "value" : 5292 , - "capabilities" : [ "ShadingRateNV", "FragmentDensityEXT" ], - "extensions" : [ "SPV_NV_shading_rate", "SPV_EXT_fragment_invocation_density" ], - "version" : "None" - }, - { - "enumerant" : "FragInvocationCountEXT", - "value" : 5293, - "capabilities" : [ "FragmentDensityEXT", "ShadingRateNV" ], - "extensions" : [ "SPV_EXT_fragment_invocation_density", "SPV_NV_shading_rate" ], - "version" : "None" - }, - { - "enumerant" : "InvocationsPerPixelNV", - "value" : 5293, - "capabilities" : [ "ShadingRateNV", "FragmentDensityEXT" ], - "extensions" : [ "SPV_NV_shading_rate", "SPV_EXT_fragment_invocation_density" ], - "version" : "None" - }, - { - "enumerant" : "LaunchIdNV", - "value" : 5319, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "LaunchIdKHR", - "value" : 5319, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "LaunchSizeNV", - "value" : 5320, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "LaunchSizeKHR", - "value" : 5320, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "WorldRayOriginNV", - "value" : 5321, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "WorldRayOriginKHR", - "value" : 5321, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "WorldRayDirectionNV", - "value" : 5322, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "WorldRayDirectionKHR", - "value" : 5322, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "ObjectRayOriginNV", - "value" : 5323, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "ObjectRayOriginKHR", - "value" : 5323, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "ObjectRayDirectionNV", - "value" : 5324, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "ObjectRayDirectionKHR", - "value" : 5324, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "RayTminNV", - "value" : 5325, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "RayTminKHR", - "value" : 5325, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "RayTmaxNV", - "value" : 5326, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "RayTmaxKHR", - "value" : 5326, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "InstanceCustomIndexNV", - "value" : 5327, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "InstanceCustomIndexKHR", - "value" : 5327, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "ObjectToWorldNV", - "value" : 5330, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "ObjectToWorldKHR", - "value" : 5330, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "WorldToObjectNV", - "value" : 5331, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "WorldToObjectKHR", - "value" : 5331, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "HitTNV", - "value" : 5332, - "capabilities" : [ "RayTracingNV" ], - "extensions" : [ "SPV_NV_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "HitKindNV", - "value" : 5333, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "HitKindKHR", - "value" : 5333, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "CurrentRayTimeNV", - "value" : 5334, - "capabilities" : [ "RayTracingMotionBlurNV" ], - "extensions" : [ "SPV_NV_ray_tracing_motion_blur" ], - "version" : "None" - }, - { - "enumerant" : "IncomingRayFlagsNV", - "value" : 5351, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "IncomingRayFlagsKHR", - "value" : 5351, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "RayGeometryIndexKHR", - "value" : 5352, - "capabilities" : [ "RayTracingKHR" ], - "extensions" : [ "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "WarpsPerSMNV", - "value" : 5374, - "capabilities" : [ "ShaderSMBuiltinsNV" ], - "extensions" : [ "SPV_NV_shader_sm_builtins" ], - "version" : "None" - }, - { - "enumerant" : "SMCountNV", - "value" : 5375, - "capabilities" : [ "ShaderSMBuiltinsNV" ], - "extensions" : [ "SPV_NV_shader_sm_builtins" ], - "version" : "None" - }, - { - "enumerant" : "WarpIDNV", - "value" : 5376, - "capabilities" : [ "ShaderSMBuiltinsNV" ], - "extensions" : [ "SPV_NV_shader_sm_builtins" ], - "version" : "None" - }, - { - "enumerant" : "SMIDNV", - "value" : 5377, - "capabilities" : [ "ShaderSMBuiltinsNV" ], - "extensions" : [ "SPV_NV_shader_sm_builtins" ], - "version" : "None" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Scope", - "enumerants" : [ - { - "enumerant" : "CrossDevice", - "value" : 0 - }, - { - "enumerant" : "Device", - "value" : 1 - }, - { - "enumerant" : "Workgroup", - "value" : 2 - }, - { - "enumerant" : "Subgroup", - "value" : 3 - }, - { - "enumerant" : "Invocation", - "value" : 4 - }, - { - "enumerant" : "QueueFamily", - "value" : 5, - "capabilities" : [ "VulkanMemoryModel" ], - "version" : "1.5" - }, - { - "enumerant" : "QueueFamilyKHR", - "value" : 5, - "capabilities" : [ "VulkanMemoryModel" ], - "version" : "1.5" - }, - { - "enumerant" : "ShaderCallKHR", - "value" : 6, - "capabilities" : [ "RayTracingKHR" ], - "version" : "None" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "GroupOperation", - "enumerants" : [ - { - "enumerant" : "Reduce", - "value" : 0, - "capabilities" : [ "Kernel", "GroupNonUniformArithmetic", "GroupNonUniformBallot" ] - }, - { - "enumerant" : "InclusiveScan", - "value" : 1, - "capabilities" : [ "Kernel", "GroupNonUniformArithmetic", "GroupNonUniformBallot" ] - }, - { - "enumerant" : "ExclusiveScan", - "value" : 2, - "capabilities" : [ "Kernel", "GroupNonUniformArithmetic", "GroupNonUniformBallot" ] - }, - { - "enumerant" : "ClusteredReduce", - "value" : 3, - "capabilities" : [ "GroupNonUniformClustered" ], - "version" : "1.3" - }, - { - "enumerant" : "PartitionedReduceNV", - "value" : 6, - "capabilities" : [ "GroupNonUniformPartitionedNV" ], - "extensions" : [ "SPV_NV_shader_subgroup_partitioned" ], - "version" : "None" - }, - { - "enumerant" : "PartitionedInclusiveScanNV", - "value" : 7, - "capabilities" : [ "GroupNonUniformPartitionedNV" ], - "extensions" : [ "SPV_NV_shader_subgroup_partitioned" ], - "version" : "None" - }, - { - "enumerant" : "PartitionedExclusiveScanNV", - "value" : 8, - "capabilities" : [ "GroupNonUniformPartitionedNV" ], - "extensions" : [ "SPV_NV_shader_subgroup_partitioned" ], - "version" : "None" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "KernelEnqueueFlags", - "enumerants" : [ - { - "enumerant" : "NoWait", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "WaitKernel", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "WaitWorkGroup", - "value" : 2, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Capability", - "enumerants" : [ - { - "enumerant" : "Matrix", - "value" : 0 - }, - { - "enumerant" : "Shader", - "value" : 1, - "capabilities" : [ "Matrix" ] - }, - { - "enumerant" : "Geometry", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Tessellation", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Addresses", - "value" : 4 - }, - { - "enumerant" : "Linkage", - "value" : 5 - }, - { - "enumerant" : "Kernel", - "value" : 6 - }, - { - "enumerant" : "Vector16", - "value" : 7, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Float16Buffer", - "value" : 8, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Float16", - "value" : 9 - }, - { - "enumerant" : "Float64", - "value" : 10 - }, - { - "enumerant" : "Int64", - "value" : 11 - }, - { - "enumerant" : "Int64Atomics", - "value" : 12, - "capabilities" : [ "Int64" ] - }, - { - "enumerant" : "ImageBasic", - "value" : 13, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ImageReadWrite", - "value" : 14, - "capabilities" : [ "ImageBasic" ] - }, - { - "enumerant" : "ImageMipmap", - "value" : 15, - "capabilities" : [ "ImageBasic" ] - }, - { - "enumerant" : "Pipes", - "value" : 17, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Groups", - "value" : 18, - "extensions" : [ "SPV_AMD_shader_ballot" ] - }, - { - "enumerant" : "DeviceEnqueue", - "value" : 19, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "LiteralSampler", - "value" : 20, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "AtomicStorage", - "value" : 21, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Int16", - "value" : 22 - }, - { - "enumerant" : "TessellationPointSize", - "value" : 23, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "GeometryPointSize", - "value" : 24, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "ImageGatherExtended", - "value" : 25, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageMultisample", - "value" : 27, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "UniformBufferArrayDynamicIndexing", - "value" : 28, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SampledImageArrayDynamicIndexing", - "value" : 29, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageBufferArrayDynamicIndexing", - "value" : 30, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageArrayDynamicIndexing", - "value" : 31, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ClipDistance", - "value" : 32, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "CullDistance", - "value" : 33, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ImageCubeArray", - "value" : 34, - "capabilities" : [ "SampledCubeArray" ] - }, - { - "enumerant" : "SampleRateShading", - "value" : 35, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ImageRect", - "value" : 36, - "capabilities" : [ "SampledRect" ] - }, - { - "enumerant" : "SampledRect", - "value" : 37, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GenericPointer", - "value" : 38, - "capabilities" : [ "Addresses" ] - }, - { - "enumerant" : "Int8", - "value" : 39 - }, - { - "enumerant" : "InputAttachment", - "value" : 40, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SparseResidency", - "value" : 41, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "MinLod", - "value" : 42, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Sampled1D", - "value" : 43 - }, - { - "enumerant" : "Image1D", - "value" : 44, - "capabilities" : [ "Sampled1D" ] - }, - { - "enumerant" : "SampledCubeArray", - "value" : 45, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SampledBuffer", - "value" : 46 - }, - { - "enumerant" : "ImageBuffer", - "value" : 47, - "capabilities" : [ "SampledBuffer" ] - }, - { - "enumerant" : "ImageMSArray", - "value" : 48, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageExtendedFormats", - "value" : 49, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ImageQuery", - "value" : 50, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DerivativeControl", - "value" : 51, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InterpolationFunction", - "value" : 52, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "TransformFeedback", - "value" : 53, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GeometryStreams", - "value" : 54, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "StorageImageReadWithoutFormat", - "value" : 55, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageWriteWithoutFormat", - "value" : 56, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "MultiViewport", - "value" : 57, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "SubgroupDispatch", - "value" : 58, - "capabilities" : [ "DeviceEnqueue" ], - "version" : "1.1" - }, - { - "enumerant" : "NamedBarrier", - "value" : 59, - "capabilities" : [ "Kernel" ], - "version" : "1.1" - }, - { - "enumerant" : "PipeStorage", - "value" : 60, - "capabilities" : [ "Pipes" ], - "version" : "1.1" - }, - { - "enumerant" : "GroupNonUniform", - "value" : 61, - "version" : "1.3" - }, - { - "enumerant" : "GroupNonUniformVote", - "value" : 62, - "capabilities" : [ "GroupNonUniform" ], - "version" : "1.3" - }, - { - "enumerant" : "GroupNonUniformArithmetic", - "value" : 63, - "capabilities" : [ "GroupNonUniform" ], - "version" : "1.3" - }, - { - "enumerant" : "GroupNonUniformBallot", - "value" : 64, - "capabilities" : [ "GroupNonUniform" ], - "version" : "1.3" - }, - { - "enumerant" : "GroupNonUniformShuffle", - "value" : 65, - "capabilities" : [ "GroupNonUniform" ], - "version" : "1.3" - }, - { - "enumerant" : "GroupNonUniformShuffleRelative", - "value" : 66, - "capabilities" : [ "GroupNonUniform" ], - "version" : "1.3" - }, - { - "enumerant" : "GroupNonUniformClustered", - "value" : 67, - "capabilities" : [ "GroupNonUniform" ], - "version" : "1.3" - }, - { - "enumerant" : "GroupNonUniformQuad", - "value" : 68, - "capabilities" : [ "GroupNonUniform" ], - "version" : "1.3" - }, - { - "enumerant" : "ShaderLayer", - "value" : 69, - "version" : "1.5" - }, - { - "enumerant" : "ShaderViewportIndex", - "value" : 70, - "version" : "1.5" - }, - { - "enumerant" : "FragmentShadingRateKHR", - "value" : 4422, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_KHR_fragment_shading_rate" ], - "version" : "None" - }, - { - "enumerant" : "SubgroupBallotKHR", - "value" : 4423, - "extensions" : [ "SPV_KHR_shader_ballot" ], - "version" : "None" - }, - { - "enumerant" : "DrawParameters", - "value" : 4427, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_KHR_shader_draw_parameters" ], - "version" : "1.3" - }, - { - "enumerant" : "WorkgroupMemoryExplicitLayoutKHR", - "value" : 4428, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_KHR_workgroup_memory_explicit_layout" ], - "version" : "None" - }, - { - "enumerant" : "WorkgroupMemoryExplicitLayout8BitAccessKHR", - "value" : 4429, - "capabilities" : [ "WorkgroupMemoryExplicitLayoutKHR" ], - "extensions" : [ "SPV_KHR_workgroup_memory_explicit_layout" ], - "version" : "None" - }, - { - "enumerant" : "WorkgroupMemoryExplicitLayout16BitAccessKHR", - "value" : 4430, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_KHR_workgroup_memory_explicit_layout" ], - "version" : "None" - }, - { - "enumerant" : "SubgroupVoteKHR", - "value" : 4431, - "extensions" : [ "SPV_KHR_subgroup_vote" ], - "version" : "None" - }, - { - "enumerant" : "StorageBuffer16BitAccess", - "value" : 4433, - "extensions" : [ "SPV_KHR_16bit_storage" ], - "version" : "1.3" - }, - { - "enumerant" : "StorageUniformBufferBlock16", - "value" : 4433, - "extensions" : [ "SPV_KHR_16bit_storage" ], - "version" : "1.3" - }, - { - "enumerant" : "UniformAndStorageBuffer16BitAccess", - "value" : 4434, - "capabilities" : [ - "StorageBuffer16BitAccess", - "StorageUniformBufferBlock16" - ], - "extensions" : [ "SPV_KHR_16bit_storage" ], - "version" : "1.3" - }, - { - "enumerant" : "StorageUniform16", - "value" : 4434, - "capabilities" : [ - "StorageBuffer16BitAccess", - "StorageUniformBufferBlock16" - ], - "extensions" : [ "SPV_KHR_16bit_storage" ], - "version" : "1.3" - }, - { - "enumerant" : "StoragePushConstant16", - "value" : 4435, - "extensions" : [ "SPV_KHR_16bit_storage" ], - "version" : "1.3" - }, - { - "enumerant" : "StorageInputOutput16", - "value" : 4436, - "extensions" : [ "SPV_KHR_16bit_storage" ], - "version" : "1.3" - }, - { - "enumerant" : "DeviceGroup", - "value" : 4437, - "extensions" : [ "SPV_KHR_device_group" ], - "version" : "1.3" - }, - { - "enumerant" : "MultiView", - "value" : 4439, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_KHR_multiview" ], - "version" : "1.3" - }, - { - "enumerant" : "VariablePointersStorageBuffer", - "value" : 4441, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_KHR_variable_pointers" ], - "version" : "1.3" - }, - { - "enumerant" : "VariablePointers", - "value" : 4442, - "capabilities" : [ "VariablePointersStorageBuffer" ], - "extensions" : [ "SPV_KHR_variable_pointers" ], - "version" : "1.3" - }, - { - "enumerant" : "AtomicStorageOps", - "value" : 4445, - "extensions" : [ "SPV_KHR_shader_atomic_counter_ops" ], - "version" : "None" - }, - { - "enumerant" : "SampleMaskPostDepthCoverage", - "value" : 4447, - "extensions" : [ "SPV_KHR_post_depth_coverage" ], - "version" : "None" - }, - { - "enumerant" : "StorageBuffer8BitAccess", - "value" : 4448, - "extensions" : [ "SPV_KHR_8bit_storage" ], - "version" : "1.5" - }, - { - "enumerant" : "UniformAndStorageBuffer8BitAccess", - "value" : 4449, - "capabilities" : [ "StorageBuffer8BitAccess" ], - "extensions" : [ "SPV_KHR_8bit_storage" ], - "version" : "1.5" - }, - { - "enumerant" : "StoragePushConstant8", - "value" : 4450, - "extensions" : [ "SPV_KHR_8bit_storage" ], - "version" : "1.5" - }, - { - "enumerant" : "DenormPreserve", - "value" : 4464, - "extensions" : [ "SPV_KHR_float_controls" ], - "version" : "1.4" - }, - { - "enumerant" : "DenormFlushToZero", - "value" : 4465, - "extensions" : [ "SPV_KHR_float_controls" ], - "version" : "1.4" - }, - { - "enumerant" : "SignedZeroInfNanPreserve", - "value" : 4466, - "extensions" : [ "SPV_KHR_float_controls" ], - "version" : "1.4" - }, - { - "enumerant" : "RoundingModeRTE", - "value" : 4467, - "extensions" : [ "SPV_KHR_float_controls" ], - "version" : "1.4" - }, - { - "enumerant" : "RoundingModeRTZ", - "value" : 4468, - "extensions" : [ "SPV_KHR_float_controls" ], - "version" : "1.4" - }, - { - "enumerant" : "RayQueryProvisionalKHR", - "value" : 4471, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "enumerant" : "RayQueryKHR", - "value" : 4472, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_KHR_ray_query" ], - "version" : "None" - }, - { - "enumerant" : "RayTraversalPrimitiveCullingKHR", - "value" : 4478, - "capabilities" : [ "RayQueryKHR","RayTracingKHR" ], - "extensions" : [ "SPV_KHR_ray_query","SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "RayTracingKHR", - "value" : 4479, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "Float16ImageAMD", - "value" : 5008, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_AMD_gpu_shader_half_float_fetch" ], - "version" : "None" - }, - { - "enumerant" : "ImageGatherBiasLodAMD", - "value" : 5009, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_AMD_texture_gather_bias_lod" ], - "version" : "None" - }, - { - "enumerant" : "FragmentMaskAMD", - "value" : 5010, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_AMD_shader_fragment_mask" ], - "version" : "None" - }, - { - "enumerant" : "StencilExportEXT", - "value" : 5013, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_EXT_shader_stencil_export" ], - "version" : "None" - }, - { - "enumerant" : "ImageReadWriteLodAMD", - "value" : 5015, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_AMD_shader_image_load_store_lod" ], - "version" : "None" - }, - { - "enumerant" : "Int64ImageEXT", - "value" : 5016, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_EXT_shader_image_int64" ], - "version" : "None" - }, - { - "enumerant" : "ShaderClockKHR", - "value" : 5055, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_KHR_shader_clock" ], - "version" : "None" - }, - { - "enumerant" : "SampleMaskOverrideCoverageNV", - "value" : 5249, - "capabilities" : [ "SampleRateShading" ], - "extensions" : [ "SPV_NV_sample_mask_override_coverage" ], - "version" : "None" - }, - { - "enumerant" : "GeometryShaderPassthroughNV", - "value" : 5251, - "capabilities" : [ "Geometry" ], - "extensions" : [ "SPV_NV_geometry_shader_passthrough" ], - "version" : "None" - }, - { - "enumerant" : "ShaderViewportIndexLayerEXT", - "value" : 5254, - "capabilities" : [ "MultiViewport" ], - "extensions" : [ "SPV_EXT_shader_viewport_index_layer" ], - "version" : "None" - }, - { - "enumerant" : "ShaderViewportIndexLayerNV", - "value" : 5254, - "capabilities" : [ "MultiViewport" ], - "extensions" : [ "SPV_NV_viewport_array2" ], - "version" : "None" - }, - { - "enumerant" : "ShaderViewportMaskNV", - "value" : 5255, - "capabilities" : [ "ShaderViewportIndexLayerNV" ], - "extensions" : [ "SPV_NV_viewport_array2" ], - "version" : "None" - }, - { - "enumerant" : "ShaderStereoViewNV", - "value" : 5259, - "capabilities" : [ "ShaderViewportMaskNV" ], - "extensions" : [ "SPV_NV_stereo_view_rendering" ], - "version" : "None" - }, - { - "enumerant" : "PerViewAttributesNV", - "value" : 5260, - "capabilities" : [ "MultiView" ], - "extensions" : [ "SPV_NVX_multiview_per_view_attributes" ], - "version" : "None" - }, - { - "enumerant" : "FragmentFullyCoveredEXT", - "value" : 5265, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_EXT_fragment_fully_covered" ], - "version" : "None" - }, - { - "enumerant" : "MeshShadingNV", - "value" : 5266, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_NV_mesh_shader" ], - "version" : "None" - }, - { - "enumerant" : "ImageFootprintNV", - "value" : 5282, - "extensions" : [ "SPV_NV_shader_image_footprint" ], - "version" : "None" - }, - { - "enumerant" : "FragmentBarycentricNV", - "value" : 5284, - "extensions" : [ "SPV_NV_fragment_shader_barycentric" ], - "version" : "None" - }, - { - "enumerant" : "ComputeDerivativeGroupQuadsNV", - "value" : 5288, - "extensions" : [ "SPV_NV_compute_shader_derivatives" ], - "version" : "None" - }, - { - "enumerant" : "FragmentDensityEXT", - "value" : 5291, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_EXT_fragment_invocation_density", "SPV_NV_shading_rate" ], - "version" : "None" - }, - { - "enumerant" : "ShadingRateNV", - "value" : 5291, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_NV_shading_rate", "SPV_EXT_fragment_invocation_density" ], - "version" : "None" - }, - { - "enumerant" : "GroupNonUniformPartitionedNV", - "value" : 5297, - "extensions" : [ "SPV_NV_shader_subgroup_partitioned" ], - "version" : "None" - }, - { - "enumerant" : "ShaderNonUniform", - "value" : 5301, - "capabilities" : [ "Shader" ], - "version" : "1.5" - }, - { - "enumerant" : "ShaderNonUniformEXT", - "value" : 5301, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_EXT_descriptor_indexing" ], - "version" : "1.5" - }, - { - "enumerant" : "RuntimeDescriptorArray", - "value" : 5302, - "capabilities" : [ "Shader" ], - "version" : "1.5" - }, - { - "enumerant" : "RuntimeDescriptorArrayEXT", - "value" : 5302, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_EXT_descriptor_indexing" ], - "version" : "1.5" - }, - { - "enumerant" : "InputAttachmentArrayDynamicIndexing", - "value" : 5303, - "capabilities" : [ "InputAttachment" ], - "version" : "1.5" - }, - { - "enumerant" : "InputAttachmentArrayDynamicIndexingEXT", - "value" : 5303, - "capabilities" : [ "InputAttachment" ], - "extensions" : [ "SPV_EXT_descriptor_indexing" ], - "version" : "1.5" - }, - { - "enumerant" : "UniformTexelBufferArrayDynamicIndexing", - "value" : 5304, - "capabilities" : [ "SampledBuffer" ], - "version" : "1.5" - }, - { - "enumerant" : "UniformTexelBufferArrayDynamicIndexingEXT", - "value" : 5304, - "capabilities" : [ "SampledBuffer" ], - "extensions" : [ "SPV_EXT_descriptor_indexing" ], - "version" : "1.5" - }, - { - "enumerant" : "StorageTexelBufferArrayDynamicIndexing", - "value" : 5305, - "capabilities" : [ "ImageBuffer" ], - "version" : "1.5" - }, - { - "enumerant" : "StorageTexelBufferArrayDynamicIndexingEXT", - "value" : 5305, - "capabilities" : [ "ImageBuffer" ], - "extensions" : [ "SPV_EXT_descriptor_indexing" ], - "version" : "1.5" - }, - { - "enumerant" : "UniformBufferArrayNonUniformIndexing", - "value" : 5306, - "capabilities" : [ "ShaderNonUniform" ], - "version" : "1.5" - }, - { - "enumerant" : "UniformBufferArrayNonUniformIndexingEXT", - "value" : 5306, - "capabilities" : [ "ShaderNonUniform" ], - "extensions" : [ "SPV_EXT_descriptor_indexing" ], - "version" : "1.5" - }, - { - "enumerant" : "SampledImageArrayNonUniformIndexing", - "value" : 5307, - "capabilities" : [ "ShaderNonUniform" ], - "version" : "1.5" - }, - { - "enumerant" : "SampledImageArrayNonUniformIndexingEXT", - "value" : 5307, - "capabilities" : [ "ShaderNonUniform" ], - "extensions" : [ "SPV_EXT_descriptor_indexing" ], - "version" : "1.5" - }, - { - "enumerant" : "StorageBufferArrayNonUniformIndexing", - "value" : 5308, - "capabilities" : [ "ShaderNonUniform" ], - "version" : "1.5" - }, - { - "enumerant" : "StorageBufferArrayNonUniformIndexingEXT", - "value" : 5308, - "capabilities" : [ "ShaderNonUniform" ], - "extensions" : [ "SPV_EXT_descriptor_indexing" ], - "version" : "1.5" - }, - { - "enumerant" : "StorageImageArrayNonUniformIndexing", - "value" : 5309, - "capabilities" : [ "ShaderNonUniform" ], - "version" : "1.5" - }, - { - "enumerant" : "StorageImageArrayNonUniformIndexingEXT", - "value" : 5309, - "capabilities" : [ "ShaderNonUniform" ], - "extensions" : [ "SPV_EXT_descriptor_indexing" ], - "version" : "1.5" - }, - { - "enumerant" : "InputAttachmentArrayNonUniformIndexing", - "value" : 5310, - "capabilities" : [ "InputAttachment", "ShaderNonUniform" ], - "version" : "1.5" - }, - { - "enumerant" : "InputAttachmentArrayNonUniformIndexingEXT", - "value" : 5310, - "capabilities" : [ "InputAttachment", "ShaderNonUniform" ], - "extensions" : [ "SPV_EXT_descriptor_indexing" ], - "version" : "1.5" - }, - { - "enumerant" : "UniformTexelBufferArrayNonUniformIndexing", - "value" : 5311, - "capabilities" : [ "SampledBuffer", "ShaderNonUniform" ], - "version" : "1.5" - }, - { - "enumerant" : "UniformTexelBufferArrayNonUniformIndexingEXT", - "value" : 5311, - "capabilities" : [ "SampledBuffer", "ShaderNonUniform" ], - "extensions" : [ "SPV_EXT_descriptor_indexing" ], - "version" : "1.5" - }, - { - "enumerant" : "StorageTexelBufferArrayNonUniformIndexing", - "value" : 5312, - "capabilities" : [ "ImageBuffer", "ShaderNonUniform" ], - "version" : "1.5" - }, - { - "enumerant" : "StorageTexelBufferArrayNonUniformIndexingEXT", - "value" : 5312, - "capabilities" : [ "ImageBuffer", "ShaderNonUniform" ], - "extensions" : [ "SPV_EXT_descriptor_indexing" ], - "version" : "1.5" - }, - { - "enumerant" : "RayTracingNV", - "value" : 5340, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_NV_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "RayTracingMotionBlurNV", - "value" : 5341, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_NV_ray_tracing_motion_blur" ], - "version" : "None" - }, - { - "enumerant" : "VulkanMemoryModel", - "value" : 5345, - "version" : "1.5" - }, - { - "enumerant" : "VulkanMemoryModelKHR", - "value" : 5345, - "extensions" : [ "SPV_KHR_vulkan_memory_model" ], - "version" : "1.5" - }, - { - "enumerant" : "VulkanMemoryModelDeviceScope", - "value" : 5346, - "version" : "1.5" - }, - { - "enumerant" : "VulkanMemoryModelDeviceScopeKHR", - "value" : 5346, - "extensions" : [ "SPV_KHR_vulkan_memory_model" ], - "version" : "1.5" - }, - { - "enumerant" : "PhysicalStorageBufferAddresses", - "value" : 5347, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_EXT_physical_storage_buffer", "SPV_KHR_physical_storage_buffer" ], - "version" : "1.5" - }, - { - "enumerant" : "PhysicalStorageBufferAddressesEXT", - "value" : 5347, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_EXT_physical_storage_buffer" ], - "version" : "1.5" - }, - { - "enumerant" : "ComputeDerivativeGroupLinearNV", - "value" : 5350, - "extensions" : [ "SPV_NV_compute_shader_derivatives" ], - "version" : "None" - }, - { - "enumerant" : "RayTracingProvisionalKHR", - "value" : 5353, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_KHR_ray_tracing" ], - "version" : "None" - }, - { - "enumerant" : "CooperativeMatrixNV", - "value" : 5357, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_NV_cooperative_matrix" ], - "version" : "None" - }, - { - "enumerant" : "FragmentShaderSampleInterlockEXT", - "value" : 5363, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_EXT_fragment_shader_interlock" ], - "version" : "None" - }, - { - "enumerant" : "FragmentShaderShadingRateInterlockEXT", - "value" : 5372, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_EXT_fragment_shader_interlock" ], - "version" : "None" - }, - { - "enumerant" : "ShaderSMBuiltinsNV", - "value" : 5373, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_NV_shader_sm_builtins" ], - "version" : "None" - }, - { - "enumerant" : "FragmentShaderPixelInterlockEXT", - "value" : 5378, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_EXT_fragment_shader_interlock" ], - "version" : "None" - }, - { - "enumerant" : "DemoteToHelperInvocationEXT", - "value" : 5379, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_EXT_demote_to_helper_invocation" ], - "version" : "None" - }, - { - "enumerant" : "SubgroupShuffleINTEL", - "value" : 5568, - "extensions" : [ "SPV_INTEL_subgroups" ], - "version" : "None" - }, - { - "enumerant" : "SubgroupBufferBlockIOINTEL", - "value" : 5569, - "extensions" : [ "SPV_INTEL_subgroups" ], - "version" : "None" - }, - { - "enumerant" : "SubgroupImageBlockIOINTEL", - "value" : 5570, - "extensions" : [ "SPV_INTEL_subgroups" ], - "version" : "None" - }, - { - "enumerant" : "SubgroupImageMediaBlockIOINTEL", - "value" : 5579, - "extensions" : [ "SPV_INTEL_media_block_io" ], - "version" : "None" - }, - { - "enumerant" : "RoundToInfinityINTEL", - "value" : 5582, - "extensions" : [ "SPV_INTEL_float_controls2" ], - "version" : "None" - }, - { - "enumerant" : "FloatingPointModeINTEL", - "value" : 5583, - "extensions" : [ "SPV_INTEL_float_controls2" ], - "version" : "None" - }, - { - "enumerant" : "IntegerFunctions2INTEL", - "value" : 5584, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_INTEL_shader_integer_functions2" ], - "version" : "None" - }, - { - "enumerant" : "FunctionPointersINTEL", - "value" : 5603, - "extensions" : [ "SPV_INTEL_function_pointers" ], - "version" : "None" - }, - { - "enumerant" : "IndirectReferencesINTEL", - "value" : 5604, - "extensions" : [ "SPV_INTEL_function_pointers" ], - "version" : "None" - }, - { - "enumerant" : "AsmINTEL", - "value" : 5606, - "extensions" : [ "SPV_INTEL_inline_assembly" ], - "version" : "None" - }, - { - "enumerant" : "AtomicFloat32MinMaxEXT", - "value" : 5612, - "extensions" : [ "SPV_EXT_shader_atomic_float_min_max" ], - "version" : "None" - }, - { - "enumerant" : "AtomicFloat64MinMaxEXT", - "value" : 5613, - "extensions" : [ "SPV_EXT_shader_atomic_float_min_max" ], - "version" : "None" - }, - { - "enumerant" : "AtomicFloat16MinMaxEXT", - "value" : 5616, - "extensions" : [ "SPV_EXT_shader_atomic_float_min_max" ], - "version" : "None" - }, - { - "enumerant" : "VectorComputeINTEL", - "value" : 5617, - "capabilities" : [ "VectorAnyINTEL" ], - "extensions" : [ "SPV_INTEL_vector_compute" ], - "version" : "None" - }, - { - "enumerant" : "VectorAnyINTEL", - "value" : 5619, - "extensions" : [ "SPV_INTEL_vector_compute" ], - "version" : "None" - }, - { - "enumerant" : "ExpectAssumeKHR", - "value" : 5629, - "extensions" : [ "SPV_KHR_expect_assume" ], - "version" : "None" - }, - { - "enumerant" : "SubgroupAvcMotionEstimationINTEL", - "value" : 5696, - "extensions" : [ "SPV_INTEL_device_side_avc_motion_estimation" ], - "version" : "None" - }, - { - "enumerant" : "SubgroupAvcMotionEstimationIntraINTEL", - "value" : 5697, - "extensions" : [ "SPV_INTEL_device_side_avc_motion_estimation" ], - "version" : "None" - }, - { - "enumerant" : "SubgroupAvcMotionEstimationChromaINTEL", - "value" : 5698, - "extensions" : [ "SPV_INTEL_device_side_avc_motion_estimation" ], - "version" : "None" - }, - { - "enumerant" : "VariableLengthArrayINTEL", - "value" : 5817, - "extensions" : [ "SPV_INTEL_variable_length_array" ], - "version" : "None" - }, - { - "enumerant" : "FunctionFloatControlINTEL", - "value" : 5821, - "extensions" : [ "SPV_INTEL_float_controls2" ], - "version" : "None" - }, - { - "enumerant" : "FPGAMemoryAttributesINTEL", - "value" : 5824, - "extensions" : [ "SPV_INTEL_fpga_memory_attributes" ], - "version" : "None" - }, - { - "enumerant" : "FPFastMathModeINTEL", - "value" : 5837, - "capabilities" : [ "Kernel" ], - "extensions" : [ "SPV_INTEL_fp_fast_math_mode" ], - "version" : "None" - }, - { - "enumerant" : "ArbitraryPrecisionIntegersINTEL", - "value" : 5844, - "extensions" : [ "SPV_INTEL_arbitrary_precision_integers" ], - "version" : "None" - }, - { - "enumerant" : "ArbitraryPrecisionFloatingPointINTEL", - "value" : 5845, - "extensions" : [ "SPV_INTEL_arbitrary_precision_floating_point" ], - "version" : "None" - }, - { - "enumerant" : "UnstructuredLoopControlsINTEL", - "value" : 5886, - "extensions" : [ "SPV_INTEL_unstructured_loop_controls" ], - "version" : "None" - }, - { - "enumerant" : "FPGALoopControlsINTEL", - "value" : 5888, - "extensions" : [ "SPV_INTEL_fpga_loop_controls" ], - "version" : "None" - }, - { - "enumerant" : "KernelAttributesINTEL", - "value" : 5892, - "extensions" : [ "SPV_INTEL_kernel_attributes" ], - "version" : "None" - }, - { - "enumerant" : "FPGAKernelAttributesINTEL", - "value" : 5897, - "extensions" : [ "SPV_INTEL_kernel_attributes" ], - "version" : "None" - }, - { - "enumerant" : "FPGAMemoryAccessesINTEL", - "value" : 5898, - "extensions" : [ "SPV_INTEL_fpga_memory_accesses" ], - "version" : "None" - }, - { - "enumerant" : "FPGAClusterAttributesINTEL", - "value" : 5904, - "extensions" : [ "SPV_INTEL_fpga_cluster_attributes" ], - "version" : "None" - }, - { - "enumerant" : "LoopFuseINTEL", - "value" : 5906, - "extensions" : [ "SPV_INTEL_loop_fuse" ], - "version" : "None" - }, - { - "enumerant" : "FPGABufferLocationINTEL", - "value" : 5920, - "extensions" : [ "SPV_INTEL_fpga_buffer_location" ], - "version" : "None" - }, - { - "enumerant" : "ArbitraryPrecisionFixedPointINTEL", - "value" : 5922, - "extensions" : [ "SPV_INTEL_arbitrary_precision_fixed_point" ], - "version" : "None" - }, - { - "enumerant" : "USMStorageClassesINTEL", - "value" : 5935, - "extensions" : [ "SPV_INTEL_usm_storage_classes" ], - "version" : "None" - }, - { - "enumerant" : "IOPipesINTEL", - "value" : 5943, - "extensions" : [ "SPV_INTEL_io_pipes" ], - "version" : "None" - }, - { - "enumerant" : "BlockingPipesINTEL", - "value" : 5945, - "extensions" : [ "SPV_INTEL_blocking_pipes" ], - "version" : "None" - }, - { - "enumerant" : "FPGARegINTEL", - "value" : 5948, - "extensions" : [ "SPV_INTEL_fpga_reg" ], - "version" : "None" - }, - { - "enumerant" : "DotProductInputAllKHR", - "value" : 6016, - "extensions" : [ "SPV_KHR_integer_dot_product" ], - "version" : "None" - }, - { - "enumerant" : "DotProductInput4x8BitKHR", - "value" : 6017, - "capabilities" : [ "Int8" ], - "extensions" : [ "SPV_KHR_integer_dot_product" ], - "version" : "None" - }, - { - "enumerant" : "DotProductInput4x8BitPackedKHR", - "value" : 6018, - "extensions" : [ "SPV_KHR_integer_dot_product" ], - "version" : "None" - }, - { - "enumerant" : "DotProductKHR", - "value" : 6019, - "extensions" : [ "SPV_KHR_integer_dot_product" ], - "version" : "None" - }, - { - "enumerant" : "BitInstructions", - "value" : 6025, - "extensions" : [ "SPV_KHR_bit_instructions" ], - "version" : "None" - }, - { - "enumerant" : "AtomicFloat32AddEXT", - "value" : 6033, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_EXT_shader_atomic_float_add" ], - "version" : "None" - }, - { - "enumerant" : "AtomicFloat64AddEXT", - "value" : 6034, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_EXT_shader_atomic_float_add" ], - "version" : "None" - }, - { - "enumerant" : "LongConstantCompositeINTEL", - "value" : 6089, - "extensions" : [ "SPV_INTEL_long_constant_composite" ], - "version" : "None" - }, - { - "enumerant" : "OptNoneINTEL", - "value" : 6094, - "extensions" : [ "SPV_INTEL_optnone" ], - "version" : "None" - }, - { - "enumerant" : "AtomicFloat16AddEXT", - "value" : 6095, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_EXT_shader_atomic_float16_add" ], - "version" : "None" - }, - { - "enumerant" : "DebugInfoModuleINTEL", - "value" : 6114, - "extensions" : [ "SPV_INTEL_debug_module" ], - "version" : "None" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "RayQueryIntersection", - "enumerants" : [ - { - "enumerant" : "RayQueryCandidateIntersectionKHR", - "value" : 0, - "capabilities" : [ "RayQueryKHR" ], - "version" : "None" - }, - { - "enumerant" : "RayQueryCommittedIntersectionKHR", - "value" : 1, - "capabilities" : [ "RayQueryKHR" ], - "version" : "None" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "RayQueryCommittedIntersectionType", - "enumerants" : [ - { - "enumerant" : "RayQueryCommittedIntersectionNoneKHR", - "value" : 0, - "capabilities" : [ "RayQueryKHR" ], - "version" : "None" - }, - { - "enumerant" : "RayQueryCommittedIntersectionTriangleKHR", - "value" : 1, - "capabilities" : [ "RayQueryKHR" ], - "version" : "None" - }, - { - "enumerant" : "RayQueryCommittedIntersectionGeneratedKHR", - "value" : 2, - "capabilities" : [ "RayQueryKHR" ], - "version" : "None" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "RayQueryCandidateIntersectionType", - "enumerants" : [ - { - "enumerant" : "RayQueryCandidateIntersectionTriangleKHR", - "value" : 0, - "capabilities" : [ "RayQueryKHR" ], - "version" : "None" - }, - { - "enumerant" : "RayQueryCandidateIntersectionAABBKHR", - "value" : 1, - "capabilities" : [ "RayQueryKHR" ], - "version" : "None" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "PackedVectorFormat", - "enumerants" : [ - { - "enumerant" : "PackedVectorFormat4x8BitKHR", - "value" : 0, - "extensions" : [ "SPV_KHR_integer_dot_product" ], - "version" : "None" - } - ] - }, - { - "category" : "Id", - "kind" : "IdResultType", - "doc" : "Reference to an representing the result's type of the enclosing instruction" - }, - { - "category" : "Id", - "kind" : "IdResult", - "doc" : "Definition of an representing the result of the enclosing instruction" - }, - { - "category" : "Id", - "kind" : "IdMemorySemantics", - "doc" : "Reference to an representing a 32-bit integer that is a mask from the MemorySemantics operand kind" - }, - { - "category" : "Id", - "kind" : "IdScope", - "doc" : "Reference to an representing a 32-bit integer that is a mask from the Scope operand kind" - }, - { - "category" : "Id", - "kind" : "IdRef", - "doc" : "Reference to an " - }, - { - "category" : "Literal", - "kind" : "LiteralInteger", - "doc" : "An integer consuming one or more words" - }, - { - "category" : "Literal", - "kind" : "LiteralString", - "doc" : "A null-terminated stream of characters consuming an integral number of words" - }, - { - "category" : "Literal", - "kind" : "LiteralContextDependentNumber", - "doc" : "A literal number whose size and format are determined by a previous operand in the enclosing instruction" - }, - { - "category" : "Literal", - "kind" : "LiteralExtInstInteger", - "doc" : "A 32-bit unsigned integer indicating which instruction to use and determining the layout of following operands (for OpExtInst)" - }, - { - "category" : "Literal", - "kind" : "LiteralSpecConstantOpInteger", - "doc" : "An opcode indicating the operation to be performed and determining the layout of following operands (for OpSpecConstantOp)" - }, - { - "category" : "Composite", - "kind" : "PairLiteralIntegerIdRef", - "bases" : [ "LiteralInteger", "IdRef" ] - }, - { - "category" : "Composite", - "kind" : "PairIdRefLiteralInteger", - "bases" : [ "IdRef", "LiteralInteger" ] - }, - { - "category" : "Composite", - "kind" : "PairIdRefIdRef", - "bases" : [ "IdRef", "IdRef" ] - } - ] -} diff --git a/include/spirv/unified1/spirv.cs b/include/spirv/unified1/spirv.cs deleted file mode 100644 index b2ca3f0d..00000000 --- a/include/spirv/unified1/spirv.cs +++ /dev/null @@ -1,1812 +0,0 @@ -// Copyright (c) 2014-2020 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -// This header is automatically generated by the same tool that creates -// the Binary Section of the SPIR-V specification. - -// Enumeration tokens for SPIR-V, in various styles: -// C, C++, C++11, JSON, Lua, Python, C#, D -// -// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -// - C# will use enum classes in the Specification class located in the "Spv" namespace, -// e.g.: Spv.Specification.SourceLanguage.GLSL -// - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL -// -// Some tokens act like mask values, which can be OR'd together, -// while others are mutually exclusive. The mask-like ones have -// "Mask" in their name, and a parallel enum that has the shift -// amount (1 << x) for each corresponding enumerant. - -namespace Spv -{ - - public static class Specification - { - public const uint MagicNumber = 0x07230203; - public const uint Version = 0x00010500; - public const uint Revision = 4; - public const uint OpCodeMask = 0xffff; - public const uint WordCountShift = 16; - - public enum SourceLanguage - { - Unknown = 0, - ESSL = 1, - GLSL = 2, - OpenCL_C = 3, - OpenCL_CPP = 4, - HLSL = 5, - CPP_for_OpenCL = 6, - } - - public enum ExecutionModel - { - Vertex = 0, - TessellationControl = 1, - TessellationEvaluation = 2, - Geometry = 3, - Fragment = 4, - GLCompute = 5, - Kernel = 6, - TaskNV = 5267, - MeshNV = 5268, - RayGenerationKHR = 5313, - RayGenerationNV = 5313, - IntersectionKHR = 5314, - IntersectionNV = 5314, - AnyHitKHR = 5315, - AnyHitNV = 5315, - ClosestHitKHR = 5316, - ClosestHitNV = 5316, - MissKHR = 5317, - MissNV = 5317, - CallableKHR = 5318, - CallableNV = 5318, - } - - public enum AddressingModel - { - Logical = 0, - Physical32 = 1, - Physical64 = 2, - PhysicalStorageBuffer64 = 5348, - PhysicalStorageBuffer64EXT = 5348, - } - - public enum MemoryModel - { - Simple = 0, - GLSL450 = 1, - OpenCL = 2, - Vulkan = 3, - VulkanKHR = 3, - } - - public enum ExecutionMode - { - Invocations = 0, - SpacingEqual = 1, - SpacingFractionalEven = 2, - SpacingFractionalOdd = 3, - VertexOrderCw = 4, - VertexOrderCcw = 5, - PixelCenterInteger = 6, - OriginUpperLeft = 7, - OriginLowerLeft = 8, - EarlyFragmentTests = 9, - PointMode = 10, - Xfb = 11, - DepthReplacing = 12, - DepthGreater = 14, - DepthLess = 15, - DepthUnchanged = 16, - LocalSize = 17, - LocalSizeHint = 18, - InputPoints = 19, - InputLines = 20, - InputLinesAdjacency = 21, - Triangles = 22, - InputTrianglesAdjacency = 23, - Quads = 24, - Isolines = 25, - OutputVertices = 26, - OutputPoints = 27, - OutputLineStrip = 28, - OutputTriangleStrip = 29, - VecTypeHint = 30, - ContractionOff = 31, - Initializer = 33, - Finalizer = 34, - SubgroupSize = 35, - SubgroupsPerWorkgroup = 36, - SubgroupsPerWorkgroupId = 37, - LocalSizeId = 38, - LocalSizeHintId = 39, - SubgroupUniformControlFlowKHR = 4421, - PostDepthCoverage = 4446, - DenormPreserve = 4459, - DenormFlushToZero = 4460, - SignedZeroInfNanPreserve = 4461, - RoundingModeRTE = 4462, - RoundingModeRTZ = 4463, - StencilRefReplacingEXT = 5027, - OutputLinesNV = 5269, - OutputPrimitivesNV = 5270, - DerivativeGroupQuadsNV = 5289, - DerivativeGroupLinearNV = 5290, - OutputTrianglesNV = 5298, - PixelInterlockOrderedEXT = 5366, - PixelInterlockUnorderedEXT = 5367, - SampleInterlockOrderedEXT = 5368, - SampleInterlockUnorderedEXT = 5369, - ShadingRateInterlockOrderedEXT = 5370, - ShadingRateInterlockUnorderedEXT = 5371, - SharedLocalMemorySizeINTEL = 5618, - RoundingModeRTPINTEL = 5620, - RoundingModeRTNINTEL = 5621, - FloatingPointModeALTINTEL = 5622, - FloatingPointModeIEEEINTEL = 5623, - MaxWorkgroupSizeINTEL = 5893, - MaxWorkDimINTEL = 5894, - NoGlobalOffsetINTEL = 5895, - NumSIMDWorkitemsINTEL = 5896, - SchedulerTargetFmaxMhzINTEL = 5903, - } - - public enum StorageClass - { - UniformConstant = 0, - Input = 1, - Uniform = 2, - Output = 3, - Workgroup = 4, - CrossWorkgroup = 5, - Private = 6, - Function = 7, - Generic = 8, - PushConstant = 9, - AtomicCounter = 10, - Image = 11, - StorageBuffer = 12, - CallableDataKHR = 5328, - CallableDataNV = 5328, - IncomingCallableDataKHR = 5329, - IncomingCallableDataNV = 5329, - RayPayloadKHR = 5338, - RayPayloadNV = 5338, - HitAttributeKHR = 5339, - HitAttributeNV = 5339, - IncomingRayPayloadKHR = 5342, - IncomingRayPayloadNV = 5342, - ShaderRecordBufferKHR = 5343, - ShaderRecordBufferNV = 5343, - PhysicalStorageBuffer = 5349, - PhysicalStorageBufferEXT = 5349, - CodeSectionINTEL = 5605, - DeviceOnlyINTEL = 5936, - HostOnlyINTEL = 5937, - } - - public enum Dim - { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - Cube = 3, - Rect = 4, - Buffer = 5, - SubpassData = 6, - } - - public enum SamplerAddressingMode - { - None = 0, - ClampToEdge = 1, - Clamp = 2, - Repeat = 3, - RepeatMirrored = 4, - } - - public enum SamplerFilterMode - { - Nearest = 0, - Linear = 1, - } - - public enum ImageFormat - { - Unknown = 0, - Rgba32f = 1, - Rgba16f = 2, - R32f = 3, - Rgba8 = 4, - Rgba8Snorm = 5, - Rg32f = 6, - Rg16f = 7, - R11fG11fB10f = 8, - R16f = 9, - Rgba16 = 10, - Rgb10A2 = 11, - Rg16 = 12, - Rg8 = 13, - R16 = 14, - R8 = 15, - Rgba16Snorm = 16, - Rg16Snorm = 17, - Rg8Snorm = 18, - R16Snorm = 19, - R8Snorm = 20, - Rgba32i = 21, - Rgba16i = 22, - Rgba8i = 23, - R32i = 24, - Rg32i = 25, - Rg16i = 26, - Rg8i = 27, - R16i = 28, - R8i = 29, - Rgba32ui = 30, - Rgba16ui = 31, - Rgba8ui = 32, - R32ui = 33, - Rgb10a2ui = 34, - Rg32ui = 35, - Rg16ui = 36, - Rg8ui = 37, - R16ui = 38, - R8ui = 39, - R64ui = 40, - R64i = 41, - } - - public enum ImageChannelOrder - { - R = 0, - A = 1, - RG = 2, - RA = 3, - RGB = 4, - RGBA = 5, - BGRA = 6, - ARGB = 7, - Intensity = 8, - Luminance = 9, - Rx = 10, - RGx = 11, - RGBx = 12, - Depth = 13, - DepthStencil = 14, - sRGB = 15, - sRGBx = 16, - sRGBA = 17, - sBGRA = 18, - ABGR = 19, - } - - public enum ImageChannelDataType - { - SnormInt8 = 0, - SnormInt16 = 1, - UnormInt8 = 2, - UnormInt16 = 3, - UnormShort565 = 4, - UnormShort555 = 5, - UnormInt101010 = 6, - SignedInt8 = 7, - SignedInt16 = 8, - SignedInt32 = 9, - UnsignedInt8 = 10, - UnsignedInt16 = 11, - UnsignedInt32 = 12, - HalfFloat = 13, - Float = 14, - UnormInt24 = 15, - UnormInt101010_2 = 16, - } - - public enum ImageOperandsShift - { - Bias = 0, - Lod = 1, - Grad = 2, - ConstOffset = 3, - Offset = 4, - ConstOffsets = 5, - Sample = 6, - MinLod = 7, - MakeTexelAvailable = 8, - MakeTexelAvailableKHR = 8, - MakeTexelVisible = 9, - MakeTexelVisibleKHR = 9, - NonPrivateTexel = 10, - NonPrivateTexelKHR = 10, - VolatileTexel = 11, - VolatileTexelKHR = 11, - SignExtend = 12, - ZeroExtend = 13, - } - - public enum ImageOperandsMask - { - MaskNone = 0, - Bias = 0x00000001, - Lod = 0x00000002, - Grad = 0x00000004, - ConstOffset = 0x00000008, - Offset = 0x00000010, - ConstOffsets = 0x00000020, - Sample = 0x00000040, - MinLod = 0x00000080, - MakeTexelAvailable = 0x00000100, - MakeTexelAvailableKHR = 0x00000100, - MakeTexelVisible = 0x00000200, - MakeTexelVisibleKHR = 0x00000200, - NonPrivateTexel = 0x00000400, - NonPrivateTexelKHR = 0x00000400, - VolatileTexel = 0x00000800, - VolatileTexelKHR = 0x00000800, - SignExtend = 0x00001000, - ZeroExtend = 0x00002000, - } - - public enum FPFastMathModeShift - { - NotNaN = 0, - NotInf = 1, - NSZ = 2, - AllowRecip = 3, - Fast = 4, - AllowContractFastINTEL = 16, - AllowReassocINTEL = 17, - } - - public enum FPFastMathModeMask - { - MaskNone = 0, - NotNaN = 0x00000001, - NotInf = 0x00000002, - NSZ = 0x00000004, - AllowRecip = 0x00000008, - Fast = 0x00000010, - AllowContractFastINTEL = 0x00010000, - AllowReassocINTEL = 0x00020000, - } - - public enum FPRoundingMode - { - RTE = 0, - RTZ = 1, - RTP = 2, - RTN = 3, - } - - public enum LinkageType - { - Export = 0, - Import = 1, - LinkOnceODR = 2, - } - - public enum AccessQualifier - { - ReadOnly = 0, - WriteOnly = 1, - ReadWrite = 2, - } - - public enum FunctionParameterAttribute - { - Zext = 0, - Sext = 1, - ByVal = 2, - Sret = 3, - NoAlias = 4, - NoCapture = 5, - NoWrite = 6, - NoReadWrite = 7, - } - - public enum Decoration - { - RelaxedPrecision = 0, - SpecId = 1, - Block = 2, - BufferBlock = 3, - RowMajor = 4, - ColMajor = 5, - ArrayStride = 6, - MatrixStride = 7, - GLSLShared = 8, - GLSLPacked = 9, - CPacked = 10, - BuiltIn = 11, - NoPerspective = 13, - Flat = 14, - Patch = 15, - Centroid = 16, - Sample = 17, - Invariant = 18, - Restrict = 19, - Aliased = 20, - Volatile = 21, - Constant = 22, - Coherent = 23, - NonWritable = 24, - NonReadable = 25, - Uniform = 26, - UniformId = 27, - SaturatedConversion = 28, - Stream = 29, - Location = 30, - Component = 31, - Index = 32, - Binding = 33, - DescriptorSet = 34, - Offset = 35, - XfbBuffer = 36, - XfbStride = 37, - FuncParamAttr = 38, - FPRoundingMode = 39, - FPFastMathMode = 40, - LinkageAttributes = 41, - NoContraction = 42, - InputAttachmentIndex = 43, - Alignment = 44, - MaxByteOffset = 45, - AlignmentId = 46, - MaxByteOffsetId = 47, - NoSignedWrap = 4469, - NoUnsignedWrap = 4470, - ExplicitInterpAMD = 4999, - OverrideCoverageNV = 5248, - PassthroughNV = 5250, - ViewportRelativeNV = 5252, - SecondaryViewportRelativeNV = 5256, - PerPrimitiveNV = 5271, - PerViewNV = 5272, - PerTaskNV = 5273, - PerVertexNV = 5285, - NonUniform = 5300, - NonUniformEXT = 5300, - RestrictPointer = 5355, - RestrictPointerEXT = 5355, - AliasedPointer = 5356, - AliasedPointerEXT = 5356, - SIMTCallINTEL = 5599, - ReferencedIndirectlyINTEL = 5602, - ClobberINTEL = 5607, - SideEffectsINTEL = 5608, - VectorComputeVariableINTEL = 5624, - FuncParamIOKindINTEL = 5625, - VectorComputeFunctionINTEL = 5626, - StackCallINTEL = 5627, - GlobalVariableOffsetINTEL = 5628, - CounterBuffer = 5634, - HlslCounterBufferGOOGLE = 5634, - HlslSemanticGOOGLE = 5635, - UserSemantic = 5635, - UserTypeGOOGLE = 5636, - FunctionRoundingModeINTEL = 5822, - FunctionDenormModeINTEL = 5823, - RegisterINTEL = 5825, - MemoryINTEL = 5826, - NumbanksINTEL = 5827, - BankwidthINTEL = 5828, - MaxPrivateCopiesINTEL = 5829, - SinglepumpINTEL = 5830, - DoublepumpINTEL = 5831, - MaxReplicatesINTEL = 5832, - SimpleDualPortINTEL = 5833, - MergeINTEL = 5834, - BankBitsINTEL = 5835, - ForcePow2DepthINTEL = 5836, - BurstCoalesceINTEL = 5899, - CacheSizeINTEL = 5900, - DontStaticallyCoalesceINTEL = 5901, - PrefetchINTEL = 5902, - StallEnableINTEL = 5905, - FuseLoopsInFunctionINTEL = 5907, - BufferLocationINTEL = 5921, - IOPipeStorageINTEL = 5944, - FunctionFloatingPointModeINTEL = 6080, - SingleElementVectorINTEL = 6085, - VectorComputeCallableFunctionINTEL = 6087, - } - - public enum BuiltIn - { - Position = 0, - PointSize = 1, - ClipDistance = 3, - CullDistance = 4, - VertexId = 5, - InstanceId = 6, - PrimitiveId = 7, - InvocationId = 8, - Layer = 9, - ViewportIndex = 10, - TessLevelOuter = 11, - TessLevelInner = 12, - TessCoord = 13, - PatchVertices = 14, - FragCoord = 15, - PointCoord = 16, - FrontFacing = 17, - SampleId = 18, - SamplePosition = 19, - SampleMask = 20, - FragDepth = 22, - HelperInvocation = 23, - NumWorkgroups = 24, - WorkgroupSize = 25, - WorkgroupId = 26, - LocalInvocationId = 27, - GlobalInvocationId = 28, - LocalInvocationIndex = 29, - WorkDim = 30, - GlobalSize = 31, - EnqueuedWorkgroupSize = 32, - GlobalOffset = 33, - GlobalLinearId = 34, - SubgroupSize = 36, - SubgroupMaxSize = 37, - NumSubgroups = 38, - NumEnqueuedSubgroups = 39, - SubgroupId = 40, - SubgroupLocalInvocationId = 41, - VertexIndex = 42, - InstanceIndex = 43, - SubgroupEqMask = 4416, - SubgroupEqMaskKHR = 4416, - SubgroupGeMask = 4417, - SubgroupGeMaskKHR = 4417, - SubgroupGtMask = 4418, - SubgroupGtMaskKHR = 4418, - SubgroupLeMask = 4419, - SubgroupLeMaskKHR = 4419, - SubgroupLtMask = 4420, - SubgroupLtMaskKHR = 4420, - BaseVertex = 4424, - BaseInstance = 4425, - DrawIndex = 4426, - PrimitiveShadingRateKHR = 4432, - DeviceIndex = 4438, - ViewIndex = 4440, - ShadingRateKHR = 4444, - BaryCoordNoPerspAMD = 4992, - BaryCoordNoPerspCentroidAMD = 4993, - BaryCoordNoPerspSampleAMD = 4994, - BaryCoordSmoothAMD = 4995, - BaryCoordSmoothCentroidAMD = 4996, - BaryCoordSmoothSampleAMD = 4997, - BaryCoordPullModelAMD = 4998, - FragStencilRefEXT = 5014, - ViewportMaskNV = 5253, - SecondaryPositionNV = 5257, - SecondaryViewportMaskNV = 5258, - PositionPerViewNV = 5261, - ViewportMaskPerViewNV = 5262, - FullyCoveredEXT = 5264, - TaskCountNV = 5274, - PrimitiveCountNV = 5275, - PrimitiveIndicesNV = 5276, - ClipDistancePerViewNV = 5277, - CullDistancePerViewNV = 5278, - LayerPerViewNV = 5279, - MeshViewCountNV = 5280, - MeshViewIndicesNV = 5281, - BaryCoordNV = 5286, - BaryCoordNoPerspNV = 5287, - FragSizeEXT = 5292, - FragmentSizeNV = 5292, - FragInvocationCountEXT = 5293, - InvocationsPerPixelNV = 5293, - LaunchIdKHR = 5319, - LaunchIdNV = 5319, - LaunchSizeKHR = 5320, - LaunchSizeNV = 5320, - WorldRayOriginKHR = 5321, - WorldRayOriginNV = 5321, - WorldRayDirectionKHR = 5322, - WorldRayDirectionNV = 5322, - ObjectRayOriginKHR = 5323, - ObjectRayOriginNV = 5323, - ObjectRayDirectionKHR = 5324, - ObjectRayDirectionNV = 5324, - RayTminKHR = 5325, - RayTminNV = 5325, - RayTmaxKHR = 5326, - RayTmaxNV = 5326, - InstanceCustomIndexKHR = 5327, - InstanceCustomIndexNV = 5327, - ObjectToWorldKHR = 5330, - ObjectToWorldNV = 5330, - WorldToObjectKHR = 5331, - WorldToObjectNV = 5331, - HitTNV = 5332, - HitKindKHR = 5333, - HitKindNV = 5333, - CurrentRayTimeNV = 5334, - IncomingRayFlagsKHR = 5351, - IncomingRayFlagsNV = 5351, - RayGeometryIndexKHR = 5352, - WarpsPerSMNV = 5374, - SMCountNV = 5375, - WarpIDNV = 5376, - SMIDNV = 5377, - } - - public enum SelectionControlShift - { - Flatten = 0, - DontFlatten = 1, - } - - public enum SelectionControlMask - { - MaskNone = 0, - Flatten = 0x00000001, - DontFlatten = 0x00000002, - } - - public enum LoopControlShift - { - Unroll = 0, - DontUnroll = 1, - DependencyInfinite = 2, - DependencyLength = 3, - MinIterations = 4, - MaxIterations = 5, - IterationMultiple = 6, - PeelCount = 7, - PartialCount = 8, - InitiationIntervalINTEL = 16, - MaxConcurrencyINTEL = 17, - DependencyArrayINTEL = 18, - PipelineEnableINTEL = 19, - LoopCoalesceINTEL = 20, - MaxInterleavingINTEL = 21, - SpeculatedIterationsINTEL = 22, - NoFusionINTEL = 23, - } - - public enum LoopControlMask - { - MaskNone = 0, - Unroll = 0x00000001, - DontUnroll = 0x00000002, - DependencyInfinite = 0x00000004, - DependencyLength = 0x00000008, - MinIterations = 0x00000010, - MaxIterations = 0x00000020, - IterationMultiple = 0x00000040, - PeelCount = 0x00000080, - PartialCount = 0x00000100, - InitiationIntervalINTEL = 0x00010000, - MaxConcurrencyINTEL = 0x00020000, - DependencyArrayINTEL = 0x00040000, - PipelineEnableINTEL = 0x00080000, - LoopCoalesceINTEL = 0x00100000, - MaxInterleavingINTEL = 0x00200000, - SpeculatedIterationsINTEL = 0x00400000, - NoFusionINTEL = 0x00800000, - } - - public enum FunctionControlShift - { - Inline = 0, - DontInline = 1, - Pure = 2, - Const = 3, - OptNoneINTEL = 16, - } - - public enum FunctionControlMask - { - MaskNone = 0, - Inline = 0x00000001, - DontInline = 0x00000002, - Pure = 0x00000004, - Const = 0x00000008, - OptNoneINTEL = 0x00010000, - } - - public enum MemorySemanticsShift - { - Acquire = 1, - Release = 2, - AcquireRelease = 3, - SequentiallyConsistent = 4, - UniformMemory = 6, - SubgroupMemory = 7, - WorkgroupMemory = 8, - CrossWorkgroupMemory = 9, - AtomicCounterMemory = 10, - ImageMemory = 11, - OutputMemory = 12, - OutputMemoryKHR = 12, - MakeAvailable = 13, - MakeAvailableKHR = 13, - MakeVisible = 14, - MakeVisibleKHR = 14, - Volatile = 15, - } - - public enum MemorySemanticsMask - { - MaskNone = 0, - Acquire = 0x00000002, - Release = 0x00000004, - AcquireRelease = 0x00000008, - SequentiallyConsistent = 0x00000010, - UniformMemory = 0x00000040, - SubgroupMemory = 0x00000080, - WorkgroupMemory = 0x00000100, - CrossWorkgroupMemory = 0x00000200, - AtomicCounterMemory = 0x00000400, - ImageMemory = 0x00000800, - OutputMemory = 0x00001000, - OutputMemoryKHR = 0x00001000, - MakeAvailable = 0x00002000, - MakeAvailableKHR = 0x00002000, - MakeVisible = 0x00004000, - MakeVisibleKHR = 0x00004000, - Volatile = 0x00008000, - } - - public enum MemoryAccessShift - { - Volatile = 0, - Aligned = 1, - Nontemporal = 2, - MakePointerAvailable = 3, - MakePointerAvailableKHR = 3, - MakePointerVisible = 4, - MakePointerVisibleKHR = 4, - NonPrivatePointer = 5, - NonPrivatePointerKHR = 5, - } - - public enum MemoryAccessMask - { - MaskNone = 0, - Volatile = 0x00000001, - Aligned = 0x00000002, - Nontemporal = 0x00000004, - MakePointerAvailable = 0x00000008, - MakePointerAvailableKHR = 0x00000008, - MakePointerVisible = 0x00000010, - MakePointerVisibleKHR = 0x00000010, - NonPrivatePointer = 0x00000020, - NonPrivatePointerKHR = 0x00000020, - } - - public enum Scope - { - CrossDevice = 0, - Device = 1, - Workgroup = 2, - Subgroup = 3, - Invocation = 4, - QueueFamily = 5, - QueueFamilyKHR = 5, - ShaderCallKHR = 6, - } - - public enum GroupOperation - { - Reduce = 0, - InclusiveScan = 1, - ExclusiveScan = 2, - ClusteredReduce = 3, - PartitionedReduceNV = 6, - PartitionedInclusiveScanNV = 7, - PartitionedExclusiveScanNV = 8, - } - - public enum KernelEnqueueFlags - { - NoWait = 0, - WaitKernel = 1, - WaitWorkGroup = 2, - } - - public enum KernelProfilingInfoShift - { - CmdExecTime = 0, - } - - public enum KernelProfilingInfoMask - { - MaskNone = 0, - CmdExecTime = 0x00000001, - } - - public enum Capability - { - Matrix = 0, - Shader = 1, - Geometry = 2, - Tessellation = 3, - Addresses = 4, - Linkage = 5, - Kernel = 6, - Vector16 = 7, - Float16Buffer = 8, - Float16 = 9, - Float64 = 10, - Int64 = 11, - Int64Atomics = 12, - ImageBasic = 13, - ImageReadWrite = 14, - ImageMipmap = 15, - Pipes = 17, - Groups = 18, - DeviceEnqueue = 19, - LiteralSampler = 20, - AtomicStorage = 21, - Int16 = 22, - TessellationPointSize = 23, - GeometryPointSize = 24, - ImageGatherExtended = 25, - StorageImageMultisample = 27, - UniformBufferArrayDynamicIndexing = 28, - SampledImageArrayDynamicIndexing = 29, - StorageBufferArrayDynamicIndexing = 30, - StorageImageArrayDynamicIndexing = 31, - ClipDistance = 32, - CullDistance = 33, - ImageCubeArray = 34, - SampleRateShading = 35, - ImageRect = 36, - SampledRect = 37, - GenericPointer = 38, - Int8 = 39, - InputAttachment = 40, - SparseResidency = 41, - MinLod = 42, - Sampled1D = 43, - Image1D = 44, - SampledCubeArray = 45, - SampledBuffer = 46, - ImageBuffer = 47, - ImageMSArray = 48, - StorageImageExtendedFormats = 49, - ImageQuery = 50, - DerivativeControl = 51, - InterpolationFunction = 52, - TransformFeedback = 53, - GeometryStreams = 54, - StorageImageReadWithoutFormat = 55, - StorageImageWriteWithoutFormat = 56, - MultiViewport = 57, - SubgroupDispatch = 58, - NamedBarrier = 59, - PipeStorage = 60, - GroupNonUniform = 61, - GroupNonUniformVote = 62, - GroupNonUniformArithmetic = 63, - GroupNonUniformBallot = 64, - GroupNonUniformShuffle = 65, - GroupNonUniformShuffleRelative = 66, - GroupNonUniformClustered = 67, - GroupNonUniformQuad = 68, - ShaderLayer = 69, - ShaderViewportIndex = 70, - FragmentShadingRateKHR = 4422, - SubgroupBallotKHR = 4423, - DrawParameters = 4427, - WorkgroupMemoryExplicitLayoutKHR = 4428, - WorkgroupMemoryExplicitLayout8BitAccessKHR = 4429, - WorkgroupMemoryExplicitLayout16BitAccessKHR = 4430, - SubgroupVoteKHR = 4431, - StorageBuffer16BitAccess = 4433, - StorageUniformBufferBlock16 = 4433, - StorageUniform16 = 4434, - UniformAndStorageBuffer16BitAccess = 4434, - StoragePushConstant16 = 4435, - StorageInputOutput16 = 4436, - DeviceGroup = 4437, - MultiView = 4439, - VariablePointersStorageBuffer = 4441, - VariablePointers = 4442, - AtomicStorageOps = 4445, - SampleMaskPostDepthCoverage = 4447, - StorageBuffer8BitAccess = 4448, - UniformAndStorageBuffer8BitAccess = 4449, - StoragePushConstant8 = 4450, - DenormPreserve = 4464, - DenormFlushToZero = 4465, - SignedZeroInfNanPreserve = 4466, - RoundingModeRTE = 4467, - RoundingModeRTZ = 4468, - RayQueryProvisionalKHR = 4471, - RayQueryKHR = 4472, - RayTraversalPrimitiveCullingKHR = 4478, - RayTracingKHR = 4479, - Float16ImageAMD = 5008, - ImageGatherBiasLodAMD = 5009, - FragmentMaskAMD = 5010, - StencilExportEXT = 5013, - ImageReadWriteLodAMD = 5015, - Int64ImageEXT = 5016, - ShaderClockKHR = 5055, - SampleMaskOverrideCoverageNV = 5249, - GeometryShaderPassthroughNV = 5251, - ShaderViewportIndexLayerEXT = 5254, - ShaderViewportIndexLayerNV = 5254, - ShaderViewportMaskNV = 5255, - ShaderStereoViewNV = 5259, - PerViewAttributesNV = 5260, - FragmentFullyCoveredEXT = 5265, - MeshShadingNV = 5266, - ImageFootprintNV = 5282, - FragmentBarycentricNV = 5284, - ComputeDerivativeGroupQuadsNV = 5288, - FragmentDensityEXT = 5291, - ShadingRateNV = 5291, - GroupNonUniformPartitionedNV = 5297, - ShaderNonUniform = 5301, - ShaderNonUniformEXT = 5301, - RuntimeDescriptorArray = 5302, - RuntimeDescriptorArrayEXT = 5302, - InputAttachmentArrayDynamicIndexing = 5303, - InputAttachmentArrayDynamicIndexingEXT = 5303, - UniformTexelBufferArrayDynamicIndexing = 5304, - UniformTexelBufferArrayDynamicIndexingEXT = 5304, - StorageTexelBufferArrayDynamicIndexing = 5305, - StorageTexelBufferArrayDynamicIndexingEXT = 5305, - UniformBufferArrayNonUniformIndexing = 5306, - UniformBufferArrayNonUniformIndexingEXT = 5306, - SampledImageArrayNonUniformIndexing = 5307, - SampledImageArrayNonUniformIndexingEXT = 5307, - StorageBufferArrayNonUniformIndexing = 5308, - StorageBufferArrayNonUniformIndexingEXT = 5308, - StorageImageArrayNonUniformIndexing = 5309, - StorageImageArrayNonUniformIndexingEXT = 5309, - InputAttachmentArrayNonUniformIndexing = 5310, - InputAttachmentArrayNonUniformIndexingEXT = 5310, - UniformTexelBufferArrayNonUniformIndexing = 5311, - UniformTexelBufferArrayNonUniformIndexingEXT = 5311, - StorageTexelBufferArrayNonUniformIndexing = 5312, - StorageTexelBufferArrayNonUniformIndexingEXT = 5312, - RayTracingNV = 5340, - RayTracingMotionBlurNV = 5341, - VulkanMemoryModel = 5345, - VulkanMemoryModelKHR = 5345, - VulkanMemoryModelDeviceScope = 5346, - VulkanMemoryModelDeviceScopeKHR = 5346, - PhysicalStorageBufferAddresses = 5347, - PhysicalStorageBufferAddressesEXT = 5347, - ComputeDerivativeGroupLinearNV = 5350, - RayTracingProvisionalKHR = 5353, - CooperativeMatrixNV = 5357, - FragmentShaderSampleInterlockEXT = 5363, - FragmentShaderShadingRateInterlockEXT = 5372, - ShaderSMBuiltinsNV = 5373, - FragmentShaderPixelInterlockEXT = 5378, - DemoteToHelperInvocationEXT = 5379, - SubgroupShuffleINTEL = 5568, - SubgroupBufferBlockIOINTEL = 5569, - SubgroupImageBlockIOINTEL = 5570, - SubgroupImageMediaBlockIOINTEL = 5579, - RoundToInfinityINTEL = 5582, - FloatingPointModeINTEL = 5583, - IntegerFunctions2INTEL = 5584, - FunctionPointersINTEL = 5603, - IndirectReferencesINTEL = 5604, - AsmINTEL = 5606, - AtomicFloat32MinMaxEXT = 5612, - AtomicFloat64MinMaxEXT = 5613, - AtomicFloat16MinMaxEXT = 5616, - VectorComputeINTEL = 5617, - VectorAnyINTEL = 5619, - ExpectAssumeKHR = 5629, - SubgroupAvcMotionEstimationINTEL = 5696, - SubgroupAvcMotionEstimationIntraINTEL = 5697, - SubgroupAvcMotionEstimationChromaINTEL = 5698, - VariableLengthArrayINTEL = 5817, - FunctionFloatControlINTEL = 5821, - FPGAMemoryAttributesINTEL = 5824, - FPFastMathModeINTEL = 5837, - ArbitraryPrecisionIntegersINTEL = 5844, - ArbitraryPrecisionFloatingPointINTEL = 5845, - UnstructuredLoopControlsINTEL = 5886, - FPGALoopControlsINTEL = 5888, - KernelAttributesINTEL = 5892, - FPGAKernelAttributesINTEL = 5897, - FPGAMemoryAccessesINTEL = 5898, - FPGAClusterAttributesINTEL = 5904, - LoopFuseINTEL = 5906, - FPGABufferLocationINTEL = 5920, - ArbitraryPrecisionFixedPointINTEL = 5922, - USMStorageClassesINTEL = 5935, - IOPipesINTEL = 5943, - BlockingPipesINTEL = 5945, - FPGARegINTEL = 5948, - DotProductInputAllKHR = 6016, - DotProductInput4x8BitKHR = 6017, - DotProductInput4x8BitPackedKHR = 6018, - DotProductKHR = 6019, - BitInstructions = 6025, - AtomicFloat32AddEXT = 6033, - AtomicFloat64AddEXT = 6034, - LongConstantCompositeINTEL = 6089, - OptNoneINTEL = 6094, - AtomicFloat16AddEXT = 6095, - DebugInfoModuleINTEL = 6114, - } - - public enum RayFlagsShift - { - OpaqueKHR = 0, - NoOpaqueKHR = 1, - TerminateOnFirstHitKHR = 2, - SkipClosestHitShaderKHR = 3, - CullBackFacingTrianglesKHR = 4, - CullFrontFacingTrianglesKHR = 5, - CullOpaqueKHR = 6, - CullNoOpaqueKHR = 7, - SkipTrianglesKHR = 8, - SkipAABBsKHR = 9, - } - - public enum RayFlagsMask - { - MaskNone = 0, - OpaqueKHR = 0x00000001, - NoOpaqueKHR = 0x00000002, - TerminateOnFirstHitKHR = 0x00000004, - SkipClosestHitShaderKHR = 0x00000008, - CullBackFacingTrianglesKHR = 0x00000010, - CullFrontFacingTrianglesKHR = 0x00000020, - CullOpaqueKHR = 0x00000040, - CullNoOpaqueKHR = 0x00000080, - SkipTrianglesKHR = 0x00000100, - SkipAABBsKHR = 0x00000200, - } - - public enum RayQueryIntersection - { - RayQueryCandidateIntersectionKHR = 0, - RayQueryCommittedIntersectionKHR = 1, - } - - public enum RayQueryCommittedIntersectionType - { - RayQueryCommittedIntersectionNoneKHR = 0, - RayQueryCommittedIntersectionTriangleKHR = 1, - RayQueryCommittedIntersectionGeneratedKHR = 2, - } - - public enum RayQueryCandidateIntersectionType - { - RayQueryCandidateIntersectionTriangleKHR = 0, - RayQueryCandidateIntersectionAABBKHR = 1, - } - - public enum FragmentShadingRateShift - { - Vertical2Pixels = 0, - Vertical4Pixels = 1, - Horizontal2Pixels = 2, - Horizontal4Pixels = 3, - } - - public enum FragmentShadingRateMask - { - MaskNone = 0, - Vertical2Pixels = 0x00000001, - Vertical4Pixels = 0x00000002, - Horizontal2Pixels = 0x00000004, - Horizontal4Pixels = 0x00000008, - } - - public enum FPDenormMode - { - Preserve = 0, - FlushToZero = 1, - } - - public enum FPOperationMode - { - IEEE = 0, - ALT = 1, - } - - public enum QuantizationModes - { - TRN = 0, - TRN_ZERO = 1, - RND = 2, - RND_ZERO = 3, - RND_INF = 4, - RND_MIN_INF = 5, - RND_CONV = 6, - RND_CONV_ODD = 7, - } - - public enum OverflowModes - { - WRAP = 0, - SAT = 1, - SAT_ZERO = 2, - SAT_SYM = 3, - } - - public enum PackedVectorFormat - { - PackedVectorFormat4x8BitKHR = 0, - } - - public enum Op - { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, - OpImageSparseRead = 320, - OpSizeOf = 321, - OpTypePipeStorage = 322, - OpConstantPipeStorage = 323, - OpCreatePipeFromPipeStorage = 324, - OpGetKernelLocalSizeForSubgroupCount = 325, - OpGetKernelMaxNumSubgroups = 326, - OpTypeNamedBarrier = 327, - OpNamedBarrierInitialize = 328, - OpMemoryNamedBarrier = 329, - OpModuleProcessed = 330, - OpExecutionModeId = 331, - OpDecorateId = 332, - OpGroupNonUniformElect = 333, - OpGroupNonUniformAll = 334, - OpGroupNonUniformAny = 335, - OpGroupNonUniformAllEqual = 336, - OpGroupNonUniformBroadcast = 337, - OpGroupNonUniformBroadcastFirst = 338, - OpGroupNonUniformBallot = 339, - OpGroupNonUniformInverseBallot = 340, - OpGroupNonUniformBallotBitExtract = 341, - OpGroupNonUniformBallotBitCount = 342, - OpGroupNonUniformBallotFindLSB = 343, - OpGroupNonUniformBallotFindMSB = 344, - OpGroupNonUniformShuffle = 345, - OpGroupNonUniformShuffleXor = 346, - OpGroupNonUniformShuffleUp = 347, - OpGroupNonUniformShuffleDown = 348, - OpGroupNonUniformIAdd = 349, - OpGroupNonUniformFAdd = 350, - OpGroupNonUniformIMul = 351, - OpGroupNonUniformFMul = 352, - OpGroupNonUniformSMin = 353, - OpGroupNonUniformUMin = 354, - OpGroupNonUniformFMin = 355, - OpGroupNonUniformSMax = 356, - OpGroupNonUniformUMax = 357, - OpGroupNonUniformFMax = 358, - OpGroupNonUniformBitwiseAnd = 359, - OpGroupNonUniformBitwiseOr = 360, - OpGroupNonUniformBitwiseXor = 361, - OpGroupNonUniformLogicalAnd = 362, - OpGroupNonUniformLogicalOr = 363, - OpGroupNonUniformLogicalXor = 364, - OpGroupNonUniformQuadBroadcast = 365, - OpGroupNonUniformQuadSwap = 366, - OpCopyLogical = 400, - OpPtrEqual = 401, - OpPtrNotEqual = 402, - OpPtrDiff = 403, - OpTerminateInvocation = 4416, - OpSubgroupBallotKHR = 4421, - OpSubgroupFirstInvocationKHR = 4422, - OpSubgroupAllKHR = 4428, - OpSubgroupAnyKHR = 4429, - OpSubgroupAllEqualKHR = 4430, - OpSubgroupReadInvocationKHR = 4432, - OpTraceRayKHR = 4445, - OpExecuteCallableKHR = 4446, - OpConvertUToAccelerationStructureKHR = 4447, - OpIgnoreIntersectionKHR = 4448, - OpTerminateRayKHR = 4449, - OpSDotKHR = 4450, - OpUDotKHR = 4451, - OpSUDotKHR = 4452, - OpSDotAccSatKHR = 4453, - OpUDotAccSatKHR = 4454, - OpSUDotAccSatKHR = 4455, - OpTypeRayQueryKHR = 4472, - OpRayQueryInitializeKHR = 4473, - OpRayQueryTerminateKHR = 4474, - OpRayQueryGenerateIntersectionKHR = 4475, - OpRayQueryConfirmIntersectionKHR = 4476, - OpRayQueryProceedKHR = 4477, - OpRayQueryGetIntersectionTypeKHR = 4479, - OpGroupIAddNonUniformAMD = 5000, - OpGroupFAddNonUniformAMD = 5001, - OpGroupFMinNonUniformAMD = 5002, - OpGroupUMinNonUniformAMD = 5003, - OpGroupSMinNonUniformAMD = 5004, - OpGroupFMaxNonUniformAMD = 5005, - OpGroupUMaxNonUniformAMD = 5006, - OpGroupSMaxNonUniformAMD = 5007, - OpFragmentMaskFetchAMD = 5011, - OpFragmentFetchAMD = 5012, - OpReadClockKHR = 5056, - OpImageSampleFootprintNV = 5283, - OpGroupNonUniformPartitionNV = 5296, - OpWritePackedPrimitiveIndices4x8NV = 5299, - OpReportIntersectionKHR = 5334, - OpReportIntersectionNV = 5334, - OpIgnoreIntersectionNV = 5335, - OpTerminateRayNV = 5336, - OpTraceNV = 5337, - OpTraceMotionNV = 5338, - OpTraceRayMotionNV = 5339, - OpTypeAccelerationStructureKHR = 5341, - OpTypeAccelerationStructureNV = 5341, - OpExecuteCallableNV = 5344, - OpTypeCooperativeMatrixNV = 5358, - OpCooperativeMatrixLoadNV = 5359, - OpCooperativeMatrixStoreNV = 5360, - OpCooperativeMatrixMulAddNV = 5361, - OpCooperativeMatrixLengthNV = 5362, - OpBeginInvocationInterlockEXT = 5364, - OpEndInvocationInterlockEXT = 5365, - OpDemoteToHelperInvocationEXT = 5380, - OpIsHelperInvocationEXT = 5381, - OpSubgroupShuffleINTEL = 5571, - OpSubgroupShuffleDownINTEL = 5572, - OpSubgroupShuffleUpINTEL = 5573, - OpSubgroupShuffleXorINTEL = 5574, - OpSubgroupBlockReadINTEL = 5575, - OpSubgroupBlockWriteINTEL = 5576, - OpSubgroupImageBlockReadINTEL = 5577, - OpSubgroupImageBlockWriteINTEL = 5578, - OpSubgroupImageMediaBlockReadINTEL = 5580, - OpSubgroupImageMediaBlockWriteINTEL = 5581, - OpUCountLeadingZerosINTEL = 5585, - OpUCountTrailingZerosINTEL = 5586, - OpAbsISubINTEL = 5587, - OpAbsUSubINTEL = 5588, - OpIAddSatINTEL = 5589, - OpUAddSatINTEL = 5590, - OpIAverageINTEL = 5591, - OpUAverageINTEL = 5592, - OpIAverageRoundedINTEL = 5593, - OpUAverageRoundedINTEL = 5594, - OpISubSatINTEL = 5595, - OpUSubSatINTEL = 5596, - OpIMul32x16INTEL = 5597, - OpUMul32x16INTEL = 5598, - OpConstFunctionPointerINTEL = 5600, - OpFunctionPointerCallINTEL = 5601, - OpAsmTargetINTEL = 5609, - OpAsmINTEL = 5610, - OpAsmCallINTEL = 5611, - OpAtomicFMinEXT = 5614, - OpAtomicFMaxEXT = 5615, - OpAssumeTrueKHR = 5630, - OpExpectKHR = 5631, - OpDecorateString = 5632, - OpDecorateStringGOOGLE = 5632, - OpMemberDecorateString = 5633, - OpMemberDecorateStringGOOGLE = 5633, - OpVmeImageINTEL = 5699, - OpTypeVmeImageINTEL = 5700, - OpTypeAvcImePayloadINTEL = 5701, - OpTypeAvcRefPayloadINTEL = 5702, - OpTypeAvcSicPayloadINTEL = 5703, - OpTypeAvcMcePayloadINTEL = 5704, - OpTypeAvcMceResultINTEL = 5705, - OpTypeAvcImeResultINTEL = 5706, - OpTypeAvcImeResultSingleReferenceStreamoutINTEL = 5707, - OpTypeAvcImeResultDualReferenceStreamoutINTEL = 5708, - OpTypeAvcImeSingleReferenceStreaminINTEL = 5709, - OpTypeAvcImeDualReferenceStreaminINTEL = 5710, - OpTypeAvcRefResultINTEL = 5711, - OpTypeAvcSicResultINTEL = 5712, - OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL = 5713, - OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL = 5714, - OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL = 5715, - OpSubgroupAvcMceSetInterShapePenaltyINTEL = 5716, - OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL = 5717, - OpSubgroupAvcMceSetInterDirectionPenaltyINTEL = 5718, - OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL = 5719, - OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL = 5720, - OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL = 5721, - OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL = 5722, - OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL = 5723, - OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL = 5724, - OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL = 5725, - OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL = 5726, - OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL = 5727, - OpSubgroupAvcMceSetAcOnlyHaarINTEL = 5728, - OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL = 5729, - OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL = 5730, - OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL = 5731, - OpSubgroupAvcMceConvertToImePayloadINTEL = 5732, - OpSubgroupAvcMceConvertToImeResultINTEL = 5733, - OpSubgroupAvcMceConvertToRefPayloadINTEL = 5734, - OpSubgroupAvcMceConvertToRefResultINTEL = 5735, - OpSubgroupAvcMceConvertToSicPayloadINTEL = 5736, - OpSubgroupAvcMceConvertToSicResultINTEL = 5737, - OpSubgroupAvcMceGetMotionVectorsINTEL = 5738, - OpSubgroupAvcMceGetInterDistortionsINTEL = 5739, - OpSubgroupAvcMceGetBestInterDistortionsINTEL = 5740, - OpSubgroupAvcMceGetInterMajorShapeINTEL = 5741, - OpSubgroupAvcMceGetInterMinorShapeINTEL = 5742, - OpSubgroupAvcMceGetInterDirectionsINTEL = 5743, - OpSubgroupAvcMceGetInterMotionVectorCountINTEL = 5744, - OpSubgroupAvcMceGetInterReferenceIdsINTEL = 5745, - OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL = 5746, - OpSubgroupAvcImeInitializeINTEL = 5747, - OpSubgroupAvcImeSetSingleReferenceINTEL = 5748, - OpSubgroupAvcImeSetDualReferenceINTEL = 5749, - OpSubgroupAvcImeRefWindowSizeINTEL = 5750, - OpSubgroupAvcImeAdjustRefOffsetINTEL = 5751, - OpSubgroupAvcImeConvertToMcePayloadINTEL = 5752, - OpSubgroupAvcImeSetMaxMotionVectorCountINTEL = 5753, - OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL = 5754, - OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL = 5755, - OpSubgroupAvcImeSetWeightedSadINTEL = 5756, - OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL = 5757, - OpSubgroupAvcImeEvaluateWithDualReferenceINTEL = 5758, - OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL = 5759, - OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL = 5760, - OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL = 5761, - OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL = 5762, - OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL = 5763, - OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL = 5764, - OpSubgroupAvcImeConvertToMceResultINTEL = 5765, - OpSubgroupAvcImeGetSingleReferenceStreaminINTEL = 5766, - OpSubgroupAvcImeGetDualReferenceStreaminINTEL = 5767, - OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL = 5768, - OpSubgroupAvcImeStripDualReferenceStreamoutINTEL = 5769, - OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL = 5770, - OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL = 5771, - OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL = 5772, - OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL = 5773, - OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL = 5774, - OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL = 5775, - OpSubgroupAvcImeGetBorderReachedINTEL = 5776, - OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL = 5777, - OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL = 5778, - OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL = 5779, - OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL = 5780, - OpSubgroupAvcFmeInitializeINTEL = 5781, - OpSubgroupAvcBmeInitializeINTEL = 5782, - OpSubgroupAvcRefConvertToMcePayloadINTEL = 5783, - OpSubgroupAvcRefSetBidirectionalMixDisableINTEL = 5784, - OpSubgroupAvcRefSetBilinearFilterEnableINTEL = 5785, - OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL = 5786, - OpSubgroupAvcRefEvaluateWithDualReferenceINTEL = 5787, - OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL = 5788, - OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL = 5789, - OpSubgroupAvcRefConvertToMceResultINTEL = 5790, - OpSubgroupAvcSicInitializeINTEL = 5791, - OpSubgroupAvcSicConfigureSkcINTEL = 5792, - OpSubgroupAvcSicConfigureIpeLumaINTEL = 5793, - OpSubgroupAvcSicConfigureIpeLumaChromaINTEL = 5794, - OpSubgroupAvcSicGetMotionVectorMaskINTEL = 5795, - OpSubgroupAvcSicConvertToMcePayloadINTEL = 5796, - OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL = 5797, - OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL = 5798, - OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL = 5799, - OpSubgroupAvcSicSetBilinearFilterEnableINTEL = 5800, - OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL = 5801, - OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL = 5802, - OpSubgroupAvcSicEvaluateIpeINTEL = 5803, - OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL = 5804, - OpSubgroupAvcSicEvaluateWithDualReferenceINTEL = 5805, - OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL = 5806, - OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL = 5807, - OpSubgroupAvcSicConvertToMceResultINTEL = 5808, - OpSubgroupAvcSicGetIpeLumaShapeINTEL = 5809, - OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL = 5810, - OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL = 5811, - OpSubgroupAvcSicGetPackedIpeLumaModesINTEL = 5812, - OpSubgroupAvcSicGetIpeChromaModeINTEL = 5813, - OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL = 5814, - OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL = 5815, - OpSubgroupAvcSicGetInterRawSadsINTEL = 5816, - OpVariableLengthArrayINTEL = 5818, - OpSaveMemoryINTEL = 5819, - OpRestoreMemoryINTEL = 5820, - OpArbitraryFloatSinCosPiINTEL = 5840, - OpArbitraryFloatCastINTEL = 5841, - OpArbitraryFloatCastFromIntINTEL = 5842, - OpArbitraryFloatCastToIntINTEL = 5843, - OpArbitraryFloatAddINTEL = 5846, - OpArbitraryFloatSubINTEL = 5847, - OpArbitraryFloatMulINTEL = 5848, - OpArbitraryFloatDivINTEL = 5849, - OpArbitraryFloatGTINTEL = 5850, - OpArbitraryFloatGEINTEL = 5851, - OpArbitraryFloatLTINTEL = 5852, - OpArbitraryFloatLEINTEL = 5853, - OpArbitraryFloatEQINTEL = 5854, - OpArbitraryFloatRecipINTEL = 5855, - OpArbitraryFloatRSqrtINTEL = 5856, - OpArbitraryFloatCbrtINTEL = 5857, - OpArbitraryFloatHypotINTEL = 5858, - OpArbitraryFloatSqrtINTEL = 5859, - OpArbitraryFloatLogINTEL = 5860, - OpArbitraryFloatLog2INTEL = 5861, - OpArbitraryFloatLog10INTEL = 5862, - OpArbitraryFloatLog1pINTEL = 5863, - OpArbitraryFloatExpINTEL = 5864, - OpArbitraryFloatExp2INTEL = 5865, - OpArbitraryFloatExp10INTEL = 5866, - OpArbitraryFloatExpm1INTEL = 5867, - OpArbitraryFloatSinINTEL = 5868, - OpArbitraryFloatCosINTEL = 5869, - OpArbitraryFloatSinCosINTEL = 5870, - OpArbitraryFloatSinPiINTEL = 5871, - OpArbitraryFloatCosPiINTEL = 5872, - OpArbitraryFloatASinINTEL = 5873, - OpArbitraryFloatASinPiINTEL = 5874, - OpArbitraryFloatACosINTEL = 5875, - OpArbitraryFloatACosPiINTEL = 5876, - OpArbitraryFloatATanINTEL = 5877, - OpArbitraryFloatATanPiINTEL = 5878, - OpArbitraryFloatATan2INTEL = 5879, - OpArbitraryFloatPowINTEL = 5880, - OpArbitraryFloatPowRINTEL = 5881, - OpArbitraryFloatPowNINTEL = 5882, - OpLoopControlINTEL = 5887, - OpFixedSqrtINTEL = 5923, - OpFixedRecipINTEL = 5924, - OpFixedRsqrtINTEL = 5925, - OpFixedSinINTEL = 5926, - OpFixedCosINTEL = 5927, - OpFixedSinCosINTEL = 5928, - OpFixedSinPiINTEL = 5929, - OpFixedCosPiINTEL = 5930, - OpFixedSinCosPiINTEL = 5931, - OpFixedLogINTEL = 5932, - OpFixedExpINTEL = 5933, - OpPtrCastToCrossWorkgroupINTEL = 5934, - OpCrossWorkgroupCastToPtrINTEL = 5938, - OpReadPipeBlockingINTEL = 5946, - OpWritePipeBlockingINTEL = 5947, - OpFPGARegINTEL = 5949, - OpRayQueryGetRayTMinKHR = 6016, - OpRayQueryGetRayFlagsKHR = 6017, - OpRayQueryGetIntersectionTKHR = 6018, - OpRayQueryGetIntersectionInstanceCustomIndexKHR = 6019, - OpRayQueryGetIntersectionInstanceIdKHR = 6020, - OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR = 6021, - OpRayQueryGetIntersectionGeometryIndexKHR = 6022, - OpRayQueryGetIntersectionPrimitiveIndexKHR = 6023, - OpRayQueryGetIntersectionBarycentricsKHR = 6024, - OpRayQueryGetIntersectionFrontFaceKHR = 6025, - OpRayQueryGetIntersectionCandidateAABBOpaqueKHR = 6026, - OpRayQueryGetIntersectionObjectRayDirectionKHR = 6027, - OpRayQueryGetIntersectionObjectRayOriginKHR = 6028, - OpRayQueryGetWorldRayDirectionKHR = 6029, - OpRayQueryGetWorldRayOriginKHR = 6030, - OpRayQueryGetIntersectionObjectToWorldKHR = 6031, - OpRayQueryGetIntersectionWorldToObjectKHR = 6032, - OpAtomicFAddEXT = 6035, - OpTypeBufferSurfaceINTEL = 6086, - OpTypeStructContinuedINTEL = 6090, - OpConstantCompositeContinuedINTEL = 6091, - OpSpecConstantCompositeContinuedINTEL = 6092, - } - } -} - diff --git a/include/spirv/unified1/spirv.hpp b/include/spirv/unified1/spirv.hpp deleted file mode 100644 index 5180457c..00000000 --- a/include/spirv/unified1/spirv.hpp +++ /dev/null @@ -1,2467 +0,0 @@ -// Copyright (c) 2014-2020 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -// This header is automatically generated by the same tool that creates -// the Binary Section of the SPIR-V specification. - -// Enumeration tokens for SPIR-V, in various styles: -// C, C++, C++11, JSON, Lua, Python, C#, D -// -// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -// - C# will use enum classes in the Specification class located in the "Spv" namespace, -// e.g.: Spv.Specification.SourceLanguage.GLSL -// - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL -// -// Some tokens act like mask values, which can be OR'd together, -// while others are mutually exclusive. The mask-like ones have -// "Mask" in their name, and a parallel enum that has the shift -// amount (1 << x) for each corresponding enumerant. - -#ifndef spirv_HPP -#define spirv_HPP - -namespace spv { - -typedef unsigned int Id; - -#define SPV_VERSION 0x10500 -#define SPV_REVISION 4 - -static const unsigned int MagicNumber = 0x07230203; -static const unsigned int Version = 0x00010500; -static const unsigned int Revision = 4; -static const unsigned int OpCodeMask = 0xffff; -static const unsigned int WordCountShift = 16; - -enum SourceLanguage { - SourceLanguageUnknown = 0, - SourceLanguageESSL = 1, - SourceLanguageGLSL = 2, - SourceLanguageOpenCL_C = 3, - SourceLanguageOpenCL_CPP = 4, - SourceLanguageHLSL = 5, - SourceLanguageCPP_for_OpenCL = 6, - SourceLanguageMax = 0x7fffffff, -}; - -enum ExecutionModel { - ExecutionModelVertex = 0, - ExecutionModelTessellationControl = 1, - ExecutionModelTessellationEvaluation = 2, - ExecutionModelGeometry = 3, - ExecutionModelFragment = 4, - ExecutionModelGLCompute = 5, - ExecutionModelKernel = 6, - ExecutionModelTaskNV = 5267, - ExecutionModelMeshNV = 5268, - ExecutionModelRayGenerationKHR = 5313, - ExecutionModelRayGenerationNV = 5313, - ExecutionModelIntersectionKHR = 5314, - ExecutionModelIntersectionNV = 5314, - ExecutionModelAnyHitKHR = 5315, - ExecutionModelAnyHitNV = 5315, - ExecutionModelClosestHitKHR = 5316, - ExecutionModelClosestHitNV = 5316, - ExecutionModelMissKHR = 5317, - ExecutionModelMissNV = 5317, - ExecutionModelCallableKHR = 5318, - ExecutionModelCallableNV = 5318, - ExecutionModelMax = 0x7fffffff, -}; - -enum AddressingModel { - AddressingModelLogical = 0, - AddressingModelPhysical32 = 1, - AddressingModelPhysical64 = 2, - AddressingModelPhysicalStorageBuffer64 = 5348, - AddressingModelPhysicalStorageBuffer64EXT = 5348, - AddressingModelMax = 0x7fffffff, -}; - -enum MemoryModel { - MemoryModelSimple = 0, - MemoryModelGLSL450 = 1, - MemoryModelOpenCL = 2, - MemoryModelVulkan = 3, - MemoryModelVulkanKHR = 3, - MemoryModelMax = 0x7fffffff, -}; - -enum ExecutionMode { - ExecutionModeInvocations = 0, - ExecutionModeSpacingEqual = 1, - ExecutionModeSpacingFractionalEven = 2, - ExecutionModeSpacingFractionalOdd = 3, - ExecutionModeVertexOrderCw = 4, - ExecutionModeVertexOrderCcw = 5, - ExecutionModePixelCenterInteger = 6, - ExecutionModeOriginUpperLeft = 7, - ExecutionModeOriginLowerLeft = 8, - ExecutionModeEarlyFragmentTests = 9, - ExecutionModePointMode = 10, - ExecutionModeXfb = 11, - ExecutionModeDepthReplacing = 12, - ExecutionModeDepthGreater = 14, - ExecutionModeDepthLess = 15, - ExecutionModeDepthUnchanged = 16, - ExecutionModeLocalSize = 17, - ExecutionModeLocalSizeHint = 18, - ExecutionModeInputPoints = 19, - ExecutionModeInputLines = 20, - ExecutionModeInputLinesAdjacency = 21, - ExecutionModeTriangles = 22, - ExecutionModeInputTrianglesAdjacency = 23, - ExecutionModeQuads = 24, - ExecutionModeIsolines = 25, - ExecutionModeOutputVertices = 26, - ExecutionModeOutputPoints = 27, - ExecutionModeOutputLineStrip = 28, - ExecutionModeOutputTriangleStrip = 29, - ExecutionModeVecTypeHint = 30, - ExecutionModeContractionOff = 31, - ExecutionModeInitializer = 33, - ExecutionModeFinalizer = 34, - ExecutionModeSubgroupSize = 35, - ExecutionModeSubgroupsPerWorkgroup = 36, - ExecutionModeSubgroupsPerWorkgroupId = 37, - ExecutionModeLocalSizeId = 38, - ExecutionModeLocalSizeHintId = 39, - ExecutionModeSubgroupUniformControlFlowKHR = 4421, - ExecutionModePostDepthCoverage = 4446, - ExecutionModeDenormPreserve = 4459, - ExecutionModeDenormFlushToZero = 4460, - ExecutionModeSignedZeroInfNanPreserve = 4461, - ExecutionModeRoundingModeRTE = 4462, - ExecutionModeRoundingModeRTZ = 4463, - ExecutionModeStencilRefReplacingEXT = 5027, - ExecutionModeOutputLinesNV = 5269, - ExecutionModeOutputPrimitivesNV = 5270, - ExecutionModeDerivativeGroupQuadsNV = 5289, - ExecutionModeDerivativeGroupLinearNV = 5290, - ExecutionModeOutputTrianglesNV = 5298, - ExecutionModePixelInterlockOrderedEXT = 5366, - ExecutionModePixelInterlockUnorderedEXT = 5367, - ExecutionModeSampleInterlockOrderedEXT = 5368, - ExecutionModeSampleInterlockUnorderedEXT = 5369, - ExecutionModeShadingRateInterlockOrderedEXT = 5370, - ExecutionModeShadingRateInterlockUnorderedEXT = 5371, - ExecutionModeSharedLocalMemorySizeINTEL = 5618, - ExecutionModeRoundingModeRTPINTEL = 5620, - ExecutionModeRoundingModeRTNINTEL = 5621, - ExecutionModeFloatingPointModeALTINTEL = 5622, - ExecutionModeFloatingPointModeIEEEINTEL = 5623, - ExecutionModeMaxWorkgroupSizeINTEL = 5893, - ExecutionModeMaxWorkDimINTEL = 5894, - ExecutionModeNoGlobalOffsetINTEL = 5895, - ExecutionModeNumSIMDWorkitemsINTEL = 5896, - ExecutionModeSchedulerTargetFmaxMhzINTEL = 5903, - ExecutionModeMax = 0x7fffffff, -}; - -enum StorageClass { - StorageClassUniformConstant = 0, - StorageClassInput = 1, - StorageClassUniform = 2, - StorageClassOutput = 3, - StorageClassWorkgroup = 4, - StorageClassCrossWorkgroup = 5, - StorageClassPrivate = 6, - StorageClassFunction = 7, - StorageClassGeneric = 8, - StorageClassPushConstant = 9, - StorageClassAtomicCounter = 10, - StorageClassImage = 11, - StorageClassStorageBuffer = 12, - StorageClassCallableDataKHR = 5328, - StorageClassCallableDataNV = 5328, - StorageClassIncomingCallableDataKHR = 5329, - StorageClassIncomingCallableDataNV = 5329, - StorageClassRayPayloadKHR = 5338, - StorageClassRayPayloadNV = 5338, - StorageClassHitAttributeKHR = 5339, - StorageClassHitAttributeNV = 5339, - StorageClassIncomingRayPayloadKHR = 5342, - StorageClassIncomingRayPayloadNV = 5342, - StorageClassShaderRecordBufferKHR = 5343, - StorageClassShaderRecordBufferNV = 5343, - StorageClassPhysicalStorageBuffer = 5349, - StorageClassPhysicalStorageBufferEXT = 5349, - StorageClassCodeSectionINTEL = 5605, - StorageClassDeviceOnlyINTEL = 5936, - StorageClassHostOnlyINTEL = 5937, - StorageClassMax = 0x7fffffff, -}; - -enum Dim { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - DimCube = 3, - DimRect = 4, - DimBuffer = 5, - DimSubpassData = 6, - DimMax = 0x7fffffff, -}; - -enum SamplerAddressingMode { - SamplerAddressingModeNone = 0, - SamplerAddressingModeClampToEdge = 1, - SamplerAddressingModeClamp = 2, - SamplerAddressingModeRepeat = 3, - SamplerAddressingModeRepeatMirrored = 4, - SamplerAddressingModeMax = 0x7fffffff, -}; - -enum SamplerFilterMode { - SamplerFilterModeNearest = 0, - SamplerFilterModeLinear = 1, - SamplerFilterModeMax = 0x7fffffff, -}; - -enum ImageFormat { - ImageFormatUnknown = 0, - ImageFormatRgba32f = 1, - ImageFormatRgba16f = 2, - ImageFormatR32f = 3, - ImageFormatRgba8 = 4, - ImageFormatRgba8Snorm = 5, - ImageFormatRg32f = 6, - ImageFormatRg16f = 7, - ImageFormatR11fG11fB10f = 8, - ImageFormatR16f = 9, - ImageFormatRgba16 = 10, - ImageFormatRgb10A2 = 11, - ImageFormatRg16 = 12, - ImageFormatRg8 = 13, - ImageFormatR16 = 14, - ImageFormatR8 = 15, - ImageFormatRgba16Snorm = 16, - ImageFormatRg16Snorm = 17, - ImageFormatRg8Snorm = 18, - ImageFormatR16Snorm = 19, - ImageFormatR8Snorm = 20, - ImageFormatRgba32i = 21, - ImageFormatRgba16i = 22, - ImageFormatRgba8i = 23, - ImageFormatR32i = 24, - ImageFormatRg32i = 25, - ImageFormatRg16i = 26, - ImageFormatRg8i = 27, - ImageFormatR16i = 28, - ImageFormatR8i = 29, - ImageFormatRgba32ui = 30, - ImageFormatRgba16ui = 31, - ImageFormatRgba8ui = 32, - ImageFormatR32ui = 33, - ImageFormatRgb10a2ui = 34, - ImageFormatRg32ui = 35, - ImageFormatRg16ui = 36, - ImageFormatRg8ui = 37, - ImageFormatR16ui = 38, - ImageFormatR8ui = 39, - ImageFormatR64ui = 40, - ImageFormatR64i = 41, - ImageFormatMax = 0x7fffffff, -}; - -enum ImageChannelOrder { - ImageChannelOrderR = 0, - ImageChannelOrderA = 1, - ImageChannelOrderRG = 2, - ImageChannelOrderRA = 3, - ImageChannelOrderRGB = 4, - ImageChannelOrderRGBA = 5, - ImageChannelOrderBGRA = 6, - ImageChannelOrderARGB = 7, - ImageChannelOrderIntensity = 8, - ImageChannelOrderLuminance = 9, - ImageChannelOrderRx = 10, - ImageChannelOrderRGx = 11, - ImageChannelOrderRGBx = 12, - ImageChannelOrderDepth = 13, - ImageChannelOrderDepthStencil = 14, - ImageChannelOrdersRGB = 15, - ImageChannelOrdersRGBx = 16, - ImageChannelOrdersRGBA = 17, - ImageChannelOrdersBGRA = 18, - ImageChannelOrderABGR = 19, - ImageChannelOrderMax = 0x7fffffff, -}; - -enum ImageChannelDataType { - ImageChannelDataTypeSnormInt8 = 0, - ImageChannelDataTypeSnormInt16 = 1, - ImageChannelDataTypeUnormInt8 = 2, - ImageChannelDataTypeUnormInt16 = 3, - ImageChannelDataTypeUnormShort565 = 4, - ImageChannelDataTypeUnormShort555 = 5, - ImageChannelDataTypeUnormInt101010 = 6, - ImageChannelDataTypeSignedInt8 = 7, - ImageChannelDataTypeSignedInt16 = 8, - ImageChannelDataTypeSignedInt32 = 9, - ImageChannelDataTypeUnsignedInt8 = 10, - ImageChannelDataTypeUnsignedInt16 = 11, - ImageChannelDataTypeUnsignedInt32 = 12, - ImageChannelDataTypeHalfFloat = 13, - ImageChannelDataTypeFloat = 14, - ImageChannelDataTypeUnormInt24 = 15, - ImageChannelDataTypeUnormInt101010_2 = 16, - ImageChannelDataTypeMax = 0x7fffffff, -}; - -enum ImageOperandsShift { - ImageOperandsBiasShift = 0, - ImageOperandsLodShift = 1, - ImageOperandsGradShift = 2, - ImageOperandsConstOffsetShift = 3, - ImageOperandsOffsetShift = 4, - ImageOperandsConstOffsetsShift = 5, - ImageOperandsSampleShift = 6, - ImageOperandsMinLodShift = 7, - ImageOperandsMakeTexelAvailableShift = 8, - ImageOperandsMakeTexelAvailableKHRShift = 8, - ImageOperandsMakeTexelVisibleShift = 9, - ImageOperandsMakeTexelVisibleKHRShift = 9, - ImageOperandsNonPrivateTexelShift = 10, - ImageOperandsNonPrivateTexelKHRShift = 10, - ImageOperandsVolatileTexelShift = 11, - ImageOperandsVolatileTexelKHRShift = 11, - ImageOperandsSignExtendShift = 12, - ImageOperandsZeroExtendShift = 13, - ImageOperandsMax = 0x7fffffff, -}; - -enum ImageOperandsMask { - ImageOperandsMaskNone = 0, - ImageOperandsBiasMask = 0x00000001, - ImageOperandsLodMask = 0x00000002, - ImageOperandsGradMask = 0x00000004, - ImageOperandsConstOffsetMask = 0x00000008, - ImageOperandsOffsetMask = 0x00000010, - ImageOperandsConstOffsetsMask = 0x00000020, - ImageOperandsSampleMask = 0x00000040, - ImageOperandsMinLodMask = 0x00000080, - ImageOperandsMakeTexelAvailableMask = 0x00000100, - ImageOperandsMakeTexelAvailableKHRMask = 0x00000100, - ImageOperandsMakeTexelVisibleMask = 0x00000200, - ImageOperandsMakeTexelVisibleKHRMask = 0x00000200, - ImageOperandsNonPrivateTexelMask = 0x00000400, - ImageOperandsNonPrivateTexelKHRMask = 0x00000400, - ImageOperandsVolatileTexelMask = 0x00000800, - ImageOperandsVolatileTexelKHRMask = 0x00000800, - ImageOperandsSignExtendMask = 0x00001000, - ImageOperandsZeroExtendMask = 0x00002000, -}; - -enum FPFastMathModeShift { - FPFastMathModeNotNaNShift = 0, - FPFastMathModeNotInfShift = 1, - FPFastMathModeNSZShift = 2, - FPFastMathModeAllowRecipShift = 3, - FPFastMathModeFastShift = 4, - FPFastMathModeAllowContractFastINTELShift = 16, - FPFastMathModeAllowReassocINTELShift = 17, - FPFastMathModeMax = 0x7fffffff, -}; - -enum FPFastMathModeMask { - FPFastMathModeMaskNone = 0, - FPFastMathModeNotNaNMask = 0x00000001, - FPFastMathModeNotInfMask = 0x00000002, - FPFastMathModeNSZMask = 0x00000004, - FPFastMathModeAllowRecipMask = 0x00000008, - FPFastMathModeFastMask = 0x00000010, - FPFastMathModeAllowContractFastINTELMask = 0x00010000, - FPFastMathModeAllowReassocINTELMask = 0x00020000, -}; - -enum FPRoundingMode { - FPRoundingModeRTE = 0, - FPRoundingModeRTZ = 1, - FPRoundingModeRTP = 2, - FPRoundingModeRTN = 3, - FPRoundingModeMax = 0x7fffffff, -}; - -enum LinkageType { - LinkageTypeExport = 0, - LinkageTypeImport = 1, - LinkageTypeLinkOnceODR = 2, - LinkageTypeMax = 0x7fffffff, -}; - -enum AccessQualifier { - AccessQualifierReadOnly = 0, - AccessQualifierWriteOnly = 1, - AccessQualifierReadWrite = 2, - AccessQualifierMax = 0x7fffffff, -}; - -enum FunctionParameterAttribute { - FunctionParameterAttributeZext = 0, - FunctionParameterAttributeSext = 1, - FunctionParameterAttributeByVal = 2, - FunctionParameterAttributeSret = 3, - FunctionParameterAttributeNoAlias = 4, - FunctionParameterAttributeNoCapture = 5, - FunctionParameterAttributeNoWrite = 6, - FunctionParameterAttributeNoReadWrite = 7, - FunctionParameterAttributeMax = 0x7fffffff, -}; - -enum Decoration { - DecorationRelaxedPrecision = 0, - DecorationSpecId = 1, - DecorationBlock = 2, - DecorationBufferBlock = 3, - DecorationRowMajor = 4, - DecorationColMajor = 5, - DecorationArrayStride = 6, - DecorationMatrixStride = 7, - DecorationGLSLShared = 8, - DecorationGLSLPacked = 9, - DecorationCPacked = 10, - DecorationBuiltIn = 11, - DecorationNoPerspective = 13, - DecorationFlat = 14, - DecorationPatch = 15, - DecorationCentroid = 16, - DecorationSample = 17, - DecorationInvariant = 18, - DecorationRestrict = 19, - DecorationAliased = 20, - DecorationVolatile = 21, - DecorationConstant = 22, - DecorationCoherent = 23, - DecorationNonWritable = 24, - DecorationNonReadable = 25, - DecorationUniform = 26, - DecorationUniformId = 27, - DecorationSaturatedConversion = 28, - DecorationStream = 29, - DecorationLocation = 30, - DecorationComponent = 31, - DecorationIndex = 32, - DecorationBinding = 33, - DecorationDescriptorSet = 34, - DecorationOffset = 35, - DecorationXfbBuffer = 36, - DecorationXfbStride = 37, - DecorationFuncParamAttr = 38, - DecorationFPRoundingMode = 39, - DecorationFPFastMathMode = 40, - DecorationLinkageAttributes = 41, - DecorationNoContraction = 42, - DecorationInputAttachmentIndex = 43, - DecorationAlignment = 44, - DecorationMaxByteOffset = 45, - DecorationAlignmentId = 46, - DecorationMaxByteOffsetId = 47, - DecorationNoSignedWrap = 4469, - DecorationNoUnsignedWrap = 4470, - DecorationExplicitInterpAMD = 4999, - DecorationOverrideCoverageNV = 5248, - DecorationPassthroughNV = 5250, - DecorationViewportRelativeNV = 5252, - DecorationSecondaryViewportRelativeNV = 5256, - DecorationPerPrimitiveNV = 5271, - DecorationPerViewNV = 5272, - DecorationPerTaskNV = 5273, - DecorationPerVertexNV = 5285, - DecorationNonUniform = 5300, - DecorationNonUniformEXT = 5300, - DecorationRestrictPointer = 5355, - DecorationRestrictPointerEXT = 5355, - DecorationAliasedPointer = 5356, - DecorationAliasedPointerEXT = 5356, - DecorationSIMTCallINTEL = 5599, - DecorationReferencedIndirectlyINTEL = 5602, - DecorationClobberINTEL = 5607, - DecorationSideEffectsINTEL = 5608, - DecorationVectorComputeVariableINTEL = 5624, - DecorationFuncParamIOKindINTEL = 5625, - DecorationVectorComputeFunctionINTEL = 5626, - DecorationStackCallINTEL = 5627, - DecorationGlobalVariableOffsetINTEL = 5628, - DecorationCounterBuffer = 5634, - DecorationHlslCounterBufferGOOGLE = 5634, - DecorationHlslSemanticGOOGLE = 5635, - DecorationUserSemantic = 5635, - DecorationUserTypeGOOGLE = 5636, - DecorationFunctionRoundingModeINTEL = 5822, - DecorationFunctionDenormModeINTEL = 5823, - DecorationRegisterINTEL = 5825, - DecorationMemoryINTEL = 5826, - DecorationNumbanksINTEL = 5827, - DecorationBankwidthINTEL = 5828, - DecorationMaxPrivateCopiesINTEL = 5829, - DecorationSinglepumpINTEL = 5830, - DecorationDoublepumpINTEL = 5831, - DecorationMaxReplicatesINTEL = 5832, - DecorationSimpleDualPortINTEL = 5833, - DecorationMergeINTEL = 5834, - DecorationBankBitsINTEL = 5835, - DecorationForcePow2DepthINTEL = 5836, - DecorationBurstCoalesceINTEL = 5899, - DecorationCacheSizeINTEL = 5900, - DecorationDontStaticallyCoalesceINTEL = 5901, - DecorationPrefetchINTEL = 5902, - DecorationStallEnableINTEL = 5905, - DecorationFuseLoopsInFunctionINTEL = 5907, - DecorationBufferLocationINTEL = 5921, - DecorationIOPipeStorageINTEL = 5944, - DecorationFunctionFloatingPointModeINTEL = 6080, - DecorationSingleElementVectorINTEL = 6085, - DecorationVectorComputeCallableFunctionINTEL = 6087, - DecorationMax = 0x7fffffff, -}; - -enum BuiltIn { - BuiltInPosition = 0, - BuiltInPointSize = 1, - BuiltInClipDistance = 3, - BuiltInCullDistance = 4, - BuiltInVertexId = 5, - BuiltInInstanceId = 6, - BuiltInPrimitiveId = 7, - BuiltInInvocationId = 8, - BuiltInLayer = 9, - BuiltInViewportIndex = 10, - BuiltInTessLevelOuter = 11, - BuiltInTessLevelInner = 12, - BuiltInTessCoord = 13, - BuiltInPatchVertices = 14, - BuiltInFragCoord = 15, - BuiltInPointCoord = 16, - BuiltInFrontFacing = 17, - BuiltInSampleId = 18, - BuiltInSamplePosition = 19, - BuiltInSampleMask = 20, - BuiltInFragDepth = 22, - BuiltInHelperInvocation = 23, - BuiltInNumWorkgroups = 24, - BuiltInWorkgroupSize = 25, - BuiltInWorkgroupId = 26, - BuiltInLocalInvocationId = 27, - BuiltInGlobalInvocationId = 28, - BuiltInLocalInvocationIndex = 29, - BuiltInWorkDim = 30, - BuiltInGlobalSize = 31, - BuiltInEnqueuedWorkgroupSize = 32, - BuiltInGlobalOffset = 33, - BuiltInGlobalLinearId = 34, - BuiltInSubgroupSize = 36, - BuiltInSubgroupMaxSize = 37, - BuiltInNumSubgroups = 38, - BuiltInNumEnqueuedSubgroups = 39, - BuiltInSubgroupId = 40, - BuiltInSubgroupLocalInvocationId = 41, - BuiltInVertexIndex = 42, - BuiltInInstanceIndex = 43, - BuiltInSubgroupEqMask = 4416, - BuiltInSubgroupEqMaskKHR = 4416, - BuiltInSubgroupGeMask = 4417, - BuiltInSubgroupGeMaskKHR = 4417, - BuiltInSubgroupGtMask = 4418, - BuiltInSubgroupGtMaskKHR = 4418, - BuiltInSubgroupLeMask = 4419, - BuiltInSubgroupLeMaskKHR = 4419, - BuiltInSubgroupLtMask = 4420, - BuiltInSubgroupLtMaskKHR = 4420, - BuiltInBaseVertex = 4424, - BuiltInBaseInstance = 4425, - BuiltInDrawIndex = 4426, - BuiltInPrimitiveShadingRateKHR = 4432, - BuiltInDeviceIndex = 4438, - BuiltInViewIndex = 4440, - BuiltInShadingRateKHR = 4444, - BuiltInBaryCoordNoPerspAMD = 4992, - BuiltInBaryCoordNoPerspCentroidAMD = 4993, - BuiltInBaryCoordNoPerspSampleAMD = 4994, - BuiltInBaryCoordSmoothAMD = 4995, - BuiltInBaryCoordSmoothCentroidAMD = 4996, - BuiltInBaryCoordSmoothSampleAMD = 4997, - BuiltInBaryCoordPullModelAMD = 4998, - BuiltInFragStencilRefEXT = 5014, - BuiltInViewportMaskNV = 5253, - BuiltInSecondaryPositionNV = 5257, - BuiltInSecondaryViewportMaskNV = 5258, - BuiltInPositionPerViewNV = 5261, - BuiltInViewportMaskPerViewNV = 5262, - BuiltInFullyCoveredEXT = 5264, - BuiltInTaskCountNV = 5274, - BuiltInPrimitiveCountNV = 5275, - BuiltInPrimitiveIndicesNV = 5276, - BuiltInClipDistancePerViewNV = 5277, - BuiltInCullDistancePerViewNV = 5278, - BuiltInLayerPerViewNV = 5279, - BuiltInMeshViewCountNV = 5280, - BuiltInMeshViewIndicesNV = 5281, - BuiltInBaryCoordNV = 5286, - BuiltInBaryCoordNoPerspNV = 5287, - BuiltInFragSizeEXT = 5292, - BuiltInFragmentSizeNV = 5292, - BuiltInFragInvocationCountEXT = 5293, - BuiltInInvocationsPerPixelNV = 5293, - BuiltInLaunchIdKHR = 5319, - BuiltInLaunchIdNV = 5319, - BuiltInLaunchSizeKHR = 5320, - BuiltInLaunchSizeNV = 5320, - BuiltInWorldRayOriginKHR = 5321, - BuiltInWorldRayOriginNV = 5321, - BuiltInWorldRayDirectionKHR = 5322, - BuiltInWorldRayDirectionNV = 5322, - BuiltInObjectRayOriginKHR = 5323, - BuiltInObjectRayOriginNV = 5323, - BuiltInObjectRayDirectionKHR = 5324, - BuiltInObjectRayDirectionNV = 5324, - BuiltInRayTminKHR = 5325, - BuiltInRayTminNV = 5325, - BuiltInRayTmaxKHR = 5326, - BuiltInRayTmaxNV = 5326, - BuiltInInstanceCustomIndexKHR = 5327, - BuiltInInstanceCustomIndexNV = 5327, - BuiltInObjectToWorldKHR = 5330, - BuiltInObjectToWorldNV = 5330, - BuiltInWorldToObjectKHR = 5331, - BuiltInWorldToObjectNV = 5331, - BuiltInHitTNV = 5332, - BuiltInHitKindKHR = 5333, - BuiltInHitKindNV = 5333, - BuiltInCurrentRayTimeNV = 5334, - BuiltInIncomingRayFlagsKHR = 5351, - BuiltInIncomingRayFlagsNV = 5351, - BuiltInRayGeometryIndexKHR = 5352, - BuiltInWarpsPerSMNV = 5374, - BuiltInSMCountNV = 5375, - BuiltInWarpIDNV = 5376, - BuiltInSMIDNV = 5377, - BuiltInMax = 0x7fffffff, -}; - -enum SelectionControlShift { - SelectionControlFlattenShift = 0, - SelectionControlDontFlattenShift = 1, - SelectionControlMax = 0x7fffffff, -}; - -enum SelectionControlMask { - SelectionControlMaskNone = 0, - SelectionControlFlattenMask = 0x00000001, - SelectionControlDontFlattenMask = 0x00000002, -}; - -enum LoopControlShift { - LoopControlUnrollShift = 0, - LoopControlDontUnrollShift = 1, - LoopControlDependencyInfiniteShift = 2, - LoopControlDependencyLengthShift = 3, - LoopControlMinIterationsShift = 4, - LoopControlMaxIterationsShift = 5, - LoopControlIterationMultipleShift = 6, - LoopControlPeelCountShift = 7, - LoopControlPartialCountShift = 8, - LoopControlInitiationIntervalINTELShift = 16, - LoopControlMaxConcurrencyINTELShift = 17, - LoopControlDependencyArrayINTELShift = 18, - LoopControlPipelineEnableINTELShift = 19, - LoopControlLoopCoalesceINTELShift = 20, - LoopControlMaxInterleavingINTELShift = 21, - LoopControlSpeculatedIterationsINTELShift = 22, - LoopControlNoFusionINTELShift = 23, - LoopControlMax = 0x7fffffff, -}; - -enum LoopControlMask { - LoopControlMaskNone = 0, - LoopControlUnrollMask = 0x00000001, - LoopControlDontUnrollMask = 0x00000002, - LoopControlDependencyInfiniteMask = 0x00000004, - LoopControlDependencyLengthMask = 0x00000008, - LoopControlMinIterationsMask = 0x00000010, - LoopControlMaxIterationsMask = 0x00000020, - LoopControlIterationMultipleMask = 0x00000040, - LoopControlPeelCountMask = 0x00000080, - LoopControlPartialCountMask = 0x00000100, - LoopControlInitiationIntervalINTELMask = 0x00010000, - LoopControlMaxConcurrencyINTELMask = 0x00020000, - LoopControlDependencyArrayINTELMask = 0x00040000, - LoopControlPipelineEnableINTELMask = 0x00080000, - LoopControlLoopCoalesceINTELMask = 0x00100000, - LoopControlMaxInterleavingINTELMask = 0x00200000, - LoopControlSpeculatedIterationsINTELMask = 0x00400000, - LoopControlNoFusionINTELMask = 0x00800000, -}; - -enum FunctionControlShift { - FunctionControlInlineShift = 0, - FunctionControlDontInlineShift = 1, - FunctionControlPureShift = 2, - FunctionControlConstShift = 3, - FunctionControlOptNoneINTELShift = 16, - FunctionControlMax = 0x7fffffff, -}; - -enum FunctionControlMask { - FunctionControlMaskNone = 0, - FunctionControlInlineMask = 0x00000001, - FunctionControlDontInlineMask = 0x00000002, - FunctionControlPureMask = 0x00000004, - FunctionControlConstMask = 0x00000008, - FunctionControlOptNoneINTELMask = 0x00010000, -}; - -enum MemorySemanticsShift { - MemorySemanticsAcquireShift = 1, - MemorySemanticsReleaseShift = 2, - MemorySemanticsAcquireReleaseShift = 3, - MemorySemanticsSequentiallyConsistentShift = 4, - MemorySemanticsUniformMemoryShift = 6, - MemorySemanticsSubgroupMemoryShift = 7, - MemorySemanticsWorkgroupMemoryShift = 8, - MemorySemanticsCrossWorkgroupMemoryShift = 9, - MemorySemanticsAtomicCounterMemoryShift = 10, - MemorySemanticsImageMemoryShift = 11, - MemorySemanticsOutputMemoryShift = 12, - MemorySemanticsOutputMemoryKHRShift = 12, - MemorySemanticsMakeAvailableShift = 13, - MemorySemanticsMakeAvailableKHRShift = 13, - MemorySemanticsMakeVisibleShift = 14, - MemorySemanticsMakeVisibleKHRShift = 14, - MemorySemanticsVolatileShift = 15, - MemorySemanticsMax = 0x7fffffff, -}; - -enum MemorySemanticsMask { - MemorySemanticsMaskNone = 0, - MemorySemanticsAcquireMask = 0x00000002, - MemorySemanticsReleaseMask = 0x00000004, - MemorySemanticsAcquireReleaseMask = 0x00000008, - MemorySemanticsSequentiallyConsistentMask = 0x00000010, - MemorySemanticsUniformMemoryMask = 0x00000040, - MemorySemanticsSubgroupMemoryMask = 0x00000080, - MemorySemanticsWorkgroupMemoryMask = 0x00000100, - MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, - MemorySemanticsAtomicCounterMemoryMask = 0x00000400, - MemorySemanticsImageMemoryMask = 0x00000800, - MemorySemanticsOutputMemoryMask = 0x00001000, - MemorySemanticsOutputMemoryKHRMask = 0x00001000, - MemorySemanticsMakeAvailableMask = 0x00002000, - MemorySemanticsMakeAvailableKHRMask = 0x00002000, - MemorySemanticsMakeVisibleMask = 0x00004000, - MemorySemanticsMakeVisibleKHRMask = 0x00004000, - MemorySemanticsVolatileMask = 0x00008000, -}; - -enum MemoryAccessShift { - MemoryAccessVolatileShift = 0, - MemoryAccessAlignedShift = 1, - MemoryAccessNontemporalShift = 2, - MemoryAccessMakePointerAvailableShift = 3, - MemoryAccessMakePointerAvailableKHRShift = 3, - MemoryAccessMakePointerVisibleShift = 4, - MemoryAccessMakePointerVisibleKHRShift = 4, - MemoryAccessNonPrivatePointerShift = 5, - MemoryAccessNonPrivatePointerKHRShift = 5, - MemoryAccessMax = 0x7fffffff, -}; - -enum MemoryAccessMask { - MemoryAccessMaskNone = 0, - MemoryAccessVolatileMask = 0x00000001, - MemoryAccessAlignedMask = 0x00000002, - MemoryAccessNontemporalMask = 0x00000004, - MemoryAccessMakePointerAvailableMask = 0x00000008, - MemoryAccessMakePointerAvailableKHRMask = 0x00000008, - MemoryAccessMakePointerVisibleMask = 0x00000010, - MemoryAccessMakePointerVisibleKHRMask = 0x00000010, - MemoryAccessNonPrivatePointerMask = 0x00000020, - MemoryAccessNonPrivatePointerKHRMask = 0x00000020, -}; - -enum Scope { - ScopeCrossDevice = 0, - ScopeDevice = 1, - ScopeWorkgroup = 2, - ScopeSubgroup = 3, - ScopeInvocation = 4, - ScopeQueueFamily = 5, - ScopeQueueFamilyKHR = 5, - ScopeShaderCallKHR = 6, - ScopeMax = 0x7fffffff, -}; - -enum GroupOperation { - GroupOperationReduce = 0, - GroupOperationInclusiveScan = 1, - GroupOperationExclusiveScan = 2, - GroupOperationClusteredReduce = 3, - GroupOperationPartitionedReduceNV = 6, - GroupOperationPartitionedInclusiveScanNV = 7, - GroupOperationPartitionedExclusiveScanNV = 8, - GroupOperationMax = 0x7fffffff, -}; - -enum KernelEnqueueFlags { - KernelEnqueueFlagsNoWait = 0, - KernelEnqueueFlagsWaitKernel = 1, - KernelEnqueueFlagsWaitWorkGroup = 2, - KernelEnqueueFlagsMax = 0x7fffffff, -}; - -enum KernelProfilingInfoShift { - KernelProfilingInfoCmdExecTimeShift = 0, - KernelProfilingInfoMax = 0x7fffffff, -}; - -enum KernelProfilingInfoMask { - KernelProfilingInfoMaskNone = 0, - KernelProfilingInfoCmdExecTimeMask = 0x00000001, -}; - -enum Capability { - CapabilityMatrix = 0, - CapabilityShader = 1, - CapabilityGeometry = 2, - CapabilityTessellation = 3, - CapabilityAddresses = 4, - CapabilityLinkage = 5, - CapabilityKernel = 6, - CapabilityVector16 = 7, - CapabilityFloat16Buffer = 8, - CapabilityFloat16 = 9, - CapabilityFloat64 = 10, - CapabilityInt64 = 11, - CapabilityInt64Atomics = 12, - CapabilityImageBasic = 13, - CapabilityImageReadWrite = 14, - CapabilityImageMipmap = 15, - CapabilityPipes = 17, - CapabilityGroups = 18, - CapabilityDeviceEnqueue = 19, - CapabilityLiteralSampler = 20, - CapabilityAtomicStorage = 21, - CapabilityInt16 = 22, - CapabilityTessellationPointSize = 23, - CapabilityGeometryPointSize = 24, - CapabilityImageGatherExtended = 25, - CapabilityStorageImageMultisample = 27, - CapabilityUniformBufferArrayDynamicIndexing = 28, - CapabilitySampledImageArrayDynamicIndexing = 29, - CapabilityStorageBufferArrayDynamicIndexing = 30, - CapabilityStorageImageArrayDynamicIndexing = 31, - CapabilityClipDistance = 32, - CapabilityCullDistance = 33, - CapabilityImageCubeArray = 34, - CapabilitySampleRateShading = 35, - CapabilityImageRect = 36, - CapabilitySampledRect = 37, - CapabilityGenericPointer = 38, - CapabilityInt8 = 39, - CapabilityInputAttachment = 40, - CapabilitySparseResidency = 41, - CapabilityMinLod = 42, - CapabilitySampled1D = 43, - CapabilityImage1D = 44, - CapabilitySampledCubeArray = 45, - CapabilitySampledBuffer = 46, - CapabilityImageBuffer = 47, - CapabilityImageMSArray = 48, - CapabilityStorageImageExtendedFormats = 49, - CapabilityImageQuery = 50, - CapabilityDerivativeControl = 51, - CapabilityInterpolationFunction = 52, - CapabilityTransformFeedback = 53, - CapabilityGeometryStreams = 54, - CapabilityStorageImageReadWithoutFormat = 55, - CapabilityStorageImageWriteWithoutFormat = 56, - CapabilityMultiViewport = 57, - CapabilitySubgroupDispatch = 58, - CapabilityNamedBarrier = 59, - CapabilityPipeStorage = 60, - CapabilityGroupNonUniform = 61, - CapabilityGroupNonUniformVote = 62, - CapabilityGroupNonUniformArithmetic = 63, - CapabilityGroupNonUniformBallot = 64, - CapabilityGroupNonUniformShuffle = 65, - CapabilityGroupNonUniformShuffleRelative = 66, - CapabilityGroupNonUniformClustered = 67, - CapabilityGroupNonUniformQuad = 68, - CapabilityShaderLayer = 69, - CapabilityShaderViewportIndex = 70, - CapabilityFragmentShadingRateKHR = 4422, - CapabilitySubgroupBallotKHR = 4423, - CapabilityDrawParameters = 4427, - CapabilityWorkgroupMemoryExplicitLayoutKHR = 4428, - CapabilityWorkgroupMemoryExplicitLayout8BitAccessKHR = 4429, - CapabilityWorkgroupMemoryExplicitLayout16BitAccessKHR = 4430, - CapabilitySubgroupVoteKHR = 4431, - CapabilityStorageBuffer16BitAccess = 4433, - CapabilityStorageUniformBufferBlock16 = 4433, - CapabilityStorageUniform16 = 4434, - CapabilityUniformAndStorageBuffer16BitAccess = 4434, - CapabilityStoragePushConstant16 = 4435, - CapabilityStorageInputOutput16 = 4436, - CapabilityDeviceGroup = 4437, - CapabilityMultiView = 4439, - CapabilityVariablePointersStorageBuffer = 4441, - CapabilityVariablePointers = 4442, - CapabilityAtomicStorageOps = 4445, - CapabilitySampleMaskPostDepthCoverage = 4447, - CapabilityStorageBuffer8BitAccess = 4448, - CapabilityUniformAndStorageBuffer8BitAccess = 4449, - CapabilityStoragePushConstant8 = 4450, - CapabilityDenormPreserve = 4464, - CapabilityDenormFlushToZero = 4465, - CapabilitySignedZeroInfNanPreserve = 4466, - CapabilityRoundingModeRTE = 4467, - CapabilityRoundingModeRTZ = 4468, - CapabilityRayQueryProvisionalKHR = 4471, - CapabilityRayQueryKHR = 4472, - CapabilityRayTraversalPrimitiveCullingKHR = 4478, - CapabilityRayTracingKHR = 4479, - CapabilityFloat16ImageAMD = 5008, - CapabilityImageGatherBiasLodAMD = 5009, - CapabilityFragmentMaskAMD = 5010, - CapabilityStencilExportEXT = 5013, - CapabilityImageReadWriteLodAMD = 5015, - CapabilityInt64ImageEXT = 5016, - CapabilityShaderClockKHR = 5055, - CapabilitySampleMaskOverrideCoverageNV = 5249, - CapabilityGeometryShaderPassthroughNV = 5251, - CapabilityShaderViewportIndexLayerEXT = 5254, - CapabilityShaderViewportIndexLayerNV = 5254, - CapabilityShaderViewportMaskNV = 5255, - CapabilityShaderStereoViewNV = 5259, - CapabilityPerViewAttributesNV = 5260, - CapabilityFragmentFullyCoveredEXT = 5265, - CapabilityMeshShadingNV = 5266, - CapabilityImageFootprintNV = 5282, - CapabilityFragmentBarycentricNV = 5284, - CapabilityComputeDerivativeGroupQuadsNV = 5288, - CapabilityFragmentDensityEXT = 5291, - CapabilityShadingRateNV = 5291, - CapabilityGroupNonUniformPartitionedNV = 5297, - CapabilityShaderNonUniform = 5301, - CapabilityShaderNonUniformEXT = 5301, - CapabilityRuntimeDescriptorArray = 5302, - CapabilityRuntimeDescriptorArrayEXT = 5302, - CapabilityInputAttachmentArrayDynamicIndexing = 5303, - CapabilityInputAttachmentArrayDynamicIndexingEXT = 5303, - CapabilityUniformTexelBufferArrayDynamicIndexing = 5304, - CapabilityUniformTexelBufferArrayDynamicIndexingEXT = 5304, - CapabilityStorageTexelBufferArrayDynamicIndexing = 5305, - CapabilityStorageTexelBufferArrayDynamicIndexingEXT = 5305, - CapabilityUniformBufferArrayNonUniformIndexing = 5306, - CapabilityUniformBufferArrayNonUniformIndexingEXT = 5306, - CapabilitySampledImageArrayNonUniformIndexing = 5307, - CapabilitySampledImageArrayNonUniformIndexingEXT = 5307, - CapabilityStorageBufferArrayNonUniformIndexing = 5308, - CapabilityStorageBufferArrayNonUniformIndexingEXT = 5308, - CapabilityStorageImageArrayNonUniformIndexing = 5309, - CapabilityStorageImageArrayNonUniformIndexingEXT = 5309, - CapabilityInputAttachmentArrayNonUniformIndexing = 5310, - CapabilityInputAttachmentArrayNonUniformIndexingEXT = 5310, - CapabilityUniformTexelBufferArrayNonUniformIndexing = 5311, - CapabilityUniformTexelBufferArrayNonUniformIndexingEXT = 5311, - CapabilityStorageTexelBufferArrayNonUniformIndexing = 5312, - CapabilityStorageTexelBufferArrayNonUniformIndexingEXT = 5312, - CapabilityRayTracingNV = 5340, - CapabilityRayTracingMotionBlurNV = 5341, - CapabilityVulkanMemoryModel = 5345, - CapabilityVulkanMemoryModelKHR = 5345, - CapabilityVulkanMemoryModelDeviceScope = 5346, - CapabilityVulkanMemoryModelDeviceScopeKHR = 5346, - CapabilityPhysicalStorageBufferAddresses = 5347, - CapabilityPhysicalStorageBufferAddressesEXT = 5347, - CapabilityComputeDerivativeGroupLinearNV = 5350, - CapabilityRayTracingProvisionalKHR = 5353, - CapabilityCooperativeMatrixNV = 5357, - CapabilityFragmentShaderSampleInterlockEXT = 5363, - CapabilityFragmentShaderShadingRateInterlockEXT = 5372, - CapabilityShaderSMBuiltinsNV = 5373, - CapabilityFragmentShaderPixelInterlockEXT = 5378, - CapabilityDemoteToHelperInvocationEXT = 5379, - CapabilitySubgroupShuffleINTEL = 5568, - CapabilitySubgroupBufferBlockIOINTEL = 5569, - CapabilitySubgroupImageBlockIOINTEL = 5570, - CapabilitySubgroupImageMediaBlockIOINTEL = 5579, - CapabilityRoundToInfinityINTEL = 5582, - CapabilityFloatingPointModeINTEL = 5583, - CapabilityIntegerFunctions2INTEL = 5584, - CapabilityFunctionPointersINTEL = 5603, - CapabilityIndirectReferencesINTEL = 5604, - CapabilityAsmINTEL = 5606, - CapabilityAtomicFloat32MinMaxEXT = 5612, - CapabilityAtomicFloat64MinMaxEXT = 5613, - CapabilityAtomicFloat16MinMaxEXT = 5616, - CapabilityVectorComputeINTEL = 5617, - CapabilityVectorAnyINTEL = 5619, - CapabilityExpectAssumeKHR = 5629, - CapabilitySubgroupAvcMotionEstimationINTEL = 5696, - CapabilitySubgroupAvcMotionEstimationIntraINTEL = 5697, - CapabilitySubgroupAvcMotionEstimationChromaINTEL = 5698, - CapabilityVariableLengthArrayINTEL = 5817, - CapabilityFunctionFloatControlINTEL = 5821, - CapabilityFPGAMemoryAttributesINTEL = 5824, - CapabilityFPFastMathModeINTEL = 5837, - CapabilityArbitraryPrecisionIntegersINTEL = 5844, - CapabilityArbitraryPrecisionFloatingPointINTEL = 5845, - CapabilityUnstructuredLoopControlsINTEL = 5886, - CapabilityFPGALoopControlsINTEL = 5888, - CapabilityKernelAttributesINTEL = 5892, - CapabilityFPGAKernelAttributesINTEL = 5897, - CapabilityFPGAMemoryAccessesINTEL = 5898, - CapabilityFPGAClusterAttributesINTEL = 5904, - CapabilityLoopFuseINTEL = 5906, - CapabilityFPGABufferLocationINTEL = 5920, - CapabilityArbitraryPrecisionFixedPointINTEL = 5922, - CapabilityUSMStorageClassesINTEL = 5935, - CapabilityIOPipesINTEL = 5943, - CapabilityBlockingPipesINTEL = 5945, - CapabilityFPGARegINTEL = 5948, - CapabilityDotProductInputAllKHR = 6016, - CapabilityDotProductInput4x8BitKHR = 6017, - CapabilityDotProductInput4x8BitPackedKHR = 6018, - CapabilityDotProductKHR = 6019, - CapabilityBitInstructions = 6025, - CapabilityAtomicFloat32AddEXT = 6033, - CapabilityAtomicFloat64AddEXT = 6034, - CapabilityLongConstantCompositeINTEL = 6089, - CapabilityOptNoneINTEL = 6094, - CapabilityAtomicFloat16AddEXT = 6095, - CapabilityDebugInfoModuleINTEL = 6114, - CapabilityMax = 0x7fffffff, -}; - -enum RayFlagsShift { - RayFlagsOpaqueKHRShift = 0, - RayFlagsNoOpaqueKHRShift = 1, - RayFlagsTerminateOnFirstHitKHRShift = 2, - RayFlagsSkipClosestHitShaderKHRShift = 3, - RayFlagsCullBackFacingTrianglesKHRShift = 4, - RayFlagsCullFrontFacingTrianglesKHRShift = 5, - RayFlagsCullOpaqueKHRShift = 6, - RayFlagsCullNoOpaqueKHRShift = 7, - RayFlagsSkipTrianglesKHRShift = 8, - RayFlagsSkipAABBsKHRShift = 9, - RayFlagsMax = 0x7fffffff, -}; - -enum RayFlagsMask { - RayFlagsMaskNone = 0, - RayFlagsOpaqueKHRMask = 0x00000001, - RayFlagsNoOpaqueKHRMask = 0x00000002, - RayFlagsTerminateOnFirstHitKHRMask = 0x00000004, - RayFlagsSkipClosestHitShaderKHRMask = 0x00000008, - RayFlagsCullBackFacingTrianglesKHRMask = 0x00000010, - RayFlagsCullFrontFacingTrianglesKHRMask = 0x00000020, - RayFlagsCullOpaqueKHRMask = 0x00000040, - RayFlagsCullNoOpaqueKHRMask = 0x00000080, - RayFlagsSkipTrianglesKHRMask = 0x00000100, - RayFlagsSkipAABBsKHRMask = 0x00000200, -}; - -enum RayQueryIntersection { - RayQueryIntersectionRayQueryCandidateIntersectionKHR = 0, - RayQueryIntersectionRayQueryCommittedIntersectionKHR = 1, - RayQueryIntersectionMax = 0x7fffffff, -}; - -enum RayQueryCommittedIntersectionType { - RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionNoneKHR = 0, - RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionTriangleKHR = 1, - RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionGeneratedKHR = 2, - RayQueryCommittedIntersectionTypeMax = 0x7fffffff, -}; - -enum RayQueryCandidateIntersectionType { - RayQueryCandidateIntersectionTypeRayQueryCandidateIntersectionTriangleKHR = 0, - RayQueryCandidateIntersectionTypeRayQueryCandidateIntersectionAABBKHR = 1, - RayQueryCandidateIntersectionTypeMax = 0x7fffffff, -}; - -enum FragmentShadingRateShift { - FragmentShadingRateVertical2PixelsShift = 0, - FragmentShadingRateVertical4PixelsShift = 1, - FragmentShadingRateHorizontal2PixelsShift = 2, - FragmentShadingRateHorizontal4PixelsShift = 3, - FragmentShadingRateMax = 0x7fffffff, -}; - -enum FragmentShadingRateMask { - FragmentShadingRateMaskNone = 0, - FragmentShadingRateVertical2PixelsMask = 0x00000001, - FragmentShadingRateVertical4PixelsMask = 0x00000002, - FragmentShadingRateHorizontal2PixelsMask = 0x00000004, - FragmentShadingRateHorizontal4PixelsMask = 0x00000008, -}; - -enum FPDenormMode { - FPDenormModePreserve = 0, - FPDenormModeFlushToZero = 1, - FPDenormModeMax = 0x7fffffff, -}; - -enum FPOperationMode { - FPOperationModeIEEE = 0, - FPOperationModeALT = 1, - FPOperationModeMax = 0x7fffffff, -}; - -enum QuantizationModes { - QuantizationModesTRN = 0, - QuantizationModesTRN_ZERO = 1, - QuantizationModesRND = 2, - QuantizationModesRND_ZERO = 3, - QuantizationModesRND_INF = 4, - QuantizationModesRND_MIN_INF = 5, - QuantizationModesRND_CONV = 6, - QuantizationModesRND_CONV_ODD = 7, - QuantizationModesMax = 0x7fffffff, -}; - -enum OverflowModes { - OverflowModesWRAP = 0, - OverflowModesSAT = 1, - OverflowModesSAT_ZERO = 2, - OverflowModesSAT_SYM = 3, - OverflowModesMax = 0x7fffffff, -}; - -enum PackedVectorFormat { - PackedVectorFormatPackedVectorFormat4x8BitKHR = 0, - PackedVectorFormatMax = 0x7fffffff, -}; - -enum Op { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, - OpImageSparseRead = 320, - OpSizeOf = 321, - OpTypePipeStorage = 322, - OpConstantPipeStorage = 323, - OpCreatePipeFromPipeStorage = 324, - OpGetKernelLocalSizeForSubgroupCount = 325, - OpGetKernelMaxNumSubgroups = 326, - OpTypeNamedBarrier = 327, - OpNamedBarrierInitialize = 328, - OpMemoryNamedBarrier = 329, - OpModuleProcessed = 330, - OpExecutionModeId = 331, - OpDecorateId = 332, - OpGroupNonUniformElect = 333, - OpGroupNonUniformAll = 334, - OpGroupNonUniformAny = 335, - OpGroupNonUniformAllEqual = 336, - OpGroupNonUniformBroadcast = 337, - OpGroupNonUniformBroadcastFirst = 338, - OpGroupNonUniformBallot = 339, - OpGroupNonUniformInverseBallot = 340, - OpGroupNonUniformBallotBitExtract = 341, - OpGroupNonUniformBallotBitCount = 342, - OpGroupNonUniformBallotFindLSB = 343, - OpGroupNonUniformBallotFindMSB = 344, - OpGroupNonUniformShuffle = 345, - OpGroupNonUniformShuffleXor = 346, - OpGroupNonUniformShuffleUp = 347, - OpGroupNonUniformShuffleDown = 348, - OpGroupNonUniformIAdd = 349, - OpGroupNonUniformFAdd = 350, - OpGroupNonUniformIMul = 351, - OpGroupNonUniformFMul = 352, - OpGroupNonUniformSMin = 353, - OpGroupNonUniformUMin = 354, - OpGroupNonUniformFMin = 355, - OpGroupNonUniformSMax = 356, - OpGroupNonUniformUMax = 357, - OpGroupNonUniformFMax = 358, - OpGroupNonUniformBitwiseAnd = 359, - OpGroupNonUniformBitwiseOr = 360, - OpGroupNonUniformBitwiseXor = 361, - OpGroupNonUniformLogicalAnd = 362, - OpGroupNonUniformLogicalOr = 363, - OpGroupNonUniformLogicalXor = 364, - OpGroupNonUniformQuadBroadcast = 365, - OpGroupNonUniformQuadSwap = 366, - OpCopyLogical = 400, - OpPtrEqual = 401, - OpPtrNotEqual = 402, - OpPtrDiff = 403, - OpTerminateInvocation = 4416, - OpSubgroupBallotKHR = 4421, - OpSubgroupFirstInvocationKHR = 4422, - OpSubgroupAllKHR = 4428, - OpSubgroupAnyKHR = 4429, - OpSubgroupAllEqualKHR = 4430, - OpSubgroupReadInvocationKHR = 4432, - OpTraceRayKHR = 4445, - OpExecuteCallableKHR = 4446, - OpConvertUToAccelerationStructureKHR = 4447, - OpIgnoreIntersectionKHR = 4448, - OpTerminateRayKHR = 4449, - OpSDotKHR = 4450, - OpUDotKHR = 4451, - OpSUDotKHR = 4452, - OpSDotAccSatKHR = 4453, - OpUDotAccSatKHR = 4454, - OpSUDotAccSatKHR = 4455, - OpTypeRayQueryKHR = 4472, - OpRayQueryInitializeKHR = 4473, - OpRayQueryTerminateKHR = 4474, - OpRayQueryGenerateIntersectionKHR = 4475, - OpRayQueryConfirmIntersectionKHR = 4476, - OpRayQueryProceedKHR = 4477, - OpRayQueryGetIntersectionTypeKHR = 4479, - OpGroupIAddNonUniformAMD = 5000, - OpGroupFAddNonUniformAMD = 5001, - OpGroupFMinNonUniformAMD = 5002, - OpGroupUMinNonUniformAMD = 5003, - OpGroupSMinNonUniformAMD = 5004, - OpGroupFMaxNonUniformAMD = 5005, - OpGroupUMaxNonUniformAMD = 5006, - OpGroupSMaxNonUniformAMD = 5007, - OpFragmentMaskFetchAMD = 5011, - OpFragmentFetchAMD = 5012, - OpReadClockKHR = 5056, - OpImageSampleFootprintNV = 5283, - OpGroupNonUniformPartitionNV = 5296, - OpWritePackedPrimitiveIndices4x8NV = 5299, - OpReportIntersectionKHR = 5334, - OpReportIntersectionNV = 5334, - OpIgnoreIntersectionNV = 5335, - OpTerminateRayNV = 5336, - OpTraceNV = 5337, - OpTraceMotionNV = 5338, - OpTraceRayMotionNV = 5339, - OpTypeAccelerationStructureKHR = 5341, - OpTypeAccelerationStructureNV = 5341, - OpExecuteCallableNV = 5344, - OpTypeCooperativeMatrixNV = 5358, - OpCooperativeMatrixLoadNV = 5359, - OpCooperativeMatrixStoreNV = 5360, - OpCooperativeMatrixMulAddNV = 5361, - OpCooperativeMatrixLengthNV = 5362, - OpBeginInvocationInterlockEXT = 5364, - OpEndInvocationInterlockEXT = 5365, - OpDemoteToHelperInvocationEXT = 5380, - OpIsHelperInvocationEXT = 5381, - OpSubgroupShuffleINTEL = 5571, - OpSubgroupShuffleDownINTEL = 5572, - OpSubgroupShuffleUpINTEL = 5573, - OpSubgroupShuffleXorINTEL = 5574, - OpSubgroupBlockReadINTEL = 5575, - OpSubgroupBlockWriteINTEL = 5576, - OpSubgroupImageBlockReadINTEL = 5577, - OpSubgroupImageBlockWriteINTEL = 5578, - OpSubgroupImageMediaBlockReadINTEL = 5580, - OpSubgroupImageMediaBlockWriteINTEL = 5581, - OpUCountLeadingZerosINTEL = 5585, - OpUCountTrailingZerosINTEL = 5586, - OpAbsISubINTEL = 5587, - OpAbsUSubINTEL = 5588, - OpIAddSatINTEL = 5589, - OpUAddSatINTEL = 5590, - OpIAverageINTEL = 5591, - OpUAverageINTEL = 5592, - OpIAverageRoundedINTEL = 5593, - OpUAverageRoundedINTEL = 5594, - OpISubSatINTEL = 5595, - OpUSubSatINTEL = 5596, - OpIMul32x16INTEL = 5597, - OpUMul32x16INTEL = 5598, - OpConstFunctionPointerINTEL = 5600, - OpFunctionPointerCallINTEL = 5601, - OpAsmTargetINTEL = 5609, - OpAsmINTEL = 5610, - OpAsmCallINTEL = 5611, - OpAtomicFMinEXT = 5614, - OpAtomicFMaxEXT = 5615, - OpAssumeTrueKHR = 5630, - OpExpectKHR = 5631, - OpDecorateString = 5632, - OpDecorateStringGOOGLE = 5632, - OpMemberDecorateString = 5633, - OpMemberDecorateStringGOOGLE = 5633, - OpVmeImageINTEL = 5699, - OpTypeVmeImageINTEL = 5700, - OpTypeAvcImePayloadINTEL = 5701, - OpTypeAvcRefPayloadINTEL = 5702, - OpTypeAvcSicPayloadINTEL = 5703, - OpTypeAvcMcePayloadINTEL = 5704, - OpTypeAvcMceResultINTEL = 5705, - OpTypeAvcImeResultINTEL = 5706, - OpTypeAvcImeResultSingleReferenceStreamoutINTEL = 5707, - OpTypeAvcImeResultDualReferenceStreamoutINTEL = 5708, - OpTypeAvcImeSingleReferenceStreaminINTEL = 5709, - OpTypeAvcImeDualReferenceStreaminINTEL = 5710, - OpTypeAvcRefResultINTEL = 5711, - OpTypeAvcSicResultINTEL = 5712, - OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL = 5713, - OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL = 5714, - OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL = 5715, - OpSubgroupAvcMceSetInterShapePenaltyINTEL = 5716, - OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL = 5717, - OpSubgroupAvcMceSetInterDirectionPenaltyINTEL = 5718, - OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL = 5719, - OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL = 5720, - OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL = 5721, - OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL = 5722, - OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL = 5723, - OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL = 5724, - OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL = 5725, - OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL = 5726, - OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL = 5727, - OpSubgroupAvcMceSetAcOnlyHaarINTEL = 5728, - OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL = 5729, - OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL = 5730, - OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL = 5731, - OpSubgroupAvcMceConvertToImePayloadINTEL = 5732, - OpSubgroupAvcMceConvertToImeResultINTEL = 5733, - OpSubgroupAvcMceConvertToRefPayloadINTEL = 5734, - OpSubgroupAvcMceConvertToRefResultINTEL = 5735, - OpSubgroupAvcMceConvertToSicPayloadINTEL = 5736, - OpSubgroupAvcMceConvertToSicResultINTEL = 5737, - OpSubgroupAvcMceGetMotionVectorsINTEL = 5738, - OpSubgroupAvcMceGetInterDistortionsINTEL = 5739, - OpSubgroupAvcMceGetBestInterDistortionsINTEL = 5740, - OpSubgroupAvcMceGetInterMajorShapeINTEL = 5741, - OpSubgroupAvcMceGetInterMinorShapeINTEL = 5742, - OpSubgroupAvcMceGetInterDirectionsINTEL = 5743, - OpSubgroupAvcMceGetInterMotionVectorCountINTEL = 5744, - OpSubgroupAvcMceGetInterReferenceIdsINTEL = 5745, - OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL = 5746, - OpSubgroupAvcImeInitializeINTEL = 5747, - OpSubgroupAvcImeSetSingleReferenceINTEL = 5748, - OpSubgroupAvcImeSetDualReferenceINTEL = 5749, - OpSubgroupAvcImeRefWindowSizeINTEL = 5750, - OpSubgroupAvcImeAdjustRefOffsetINTEL = 5751, - OpSubgroupAvcImeConvertToMcePayloadINTEL = 5752, - OpSubgroupAvcImeSetMaxMotionVectorCountINTEL = 5753, - OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL = 5754, - OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL = 5755, - OpSubgroupAvcImeSetWeightedSadINTEL = 5756, - OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL = 5757, - OpSubgroupAvcImeEvaluateWithDualReferenceINTEL = 5758, - OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL = 5759, - OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL = 5760, - OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL = 5761, - OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL = 5762, - OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL = 5763, - OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL = 5764, - OpSubgroupAvcImeConvertToMceResultINTEL = 5765, - OpSubgroupAvcImeGetSingleReferenceStreaminINTEL = 5766, - OpSubgroupAvcImeGetDualReferenceStreaminINTEL = 5767, - OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL = 5768, - OpSubgroupAvcImeStripDualReferenceStreamoutINTEL = 5769, - OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL = 5770, - OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL = 5771, - OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL = 5772, - OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL = 5773, - OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL = 5774, - OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL = 5775, - OpSubgroupAvcImeGetBorderReachedINTEL = 5776, - OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL = 5777, - OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL = 5778, - OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL = 5779, - OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL = 5780, - OpSubgroupAvcFmeInitializeINTEL = 5781, - OpSubgroupAvcBmeInitializeINTEL = 5782, - OpSubgroupAvcRefConvertToMcePayloadINTEL = 5783, - OpSubgroupAvcRefSetBidirectionalMixDisableINTEL = 5784, - OpSubgroupAvcRefSetBilinearFilterEnableINTEL = 5785, - OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL = 5786, - OpSubgroupAvcRefEvaluateWithDualReferenceINTEL = 5787, - OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL = 5788, - OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL = 5789, - OpSubgroupAvcRefConvertToMceResultINTEL = 5790, - OpSubgroupAvcSicInitializeINTEL = 5791, - OpSubgroupAvcSicConfigureSkcINTEL = 5792, - OpSubgroupAvcSicConfigureIpeLumaINTEL = 5793, - OpSubgroupAvcSicConfigureIpeLumaChromaINTEL = 5794, - OpSubgroupAvcSicGetMotionVectorMaskINTEL = 5795, - OpSubgroupAvcSicConvertToMcePayloadINTEL = 5796, - OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL = 5797, - OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL = 5798, - OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL = 5799, - OpSubgroupAvcSicSetBilinearFilterEnableINTEL = 5800, - OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL = 5801, - OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL = 5802, - OpSubgroupAvcSicEvaluateIpeINTEL = 5803, - OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL = 5804, - OpSubgroupAvcSicEvaluateWithDualReferenceINTEL = 5805, - OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL = 5806, - OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL = 5807, - OpSubgroupAvcSicConvertToMceResultINTEL = 5808, - OpSubgroupAvcSicGetIpeLumaShapeINTEL = 5809, - OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL = 5810, - OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL = 5811, - OpSubgroupAvcSicGetPackedIpeLumaModesINTEL = 5812, - OpSubgroupAvcSicGetIpeChromaModeINTEL = 5813, - OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL = 5814, - OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL = 5815, - OpSubgroupAvcSicGetInterRawSadsINTEL = 5816, - OpVariableLengthArrayINTEL = 5818, - OpSaveMemoryINTEL = 5819, - OpRestoreMemoryINTEL = 5820, - OpArbitraryFloatSinCosPiINTEL = 5840, - OpArbitraryFloatCastINTEL = 5841, - OpArbitraryFloatCastFromIntINTEL = 5842, - OpArbitraryFloatCastToIntINTEL = 5843, - OpArbitraryFloatAddINTEL = 5846, - OpArbitraryFloatSubINTEL = 5847, - OpArbitraryFloatMulINTEL = 5848, - OpArbitraryFloatDivINTEL = 5849, - OpArbitraryFloatGTINTEL = 5850, - OpArbitraryFloatGEINTEL = 5851, - OpArbitraryFloatLTINTEL = 5852, - OpArbitraryFloatLEINTEL = 5853, - OpArbitraryFloatEQINTEL = 5854, - OpArbitraryFloatRecipINTEL = 5855, - OpArbitraryFloatRSqrtINTEL = 5856, - OpArbitraryFloatCbrtINTEL = 5857, - OpArbitraryFloatHypotINTEL = 5858, - OpArbitraryFloatSqrtINTEL = 5859, - OpArbitraryFloatLogINTEL = 5860, - OpArbitraryFloatLog2INTEL = 5861, - OpArbitraryFloatLog10INTEL = 5862, - OpArbitraryFloatLog1pINTEL = 5863, - OpArbitraryFloatExpINTEL = 5864, - OpArbitraryFloatExp2INTEL = 5865, - OpArbitraryFloatExp10INTEL = 5866, - OpArbitraryFloatExpm1INTEL = 5867, - OpArbitraryFloatSinINTEL = 5868, - OpArbitraryFloatCosINTEL = 5869, - OpArbitraryFloatSinCosINTEL = 5870, - OpArbitraryFloatSinPiINTEL = 5871, - OpArbitraryFloatCosPiINTEL = 5872, - OpArbitraryFloatASinINTEL = 5873, - OpArbitraryFloatASinPiINTEL = 5874, - OpArbitraryFloatACosINTEL = 5875, - OpArbitraryFloatACosPiINTEL = 5876, - OpArbitraryFloatATanINTEL = 5877, - OpArbitraryFloatATanPiINTEL = 5878, - OpArbitraryFloatATan2INTEL = 5879, - OpArbitraryFloatPowINTEL = 5880, - OpArbitraryFloatPowRINTEL = 5881, - OpArbitraryFloatPowNINTEL = 5882, - OpLoopControlINTEL = 5887, - OpFixedSqrtINTEL = 5923, - OpFixedRecipINTEL = 5924, - OpFixedRsqrtINTEL = 5925, - OpFixedSinINTEL = 5926, - OpFixedCosINTEL = 5927, - OpFixedSinCosINTEL = 5928, - OpFixedSinPiINTEL = 5929, - OpFixedCosPiINTEL = 5930, - OpFixedSinCosPiINTEL = 5931, - OpFixedLogINTEL = 5932, - OpFixedExpINTEL = 5933, - OpPtrCastToCrossWorkgroupINTEL = 5934, - OpCrossWorkgroupCastToPtrINTEL = 5938, - OpReadPipeBlockingINTEL = 5946, - OpWritePipeBlockingINTEL = 5947, - OpFPGARegINTEL = 5949, - OpRayQueryGetRayTMinKHR = 6016, - OpRayQueryGetRayFlagsKHR = 6017, - OpRayQueryGetIntersectionTKHR = 6018, - OpRayQueryGetIntersectionInstanceCustomIndexKHR = 6019, - OpRayQueryGetIntersectionInstanceIdKHR = 6020, - OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR = 6021, - OpRayQueryGetIntersectionGeometryIndexKHR = 6022, - OpRayQueryGetIntersectionPrimitiveIndexKHR = 6023, - OpRayQueryGetIntersectionBarycentricsKHR = 6024, - OpRayQueryGetIntersectionFrontFaceKHR = 6025, - OpRayQueryGetIntersectionCandidateAABBOpaqueKHR = 6026, - OpRayQueryGetIntersectionObjectRayDirectionKHR = 6027, - OpRayQueryGetIntersectionObjectRayOriginKHR = 6028, - OpRayQueryGetWorldRayDirectionKHR = 6029, - OpRayQueryGetWorldRayOriginKHR = 6030, - OpRayQueryGetIntersectionObjectToWorldKHR = 6031, - OpRayQueryGetIntersectionWorldToObjectKHR = 6032, - OpAtomicFAddEXT = 6035, - OpTypeBufferSurfaceINTEL = 6086, - OpTypeStructContinuedINTEL = 6090, - OpConstantCompositeContinuedINTEL = 6091, - OpSpecConstantCompositeContinuedINTEL = 6092, - OpMax = 0x7fffffff, -}; - -#ifdef SPV_ENABLE_UTILITY_CODE -inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { - *hasResult = *hasResultType = false; - switch (opcode) { - default: /* unknown opcode */ break; - case OpNop: *hasResult = false; *hasResultType = false; break; - case OpUndef: *hasResult = true; *hasResultType = true; break; - case OpSourceContinued: *hasResult = false; *hasResultType = false; break; - case OpSource: *hasResult = false; *hasResultType = false; break; - case OpSourceExtension: *hasResult = false; *hasResultType = false; break; - case OpName: *hasResult = false; *hasResultType = false; break; - case OpMemberName: *hasResult = false; *hasResultType = false; break; - case OpString: *hasResult = true; *hasResultType = false; break; - case OpLine: *hasResult = false; *hasResultType = false; break; - case OpExtension: *hasResult = false; *hasResultType = false; break; - case OpExtInstImport: *hasResult = true; *hasResultType = false; break; - case OpExtInst: *hasResult = true; *hasResultType = true; break; - case OpMemoryModel: *hasResult = false; *hasResultType = false; break; - case OpEntryPoint: *hasResult = false; *hasResultType = false; break; - case OpExecutionMode: *hasResult = false; *hasResultType = false; break; - case OpCapability: *hasResult = false; *hasResultType = false; break; - case OpTypeVoid: *hasResult = true; *hasResultType = false; break; - case OpTypeBool: *hasResult = true; *hasResultType = false; break; - case OpTypeInt: *hasResult = true; *hasResultType = false; break; - case OpTypeFloat: *hasResult = true; *hasResultType = false; break; - case OpTypeVector: *hasResult = true; *hasResultType = false; break; - case OpTypeMatrix: *hasResult = true; *hasResultType = false; break; - case OpTypeImage: *hasResult = true; *hasResultType = false; break; - case OpTypeSampler: *hasResult = true; *hasResultType = false; break; - case OpTypeSampledImage: *hasResult = true; *hasResultType = false; break; - case OpTypeArray: *hasResult = true; *hasResultType = false; break; - case OpTypeRuntimeArray: *hasResult = true; *hasResultType = false; break; - case OpTypeStruct: *hasResult = true; *hasResultType = false; break; - case OpTypeOpaque: *hasResult = true; *hasResultType = false; break; - case OpTypePointer: *hasResult = true; *hasResultType = false; break; - case OpTypeFunction: *hasResult = true; *hasResultType = false; break; - case OpTypeEvent: *hasResult = true; *hasResultType = false; break; - case OpTypeDeviceEvent: *hasResult = true; *hasResultType = false; break; - case OpTypeReserveId: *hasResult = true; *hasResultType = false; break; - case OpTypeQueue: *hasResult = true; *hasResultType = false; break; - case OpTypePipe: *hasResult = true; *hasResultType = false; break; - case OpTypeForwardPointer: *hasResult = false; *hasResultType = false; break; - case OpConstantTrue: *hasResult = true; *hasResultType = true; break; - case OpConstantFalse: *hasResult = true; *hasResultType = true; break; - case OpConstant: *hasResult = true; *hasResultType = true; break; - case OpConstantComposite: *hasResult = true; *hasResultType = true; break; - case OpConstantSampler: *hasResult = true; *hasResultType = true; break; - case OpConstantNull: *hasResult = true; *hasResultType = true; break; - case OpSpecConstantTrue: *hasResult = true; *hasResultType = true; break; - case OpSpecConstantFalse: *hasResult = true; *hasResultType = true; break; - case OpSpecConstant: *hasResult = true; *hasResultType = true; break; - case OpSpecConstantComposite: *hasResult = true; *hasResultType = true; break; - case OpSpecConstantOp: *hasResult = true; *hasResultType = true; break; - case OpFunction: *hasResult = true; *hasResultType = true; break; - case OpFunctionParameter: *hasResult = true; *hasResultType = true; break; - case OpFunctionEnd: *hasResult = false; *hasResultType = false; break; - case OpFunctionCall: *hasResult = true; *hasResultType = true; break; - case OpVariable: *hasResult = true; *hasResultType = true; break; - case OpImageTexelPointer: *hasResult = true; *hasResultType = true; break; - case OpLoad: *hasResult = true; *hasResultType = true; break; - case OpStore: *hasResult = false; *hasResultType = false; break; - case OpCopyMemory: *hasResult = false; *hasResultType = false; break; - case OpCopyMemorySized: *hasResult = false; *hasResultType = false; break; - case OpAccessChain: *hasResult = true; *hasResultType = true; break; - case OpInBoundsAccessChain: *hasResult = true; *hasResultType = true; break; - case OpPtrAccessChain: *hasResult = true; *hasResultType = true; break; - case OpArrayLength: *hasResult = true; *hasResultType = true; break; - case OpGenericPtrMemSemantics: *hasResult = true; *hasResultType = true; break; - case OpInBoundsPtrAccessChain: *hasResult = true; *hasResultType = true; break; - case OpDecorate: *hasResult = false; *hasResultType = false; break; - case OpMemberDecorate: *hasResult = false; *hasResultType = false; break; - case OpDecorationGroup: *hasResult = true; *hasResultType = false; break; - case OpGroupDecorate: *hasResult = false; *hasResultType = false; break; - case OpGroupMemberDecorate: *hasResult = false; *hasResultType = false; break; - case OpVectorExtractDynamic: *hasResult = true; *hasResultType = true; break; - case OpVectorInsertDynamic: *hasResult = true; *hasResultType = true; break; - case OpVectorShuffle: *hasResult = true; *hasResultType = true; break; - case OpCompositeConstruct: *hasResult = true; *hasResultType = true; break; - case OpCompositeExtract: *hasResult = true; *hasResultType = true; break; - case OpCompositeInsert: *hasResult = true; *hasResultType = true; break; - case OpCopyObject: *hasResult = true; *hasResultType = true; break; - case OpTranspose: *hasResult = true; *hasResultType = true; break; - case OpSampledImage: *hasResult = true; *hasResultType = true; break; - case OpImageSampleImplicitLod: *hasResult = true; *hasResultType = true; break; - case OpImageSampleExplicitLod: *hasResult = true; *hasResultType = true; break; - case OpImageSampleDrefImplicitLod: *hasResult = true; *hasResultType = true; break; - case OpImageSampleDrefExplicitLod: *hasResult = true; *hasResultType = true; break; - case OpImageSampleProjImplicitLod: *hasResult = true; *hasResultType = true; break; - case OpImageSampleProjExplicitLod: *hasResult = true; *hasResultType = true; break; - case OpImageSampleProjDrefImplicitLod: *hasResult = true; *hasResultType = true; break; - case OpImageSampleProjDrefExplicitLod: *hasResult = true; *hasResultType = true; break; - case OpImageFetch: *hasResult = true; *hasResultType = true; break; - case OpImageGather: *hasResult = true; *hasResultType = true; break; - case OpImageDrefGather: *hasResult = true; *hasResultType = true; break; - case OpImageRead: *hasResult = true; *hasResultType = true; break; - case OpImageWrite: *hasResult = false; *hasResultType = false; break; - case OpImage: *hasResult = true; *hasResultType = true; break; - case OpImageQueryFormat: *hasResult = true; *hasResultType = true; break; - case OpImageQueryOrder: *hasResult = true; *hasResultType = true; break; - case OpImageQuerySizeLod: *hasResult = true; *hasResultType = true; break; - case OpImageQuerySize: *hasResult = true; *hasResultType = true; break; - case OpImageQueryLod: *hasResult = true; *hasResultType = true; break; - case OpImageQueryLevels: *hasResult = true; *hasResultType = true; break; - case OpImageQuerySamples: *hasResult = true; *hasResultType = true; break; - case OpConvertFToU: *hasResult = true; *hasResultType = true; break; - case OpConvertFToS: *hasResult = true; *hasResultType = true; break; - case OpConvertSToF: *hasResult = true; *hasResultType = true; break; - case OpConvertUToF: *hasResult = true; *hasResultType = true; break; - case OpUConvert: *hasResult = true; *hasResultType = true; break; - case OpSConvert: *hasResult = true; *hasResultType = true; break; - case OpFConvert: *hasResult = true; *hasResultType = true; break; - case OpQuantizeToF16: *hasResult = true; *hasResultType = true; break; - case OpConvertPtrToU: *hasResult = true; *hasResultType = true; break; - case OpSatConvertSToU: *hasResult = true; *hasResultType = true; break; - case OpSatConvertUToS: *hasResult = true; *hasResultType = true; break; - case OpConvertUToPtr: *hasResult = true; *hasResultType = true; break; - case OpPtrCastToGeneric: *hasResult = true; *hasResultType = true; break; - case OpGenericCastToPtr: *hasResult = true; *hasResultType = true; break; - case OpGenericCastToPtrExplicit: *hasResult = true; *hasResultType = true; break; - case OpBitcast: *hasResult = true; *hasResultType = true; break; - case OpSNegate: *hasResult = true; *hasResultType = true; break; - case OpFNegate: *hasResult = true; *hasResultType = true; break; - case OpIAdd: *hasResult = true; *hasResultType = true; break; - case OpFAdd: *hasResult = true; *hasResultType = true; break; - case OpISub: *hasResult = true; *hasResultType = true; break; - case OpFSub: *hasResult = true; *hasResultType = true; break; - case OpIMul: *hasResult = true; *hasResultType = true; break; - case OpFMul: *hasResult = true; *hasResultType = true; break; - case OpUDiv: *hasResult = true; *hasResultType = true; break; - case OpSDiv: *hasResult = true; *hasResultType = true; break; - case OpFDiv: *hasResult = true; *hasResultType = true; break; - case OpUMod: *hasResult = true; *hasResultType = true; break; - case OpSRem: *hasResult = true; *hasResultType = true; break; - case OpSMod: *hasResult = true; *hasResultType = true; break; - case OpFRem: *hasResult = true; *hasResultType = true; break; - case OpFMod: *hasResult = true; *hasResultType = true; break; - case OpVectorTimesScalar: *hasResult = true; *hasResultType = true; break; - case OpMatrixTimesScalar: *hasResult = true; *hasResultType = true; break; - case OpVectorTimesMatrix: *hasResult = true; *hasResultType = true; break; - case OpMatrixTimesVector: *hasResult = true; *hasResultType = true; break; - case OpMatrixTimesMatrix: *hasResult = true; *hasResultType = true; break; - case OpOuterProduct: *hasResult = true; *hasResultType = true; break; - case OpDot: *hasResult = true; *hasResultType = true; break; - case OpIAddCarry: *hasResult = true; *hasResultType = true; break; - case OpISubBorrow: *hasResult = true; *hasResultType = true; break; - case OpUMulExtended: *hasResult = true; *hasResultType = true; break; - case OpSMulExtended: *hasResult = true; *hasResultType = true; break; - case OpAny: *hasResult = true; *hasResultType = true; break; - case OpAll: *hasResult = true; *hasResultType = true; break; - case OpIsNan: *hasResult = true; *hasResultType = true; break; - case OpIsInf: *hasResult = true; *hasResultType = true; break; - case OpIsFinite: *hasResult = true; *hasResultType = true; break; - case OpIsNormal: *hasResult = true; *hasResultType = true; break; - case OpSignBitSet: *hasResult = true; *hasResultType = true; break; - case OpLessOrGreater: *hasResult = true; *hasResultType = true; break; - case OpOrdered: *hasResult = true; *hasResultType = true; break; - case OpUnordered: *hasResult = true; *hasResultType = true; break; - case OpLogicalEqual: *hasResult = true; *hasResultType = true; break; - case OpLogicalNotEqual: *hasResult = true; *hasResultType = true; break; - case OpLogicalOr: *hasResult = true; *hasResultType = true; break; - case OpLogicalAnd: *hasResult = true; *hasResultType = true; break; - case OpLogicalNot: *hasResult = true; *hasResultType = true; break; - case OpSelect: *hasResult = true; *hasResultType = true; break; - case OpIEqual: *hasResult = true; *hasResultType = true; break; - case OpINotEqual: *hasResult = true; *hasResultType = true; break; - case OpUGreaterThan: *hasResult = true; *hasResultType = true; break; - case OpSGreaterThan: *hasResult = true; *hasResultType = true; break; - case OpUGreaterThanEqual: *hasResult = true; *hasResultType = true; break; - case OpSGreaterThanEqual: *hasResult = true; *hasResultType = true; break; - case OpULessThan: *hasResult = true; *hasResultType = true; break; - case OpSLessThan: *hasResult = true; *hasResultType = true; break; - case OpULessThanEqual: *hasResult = true; *hasResultType = true; break; - case OpSLessThanEqual: *hasResult = true; *hasResultType = true; break; - case OpFOrdEqual: *hasResult = true; *hasResultType = true; break; - case OpFUnordEqual: *hasResult = true; *hasResultType = true; break; - case OpFOrdNotEqual: *hasResult = true; *hasResultType = true; break; - case OpFUnordNotEqual: *hasResult = true; *hasResultType = true; break; - case OpFOrdLessThan: *hasResult = true; *hasResultType = true; break; - case OpFUnordLessThan: *hasResult = true; *hasResultType = true; break; - case OpFOrdGreaterThan: *hasResult = true; *hasResultType = true; break; - case OpFUnordGreaterThan: *hasResult = true; *hasResultType = true; break; - case OpFOrdLessThanEqual: *hasResult = true; *hasResultType = true; break; - case OpFUnordLessThanEqual: *hasResult = true; *hasResultType = true; break; - case OpFOrdGreaterThanEqual: *hasResult = true; *hasResultType = true; break; - case OpFUnordGreaterThanEqual: *hasResult = true; *hasResultType = true; break; - case OpShiftRightLogical: *hasResult = true; *hasResultType = true; break; - case OpShiftRightArithmetic: *hasResult = true; *hasResultType = true; break; - case OpShiftLeftLogical: *hasResult = true; *hasResultType = true; break; - case OpBitwiseOr: *hasResult = true; *hasResultType = true; break; - case OpBitwiseXor: *hasResult = true; *hasResultType = true; break; - case OpBitwiseAnd: *hasResult = true; *hasResultType = true; break; - case OpNot: *hasResult = true; *hasResultType = true; break; - case OpBitFieldInsert: *hasResult = true; *hasResultType = true; break; - case OpBitFieldSExtract: *hasResult = true; *hasResultType = true; break; - case OpBitFieldUExtract: *hasResult = true; *hasResultType = true; break; - case OpBitReverse: *hasResult = true; *hasResultType = true; break; - case OpBitCount: *hasResult = true; *hasResultType = true; break; - case OpDPdx: *hasResult = true; *hasResultType = true; break; - case OpDPdy: *hasResult = true; *hasResultType = true; break; - case OpFwidth: *hasResult = true; *hasResultType = true; break; - case OpDPdxFine: *hasResult = true; *hasResultType = true; break; - case OpDPdyFine: *hasResult = true; *hasResultType = true; break; - case OpFwidthFine: *hasResult = true; *hasResultType = true; break; - case OpDPdxCoarse: *hasResult = true; *hasResultType = true; break; - case OpDPdyCoarse: *hasResult = true; *hasResultType = true; break; - case OpFwidthCoarse: *hasResult = true; *hasResultType = true; break; - case OpEmitVertex: *hasResult = false; *hasResultType = false; break; - case OpEndPrimitive: *hasResult = false; *hasResultType = false; break; - case OpEmitStreamVertex: *hasResult = false; *hasResultType = false; break; - case OpEndStreamPrimitive: *hasResult = false; *hasResultType = false; break; - case OpControlBarrier: *hasResult = false; *hasResultType = false; break; - case OpMemoryBarrier: *hasResult = false; *hasResultType = false; break; - case OpAtomicLoad: *hasResult = true; *hasResultType = true; break; - case OpAtomicStore: *hasResult = false; *hasResultType = false; break; - case OpAtomicExchange: *hasResult = true; *hasResultType = true; break; - case OpAtomicCompareExchange: *hasResult = true; *hasResultType = true; break; - case OpAtomicCompareExchangeWeak: *hasResult = true; *hasResultType = true; break; - case OpAtomicIIncrement: *hasResult = true; *hasResultType = true; break; - case OpAtomicIDecrement: *hasResult = true; *hasResultType = true; break; - case OpAtomicIAdd: *hasResult = true; *hasResultType = true; break; - case OpAtomicISub: *hasResult = true; *hasResultType = true; break; - case OpAtomicSMin: *hasResult = true; *hasResultType = true; break; - case OpAtomicUMin: *hasResult = true; *hasResultType = true; break; - case OpAtomicSMax: *hasResult = true; *hasResultType = true; break; - case OpAtomicUMax: *hasResult = true; *hasResultType = true; break; - case OpAtomicAnd: *hasResult = true; *hasResultType = true; break; - case OpAtomicOr: *hasResult = true; *hasResultType = true; break; - case OpAtomicXor: *hasResult = true; *hasResultType = true; break; - case OpPhi: *hasResult = true; *hasResultType = true; break; - case OpLoopMerge: *hasResult = false; *hasResultType = false; break; - case OpSelectionMerge: *hasResult = false; *hasResultType = false; break; - case OpLabel: *hasResult = true; *hasResultType = false; break; - case OpBranch: *hasResult = false; *hasResultType = false; break; - case OpBranchConditional: *hasResult = false; *hasResultType = false; break; - case OpSwitch: *hasResult = false; *hasResultType = false; break; - case OpKill: *hasResult = false; *hasResultType = false; break; - case OpReturn: *hasResult = false; *hasResultType = false; break; - case OpReturnValue: *hasResult = false; *hasResultType = false; break; - case OpUnreachable: *hasResult = false; *hasResultType = false; break; - case OpLifetimeStart: *hasResult = false; *hasResultType = false; break; - case OpLifetimeStop: *hasResult = false; *hasResultType = false; break; - case OpGroupAsyncCopy: *hasResult = true; *hasResultType = true; break; - case OpGroupWaitEvents: *hasResult = false; *hasResultType = false; break; - case OpGroupAll: *hasResult = true; *hasResultType = true; break; - case OpGroupAny: *hasResult = true; *hasResultType = true; break; - case OpGroupBroadcast: *hasResult = true; *hasResultType = true; break; - case OpGroupIAdd: *hasResult = true; *hasResultType = true; break; - case OpGroupFAdd: *hasResult = true; *hasResultType = true; break; - case OpGroupFMin: *hasResult = true; *hasResultType = true; break; - case OpGroupUMin: *hasResult = true; *hasResultType = true; break; - case OpGroupSMin: *hasResult = true; *hasResultType = true; break; - case OpGroupFMax: *hasResult = true; *hasResultType = true; break; - case OpGroupUMax: *hasResult = true; *hasResultType = true; break; - case OpGroupSMax: *hasResult = true; *hasResultType = true; break; - case OpReadPipe: *hasResult = true; *hasResultType = true; break; - case OpWritePipe: *hasResult = true; *hasResultType = true; break; - case OpReservedReadPipe: *hasResult = true; *hasResultType = true; break; - case OpReservedWritePipe: *hasResult = true; *hasResultType = true; break; - case OpReserveReadPipePackets: *hasResult = true; *hasResultType = true; break; - case OpReserveWritePipePackets: *hasResult = true; *hasResultType = true; break; - case OpCommitReadPipe: *hasResult = false; *hasResultType = false; break; - case OpCommitWritePipe: *hasResult = false; *hasResultType = false; break; - case OpIsValidReserveId: *hasResult = true; *hasResultType = true; break; - case OpGetNumPipePackets: *hasResult = true; *hasResultType = true; break; - case OpGetMaxPipePackets: *hasResult = true; *hasResultType = true; break; - case OpGroupReserveReadPipePackets: *hasResult = true; *hasResultType = true; break; - case OpGroupReserveWritePipePackets: *hasResult = true; *hasResultType = true; break; - case OpGroupCommitReadPipe: *hasResult = false; *hasResultType = false; break; - case OpGroupCommitWritePipe: *hasResult = false; *hasResultType = false; break; - case OpEnqueueMarker: *hasResult = true; *hasResultType = true; break; - case OpEnqueueKernel: *hasResult = true; *hasResultType = true; break; - case OpGetKernelNDrangeSubGroupCount: *hasResult = true; *hasResultType = true; break; - case OpGetKernelNDrangeMaxSubGroupSize: *hasResult = true; *hasResultType = true; break; - case OpGetKernelWorkGroupSize: *hasResult = true; *hasResultType = true; break; - case OpGetKernelPreferredWorkGroupSizeMultiple: *hasResult = true; *hasResultType = true; break; - case OpRetainEvent: *hasResult = false; *hasResultType = false; break; - case OpReleaseEvent: *hasResult = false; *hasResultType = false; break; - case OpCreateUserEvent: *hasResult = true; *hasResultType = true; break; - case OpIsValidEvent: *hasResult = true; *hasResultType = true; break; - case OpSetUserEventStatus: *hasResult = false; *hasResultType = false; break; - case OpCaptureEventProfilingInfo: *hasResult = false; *hasResultType = false; break; - case OpGetDefaultQueue: *hasResult = true; *hasResultType = true; break; - case OpBuildNDRange: *hasResult = true; *hasResultType = true; break; - case OpImageSparseSampleImplicitLod: *hasResult = true; *hasResultType = true; break; - case OpImageSparseSampleExplicitLod: *hasResult = true; *hasResultType = true; break; - case OpImageSparseSampleDrefImplicitLod: *hasResult = true; *hasResultType = true; break; - case OpImageSparseSampleDrefExplicitLod: *hasResult = true; *hasResultType = true; break; - case OpImageSparseSampleProjImplicitLod: *hasResult = true; *hasResultType = true; break; - case OpImageSparseSampleProjExplicitLod: *hasResult = true; *hasResultType = true; break; - case OpImageSparseSampleProjDrefImplicitLod: *hasResult = true; *hasResultType = true; break; - case OpImageSparseSampleProjDrefExplicitLod: *hasResult = true; *hasResultType = true; break; - case OpImageSparseFetch: *hasResult = true; *hasResultType = true; break; - case OpImageSparseGather: *hasResult = true; *hasResultType = true; break; - case OpImageSparseDrefGather: *hasResult = true; *hasResultType = true; break; - case OpImageSparseTexelsResident: *hasResult = true; *hasResultType = true; break; - case OpNoLine: *hasResult = false; *hasResultType = false; break; - case OpAtomicFlagTestAndSet: *hasResult = true; *hasResultType = true; break; - case OpAtomicFlagClear: *hasResult = false; *hasResultType = false; break; - case OpImageSparseRead: *hasResult = true; *hasResultType = true; break; - case OpSizeOf: *hasResult = true; *hasResultType = true; break; - case OpTypePipeStorage: *hasResult = true; *hasResultType = false; break; - case OpConstantPipeStorage: *hasResult = true; *hasResultType = true; break; - case OpCreatePipeFromPipeStorage: *hasResult = true; *hasResultType = true; break; - case OpGetKernelLocalSizeForSubgroupCount: *hasResult = true; *hasResultType = true; break; - case OpGetKernelMaxNumSubgroups: *hasResult = true; *hasResultType = true; break; - case OpTypeNamedBarrier: *hasResult = true; *hasResultType = false; break; - case OpNamedBarrierInitialize: *hasResult = true; *hasResultType = true; break; - case OpMemoryNamedBarrier: *hasResult = false; *hasResultType = false; break; - case OpModuleProcessed: *hasResult = false; *hasResultType = false; break; - case OpExecutionModeId: *hasResult = false; *hasResultType = false; break; - case OpDecorateId: *hasResult = false; *hasResultType = false; break; - case OpGroupNonUniformElect: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformAll: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformAny: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformAllEqual: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformBroadcast: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformBroadcastFirst: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformBallot: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformInverseBallot: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformBallotBitExtract: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformBallotBitCount: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformBallotFindLSB: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformBallotFindMSB: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformShuffle: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformShuffleXor: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformShuffleUp: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformShuffleDown: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformIAdd: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformFAdd: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformIMul: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformFMul: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformSMin: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformUMin: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformFMin: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformSMax: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformUMax: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformFMax: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformBitwiseAnd: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformBitwiseOr: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformBitwiseXor: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformLogicalAnd: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformLogicalOr: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformLogicalXor: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformQuadBroadcast: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformQuadSwap: *hasResult = true; *hasResultType = true; break; - case OpCopyLogical: *hasResult = true; *hasResultType = true; break; - case OpPtrEqual: *hasResult = true; *hasResultType = true; break; - case OpPtrNotEqual: *hasResult = true; *hasResultType = true; break; - case OpPtrDiff: *hasResult = true; *hasResultType = true; break; - case OpTerminateInvocation: *hasResult = false; *hasResultType = false; break; - case OpSubgroupBallotKHR: *hasResult = true; *hasResultType = true; break; - case OpSubgroupFirstInvocationKHR: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break; - case OpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break; - case OpTraceRayKHR: *hasResult = false; *hasResultType = false; break; - case OpExecuteCallableKHR: *hasResult = false; *hasResultType = false; break; - case OpConvertUToAccelerationStructureKHR: *hasResult = true; *hasResultType = true; break; - case OpIgnoreIntersectionKHR: *hasResult = false; *hasResultType = false; break; - case OpTerminateRayKHR: *hasResult = false; *hasResultType = false; break; - case OpSDotKHR: *hasResult = true; *hasResultType = true; break; - case OpUDotKHR: *hasResult = true; *hasResultType = true; break; - case OpSUDotKHR: *hasResult = true; *hasResultType = true; break; - case OpSDotAccSatKHR: *hasResult = true; *hasResultType = true; break; - case OpUDotAccSatKHR: *hasResult = true; *hasResultType = true; break; - case OpSUDotAccSatKHR: *hasResult = true; *hasResultType = true; break; - case OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break; - case OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break; - case OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break; - case OpRayQueryGenerateIntersectionKHR: *hasResult = false; *hasResultType = false; break; - case OpRayQueryConfirmIntersectionKHR: *hasResult = false; *hasResultType = false; break; - case OpRayQueryProceedKHR: *hasResult = true; *hasResultType = true; break; - case OpRayQueryGetIntersectionTypeKHR: *hasResult = true; *hasResultType = true; break; - case OpGroupIAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; - case OpGroupFAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; - case OpGroupFMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; - case OpGroupUMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; - case OpGroupSMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; - case OpGroupFMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; - case OpGroupUMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; - case OpGroupSMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; - case OpFragmentMaskFetchAMD: *hasResult = true; *hasResultType = true; break; - case OpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break; - case OpReadClockKHR: *hasResult = true; *hasResultType = true; break; - case OpImageSampleFootprintNV: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformPartitionNV: *hasResult = true; *hasResultType = true; break; - case OpWritePackedPrimitiveIndices4x8NV: *hasResult = false; *hasResultType = false; break; - case OpReportIntersectionNV: *hasResult = true; *hasResultType = true; break; - case OpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break; - case OpTerminateRayNV: *hasResult = false; *hasResultType = false; break; - case OpTraceNV: *hasResult = false; *hasResultType = false; break; - case OpTraceMotionNV: *hasResult = false; *hasResultType = false; break; - case OpTraceRayMotionNV: *hasResult = false; *hasResultType = false; break; - case OpTypeAccelerationStructureNV: *hasResult = true; *hasResultType = false; break; - case OpExecuteCallableNV: *hasResult = false; *hasResultType = false; break; - case OpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break; - case OpCooperativeMatrixLoadNV: *hasResult = true; *hasResultType = true; break; - case OpCooperativeMatrixStoreNV: *hasResult = false; *hasResultType = false; break; - case OpCooperativeMatrixMulAddNV: *hasResult = true; *hasResultType = true; break; - case OpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break; - case OpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break; - case OpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break; - case OpDemoteToHelperInvocationEXT: *hasResult = false; *hasResultType = false; break; - case OpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break; - case OpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupShuffleXorINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupBlockReadINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; - case OpSubgroupImageBlockReadINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupImageBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; - case OpSubgroupImageMediaBlockReadINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupImageMediaBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; - case OpUCountLeadingZerosINTEL: *hasResult = true; *hasResultType = true; break; - case OpUCountTrailingZerosINTEL: *hasResult = true; *hasResultType = true; break; - case OpAbsISubINTEL: *hasResult = true; *hasResultType = true; break; - case OpAbsUSubINTEL: *hasResult = true; *hasResultType = true; break; - case OpIAddSatINTEL: *hasResult = true; *hasResultType = true; break; - case OpUAddSatINTEL: *hasResult = true; *hasResultType = true; break; - case OpIAverageINTEL: *hasResult = true; *hasResultType = true; break; - case OpUAverageINTEL: *hasResult = true; *hasResultType = true; break; - case OpIAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break; - case OpUAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break; - case OpISubSatINTEL: *hasResult = true; *hasResultType = true; break; - case OpUSubSatINTEL: *hasResult = true; *hasResultType = true; break; - case OpIMul32x16INTEL: *hasResult = true; *hasResultType = true; break; - case OpUMul32x16INTEL: *hasResult = true; *hasResultType = true; break; - case OpConstFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break; - case OpFunctionPointerCallINTEL: *hasResult = true; *hasResultType = true; break; - case OpAsmTargetINTEL: *hasResult = true; *hasResultType = true; break; - case OpAsmINTEL: *hasResult = true; *hasResultType = true; break; - case OpAsmCallINTEL: *hasResult = true; *hasResultType = true; break; - case OpAtomicFMinEXT: *hasResult = true; *hasResultType = true; break; - case OpAtomicFMaxEXT: *hasResult = true; *hasResultType = true; break; - case OpAssumeTrueKHR: *hasResult = false; *hasResultType = false; break; - case OpExpectKHR: *hasResult = true; *hasResultType = true; break; - case OpDecorateString: *hasResult = false; *hasResultType = false; break; - case OpMemberDecorateString: *hasResult = false; *hasResultType = false; break; - case OpVmeImageINTEL: *hasResult = true; *hasResultType = true; break; - case OpTypeVmeImageINTEL: *hasResult = true; *hasResultType = false; break; - case OpTypeAvcImePayloadINTEL: *hasResult = true; *hasResultType = false; break; - case OpTypeAvcRefPayloadINTEL: *hasResult = true; *hasResultType = false; break; - case OpTypeAvcSicPayloadINTEL: *hasResult = true; *hasResultType = false; break; - case OpTypeAvcMcePayloadINTEL: *hasResult = true; *hasResultType = false; break; - case OpTypeAvcMceResultINTEL: *hasResult = true; *hasResultType = false; break; - case OpTypeAvcImeResultINTEL: *hasResult = true; *hasResultType = false; break; - case OpTypeAvcImeResultSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = false; break; - case OpTypeAvcImeResultDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = false; break; - case OpTypeAvcImeSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = false; break; - case OpTypeAvcImeDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = false; break; - case OpTypeAvcRefResultINTEL: *hasResult = true; *hasResultType = false; break; - case OpTypeAvcSicResultINTEL: *hasResult = true; *hasResultType = false; break; - case OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceSetInterShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceSetInterDirectionPenaltyINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceSetAcOnlyHaarINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceConvertToImePayloadINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceConvertToImeResultINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceConvertToRefPayloadINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceConvertToRefResultINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceConvertToSicPayloadINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceConvertToSicResultINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceGetMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceGetInterDistortionsINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceGetBestInterDistortionsINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceGetInterMajorShapeINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceGetInterMinorShapeINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceGetInterDirectionsINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceGetInterMotionVectorCountINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceGetInterReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeInitializeINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeSetSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeSetDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeRefWindowSizeINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeAdjustRefOffsetINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeSetMaxMotionVectorCountINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeSetWeightedSadINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeGetSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeGetDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeStripDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeGetBorderReachedINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcFmeInitializeINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcBmeInitializeINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcRefConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcRefSetBidirectionalMixDisableINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcRefSetBilinearFilterEnableINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcRefEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcRefConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcSicInitializeINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcSicConfigureSkcINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcSicConfigureIpeLumaINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcSicConfigureIpeLumaChromaINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcSicGetMotionVectorMaskINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcSicConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcSicSetBilinearFilterEnableINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcSicEvaluateIpeINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcSicEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcSicConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcSicGetIpeLumaShapeINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcSicGetPackedIpeLumaModesINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcSicGetIpeChromaModeINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL: *hasResult = true; *hasResultType = true; break; - case OpSubgroupAvcSicGetInterRawSadsINTEL: *hasResult = true; *hasResultType = true; break; - case OpVariableLengthArrayINTEL: *hasResult = true; *hasResultType = true; break; - case OpSaveMemoryINTEL: *hasResult = true; *hasResultType = true; break; - case OpRestoreMemoryINTEL: *hasResult = false; *hasResultType = false; break; - case OpArbitraryFloatSinCosPiINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatCastINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatCastFromIntINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatCastToIntINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatAddINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatSubINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatMulINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatDivINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatGTINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatGEINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatLTINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatLEINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatEQINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatRecipINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatRSqrtINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatCbrtINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatHypotINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatSqrtINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatLogINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatLog2INTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatLog10INTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatLog1pINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatExpINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatExp2INTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatExp10INTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatExpm1INTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatSinINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatCosINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatSinCosINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatSinPiINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatCosPiINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatASinINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatASinPiINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatACosINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatACosPiINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatATanINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatATanPiINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatATan2INTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatPowINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatPowRINTEL: *hasResult = true; *hasResultType = true; break; - case OpArbitraryFloatPowNINTEL: *hasResult = true; *hasResultType = true; break; - case OpLoopControlINTEL: *hasResult = false; *hasResultType = false; break; - case OpFixedSqrtINTEL: *hasResult = true; *hasResultType = true; break; - case OpFixedRecipINTEL: *hasResult = true; *hasResultType = true; break; - case OpFixedRsqrtINTEL: *hasResult = true; *hasResultType = true; break; - case OpFixedSinINTEL: *hasResult = true; *hasResultType = true; break; - case OpFixedCosINTEL: *hasResult = true; *hasResultType = true; break; - case OpFixedSinCosINTEL: *hasResult = true; *hasResultType = true; break; - case OpFixedSinPiINTEL: *hasResult = true; *hasResultType = true; break; - case OpFixedCosPiINTEL: *hasResult = true; *hasResultType = true; break; - case OpFixedSinCosPiINTEL: *hasResult = true; *hasResultType = true; break; - case OpFixedLogINTEL: *hasResult = true; *hasResultType = true; break; - case OpFixedExpINTEL: *hasResult = true; *hasResultType = true; break; - case OpPtrCastToCrossWorkgroupINTEL: *hasResult = true; *hasResultType = true; break; - case OpCrossWorkgroupCastToPtrINTEL: *hasResult = true; *hasResultType = true; break; - case OpReadPipeBlockingINTEL: *hasResult = true; *hasResultType = true; break; - case OpWritePipeBlockingINTEL: *hasResult = true; *hasResultType = true; break; - case OpFPGARegINTEL: *hasResult = true; *hasResultType = true; break; - case OpRayQueryGetRayTMinKHR: *hasResult = true; *hasResultType = true; break; - case OpRayQueryGetRayFlagsKHR: *hasResult = true; *hasResultType = true; break; - case OpRayQueryGetIntersectionTKHR: *hasResult = true; *hasResultType = true; break; - case OpRayQueryGetIntersectionInstanceCustomIndexKHR: *hasResult = true; *hasResultType = true; break; - case OpRayQueryGetIntersectionInstanceIdKHR: *hasResult = true; *hasResultType = true; break; - case OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: *hasResult = true; *hasResultType = true; break; - case OpRayQueryGetIntersectionGeometryIndexKHR: *hasResult = true; *hasResultType = true; break; - case OpRayQueryGetIntersectionPrimitiveIndexKHR: *hasResult = true; *hasResultType = true; break; - case OpRayQueryGetIntersectionBarycentricsKHR: *hasResult = true; *hasResultType = true; break; - case OpRayQueryGetIntersectionFrontFaceKHR: *hasResult = true; *hasResultType = true; break; - case OpRayQueryGetIntersectionCandidateAABBOpaqueKHR: *hasResult = true; *hasResultType = true; break; - case OpRayQueryGetIntersectionObjectRayDirectionKHR: *hasResult = true; *hasResultType = true; break; - case OpRayQueryGetIntersectionObjectRayOriginKHR: *hasResult = true; *hasResultType = true; break; - case OpRayQueryGetWorldRayDirectionKHR: *hasResult = true; *hasResultType = true; break; - case OpRayQueryGetWorldRayOriginKHR: *hasResult = true; *hasResultType = true; break; - case OpRayQueryGetIntersectionObjectToWorldKHR: *hasResult = true; *hasResultType = true; break; - case OpRayQueryGetIntersectionWorldToObjectKHR: *hasResult = true; *hasResultType = true; break; - case OpAtomicFAddEXT: *hasResult = true; *hasResultType = true; break; - case OpTypeBufferSurfaceINTEL: *hasResult = true; *hasResultType = false; break; - case OpTypeStructContinuedINTEL: *hasResult = false; *hasResultType = false; break; - case OpConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break; - case OpSpecConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break; - } -} -#endif /* SPV_ENABLE_UTILITY_CODE */ - -// Overload operator| for mask bit combining - -inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } -inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } -inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } -inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } -inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } -inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } -inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } -inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } -inline RayFlagsMask operator|(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) | unsigned(b)); } -inline FragmentShadingRateMask operator|(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) | unsigned(b)); } - -} // end namespace spv - -#endif // #ifndef spirv_HPP - diff --git a/include/spirv/unified1/spirv.hpp11 b/include/spirv/unified1/spirv.hpp11 deleted file mode 100644 index 51e90249..00000000 --- a/include/spirv/unified1/spirv.hpp11 +++ /dev/null @@ -1,2467 +0,0 @@ -// Copyright (c) 2014-2020 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -// This header is automatically generated by the same tool that creates -// the Binary Section of the SPIR-V specification. - -// Enumeration tokens for SPIR-V, in various styles: -// C, C++, C++11, JSON, Lua, Python, C#, D -// -// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -// - C# will use enum classes in the Specification class located in the "Spv" namespace, -// e.g.: Spv.Specification.SourceLanguage.GLSL -// - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL -// -// Some tokens act like mask values, which can be OR'd together, -// while others are mutually exclusive. The mask-like ones have -// "Mask" in their name, and a parallel enum that has the shift -// amount (1 << x) for each corresponding enumerant. - -#ifndef spirv_HPP -#define spirv_HPP - -namespace spv { - -typedef unsigned int Id; - -#define SPV_VERSION 0x10500 -#define SPV_REVISION 4 - -static const unsigned int MagicNumber = 0x07230203; -static const unsigned int Version = 0x00010500; -static const unsigned int Revision = 4; -static const unsigned int OpCodeMask = 0xffff; -static const unsigned int WordCountShift = 16; - -enum class SourceLanguage : unsigned { - Unknown = 0, - ESSL = 1, - GLSL = 2, - OpenCL_C = 3, - OpenCL_CPP = 4, - HLSL = 5, - CPP_for_OpenCL = 6, - Max = 0x7fffffff, -}; - -enum class ExecutionModel : unsigned { - Vertex = 0, - TessellationControl = 1, - TessellationEvaluation = 2, - Geometry = 3, - Fragment = 4, - GLCompute = 5, - Kernel = 6, - TaskNV = 5267, - MeshNV = 5268, - RayGenerationKHR = 5313, - RayGenerationNV = 5313, - IntersectionKHR = 5314, - IntersectionNV = 5314, - AnyHitKHR = 5315, - AnyHitNV = 5315, - ClosestHitKHR = 5316, - ClosestHitNV = 5316, - MissKHR = 5317, - MissNV = 5317, - CallableKHR = 5318, - CallableNV = 5318, - Max = 0x7fffffff, -}; - -enum class AddressingModel : unsigned { - Logical = 0, - Physical32 = 1, - Physical64 = 2, - PhysicalStorageBuffer64 = 5348, - PhysicalStorageBuffer64EXT = 5348, - Max = 0x7fffffff, -}; - -enum class MemoryModel : unsigned { - Simple = 0, - GLSL450 = 1, - OpenCL = 2, - Vulkan = 3, - VulkanKHR = 3, - Max = 0x7fffffff, -}; - -enum class ExecutionMode : unsigned { - Invocations = 0, - SpacingEqual = 1, - SpacingFractionalEven = 2, - SpacingFractionalOdd = 3, - VertexOrderCw = 4, - VertexOrderCcw = 5, - PixelCenterInteger = 6, - OriginUpperLeft = 7, - OriginLowerLeft = 8, - EarlyFragmentTests = 9, - PointMode = 10, - Xfb = 11, - DepthReplacing = 12, - DepthGreater = 14, - DepthLess = 15, - DepthUnchanged = 16, - LocalSize = 17, - LocalSizeHint = 18, - InputPoints = 19, - InputLines = 20, - InputLinesAdjacency = 21, - Triangles = 22, - InputTrianglesAdjacency = 23, - Quads = 24, - Isolines = 25, - OutputVertices = 26, - OutputPoints = 27, - OutputLineStrip = 28, - OutputTriangleStrip = 29, - VecTypeHint = 30, - ContractionOff = 31, - Initializer = 33, - Finalizer = 34, - SubgroupSize = 35, - SubgroupsPerWorkgroup = 36, - SubgroupsPerWorkgroupId = 37, - LocalSizeId = 38, - LocalSizeHintId = 39, - SubgroupUniformControlFlowKHR = 4421, - PostDepthCoverage = 4446, - DenormPreserve = 4459, - DenormFlushToZero = 4460, - SignedZeroInfNanPreserve = 4461, - RoundingModeRTE = 4462, - RoundingModeRTZ = 4463, - StencilRefReplacingEXT = 5027, - OutputLinesNV = 5269, - OutputPrimitivesNV = 5270, - DerivativeGroupQuadsNV = 5289, - DerivativeGroupLinearNV = 5290, - OutputTrianglesNV = 5298, - PixelInterlockOrderedEXT = 5366, - PixelInterlockUnorderedEXT = 5367, - SampleInterlockOrderedEXT = 5368, - SampleInterlockUnorderedEXT = 5369, - ShadingRateInterlockOrderedEXT = 5370, - ShadingRateInterlockUnorderedEXT = 5371, - SharedLocalMemorySizeINTEL = 5618, - RoundingModeRTPINTEL = 5620, - RoundingModeRTNINTEL = 5621, - FloatingPointModeALTINTEL = 5622, - FloatingPointModeIEEEINTEL = 5623, - MaxWorkgroupSizeINTEL = 5893, - MaxWorkDimINTEL = 5894, - NoGlobalOffsetINTEL = 5895, - NumSIMDWorkitemsINTEL = 5896, - SchedulerTargetFmaxMhzINTEL = 5903, - Max = 0x7fffffff, -}; - -enum class StorageClass : unsigned { - UniformConstant = 0, - Input = 1, - Uniform = 2, - Output = 3, - Workgroup = 4, - CrossWorkgroup = 5, - Private = 6, - Function = 7, - Generic = 8, - PushConstant = 9, - AtomicCounter = 10, - Image = 11, - StorageBuffer = 12, - CallableDataKHR = 5328, - CallableDataNV = 5328, - IncomingCallableDataKHR = 5329, - IncomingCallableDataNV = 5329, - RayPayloadKHR = 5338, - RayPayloadNV = 5338, - HitAttributeKHR = 5339, - HitAttributeNV = 5339, - IncomingRayPayloadKHR = 5342, - IncomingRayPayloadNV = 5342, - ShaderRecordBufferKHR = 5343, - ShaderRecordBufferNV = 5343, - PhysicalStorageBuffer = 5349, - PhysicalStorageBufferEXT = 5349, - CodeSectionINTEL = 5605, - DeviceOnlyINTEL = 5936, - HostOnlyINTEL = 5937, - Max = 0x7fffffff, -}; - -enum class Dim : unsigned { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - Cube = 3, - Rect = 4, - Buffer = 5, - SubpassData = 6, - Max = 0x7fffffff, -}; - -enum class SamplerAddressingMode : unsigned { - None = 0, - ClampToEdge = 1, - Clamp = 2, - Repeat = 3, - RepeatMirrored = 4, - Max = 0x7fffffff, -}; - -enum class SamplerFilterMode : unsigned { - Nearest = 0, - Linear = 1, - Max = 0x7fffffff, -}; - -enum class ImageFormat : unsigned { - Unknown = 0, - Rgba32f = 1, - Rgba16f = 2, - R32f = 3, - Rgba8 = 4, - Rgba8Snorm = 5, - Rg32f = 6, - Rg16f = 7, - R11fG11fB10f = 8, - R16f = 9, - Rgba16 = 10, - Rgb10A2 = 11, - Rg16 = 12, - Rg8 = 13, - R16 = 14, - R8 = 15, - Rgba16Snorm = 16, - Rg16Snorm = 17, - Rg8Snorm = 18, - R16Snorm = 19, - R8Snorm = 20, - Rgba32i = 21, - Rgba16i = 22, - Rgba8i = 23, - R32i = 24, - Rg32i = 25, - Rg16i = 26, - Rg8i = 27, - R16i = 28, - R8i = 29, - Rgba32ui = 30, - Rgba16ui = 31, - Rgba8ui = 32, - R32ui = 33, - Rgb10a2ui = 34, - Rg32ui = 35, - Rg16ui = 36, - Rg8ui = 37, - R16ui = 38, - R8ui = 39, - R64ui = 40, - R64i = 41, - Max = 0x7fffffff, -}; - -enum class ImageChannelOrder : unsigned { - R = 0, - A = 1, - RG = 2, - RA = 3, - RGB = 4, - RGBA = 5, - BGRA = 6, - ARGB = 7, - Intensity = 8, - Luminance = 9, - Rx = 10, - RGx = 11, - RGBx = 12, - Depth = 13, - DepthStencil = 14, - sRGB = 15, - sRGBx = 16, - sRGBA = 17, - sBGRA = 18, - ABGR = 19, - Max = 0x7fffffff, -}; - -enum class ImageChannelDataType : unsigned { - SnormInt8 = 0, - SnormInt16 = 1, - UnormInt8 = 2, - UnormInt16 = 3, - UnormShort565 = 4, - UnormShort555 = 5, - UnormInt101010 = 6, - SignedInt8 = 7, - SignedInt16 = 8, - SignedInt32 = 9, - UnsignedInt8 = 10, - UnsignedInt16 = 11, - UnsignedInt32 = 12, - HalfFloat = 13, - Float = 14, - UnormInt24 = 15, - UnormInt101010_2 = 16, - Max = 0x7fffffff, -}; - -enum class ImageOperandsShift : unsigned { - Bias = 0, - Lod = 1, - Grad = 2, - ConstOffset = 3, - Offset = 4, - ConstOffsets = 5, - Sample = 6, - MinLod = 7, - MakeTexelAvailable = 8, - MakeTexelAvailableKHR = 8, - MakeTexelVisible = 9, - MakeTexelVisibleKHR = 9, - NonPrivateTexel = 10, - NonPrivateTexelKHR = 10, - VolatileTexel = 11, - VolatileTexelKHR = 11, - SignExtend = 12, - ZeroExtend = 13, - Max = 0x7fffffff, -}; - -enum class ImageOperandsMask : unsigned { - MaskNone = 0, - Bias = 0x00000001, - Lod = 0x00000002, - Grad = 0x00000004, - ConstOffset = 0x00000008, - Offset = 0x00000010, - ConstOffsets = 0x00000020, - Sample = 0x00000040, - MinLod = 0x00000080, - MakeTexelAvailable = 0x00000100, - MakeTexelAvailableKHR = 0x00000100, - MakeTexelVisible = 0x00000200, - MakeTexelVisibleKHR = 0x00000200, - NonPrivateTexel = 0x00000400, - NonPrivateTexelKHR = 0x00000400, - VolatileTexel = 0x00000800, - VolatileTexelKHR = 0x00000800, - SignExtend = 0x00001000, - ZeroExtend = 0x00002000, -}; - -enum class FPFastMathModeShift : unsigned { - NotNaN = 0, - NotInf = 1, - NSZ = 2, - AllowRecip = 3, - Fast = 4, - AllowContractFastINTEL = 16, - AllowReassocINTEL = 17, - Max = 0x7fffffff, -}; - -enum class FPFastMathModeMask : unsigned { - MaskNone = 0, - NotNaN = 0x00000001, - NotInf = 0x00000002, - NSZ = 0x00000004, - AllowRecip = 0x00000008, - Fast = 0x00000010, - AllowContractFastINTEL = 0x00010000, - AllowReassocINTEL = 0x00020000, -}; - -enum class FPRoundingMode : unsigned { - RTE = 0, - RTZ = 1, - RTP = 2, - RTN = 3, - Max = 0x7fffffff, -}; - -enum class LinkageType : unsigned { - Export = 0, - Import = 1, - LinkOnceODR = 2, - Max = 0x7fffffff, -}; - -enum class AccessQualifier : unsigned { - ReadOnly = 0, - WriteOnly = 1, - ReadWrite = 2, - Max = 0x7fffffff, -}; - -enum class FunctionParameterAttribute : unsigned { - Zext = 0, - Sext = 1, - ByVal = 2, - Sret = 3, - NoAlias = 4, - NoCapture = 5, - NoWrite = 6, - NoReadWrite = 7, - Max = 0x7fffffff, -}; - -enum class Decoration : unsigned { - RelaxedPrecision = 0, - SpecId = 1, - Block = 2, - BufferBlock = 3, - RowMajor = 4, - ColMajor = 5, - ArrayStride = 6, - MatrixStride = 7, - GLSLShared = 8, - GLSLPacked = 9, - CPacked = 10, - BuiltIn = 11, - NoPerspective = 13, - Flat = 14, - Patch = 15, - Centroid = 16, - Sample = 17, - Invariant = 18, - Restrict = 19, - Aliased = 20, - Volatile = 21, - Constant = 22, - Coherent = 23, - NonWritable = 24, - NonReadable = 25, - Uniform = 26, - UniformId = 27, - SaturatedConversion = 28, - Stream = 29, - Location = 30, - Component = 31, - Index = 32, - Binding = 33, - DescriptorSet = 34, - Offset = 35, - XfbBuffer = 36, - XfbStride = 37, - FuncParamAttr = 38, - FPRoundingMode = 39, - FPFastMathMode = 40, - LinkageAttributes = 41, - NoContraction = 42, - InputAttachmentIndex = 43, - Alignment = 44, - MaxByteOffset = 45, - AlignmentId = 46, - MaxByteOffsetId = 47, - NoSignedWrap = 4469, - NoUnsignedWrap = 4470, - ExplicitInterpAMD = 4999, - OverrideCoverageNV = 5248, - PassthroughNV = 5250, - ViewportRelativeNV = 5252, - SecondaryViewportRelativeNV = 5256, - PerPrimitiveNV = 5271, - PerViewNV = 5272, - PerTaskNV = 5273, - PerVertexNV = 5285, - NonUniform = 5300, - NonUniformEXT = 5300, - RestrictPointer = 5355, - RestrictPointerEXT = 5355, - AliasedPointer = 5356, - AliasedPointerEXT = 5356, - SIMTCallINTEL = 5599, - ReferencedIndirectlyINTEL = 5602, - ClobberINTEL = 5607, - SideEffectsINTEL = 5608, - VectorComputeVariableINTEL = 5624, - FuncParamIOKindINTEL = 5625, - VectorComputeFunctionINTEL = 5626, - StackCallINTEL = 5627, - GlobalVariableOffsetINTEL = 5628, - CounterBuffer = 5634, - HlslCounterBufferGOOGLE = 5634, - HlslSemanticGOOGLE = 5635, - UserSemantic = 5635, - UserTypeGOOGLE = 5636, - FunctionRoundingModeINTEL = 5822, - FunctionDenormModeINTEL = 5823, - RegisterINTEL = 5825, - MemoryINTEL = 5826, - NumbanksINTEL = 5827, - BankwidthINTEL = 5828, - MaxPrivateCopiesINTEL = 5829, - SinglepumpINTEL = 5830, - DoublepumpINTEL = 5831, - MaxReplicatesINTEL = 5832, - SimpleDualPortINTEL = 5833, - MergeINTEL = 5834, - BankBitsINTEL = 5835, - ForcePow2DepthINTEL = 5836, - BurstCoalesceINTEL = 5899, - CacheSizeINTEL = 5900, - DontStaticallyCoalesceINTEL = 5901, - PrefetchINTEL = 5902, - StallEnableINTEL = 5905, - FuseLoopsInFunctionINTEL = 5907, - BufferLocationINTEL = 5921, - IOPipeStorageINTEL = 5944, - FunctionFloatingPointModeINTEL = 6080, - SingleElementVectorINTEL = 6085, - VectorComputeCallableFunctionINTEL = 6087, - Max = 0x7fffffff, -}; - -enum class BuiltIn : unsigned { - Position = 0, - PointSize = 1, - ClipDistance = 3, - CullDistance = 4, - VertexId = 5, - InstanceId = 6, - PrimitiveId = 7, - InvocationId = 8, - Layer = 9, - ViewportIndex = 10, - TessLevelOuter = 11, - TessLevelInner = 12, - TessCoord = 13, - PatchVertices = 14, - FragCoord = 15, - PointCoord = 16, - FrontFacing = 17, - SampleId = 18, - SamplePosition = 19, - SampleMask = 20, - FragDepth = 22, - HelperInvocation = 23, - NumWorkgroups = 24, - WorkgroupSize = 25, - WorkgroupId = 26, - LocalInvocationId = 27, - GlobalInvocationId = 28, - LocalInvocationIndex = 29, - WorkDim = 30, - GlobalSize = 31, - EnqueuedWorkgroupSize = 32, - GlobalOffset = 33, - GlobalLinearId = 34, - SubgroupSize = 36, - SubgroupMaxSize = 37, - NumSubgroups = 38, - NumEnqueuedSubgroups = 39, - SubgroupId = 40, - SubgroupLocalInvocationId = 41, - VertexIndex = 42, - InstanceIndex = 43, - SubgroupEqMask = 4416, - SubgroupEqMaskKHR = 4416, - SubgroupGeMask = 4417, - SubgroupGeMaskKHR = 4417, - SubgroupGtMask = 4418, - SubgroupGtMaskKHR = 4418, - SubgroupLeMask = 4419, - SubgroupLeMaskKHR = 4419, - SubgroupLtMask = 4420, - SubgroupLtMaskKHR = 4420, - BaseVertex = 4424, - BaseInstance = 4425, - DrawIndex = 4426, - PrimitiveShadingRateKHR = 4432, - DeviceIndex = 4438, - ViewIndex = 4440, - ShadingRateKHR = 4444, - BaryCoordNoPerspAMD = 4992, - BaryCoordNoPerspCentroidAMD = 4993, - BaryCoordNoPerspSampleAMD = 4994, - BaryCoordSmoothAMD = 4995, - BaryCoordSmoothCentroidAMD = 4996, - BaryCoordSmoothSampleAMD = 4997, - BaryCoordPullModelAMD = 4998, - FragStencilRefEXT = 5014, - ViewportMaskNV = 5253, - SecondaryPositionNV = 5257, - SecondaryViewportMaskNV = 5258, - PositionPerViewNV = 5261, - ViewportMaskPerViewNV = 5262, - FullyCoveredEXT = 5264, - TaskCountNV = 5274, - PrimitiveCountNV = 5275, - PrimitiveIndicesNV = 5276, - ClipDistancePerViewNV = 5277, - CullDistancePerViewNV = 5278, - LayerPerViewNV = 5279, - MeshViewCountNV = 5280, - MeshViewIndicesNV = 5281, - BaryCoordNV = 5286, - BaryCoordNoPerspNV = 5287, - FragSizeEXT = 5292, - FragmentSizeNV = 5292, - FragInvocationCountEXT = 5293, - InvocationsPerPixelNV = 5293, - LaunchIdKHR = 5319, - LaunchIdNV = 5319, - LaunchSizeKHR = 5320, - LaunchSizeNV = 5320, - WorldRayOriginKHR = 5321, - WorldRayOriginNV = 5321, - WorldRayDirectionKHR = 5322, - WorldRayDirectionNV = 5322, - ObjectRayOriginKHR = 5323, - ObjectRayOriginNV = 5323, - ObjectRayDirectionKHR = 5324, - ObjectRayDirectionNV = 5324, - RayTminKHR = 5325, - RayTminNV = 5325, - RayTmaxKHR = 5326, - RayTmaxNV = 5326, - InstanceCustomIndexKHR = 5327, - InstanceCustomIndexNV = 5327, - ObjectToWorldKHR = 5330, - ObjectToWorldNV = 5330, - WorldToObjectKHR = 5331, - WorldToObjectNV = 5331, - HitTNV = 5332, - HitKindKHR = 5333, - HitKindNV = 5333, - CurrentRayTimeNV = 5334, - IncomingRayFlagsKHR = 5351, - IncomingRayFlagsNV = 5351, - RayGeometryIndexKHR = 5352, - WarpsPerSMNV = 5374, - SMCountNV = 5375, - WarpIDNV = 5376, - SMIDNV = 5377, - Max = 0x7fffffff, -}; - -enum class SelectionControlShift : unsigned { - Flatten = 0, - DontFlatten = 1, - Max = 0x7fffffff, -}; - -enum class SelectionControlMask : unsigned { - MaskNone = 0, - Flatten = 0x00000001, - DontFlatten = 0x00000002, -}; - -enum class LoopControlShift : unsigned { - Unroll = 0, - DontUnroll = 1, - DependencyInfinite = 2, - DependencyLength = 3, - MinIterations = 4, - MaxIterations = 5, - IterationMultiple = 6, - PeelCount = 7, - PartialCount = 8, - InitiationIntervalINTEL = 16, - MaxConcurrencyINTEL = 17, - DependencyArrayINTEL = 18, - PipelineEnableINTEL = 19, - LoopCoalesceINTEL = 20, - MaxInterleavingINTEL = 21, - SpeculatedIterationsINTEL = 22, - NoFusionINTEL = 23, - Max = 0x7fffffff, -}; - -enum class LoopControlMask : unsigned { - MaskNone = 0, - Unroll = 0x00000001, - DontUnroll = 0x00000002, - DependencyInfinite = 0x00000004, - DependencyLength = 0x00000008, - MinIterations = 0x00000010, - MaxIterations = 0x00000020, - IterationMultiple = 0x00000040, - PeelCount = 0x00000080, - PartialCount = 0x00000100, - InitiationIntervalINTEL = 0x00010000, - MaxConcurrencyINTEL = 0x00020000, - DependencyArrayINTEL = 0x00040000, - PipelineEnableINTEL = 0x00080000, - LoopCoalesceINTEL = 0x00100000, - MaxInterleavingINTEL = 0x00200000, - SpeculatedIterationsINTEL = 0x00400000, - NoFusionINTEL = 0x00800000, -}; - -enum class FunctionControlShift : unsigned { - Inline = 0, - DontInline = 1, - Pure = 2, - Const = 3, - OptNoneINTEL = 16, - Max = 0x7fffffff, -}; - -enum class FunctionControlMask : unsigned { - MaskNone = 0, - Inline = 0x00000001, - DontInline = 0x00000002, - Pure = 0x00000004, - Const = 0x00000008, - OptNoneINTEL = 0x00010000, -}; - -enum class MemorySemanticsShift : unsigned { - Acquire = 1, - Release = 2, - AcquireRelease = 3, - SequentiallyConsistent = 4, - UniformMemory = 6, - SubgroupMemory = 7, - WorkgroupMemory = 8, - CrossWorkgroupMemory = 9, - AtomicCounterMemory = 10, - ImageMemory = 11, - OutputMemory = 12, - OutputMemoryKHR = 12, - MakeAvailable = 13, - MakeAvailableKHR = 13, - MakeVisible = 14, - MakeVisibleKHR = 14, - Volatile = 15, - Max = 0x7fffffff, -}; - -enum class MemorySemanticsMask : unsigned { - MaskNone = 0, - Acquire = 0x00000002, - Release = 0x00000004, - AcquireRelease = 0x00000008, - SequentiallyConsistent = 0x00000010, - UniformMemory = 0x00000040, - SubgroupMemory = 0x00000080, - WorkgroupMemory = 0x00000100, - CrossWorkgroupMemory = 0x00000200, - AtomicCounterMemory = 0x00000400, - ImageMemory = 0x00000800, - OutputMemory = 0x00001000, - OutputMemoryKHR = 0x00001000, - MakeAvailable = 0x00002000, - MakeAvailableKHR = 0x00002000, - MakeVisible = 0x00004000, - MakeVisibleKHR = 0x00004000, - Volatile = 0x00008000, -}; - -enum class MemoryAccessShift : unsigned { - Volatile = 0, - Aligned = 1, - Nontemporal = 2, - MakePointerAvailable = 3, - MakePointerAvailableKHR = 3, - MakePointerVisible = 4, - MakePointerVisibleKHR = 4, - NonPrivatePointer = 5, - NonPrivatePointerKHR = 5, - Max = 0x7fffffff, -}; - -enum class MemoryAccessMask : unsigned { - MaskNone = 0, - Volatile = 0x00000001, - Aligned = 0x00000002, - Nontemporal = 0x00000004, - MakePointerAvailable = 0x00000008, - MakePointerAvailableKHR = 0x00000008, - MakePointerVisible = 0x00000010, - MakePointerVisibleKHR = 0x00000010, - NonPrivatePointer = 0x00000020, - NonPrivatePointerKHR = 0x00000020, -}; - -enum class Scope : unsigned { - CrossDevice = 0, - Device = 1, - Workgroup = 2, - Subgroup = 3, - Invocation = 4, - QueueFamily = 5, - QueueFamilyKHR = 5, - ShaderCallKHR = 6, - Max = 0x7fffffff, -}; - -enum class GroupOperation : unsigned { - Reduce = 0, - InclusiveScan = 1, - ExclusiveScan = 2, - ClusteredReduce = 3, - PartitionedReduceNV = 6, - PartitionedInclusiveScanNV = 7, - PartitionedExclusiveScanNV = 8, - Max = 0x7fffffff, -}; - -enum class KernelEnqueueFlags : unsigned { - NoWait = 0, - WaitKernel = 1, - WaitWorkGroup = 2, - Max = 0x7fffffff, -}; - -enum class KernelProfilingInfoShift : unsigned { - CmdExecTime = 0, - Max = 0x7fffffff, -}; - -enum class KernelProfilingInfoMask : unsigned { - MaskNone = 0, - CmdExecTime = 0x00000001, -}; - -enum class Capability : unsigned { - Matrix = 0, - Shader = 1, - Geometry = 2, - Tessellation = 3, - Addresses = 4, - Linkage = 5, - Kernel = 6, - Vector16 = 7, - Float16Buffer = 8, - Float16 = 9, - Float64 = 10, - Int64 = 11, - Int64Atomics = 12, - ImageBasic = 13, - ImageReadWrite = 14, - ImageMipmap = 15, - Pipes = 17, - Groups = 18, - DeviceEnqueue = 19, - LiteralSampler = 20, - AtomicStorage = 21, - Int16 = 22, - TessellationPointSize = 23, - GeometryPointSize = 24, - ImageGatherExtended = 25, - StorageImageMultisample = 27, - UniformBufferArrayDynamicIndexing = 28, - SampledImageArrayDynamicIndexing = 29, - StorageBufferArrayDynamicIndexing = 30, - StorageImageArrayDynamicIndexing = 31, - ClipDistance = 32, - CullDistance = 33, - ImageCubeArray = 34, - SampleRateShading = 35, - ImageRect = 36, - SampledRect = 37, - GenericPointer = 38, - Int8 = 39, - InputAttachment = 40, - SparseResidency = 41, - MinLod = 42, - Sampled1D = 43, - Image1D = 44, - SampledCubeArray = 45, - SampledBuffer = 46, - ImageBuffer = 47, - ImageMSArray = 48, - StorageImageExtendedFormats = 49, - ImageQuery = 50, - DerivativeControl = 51, - InterpolationFunction = 52, - TransformFeedback = 53, - GeometryStreams = 54, - StorageImageReadWithoutFormat = 55, - StorageImageWriteWithoutFormat = 56, - MultiViewport = 57, - SubgroupDispatch = 58, - NamedBarrier = 59, - PipeStorage = 60, - GroupNonUniform = 61, - GroupNonUniformVote = 62, - GroupNonUniformArithmetic = 63, - GroupNonUniformBallot = 64, - GroupNonUniformShuffle = 65, - GroupNonUniformShuffleRelative = 66, - GroupNonUniformClustered = 67, - GroupNonUniformQuad = 68, - ShaderLayer = 69, - ShaderViewportIndex = 70, - FragmentShadingRateKHR = 4422, - SubgroupBallotKHR = 4423, - DrawParameters = 4427, - WorkgroupMemoryExplicitLayoutKHR = 4428, - WorkgroupMemoryExplicitLayout8BitAccessKHR = 4429, - WorkgroupMemoryExplicitLayout16BitAccessKHR = 4430, - SubgroupVoteKHR = 4431, - StorageBuffer16BitAccess = 4433, - StorageUniformBufferBlock16 = 4433, - StorageUniform16 = 4434, - UniformAndStorageBuffer16BitAccess = 4434, - StoragePushConstant16 = 4435, - StorageInputOutput16 = 4436, - DeviceGroup = 4437, - MultiView = 4439, - VariablePointersStorageBuffer = 4441, - VariablePointers = 4442, - AtomicStorageOps = 4445, - SampleMaskPostDepthCoverage = 4447, - StorageBuffer8BitAccess = 4448, - UniformAndStorageBuffer8BitAccess = 4449, - StoragePushConstant8 = 4450, - DenormPreserve = 4464, - DenormFlushToZero = 4465, - SignedZeroInfNanPreserve = 4466, - RoundingModeRTE = 4467, - RoundingModeRTZ = 4468, - RayQueryProvisionalKHR = 4471, - RayQueryKHR = 4472, - RayTraversalPrimitiveCullingKHR = 4478, - RayTracingKHR = 4479, - Float16ImageAMD = 5008, - ImageGatherBiasLodAMD = 5009, - FragmentMaskAMD = 5010, - StencilExportEXT = 5013, - ImageReadWriteLodAMD = 5015, - Int64ImageEXT = 5016, - ShaderClockKHR = 5055, - SampleMaskOverrideCoverageNV = 5249, - GeometryShaderPassthroughNV = 5251, - ShaderViewportIndexLayerEXT = 5254, - ShaderViewportIndexLayerNV = 5254, - ShaderViewportMaskNV = 5255, - ShaderStereoViewNV = 5259, - PerViewAttributesNV = 5260, - FragmentFullyCoveredEXT = 5265, - MeshShadingNV = 5266, - ImageFootprintNV = 5282, - FragmentBarycentricNV = 5284, - ComputeDerivativeGroupQuadsNV = 5288, - FragmentDensityEXT = 5291, - ShadingRateNV = 5291, - GroupNonUniformPartitionedNV = 5297, - ShaderNonUniform = 5301, - ShaderNonUniformEXT = 5301, - RuntimeDescriptorArray = 5302, - RuntimeDescriptorArrayEXT = 5302, - InputAttachmentArrayDynamicIndexing = 5303, - InputAttachmentArrayDynamicIndexingEXT = 5303, - UniformTexelBufferArrayDynamicIndexing = 5304, - UniformTexelBufferArrayDynamicIndexingEXT = 5304, - StorageTexelBufferArrayDynamicIndexing = 5305, - StorageTexelBufferArrayDynamicIndexingEXT = 5305, - UniformBufferArrayNonUniformIndexing = 5306, - UniformBufferArrayNonUniformIndexingEXT = 5306, - SampledImageArrayNonUniformIndexing = 5307, - SampledImageArrayNonUniformIndexingEXT = 5307, - StorageBufferArrayNonUniformIndexing = 5308, - StorageBufferArrayNonUniformIndexingEXT = 5308, - StorageImageArrayNonUniformIndexing = 5309, - StorageImageArrayNonUniformIndexingEXT = 5309, - InputAttachmentArrayNonUniformIndexing = 5310, - InputAttachmentArrayNonUniformIndexingEXT = 5310, - UniformTexelBufferArrayNonUniformIndexing = 5311, - UniformTexelBufferArrayNonUniformIndexingEXT = 5311, - StorageTexelBufferArrayNonUniformIndexing = 5312, - StorageTexelBufferArrayNonUniformIndexingEXT = 5312, - RayTracingNV = 5340, - RayTracingMotionBlurNV = 5341, - VulkanMemoryModel = 5345, - VulkanMemoryModelKHR = 5345, - VulkanMemoryModelDeviceScope = 5346, - VulkanMemoryModelDeviceScopeKHR = 5346, - PhysicalStorageBufferAddresses = 5347, - PhysicalStorageBufferAddressesEXT = 5347, - ComputeDerivativeGroupLinearNV = 5350, - RayTracingProvisionalKHR = 5353, - CooperativeMatrixNV = 5357, - FragmentShaderSampleInterlockEXT = 5363, - FragmentShaderShadingRateInterlockEXT = 5372, - ShaderSMBuiltinsNV = 5373, - FragmentShaderPixelInterlockEXT = 5378, - DemoteToHelperInvocationEXT = 5379, - SubgroupShuffleINTEL = 5568, - SubgroupBufferBlockIOINTEL = 5569, - SubgroupImageBlockIOINTEL = 5570, - SubgroupImageMediaBlockIOINTEL = 5579, - RoundToInfinityINTEL = 5582, - FloatingPointModeINTEL = 5583, - IntegerFunctions2INTEL = 5584, - FunctionPointersINTEL = 5603, - IndirectReferencesINTEL = 5604, - AsmINTEL = 5606, - AtomicFloat32MinMaxEXT = 5612, - AtomicFloat64MinMaxEXT = 5613, - AtomicFloat16MinMaxEXT = 5616, - VectorComputeINTEL = 5617, - VectorAnyINTEL = 5619, - ExpectAssumeKHR = 5629, - SubgroupAvcMotionEstimationINTEL = 5696, - SubgroupAvcMotionEstimationIntraINTEL = 5697, - SubgroupAvcMotionEstimationChromaINTEL = 5698, - VariableLengthArrayINTEL = 5817, - FunctionFloatControlINTEL = 5821, - FPGAMemoryAttributesINTEL = 5824, - FPFastMathModeINTEL = 5837, - ArbitraryPrecisionIntegersINTEL = 5844, - ArbitraryPrecisionFloatingPointINTEL = 5845, - UnstructuredLoopControlsINTEL = 5886, - FPGALoopControlsINTEL = 5888, - KernelAttributesINTEL = 5892, - FPGAKernelAttributesINTEL = 5897, - FPGAMemoryAccessesINTEL = 5898, - FPGAClusterAttributesINTEL = 5904, - LoopFuseINTEL = 5906, - FPGABufferLocationINTEL = 5920, - ArbitraryPrecisionFixedPointINTEL = 5922, - USMStorageClassesINTEL = 5935, - IOPipesINTEL = 5943, - BlockingPipesINTEL = 5945, - FPGARegINTEL = 5948, - DotProductInputAllKHR = 6016, - DotProductInput4x8BitKHR = 6017, - DotProductInput4x8BitPackedKHR = 6018, - DotProductKHR = 6019, - BitInstructions = 6025, - AtomicFloat32AddEXT = 6033, - AtomicFloat64AddEXT = 6034, - LongConstantCompositeINTEL = 6089, - OptNoneINTEL = 6094, - AtomicFloat16AddEXT = 6095, - DebugInfoModuleINTEL = 6114, - Max = 0x7fffffff, -}; - -enum class RayFlagsShift : unsigned { - OpaqueKHR = 0, - NoOpaqueKHR = 1, - TerminateOnFirstHitKHR = 2, - SkipClosestHitShaderKHR = 3, - CullBackFacingTrianglesKHR = 4, - CullFrontFacingTrianglesKHR = 5, - CullOpaqueKHR = 6, - CullNoOpaqueKHR = 7, - SkipTrianglesKHR = 8, - SkipAABBsKHR = 9, - Max = 0x7fffffff, -}; - -enum class RayFlagsMask : unsigned { - MaskNone = 0, - OpaqueKHR = 0x00000001, - NoOpaqueKHR = 0x00000002, - TerminateOnFirstHitKHR = 0x00000004, - SkipClosestHitShaderKHR = 0x00000008, - CullBackFacingTrianglesKHR = 0x00000010, - CullFrontFacingTrianglesKHR = 0x00000020, - CullOpaqueKHR = 0x00000040, - CullNoOpaqueKHR = 0x00000080, - SkipTrianglesKHR = 0x00000100, - SkipAABBsKHR = 0x00000200, -}; - -enum class RayQueryIntersection : unsigned { - RayQueryCandidateIntersectionKHR = 0, - RayQueryCommittedIntersectionKHR = 1, - Max = 0x7fffffff, -}; - -enum class RayQueryCommittedIntersectionType : unsigned { - RayQueryCommittedIntersectionNoneKHR = 0, - RayQueryCommittedIntersectionTriangleKHR = 1, - RayQueryCommittedIntersectionGeneratedKHR = 2, - Max = 0x7fffffff, -}; - -enum class RayQueryCandidateIntersectionType : unsigned { - RayQueryCandidateIntersectionTriangleKHR = 0, - RayQueryCandidateIntersectionAABBKHR = 1, - Max = 0x7fffffff, -}; - -enum class FragmentShadingRateShift : unsigned { - Vertical2Pixels = 0, - Vertical4Pixels = 1, - Horizontal2Pixels = 2, - Horizontal4Pixels = 3, - Max = 0x7fffffff, -}; - -enum class FragmentShadingRateMask : unsigned { - MaskNone = 0, - Vertical2Pixels = 0x00000001, - Vertical4Pixels = 0x00000002, - Horizontal2Pixels = 0x00000004, - Horizontal4Pixels = 0x00000008, -}; - -enum class FPDenormMode : unsigned { - Preserve = 0, - FlushToZero = 1, - Max = 0x7fffffff, -}; - -enum class FPOperationMode : unsigned { - IEEE = 0, - ALT = 1, - Max = 0x7fffffff, -}; - -enum class QuantizationModes : unsigned { - TRN = 0, - TRN_ZERO = 1, - RND = 2, - RND_ZERO = 3, - RND_INF = 4, - RND_MIN_INF = 5, - RND_CONV = 6, - RND_CONV_ODD = 7, - Max = 0x7fffffff, -}; - -enum class OverflowModes : unsigned { - WRAP = 0, - SAT = 1, - SAT_ZERO = 2, - SAT_SYM = 3, - Max = 0x7fffffff, -}; - -enum class PackedVectorFormat : unsigned { - PackedVectorFormat4x8BitKHR = 0, - Max = 0x7fffffff, -}; - -enum class Op : unsigned { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, - OpImageSparseRead = 320, - OpSizeOf = 321, - OpTypePipeStorage = 322, - OpConstantPipeStorage = 323, - OpCreatePipeFromPipeStorage = 324, - OpGetKernelLocalSizeForSubgroupCount = 325, - OpGetKernelMaxNumSubgroups = 326, - OpTypeNamedBarrier = 327, - OpNamedBarrierInitialize = 328, - OpMemoryNamedBarrier = 329, - OpModuleProcessed = 330, - OpExecutionModeId = 331, - OpDecorateId = 332, - OpGroupNonUniformElect = 333, - OpGroupNonUniformAll = 334, - OpGroupNonUniformAny = 335, - OpGroupNonUniformAllEqual = 336, - OpGroupNonUniformBroadcast = 337, - OpGroupNonUniformBroadcastFirst = 338, - OpGroupNonUniformBallot = 339, - OpGroupNonUniformInverseBallot = 340, - OpGroupNonUniformBallotBitExtract = 341, - OpGroupNonUniformBallotBitCount = 342, - OpGroupNonUniformBallotFindLSB = 343, - OpGroupNonUniformBallotFindMSB = 344, - OpGroupNonUniformShuffle = 345, - OpGroupNonUniformShuffleXor = 346, - OpGroupNonUniformShuffleUp = 347, - OpGroupNonUniformShuffleDown = 348, - OpGroupNonUniformIAdd = 349, - OpGroupNonUniformFAdd = 350, - OpGroupNonUniformIMul = 351, - OpGroupNonUniformFMul = 352, - OpGroupNonUniformSMin = 353, - OpGroupNonUniformUMin = 354, - OpGroupNonUniformFMin = 355, - OpGroupNonUniformSMax = 356, - OpGroupNonUniformUMax = 357, - OpGroupNonUniformFMax = 358, - OpGroupNonUniformBitwiseAnd = 359, - OpGroupNonUniformBitwiseOr = 360, - OpGroupNonUniformBitwiseXor = 361, - OpGroupNonUniformLogicalAnd = 362, - OpGroupNonUniformLogicalOr = 363, - OpGroupNonUniformLogicalXor = 364, - OpGroupNonUniformQuadBroadcast = 365, - OpGroupNonUniformQuadSwap = 366, - OpCopyLogical = 400, - OpPtrEqual = 401, - OpPtrNotEqual = 402, - OpPtrDiff = 403, - OpTerminateInvocation = 4416, - OpSubgroupBallotKHR = 4421, - OpSubgroupFirstInvocationKHR = 4422, - OpSubgroupAllKHR = 4428, - OpSubgroupAnyKHR = 4429, - OpSubgroupAllEqualKHR = 4430, - OpSubgroupReadInvocationKHR = 4432, - OpTraceRayKHR = 4445, - OpExecuteCallableKHR = 4446, - OpConvertUToAccelerationStructureKHR = 4447, - OpIgnoreIntersectionKHR = 4448, - OpTerminateRayKHR = 4449, - OpSDotKHR = 4450, - OpUDotKHR = 4451, - OpSUDotKHR = 4452, - OpSDotAccSatKHR = 4453, - OpUDotAccSatKHR = 4454, - OpSUDotAccSatKHR = 4455, - OpTypeRayQueryKHR = 4472, - OpRayQueryInitializeKHR = 4473, - OpRayQueryTerminateKHR = 4474, - OpRayQueryGenerateIntersectionKHR = 4475, - OpRayQueryConfirmIntersectionKHR = 4476, - OpRayQueryProceedKHR = 4477, - OpRayQueryGetIntersectionTypeKHR = 4479, - OpGroupIAddNonUniformAMD = 5000, - OpGroupFAddNonUniformAMD = 5001, - OpGroupFMinNonUniformAMD = 5002, - OpGroupUMinNonUniformAMD = 5003, - OpGroupSMinNonUniformAMD = 5004, - OpGroupFMaxNonUniformAMD = 5005, - OpGroupUMaxNonUniformAMD = 5006, - OpGroupSMaxNonUniformAMD = 5007, - OpFragmentMaskFetchAMD = 5011, - OpFragmentFetchAMD = 5012, - OpReadClockKHR = 5056, - OpImageSampleFootprintNV = 5283, - OpGroupNonUniformPartitionNV = 5296, - OpWritePackedPrimitiveIndices4x8NV = 5299, - OpReportIntersectionKHR = 5334, - OpReportIntersectionNV = 5334, - OpIgnoreIntersectionNV = 5335, - OpTerminateRayNV = 5336, - OpTraceNV = 5337, - OpTraceMotionNV = 5338, - OpTraceRayMotionNV = 5339, - OpTypeAccelerationStructureKHR = 5341, - OpTypeAccelerationStructureNV = 5341, - OpExecuteCallableNV = 5344, - OpTypeCooperativeMatrixNV = 5358, - OpCooperativeMatrixLoadNV = 5359, - OpCooperativeMatrixStoreNV = 5360, - OpCooperativeMatrixMulAddNV = 5361, - OpCooperativeMatrixLengthNV = 5362, - OpBeginInvocationInterlockEXT = 5364, - OpEndInvocationInterlockEXT = 5365, - OpDemoteToHelperInvocationEXT = 5380, - OpIsHelperInvocationEXT = 5381, - OpSubgroupShuffleINTEL = 5571, - OpSubgroupShuffleDownINTEL = 5572, - OpSubgroupShuffleUpINTEL = 5573, - OpSubgroupShuffleXorINTEL = 5574, - OpSubgroupBlockReadINTEL = 5575, - OpSubgroupBlockWriteINTEL = 5576, - OpSubgroupImageBlockReadINTEL = 5577, - OpSubgroupImageBlockWriteINTEL = 5578, - OpSubgroupImageMediaBlockReadINTEL = 5580, - OpSubgroupImageMediaBlockWriteINTEL = 5581, - OpUCountLeadingZerosINTEL = 5585, - OpUCountTrailingZerosINTEL = 5586, - OpAbsISubINTEL = 5587, - OpAbsUSubINTEL = 5588, - OpIAddSatINTEL = 5589, - OpUAddSatINTEL = 5590, - OpIAverageINTEL = 5591, - OpUAverageINTEL = 5592, - OpIAverageRoundedINTEL = 5593, - OpUAverageRoundedINTEL = 5594, - OpISubSatINTEL = 5595, - OpUSubSatINTEL = 5596, - OpIMul32x16INTEL = 5597, - OpUMul32x16INTEL = 5598, - OpConstFunctionPointerINTEL = 5600, - OpFunctionPointerCallINTEL = 5601, - OpAsmTargetINTEL = 5609, - OpAsmINTEL = 5610, - OpAsmCallINTEL = 5611, - OpAtomicFMinEXT = 5614, - OpAtomicFMaxEXT = 5615, - OpAssumeTrueKHR = 5630, - OpExpectKHR = 5631, - OpDecorateString = 5632, - OpDecorateStringGOOGLE = 5632, - OpMemberDecorateString = 5633, - OpMemberDecorateStringGOOGLE = 5633, - OpVmeImageINTEL = 5699, - OpTypeVmeImageINTEL = 5700, - OpTypeAvcImePayloadINTEL = 5701, - OpTypeAvcRefPayloadINTEL = 5702, - OpTypeAvcSicPayloadINTEL = 5703, - OpTypeAvcMcePayloadINTEL = 5704, - OpTypeAvcMceResultINTEL = 5705, - OpTypeAvcImeResultINTEL = 5706, - OpTypeAvcImeResultSingleReferenceStreamoutINTEL = 5707, - OpTypeAvcImeResultDualReferenceStreamoutINTEL = 5708, - OpTypeAvcImeSingleReferenceStreaminINTEL = 5709, - OpTypeAvcImeDualReferenceStreaminINTEL = 5710, - OpTypeAvcRefResultINTEL = 5711, - OpTypeAvcSicResultINTEL = 5712, - OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL = 5713, - OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL = 5714, - OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL = 5715, - OpSubgroupAvcMceSetInterShapePenaltyINTEL = 5716, - OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL = 5717, - OpSubgroupAvcMceSetInterDirectionPenaltyINTEL = 5718, - OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL = 5719, - OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL = 5720, - OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL = 5721, - OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL = 5722, - OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL = 5723, - OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL = 5724, - OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL = 5725, - OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL = 5726, - OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL = 5727, - OpSubgroupAvcMceSetAcOnlyHaarINTEL = 5728, - OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL = 5729, - OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL = 5730, - OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL = 5731, - OpSubgroupAvcMceConvertToImePayloadINTEL = 5732, - OpSubgroupAvcMceConvertToImeResultINTEL = 5733, - OpSubgroupAvcMceConvertToRefPayloadINTEL = 5734, - OpSubgroupAvcMceConvertToRefResultINTEL = 5735, - OpSubgroupAvcMceConvertToSicPayloadINTEL = 5736, - OpSubgroupAvcMceConvertToSicResultINTEL = 5737, - OpSubgroupAvcMceGetMotionVectorsINTEL = 5738, - OpSubgroupAvcMceGetInterDistortionsINTEL = 5739, - OpSubgroupAvcMceGetBestInterDistortionsINTEL = 5740, - OpSubgroupAvcMceGetInterMajorShapeINTEL = 5741, - OpSubgroupAvcMceGetInterMinorShapeINTEL = 5742, - OpSubgroupAvcMceGetInterDirectionsINTEL = 5743, - OpSubgroupAvcMceGetInterMotionVectorCountINTEL = 5744, - OpSubgroupAvcMceGetInterReferenceIdsINTEL = 5745, - OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL = 5746, - OpSubgroupAvcImeInitializeINTEL = 5747, - OpSubgroupAvcImeSetSingleReferenceINTEL = 5748, - OpSubgroupAvcImeSetDualReferenceINTEL = 5749, - OpSubgroupAvcImeRefWindowSizeINTEL = 5750, - OpSubgroupAvcImeAdjustRefOffsetINTEL = 5751, - OpSubgroupAvcImeConvertToMcePayloadINTEL = 5752, - OpSubgroupAvcImeSetMaxMotionVectorCountINTEL = 5753, - OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL = 5754, - OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL = 5755, - OpSubgroupAvcImeSetWeightedSadINTEL = 5756, - OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL = 5757, - OpSubgroupAvcImeEvaluateWithDualReferenceINTEL = 5758, - OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL = 5759, - OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL = 5760, - OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL = 5761, - OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL = 5762, - OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL = 5763, - OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL = 5764, - OpSubgroupAvcImeConvertToMceResultINTEL = 5765, - OpSubgroupAvcImeGetSingleReferenceStreaminINTEL = 5766, - OpSubgroupAvcImeGetDualReferenceStreaminINTEL = 5767, - OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL = 5768, - OpSubgroupAvcImeStripDualReferenceStreamoutINTEL = 5769, - OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL = 5770, - OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL = 5771, - OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL = 5772, - OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL = 5773, - OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL = 5774, - OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL = 5775, - OpSubgroupAvcImeGetBorderReachedINTEL = 5776, - OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL = 5777, - OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL = 5778, - OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL = 5779, - OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL = 5780, - OpSubgroupAvcFmeInitializeINTEL = 5781, - OpSubgroupAvcBmeInitializeINTEL = 5782, - OpSubgroupAvcRefConvertToMcePayloadINTEL = 5783, - OpSubgroupAvcRefSetBidirectionalMixDisableINTEL = 5784, - OpSubgroupAvcRefSetBilinearFilterEnableINTEL = 5785, - OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL = 5786, - OpSubgroupAvcRefEvaluateWithDualReferenceINTEL = 5787, - OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL = 5788, - OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL = 5789, - OpSubgroupAvcRefConvertToMceResultINTEL = 5790, - OpSubgroupAvcSicInitializeINTEL = 5791, - OpSubgroupAvcSicConfigureSkcINTEL = 5792, - OpSubgroupAvcSicConfigureIpeLumaINTEL = 5793, - OpSubgroupAvcSicConfigureIpeLumaChromaINTEL = 5794, - OpSubgroupAvcSicGetMotionVectorMaskINTEL = 5795, - OpSubgroupAvcSicConvertToMcePayloadINTEL = 5796, - OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL = 5797, - OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL = 5798, - OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL = 5799, - OpSubgroupAvcSicSetBilinearFilterEnableINTEL = 5800, - OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL = 5801, - OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL = 5802, - OpSubgroupAvcSicEvaluateIpeINTEL = 5803, - OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL = 5804, - OpSubgroupAvcSicEvaluateWithDualReferenceINTEL = 5805, - OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL = 5806, - OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL = 5807, - OpSubgroupAvcSicConvertToMceResultINTEL = 5808, - OpSubgroupAvcSicGetIpeLumaShapeINTEL = 5809, - OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL = 5810, - OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL = 5811, - OpSubgroupAvcSicGetPackedIpeLumaModesINTEL = 5812, - OpSubgroupAvcSicGetIpeChromaModeINTEL = 5813, - OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL = 5814, - OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL = 5815, - OpSubgroupAvcSicGetInterRawSadsINTEL = 5816, - OpVariableLengthArrayINTEL = 5818, - OpSaveMemoryINTEL = 5819, - OpRestoreMemoryINTEL = 5820, - OpArbitraryFloatSinCosPiINTEL = 5840, - OpArbitraryFloatCastINTEL = 5841, - OpArbitraryFloatCastFromIntINTEL = 5842, - OpArbitraryFloatCastToIntINTEL = 5843, - OpArbitraryFloatAddINTEL = 5846, - OpArbitraryFloatSubINTEL = 5847, - OpArbitraryFloatMulINTEL = 5848, - OpArbitraryFloatDivINTEL = 5849, - OpArbitraryFloatGTINTEL = 5850, - OpArbitraryFloatGEINTEL = 5851, - OpArbitraryFloatLTINTEL = 5852, - OpArbitraryFloatLEINTEL = 5853, - OpArbitraryFloatEQINTEL = 5854, - OpArbitraryFloatRecipINTEL = 5855, - OpArbitraryFloatRSqrtINTEL = 5856, - OpArbitraryFloatCbrtINTEL = 5857, - OpArbitraryFloatHypotINTEL = 5858, - OpArbitraryFloatSqrtINTEL = 5859, - OpArbitraryFloatLogINTEL = 5860, - OpArbitraryFloatLog2INTEL = 5861, - OpArbitraryFloatLog10INTEL = 5862, - OpArbitraryFloatLog1pINTEL = 5863, - OpArbitraryFloatExpINTEL = 5864, - OpArbitraryFloatExp2INTEL = 5865, - OpArbitraryFloatExp10INTEL = 5866, - OpArbitraryFloatExpm1INTEL = 5867, - OpArbitraryFloatSinINTEL = 5868, - OpArbitraryFloatCosINTEL = 5869, - OpArbitraryFloatSinCosINTEL = 5870, - OpArbitraryFloatSinPiINTEL = 5871, - OpArbitraryFloatCosPiINTEL = 5872, - OpArbitraryFloatASinINTEL = 5873, - OpArbitraryFloatASinPiINTEL = 5874, - OpArbitraryFloatACosINTEL = 5875, - OpArbitraryFloatACosPiINTEL = 5876, - OpArbitraryFloatATanINTEL = 5877, - OpArbitraryFloatATanPiINTEL = 5878, - OpArbitraryFloatATan2INTEL = 5879, - OpArbitraryFloatPowINTEL = 5880, - OpArbitraryFloatPowRINTEL = 5881, - OpArbitraryFloatPowNINTEL = 5882, - OpLoopControlINTEL = 5887, - OpFixedSqrtINTEL = 5923, - OpFixedRecipINTEL = 5924, - OpFixedRsqrtINTEL = 5925, - OpFixedSinINTEL = 5926, - OpFixedCosINTEL = 5927, - OpFixedSinCosINTEL = 5928, - OpFixedSinPiINTEL = 5929, - OpFixedCosPiINTEL = 5930, - OpFixedSinCosPiINTEL = 5931, - OpFixedLogINTEL = 5932, - OpFixedExpINTEL = 5933, - OpPtrCastToCrossWorkgroupINTEL = 5934, - OpCrossWorkgroupCastToPtrINTEL = 5938, - OpReadPipeBlockingINTEL = 5946, - OpWritePipeBlockingINTEL = 5947, - OpFPGARegINTEL = 5949, - OpRayQueryGetRayTMinKHR = 6016, - OpRayQueryGetRayFlagsKHR = 6017, - OpRayQueryGetIntersectionTKHR = 6018, - OpRayQueryGetIntersectionInstanceCustomIndexKHR = 6019, - OpRayQueryGetIntersectionInstanceIdKHR = 6020, - OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR = 6021, - OpRayQueryGetIntersectionGeometryIndexKHR = 6022, - OpRayQueryGetIntersectionPrimitiveIndexKHR = 6023, - OpRayQueryGetIntersectionBarycentricsKHR = 6024, - OpRayQueryGetIntersectionFrontFaceKHR = 6025, - OpRayQueryGetIntersectionCandidateAABBOpaqueKHR = 6026, - OpRayQueryGetIntersectionObjectRayDirectionKHR = 6027, - OpRayQueryGetIntersectionObjectRayOriginKHR = 6028, - OpRayQueryGetWorldRayDirectionKHR = 6029, - OpRayQueryGetWorldRayOriginKHR = 6030, - OpRayQueryGetIntersectionObjectToWorldKHR = 6031, - OpRayQueryGetIntersectionWorldToObjectKHR = 6032, - OpAtomicFAddEXT = 6035, - OpTypeBufferSurfaceINTEL = 6086, - OpTypeStructContinuedINTEL = 6090, - OpConstantCompositeContinuedINTEL = 6091, - OpSpecConstantCompositeContinuedINTEL = 6092, - Max = 0x7fffffff, -}; - -#ifdef SPV_ENABLE_UTILITY_CODE -inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { - *hasResult = *hasResultType = false; - switch (opcode) { - default: /* unknown opcode */ break; - case Op::OpNop: *hasResult = false; *hasResultType = false; break; - case Op::OpUndef: *hasResult = true; *hasResultType = true; break; - case Op::OpSourceContinued: *hasResult = false; *hasResultType = false; break; - case Op::OpSource: *hasResult = false; *hasResultType = false; break; - case Op::OpSourceExtension: *hasResult = false; *hasResultType = false; break; - case Op::OpName: *hasResult = false; *hasResultType = false; break; - case Op::OpMemberName: *hasResult = false; *hasResultType = false; break; - case Op::OpString: *hasResult = true; *hasResultType = false; break; - case Op::OpLine: *hasResult = false; *hasResultType = false; break; - case Op::OpExtension: *hasResult = false; *hasResultType = false; break; - case Op::OpExtInstImport: *hasResult = true; *hasResultType = false; break; - case Op::OpExtInst: *hasResult = true; *hasResultType = true; break; - case Op::OpMemoryModel: *hasResult = false; *hasResultType = false; break; - case Op::OpEntryPoint: *hasResult = false; *hasResultType = false; break; - case Op::OpExecutionMode: *hasResult = false; *hasResultType = false; break; - case Op::OpCapability: *hasResult = false; *hasResultType = false; break; - case Op::OpTypeVoid: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeBool: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeInt: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeFloat: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeVector: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeMatrix: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeImage: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeSampler: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeSampledImage: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeArray: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeRuntimeArray: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeStruct: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeOpaque: *hasResult = true; *hasResultType = false; break; - case Op::OpTypePointer: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeFunction: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeEvent: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeDeviceEvent: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeReserveId: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeQueue: *hasResult = true; *hasResultType = false; break; - case Op::OpTypePipe: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeForwardPointer: *hasResult = false; *hasResultType = false; break; - case Op::OpConstantTrue: *hasResult = true; *hasResultType = true; break; - case Op::OpConstantFalse: *hasResult = true; *hasResultType = true; break; - case Op::OpConstant: *hasResult = true; *hasResultType = true; break; - case Op::OpConstantComposite: *hasResult = true; *hasResultType = true; break; - case Op::OpConstantSampler: *hasResult = true; *hasResultType = true; break; - case Op::OpConstantNull: *hasResult = true; *hasResultType = true; break; - case Op::OpSpecConstantTrue: *hasResult = true; *hasResultType = true; break; - case Op::OpSpecConstantFalse: *hasResult = true; *hasResultType = true; break; - case Op::OpSpecConstant: *hasResult = true; *hasResultType = true; break; - case Op::OpSpecConstantComposite: *hasResult = true; *hasResultType = true; break; - case Op::OpSpecConstantOp: *hasResult = true; *hasResultType = true; break; - case Op::OpFunction: *hasResult = true; *hasResultType = true; break; - case Op::OpFunctionParameter: *hasResult = true; *hasResultType = true; break; - case Op::OpFunctionEnd: *hasResult = false; *hasResultType = false; break; - case Op::OpFunctionCall: *hasResult = true; *hasResultType = true; break; - case Op::OpVariable: *hasResult = true; *hasResultType = true; break; - case Op::OpImageTexelPointer: *hasResult = true; *hasResultType = true; break; - case Op::OpLoad: *hasResult = true; *hasResultType = true; break; - case Op::OpStore: *hasResult = false; *hasResultType = false; break; - case Op::OpCopyMemory: *hasResult = false; *hasResultType = false; break; - case Op::OpCopyMemorySized: *hasResult = false; *hasResultType = false; break; - case Op::OpAccessChain: *hasResult = true; *hasResultType = true; break; - case Op::OpInBoundsAccessChain: *hasResult = true; *hasResultType = true; break; - case Op::OpPtrAccessChain: *hasResult = true; *hasResultType = true; break; - case Op::OpArrayLength: *hasResult = true; *hasResultType = true; break; - case Op::OpGenericPtrMemSemantics: *hasResult = true; *hasResultType = true; break; - case Op::OpInBoundsPtrAccessChain: *hasResult = true; *hasResultType = true; break; - case Op::OpDecorate: *hasResult = false; *hasResultType = false; break; - case Op::OpMemberDecorate: *hasResult = false; *hasResultType = false; break; - case Op::OpDecorationGroup: *hasResult = true; *hasResultType = false; break; - case Op::OpGroupDecorate: *hasResult = false; *hasResultType = false; break; - case Op::OpGroupMemberDecorate: *hasResult = false; *hasResultType = false; break; - case Op::OpVectorExtractDynamic: *hasResult = true; *hasResultType = true; break; - case Op::OpVectorInsertDynamic: *hasResult = true; *hasResultType = true; break; - case Op::OpVectorShuffle: *hasResult = true; *hasResultType = true; break; - case Op::OpCompositeConstruct: *hasResult = true; *hasResultType = true; break; - case Op::OpCompositeExtract: *hasResult = true; *hasResultType = true; break; - case Op::OpCompositeInsert: *hasResult = true; *hasResultType = true; break; - case Op::OpCopyObject: *hasResult = true; *hasResultType = true; break; - case Op::OpTranspose: *hasResult = true; *hasResultType = true; break; - case Op::OpSampledImage: *hasResult = true; *hasResultType = true; break; - case Op::OpImageSampleImplicitLod: *hasResult = true; *hasResultType = true; break; - case Op::OpImageSampleExplicitLod: *hasResult = true; *hasResultType = true; break; - case Op::OpImageSampleDrefImplicitLod: *hasResult = true; *hasResultType = true; break; - case Op::OpImageSampleDrefExplicitLod: *hasResult = true; *hasResultType = true; break; - case Op::OpImageSampleProjImplicitLod: *hasResult = true; *hasResultType = true; break; - case Op::OpImageSampleProjExplicitLod: *hasResult = true; *hasResultType = true; break; - case Op::OpImageSampleProjDrefImplicitLod: *hasResult = true; *hasResultType = true; break; - case Op::OpImageSampleProjDrefExplicitLod: *hasResult = true; *hasResultType = true; break; - case Op::OpImageFetch: *hasResult = true; *hasResultType = true; break; - case Op::OpImageGather: *hasResult = true; *hasResultType = true; break; - case Op::OpImageDrefGather: *hasResult = true; *hasResultType = true; break; - case Op::OpImageRead: *hasResult = true; *hasResultType = true; break; - case Op::OpImageWrite: *hasResult = false; *hasResultType = false; break; - case Op::OpImage: *hasResult = true; *hasResultType = true; break; - case Op::OpImageQueryFormat: *hasResult = true; *hasResultType = true; break; - case Op::OpImageQueryOrder: *hasResult = true; *hasResultType = true; break; - case Op::OpImageQuerySizeLod: *hasResult = true; *hasResultType = true; break; - case Op::OpImageQuerySize: *hasResult = true; *hasResultType = true; break; - case Op::OpImageQueryLod: *hasResult = true; *hasResultType = true; break; - case Op::OpImageQueryLevels: *hasResult = true; *hasResultType = true; break; - case Op::OpImageQuerySamples: *hasResult = true; *hasResultType = true; break; - case Op::OpConvertFToU: *hasResult = true; *hasResultType = true; break; - case Op::OpConvertFToS: *hasResult = true; *hasResultType = true; break; - case Op::OpConvertSToF: *hasResult = true; *hasResultType = true; break; - case Op::OpConvertUToF: *hasResult = true; *hasResultType = true; break; - case Op::OpUConvert: *hasResult = true; *hasResultType = true; break; - case Op::OpSConvert: *hasResult = true; *hasResultType = true; break; - case Op::OpFConvert: *hasResult = true; *hasResultType = true; break; - case Op::OpQuantizeToF16: *hasResult = true; *hasResultType = true; break; - case Op::OpConvertPtrToU: *hasResult = true; *hasResultType = true; break; - case Op::OpSatConvertSToU: *hasResult = true; *hasResultType = true; break; - case Op::OpSatConvertUToS: *hasResult = true; *hasResultType = true; break; - case Op::OpConvertUToPtr: *hasResult = true; *hasResultType = true; break; - case Op::OpPtrCastToGeneric: *hasResult = true; *hasResultType = true; break; - case Op::OpGenericCastToPtr: *hasResult = true; *hasResultType = true; break; - case Op::OpGenericCastToPtrExplicit: *hasResult = true; *hasResultType = true; break; - case Op::OpBitcast: *hasResult = true; *hasResultType = true; break; - case Op::OpSNegate: *hasResult = true; *hasResultType = true; break; - case Op::OpFNegate: *hasResult = true; *hasResultType = true; break; - case Op::OpIAdd: *hasResult = true; *hasResultType = true; break; - case Op::OpFAdd: *hasResult = true; *hasResultType = true; break; - case Op::OpISub: *hasResult = true; *hasResultType = true; break; - case Op::OpFSub: *hasResult = true; *hasResultType = true; break; - case Op::OpIMul: *hasResult = true; *hasResultType = true; break; - case Op::OpFMul: *hasResult = true; *hasResultType = true; break; - case Op::OpUDiv: *hasResult = true; *hasResultType = true; break; - case Op::OpSDiv: *hasResult = true; *hasResultType = true; break; - case Op::OpFDiv: *hasResult = true; *hasResultType = true; break; - case Op::OpUMod: *hasResult = true; *hasResultType = true; break; - case Op::OpSRem: *hasResult = true; *hasResultType = true; break; - case Op::OpSMod: *hasResult = true; *hasResultType = true; break; - case Op::OpFRem: *hasResult = true; *hasResultType = true; break; - case Op::OpFMod: *hasResult = true; *hasResultType = true; break; - case Op::OpVectorTimesScalar: *hasResult = true; *hasResultType = true; break; - case Op::OpMatrixTimesScalar: *hasResult = true; *hasResultType = true; break; - case Op::OpVectorTimesMatrix: *hasResult = true; *hasResultType = true; break; - case Op::OpMatrixTimesVector: *hasResult = true; *hasResultType = true; break; - case Op::OpMatrixTimesMatrix: *hasResult = true; *hasResultType = true; break; - case Op::OpOuterProduct: *hasResult = true; *hasResultType = true; break; - case Op::OpDot: *hasResult = true; *hasResultType = true; break; - case Op::OpIAddCarry: *hasResult = true; *hasResultType = true; break; - case Op::OpISubBorrow: *hasResult = true; *hasResultType = true; break; - case Op::OpUMulExtended: *hasResult = true; *hasResultType = true; break; - case Op::OpSMulExtended: *hasResult = true; *hasResultType = true; break; - case Op::OpAny: *hasResult = true; *hasResultType = true; break; - case Op::OpAll: *hasResult = true; *hasResultType = true; break; - case Op::OpIsNan: *hasResult = true; *hasResultType = true; break; - case Op::OpIsInf: *hasResult = true; *hasResultType = true; break; - case Op::OpIsFinite: *hasResult = true; *hasResultType = true; break; - case Op::OpIsNormal: *hasResult = true; *hasResultType = true; break; - case Op::OpSignBitSet: *hasResult = true; *hasResultType = true; break; - case Op::OpLessOrGreater: *hasResult = true; *hasResultType = true; break; - case Op::OpOrdered: *hasResult = true; *hasResultType = true; break; - case Op::OpUnordered: *hasResult = true; *hasResultType = true; break; - case Op::OpLogicalEqual: *hasResult = true; *hasResultType = true; break; - case Op::OpLogicalNotEqual: *hasResult = true; *hasResultType = true; break; - case Op::OpLogicalOr: *hasResult = true; *hasResultType = true; break; - case Op::OpLogicalAnd: *hasResult = true; *hasResultType = true; break; - case Op::OpLogicalNot: *hasResult = true; *hasResultType = true; break; - case Op::OpSelect: *hasResult = true; *hasResultType = true; break; - case Op::OpIEqual: *hasResult = true; *hasResultType = true; break; - case Op::OpINotEqual: *hasResult = true; *hasResultType = true; break; - case Op::OpUGreaterThan: *hasResult = true; *hasResultType = true; break; - case Op::OpSGreaterThan: *hasResult = true; *hasResultType = true; break; - case Op::OpUGreaterThanEqual: *hasResult = true; *hasResultType = true; break; - case Op::OpSGreaterThanEqual: *hasResult = true; *hasResultType = true; break; - case Op::OpULessThan: *hasResult = true; *hasResultType = true; break; - case Op::OpSLessThan: *hasResult = true; *hasResultType = true; break; - case Op::OpULessThanEqual: *hasResult = true; *hasResultType = true; break; - case Op::OpSLessThanEqual: *hasResult = true; *hasResultType = true; break; - case Op::OpFOrdEqual: *hasResult = true; *hasResultType = true; break; - case Op::OpFUnordEqual: *hasResult = true; *hasResultType = true; break; - case Op::OpFOrdNotEqual: *hasResult = true; *hasResultType = true; break; - case Op::OpFUnordNotEqual: *hasResult = true; *hasResultType = true; break; - case Op::OpFOrdLessThan: *hasResult = true; *hasResultType = true; break; - case Op::OpFUnordLessThan: *hasResult = true; *hasResultType = true; break; - case Op::OpFOrdGreaterThan: *hasResult = true; *hasResultType = true; break; - case Op::OpFUnordGreaterThan: *hasResult = true; *hasResultType = true; break; - case Op::OpFOrdLessThanEqual: *hasResult = true; *hasResultType = true; break; - case Op::OpFUnordLessThanEqual: *hasResult = true; *hasResultType = true; break; - case Op::OpFOrdGreaterThanEqual: *hasResult = true; *hasResultType = true; break; - case Op::OpFUnordGreaterThanEqual: *hasResult = true; *hasResultType = true; break; - case Op::OpShiftRightLogical: *hasResult = true; *hasResultType = true; break; - case Op::OpShiftRightArithmetic: *hasResult = true; *hasResultType = true; break; - case Op::OpShiftLeftLogical: *hasResult = true; *hasResultType = true; break; - case Op::OpBitwiseOr: *hasResult = true; *hasResultType = true; break; - case Op::OpBitwiseXor: *hasResult = true; *hasResultType = true; break; - case Op::OpBitwiseAnd: *hasResult = true; *hasResultType = true; break; - case Op::OpNot: *hasResult = true; *hasResultType = true; break; - case Op::OpBitFieldInsert: *hasResult = true; *hasResultType = true; break; - case Op::OpBitFieldSExtract: *hasResult = true; *hasResultType = true; break; - case Op::OpBitFieldUExtract: *hasResult = true; *hasResultType = true; break; - case Op::OpBitReverse: *hasResult = true; *hasResultType = true; break; - case Op::OpBitCount: *hasResult = true; *hasResultType = true; break; - case Op::OpDPdx: *hasResult = true; *hasResultType = true; break; - case Op::OpDPdy: *hasResult = true; *hasResultType = true; break; - case Op::OpFwidth: *hasResult = true; *hasResultType = true; break; - case Op::OpDPdxFine: *hasResult = true; *hasResultType = true; break; - case Op::OpDPdyFine: *hasResult = true; *hasResultType = true; break; - case Op::OpFwidthFine: *hasResult = true; *hasResultType = true; break; - case Op::OpDPdxCoarse: *hasResult = true; *hasResultType = true; break; - case Op::OpDPdyCoarse: *hasResult = true; *hasResultType = true; break; - case Op::OpFwidthCoarse: *hasResult = true; *hasResultType = true; break; - case Op::OpEmitVertex: *hasResult = false; *hasResultType = false; break; - case Op::OpEndPrimitive: *hasResult = false; *hasResultType = false; break; - case Op::OpEmitStreamVertex: *hasResult = false; *hasResultType = false; break; - case Op::OpEndStreamPrimitive: *hasResult = false; *hasResultType = false; break; - case Op::OpControlBarrier: *hasResult = false; *hasResultType = false; break; - case Op::OpMemoryBarrier: *hasResult = false; *hasResultType = false; break; - case Op::OpAtomicLoad: *hasResult = true; *hasResultType = true; break; - case Op::OpAtomicStore: *hasResult = false; *hasResultType = false; break; - case Op::OpAtomicExchange: *hasResult = true; *hasResultType = true; break; - case Op::OpAtomicCompareExchange: *hasResult = true; *hasResultType = true; break; - case Op::OpAtomicCompareExchangeWeak: *hasResult = true; *hasResultType = true; break; - case Op::OpAtomicIIncrement: *hasResult = true; *hasResultType = true; break; - case Op::OpAtomicIDecrement: *hasResult = true; *hasResultType = true; break; - case Op::OpAtomicIAdd: *hasResult = true; *hasResultType = true; break; - case Op::OpAtomicISub: *hasResult = true; *hasResultType = true; break; - case Op::OpAtomicSMin: *hasResult = true; *hasResultType = true; break; - case Op::OpAtomicUMin: *hasResult = true; *hasResultType = true; break; - case Op::OpAtomicSMax: *hasResult = true; *hasResultType = true; break; - case Op::OpAtomicUMax: *hasResult = true; *hasResultType = true; break; - case Op::OpAtomicAnd: *hasResult = true; *hasResultType = true; break; - case Op::OpAtomicOr: *hasResult = true; *hasResultType = true; break; - case Op::OpAtomicXor: *hasResult = true; *hasResultType = true; break; - case Op::OpPhi: *hasResult = true; *hasResultType = true; break; - case Op::OpLoopMerge: *hasResult = false; *hasResultType = false; break; - case Op::OpSelectionMerge: *hasResult = false; *hasResultType = false; break; - case Op::OpLabel: *hasResult = true; *hasResultType = false; break; - case Op::OpBranch: *hasResult = false; *hasResultType = false; break; - case Op::OpBranchConditional: *hasResult = false; *hasResultType = false; break; - case Op::OpSwitch: *hasResult = false; *hasResultType = false; break; - case Op::OpKill: *hasResult = false; *hasResultType = false; break; - case Op::OpReturn: *hasResult = false; *hasResultType = false; break; - case Op::OpReturnValue: *hasResult = false; *hasResultType = false; break; - case Op::OpUnreachable: *hasResult = false; *hasResultType = false; break; - case Op::OpLifetimeStart: *hasResult = false; *hasResultType = false; break; - case Op::OpLifetimeStop: *hasResult = false; *hasResultType = false; break; - case Op::OpGroupAsyncCopy: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupWaitEvents: *hasResult = false; *hasResultType = false; break; - case Op::OpGroupAll: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupAny: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupBroadcast: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupIAdd: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupFAdd: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupFMin: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupUMin: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupSMin: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupFMax: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupUMax: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupSMax: *hasResult = true; *hasResultType = true; break; - case Op::OpReadPipe: *hasResult = true; *hasResultType = true; break; - case Op::OpWritePipe: *hasResult = true; *hasResultType = true; break; - case Op::OpReservedReadPipe: *hasResult = true; *hasResultType = true; break; - case Op::OpReservedWritePipe: *hasResult = true; *hasResultType = true; break; - case Op::OpReserveReadPipePackets: *hasResult = true; *hasResultType = true; break; - case Op::OpReserveWritePipePackets: *hasResult = true; *hasResultType = true; break; - case Op::OpCommitReadPipe: *hasResult = false; *hasResultType = false; break; - case Op::OpCommitWritePipe: *hasResult = false; *hasResultType = false; break; - case Op::OpIsValidReserveId: *hasResult = true; *hasResultType = true; break; - case Op::OpGetNumPipePackets: *hasResult = true; *hasResultType = true; break; - case Op::OpGetMaxPipePackets: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupReserveReadPipePackets: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupReserveWritePipePackets: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupCommitReadPipe: *hasResult = false; *hasResultType = false; break; - case Op::OpGroupCommitWritePipe: *hasResult = false; *hasResultType = false; break; - case Op::OpEnqueueMarker: *hasResult = true; *hasResultType = true; break; - case Op::OpEnqueueKernel: *hasResult = true; *hasResultType = true; break; - case Op::OpGetKernelNDrangeSubGroupCount: *hasResult = true; *hasResultType = true; break; - case Op::OpGetKernelNDrangeMaxSubGroupSize: *hasResult = true; *hasResultType = true; break; - case Op::OpGetKernelWorkGroupSize: *hasResult = true; *hasResultType = true; break; - case Op::OpGetKernelPreferredWorkGroupSizeMultiple: *hasResult = true; *hasResultType = true; break; - case Op::OpRetainEvent: *hasResult = false; *hasResultType = false; break; - case Op::OpReleaseEvent: *hasResult = false; *hasResultType = false; break; - case Op::OpCreateUserEvent: *hasResult = true; *hasResultType = true; break; - case Op::OpIsValidEvent: *hasResult = true; *hasResultType = true; break; - case Op::OpSetUserEventStatus: *hasResult = false; *hasResultType = false; break; - case Op::OpCaptureEventProfilingInfo: *hasResult = false; *hasResultType = false; break; - case Op::OpGetDefaultQueue: *hasResult = true; *hasResultType = true; break; - case Op::OpBuildNDRange: *hasResult = true; *hasResultType = true; break; - case Op::OpImageSparseSampleImplicitLod: *hasResult = true; *hasResultType = true; break; - case Op::OpImageSparseSampleExplicitLod: *hasResult = true; *hasResultType = true; break; - case Op::OpImageSparseSampleDrefImplicitLod: *hasResult = true; *hasResultType = true; break; - case Op::OpImageSparseSampleDrefExplicitLod: *hasResult = true; *hasResultType = true; break; - case Op::OpImageSparseSampleProjImplicitLod: *hasResult = true; *hasResultType = true; break; - case Op::OpImageSparseSampleProjExplicitLod: *hasResult = true; *hasResultType = true; break; - case Op::OpImageSparseSampleProjDrefImplicitLod: *hasResult = true; *hasResultType = true; break; - case Op::OpImageSparseSampleProjDrefExplicitLod: *hasResult = true; *hasResultType = true; break; - case Op::OpImageSparseFetch: *hasResult = true; *hasResultType = true; break; - case Op::OpImageSparseGather: *hasResult = true; *hasResultType = true; break; - case Op::OpImageSparseDrefGather: *hasResult = true; *hasResultType = true; break; - case Op::OpImageSparseTexelsResident: *hasResult = true; *hasResultType = true; break; - case Op::OpNoLine: *hasResult = false; *hasResultType = false; break; - case Op::OpAtomicFlagTestAndSet: *hasResult = true; *hasResultType = true; break; - case Op::OpAtomicFlagClear: *hasResult = false; *hasResultType = false; break; - case Op::OpImageSparseRead: *hasResult = true; *hasResultType = true; break; - case Op::OpSizeOf: *hasResult = true; *hasResultType = true; break; - case Op::OpTypePipeStorage: *hasResult = true; *hasResultType = false; break; - case Op::OpConstantPipeStorage: *hasResult = true; *hasResultType = true; break; - case Op::OpCreatePipeFromPipeStorage: *hasResult = true; *hasResultType = true; break; - case Op::OpGetKernelLocalSizeForSubgroupCount: *hasResult = true; *hasResultType = true; break; - case Op::OpGetKernelMaxNumSubgroups: *hasResult = true; *hasResultType = true; break; - case Op::OpTypeNamedBarrier: *hasResult = true; *hasResultType = false; break; - case Op::OpNamedBarrierInitialize: *hasResult = true; *hasResultType = true; break; - case Op::OpMemoryNamedBarrier: *hasResult = false; *hasResultType = false; break; - case Op::OpModuleProcessed: *hasResult = false; *hasResultType = false; break; - case Op::OpExecutionModeId: *hasResult = false; *hasResultType = false; break; - case Op::OpDecorateId: *hasResult = false; *hasResultType = false; break; - case Op::OpGroupNonUniformElect: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformAll: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformAny: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformAllEqual: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformBroadcast: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformBroadcastFirst: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformBallot: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformInverseBallot: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformBallotBitExtract: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformBallotBitCount: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformBallotFindLSB: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformBallotFindMSB: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformShuffle: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformShuffleXor: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformShuffleUp: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformShuffleDown: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformIAdd: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformFAdd: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformIMul: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformFMul: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformSMin: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformUMin: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformFMin: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformSMax: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformUMax: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformFMax: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformBitwiseAnd: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformBitwiseOr: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformBitwiseXor: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformLogicalAnd: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformLogicalOr: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformLogicalXor: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformQuadBroadcast: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformQuadSwap: *hasResult = true; *hasResultType = true; break; - case Op::OpCopyLogical: *hasResult = true; *hasResultType = true; break; - case Op::OpPtrEqual: *hasResult = true; *hasResultType = true; break; - case Op::OpPtrNotEqual: *hasResult = true; *hasResultType = true; break; - case Op::OpPtrDiff: *hasResult = true; *hasResultType = true; break; - case Op::OpTerminateInvocation: *hasResult = false; *hasResultType = false; break; - case Op::OpSubgroupBallotKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupFirstInvocationKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpTraceRayKHR: *hasResult = false; *hasResultType = false; break; - case Op::OpExecuteCallableKHR: *hasResult = false; *hasResultType = false; break; - case Op::OpConvertUToAccelerationStructureKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpIgnoreIntersectionKHR: *hasResult = false; *hasResultType = false; break; - case Op::OpTerminateRayKHR: *hasResult = false; *hasResultType = false; break; - case Op::OpSDotKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpUDotKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpSUDotKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpSDotAccSatKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpUDotAccSatKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpSUDotAccSatKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break; - case Op::OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break; - case Op::OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break; - case Op::OpRayQueryGenerateIntersectionKHR: *hasResult = false; *hasResultType = false; break; - case Op::OpRayQueryConfirmIntersectionKHR: *hasResult = false; *hasResultType = false; break; - case Op::OpRayQueryProceedKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpRayQueryGetIntersectionTypeKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupIAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupFAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupFMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupUMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupSMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupFMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupUMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupSMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; - case Op::OpFragmentMaskFetchAMD: *hasResult = true; *hasResultType = true; break; - case Op::OpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break; - case Op::OpReadClockKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpImageSampleFootprintNV: *hasResult = true; *hasResultType = true; break; - case Op::OpGroupNonUniformPartitionNV: *hasResult = true; *hasResultType = true; break; - case Op::OpWritePackedPrimitiveIndices4x8NV: *hasResult = false; *hasResultType = false; break; - case Op::OpReportIntersectionNV: *hasResult = true; *hasResultType = true; break; - case Op::OpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break; - case Op::OpTerminateRayNV: *hasResult = false; *hasResultType = false; break; - case Op::OpTraceNV: *hasResult = false; *hasResultType = false; break; - case Op::OpTraceMotionNV: *hasResult = false; *hasResultType = false; break; - case Op::OpTraceRayMotionNV: *hasResult = false; *hasResultType = false; break; - case Op::OpTypeAccelerationStructureNV: *hasResult = true; *hasResultType = false; break; - case Op::OpExecuteCallableNV: *hasResult = false; *hasResultType = false; break; - case Op::OpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break; - case Op::OpCooperativeMatrixLoadNV: *hasResult = true; *hasResultType = true; break; - case Op::OpCooperativeMatrixStoreNV: *hasResult = false; *hasResultType = false; break; - case Op::OpCooperativeMatrixMulAddNV: *hasResult = true; *hasResultType = true; break; - case Op::OpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break; - case Op::OpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break; - case Op::OpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break; - case Op::OpDemoteToHelperInvocationEXT: *hasResult = false; *hasResultType = false; break; - case Op::OpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupShuffleXorINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupBlockReadINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; - case Op::OpSubgroupImageBlockReadINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupImageBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; - case Op::OpSubgroupImageMediaBlockReadINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupImageMediaBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; - case Op::OpUCountLeadingZerosINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpUCountTrailingZerosINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpAbsISubINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpAbsUSubINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpIAddSatINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpUAddSatINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpIAverageINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpUAverageINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpIAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpUAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpISubSatINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpUSubSatINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpIMul32x16INTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpUMul32x16INTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpConstFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpFunctionPointerCallINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpAsmTargetINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpAsmINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpAsmCallINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpAtomicFMinEXT: *hasResult = true; *hasResultType = true; break; - case Op::OpAtomicFMaxEXT: *hasResult = true; *hasResultType = true; break; - case Op::OpAssumeTrueKHR: *hasResult = false; *hasResultType = false; break; - case Op::OpExpectKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpDecorateString: *hasResult = false; *hasResultType = false; break; - case Op::OpMemberDecorateString: *hasResult = false; *hasResultType = false; break; - case Op::OpVmeImageINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpTypeVmeImageINTEL: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeAvcImePayloadINTEL: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeAvcRefPayloadINTEL: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeAvcSicPayloadINTEL: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeAvcMcePayloadINTEL: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeAvcMceResultINTEL: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeAvcImeResultINTEL: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeAvcImeResultSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeAvcImeResultDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeAvcImeSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeAvcImeDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeAvcRefResultINTEL: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeAvcSicResultINTEL: *hasResult = true; *hasResultType = false; break; - case Op::OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceSetInterShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceSetInterDirectionPenaltyINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceSetAcOnlyHaarINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceConvertToImePayloadINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceConvertToImeResultINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceConvertToRefPayloadINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceConvertToRefResultINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceConvertToSicPayloadINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceConvertToSicResultINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceGetMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceGetInterDistortionsINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceGetBestInterDistortionsINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceGetInterMajorShapeINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceGetInterMinorShapeINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceGetInterDirectionsINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceGetInterMotionVectorCountINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceGetInterReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeInitializeINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeSetSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeSetDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeRefWindowSizeINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeAdjustRefOffsetINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeSetMaxMotionVectorCountINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeSetWeightedSadINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeGetSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeGetDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeStripDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeGetBorderReachedINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcFmeInitializeINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcBmeInitializeINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcRefConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcRefSetBidirectionalMixDisableINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcRefSetBilinearFilterEnableINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcRefEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcRefConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcSicInitializeINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcSicConfigureSkcINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcSicConfigureIpeLumaINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcSicConfigureIpeLumaChromaINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcSicGetMotionVectorMaskINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcSicConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcSicSetBilinearFilterEnableINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcSicEvaluateIpeINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcSicEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcSicConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcSicGetIpeLumaShapeINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcSicGetPackedIpeLumaModesINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcSicGetIpeChromaModeINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSubgroupAvcSicGetInterRawSadsINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpVariableLengthArrayINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpSaveMemoryINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpRestoreMemoryINTEL: *hasResult = false; *hasResultType = false; break; - case Op::OpArbitraryFloatSinCosPiINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatCastINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatCastFromIntINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatCastToIntINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatAddINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatSubINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatMulINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatDivINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatGTINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatGEINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatLTINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatLEINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatEQINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatRecipINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatRSqrtINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatCbrtINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatHypotINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatSqrtINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatLogINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatLog2INTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatLog10INTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatLog1pINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatExpINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatExp2INTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatExp10INTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatExpm1INTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatSinINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatCosINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatSinCosINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatSinPiINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatCosPiINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatASinINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatASinPiINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatACosINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatACosPiINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatATanINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatATanPiINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatATan2INTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatPowINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatPowRINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpArbitraryFloatPowNINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpLoopControlINTEL: *hasResult = false; *hasResultType = false; break; - case Op::OpFixedSqrtINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpFixedRecipINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpFixedRsqrtINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpFixedSinINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpFixedCosINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpFixedSinCosINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpFixedSinPiINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpFixedCosPiINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpFixedSinCosPiINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpFixedLogINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpFixedExpINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpPtrCastToCrossWorkgroupINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpCrossWorkgroupCastToPtrINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpReadPipeBlockingINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpWritePipeBlockingINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpFPGARegINTEL: *hasResult = true; *hasResultType = true; break; - case Op::OpRayQueryGetRayTMinKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpRayQueryGetRayFlagsKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpRayQueryGetIntersectionTKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpRayQueryGetIntersectionInstanceCustomIndexKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpRayQueryGetIntersectionInstanceIdKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpRayQueryGetIntersectionGeometryIndexKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpRayQueryGetIntersectionPrimitiveIndexKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpRayQueryGetIntersectionBarycentricsKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpRayQueryGetIntersectionFrontFaceKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpRayQueryGetIntersectionCandidateAABBOpaqueKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpRayQueryGetIntersectionObjectRayDirectionKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpRayQueryGetIntersectionObjectRayOriginKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpRayQueryGetWorldRayDirectionKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpRayQueryGetWorldRayOriginKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpRayQueryGetIntersectionObjectToWorldKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpRayQueryGetIntersectionWorldToObjectKHR: *hasResult = true; *hasResultType = true; break; - case Op::OpAtomicFAddEXT: *hasResult = true; *hasResultType = true; break; - case Op::OpTypeBufferSurfaceINTEL: *hasResult = true; *hasResultType = false; break; - case Op::OpTypeStructContinuedINTEL: *hasResult = false; *hasResultType = false; break; - case Op::OpConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break; - case Op::OpSpecConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break; - } -} -#endif /* SPV_ENABLE_UTILITY_CODE */ - -// Overload operator| for mask bit combining - -inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } -inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } -inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } -inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } -inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } -inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } -inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } -inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } -inline RayFlagsMask operator|(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) | unsigned(b)); } -inline FragmentShadingRateMask operator|(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) | unsigned(b)); } - -} // end namespace spv - -#endif // #ifndef spirv_HPP - diff --git a/include/spirv/unified1/spirv.json b/include/spirv/unified1/spirv.json deleted file mode 100644 index 017b842b..00000000 --- a/include/spirv/unified1/spirv.json +++ /dev/null @@ -1,1805 +0,0 @@ -{ - "spv": - { - "meta": - { - "Comment": - [ - [ - "Copyright (c) 2014-2020 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - [ - "This header is automatically generated by the same tool that creates", - "the Binary Section of the SPIR-V specification." - ], - [ - "Enumeration tokens for SPIR-V, in various styles:", - " C, C++, C++11, JSON, Lua, Python, C#, D", - "", - "- C will have tokens with a \"Spv\" prefix, e.g.: SpvSourceLanguageGLSL", - "- C++ will have tokens in the \"spv\" name space, e.g.: spv::SourceLanguageGLSL", - "- C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL", - "- Lua will use tables, e.g.: spv.SourceLanguage.GLSL", - "- Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL']", - "- C# will use enum classes in the Specification class located in the \"Spv\" namespace,", - " e.g.: Spv.Specification.SourceLanguage.GLSL", - "- D will have tokens under the \"spv\" module, e.g: spv.SourceLanguage.GLSL", - "", - "Some tokens act like mask values, which can be OR'd together,", - "while others are mutually exclusive. The mask-like ones have", - "\"Mask\" in their name, and a parallel enum that has the shift", - "amount (1 << x) for each corresponding enumerant." - ] - ], - "MagicNumber": 119734787, - "Version": 66816, - "Revision": 4, - "OpCodeMask": 65535, - "WordCountShift": 16 - }, - "enum": - [ - { - "Name": "SourceLanguage", - "Type": "Value", - "Values": - { - "Unknown": 0, - "ESSL": 1, - "GLSL": 2, - "OpenCL_C": 3, - "OpenCL_CPP": 4, - "HLSL": 5, - "CPP_for_OpenCL": 6 - } - }, - { - "Name": "ExecutionModel", - "Type": "Value", - "Values": - { - "Vertex": 0, - "TessellationControl": 1, - "TessellationEvaluation": 2, - "Geometry": 3, - "Fragment": 4, - "GLCompute": 5, - "Kernel": 6, - "TaskNV": 5267, - "MeshNV": 5268, - "RayGenerationKHR": 5313, - "RayGenerationNV": 5313, - "IntersectionKHR": 5314, - "IntersectionNV": 5314, - "AnyHitKHR": 5315, - "AnyHitNV": 5315, - "ClosestHitKHR": 5316, - "ClosestHitNV": 5316, - "MissKHR": 5317, - "MissNV": 5317, - "CallableKHR": 5318, - "CallableNV": 5318 - } - }, - { - "Name": "AddressingModel", - "Type": "Value", - "Values": - { - "Logical": 0, - "Physical32": 1, - "Physical64": 2, - "PhysicalStorageBuffer64": 5348, - "PhysicalStorageBuffer64EXT": 5348 - } - }, - { - "Name": "MemoryModel", - "Type": "Value", - "Values": - { - "Simple": 0, - "GLSL450": 1, - "OpenCL": 2, - "Vulkan": 3, - "VulkanKHR": 3 - } - }, - { - "Name": "ExecutionMode", - "Type": "Value", - "Values": - { - "Invocations": 0, - "SpacingEqual": 1, - "SpacingFractionalEven": 2, - "SpacingFractionalOdd": 3, - "VertexOrderCw": 4, - "VertexOrderCcw": 5, - "PixelCenterInteger": 6, - "OriginUpperLeft": 7, - "OriginLowerLeft": 8, - "EarlyFragmentTests": 9, - "PointMode": 10, - "Xfb": 11, - "DepthReplacing": 12, - "DepthGreater": 14, - "DepthLess": 15, - "DepthUnchanged": 16, - "LocalSize": 17, - "LocalSizeHint": 18, - "InputPoints": 19, - "InputLines": 20, - "InputLinesAdjacency": 21, - "Triangles": 22, - "InputTrianglesAdjacency": 23, - "Quads": 24, - "Isolines": 25, - "OutputVertices": 26, - "OutputPoints": 27, - "OutputLineStrip": 28, - "OutputTriangleStrip": 29, - "VecTypeHint": 30, - "ContractionOff": 31, - "Initializer": 33, - "Finalizer": 34, - "SubgroupSize": 35, - "SubgroupsPerWorkgroup": 36, - "SubgroupsPerWorkgroupId": 37, - "LocalSizeId": 38, - "LocalSizeHintId": 39, - "SubgroupUniformControlFlowKHR": 4421, - "PostDepthCoverage": 4446, - "DenormPreserve": 4459, - "DenormFlushToZero": 4460, - "SignedZeroInfNanPreserve": 4461, - "RoundingModeRTE": 4462, - "RoundingModeRTZ": 4463, - "StencilRefReplacingEXT": 5027, - "OutputLinesNV": 5269, - "OutputPrimitivesNV": 5270, - "DerivativeGroupQuadsNV": 5289, - "DerivativeGroupLinearNV": 5290, - "OutputTrianglesNV": 5298, - "PixelInterlockOrderedEXT": 5366, - "PixelInterlockUnorderedEXT": 5367, - "SampleInterlockOrderedEXT": 5368, - "SampleInterlockUnorderedEXT": 5369, - "ShadingRateInterlockOrderedEXT": 5370, - "ShadingRateInterlockUnorderedEXT": 5371, - "SharedLocalMemorySizeINTEL": 5618, - "RoundingModeRTPINTEL": 5620, - "RoundingModeRTNINTEL": 5621, - "FloatingPointModeALTINTEL": 5622, - "FloatingPointModeIEEEINTEL": 5623, - "MaxWorkgroupSizeINTEL": 5893, - "MaxWorkDimINTEL": 5894, - "NoGlobalOffsetINTEL": 5895, - "NumSIMDWorkitemsINTEL": 5896, - "SchedulerTargetFmaxMhzINTEL": 5903 - } - }, - { - "Name": "StorageClass", - "Type": "Value", - "Values": - { - "UniformConstant": 0, - "Input": 1, - "Uniform": 2, - "Output": 3, - "Workgroup": 4, - "CrossWorkgroup": 5, - "Private": 6, - "Function": 7, - "Generic": 8, - "PushConstant": 9, - "AtomicCounter": 10, - "Image": 11, - "StorageBuffer": 12, - "CallableDataKHR": 5328, - "CallableDataNV": 5328, - "IncomingCallableDataKHR": 5329, - "IncomingCallableDataNV": 5329, - "RayPayloadKHR": 5338, - "RayPayloadNV": 5338, - "HitAttributeKHR": 5339, - "HitAttributeNV": 5339, - "IncomingRayPayloadKHR": 5342, - "IncomingRayPayloadNV": 5342, - "ShaderRecordBufferKHR": 5343, - "ShaderRecordBufferNV": 5343, - "PhysicalStorageBuffer": 5349, - "PhysicalStorageBufferEXT": 5349, - "CodeSectionINTEL": 5605, - "DeviceOnlyINTEL": 5936, - "HostOnlyINTEL": 5937 - } - }, - { - "Name": "Dim", - "Type": "Value", - "Values": - { - "Dim1D": 0, - "Dim2D": 1, - "Dim3D": 2, - "Cube": 3, - "Rect": 4, - "Buffer": 5, - "SubpassData": 6 - } - }, - { - "Name": "SamplerAddressingMode", - "Type": "Value", - "Values": - { - "None": 0, - "ClampToEdge": 1, - "Clamp": 2, - "Repeat": 3, - "RepeatMirrored": 4 - } - }, - { - "Name": "SamplerFilterMode", - "Type": "Value", - "Values": - { - "Nearest": 0, - "Linear": 1 - } - }, - { - "Name": "ImageFormat", - "Type": "Value", - "Values": - { - "Unknown": 0, - "Rgba32f": 1, - "Rgba16f": 2, - "R32f": 3, - "Rgba8": 4, - "Rgba8Snorm": 5, - "Rg32f": 6, - "Rg16f": 7, - "R11fG11fB10f": 8, - "R16f": 9, - "Rgba16": 10, - "Rgb10A2": 11, - "Rg16": 12, - "Rg8": 13, - "R16": 14, - "R8": 15, - "Rgba16Snorm": 16, - "Rg16Snorm": 17, - "Rg8Snorm": 18, - "R16Snorm": 19, - "R8Snorm": 20, - "Rgba32i": 21, - "Rgba16i": 22, - "Rgba8i": 23, - "R32i": 24, - "Rg32i": 25, - "Rg16i": 26, - "Rg8i": 27, - "R16i": 28, - "R8i": 29, - "Rgba32ui": 30, - "Rgba16ui": 31, - "Rgba8ui": 32, - "R32ui": 33, - "Rgb10a2ui": 34, - "Rg32ui": 35, - "Rg16ui": 36, - "Rg8ui": 37, - "R16ui": 38, - "R8ui": 39, - "R64ui": 40, - "R64i": 41 - } - }, - { - "Name": "ImageChannelOrder", - "Type": "Value", - "Values": - { - "R": 0, - "A": 1, - "RG": 2, - "RA": 3, - "RGB": 4, - "RGBA": 5, - "BGRA": 6, - "ARGB": 7, - "Intensity": 8, - "Luminance": 9, - "Rx": 10, - "RGx": 11, - "RGBx": 12, - "Depth": 13, - "DepthStencil": 14, - "sRGB": 15, - "sRGBx": 16, - "sRGBA": 17, - "sBGRA": 18, - "ABGR": 19 - } - }, - { - "Name": "ImageChannelDataType", - "Type": "Value", - "Values": - { - "SnormInt8": 0, - "SnormInt16": 1, - "UnormInt8": 2, - "UnormInt16": 3, - "UnormShort565": 4, - "UnormShort555": 5, - "UnormInt101010": 6, - "SignedInt8": 7, - "SignedInt16": 8, - "SignedInt32": 9, - "UnsignedInt8": 10, - "UnsignedInt16": 11, - "UnsignedInt32": 12, - "HalfFloat": 13, - "Float": 14, - "UnormInt24": 15, - "UnormInt101010_2": 16 - } - }, - { - "Name": "ImageOperands", - "Type": "Bit", - "Values": - { - "Bias": 0, - "Lod": 1, - "Grad": 2, - "ConstOffset": 3, - "Offset": 4, - "ConstOffsets": 5, - "Sample": 6, - "MinLod": 7, - "MakeTexelAvailable": 8, - "MakeTexelAvailableKHR": 8, - "MakeTexelVisible": 9, - "MakeTexelVisibleKHR": 9, - "NonPrivateTexel": 10, - "NonPrivateTexelKHR": 10, - "VolatileTexel": 11, - "VolatileTexelKHR": 11, - "SignExtend": 12, - "ZeroExtend": 13 - } - }, - { - "Name": "FPFastMathMode", - "Type": "Bit", - "Values": - { - "NotNaN": 0, - "NotInf": 1, - "NSZ": 2, - "AllowRecip": 3, - "Fast": 4, - "AllowContractFastINTEL": 16, - "AllowReassocINTEL": 17 - } - }, - { - "Name": "FPRoundingMode", - "Type": "Value", - "Values": - { - "RTE": 0, - "RTZ": 1, - "RTP": 2, - "RTN": 3 - } - }, - { - "Name": "LinkageType", - "Type": "Value", - "Values": - { - "Export": 0, - "Import": 1, - "LinkOnceODR": 2 - } - }, - { - "Name": "AccessQualifier", - "Type": "Value", - "Values": - { - "ReadOnly": 0, - "WriteOnly": 1, - "ReadWrite": 2 - } - }, - { - "Name": "FunctionParameterAttribute", - "Type": "Value", - "Values": - { - "Zext": 0, - "Sext": 1, - "ByVal": 2, - "Sret": 3, - "NoAlias": 4, - "NoCapture": 5, - "NoWrite": 6, - "NoReadWrite": 7 - } - }, - { - "Name": "Decoration", - "Type": "Value", - "Values": - { - "RelaxedPrecision": 0, - "SpecId": 1, - "Block": 2, - "BufferBlock": 3, - "RowMajor": 4, - "ColMajor": 5, - "ArrayStride": 6, - "MatrixStride": 7, - "GLSLShared": 8, - "GLSLPacked": 9, - "CPacked": 10, - "BuiltIn": 11, - "NoPerspective": 13, - "Flat": 14, - "Patch": 15, - "Centroid": 16, - "Sample": 17, - "Invariant": 18, - "Restrict": 19, - "Aliased": 20, - "Volatile": 21, - "Constant": 22, - "Coherent": 23, - "NonWritable": 24, - "NonReadable": 25, - "Uniform": 26, - "UniformId": 27, - "SaturatedConversion": 28, - "Stream": 29, - "Location": 30, - "Component": 31, - "Index": 32, - "Binding": 33, - "DescriptorSet": 34, - "Offset": 35, - "XfbBuffer": 36, - "XfbStride": 37, - "FuncParamAttr": 38, - "FPRoundingMode": 39, - "FPFastMathMode": 40, - "LinkageAttributes": 41, - "NoContraction": 42, - "InputAttachmentIndex": 43, - "Alignment": 44, - "MaxByteOffset": 45, - "AlignmentId": 46, - "MaxByteOffsetId": 47, - "NoSignedWrap": 4469, - "NoUnsignedWrap": 4470, - "ExplicitInterpAMD": 4999, - "OverrideCoverageNV": 5248, - "PassthroughNV": 5250, - "ViewportRelativeNV": 5252, - "SecondaryViewportRelativeNV": 5256, - "PerPrimitiveNV": 5271, - "PerViewNV": 5272, - "PerTaskNV": 5273, - "PerVertexNV": 5285, - "NonUniform": 5300, - "NonUniformEXT": 5300, - "RestrictPointer": 5355, - "RestrictPointerEXT": 5355, - "AliasedPointer": 5356, - "AliasedPointerEXT": 5356, - "SIMTCallINTEL": 5599, - "ReferencedIndirectlyINTEL": 5602, - "ClobberINTEL": 5607, - "SideEffectsINTEL": 5608, - "VectorComputeVariableINTEL": 5624, - "FuncParamIOKindINTEL": 5625, - "VectorComputeFunctionINTEL": 5626, - "StackCallINTEL": 5627, - "GlobalVariableOffsetINTEL": 5628, - "CounterBuffer": 5634, - "HlslCounterBufferGOOGLE": 5634, - "HlslSemanticGOOGLE": 5635, - "UserSemantic": 5635, - "UserTypeGOOGLE": 5636, - "FunctionRoundingModeINTEL": 5822, - "FunctionDenormModeINTEL": 5823, - "RegisterINTEL": 5825, - "MemoryINTEL": 5826, - "NumbanksINTEL": 5827, - "BankwidthINTEL": 5828, - "MaxPrivateCopiesINTEL": 5829, - "SinglepumpINTEL": 5830, - "DoublepumpINTEL": 5831, - "MaxReplicatesINTEL": 5832, - "SimpleDualPortINTEL": 5833, - "MergeINTEL": 5834, - "BankBitsINTEL": 5835, - "ForcePow2DepthINTEL": 5836, - "BurstCoalesceINTEL": 5899, - "CacheSizeINTEL": 5900, - "DontStaticallyCoalesceINTEL": 5901, - "PrefetchINTEL": 5902, - "StallEnableINTEL": 5905, - "FuseLoopsInFunctionINTEL": 5907, - "BufferLocationINTEL": 5921, - "IOPipeStorageINTEL": 5944, - "FunctionFloatingPointModeINTEL": 6080, - "SingleElementVectorINTEL": 6085, - "VectorComputeCallableFunctionINTEL": 6087 - } - }, - { - "Name": "BuiltIn", - "Type": "Value", - "Values": - { - "Position": 0, - "PointSize": 1, - "ClipDistance": 3, - "CullDistance": 4, - "VertexId": 5, - "InstanceId": 6, - "PrimitiveId": 7, - "InvocationId": 8, - "Layer": 9, - "ViewportIndex": 10, - "TessLevelOuter": 11, - "TessLevelInner": 12, - "TessCoord": 13, - "PatchVertices": 14, - "FragCoord": 15, - "PointCoord": 16, - "FrontFacing": 17, - "SampleId": 18, - "SamplePosition": 19, - "SampleMask": 20, - "FragDepth": 22, - "HelperInvocation": 23, - "NumWorkgroups": 24, - "WorkgroupSize": 25, - "WorkgroupId": 26, - "LocalInvocationId": 27, - "GlobalInvocationId": 28, - "LocalInvocationIndex": 29, - "WorkDim": 30, - "GlobalSize": 31, - "EnqueuedWorkgroupSize": 32, - "GlobalOffset": 33, - "GlobalLinearId": 34, - "SubgroupSize": 36, - "SubgroupMaxSize": 37, - "NumSubgroups": 38, - "NumEnqueuedSubgroups": 39, - "SubgroupId": 40, - "SubgroupLocalInvocationId": 41, - "VertexIndex": 42, - "InstanceIndex": 43, - "SubgroupEqMask": 4416, - "SubgroupEqMaskKHR": 4416, - "SubgroupGeMask": 4417, - "SubgroupGeMaskKHR": 4417, - "SubgroupGtMask": 4418, - "SubgroupGtMaskKHR": 4418, - "SubgroupLeMask": 4419, - "SubgroupLeMaskKHR": 4419, - "SubgroupLtMask": 4420, - "SubgroupLtMaskKHR": 4420, - "BaseVertex": 4424, - "BaseInstance": 4425, - "DrawIndex": 4426, - "PrimitiveShadingRateKHR": 4432, - "DeviceIndex": 4438, - "ViewIndex": 4440, - "ShadingRateKHR": 4444, - "BaryCoordNoPerspAMD": 4992, - "BaryCoordNoPerspCentroidAMD": 4993, - "BaryCoordNoPerspSampleAMD": 4994, - "BaryCoordSmoothAMD": 4995, - "BaryCoordSmoothCentroidAMD": 4996, - "BaryCoordSmoothSampleAMD": 4997, - "BaryCoordPullModelAMD": 4998, - "FragStencilRefEXT": 5014, - "ViewportMaskNV": 5253, - "SecondaryPositionNV": 5257, - "SecondaryViewportMaskNV": 5258, - "PositionPerViewNV": 5261, - "ViewportMaskPerViewNV": 5262, - "FullyCoveredEXT": 5264, - "TaskCountNV": 5274, - "PrimitiveCountNV": 5275, - "PrimitiveIndicesNV": 5276, - "ClipDistancePerViewNV": 5277, - "CullDistancePerViewNV": 5278, - "LayerPerViewNV": 5279, - "MeshViewCountNV": 5280, - "MeshViewIndicesNV": 5281, - "BaryCoordNV": 5286, - "BaryCoordNoPerspNV": 5287, - "FragSizeEXT": 5292, - "FragmentSizeNV": 5292, - "FragInvocationCountEXT": 5293, - "InvocationsPerPixelNV": 5293, - "LaunchIdKHR": 5319, - "LaunchIdNV": 5319, - "LaunchSizeKHR": 5320, - "LaunchSizeNV": 5320, - "WorldRayOriginKHR": 5321, - "WorldRayOriginNV": 5321, - "WorldRayDirectionKHR": 5322, - "WorldRayDirectionNV": 5322, - "ObjectRayOriginKHR": 5323, - "ObjectRayOriginNV": 5323, - "ObjectRayDirectionKHR": 5324, - "ObjectRayDirectionNV": 5324, - "RayTminKHR": 5325, - "RayTminNV": 5325, - "RayTmaxKHR": 5326, - "RayTmaxNV": 5326, - "InstanceCustomIndexKHR": 5327, - "InstanceCustomIndexNV": 5327, - "ObjectToWorldKHR": 5330, - "ObjectToWorldNV": 5330, - "WorldToObjectKHR": 5331, - "WorldToObjectNV": 5331, - "HitTNV": 5332, - "HitKindKHR": 5333, - "HitKindNV": 5333, - "CurrentRayTimeNV": 5334, - "IncomingRayFlagsKHR": 5351, - "IncomingRayFlagsNV": 5351, - "RayGeometryIndexKHR": 5352, - "WarpsPerSMNV": 5374, - "SMCountNV": 5375, - "WarpIDNV": 5376, - "SMIDNV": 5377 - } - }, - { - "Name": "SelectionControl", - "Type": "Bit", - "Values": - { - "Flatten": 0, - "DontFlatten": 1 - } - }, - { - "Name": "LoopControl", - "Type": "Bit", - "Values": - { - "Unroll": 0, - "DontUnroll": 1, - "DependencyInfinite": 2, - "DependencyLength": 3, - "MinIterations": 4, - "MaxIterations": 5, - "IterationMultiple": 6, - "PeelCount": 7, - "PartialCount": 8, - "InitiationIntervalINTEL": 16, - "MaxConcurrencyINTEL": 17, - "DependencyArrayINTEL": 18, - "PipelineEnableINTEL": 19, - "LoopCoalesceINTEL": 20, - "MaxInterleavingINTEL": 21, - "SpeculatedIterationsINTEL": 22, - "NoFusionINTEL": 23 - } - }, - { - "Name": "FunctionControl", - "Type": "Bit", - "Values": - { - "Inline": 0, - "DontInline": 1, - "Pure": 2, - "Const": 3, - "OptNoneINTEL": 16 - } - }, - { - "Name": "MemorySemantics", - "Type": "Bit", - "Values": - { - "Acquire": 1, - "Release": 2, - "AcquireRelease": 3, - "SequentiallyConsistent": 4, - "UniformMemory": 6, - "SubgroupMemory": 7, - "WorkgroupMemory": 8, - "CrossWorkgroupMemory": 9, - "AtomicCounterMemory": 10, - "ImageMemory": 11, - "OutputMemory": 12, - "OutputMemoryKHR": 12, - "MakeAvailable": 13, - "MakeAvailableKHR": 13, - "MakeVisible": 14, - "MakeVisibleKHR": 14, - "Volatile": 15 - } - }, - { - "Name": "MemoryAccess", - "Type": "Bit", - "Values": - { - "Volatile": 0, - "Aligned": 1, - "Nontemporal": 2, - "MakePointerAvailable": 3, - "MakePointerAvailableKHR": 3, - "MakePointerVisible": 4, - "MakePointerVisibleKHR": 4, - "NonPrivatePointer": 5, - "NonPrivatePointerKHR": 5 - } - }, - { - "Name": "Scope", - "Type": "Value", - "Values": - { - "CrossDevice": 0, - "Device": 1, - "Workgroup": 2, - "Subgroup": 3, - "Invocation": 4, - "QueueFamily": 5, - "QueueFamilyKHR": 5, - "ShaderCallKHR": 6 - } - }, - { - "Name": "GroupOperation", - "Type": "Value", - "Values": - { - "Reduce": 0, - "InclusiveScan": 1, - "ExclusiveScan": 2, - "ClusteredReduce": 3, - "PartitionedReduceNV": 6, - "PartitionedInclusiveScanNV": 7, - "PartitionedExclusiveScanNV": 8 - } - }, - { - "Name": "KernelEnqueueFlags", - "Type": "Value", - "Values": - { - "NoWait": 0, - "WaitKernel": 1, - "WaitWorkGroup": 2 - } - }, - { - "Name": "KernelProfilingInfo", - "Type": "Bit", - "Values": - { - "CmdExecTime": 0 - } - }, - { - "Name": "Capability", - "Type": "Value", - "Values": - { - "Matrix": 0, - "Shader": 1, - "Geometry": 2, - "Tessellation": 3, - "Addresses": 4, - "Linkage": 5, - "Kernel": 6, - "Vector16": 7, - "Float16Buffer": 8, - "Float16": 9, - "Float64": 10, - "Int64": 11, - "Int64Atomics": 12, - "ImageBasic": 13, - "ImageReadWrite": 14, - "ImageMipmap": 15, - "Pipes": 17, - "Groups": 18, - "DeviceEnqueue": 19, - "LiteralSampler": 20, - "AtomicStorage": 21, - "Int16": 22, - "TessellationPointSize": 23, - "GeometryPointSize": 24, - "ImageGatherExtended": 25, - "StorageImageMultisample": 27, - "UniformBufferArrayDynamicIndexing": 28, - "SampledImageArrayDynamicIndexing": 29, - "StorageBufferArrayDynamicIndexing": 30, - "StorageImageArrayDynamicIndexing": 31, - "ClipDistance": 32, - "CullDistance": 33, - "ImageCubeArray": 34, - "SampleRateShading": 35, - "ImageRect": 36, - "SampledRect": 37, - "GenericPointer": 38, - "Int8": 39, - "InputAttachment": 40, - "SparseResidency": 41, - "MinLod": 42, - "Sampled1D": 43, - "Image1D": 44, - "SampledCubeArray": 45, - "SampledBuffer": 46, - "ImageBuffer": 47, - "ImageMSArray": 48, - "StorageImageExtendedFormats": 49, - "ImageQuery": 50, - "DerivativeControl": 51, - "InterpolationFunction": 52, - "TransformFeedback": 53, - "GeometryStreams": 54, - "StorageImageReadWithoutFormat": 55, - "StorageImageWriteWithoutFormat": 56, - "MultiViewport": 57, - "SubgroupDispatch": 58, - "NamedBarrier": 59, - "PipeStorage": 60, - "GroupNonUniform": 61, - "GroupNonUniformVote": 62, - "GroupNonUniformArithmetic": 63, - "GroupNonUniformBallot": 64, - "GroupNonUniformShuffle": 65, - "GroupNonUniformShuffleRelative": 66, - "GroupNonUniformClustered": 67, - "GroupNonUniformQuad": 68, - "ShaderLayer": 69, - "ShaderViewportIndex": 70, - "FragmentShadingRateKHR": 4422, - "SubgroupBallotKHR": 4423, - "DrawParameters": 4427, - "WorkgroupMemoryExplicitLayoutKHR": 4428, - "WorkgroupMemoryExplicitLayout8BitAccessKHR": 4429, - "WorkgroupMemoryExplicitLayout16BitAccessKHR": 4430, - "SubgroupVoteKHR": 4431, - "StorageBuffer16BitAccess": 4433, - "StorageUniformBufferBlock16": 4433, - "StorageUniform16": 4434, - "UniformAndStorageBuffer16BitAccess": 4434, - "StoragePushConstant16": 4435, - "StorageInputOutput16": 4436, - "DeviceGroup": 4437, - "MultiView": 4439, - "VariablePointersStorageBuffer": 4441, - "VariablePointers": 4442, - "AtomicStorageOps": 4445, - "SampleMaskPostDepthCoverage": 4447, - "StorageBuffer8BitAccess": 4448, - "UniformAndStorageBuffer8BitAccess": 4449, - "StoragePushConstant8": 4450, - "DenormPreserve": 4464, - "DenormFlushToZero": 4465, - "SignedZeroInfNanPreserve": 4466, - "RoundingModeRTE": 4467, - "RoundingModeRTZ": 4468, - "RayQueryProvisionalKHR": 4471, - "RayQueryKHR": 4472, - "RayTraversalPrimitiveCullingKHR": 4478, - "RayTracingKHR": 4479, - "Float16ImageAMD": 5008, - "ImageGatherBiasLodAMD": 5009, - "FragmentMaskAMD": 5010, - "StencilExportEXT": 5013, - "ImageReadWriteLodAMD": 5015, - "Int64ImageEXT": 5016, - "ShaderClockKHR": 5055, - "SampleMaskOverrideCoverageNV": 5249, - "GeometryShaderPassthroughNV": 5251, - "ShaderViewportIndexLayerEXT": 5254, - "ShaderViewportIndexLayerNV": 5254, - "ShaderViewportMaskNV": 5255, - "ShaderStereoViewNV": 5259, - "PerViewAttributesNV": 5260, - "FragmentFullyCoveredEXT": 5265, - "MeshShadingNV": 5266, - "ImageFootprintNV": 5282, - "FragmentBarycentricNV": 5284, - "ComputeDerivativeGroupQuadsNV": 5288, - "FragmentDensityEXT": 5291, - "ShadingRateNV": 5291, - "GroupNonUniformPartitionedNV": 5297, - "ShaderNonUniform": 5301, - "ShaderNonUniformEXT": 5301, - "RuntimeDescriptorArray": 5302, - "RuntimeDescriptorArrayEXT": 5302, - "InputAttachmentArrayDynamicIndexing": 5303, - "InputAttachmentArrayDynamicIndexingEXT": 5303, - "UniformTexelBufferArrayDynamicIndexing": 5304, - "UniformTexelBufferArrayDynamicIndexingEXT": 5304, - "StorageTexelBufferArrayDynamicIndexing": 5305, - "StorageTexelBufferArrayDynamicIndexingEXT": 5305, - "UniformBufferArrayNonUniformIndexing": 5306, - "UniformBufferArrayNonUniformIndexingEXT": 5306, - "SampledImageArrayNonUniformIndexing": 5307, - "SampledImageArrayNonUniformIndexingEXT": 5307, - "StorageBufferArrayNonUniformIndexing": 5308, - "StorageBufferArrayNonUniformIndexingEXT": 5308, - "StorageImageArrayNonUniformIndexing": 5309, - "StorageImageArrayNonUniformIndexingEXT": 5309, - "InputAttachmentArrayNonUniformIndexing": 5310, - "InputAttachmentArrayNonUniformIndexingEXT": 5310, - "UniformTexelBufferArrayNonUniformIndexing": 5311, - "UniformTexelBufferArrayNonUniformIndexingEXT": 5311, - "StorageTexelBufferArrayNonUniformIndexing": 5312, - "StorageTexelBufferArrayNonUniformIndexingEXT": 5312, - "RayTracingNV": 5340, - "RayTracingMotionBlurNV": 5341, - "VulkanMemoryModel": 5345, - "VulkanMemoryModelKHR": 5345, - "VulkanMemoryModelDeviceScope": 5346, - "VulkanMemoryModelDeviceScopeKHR": 5346, - "PhysicalStorageBufferAddresses": 5347, - "PhysicalStorageBufferAddressesEXT": 5347, - "ComputeDerivativeGroupLinearNV": 5350, - "RayTracingProvisionalKHR": 5353, - "CooperativeMatrixNV": 5357, - "FragmentShaderSampleInterlockEXT": 5363, - "FragmentShaderShadingRateInterlockEXT": 5372, - "ShaderSMBuiltinsNV": 5373, - "FragmentShaderPixelInterlockEXT": 5378, - "DemoteToHelperInvocationEXT": 5379, - "SubgroupShuffleINTEL": 5568, - "SubgroupBufferBlockIOINTEL": 5569, - "SubgroupImageBlockIOINTEL": 5570, - "SubgroupImageMediaBlockIOINTEL": 5579, - "RoundToInfinityINTEL": 5582, - "FloatingPointModeINTEL": 5583, - "IntegerFunctions2INTEL": 5584, - "FunctionPointersINTEL": 5603, - "IndirectReferencesINTEL": 5604, - "AsmINTEL": 5606, - "AtomicFloat32MinMaxEXT": 5612, - "AtomicFloat64MinMaxEXT": 5613, - "AtomicFloat16MinMaxEXT": 5616, - "VectorComputeINTEL": 5617, - "VectorAnyINTEL": 5619, - "ExpectAssumeKHR": 5629, - "SubgroupAvcMotionEstimationINTEL": 5696, - "SubgroupAvcMotionEstimationIntraINTEL": 5697, - "SubgroupAvcMotionEstimationChromaINTEL": 5698, - "VariableLengthArrayINTEL": 5817, - "FunctionFloatControlINTEL": 5821, - "FPGAMemoryAttributesINTEL": 5824, - "FPFastMathModeINTEL": 5837, - "ArbitraryPrecisionIntegersINTEL": 5844, - "ArbitraryPrecisionFloatingPointINTEL": 5845, - "UnstructuredLoopControlsINTEL": 5886, - "FPGALoopControlsINTEL": 5888, - "KernelAttributesINTEL": 5892, - "FPGAKernelAttributesINTEL": 5897, - "FPGAMemoryAccessesINTEL": 5898, - "FPGAClusterAttributesINTEL": 5904, - "LoopFuseINTEL": 5906, - "FPGABufferLocationINTEL": 5920, - "ArbitraryPrecisionFixedPointINTEL": 5922, - "USMStorageClassesINTEL": 5935, - "IOPipesINTEL": 5943, - "BlockingPipesINTEL": 5945, - "FPGARegINTEL": 5948, - "DotProductInputAllKHR": 6016, - "DotProductInput4x8BitKHR": 6017, - "DotProductInput4x8BitPackedKHR": 6018, - "DotProductKHR": 6019, - "BitInstructions": 6025, - "AtomicFloat32AddEXT": 6033, - "AtomicFloat64AddEXT": 6034, - "LongConstantCompositeINTEL": 6089, - "OptNoneINTEL": 6094, - "AtomicFloat16AddEXT": 6095, - "DebugInfoModuleINTEL": 6114 - } - }, - { - "Name": "RayFlags", - "Type": "Bit", - "Values": - { - "OpaqueKHR": 0, - "NoOpaqueKHR": 1, - "TerminateOnFirstHitKHR": 2, - "SkipClosestHitShaderKHR": 3, - "CullBackFacingTrianglesKHR": 4, - "CullFrontFacingTrianglesKHR": 5, - "CullOpaqueKHR": 6, - "CullNoOpaqueKHR": 7, - "SkipTrianglesKHR": 8, - "SkipAABBsKHR": 9 - } - }, - { - "Name": "RayQueryIntersection", - "Type": "Value", - "Values": - { - "RayQueryCandidateIntersectionKHR": 0, - "RayQueryCommittedIntersectionKHR": 1 - } - }, - { - "Name": "RayQueryCommittedIntersectionType", - "Type": "Value", - "Values": - { - "RayQueryCommittedIntersectionNoneKHR": 0, - "RayQueryCommittedIntersectionTriangleKHR": 1, - "RayQueryCommittedIntersectionGeneratedKHR": 2 - } - }, - { - "Name": "RayQueryCandidateIntersectionType", - "Type": "Value", - "Values": - { - "RayQueryCandidateIntersectionTriangleKHR": 0, - "RayQueryCandidateIntersectionAABBKHR": 1 - } - }, - { - "Name": "FragmentShadingRate", - "Type": "Bit", - "Values": - { - "Vertical2Pixels": 0, - "Vertical4Pixels": 1, - "Horizontal2Pixels": 2, - "Horizontal4Pixels": 3 - } - }, - { - "Name": "FPDenormMode", - "Type": "Value", - "Values": - { - "Preserve": 0, - "FlushToZero": 1 - } - }, - { - "Name": "FPOperationMode", - "Type": "Value", - "Values": - { - "IEEE": 0, - "ALT": 1 - } - }, - { - "Name": "QuantizationModes", - "Type": "Value", - "Values": - { - "TRN": 0, - "TRN_ZERO": 1, - "RND": 2, - "RND_ZERO": 3, - "RND_INF": 4, - "RND_MIN_INF": 5, - "RND_CONV": 6, - "RND_CONV_ODD": 7 - } - }, - { - "Name": "OverflowModes", - "Type": "Value", - "Values": - { - "WRAP": 0, - "SAT": 1, - "SAT_ZERO": 2, - "SAT_SYM": 3 - } - }, - { - "Name": "PackedVectorFormat", - "Type": "Value", - "Values": - { - "PackedVectorFormat4x8BitKHR": 0 - } - }, - { - "Name": "Op", - "Type": "Value", - "Values": - { - "OpNop": 0, - "OpUndef": 1, - "OpSourceContinued": 2, - "OpSource": 3, - "OpSourceExtension": 4, - "OpName": 5, - "OpMemberName": 6, - "OpString": 7, - "OpLine": 8, - "OpExtension": 10, - "OpExtInstImport": 11, - "OpExtInst": 12, - "OpMemoryModel": 14, - "OpEntryPoint": 15, - "OpExecutionMode": 16, - "OpCapability": 17, - "OpTypeVoid": 19, - "OpTypeBool": 20, - "OpTypeInt": 21, - "OpTypeFloat": 22, - "OpTypeVector": 23, - "OpTypeMatrix": 24, - "OpTypeImage": 25, - "OpTypeSampler": 26, - "OpTypeSampledImage": 27, - "OpTypeArray": 28, - "OpTypeRuntimeArray": 29, - "OpTypeStruct": 30, - "OpTypeOpaque": 31, - "OpTypePointer": 32, - "OpTypeFunction": 33, - "OpTypeEvent": 34, - "OpTypeDeviceEvent": 35, - "OpTypeReserveId": 36, - "OpTypeQueue": 37, - "OpTypePipe": 38, - "OpTypeForwardPointer": 39, - "OpConstantTrue": 41, - "OpConstantFalse": 42, - "OpConstant": 43, - "OpConstantComposite": 44, - "OpConstantSampler": 45, - "OpConstantNull": 46, - "OpSpecConstantTrue": 48, - "OpSpecConstantFalse": 49, - "OpSpecConstant": 50, - "OpSpecConstantComposite": 51, - "OpSpecConstantOp": 52, - "OpFunction": 54, - "OpFunctionParameter": 55, - "OpFunctionEnd": 56, - "OpFunctionCall": 57, - "OpVariable": 59, - "OpImageTexelPointer": 60, - "OpLoad": 61, - "OpStore": 62, - "OpCopyMemory": 63, - "OpCopyMemorySized": 64, - "OpAccessChain": 65, - "OpInBoundsAccessChain": 66, - "OpPtrAccessChain": 67, - "OpArrayLength": 68, - "OpGenericPtrMemSemantics": 69, - "OpInBoundsPtrAccessChain": 70, - "OpDecorate": 71, - "OpMemberDecorate": 72, - "OpDecorationGroup": 73, - "OpGroupDecorate": 74, - "OpGroupMemberDecorate": 75, - "OpVectorExtractDynamic": 77, - "OpVectorInsertDynamic": 78, - "OpVectorShuffle": 79, - "OpCompositeConstruct": 80, - "OpCompositeExtract": 81, - "OpCompositeInsert": 82, - "OpCopyObject": 83, - "OpTranspose": 84, - "OpSampledImage": 86, - "OpImageSampleImplicitLod": 87, - "OpImageSampleExplicitLod": 88, - "OpImageSampleDrefImplicitLod": 89, - "OpImageSampleDrefExplicitLod": 90, - "OpImageSampleProjImplicitLod": 91, - "OpImageSampleProjExplicitLod": 92, - "OpImageSampleProjDrefImplicitLod": 93, - "OpImageSampleProjDrefExplicitLod": 94, - "OpImageFetch": 95, - "OpImageGather": 96, - "OpImageDrefGather": 97, - "OpImageRead": 98, - "OpImageWrite": 99, - "OpImage": 100, - "OpImageQueryFormat": 101, - "OpImageQueryOrder": 102, - "OpImageQuerySizeLod": 103, - "OpImageQuerySize": 104, - "OpImageQueryLod": 105, - "OpImageQueryLevels": 106, - "OpImageQuerySamples": 107, - "OpConvertFToU": 109, - "OpConvertFToS": 110, - "OpConvertSToF": 111, - "OpConvertUToF": 112, - "OpUConvert": 113, - "OpSConvert": 114, - "OpFConvert": 115, - "OpQuantizeToF16": 116, - "OpConvertPtrToU": 117, - "OpSatConvertSToU": 118, - "OpSatConvertUToS": 119, - "OpConvertUToPtr": 120, - "OpPtrCastToGeneric": 121, - "OpGenericCastToPtr": 122, - "OpGenericCastToPtrExplicit": 123, - "OpBitcast": 124, - "OpSNegate": 126, - "OpFNegate": 127, - "OpIAdd": 128, - "OpFAdd": 129, - "OpISub": 130, - "OpFSub": 131, - "OpIMul": 132, - "OpFMul": 133, - "OpUDiv": 134, - "OpSDiv": 135, - "OpFDiv": 136, - "OpUMod": 137, - "OpSRem": 138, - "OpSMod": 139, - "OpFRem": 140, - "OpFMod": 141, - "OpVectorTimesScalar": 142, - "OpMatrixTimesScalar": 143, - "OpVectorTimesMatrix": 144, - "OpMatrixTimesVector": 145, - "OpMatrixTimesMatrix": 146, - "OpOuterProduct": 147, - "OpDot": 148, - "OpIAddCarry": 149, - "OpISubBorrow": 150, - "OpUMulExtended": 151, - "OpSMulExtended": 152, - "OpAny": 154, - "OpAll": 155, - "OpIsNan": 156, - "OpIsInf": 157, - "OpIsFinite": 158, - "OpIsNormal": 159, - "OpSignBitSet": 160, - "OpLessOrGreater": 161, - "OpOrdered": 162, - "OpUnordered": 163, - "OpLogicalEqual": 164, - "OpLogicalNotEqual": 165, - "OpLogicalOr": 166, - "OpLogicalAnd": 167, - "OpLogicalNot": 168, - "OpSelect": 169, - "OpIEqual": 170, - "OpINotEqual": 171, - "OpUGreaterThan": 172, - "OpSGreaterThan": 173, - "OpUGreaterThanEqual": 174, - "OpSGreaterThanEqual": 175, - "OpULessThan": 176, - "OpSLessThan": 177, - "OpULessThanEqual": 178, - "OpSLessThanEqual": 179, - "OpFOrdEqual": 180, - "OpFUnordEqual": 181, - "OpFOrdNotEqual": 182, - "OpFUnordNotEqual": 183, - "OpFOrdLessThan": 184, - "OpFUnordLessThan": 185, - "OpFOrdGreaterThan": 186, - "OpFUnordGreaterThan": 187, - "OpFOrdLessThanEqual": 188, - "OpFUnordLessThanEqual": 189, - "OpFOrdGreaterThanEqual": 190, - "OpFUnordGreaterThanEqual": 191, - "OpShiftRightLogical": 194, - "OpShiftRightArithmetic": 195, - "OpShiftLeftLogical": 196, - "OpBitwiseOr": 197, - "OpBitwiseXor": 198, - "OpBitwiseAnd": 199, - "OpNot": 200, - "OpBitFieldInsert": 201, - "OpBitFieldSExtract": 202, - "OpBitFieldUExtract": 203, - "OpBitReverse": 204, - "OpBitCount": 205, - "OpDPdx": 207, - "OpDPdy": 208, - "OpFwidth": 209, - "OpDPdxFine": 210, - "OpDPdyFine": 211, - "OpFwidthFine": 212, - "OpDPdxCoarse": 213, - "OpDPdyCoarse": 214, - "OpFwidthCoarse": 215, - "OpEmitVertex": 218, - "OpEndPrimitive": 219, - "OpEmitStreamVertex": 220, - "OpEndStreamPrimitive": 221, - "OpControlBarrier": 224, - "OpMemoryBarrier": 225, - "OpAtomicLoad": 227, - "OpAtomicStore": 228, - "OpAtomicExchange": 229, - "OpAtomicCompareExchange": 230, - "OpAtomicCompareExchangeWeak": 231, - "OpAtomicIIncrement": 232, - "OpAtomicIDecrement": 233, - "OpAtomicIAdd": 234, - "OpAtomicISub": 235, - "OpAtomicSMin": 236, - "OpAtomicUMin": 237, - "OpAtomicSMax": 238, - "OpAtomicUMax": 239, - "OpAtomicAnd": 240, - "OpAtomicOr": 241, - "OpAtomicXor": 242, - "OpPhi": 245, - "OpLoopMerge": 246, - "OpSelectionMerge": 247, - "OpLabel": 248, - "OpBranch": 249, - "OpBranchConditional": 250, - "OpSwitch": 251, - "OpKill": 252, - "OpReturn": 253, - "OpReturnValue": 254, - "OpUnreachable": 255, - "OpLifetimeStart": 256, - "OpLifetimeStop": 257, - "OpGroupAsyncCopy": 259, - "OpGroupWaitEvents": 260, - "OpGroupAll": 261, - "OpGroupAny": 262, - "OpGroupBroadcast": 263, - "OpGroupIAdd": 264, - "OpGroupFAdd": 265, - "OpGroupFMin": 266, - "OpGroupUMin": 267, - "OpGroupSMin": 268, - "OpGroupFMax": 269, - "OpGroupUMax": 270, - "OpGroupSMax": 271, - "OpReadPipe": 274, - "OpWritePipe": 275, - "OpReservedReadPipe": 276, - "OpReservedWritePipe": 277, - "OpReserveReadPipePackets": 278, - "OpReserveWritePipePackets": 279, - "OpCommitReadPipe": 280, - "OpCommitWritePipe": 281, - "OpIsValidReserveId": 282, - "OpGetNumPipePackets": 283, - "OpGetMaxPipePackets": 284, - "OpGroupReserveReadPipePackets": 285, - "OpGroupReserveWritePipePackets": 286, - "OpGroupCommitReadPipe": 287, - "OpGroupCommitWritePipe": 288, - "OpEnqueueMarker": 291, - "OpEnqueueKernel": 292, - "OpGetKernelNDrangeSubGroupCount": 293, - "OpGetKernelNDrangeMaxSubGroupSize": 294, - "OpGetKernelWorkGroupSize": 295, - "OpGetKernelPreferredWorkGroupSizeMultiple": 296, - "OpRetainEvent": 297, - "OpReleaseEvent": 298, - "OpCreateUserEvent": 299, - "OpIsValidEvent": 300, - "OpSetUserEventStatus": 301, - "OpCaptureEventProfilingInfo": 302, - "OpGetDefaultQueue": 303, - "OpBuildNDRange": 304, - "OpImageSparseSampleImplicitLod": 305, - "OpImageSparseSampleExplicitLod": 306, - "OpImageSparseSampleDrefImplicitLod": 307, - "OpImageSparseSampleDrefExplicitLod": 308, - "OpImageSparseSampleProjImplicitLod": 309, - "OpImageSparseSampleProjExplicitLod": 310, - "OpImageSparseSampleProjDrefImplicitLod": 311, - "OpImageSparseSampleProjDrefExplicitLod": 312, - "OpImageSparseFetch": 313, - "OpImageSparseGather": 314, - "OpImageSparseDrefGather": 315, - "OpImageSparseTexelsResident": 316, - "OpNoLine": 317, - "OpAtomicFlagTestAndSet": 318, - "OpAtomicFlagClear": 319, - "OpImageSparseRead": 320, - "OpSizeOf": 321, - "OpTypePipeStorage": 322, - "OpConstantPipeStorage": 323, - "OpCreatePipeFromPipeStorage": 324, - "OpGetKernelLocalSizeForSubgroupCount": 325, - "OpGetKernelMaxNumSubgroups": 326, - "OpTypeNamedBarrier": 327, - "OpNamedBarrierInitialize": 328, - "OpMemoryNamedBarrier": 329, - "OpModuleProcessed": 330, - "OpExecutionModeId": 331, - "OpDecorateId": 332, - "OpGroupNonUniformElect": 333, - "OpGroupNonUniformAll": 334, - "OpGroupNonUniformAny": 335, - "OpGroupNonUniformAllEqual": 336, - "OpGroupNonUniformBroadcast": 337, - "OpGroupNonUniformBroadcastFirst": 338, - "OpGroupNonUniformBallot": 339, - "OpGroupNonUniformInverseBallot": 340, - "OpGroupNonUniformBallotBitExtract": 341, - "OpGroupNonUniformBallotBitCount": 342, - "OpGroupNonUniformBallotFindLSB": 343, - "OpGroupNonUniformBallotFindMSB": 344, - "OpGroupNonUniformShuffle": 345, - "OpGroupNonUniformShuffleXor": 346, - "OpGroupNonUniformShuffleUp": 347, - "OpGroupNonUniformShuffleDown": 348, - "OpGroupNonUniformIAdd": 349, - "OpGroupNonUniformFAdd": 350, - "OpGroupNonUniformIMul": 351, - "OpGroupNonUniformFMul": 352, - "OpGroupNonUniformSMin": 353, - "OpGroupNonUniformUMin": 354, - "OpGroupNonUniformFMin": 355, - "OpGroupNonUniformSMax": 356, - "OpGroupNonUniformUMax": 357, - "OpGroupNonUniformFMax": 358, - "OpGroupNonUniformBitwiseAnd": 359, - "OpGroupNonUniformBitwiseOr": 360, - "OpGroupNonUniformBitwiseXor": 361, - "OpGroupNonUniformLogicalAnd": 362, - "OpGroupNonUniformLogicalOr": 363, - "OpGroupNonUniformLogicalXor": 364, - "OpGroupNonUniformQuadBroadcast": 365, - "OpGroupNonUniformQuadSwap": 366, - "OpCopyLogical": 400, - "OpPtrEqual": 401, - "OpPtrNotEqual": 402, - "OpPtrDiff": 403, - "OpTerminateInvocation": 4416, - "OpSubgroupBallotKHR": 4421, - "OpSubgroupFirstInvocationKHR": 4422, - "OpSubgroupAllKHR": 4428, - "OpSubgroupAnyKHR": 4429, - "OpSubgroupAllEqualKHR": 4430, - "OpSubgroupReadInvocationKHR": 4432, - "OpTraceRayKHR": 4445, - "OpExecuteCallableKHR": 4446, - "OpConvertUToAccelerationStructureKHR": 4447, - "OpIgnoreIntersectionKHR": 4448, - "OpTerminateRayKHR": 4449, - "OpSDotKHR": 4450, - "OpUDotKHR": 4451, - "OpSUDotKHR": 4452, - "OpSDotAccSatKHR": 4453, - "OpUDotAccSatKHR": 4454, - "OpSUDotAccSatKHR": 4455, - "OpTypeRayQueryKHR": 4472, - "OpRayQueryInitializeKHR": 4473, - "OpRayQueryTerminateKHR": 4474, - "OpRayQueryGenerateIntersectionKHR": 4475, - "OpRayQueryConfirmIntersectionKHR": 4476, - "OpRayQueryProceedKHR": 4477, - "OpRayQueryGetIntersectionTypeKHR": 4479, - "OpGroupIAddNonUniformAMD": 5000, - "OpGroupFAddNonUniformAMD": 5001, - "OpGroupFMinNonUniformAMD": 5002, - "OpGroupUMinNonUniformAMD": 5003, - "OpGroupSMinNonUniformAMD": 5004, - "OpGroupFMaxNonUniformAMD": 5005, - "OpGroupUMaxNonUniformAMD": 5006, - "OpGroupSMaxNonUniformAMD": 5007, - "OpFragmentMaskFetchAMD": 5011, - "OpFragmentFetchAMD": 5012, - "OpReadClockKHR": 5056, - "OpImageSampleFootprintNV": 5283, - "OpGroupNonUniformPartitionNV": 5296, - "OpWritePackedPrimitiveIndices4x8NV": 5299, - "OpReportIntersectionKHR": 5334, - "OpReportIntersectionNV": 5334, - "OpIgnoreIntersectionNV": 5335, - "OpTerminateRayNV": 5336, - "OpTraceNV": 5337, - "OpTraceMotionNV": 5338, - "OpTraceRayMotionNV": 5339, - "OpTypeAccelerationStructureKHR": 5341, - "OpTypeAccelerationStructureNV": 5341, - "OpExecuteCallableNV": 5344, - "OpTypeCooperativeMatrixNV": 5358, - "OpCooperativeMatrixLoadNV": 5359, - "OpCooperativeMatrixStoreNV": 5360, - "OpCooperativeMatrixMulAddNV": 5361, - "OpCooperativeMatrixLengthNV": 5362, - "OpBeginInvocationInterlockEXT": 5364, - "OpEndInvocationInterlockEXT": 5365, - "OpDemoteToHelperInvocationEXT": 5380, - "OpIsHelperInvocationEXT": 5381, - "OpSubgroupShuffleINTEL": 5571, - "OpSubgroupShuffleDownINTEL": 5572, - "OpSubgroupShuffleUpINTEL": 5573, - "OpSubgroupShuffleXorINTEL": 5574, - "OpSubgroupBlockReadINTEL": 5575, - "OpSubgroupBlockWriteINTEL": 5576, - "OpSubgroupImageBlockReadINTEL": 5577, - "OpSubgroupImageBlockWriteINTEL": 5578, - "OpSubgroupImageMediaBlockReadINTEL": 5580, - "OpSubgroupImageMediaBlockWriteINTEL": 5581, - "OpUCountLeadingZerosINTEL": 5585, - "OpUCountTrailingZerosINTEL": 5586, - "OpAbsISubINTEL": 5587, - "OpAbsUSubINTEL": 5588, - "OpIAddSatINTEL": 5589, - "OpUAddSatINTEL": 5590, - "OpIAverageINTEL": 5591, - "OpUAverageINTEL": 5592, - "OpIAverageRoundedINTEL": 5593, - "OpUAverageRoundedINTEL": 5594, - "OpISubSatINTEL": 5595, - "OpUSubSatINTEL": 5596, - "OpIMul32x16INTEL": 5597, - "OpUMul32x16INTEL": 5598, - "OpConstFunctionPointerINTEL": 5600, - "OpFunctionPointerCallINTEL": 5601, - "OpAsmTargetINTEL": 5609, - "OpAsmINTEL": 5610, - "OpAsmCallINTEL": 5611, - "OpAtomicFMinEXT": 5614, - "OpAtomicFMaxEXT": 5615, - "OpAssumeTrueKHR": 5630, - "OpExpectKHR": 5631, - "OpDecorateString": 5632, - "OpDecorateStringGOOGLE": 5632, - "OpMemberDecorateString": 5633, - "OpMemberDecorateStringGOOGLE": 5633, - "OpVmeImageINTEL": 5699, - "OpTypeVmeImageINTEL": 5700, - "OpTypeAvcImePayloadINTEL": 5701, - "OpTypeAvcRefPayloadINTEL": 5702, - "OpTypeAvcSicPayloadINTEL": 5703, - "OpTypeAvcMcePayloadINTEL": 5704, - "OpTypeAvcMceResultINTEL": 5705, - "OpTypeAvcImeResultINTEL": 5706, - "OpTypeAvcImeResultSingleReferenceStreamoutINTEL": 5707, - "OpTypeAvcImeResultDualReferenceStreamoutINTEL": 5708, - "OpTypeAvcImeSingleReferenceStreaminINTEL": 5709, - "OpTypeAvcImeDualReferenceStreaminINTEL": 5710, - "OpTypeAvcRefResultINTEL": 5711, - "OpTypeAvcSicResultINTEL": 5712, - "OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL": 5713, - "OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL": 5714, - "OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL": 5715, - "OpSubgroupAvcMceSetInterShapePenaltyINTEL": 5716, - "OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL": 5717, - "OpSubgroupAvcMceSetInterDirectionPenaltyINTEL": 5718, - "OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL": 5719, - "OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL": 5720, - "OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL": 5721, - "OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL": 5722, - "OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL": 5723, - "OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL": 5724, - "OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL": 5725, - "OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL": 5726, - "OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL": 5727, - "OpSubgroupAvcMceSetAcOnlyHaarINTEL": 5728, - "OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL": 5729, - "OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL": 5730, - "OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL": 5731, - "OpSubgroupAvcMceConvertToImePayloadINTEL": 5732, - "OpSubgroupAvcMceConvertToImeResultINTEL": 5733, - "OpSubgroupAvcMceConvertToRefPayloadINTEL": 5734, - "OpSubgroupAvcMceConvertToRefResultINTEL": 5735, - "OpSubgroupAvcMceConvertToSicPayloadINTEL": 5736, - "OpSubgroupAvcMceConvertToSicResultINTEL": 5737, - "OpSubgroupAvcMceGetMotionVectorsINTEL": 5738, - "OpSubgroupAvcMceGetInterDistortionsINTEL": 5739, - "OpSubgroupAvcMceGetBestInterDistortionsINTEL": 5740, - "OpSubgroupAvcMceGetInterMajorShapeINTEL": 5741, - "OpSubgroupAvcMceGetInterMinorShapeINTEL": 5742, - "OpSubgroupAvcMceGetInterDirectionsINTEL": 5743, - "OpSubgroupAvcMceGetInterMotionVectorCountINTEL": 5744, - "OpSubgroupAvcMceGetInterReferenceIdsINTEL": 5745, - "OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL": 5746, - "OpSubgroupAvcImeInitializeINTEL": 5747, - "OpSubgroupAvcImeSetSingleReferenceINTEL": 5748, - "OpSubgroupAvcImeSetDualReferenceINTEL": 5749, - "OpSubgroupAvcImeRefWindowSizeINTEL": 5750, - "OpSubgroupAvcImeAdjustRefOffsetINTEL": 5751, - "OpSubgroupAvcImeConvertToMcePayloadINTEL": 5752, - "OpSubgroupAvcImeSetMaxMotionVectorCountINTEL": 5753, - "OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL": 5754, - "OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL": 5755, - "OpSubgroupAvcImeSetWeightedSadINTEL": 5756, - "OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL": 5757, - "OpSubgroupAvcImeEvaluateWithDualReferenceINTEL": 5758, - "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL": 5759, - "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL": 5760, - "OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL": 5761, - "OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL": 5762, - "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL": 5763, - "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL": 5764, - "OpSubgroupAvcImeConvertToMceResultINTEL": 5765, - "OpSubgroupAvcImeGetSingleReferenceStreaminINTEL": 5766, - "OpSubgroupAvcImeGetDualReferenceStreaminINTEL": 5767, - "OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL": 5768, - "OpSubgroupAvcImeStripDualReferenceStreamoutINTEL": 5769, - "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL": 5770, - "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL": 5771, - "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL": 5772, - "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL": 5773, - "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL": 5774, - "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL": 5775, - "OpSubgroupAvcImeGetBorderReachedINTEL": 5776, - "OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL": 5777, - "OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL": 5778, - "OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL": 5779, - "OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL": 5780, - "OpSubgroupAvcFmeInitializeINTEL": 5781, - "OpSubgroupAvcBmeInitializeINTEL": 5782, - "OpSubgroupAvcRefConvertToMcePayloadINTEL": 5783, - "OpSubgroupAvcRefSetBidirectionalMixDisableINTEL": 5784, - "OpSubgroupAvcRefSetBilinearFilterEnableINTEL": 5785, - "OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL": 5786, - "OpSubgroupAvcRefEvaluateWithDualReferenceINTEL": 5787, - "OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL": 5788, - "OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL": 5789, - "OpSubgroupAvcRefConvertToMceResultINTEL": 5790, - "OpSubgroupAvcSicInitializeINTEL": 5791, - "OpSubgroupAvcSicConfigureSkcINTEL": 5792, - "OpSubgroupAvcSicConfigureIpeLumaINTEL": 5793, - "OpSubgroupAvcSicConfigureIpeLumaChromaINTEL": 5794, - "OpSubgroupAvcSicGetMotionVectorMaskINTEL": 5795, - "OpSubgroupAvcSicConvertToMcePayloadINTEL": 5796, - "OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL": 5797, - "OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL": 5798, - "OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL": 5799, - "OpSubgroupAvcSicSetBilinearFilterEnableINTEL": 5800, - "OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL": 5801, - "OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL": 5802, - "OpSubgroupAvcSicEvaluateIpeINTEL": 5803, - "OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL": 5804, - "OpSubgroupAvcSicEvaluateWithDualReferenceINTEL": 5805, - "OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL": 5806, - "OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL": 5807, - "OpSubgroupAvcSicConvertToMceResultINTEL": 5808, - "OpSubgroupAvcSicGetIpeLumaShapeINTEL": 5809, - "OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL": 5810, - "OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL": 5811, - "OpSubgroupAvcSicGetPackedIpeLumaModesINTEL": 5812, - "OpSubgroupAvcSicGetIpeChromaModeINTEL": 5813, - "OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL": 5814, - "OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL": 5815, - "OpSubgroupAvcSicGetInterRawSadsINTEL": 5816, - "OpVariableLengthArrayINTEL": 5818, - "OpSaveMemoryINTEL": 5819, - "OpRestoreMemoryINTEL": 5820, - "OpArbitraryFloatSinCosPiINTEL": 5840, - "OpArbitraryFloatCastINTEL": 5841, - "OpArbitraryFloatCastFromIntINTEL": 5842, - "OpArbitraryFloatCastToIntINTEL": 5843, - "OpArbitraryFloatAddINTEL": 5846, - "OpArbitraryFloatSubINTEL": 5847, - "OpArbitraryFloatMulINTEL": 5848, - "OpArbitraryFloatDivINTEL": 5849, - "OpArbitraryFloatGTINTEL": 5850, - "OpArbitraryFloatGEINTEL": 5851, - "OpArbitraryFloatLTINTEL": 5852, - "OpArbitraryFloatLEINTEL": 5853, - "OpArbitraryFloatEQINTEL": 5854, - "OpArbitraryFloatRecipINTEL": 5855, - "OpArbitraryFloatRSqrtINTEL": 5856, - "OpArbitraryFloatCbrtINTEL": 5857, - "OpArbitraryFloatHypotINTEL": 5858, - "OpArbitraryFloatSqrtINTEL": 5859, - "OpArbitraryFloatLogINTEL": 5860, - "OpArbitraryFloatLog2INTEL": 5861, - "OpArbitraryFloatLog10INTEL": 5862, - "OpArbitraryFloatLog1pINTEL": 5863, - "OpArbitraryFloatExpINTEL": 5864, - "OpArbitraryFloatExp2INTEL": 5865, - "OpArbitraryFloatExp10INTEL": 5866, - "OpArbitraryFloatExpm1INTEL": 5867, - "OpArbitraryFloatSinINTEL": 5868, - "OpArbitraryFloatCosINTEL": 5869, - "OpArbitraryFloatSinCosINTEL": 5870, - "OpArbitraryFloatSinPiINTEL": 5871, - "OpArbitraryFloatCosPiINTEL": 5872, - "OpArbitraryFloatASinINTEL": 5873, - "OpArbitraryFloatASinPiINTEL": 5874, - "OpArbitraryFloatACosINTEL": 5875, - "OpArbitraryFloatACosPiINTEL": 5876, - "OpArbitraryFloatATanINTEL": 5877, - "OpArbitraryFloatATanPiINTEL": 5878, - "OpArbitraryFloatATan2INTEL": 5879, - "OpArbitraryFloatPowINTEL": 5880, - "OpArbitraryFloatPowRINTEL": 5881, - "OpArbitraryFloatPowNINTEL": 5882, - "OpLoopControlINTEL": 5887, - "OpFixedSqrtINTEL": 5923, - "OpFixedRecipINTEL": 5924, - "OpFixedRsqrtINTEL": 5925, - "OpFixedSinINTEL": 5926, - "OpFixedCosINTEL": 5927, - "OpFixedSinCosINTEL": 5928, - "OpFixedSinPiINTEL": 5929, - "OpFixedCosPiINTEL": 5930, - "OpFixedSinCosPiINTEL": 5931, - "OpFixedLogINTEL": 5932, - "OpFixedExpINTEL": 5933, - "OpPtrCastToCrossWorkgroupINTEL": 5934, - "OpCrossWorkgroupCastToPtrINTEL": 5938, - "OpReadPipeBlockingINTEL": 5946, - "OpWritePipeBlockingINTEL": 5947, - "OpFPGARegINTEL": 5949, - "OpRayQueryGetRayTMinKHR": 6016, - "OpRayQueryGetRayFlagsKHR": 6017, - "OpRayQueryGetIntersectionTKHR": 6018, - "OpRayQueryGetIntersectionInstanceCustomIndexKHR": 6019, - "OpRayQueryGetIntersectionInstanceIdKHR": 6020, - "OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR": 6021, - "OpRayQueryGetIntersectionGeometryIndexKHR": 6022, - "OpRayQueryGetIntersectionPrimitiveIndexKHR": 6023, - "OpRayQueryGetIntersectionBarycentricsKHR": 6024, - "OpRayQueryGetIntersectionFrontFaceKHR": 6025, - "OpRayQueryGetIntersectionCandidateAABBOpaqueKHR": 6026, - "OpRayQueryGetIntersectionObjectRayDirectionKHR": 6027, - "OpRayQueryGetIntersectionObjectRayOriginKHR": 6028, - "OpRayQueryGetWorldRayDirectionKHR": 6029, - "OpRayQueryGetWorldRayOriginKHR": 6030, - "OpRayQueryGetIntersectionObjectToWorldKHR": 6031, - "OpRayQueryGetIntersectionWorldToObjectKHR": 6032, - "OpAtomicFAddEXT": 6035, - "OpTypeBufferSurfaceINTEL": 6086, - "OpTypeStructContinuedINTEL": 6090, - "OpConstantCompositeContinuedINTEL": 6091, - "OpSpecConstantCompositeContinuedINTEL": 6092 - } - } - ] - } -} - diff --git a/include/spirv/unified1/spirv.lua b/include/spirv/unified1/spirv.lua deleted file mode 100644 index 46665d82..00000000 --- a/include/spirv/unified1/spirv.lua +++ /dev/null @@ -1,1757 +0,0 @@ --- Copyright (c) 2014-2020 The Khronos Group Inc. --- --- Permission is hereby granted, free of charge, to any person obtaining a copy --- of this software and/or associated documentation files (the "Materials"), --- to deal in the Materials without restriction, including without limitation --- the rights to use, copy, modify, merge, publish, distribute, sublicense, --- and/or sell copies of the Materials, and to permit persons to whom the --- Materials are furnished to do so, subject to the following conditions: --- --- The above copyright notice and this permission notice shall be included in --- all copies or substantial portions of the Materials. --- --- MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS --- STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND --- HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ --- --- THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL --- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING --- FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS --- IN THE MATERIALS. - --- This header is automatically generated by the same tool that creates --- the Binary Section of the SPIR-V specification. - --- Enumeration tokens for SPIR-V, in various styles: --- C, C++, C++11, JSON, Lua, Python, C#, D --- --- - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL --- - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL --- - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL --- - Lua will use tables, e.g.: spv.SourceLanguage.GLSL --- - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] --- - C# will use enum classes in the Specification class located in the "Spv" namespace, --- e.g.: Spv.Specification.SourceLanguage.GLSL --- - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL --- --- Some tokens act like mask values, which can be OR'd together, --- while others are mutually exclusive. The mask-like ones have --- "Mask" in their name, and a parallel enum that has the shift --- amount (1 << x) for each corresponding enumerant. - -spv = { - MagicNumber = 0x07230203, - Version = 0x00010500, - Revision = 4, - OpCodeMask = 0xffff, - WordCountShift = 16, - - SourceLanguage = { - Unknown = 0, - ESSL = 1, - GLSL = 2, - OpenCL_C = 3, - OpenCL_CPP = 4, - HLSL = 5, - CPP_for_OpenCL = 6, - }, - - ExecutionModel = { - Vertex = 0, - TessellationControl = 1, - TessellationEvaluation = 2, - Geometry = 3, - Fragment = 4, - GLCompute = 5, - Kernel = 6, - TaskNV = 5267, - MeshNV = 5268, - RayGenerationKHR = 5313, - RayGenerationNV = 5313, - IntersectionKHR = 5314, - IntersectionNV = 5314, - AnyHitKHR = 5315, - AnyHitNV = 5315, - ClosestHitKHR = 5316, - ClosestHitNV = 5316, - MissKHR = 5317, - MissNV = 5317, - CallableKHR = 5318, - CallableNV = 5318, - }, - - AddressingModel = { - Logical = 0, - Physical32 = 1, - Physical64 = 2, - PhysicalStorageBuffer64 = 5348, - PhysicalStorageBuffer64EXT = 5348, - }, - - MemoryModel = { - Simple = 0, - GLSL450 = 1, - OpenCL = 2, - Vulkan = 3, - VulkanKHR = 3, - }, - - ExecutionMode = { - Invocations = 0, - SpacingEqual = 1, - SpacingFractionalEven = 2, - SpacingFractionalOdd = 3, - VertexOrderCw = 4, - VertexOrderCcw = 5, - PixelCenterInteger = 6, - OriginUpperLeft = 7, - OriginLowerLeft = 8, - EarlyFragmentTests = 9, - PointMode = 10, - Xfb = 11, - DepthReplacing = 12, - DepthGreater = 14, - DepthLess = 15, - DepthUnchanged = 16, - LocalSize = 17, - LocalSizeHint = 18, - InputPoints = 19, - InputLines = 20, - InputLinesAdjacency = 21, - Triangles = 22, - InputTrianglesAdjacency = 23, - Quads = 24, - Isolines = 25, - OutputVertices = 26, - OutputPoints = 27, - OutputLineStrip = 28, - OutputTriangleStrip = 29, - VecTypeHint = 30, - ContractionOff = 31, - Initializer = 33, - Finalizer = 34, - SubgroupSize = 35, - SubgroupsPerWorkgroup = 36, - SubgroupsPerWorkgroupId = 37, - LocalSizeId = 38, - LocalSizeHintId = 39, - SubgroupUniformControlFlowKHR = 4421, - PostDepthCoverage = 4446, - DenormPreserve = 4459, - DenormFlushToZero = 4460, - SignedZeroInfNanPreserve = 4461, - RoundingModeRTE = 4462, - RoundingModeRTZ = 4463, - StencilRefReplacingEXT = 5027, - OutputLinesNV = 5269, - OutputPrimitivesNV = 5270, - DerivativeGroupQuadsNV = 5289, - DerivativeGroupLinearNV = 5290, - OutputTrianglesNV = 5298, - PixelInterlockOrderedEXT = 5366, - PixelInterlockUnorderedEXT = 5367, - SampleInterlockOrderedEXT = 5368, - SampleInterlockUnorderedEXT = 5369, - ShadingRateInterlockOrderedEXT = 5370, - ShadingRateInterlockUnorderedEXT = 5371, - SharedLocalMemorySizeINTEL = 5618, - RoundingModeRTPINTEL = 5620, - RoundingModeRTNINTEL = 5621, - FloatingPointModeALTINTEL = 5622, - FloatingPointModeIEEEINTEL = 5623, - MaxWorkgroupSizeINTEL = 5893, - MaxWorkDimINTEL = 5894, - NoGlobalOffsetINTEL = 5895, - NumSIMDWorkitemsINTEL = 5896, - SchedulerTargetFmaxMhzINTEL = 5903, - }, - - StorageClass = { - UniformConstant = 0, - Input = 1, - Uniform = 2, - Output = 3, - Workgroup = 4, - CrossWorkgroup = 5, - Private = 6, - Function = 7, - Generic = 8, - PushConstant = 9, - AtomicCounter = 10, - Image = 11, - StorageBuffer = 12, - CallableDataKHR = 5328, - CallableDataNV = 5328, - IncomingCallableDataKHR = 5329, - IncomingCallableDataNV = 5329, - RayPayloadKHR = 5338, - RayPayloadNV = 5338, - HitAttributeKHR = 5339, - HitAttributeNV = 5339, - IncomingRayPayloadKHR = 5342, - IncomingRayPayloadNV = 5342, - ShaderRecordBufferKHR = 5343, - ShaderRecordBufferNV = 5343, - PhysicalStorageBuffer = 5349, - PhysicalStorageBufferEXT = 5349, - CodeSectionINTEL = 5605, - DeviceOnlyINTEL = 5936, - HostOnlyINTEL = 5937, - }, - - Dim = { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - Cube = 3, - Rect = 4, - Buffer = 5, - SubpassData = 6, - }, - - SamplerAddressingMode = { - None = 0, - ClampToEdge = 1, - Clamp = 2, - Repeat = 3, - RepeatMirrored = 4, - }, - - SamplerFilterMode = { - Nearest = 0, - Linear = 1, - }, - - ImageFormat = { - Unknown = 0, - Rgba32f = 1, - Rgba16f = 2, - R32f = 3, - Rgba8 = 4, - Rgba8Snorm = 5, - Rg32f = 6, - Rg16f = 7, - R11fG11fB10f = 8, - R16f = 9, - Rgba16 = 10, - Rgb10A2 = 11, - Rg16 = 12, - Rg8 = 13, - R16 = 14, - R8 = 15, - Rgba16Snorm = 16, - Rg16Snorm = 17, - Rg8Snorm = 18, - R16Snorm = 19, - R8Snorm = 20, - Rgba32i = 21, - Rgba16i = 22, - Rgba8i = 23, - R32i = 24, - Rg32i = 25, - Rg16i = 26, - Rg8i = 27, - R16i = 28, - R8i = 29, - Rgba32ui = 30, - Rgba16ui = 31, - Rgba8ui = 32, - R32ui = 33, - Rgb10a2ui = 34, - Rg32ui = 35, - Rg16ui = 36, - Rg8ui = 37, - R16ui = 38, - R8ui = 39, - R64ui = 40, - R64i = 41, - }, - - ImageChannelOrder = { - R = 0, - A = 1, - RG = 2, - RA = 3, - RGB = 4, - RGBA = 5, - BGRA = 6, - ARGB = 7, - Intensity = 8, - Luminance = 9, - Rx = 10, - RGx = 11, - RGBx = 12, - Depth = 13, - DepthStencil = 14, - sRGB = 15, - sRGBx = 16, - sRGBA = 17, - sBGRA = 18, - ABGR = 19, - }, - - ImageChannelDataType = { - SnormInt8 = 0, - SnormInt16 = 1, - UnormInt8 = 2, - UnormInt16 = 3, - UnormShort565 = 4, - UnormShort555 = 5, - UnormInt101010 = 6, - SignedInt8 = 7, - SignedInt16 = 8, - SignedInt32 = 9, - UnsignedInt8 = 10, - UnsignedInt16 = 11, - UnsignedInt32 = 12, - HalfFloat = 13, - Float = 14, - UnormInt24 = 15, - UnormInt101010_2 = 16, - }, - - ImageOperandsShift = { - Bias = 0, - Lod = 1, - Grad = 2, - ConstOffset = 3, - Offset = 4, - ConstOffsets = 5, - Sample = 6, - MinLod = 7, - MakeTexelAvailable = 8, - MakeTexelAvailableKHR = 8, - MakeTexelVisible = 9, - MakeTexelVisibleKHR = 9, - NonPrivateTexel = 10, - NonPrivateTexelKHR = 10, - VolatileTexel = 11, - VolatileTexelKHR = 11, - SignExtend = 12, - ZeroExtend = 13, - }, - - ImageOperandsMask = { - MaskNone = 0, - Bias = 0x00000001, - Lod = 0x00000002, - Grad = 0x00000004, - ConstOffset = 0x00000008, - Offset = 0x00000010, - ConstOffsets = 0x00000020, - Sample = 0x00000040, - MinLod = 0x00000080, - MakeTexelAvailable = 0x00000100, - MakeTexelAvailableKHR = 0x00000100, - MakeTexelVisible = 0x00000200, - MakeTexelVisibleKHR = 0x00000200, - NonPrivateTexel = 0x00000400, - NonPrivateTexelKHR = 0x00000400, - VolatileTexel = 0x00000800, - VolatileTexelKHR = 0x00000800, - SignExtend = 0x00001000, - ZeroExtend = 0x00002000, - }, - - FPFastMathModeShift = { - NotNaN = 0, - NotInf = 1, - NSZ = 2, - AllowRecip = 3, - Fast = 4, - AllowContractFastINTEL = 16, - AllowReassocINTEL = 17, - }, - - FPFastMathModeMask = { - MaskNone = 0, - NotNaN = 0x00000001, - NotInf = 0x00000002, - NSZ = 0x00000004, - AllowRecip = 0x00000008, - Fast = 0x00000010, - AllowContractFastINTEL = 0x00010000, - AllowReassocINTEL = 0x00020000, - }, - - FPRoundingMode = { - RTE = 0, - RTZ = 1, - RTP = 2, - RTN = 3, - }, - - LinkageType = { - Export = 0, - Import = 1, - LinkOnceODR = 2, - }, - - AccessQualifier = { - ReadOnly = 0, - WriteOnly = 1, - ReadWrite = 2, - }, - - FunctionParameterAttribute = { - Zext = 0, - Sext = 1, - ByVal = 2, - Sret = 3, - NoAlias = 4, - NoCapture = 5, - NoWrite = 6, - NoReadWrite = 7, - }, - - Decoration = { - RelaxedPrecision = 0, - SpecId = 1, - Block = 2, - BufferBlock = 3, - RowMajor = 4, - ColMajor = 5, - ArrayStride = 6, - MatrixStride = 7, - GLSLShared = 8, - GLSLPacked = 9, - CPacked = 10, - BuiltIn = 11, - NoPerspective = 13, - Flat = 14, - Patch = 15, - Centroid = 16, - Sample = 17, - Invariant = 18, - Restrict = 19, - Aliased = 20, - Volatile = 21, - Constant = 22, - Coherent = 23, - NonWritable = 24, - NonReadable = 25, - Uniform = 26, - UniformId = 27, - SaturatedConversion = 28, - Stream = 29, - Location = 30, - Component = 31, - Index = 32, - Binding = 33, - DescriptorSet = 34, - Offset = 35, - XfbBuffer = 36, - XfbStride = 37, - FuncParamAttr = 38, - FPRoundingMode = 39, - FPFastMathMode = 40, - LinkageAttributes = 41, - NoContraction = 42, - InputAttachmentIndex = 43, - Alignment = 44, - MaxByteOffset = 45, - AlignmentId = 46, - MaxByteOffsetId = 47, - NoSignedWrap = 4469, - NoUnsignedWrap = 4470, - ExplicitInterpAMD = 4999, - OverrideCoverageNV = 5248, - PassthroughNV = 5250, - ViewportRelativeNV = 5252, - SecondaryViewportRelativeNV = 5256, - PerPrimitiveNV = 5271, - PerViewNV = 5272, - PerTaskNV = 5273, - PerVertexNV = 5285, - NonUniform = 5300, - NonUniformEXT = 5300, - RestrictPointer = 5355, - RestrictPointerEXT = 5355, - AliasedPointer = 5356, - AliasedPointerEXT = 5356, - SIMTCallINTEL = 5599, - ReferencedIndirectlyINTEL = 5602, - ClobberINTEL = 5607, - SideEffectsINTEL = 5608, - VectorComputeVariableINTEL = 5624, - FuncParamIOKindINTEL = 5625, - VectorComputeFunctionINTEL = 5626, - StackCallINTEL = 5627, - GlobalVariableOffsetINTEL = 5628, - CounterBuffer = 5634, - HlslCounterBufferGOOGLE = 5634, - HlslSemanticGOOGLE = 5635, - UserSemantic = 5635, - UserTypeGOOGLE = 5636, - FunctionRoundingModeINTEL = 5822, - FunctionDenormModeINTEL = 5823, - RegisterINTEL = 5825, - MemoryINTEL = 5826, - NumbanksINTEL = 5827, - BankwidthINTEL = 5828, - MaxPrivateCopiesINTEL = 5829, - SinglepumpINTEL = 5830, - DoublepumpINTEL = 5831, - MaxReplicatesINTEL = 5832, - SimpleDualPortINTEL = 5833, - MergeINTEL = 5834, - BankBitsINTEL = 5835, - ForcePow2DepthINTEL = 5836, - BurstCoalesceINTEL = 5899, - CacheSizeINTEL = 5900, - DontStaticallyCoalesceINTEL = 5901, - PrefetchINTEL = 5902, - StallEnableINTEL = 5905, - FuseLoopsInFunctionINTEL = 5907, - BufferLocationINTEL = 5921, - IOPipeStorageINTEL = 5944, - FunctionFloatingPointModeINTEL = 6080, - SingleElementVectorINTEL = 6085, - VectorComputeCallableFunctionINTEL = 6087, - }, - - BuiltIn = { - Position = 0, - PointSize = 1, - ClipDistance = 3, - CullDistance = 4, - VertexId = 5, - InstanceId = 6, - PrimitiveId = 7, - InvocationId = 8, - Layer = 9, - ViewportIndex = 10, - TessLevelOuter = 11, - TessLevelInner = 12, - TessCoord = 13, - PatchVertices = 14, - FragCoord = 15, - PointCoord = 16, - FrontFacing = 17, - SampleId = 18, - SamplePosition = 19, - SampleMask = 20, - FragDepth = 22, - HelperInvocation = 23, - NumWorkgroups = 24, - WorkgroupSize = 25, - WorkgroupId = 26, - LocalInvocationId = 27, - GlobalInvocationId = 28, - LocalInvocationIndex = 29, - WorkDim = 30, - GlobalSize = 31, - EnqueuedWorkgroupSize = 32, - GlobalOffset = 33, - GlobalLinearId = 34, - SubgroupSize = 36, - SubgroupMaxSize = 37, - NumSubgroups = 38, - NumEnqueuedSubgroups = 39, - SubgroupId = 40, - SubgroupLocalInvocationId = 41, - VertexIndex = 42, - InstanceIndex = 43, - SubgroupEqMask = 4416, - SubgroupEqMaskKHR = 4416, - SubgroupGeMask = 4417, - SubgroupGeMaskKHR = 4417, - SubgroupGtMask = 4418, - SubgroupGtMaskKHR = 4418, - SubgroupLeMask = 4419, - SubgroupLeMaskKHR = 4419, - SubgroupLtMask = 4420, - SubgroupLtMaskKHR = 4420, - BaseVertex = 4424, - BaseInstance = 4425, - DrawIndex = 4426, - PrimitiveShadingRateKHR = 4432, - DeviceIndex = 4438, - ViewIndex = 4440, - ShadingRateKHR = 4444, - BaryCoordNoPerspAMD = 4992, - BaryCoordNoPerspCentroidAMD = 4993, - BaryCoordNoPerspSampleAMD = 4994, - BaryCoordSmoothAMD = 4995, - BaryCoordSmoothCentroidAMD = 4996, - BaryCoordSmoothSampleAMD = 4997, - BaryCoordPullModelAMD = 4998, - FragStencilRefEXT = 5014, - ViewportMaskNV = 5253, - SecondaryPositionNV = 5257, - SecondaryViewportMaskNV = 5258, - PositionPerViewNV = 5261, - ViewportMaskPerViewNV = 5262, - FullyCoveredEXT = 5264, - TaskCountNV = 5274, - PrimitiveCountNV = 5275, - PrimitiveIndicesNV = 5276, - ClipDistancePerViewNV = 5277, - CullDistancePerViewNV = 5278, - LayerPerViewNV = 5279, - MeshViewCountNV = 5280, - MeshViewIndicesNV = 5281, - BaryCoordNV = 5286, - BaryCoordNoPerspNV = 5287, - FragSizeEXT = 5292, - FragmentSizeNV = 5292, - FragInvocationCountEXT = 5293, - InvocationsPerPixelNV = 5293, - LaunchIdKHR = 5319, - LaunchIdNV = 5319, - LaunchSizeKHR = 5320, - LaunchSizeNV = 5320, - WorldRayOriginKHR = 5321, - WorldRayOriginNV = 5321, - WorldRayDirectionKHR = 5322, - WorldRayDirectionNV = 5322, - ObjectRayOriginKHR = 5323, - ObjectRayOriginNV = 5323, - ObjectRayDirectionKHR = 5324, - ObjectRayDirectionNV = 5324, - RayTminKHR = 5325, - RayTminNV = 5325, - RayTmaxKHR = 5326, - RayTmaxNV = 5326, - InstanceCustomIndexKHR = 5327, - InstanceCustomIndexNV = 5327, - ObjectToWorldKHR = 5330, - ObjectToWorldNV = 5330, - WorldToObjectKHR = 5331, - WorldToObjectNV = 5331, - HitTNV = 5332, - HitKindKHR = 5333, - HitKindNV = 5333, - CurrentRayTimeNV = 5334, - IncomingRayFlagsKHR = 5351, - IncomingRayFlagsNV = 5351, - RayGeometryIndexKHR = 5352, - WarpsPerSMNV = 5374, - SMCountNV = 5375, - WarpIDNV = 5376, - SMIDNV = 5377, - }, - - SelectionControlShift = { - Flatten = 0, - DontFlatten = 1, - }, - - SelectionControlMask = { - MaskNone = 0, - Flatten = 0x00000001, - DontFlatten = 0x00000002, - }, - - LoopControlShift = { - Unroll = 0, - DontUnroll = 1, - DependencyInfinite = 2, - DependencyLength = 3, - MinIterations = 4, - MaxIterations = 5, - IterationMultiple = 6, - PeelCount = 7, - PartialCount = 8, - InitiationIntervalINTEL = 16, - MaxConcurrencyINTEL = 17, - DependencyArrayINTEL = 18, - PipelineEnableINTEL = 19, - LoopCoalesceINTEL = 20, - MaxInterleavingINTEL = 21, - SpeculatedIterationsINTEL = 22, - NoFusionINTEL = 23, - }, - - LoopControlMask = { - MaskNone = 0, - Unroll = 0x00000001, - DontUnroll = 0x00000002, - DependencyInfinite = 0x00000004, - DependencyLength = 0x00000008, - MinIterations = 0x00000010, - MaxIterations = 0x00000020, - IterationMultiple = 0x00000040, - PeelCount = 0x00000080, - PartialCount = 0x00000100, - InitiationIntervalINTEL = 0x00010000, - MaxConcurrencyINTEL = 0x00020000, - DependencyArrayINTEL = 0x00040000, - PipelineEnableINTEL = 0x00080000, - LoopCoalesceINTEL = 0x00100000, - MaxInterleavingINTEL = 0x00200000, - SpeculatedIterationsINTEL = 0x00400000, - NoFusionINTEL = 0x00800000, - }, - - FunctionControlShift = { - Inline = 0, - DontInline = 1, - Pure = 2, - Const = 3, - OptNoneINTEL = 16, - }, - - FunctionControlMask = { - MaskNone = 0, - Inline = 0x00000001, - DontInline = 0x00000002, - Pure = 0x00000004, - Const = 0x00000008, - OptNoneINTEL = 0x00010000, - }, - - MemorySemanticsShift = { - Acquire = 1, - Release = 2, - AcquireRelease = 3, - SequentiallyConsistent = 4, - UniformMemory = 6, - SubgroupMemory = 7, - WorkgroupMemory = 8, - CrossWorkgroupMemory = 9, - AtomicCounterMemory = 10, - ImageMemory = 11, - OutputMemory = 12, - OutputMemoryKHR = 12, - MakeAvailable = 13, - MakeAvailableKHR = 13, - MakeVisible = 14, - MakeVisibleKHR = 14, - Volatile = 15, - }, - - MemorySemanticsMask = { - MaskNone = 0, - Acquire = 0x00000002, - Release = 0x00000004, - AcquireRelease = 0x00000008, - SequentiallyConsistent = 0x00000010, - UniformMemory = 0x00000040, - SubgroupMemory = 0x00000080, - WorkgroupMemory = 0x00000100, - CrossWorkgroupMemory = 0x00000200, - AtomicCounterMemory = 0x00000400, - ImageMemory = 0x00000800, - OutputMemory = 0x00001000, - OutputMemoryKHR = 0x00001000, - MakeAvailable = 0x00002000, - MakeAvailableKHR = 0x00002000, - MakeVisible = 0x00004000, - MakeVisibleKHR = 0x00004000, - Volatile = 0x00008000, - }, - - MemoryAccessShift = { - Volatile = 0, - Aligned = 1, - Nontemporal = 2, - MakePointerAvailable = 3, - MakePointerAvailableKHR = 3, - MakePointerVisible = 4, - MakePointerVisibleKHR = 4, - NonPrivatePointer = 5, - NonPrivatePointerKHR = 5, - }, - - MemoryAccessMask = { - MaskNone = 0, - Volatile = 0x00000001, - Aligned = 0x00000002, - Nontemporal = 0x00000004, - MakePointerAvailable = 0x00000008, - MakePointerAvailableKHR = 0x00000008, - MakePointerVisible = 0x00000010, - MakePointerVisibleKHR = 0x00000010, - NonPrivatePointer = 0x00000020, - NonPrivatePointerKHR = 0x00000020, - }, - - Scope = { - CrossDevice = 0, - Device = 1, - Workgroup = 2, - Subgroup = 3, - Invocation = 4, - QueueFamily = 5, - QueueFamilyKHR = 5, - ShaderCallKHR = 6, - }, - - GroupOperation = { - Reduce = 0, - InclusiveScan = 1, - ExclusiveScan = 2, - ClusteredReduce = 3, - PartitionedReduceNV = 6, - PartitionedInclusiveScanNV = 7, - PartitionedExclusiveScanNV = 8, - }, - - KernelEnqueueFlags = { - NoWait = 0, - WaitKernel = 1, - WaitWorkGroup = 2, - }, - - KernelProfilingInfoShift = { - CmdExecTime = 0, - }, - - KernelProfilingInfoMask = { - MaskNone = 0, - CmdExecTime = 0x00000001, - }, - - Capability = { - Matrix = 0, - Shader = 1, - Geometry = 2, - Tessellation = 3, - Addresses = 4, - Linkage = 5, - Kernel = 6, - Vector16 = 7, - Float16Buffer = 8, - Float16 = 9, - Float64 = 10, - Int64 = 11, - Int64Atomics = 12, - ImageBasic = 13, - ImageReadWrite = 14, - ImageMipmap = 15, - Pipes = 17, - Groups = 18, - DeviceEnqueue = 19, - LiteralSampler = 20, - AtomicStorage = 21, - Int16 = 22, - TessellationPointSize = 23, - GeometryPointSize = 24, - ImageGatherExtended = 25, - StorageImageMultisample = 27, - UniformBufferArrayDynamicIndexing = 28, - SampledImageArrayDynamicIndexing = 29, - StorageBufferArrayDynamicIndexing = 30, - StorageImageArrayDynamicIndexing = 31, - ClipDistance = 32, - CullDistance = 33, - ImageCubeArray = 34, - SampleRateShading = 35, - ImageRect = 36, - SampledRect = 37, - GenericPointer = 38, - Int8 = 39, - InputAttachment = 40, - SparseResidency = 41, - MinLod = 42, - Sampled1D = 43, - Image1D = 44, - SampledCubeArray = 45, - SampledBuffer = 46, - ImageBuffer = 47, - ImageMSArray = 48, - StorageImageExtendedFormats = 49, - ImageQuery = 50, - DerivativeControl = 51, - InterpolationFunction = 52, - TransformFeedback = 53, - GeometryStreams = 54, - StorageImageReadWithoutFormat = 55, - StorageImageWriteWithoutFormat = 56, - MultiViewport = 57, - SubgroupDispatch = 58, - NamedBarrier = 59, - PipeStorage = 60, - GroupNonUniform = 61, - GroupNonUniformVote = 62, - GroupNonUniformArithmetic = 63, - GroupNonUniformBallot = 64, - GroupNonUniformShuffle = 65, - GroupNonUniformShuffleRelative = 66, - GroupNonUniformClustered = 67, - GroupNonUniformQuad = 68, - ShaderLayer = 69, - ShaderViewportIndex = 70, - FragmentShadingRateKHR = 4422, - SubgroupBallotKHR = 4423, - DrawParameters = 4427, - WorkgroupMemoryExplicitLayoutKHR = 4428, - WorkgroupMemoryExplicitLayout8BitAccessKHR = 4429, - WorkgroupMemoryExplicitLayout16BitAccessKHR = 4430, - SubgroupVoteKHR = 4431, - StorageBuffer16BitAccess = 4433, - StorageUniformBufferBlock16 = 4433, - StorageUniform16 = 4434, - UniformAndStorageBuffer16BitAccess = 4434, - StoragePushConstant16 = 4435, - StorageInputOutput16 = 4436, - DeviceGroup = 4437, - MultiView = 4439, - VariablePointersStorageBuffer = 4441, - VariablePointers = 4442, - AtomicStorageOps = 4445, - SampleMaskPostDepthCoverage = 4447, - StorageBuffer8BitAccess = 4448, - UniformAndStorageBuffer8BitAccess = 4449, - StoragePushConstant8 = 4450, - DenormPreserve = 4464, - DenormFlushToZero = 4465, - SignedZeroInfNanPreserve = 4466, - RoundingModeRTE = 4467, - RoundingModeRTZ = 4468, - RayQueryProvisionalKHR = 4471, - RayQueryKHR = 4472, - RayTraversalPrimitiveCullingKHR = 4478, - RayTracingKHR = 4479, - Float16ImageAMD = 5008, - ImageGatherBiasLodAMD = 5009, - FragmentMaskAMD = 5010, - StencilExportEXT = 5013, - ImageReadWriteLodAMD = 5015, - Int64ImageEXT = 5016, - ShaderClockKHR = 5055, - SampleMaskOverrideCoverageNV = 5249, - GeometryShaderPassthroughNV = 5251, - ShaderViewportIndexLayerEXT = 5254, - ShaderViewportIndexLayerNV = 5254, - ShaderViewportMaskNV = 5255, - ShaderStereoViewNV = 5259, - PerViewAttributesNV = 5260, - FragmentFullyCoveredEXT = 5265, - MeshShadingNV = 5266, - ImageFootprintNV = 5282, - FragmentBarycentricNV = 5284, - ComputeDerivativeGroupQuadsNV = 5288, - FragmentDensityEXT = 5291, - ShadingRateNV = 5291, - GroupNonUniformPartitionedNV = 5297, - ShaderNonUniform = 5301, - ShaderNonUniformEXT = 5301, - RuntimeDescriptorArray = 5302, - RuntimeDescriptorArrayEXT = 5302, - InputAttachmentArrayDynamicIndexing = 5303, - InputAttachmentArrayDynamicIndexingEXT = 5303, - UniformTexelBufferArrayDynamicIndexing = 5304, - UniformTexelBufferArrayDynamicIndexingEXT = 5304, - StorageTexelBufferArrayDynamicIndexing = 5305, - StorageTexelBufferArrayDynamicIndexingEXT = 5305, - UniformBufferArrayNonUniformIndexing = 5306, - UniformBufferArrayNonUniformIndexingEXT = 5306, - SampledImageArrayNonUniformIndexing = 5307, - SampledImageArrayNonUniformIndexingEXT = 5307, - StorageBufferArrayNonUniformIndexing = 5308, - StorageBufferArrayNonUniformIndexingEXT = 5308, - StorageImageArrayNonUniformIndexing = 5309, - StorageImageArrayNonUniformIndexingEXT = 5309, - InputAttachmentArrayNonUniformIndexing = 5310, - InputAttachmentArrayNonUniformIndexingEXT = 5310, - UniformTexelBufferArrayNonUniformIndexing = 5311, - UniformTexelBufferArrayNonUniformIndexingEXT = 5311, - StorageTexelBufferArrayNonUniformIndexing = 5312, - StorageTexelBufferArrayNonUniformIndexingEXT = 5312, - RayTracingNV = 5340, - RayTracingMotionBlurNV = 5341, - VulkanMemoryModel = 5345, - VulkanMemoryModelKHR = 5345, - VulkanMemoryModelDeviceScope = 5346, - VulkanMemoryModelDeviceScopeKHR = 5346, - PhysicalStorageBufferAddresses = 5347, - PhysicalStorageBufferAddressesEXT = 5347, - ComputeDerivativeGroupLinearNV = 5350, - RayTracingProvisionalKHR = 5353, - CooperativeMatrixNV = 5357, - FragmentShaderSampleInterlockEXT = 5363, - FragmentShaderShadingRateInterlockEXT = 5372, - ShaderSMBuiltinsNV = 5373, - FragmentShaderPixelInterlockEXT = 5378, - DemoteToHelperInvocationEXT = 5379, - SubgroupShuffleINTEL = 5568, - SubgroupBufferBlockIOINTEL = 5569, - SubgroupImageBlockIOINTEL = 5570, - SubgroupImageMediaBlockIOINTEL = 5579, - RoundToInfinityINTEL = 5582, - FloatingPointModeINTEL = 5583, - IntegerFunctions2INTEL = 5584, - FunctionPointersINTEL = 5603, - IndirectReferencesINTEL = 5604, - AsmINTEL = 5606, - AtomicFloat32MinMaxEXT = 5612, - AtomicFloat64MinMaxEXT = 5613, - AtomicFloat16MinMaxEXT = 5616, - VectorComputeINTEL = 5617, - VectorAnyINTEL = 5619, - ExpectAssumeKHR = 5629, - SubgroupAvcMotionEstimationINTEL = 5696, - SubgroupAvcMotionEstimationIntraINTEL = 5697, - SubgroupAvcMotionEstimationChromaINTEL = 5698, - VariableLengthArrayINTEL = 5817, - FunctionFloatControlINTEL = 5821, - FPGAMemoryAttributesINTEL = 5824, - FPFastMathModeINTEL = 5837, - ArbitraryPrecisionIntegersINTEL = 5844, - ArbitraryPrecisionFloatingPointINTEL = 5845, - UnstructuredLoopControlsINTEL = 5886, - FPGALoopControlsINTEL = 5888, - KernelAttributesINTEL = 5892, - FPGAKernelAttributesINTEL = 5897, - FPGAMemoryAccessesINTEL = 5898, - FPGAClusterAttributesINTEL = 5904, - LoopFuseINTEL = 5906, - FPGABufferLocationINTEL = 5920, - ArbitraryPrecisionFixedPointINTEL = 5922, - USMStorageClassesINTEL = 5935, - IOPipesINTEL = 5943, - BlockingPipesINTEL = 5945, - FPGARegINTEL = 5948, - DotProductInputAllKHR = 6016, - DotProductInput4x8BitKHR = 6017, - DotProductInput4x8BitPackedKHR = 6018, - DotProductKHR = 6019, - BitInstructions = 6025, - AtomicFloat32AddEXT = 6033, - AtomicFloat64AddEXT = 6034, - LongConstantCompositeINTEL = 6089, - OptNoneINTEL = 6094, - AtomicFloat16AddEXT = 6095, - DebugInfoModuleINTEL = 6114, - }, - - RayFlagsShift = { - OpaqueKHR = 0, - NoOpaqueKHR = 1, - TerminateOnFirstHitKHR = 2, - SkipClosestHitShaderKHR = 3, - CullBackFacingTrianglesKHR = 4, - CullFrontFacingTrianglesKHR = 5, - CullOpaqueKHR = 6, - CullNoOpaqueKHR = 7, - SkipTrianglesKHR = 8, - SkipAABBsKHR = 9, - }, - - RayFlagsMask = { - MaskNone = 0, - OpaqueKHR = 0x00000001, - NoOpaqueKHR = 0x00000002, - TerminateOnFirstHitKHR = 0x00000004, - SkipClosestHitShaderKHR = 0x00000008, - CullBackFacingTrianglesKHR = 0x00000010, - CullFrontFacingTrianglesKHR = 0x00000020, - CullOpaqueKHR = 0x00000040, - CullNoOpaqueKHR = 0x00000080, - SkipTrianglesKHR = 0x00000100, - SkipAABBsKHR = 0x00000200, - }, - - RayQueryIntersection = { - RayQueryCandidateIntersectionKHR = 0, - RayQueryCommittedIntersectionKHR = 1, - }, - - RayQueryCommittedIntersectionType = { - RayQueryCommittedIntersectionNoneKHR = 0, - RayQueryCommittedIntersectionTriangleKHR = 1, - RayQueryCommittedIntersectionGeneratedKHR = 2, - }, - - RayQueryCandidateIntersectionType = { - RayQueryCandidateIntersectionTriangleKHR = 0, - RayQueryCandidateIntersectionAABBKHR = 1, - }, - - FragmentShadingRateShift = { - Vertical2Pixels = 0, - Vertical4Pixels = 1, - Horizontal2Pixels = 2, - Horizontal4Pixels = 3, - }, - - FragmentShadingRateMask = { - MaskNone = 0, - Vertical2Pixels = 0x00000001, - Vertical4Pixels = 0x00000002, - Horizontal2Pixels = 0x00000004, - Horizontal4Pixels = 0x00000008, - }, - - FPDenormMode = { - Preserve = 0, - FlushToZero = 1, - }, - - FPOperationMode = { - IEEE = 0, - ALT = 1, - }, - - QuantizationModes = { - TRN = 0, - TRN_ZERO = 1, - RND = 2, - RND_ZERO = 3, - RND_INF = 4, - RND_MIN_INF = 5, - RND_CONV = 6, - RND_CONV_ODD = 7, - }, - - OverflowModes = { - WRAP = 0, - SAT = 1, - SAT_ZERO = 2, - SAT_SYM = 3, - }, - - PackedVectorFormat = { - PackedVectorFormat4x8BitKHR = 0, - }, - - Op = { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, - OpImageSparseRead = 320, - OpSizeOf = 321, - OpTypePipeStorage = 322, - OpConstantPipeStorage = 323, - OpCreatePipeFromPipeStorage = 324, - OpGetKernelLocalSizeForSubgroupCount = 325, - OpGetKernelMaxNumSubgroups = 326, - OpTypeNamedBarrier = 327, - OpNamedBarrierInitialize = 328, - OpMemoryNamedBarrier = 329, - OpModuleProcessed = 330, - OpExecutionModeId = 331, - OpDecorateId = 332, - OpGroupNonUniformElect = 333, - OpGroupNonUniformAll = 334, - OpGroupNonUniformAny = 335, - OpGroupNonUniformAllEqual = 336, - OpGroupNonUniformBroadcast = 337, - OpGroupNonUniformBroadcastFirst = 338, - OpGroupNonUniformBallot = 339, - OpGroupNonUniformInverseBallot = 340, - OpGroupNonUniformBallotBitExtract = 341, - OpGroupNonUniformBallotBitCount = 342, - OpGroupNonUniformBallotFindLSB = 343, - OpGroupNonUniformBallotFindMSB = 344, - OpGroupNonUniformShuffle = 345, - OpGroupNonUniformShuffleXor = 346, - OpGroupNonUniformShuffleUp = 347, - OpGroupNonUniformShuffleDown = 348, - OpGroupNonUniformIAdd = 349, - OpGroupNonUniformFAdd = 350, - OpGroupNonUniformIMul = 351, - OpGroupNonUniformFMul = 352, - OpGroupNonUniformSMin = 353, - OpGroupNonUniformUMin = 354, - OpGroupNonUniformFMin = 355, - OpGroupNonUniformSMax = 356, - OpGroupNonUniformUMax = 357, - OpGroupNonUniformFMax = 358, - OpGroupNonUniformBitwiseAnd = 359, - OpGroupNonUniformBitwiseOr = 360, - OpGroupNonUniformBitwiseXor = 361, - OpGroupNonUniformLogicalAnd = 362, - OpGroupNonUniformLogicalOr = 363, - OpGroupNonUniformLogicalXor = 364, - OpGroupNonUniformQuadBroadcast = 365, - OpGroupNonUniformQuadSwap = 366, - OpCopyLogical = 400, - OpPtrEqual = 401, - OpPtrNotEqual = 402, - OpPtrDiff = 403, - OpTerminateInvocation = 4416, - OpSubgroupBallotKHR = 4421, - OpSubgroupFirstInvocationKHR = 4422, - OpSubgroupAllKHR = 4428, - OpSubgroupAnyKHR = 4429, - OpSubgroupAllEqualKHR = 4430, - OpSubgroupReadInvocationKHR = 4432, - OpTraceRayKHR = 4445, - OpExecuteCallableKHR = 4446, - OpConvertUToAccelerationStructureKHR = 4447, - OpIgnoreIntersectionKHR = 4448, - OpTerminateRayKHR = 4449, - OpSDotKHR = 4450, - OpUDotKHR = 4451, - OpSUDotKHR = 4452, - OpSDotAccSatKHR = 4453, - OpUDotAccSatKHR = 4454, - OpSUDotAccSatKHR = 4455, - OpTypeRayQueryKHR = 4472, - OpRayQueryInitializeKHR = 4473, - OpRayQueryTerminateKHR = 4474, - OpRayQueryGenerateIntersectionKHR = 4475, - OpRayQueryConfirmIntersectionKHR = 4476, - OpRayQueryProceedKHR = 4477, - OpRayQueryGetIntersectionTypeKHR = 4479, - OpGroupIAddNonUniformAMD = 5000, - OpGroupFAddNonUniformAMD = 5001, - OpGroupFMinNonUniformAMD = 5002, - OpGroupUMinNonUniformAMD = 5003, - OpGroupSMinNonUniformAMD = 5004, - OpGroupFMaxNonUniformAMD = 5005, - OpGroupUMaxNonUniformAMD = 5006, - OpGroupSMaxNonUniformAMD = 5007, - OpFragmentMaskFetchAMD = 5011, - OpFragmentFetchAMD = 5012, - OpReadClockKHR = 5056, - OpImageSampleFootprintNV = 5283, - OpGroupNonUniformPartitionNV = 5296, - OpWritePackedPrimitiveIndices4x8NV = 5299, - OpReportIntersectionKHR = 5334, - OpReportIntersectionNV = 5334, - OpIgnoreIntersectionNV = 5335, - OpTerminateRayNV = 5336, - OpTraceNV = 5337, - OpTraceMotionNV = 5338, - OpTraceRayMotionNV = 5339, - OpTypeAccelerationStructureKHR = 5341, - OpTypeAccelerationStructureNV = 5341, - OpExecuteCallableNV = 5344, - OpTypeCooperativeMatrixNV = 5358, - OpCooperativeMatrixLoadNV = 5359, - OpCooperativeMatrixStoreNV = 5360, - OpCooperativeMatrixMulAddNV = 5361, - OpCooperativeMatrixLengthNV = 5362, - OpBeginInvocationInterlockEXT = 5364, - OpEndInvocationInterlockEXT = 5365, - OpDemoteToHelperInvocationEXT = 5380, - OpIsHelperInvocationEXT = 5381, - OpSubgroupShuffleINTEL = 5571, - OpSubgroupShuffleDownINTEL = 5572, - OpSubgroupShuffleUpINTEL = 5573, - OpSubgroupShuffleXorINTEL = 5574, - OpSubgroupBlockReadINTEL = 5575, - OpSubgroupBlockWriteINTEL = 5576, - OpSubgroupImageBlockReadINTEL = 5577, - OpSubgroupImageBlockWriteINTEL = 5578, - OpSubgroupImageMediaBlockReadINTEL = 5580, - OpSubgroupImageMediaBlockWriteINTEL = 5581, - OpUCountLeadingZerosINTEL = 5585, - OpUCountTrailingZerosINTEL = 5586, - OpAbsISubINTEL = 5587, - OpAbsUSubINTEL = 5588, - OpIAddSatINTEL = 5589, - OpUAddSatINTEL = 5590, - OpIAverageINTEL = 5591, - OpUAverageINTEL = 5592, - OpIAverageRoundedINTEL = 5593, - OpUAverageRoundedINTEL = 5594, - OpISubSatINTEL = 5595, - OpUSubSatINTEL = 5596, - OpIMul32x16INTEL = 5597, - OpUMul32x16INTEL = 5598, - OpConstFunctionPointerINTEL = 5600, - OpFunctionPointerCallINTEL = 5601, - OpAsmTargetINTEL = 5609, - OpAsmINTEL = 5610, - OpAsmCallINTEL = 5611, - OpAtomicFMinEXT = 5614, - OpAtomicFMaxEXT = 5615, - OpAssumeTrueKHR = 5630, - OpExpectKHR = 5631, - OpDecorateString = 5632, - OpDecorateStringGOOGLE = 5632, - OpMemberDecorateString = 5633, - OpMemberDecorateStringGOOGLE = 5633, - OpVmeImageINTEL = 5699, - OpTypeVmeImageINTEL = 5700, - OpTypeAvcImePayloadINTEL = 5701, - OpTypeAvcRefPayloadINTEL = 5702, - OpTypeAvcSicPayloadINTEL = 5703, - OpTypeAvcMcePayloadINTEL = 5704, - OpTypeAvcMceResultINTEL = 5705, - OpTypeAvcImeResultINTEL = 5706, - OpTypeAvcImeResultSingleReferenceStreamoutINTEL = 5707, - OpTypeAvcImeResultDualReferenceStreamoutINTEL = 5708, - OpTypeAvcImeSingleReferenceStreaminINTEL = 5709, - OpTypeAvcImeDualReferenceStreaminINTEL = 5710, - OpTypeAvcRefResultINTEL = 5711, - OpTypeAvcSicResultINTEL = 5712, - OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL = 5713, - OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL = 5714, - OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL = 5715, - OpSubgroupAvcMceSetInterShapePenaltyINTEL = 5716, - OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL = 5717, - OpSubgroupAvcMceSetInterDirectionPenaltyINTEL = 5718, - OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL = 5719, - OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL = 5720, - OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL = 5721, - OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL = 5722, - OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL = 5723, - OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL = 5724, - OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL = 5725, - OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL = 5726, - OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL = 5727, - OpSubgroupAvcMceSetAcOnlyHaarINTEL = 5728, - OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL = 5729, - OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL = 5730, - OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL = 5731, - OpSubgroupAvcMceConvertToImePayloadINTEL = 5732, - OpSubgroupAvcMceConvertToImeResultINTEL = 5733, - OpSubgroupAvcMceConvertToRefPayloadINTEL = 5734, - OpSubgroupAvcMceConvertToRefResultINTEL = 5735, - OpSubgroupAvcMceConvertToSicPayloadINTEL = 5736, - OpSubgroupAvcMceConvertToSicResultINTEL = 5737, - OpSubgroupAvcMceGetMotionVectorsINTEL = 5738, - OpSubgroupAvcMceGetInterDistortionsINTEL = 5739, - OpSubgroupAvcMceGetBestInterDistortionsINTEL = 5740, - OpSubgroupAvcMceGetInterMajorShapeINTEL = 5741, - OpSubgroupAvcMceGetInterMinorShapeINTEL = 5742, - OpSubgroupAvcMceGetInterDirectionsINTEL = 5743, - OpSubgroupAvcMceGetInterMotionVectorCountINTEL = 5744, - OpSubgroupAvcMceGetInterReferenceIdsINTEL = 5745, - OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL = 5746, - OpSubgroupAvcImeInitializeINTEL = 5747, - OpSubgroupAvcImeSetSingleReferenceINTEL = 5748, - OpSubgroupAvcImeSetDualReferenceINTEL = 5749, - OpSubgroupAvcImeRefWindowSizeINTEL = 5750, - OpSubgroupAvcImeAdjustRefOffsetINTEL = 5751, - OpSubgroupAvcImeConvertToMcePayloadINTEL = 5752, - OpSubgroupAvcImeSetMaxMotionVectorCountINTEL = 5753, - OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL = 5754, - OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL = 5755, - OpSubgroupAvcImeSetWeightedSadINTEL = 5756, - OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL = 5757, - OpSubgroupAvcImeEvaluateWithDualReferenceINTEL = 5758, - OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL = 5759, - OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL = 5760, - OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL = 5761, - OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL = 5762, - OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL = 5763, - OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL = 5764, - OpSubgroupAvcImeConvertToMceResultINTEL = 5765, - OpSubgroupAvcImeGetSingleReferenceStreaminINTEL = 5766, - OpSubgroupAvcImeGetDualReferenceStreaminINTEL = 5767, - OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL = 5768, - OpSubgroupAvcImeStripDualReferenceStreamoutINTEL = 5769, - OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL = 5770, - OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL = 5771, - OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL = 5772, - OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL = 5773, - OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL = 5774, - OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL = 5775, - OpSubgroupAvcImeGetBorderReachedINTEL = 5776, - OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL = 5777, - OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL = 5778, - OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL = 5779, - OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL = 5780, - OpSubgroupAvcFmeInitializeINTEL = 5781, - OpSubgroupAvcBmeInitializeINTEL = 5782, - OpSubgroupAvcRefConvertToMcePayloadINTEL = 5783, - OpSubgroupAvcRefSetBidirectionalMixDisableINTEL = 5784, - OpSubgroupAvcRefSetBilinearFilterEnableINTEL = 5785, - OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL = 5786, - OpSubgroupAvcRefEvaluateWithDualReferenceINTEL = 5787, - OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL = 5788, - OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL = 5789, - OpSubgroupAvcRefConvertToMceResultINTEL = 5790, - OpSubgroupAvcSicInitializeINTEL = 5791, - OpSubgroupAvcSicConfigureSkcINTEL = 5792, - OpSubgroupAvcSicConfigureIpeLumaINTEL = 5793, - OpSubgroupAvcSicConfigureIpeLumaChromaINTEL = 5794, - OpSubgroupAvcSicGetMotionVectorMaskINTEL = 5795, - OpSubgroupAvcSicConvertToMcePayloadINTEL = 5796, - OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL = 5797, - OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL = 5798, - OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL = 5799, - OpSubgroupAvcSicSetBilinearFilterEnableINTEL = 5800, - OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL = 5801, - OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL = 5802, - OpSubgroupAvcSicEvaluateIpeINTEL = 5803, - OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL = 5804, - OpSubgroupAvcSicEvaluateWithDualReferenceINTEL = 5805, - OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL = 5806, - OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL = 5807, - OpSubgroupAvcSicConvertToMceResultINTEL = 5808, - OpSubgroupAvcSicGetIpeLumaShapeINTEL = 5809, - OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL = 5810, - OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL = 5811, - OpSubgroupAvcSicGetPackedIpeLumaModesINTEL = 5812, - OpSubgroupAvcSicGetIpeChromaModeINTEL = 5813, - OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL = 5814, - OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL = 5815, - OpSubgroupAvcSicGetInterRawSadsINTEL = 5816, - OpVariableLengthArrayINTEL = 5818, - OpSaveMemoryINTEL = 5819, - OpRestoreMemoryINTEL = 5820, - OpArbitraryFloatSinCosPiINTEL = 5840, - OpArbitraryFloatCastINTEL = 5841, - OpArbitraryFloatCastFromIntINTEL = 5842, - OpArbitraryFloatCastToIntINTEL = 5843, - OpArbitraryFloatAddINTEL = 5846, - OpArbitraryFloatSubINTEL = 5847, - OpArbitraryFloatMulINTEL = 5848, - OpArbitraryFloatDivINTEL = 5849, - OpArbitraryFloatGTINTEL = 5850, - OpArbitraryFloatGEINTEL = 5851, - OpArbitraryFloatLTINTEL = 5852, - OpArbitraryFloatLEINTEL = 5853, - OpArbitraryFloatEQINTEL = 5854, - OpArbitraryFloatRecipINTEL = 5855, - OpArbitraryFloatRSqrtINTEL = 5856, - OpArbitraryFloatCbrtINTEL = 5857, - OpArbitraryFloatHypotINTEL = 5858, - OpArbitraryFloatSqrtINTEL = 5859, - OpArbitraryFloatLogINTEL = 5860, - OpArbitraryFloatLog2INTEL = 5861, - OpArbitraryFloatLog10INTEL = 5862, - OpArbitraryFloatLog1pINTEL = 5863, - OpArbitraryFloatExpINTEL = 5864, - OpArbitraryFloatExp2INTEL = 5865, - OpArbitraryFloatExp10INTEL = 5866, - OpArbitraryFloatExpm1INTEL = 5867, - OpArbitraryFloatSinINTEL = 5868, - OpArbitraryFloatCosINTEL = 5869, - OpArbitraryFloatSinCosINTEL = 5870, - OpArbitraryFloatSinPiINTEL = 5871, - OpArbitraryFloatCosPiINTEL = 5872, - OpArbitraryFloatASinINTEL = 5873, - OpArbitraryFloatASinPiINTEL = 5874, - OpArbitraryFloatACosINTEL = 5875, - OpArbitraryFloatACosPiINTEL = 5876, - OpArbitraryFloatATanINTEL = 5877, - OpArbitraryFloatATanPiINTEL = 5878, - OpArbitraryFloatATan2INTEL = 5879, - OpArbitraryFloatPowINTEL = 5880, - OpArbitraryFloatPowRINTEL = 5881, - OpArbitraryFloatPowNINTEL = 5882, - OpLoopControlINTEL = 5887, - OpFixedSqrtINTEL = 5923, - OpFixedRecipINTEL = 5924, - OpFixedRsqrtINTEL = 5925, - OpFixedSinINTEL = 5926, - OpFixedCosINTEL = 5927, - OpFixedSinCosINTEL = 5928, - OpFixedSinPiINTEL = 5929, - OpFixedCosPiINTEL = 5930, - OpFixedSinCosPiINTEL = 5931, - OpFixedLogINTEL = 5932, - OpFixedExpINTEL = 5933, - OpPtrCastToCrossWorkgroupINTEL = 5934, - OpCrossWorkgroupCastToPtrINTEL = 5938, - OpReadPipeBlockingINTEL = 5946, - OpWritePipeBlockingINTEL = 5947, - OpFPGARegINTEL = 5949, - OpRayQueryGetRayTMinKHR = 6016, - OpRayQueryGetRayFlagsKHR = 6017, - OpRayQueryGetIntersectionTKHR = 6018, - OpRayQueryGetIntersectionInstanceCustomIndexKHR = 6019, - OpRayQueryGetIntersectionInstanceIdKHR = 6020, - OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR = 6021, - OpRayQueryGetIntersectionGeometryIndexKHR = 6022, - OpRayQueryGetIntersectionPrimitiveIndexKHR = 6023, - OpRayQueryGetIntersectionBarycentricsKHR = 6024, - OpRayQueryGetIntersectionFrontFaceKHR = 6025, - OpRayQueryGetIntersectionCandidateAABBOpaqueKHR = 6026, - OpRayQueryGetIntersectionObjectRayDirectionKHR = 6027, - OpRayQueryGetIntersectionObjectRayOriginKHR = 6028, - OpRayQueryGetWorldRayDirectionKHR = 6029, - OpRayQueryGetWorldRayOriginKHR = 6030, - OpRayQueryGetIntersectionObjectToWorldKHR = 6031, - OpRayQueryGetIntersectionWorldToObjectKHR = 6032, - OpAtomicFAddEXT = 6035, - OpTypeBufferSurfaceINTEL = 6086, - OpTypeStructContinuedINTEL = 6090, - OpConstantCompositeContinuedINTEL = 6091, - OpSpecConstantCompositeContinuedINTEL = 6092, - }, - -} - diff --git a/include/spirv/unified1/spirv.py b/include/spirv/unified1/spirv.py deleted file mode 100644 index a7801919..00000000 --- a/include/spirv/unified1/spirv.py +++ /dev/null @@ -1,1757 +0,0 @@ -# Copyright (c) 2014-2020 The Khronos Group Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and/or associated documentation files (the "Materials"), -# to deal in the Materials without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Materials, and to permit persons to whom the -# Materials are furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Materials. -# -# MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -# STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -# HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -# -# THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -# IN THE MATERIALS. - -# This header is automatically generated by the same tool that creates -# the Binary Section of the SPIR-V specification. - -# Enumeration tokens for SPIR-V, in various styles: -# C, C++, C++11, JSON, Lua, Python, C#, D -# -# - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -# - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -# - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -# - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -# - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -# - C# will use enum classes in the Specification class located in the "Spv" namespace, -# e.g.: Spv.Specification.SourceLanguage.GLSL -# - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL -# -# Some tokens act like mask values, which can be OR'd together, -# while others are mutually exclusive. The mask-like ones have -# "Mask" in their name, and a parallel enum that has the shift -# amount (1 << x) for each corresponding enumerant. - -spv = { - 'MagicNumber' : 0x07230203, - 'Version' : 0x00010500, - 'Revision' : 4, - 'OpCodeMask' : 0xffff, - 'WordCountShift' : 16, - - 'SourceLanguage' : { - 'Unknown' : 0, - 'ESSL' : 1, - 'GLSL' : 2, - 'OpenCL_C' : 3, - 'OpenCL_CPP' : 4, - 'HLSL' : 5, - 'CPP_for_OpenCL' : 6, - }, - - 'ExecutionModel' : { - 'Vertex' : 0, - 'TessellationControl' : 1, - 'TessellationEvaluation' : 2, - 'Geometry' : 3, - 'Fragment' : 4, - 'GLCompute' : 5, - 'Kernel' : 6, - 'TaskNV' : 5267, - 'MeshNV' : 5268, - 'RayGenerationKHR' : 5313, - 'RayGenerationNV' : 5313, - 'IntersectionKHR' : 5314, - 'IntersectionNV' : 5314, - 'AnyHitKHR' : 5315, - 'AnyHitNV' : 5315, - 'ClosestHitKHR' : 5316, - 'ClosestHitNV' : 5316, - 'MissKHR' : 5317, - 'MissNV' : 5317, - 'CallableKHR' : 5318, - 'CallableNV' : 5318, - }, - - 'AddressingModel' : { - 'Logical' : 0, - 'Physical32' : 1, - 'Physical64' : 2, - 'PhysicalStorageBuffer64' : 5348, - 'PhysicalStorageBuffer64EXT' : 5348, - }, - - 'MemoryModel' : { - 'Simple' : 0, - 'GLSL450' : 1, - 'OpenCL' : 2, - 'Vulkan' : 3, - 'VulkanKHR' : 3, - }, - - 'ExecutionMode' : { - 'Invocations' : 0, - 'SpacingEqual' : 1, - 'SpacingFractionalEven' : 2, - 'SpacingFractionalOdd' : 3, - 'VertexOrderCw' : 4, - 'VertexOrderCcw' : 5, - 'PixelCenterInteger' : 6, - 'OriginUpperLeft' : 7, - 'OriginLowerLeft' : 8, - 'EarlyFragmentTests' : 9, - 'PointMode' : 10, - 'Xfb' : 11, - 'DepthReplacing' : 12, - 'DepthGreater' : 14, - 'DepthLess' : 15, - 'DepthUnchanged' : 16, - 'LocalSize' : 17, - 'LocalSizeHint' : 18, - 'InputPoints' : 19, - 'InputLines' : 20, - 'InputLinesAdjacency' : 21, - 'Triangles' : 22, - 'InputTrianglesAdjacency' : 23, - 'Quads' : 24, - 'Isolines' : 25, - 'OutputVertices' : 26, - 'OutputPoints' : 27, - 'OutputLineStrip' : 28, - 'OutputTriangleStrip' : 29, - 'VecTypeHint' : 30, - 'ContractionOff' : 31, - 'Initializer' : 33, - 'Finalizer' : 34, - 'SubgroupSize' : 35, - 'SubgroupsPerWorkgroup' : 36, - 'SubgroupsPerWorkgroupId' : 37, - 'LocalSizeId' : 38, - 'LocalSizeHintId' : 39, - 'SubgroupUniformControlFlowKHR' : 4421, - 'PostDepthCoverage' : 4446, - 'DenormPreserve' : 4459, - 'DenormFlushToZero' : 4460, - 'SignedZeroInfNanPreserve' : 4461, - 'RoundingModeRTE' : 4462, - 'RoundingModeRTZ' : 4463, - 'StencilRefReplacingEXT' : 5027, - 'OutputLinesNV' : 5269, - 'OutputPrimitivesNV' : 5270, - 'DerivativeGroupQuadsNV' : 5289, - 'DerivativeGroupLinearNV' : 5290, - 'OutputTrianglesNV' : 5298, - 'PixelInterlockOrderedEXT' : 5366, - 'PixelInterlockUnorderedEXT' : 5367, - 'SampleInterlockOrderedEXT' : 5368, - 'SampleInterlockUnorderedEXT' : 5369, - 'ShadingRateInterlockOrderedEXT' : 5370, - 'ShadingRateInterlockUnorderedEXT' : 5371, - 'SharedLocalMemorySizeINTEL' : 5618, - 'RoundingModeRTPINTEL' : 5620, - 'RoundingModeRTNINTEL' : 5621, - 'FloatingPointModeALTINTEL' : 5622, - 'FloatingPointModeIEEEINTEL' : 5623, - 'MaxWorkgroupSizeINTEL' : 5893, - 'MaxWorkDimINTEL' : 5894, - 'NoGlobalOffsetINTEL' : 5895, - 'NumSIMDWorkitemsINTEL' : 5896, - 'SchedulerTargetFmaxMhzINTEL' : 5903, - }, - - 'StorageClass' : { - 'UniformConstant' : 0, - 'Input' : 1, - 'Uniform' : 2, - 'Output' : 3, - 'Workgroup' : 4, - 'CrossWorkgroup' : 5, - 'Private' : 6, - 'Function' : 7, - 'Generic' : 8, - 'PushConstant' : 9, - 'AtomicCounter' : 10, - 'Image' : 11, - 'StorageBuffer' : 12, - 'CallableDataKHR' : 5328, - 'CallableDataNV' : 5328, - 'IncomingCallableDataKHR' : 5329, - 'IncomingCallableDataNV' : 5329, - 'RayPayloadKHR' : 5338, - 'RayPayloadNV' : 5338, - 'HitAttributeKHR' : 5339, - 'HitAttributeNV' : 5339, - 'IncomingRayPayloadKHR' : 5342, - 'IncomingRayPayloadNV' : 5342, - 'ShaderRecordBufferKHR' : 5343, - 'ShaderRecordBufferNV' : 5343, - 'PhysicalStorageBuffer' : 5349, - 'PhysicalStorageBufferEXT' : 5349, - 'CodeSectionINTEL' : 5605, - 'DeviceOnlyINTEL' : 5936, - 'HostOnlyINTEL' : 5937, - }, - - 'Dim' : { - 'Dim1D' : 0, - 'Dim2D' : 1, - 'Dim3D' : 2, - 'Cube' : 3, - 'Rect' : 4, - 'Buffer' : 5, - 'SubpassData' : 6, - }, - - 'SamplerAddressingMode' : { - 'None' : 0, - 'ClampToEdge' : 1, - 'Clamp' : 2, - 'Repeat' : 3, - 'RepeatMirrored' : 4, - }, - - 'SamplerFilterMode' : { - 'Nearest' : 0, - 'Linear' : 1, - }, - - 'ImageFormat' : { - 'Unknown' : 0, - 'Rgba32f' : 1, - 'Rgba16f' : 2, - 'R32f' : 3, - 'Rgba8' : 4, - 'Rgba8Snorm' : 5, - 'Rg32f' : 6, - 'Rg16f' : 7, - 'R11fG11fB10f' : 8, - 'R16f' : 9, - 'Rgba16' : 10, - 'Rgb10A2' : 11, - 'Rg16' : 12, - 'Rg8' : 13, - 'R16' : 14, - 'R8' : 15, - 'Rgba16Snorm' : 16, - 'Rg16Snorm' : 17, - 'Rg8Snorm' : 18, - 'R16Snorm' : 19, - 'R8Snorm' : 20, - 'Rgba32i' : 21, - 'Rgba16i' : 22, - 'Rgba8i' : 23, - 'R32i' : 24, - 'Rg32i' : 25, - 'Rg16i' : 26, - 'Rg8i' : 27, - 'R16i' : 28, - 'R8i' : 29, - 'Rgba32ui' : 30, - 'Rgba16ui' : 31, - 'Rgba8ui' : 32, - 'R32ui' : 33, - 'Rgb10a2ui' : 34, - 'Rg32ui' : 35, - 'Rg16ui' : 36, - 'Rg8ui' : 37, - 'R16ui' : 38, - 'R8ui' : 39, - 'R64ui' : 40, - 'R64i' : 41, - }, - - 'ImageChannelOrder' : { - 'R' : 0, - 'A' : 1, - 'RG' : 2, - 'RA' : 3, - 'RGB' : 4, - 'RGBA' : 5, - 'BGRA' : 6, - 'ARGB' : 7, - 'Intensity' : 8, - 'Luminance' : 9, - 'Rx' : 10, - 'RGx' : 11, - 'RGBx' : 12, - 'Depth' : 13, - 'DepthStencil' : 14, - 'sRGB' : 15, - 'sRGBx' : 16, - 'sRGBA' : 17, - 'sBGRA' : 18, - 'ABGR' : 19, - }, - - 'ImageChannelDataType' : { - 'SnormInt8' : 0, - 'SnormInt16' : 1, - 'UnormInt8' : 2, - 'UnormInt16' : 3, - 'UnormShort565' : 4, - 'UnormShort555' : 5, - 'UnormInt101010' : 6, - 'SignedInt8' : 7, - 'SignedInt16' : 8, - 'SignedInt32' : 9, - 'UnsignedInt8' : 10, - 'UnsignedInt16' : 11, - 'UnsignedInt32' : 12, - 'HalfFloat' : 13, - 'Float' : 14, - 'UnormInt24' : 15, - 'UnormInt101010_2' : 16, - }, - - 'ImageOperandsShift' : { - 'Bias' : 0, - 'Lod' : 1, - 'Grad' : 2, - 'ConstOffset' : 3, - 'Offset' : 4, - 'ConstOffsets' : 5, - 'Sample' : 6, - 'MinLod' : 7, - 'MakeTexelAvailable' : 8, - 'MakeTexelAvailableKHR' : 8, - 'MakeTexelVisible' : 9, - 'MakeTexelVisibleKHR' : 9, - 'NonPrivateTexel' : 10, - 'NonPrivateTexelKHR' : 10, - 'VolatileTexel' : 11, - 'VolatileTexelKHR' : 11, - 'SignExtend' : 12, - 'ZeroExtend' : 13, - }, - - 'ImageOperandsMask' : { - 'MaskNone' : 0, - 'Bias' : 0x00000001, - 'Lod' : 0x00000002, - 'Grad' : 0x00000004, - 'ConstOffset' : 0x00000008, - 'Offset' : 0x00000010, - 'ConstOffsets' : 0x00000020, - 'Sample' : 0x00000040, - 'MinLod' : 0x00000080, - 'MakeTexelAvailable' : 0x00000100, - 'MakeTexelAvailableKHR' : 0x00000100, - 'MakeTexelVisible' : 0x00000200, - 'MakeTexelVisibleKHR' : 0x00000200, - 'NonPrivateTexel' : 0x00000400, - 'NonPrivateTexelKHR' : 0x00000400, - 'VolatileTexel' : 0x00000800, - 'VolatileTexelKHR' : 0x00000800, - 'SignExtend' : 0x00001000, - 'ZeroExtend' : 0x00002000, - }, - - 'FPFastMathModeShift' : { - 'NotNaN' : 0, - 'NotInf' : 1, - 'NSZ' : 2, - 'AllowRecip' : 3, - 'Fast' : 4, - 'AllowContractFastINTEL' : 16, - 'AllowReassocINTEL' : 17, - }, - - 'FPFastMathModeMask' : { - 'MaskNone' : 0, - 'NotNaN' : 0x00000001, - 'NotInf' : 0x00000002, - 'NSZ' : 0x00000004, - 'AllowRecip' : 0x00000008, - 'Fast' : 0x00000010, - 'AllowContractFastINTEL' : 0x00010000, - 'AllowReassocINTEL' : 0x00020000, - }, - - 'FPRoundingMode' : { - 'RTE' : 0, - 'RTZ' : 1, - 'RTP' : 2, - 'RTN' : 3, - }, - - 'LinkageType' : { - 'Export' : 0, - 'Import' : 1, - 'LinkOnceODR' : 2, - }, - - 'AccessQualifier' : { - 'ReadOnly' : 0, - 'WriteOnly' : 1, - 'ReadWrite' : 2, - }, - - 'FunctionParameterAttribute' : { - 'Zext' : 0, - 'Sext' : 1, - 'ByVal' : 2, - 'Sret' : 3, - 'NoAlias' : 4, - 'NoCapture' : 5, - 'NoWrite' : 6, - 'NoReadWrite' : 7, - }, - - 'Decoration' : { - 'RelaxedPrecision' : 0, - 'SpecId' : 1, - 'Block' : 2, - 'BufferBlock' : 3, - 'RowMajor' : 4, - 'ColMajor' : 5, - 'ArrayStride' : 6, - 'MatrixStride' : 7, - 'GLSLShared' : 8, - 'GLSLPacked' : 9, - 'CPacked' : 10, - 'BuiltIn' : 11, - 'NoPerspective' : 13, - 'Flat' : 14, - 'Patch' : 15, - 'Centroid' : 16, - 'Sample' : 17, - 'Invariant' : 18, - 'Restrict' : 19, - 'Aliased' : 20, - 'Volatile' : 21, - 'Constant' : 22, - 'Coherent' : 23, - 'NonWritable' : 24, - 'NonReadable' : 25, - 'Uniform' : 26, - 'UniformId' : 27, - 'SaturatedConversion' : 28, - 'Stream' : 29, - 'Location' : 30, - 'Component' : 31, - 'Index' : 32, - 'Binding' : 33, - 'DescriptorSet' : 34, - 'Offset' : 35, - 'XfbBuffer' : 36, - 'XfbStride' : 37, - 'FuncParamAttr' : 38, - 'FPRoundingMode' : 39, - 'FPFastMathMode' : 40, - 'LinkageAttributes' : 41, - 'NoContraction' : 42, - 'InputAttachmentIndex' : 43, - 'Alignment' : 44, - 'MaxByteOffset' : 45, - 'AlignmentId' : 46, - 'MaxByteOffsetId' : 47, - 'NoSignedWrap' : 4469, - 'NoUnsignedWrap' : 4470, - 'ExplicitInterpAMD' : 4999, - 'OverrideCoverageNV' : 5248, - 'PassthroughNV' : 5250, - 'ViewportRelativeNV' : 5252, - 'SecondaryViewportRelativeNV' : 5256, - 'PerPrimitiveNV' : 5271, - 'PerViewNV' : 5272, - 'PerTaskNV' : 5273, - 'PerVertexNV' : 5285, - 'NonUniform' : 5300, - 'NonUniformEXT' : 5300, - 'RestrictPointer' : 5355, - 'RestrictPointerEXT' : 5355, - 'AliasedPointer' : 5356, - 'AliasedPointerEXT' : 5356, - 'SIMTCallINTEL' : 5599, - 'ReferencedIndirectlyINTEL' : 5602, - 'ClobberINTEL' : 5607, - 'SideEffectsINTEL' : 5608, - 'VectorComputeVariableINTEL' : 5624, - 'FuncParamIOKindINTEL' : 5625, - 'VectorComputeFunctionINTEL' : 5626, - 'StackCallINTEL' : 5627, - 'GlobalVariableOffsetINTEL' : 5628, - 'CounterBuffer' : 5634, - 'HlslCounterBufferGOOGLE' : 5634, - 'HlslSemanticGOOGLE' : 5635, - 'UserSemantic' : 5635, - 'UserTypeGOOGLE' : 5636, - 'FunctionRoundingModeINTEL' : 5822, - 'FunctionDenormModeINTEL' : 5823, - 'RegisterINTEL' : 5825, - 'MemoryINTEL' : 5826, - 'NumbanksINTEL' : 5827, - 'BankwidthINTEL' : 5828, - 'MaxPrivateCopiesINTEL' : 5829, - 'SinglepumpINTEL' : 5830, - 'DoublepumpINTEL' : 5831, - 'MaxReplicatesINTEL' : 5832, - 'SimpleDualPortINTEL' : 5833, - 'MergeINTEL' : 5834, - 'BankBitsINTEL' : 5835, - 'ForcePow2DepthINTEL' : 5836, - 'BurstCoalesceINTEL' : 5899, - 'CacheSizeINTEL' : 5900, - 'DontStaticallyCoalesceINTEL' : 5901, - 'PrefetchINTEL' : 5902, - 'StallEnableINTEL' : 5905, - 'FuseLoopsInFunctionINTEL' : 5907, - 'BufferLocationINTEL' : 5921, - 'IOPipeStorageINTEL' : 5944, - 'FunctionFloatingPointModeINTEL' : 6080, - 'SingleElementVectorINTEL' : 6085, - 'VectorComputeCallableFunctionINTEL' : 6087, - }, - - 'BuiltIn' : { - 'Position' : 0, - 'PointSize' : 1, - 'ClipDistance' : 3, - 'CullDistance' : 4, - 'VertexId' : 5, - 'InstanceId' : 6, - 'PrimitiveId' : 7, - 'InvocationId' : 8, - 'Layer' : 9, - 'ViewportIndex' : 10, - 'TessLevelOuter' : 11, - 'TessLevelInner' : 12, - 'TessCoord' : 13, - 'PatchVertices' : 14, - 'FragCoord' : 15, - 'PointCoord' : 16, - 'FrontFacing' : 17, - 'SampleId' : 18, - 'SamplePosition' : 19, - 'SampleMask' : 20, - 'FragDepth' : 22, - 'HelperInvocation' : 23, - 'NumWorkgroups' : 24, - 'WorkgroupSize' : 25, - 'WorkgroupId' : 26, - 'LocalInvocationId' : 27, - 'GlobalInvocationId' : 28, - 'LocalInvocationIndex' : 29, - 'WorkDim' : 30, - 'GlobalSize' : 31, - 'EnqueuedWorkgroupSize' : 32, - 'GlobalOffset' : 33, - 'GlobalLinearId' : 34, - 'SubgroupSize' : 36, - 'SubgroupMaxSize' : 37, - 'NumSubgroups' : 38, - 'NumEnqueuedSubgroups' : 39, - 'SubgroupId' : 40, - 'SubgroupLocalInvocationId' : 41, - 'VertexIndex' : 42, - 'InstanceIndex' : 43, - 'SubgroupEqMask' : 4416, - 'SubgroupEqMaskKHR' : 4416, - 'SubgroupGeMask' : 4417, - 'SubgroupGeMaskKHR' : 4417, - 'SubgroupGtMask' : 4418, - 'SubgroupGtMaskKHR' : 4418, - 'SubgroupLeMask' : 4419, - 'SubgroupLeMaskKHR' : 4419, - 'SubgroupLtMask' : 4420, - 'SubgroupLtMaskKHR' : 4420, - 'BaseVertex' : 4424, - 'BaseInstance' : 4425, - 'DrawIndex' : 4426, - 'PrimitiveShadingRateKHR' : 4432, - 'DeviceIndex' : 4438, - 'ViewIndex' : 4440, - 'ShadingRateKHR' : 4444, - 'BaryCoordNoPerspAMD' : 4992, - 'BaryCoordNoPerspCentroidAMD' : 4993, - 'BaryCoordNoPerspSampleAMD' : 4994, - 'BaryCoordSmoothAMD' : 4995, - 'BaryCoordSmoothCentroidAMD' : 4996, - 'BaryCoordSmoothSampleAMD' : 4997, - 'BaryCoordPullModelAMD' : 4998, - 'FragStencilRefEXT' : 5014, - 'ViewportMaskNV' : 5253, - 'SecondaryPositionNV' : 5257, - 'SecondaryViewportMaskNV' : 5258, - 'PositionPerViewNV' : 5261, - 'ViewportMaskPerViewNV' : 5262, - 'FullyCoveredEXT' : 5264, - 'TaskCountNV' : 5274, - 'PrimitiveCountNV' : 5275, - 'PrimitiveIndicesNV' : 5276, - 'ClipDistancePerViewNV' : 5277, - 'CullDistancePerViewNV' : 5278, - 'LayerPerViewNV' : 5279, - 'MeshViewCountNV' : 5280, - 'MeshViewIndicesNV' : 5281, - 'BaryCoordNV' : 5286, - 'BaryCoordNoPerspNV' : 5287, - 'FragSizeEXT' : 5292, - 'FragmentSizeNV' : 5292, - 'FragInvocationCountEXT' : 5293, - 'InvocationsPerPixelNV' : 5293, - 'LaunchIdKHR' : 5319, - 'LaunchIdNV' : 5319, - 'LaunchSizeKHR' : 5320, - 'LaunchSizeNV' : 5320, - 'WorldRayOriginKHR' : 5321, - 'WorldRayOriginNV' : 5321, - 'WorldRayDirectionKHR' : 5322, - 'WorldRayDirectionNV' : 5322, - 'ObjectRayOriginKHR' : 5323, - 'ObjectRayOriginNV' : 5323, - 'ObjectRayDirectionKHR' : 5324, - 'ObjectRayDirectionNV' : 5324, - 'RayTminKHR' : 5325, - 'RayTminNV' : 5325, - 'RayTmaxKHR' : 5326, - 'RayTmaxNV' : 5326, - 'InstanceCustomIndexKHR' : 5327, - 'InstanceCustomIndexNV' : 5327, - 'ObjectToWorldKHR' : 5330, - 'ObjectToWorldNV' : 5330, - 'WorldToObjectKHR' : 5331, - 'WorldToObjectNV' : 5331, - 'HitTNV' : 5332, - 'HitKindKHR' : 5333, - 'HitKindNV' : 5333, - 'CurrentRayTimeNV' : 5334, - 'IncomingRayFlagsKHR' : 5351, - 'IncomingRayFlagsNV' : 5351, - 'RayGeometryIndexKHR' : 5352, - 'WarpsPerSMNV' : 5374, - 'SMCountNV' : 5375, - 'WarpIDNV' : 5376, - 'SMIDNV' : 5377, - }, - - 'SelectionControlShift' : { - 'Flatten' : 0, - 'DontFlatten' : 1, - }, - - 'SelectionControlMask' : { - 'MaskNone' : 0, - 'Flatten' : 0x00000001, - 'DontFlatten' : 0x00000002, - }, - - 'LoopControlShift' : { - 'Unroll' : 0, - 'DontUnroll' : 1, - 'DependencyInfinite' : 2, - 'DependencyLength' : 3, - 'MinIterations' : 4, - 'MaxIterations' : 5, - 'IterationMultiple' : 6, - 'PeelCount' : 7, - 'PartialCount' : 8, - 'InitiationIntervalINTEL' : 16, - 'MaxConcurrencyINTEL' : 17, - 'DependencyArrayINTEL' : 18, - 'PipelineEnableINTEL' : 19, - 'LoopCoalesceINTEL' : 20, - 'MaxInterleavingINTEL' : 21, - 'SpeculatedIterationsINTEL' : 22, - 'NoFusionINTEL' : 23, - }, - - 'LoopControlMask' : { - 'MaskNone' : 0, - 'Unroll' : 0x00000001, - 'DontUnroll' : 0x00000002, - 'DependencyInfinite' : 0x00000004, - 'DependencyLength' : 0x00000008, - 'MinIterations' : 0x00000010, - 'MaxIterations' : 0x00000020, - 'IterationMultiple' : 0x00000040, - 'PeelCount' : 0x00000080, - 'PartialCount' : 0x00000100, - 'InitiationIntervalINTEL' : 0x00010000, - 'MaxConcurrencyINTEL' : 0x00020000, - 'DependencyArrayINTEL' : 0x00040000, - 'PipelineEnableINTEL' : 0x00080000, - 'LoopCoalesceINTEL' : 0x00100000, - 'MaxInterleavingINTEL' : 0x00200000, - 'SpeculatedIterationsINTEL' : 0x00400000, - 'NoFusionINTEL' : 0x00800000, - }, - - 'FunctionControlShift' : { - 'Inline' : 0, - 'DontInline' : 1, - 'Pure' : 2, - 'Const' : 3, - 'OptNoneINTEL' : 16, - }, - - 'FunctionControlMask' : { - 'MaskNone' : 0, - 'Inline' : 0x00000001, - 'DontInline' : 0x00000002, - 'Pure' : 0x00000004, - 'Const' : 0x00000008, - 'OptNoneINTEL' : 0x00010000, - }, - - 'MemorySemanticsShift' : { - 'Acquire' : 1, - 'Release' : 2, - 'AcquireRelease' : 3, - 'SequentiallyConsistent' : 4, - 'UniformMemory' : 6, - 'SubgroupMemory' : 7, - 'WorkgroupMemory' : 8, - 'CrossWorkgroupMemory' : 9, - 'AtomicCounterMemory' : 10, - 'ImageMemory' : 11, - 'OutputMemory' : 12, - 'OutputMemoryKHR' : 12, - 'MakeAvailable' : 13, - 'MakeAvailableKHR' : 13, - 'MakeVisible' : 14, - 'MakeVisibleKHR' : 14, - 'Volatile' : 15, - }, - - 'MemorySemanticsMask' : { - 'MaskNone' : 0, - 'Acquire' : 0x00000002, - 'Release' : 0x00000004, - 'AcquireRelease' : 0x00000008, - 'SequentiallyConsistent' : 0x00000010, - 'UniformMemory' : 0x00000040, - 'SubgroupMemory' : 0x00000080, - 'WorkgroupMemory' : 0x00000100, - 'CrossWorkgroupMemory' : 0x00000200, - 'AtomicCounterMemory' : 0x00000400, - 'ImageMemory' : 0x00000800, - 'OutputMemory' : 0x00001000, - 'OutputMemoryKHR' : 0x00001000, - 'MakeAvailable' : 0x00002000, - 'MakeAvailableKHR' : 0x00002000, - 'MakeVisible' : 0x00004000, - 'MakeVisibleKHR' : 0x00004000, - 'Volatile' : 0x00008000, - }, - - 'MemoryAccessShift' : { - 'Volatile' : 0, - 'Aligned' : 1, - 'Nontemporal' : 2, - 'MakePointerAvailable' : 3, - 'MakePointerAvailableKHR' : 3, - 'MakePointerVisible' : 4, - 'MakePointerVisibleKHR' : 4, - 'NonPrivatePointer' : 5, - 'NonPrivatePointerKHR' : 5, - }, - - 'MemoryAccessMask' : { - 'MaskNone' : 0, - 'Volatile' : 0x00000001, - 'Aligned' : 0x00000002, - 'Nontemporal' : 0x00000004, - 'MakePointerAvailable' : 0x00000008, - 'MakePointerAvailableKHR' : 0x00000008, - 'MakePointerVisible' : 0x00000010, - 'MakePointerVisibleKHR' : 0x00000010, - 'NonPrivatePointer' : 0x00000020, - 'NonPrivatePointerKHR' : 0x00000020, - }, - - 'Scope' : { - 'CrossDevice' : 0, - 'Device' : 1, - 'Workgroup' : 2, - 'Subgroup' : 3, - 'Invocation' : 4, - 'QueueFamily' : 5, - 'QueueFamilyKHR' : 5, - 'ShaderCallKHR' : 6, - }, - - 'GroupOperation' : { - 'Reduce' : 0, - 'InclusiveScan' : 1, - 'ExclusiveScan' : 2, - 'ClusteredReduce' : 3, - 'PartitionedReduceNV' : 6, - 'PartitionedInclusiveScanNV' : 7, - 'PartitionedExclusiveScanNV' : 8, - }, - - 'KernelEnqueueFlags' : { - 'NoWait' : 0, - 'WaitKernel' : 1, - 'WaitWorkGroup' : 2, - }, - - 'KernelProfilingInfoShift' : { - 'CmdExecTime' : 0, - }, - - 'KernelProfilingInfoMask' : { - 'MaskNone' : 0, - 'CmdExecTime' : 0x00000001, - }, - - 'Capability' : { - 'Matrix' : 0, - 'Shader' : 1, - 'Geometry' : 2, - 'Tessellation' : 3, - 'Addresses' : 4, - 'Linkage' : 5, - 'Kernel' : 6, - 'Vector16' : 7, - 'Float16Buffer' : 8, - 'Float16' : 9, - 'Float64' : 10, - 'Int64' : 11, - 'Int64Atomics' : 12, - 'ImageBasic' : 13, - 'ImageReadWrite' : 14, - 'ImageMipmap' : 15, - 'Pipes' : 17, - 'Groups' : 18, - 'DeviceEnqueue' : 19, - 'LiteralSampler' : 20, - 'AtomicStorage' : 21, - 'Int16' : 22, - 'TessellationPointSize' : 23, - 'GeometryPointSize' : 24, - 'ImageGatherExtended' : 25, - 'StorageImageMultisample' : 27, - 'UniformBufferArrayDynamicIndexing' : 28, - 'SampledImageArrayDynamicIndexing' : 29, - 'StorageBufferArrayDynamicIndexing' : 30, - 'StorageImageArrayDynamicIndexing' : 31, - 'ClipDistance' : 32, - 'CullDistance' : 33, - 'ImageCubeArray' : 34, - 'SampleRateShading' : 35, - 'ImageRect' : 36, - 'SampledRect' : 37, - 'GenericPointer' : 38, - 'Int8' : 39, - 'InputAttachment' : 40, - 'SparseResidency' : 41, - 'MinLod' : 42, - 'Sampled1D' : 43, - 'Image1D' : 44, - 'SampledCubeArray' : 45, - 'SampledBuffer' : 46, - 'ImageBuffer' : 47, - 'ImageMSArray' : 48, - 'StorageImageExtendedFormats' : 49, - 'ImageQuery' : 50, - 'DerivativeControl' : 51, - 'InterpolationFunction' : 52, - 'TransformFeedback' : 53, - 'GeometryStreams' : 54, - 'StorageImageReadWithoutFormat' : 55, - 'StorageImageWriteWithoutFormat' : 56, - 'MultiViewport' : 57, - 'SubgroupDispatch' : 58, - 'NamedBarrier' : 59, - 'PipeStorage' : 60, - 'GroupNonUniform' : 61, - 'GroupNonUniformVote' : 62, - 'GroupNonUniformArithmetic' : 63, - 'GroupNonUniformBallot' : 64, - 'GroupNonUniformShuffle' : 65, - 'GroupNonUniformShuffleRelative' : 66, - 'GroupNonUniformClustered' : 67, - 'GroupNonUniformQuad' : 68, - 'ShaderLayer' : 69, - 'ShaderViewportIndex' : 70, - 'FragmentShadingRateKHR' : 4422, - 'SubgroupBallotKHR' : 4423, - 'DrawParameters' : 4427, - 'WorkgroupMemoryExplicitLayoutKHR' : 4428, - 'WorkgroupMemoryExplicitLayout8BitAccessKHR' : 4429, - 'WorkgroupMemoryExplicitLayout16BitAccessKHR' : 4430, - 'SubgroupVoteKHR' : 4431, - 'StorageBuffer16BitAccess' : 4433, - 'StorageUniformBufferBlock16' : 4433, - 'StorageUniform16' : 4434, - 'UniformAndStorageBuffer16BitAccess' : 4434, - 'StoragePushConstant16' : 4435, - 'StorageInputOutput16' : 4436, - 'DeviceGroup' : 4437, - 'MultiView' : 4439, - 'VariablePointersStorageBuffer' : 4441, - 'VariablePointers' : 4442, - 'AtomicStorageOps' : 4445, - 'SampleMaskPostDepthCoverage' : 4447, - 'StorageBuffer8BitAccess' : 4448, - 'UniformAndStorageBuffer8BitAccess' : 4449, - 'StoragePushConstant8' : 4450, - 'DenormPreserve' : 4464, - 'DenormFlushToZero' : 4465, - 'SignedZeroInfNanPreserve' : 4466, - 'RoundingModeRTE' : 4467, - 'RoundingModeRTZ' : 4468, - 'RayQueryProvisionalKHR' : 4471, - 'RayQueryKHR' : 4472, - 'RayTraversalPrimitiveCullingKHR' : 4478, - 'RayTracingKHR' : 4479, - 'Float16ImageAMD' : 5008, - 'ImageGatherBiasLodAMD' : 5009, - 'FragmentMaskAMD' : 5010, - 'StencilExportEXT' : 5013, - 'ImageReadWriteLodAMD' : 5015, - 'Int64ImageEXT' : 5016, - 'ShaderClockKHR' : 5055, - 'SampleMaskOverrideCoverageNV' : 5249, - 'GeometryShaderPassthroughNV' : 5251, - 'ShaderViewportIndexLayerEXT' : 5254, - 'ShaderViewportIndexLayerNV' : 5254, - 'ShaderViewportMaskNV' : 5255, - 'ShaderStereoViewNV' : 5259, - 'PerViewAttributesNV' : 5260, - 'FragmentFullyCoveredEXT' : 5265, - 'MeshShadingNV' : 5266, - 'ImageFootprintNV' : 5282, - 'FragmentBarycentricNV' : 5284, - 'ComputeDerivativeGroupQuadsNV' : 5288, - 'FragmentDensityEXT' : 5291, - 'ShadingRateNV' : 5291, - 'GroupNonUniformPartitionedNV' : 5297, - 'ShaderNonUniform' : 5301, - 'ShaderNonUniformEXT' : 5301, - 'RuntimeDescriptorArray' : 5302, - 'RuntimeDescriptorArrayEXT' : 5302, - 'InputAttachmentArrayDynamicIndexing' : 5303, - 'InputAttachmentArrayDynamicIndexingEXT' : 5303, - 'UniformTexelBufferArrayDynamicIndexing' : 5304, - 'UniformTexelBufferArrayDynamicIndexingEXT' : 5304, - 'StorageTexelBufferArrayDynamicIndexing' : 5305, - 'StorageTexelBufferArrayDynamicIndexingEXT' : 5305, - 'UniformBufferArrayNonUniformIndexing' : 5306, - 'UniformBufferArrayNonUniformIndexingEXT' : 5306, - 'SampledImageArrayNonUniformIndexing' : 5307, - 'SampledImageArrayNonUniformIndexingEXT' : 5307, - 'StorageBufferArrayNonUniformIndexing' : 5308, - 'StorageBufferArrayNonUniformIndexingEXT' : 5308, - 'StorageImageArrayNonUniformIndexing' : 5309, - 'StorageImageArrayNonUniformIndexingEXT' : 5309, - 'InputAttachmentArrayNonUniformIndexing' : 5310, - 'InputAttachmentArrayNonUniformIndexingEXT' : 5310, - 'UniformTexelBufferArrayNonUniformIndexing' : 5311, - 'UniformTexelBufferArrayNonUniformIndexingEXT' : 5311, - 'StorageTexelBufferArrayNonUniformIndexing' : 5312, - 'StorageTexelBufferArrayNonUniformIndexingEXT' : 5312, - 'RayTracingNV' : 5340, - 'RayTracingMotionBlurNV' : 5341, - 'VulkanMemoryModel' : 5345, - 'VulkanMemoryModelKHR' : 5345, - 'VulkanMemoryModelDeviceScope' : 5346, - 'VulkanMemoryModelDeviceScopeKHR' : 5346, - 'PhysicalStorageBufferAddresses' : 5347, - 'PhysicalStorageBufferAddressesEXT' : 5347, - 'ComputeDerivativeGroupLinearNV' : 5350, - 'RayTracingProvisionalKHR' : 5353, - 'CooperativeMatrixNV' : 5357, - 'FragmentShaderSampleInterlockEXT' : 5363, - 'FragmentShaderShadingRateInterlockEXT' : 5372, - 'ShaderSMBuiltinsNV' : 5373, - 'FragmentShaderPixelInterlockEXT' : 5378, - 'DemoteToHelperInvocationEXT' : 5379, - 'SubgroupShuffleINTEL' : 5568, - 'SubgroupBufferBlockIOINTEL' : 5569, - 'SubgroupImageBlockIOINTEL' : 5570, - 'SubgroupImageMediaBlockIOINTEL' : 5579, - 'RoundToInfinityINTEL' : 5582, - 'FloatingPointModeINTEL' : 5583, - 'IntegerFunctions2INTEL' : 5584, - 'FunctionPointersINTEL' : 5603, - 'IndirectReferencesINTEL' : 5604, - 'AsmINTEL' : 5606, - 'AtomicFloat32MinMaxEXT' : 5612, - 'AtomicFloat64MinMaxEXT' : 5613, - 'AtomicFloat16MinMaxEXT' : 5616, - 'VectorComputeINTEL' : 5617, - 'VectorAnyINTEL' : 5619, - 'ExpectAssumeKHR' : 5629, - 'SubgroupAvcMotionEstimationINTEL' : 5696, - 'SubgroupAvcMotionEstimationIntraINTEL' : 5697, - 'SubgroupAvcMotionEstimationChromaINTEL' : 5698, - 'VariableLengthArrayINTEL' : 5817, - 'FunctionFloatControlINTEL' : 5821, - 'FPGAMemoryAttributesINTEL' : 5824, - 'FPFastMathModeINTEL' : 5837, - 'ArbitraryPrecisionIntegersINTEL' : 5844, - 'ArbitraryPrecisionFloatingPointINTEL' : 5845, - 'UnstructuredLoopControlsINTEL' : 5886, - 'FPGALoopControlsINTEL' : 5888, - 'KernelAttributesINTEL' : 5892, - 'FPGAKernelAttributesINTEL' : 5897, - 'FPGAMemoryAccessesINTEL' : 5898, - 'FPGAClusterAttributesINTEL' : 5904, - 'LoopFuseINTEL' : 5906, - 'FPGABufferLocationINTEL' : 5920, - 'ArbitraryPrecisionFixedPointINTEL' : 5922, - 'USMStorageClassesINTEL' : 5935, - 'IOPipesINTEL' : 5943, - 'BlockingPipesINTEL' : 5945, - 'FPGARegINTEL' : 5948, - 'DotProductInputAllKHR' : 6016, - 'DotProductInput4x8BitKHR' : 6017, - 'DotProductInput4x8BitPackedKHR' : 6018, - 'DotProductKHR' : 6019, - 'BitInstructions' : 6025, - 'AtomicFloat32AddEXT' : 6033, - 'AtomicFloat64AddEXT' : 6034, - 'LongConstantCompositeINTEL' : 6089, - 'OptNoneINTEL' : 6094, - 'AtomicFloat16AddEXT' : 6095, - 'DebugInfoModuleINTEL' : 6114, - }, - - 'RayFlagsShift' : { - 'OpaqueKHR' : 0, - 'NoOpaqueKHR' : 1, - 'TerminateOnFirstHitKHR' : 2, - 'SkipClosestHitShaderKHR' : 3, - 'CullBackFacingTrianglesKHR' : 4, - 'CullFrontFacingTrianglesKHR' : 5, - 'CullOpaqueKHR' : 6, - 'CullNoOpaqueKHR' : 7, - 'SkipTrianglesKHR' : 8, - 'SkipAABBsKHR' : 9, - }, - - 'RayFlagsMask' : { - 'MaskNone' : 0, - 'OpaqueKHR' : 0x00000001, - 'NoOpaqueKHR' : 0x00000002, - 'TerminateOnFirstHitKHR' : 0x00000004, - 'SkipClosestHitShaderKHR' : 0x00000008, - 'CullBackFacingTrianglesKHR' : 0x00000010, - 'CullFrontFacingTrianglesKHR' : 0x00000020, - 'CullOpaqueKHR' : 0x00000040, - 'CullNoOpaqueKHR' : 0x00000080, - 'SkipTrianglesKHR' : 0x00000100, - 'SkipAABBsKHR' : 0x00000200, - }, - - 'RayQueryIntersection' : { - 'RayQueryCandidateIntersectionKHR' : 0, - 'RayQueryCommittedIntersectionKHR' : 1, - }, - - 'RayQueryCommittedIntersectionType' : { - 'RayQueryCommittedIntersectionNoneKHR' : 0, - 'RayQueryCommittedIntersectionTriangleKHR' : 1, - 'RayQueryCommittedIntersectionGeneratedKHR' : 2, - }, - - 'RayQueryCandidateIntersectionType' : { - 'RayQueryCandidateIntersectionTriangleKHR' : 0, - 'RayQueryCandidateIntersectionAABBKHR' : 1, - }, - - 'FragmentShadingRateShift' : { - 'Vertical2Pixels' : 0, - 'Vertical4Pixels' : 1, - 'Horizontal2Pixels' : 2, - 'Horizontal4Pixels' : 3, - }, - - 'FragmentShadingRateMask' : { - 'MaskNone' : 0, - 'Vertical2Pixels' : 0x00000001, - 'Vertical4Pixels' : 0x00000002, - 'Horizontal2Pixels' : 0x00000004, - 'Horizontal4Pixels' : 0x00000008, - }, - - 'FPDenormMode' : { - 'Preserve' : 0, - 'FlushToZero' : 1, - }, - - 'FPOperationMode' : { - 'IEEE' : 0, - 'ALT' : 1, - }, - - 'QuantizationModes' : { - 'TRN' : 0, - 'TRN_ZERO' : 1, - 'RND' : 2, - 'RND_ZERO' : 3, - 'RND_INF' : 4, - 'RND_MIN_INF' : 5, - 'RND_CONV' : 6, - 'RND_CONV_ODD' : 7, - }, - - 'OverflowModes' : { - 'WRAP' : 0, - 'SAT' : 1, - 'SAT_ZERO' : 2, - 'SAT_SYM' : 3, - }, - - 'PackedVectorFormat' : { - 'PackedVectorFormat4x8BitKHR' : 0, - }, - - 'Op' : { - 'OpNop' : 0, - 'OpUndef' : 1, - 'OpSourceContinued' : 2, - 'OpSource' : 3, - 'OpSourceExtension' : 4, - 'OpName' : 5, - 'OpMemberName' : 6, - 'OpString' : 7, - 'OpLine' : 8, - 'OpExtension' : 10, - 'OpExtInstImport' : 11, - 'OpExtInst' : 12, - 'OpMemoryModel' : 14, - 'OpEntryPoint' : 15, - 'OpExecutionMode' : 16, - 'OpCapability' : 17, - 'OpTypeVoid' : 19, - 'OpTypeBool' : 20, - 'OpTypeInt' : 21, - 'OpTypeFloat' : 22, - 'OpTypeVector' : 23, - 'OpTypeMatrix' : 24, - 'OpTypeImage' : 25, - 'OpTypeSampler' : 26, - 'OpTypeSampledImage' : 27, - 'OpTypeArray' : 28, - 'OpTypeRuntimeArray' : 29, - 'OpTypeStruct' : 30, - 'OpTypeOpaque' : 31, - 'OpTypePointer' : 32, - 'OpTypeFunction' : 33, - 'OpTypeEvent' : 34, - 'OpTypeDeviceEvent' : 35, - 'OpTypeReserveId' : 36, - 'OpTypeQueue' : 37, - 'OpTypePipe' : 38, - 'OpTypeForwardPointer' : 39, - 'OpConstantTrue' : 41, - 'OpConstantFalse' : 42, - 'OpConstant' : 43, - 'OpConstantComposite' : 44, - 'OpConstantSampler' : 45, - 'OpConstantNull' : 46, - 'OpSpecConstantTrue' : 48, - 'OpSpecConstantFalse' : 49, - 'OpSpecConstant' : 50, - 'OpSpecConstantComposite' : 51, - 'OpSpecConstantOp' : 52, - 'OpFunction' : 54, - 'OpFunctionParameter' : 55, - 'OpFunctionEnd' : 56, - 'OpFunctionCall' : 57, - 'OpVariable' : 59, - 'OpImageTexelPointer' : 60, - 'OpLoad' : 61, - 'OpStore' : 62, - 'OpCopyMemory' : 63, - 'OpCopyMemorySized' : 64, - 'OpAccessChain' : 65, - 'OpInBoundsAccessChain' : 66, - 'OpPtrAccessChain' : 67, - 'OpArrayLength' : 68, - 'OpGenericPtrMemSemantics' : 69, - 'OpInBoundsPtrAccessChain' : 70, - 'OpDecorate' : 71, - 'OpMemberDecorate' : 72, - 'OpDecorationGroup' : 73, - 'OpGroupDecorate' : 74, - 'OpGroupMemberDecorate' : 75, - 'OpVectorExtractDynamic' : 77, - 'OpVectorInsertDynamic' : 78, - 'OpVectorShuffle' : 79, - 'OpCompositeConstruct' : 80, - 'OpCompositeExtract' : 81, - 'OpCompositeInsert' : 82, - 'OpCopyObject' : 83, - 'OpTranspose' : 84, - 'OpSampledImage' : 86, - 'OpImageSampleImplicitLod' : 87, - 'OpImageSampleExplicitLod' : 88, - 'OpImageSampleDrefImplicitLod' : 89, - 'OpImageSampleDrefExplicitLod' : 90, - 'OpImageSampleProjImplicitLod' : 91, - 'OpImageSampleProjExplicitLod' : 92, - 'OpImageSampleProjDrefImplicitLod' : 93, - 'OpImageSampleProjDrefExplicitLod' : 94, - 'OpImageFetch' : 95, - 'OpImageGather' : 96, - 'OpImageDrefGather' : 97, - 'OpImageRead' : 98, - 'OpImageWrite' : 99, - 'OpImage' : 100, - 'OpImageQueryFormat' : 101, - 'OpImageQueryOrder' : 102, - 'OpImageQuerySizeLod' : 103, - 'OpImageQuerySize' : 104, - 'OpImageQueryLod' : 105, - 'OpImageQueryLevels' : 106, - 'OpImageQuerySamples' : 107, - 'OpConvertFToU' : 109, - 'OpConvertFToS' : 110, - 'OpConvertSToF' : 111, - 'OpConvertUToF' : 112, - 'OpUConvert' : 113, - 'OpSConvert' : 114, - 'OpFConvert' : 115, - 'OpQuantizeToF16' : 116, - 'OpConvertPtrToU' : 117, - 'OpSatConvertSToU' : 118, - 'OpSatConvertUToS' : 119, - 'OpConvertUToPtr' : 120, - 'OpPtrCastToGeneric' : 121, - 'OpGenericCastToPtr' : 122, - 'OpGenericCastToPtrExplicit' : 123, - 'OpBitcast' : 124, - 'OpSNegate' : 126, - 'OpFNegate' : 127, - 'OpIAdd' : 128, - 'OpFAdd' : 129, - 'OpISub' : 130, - 'OpFSub' : 131, - 'OpIMul' : 132, - 'OpFMul' : 133, - 'OpUDiv' : 134, - 'OpSDiv' : 135, - 'OpFDiv' : 136, - 'OpUMod' : 137, - 'OpSRem' : 138, - 'OpSMod' : 139, - 'OpFRem' : 140, - 'OpFMod' : 141, - 'OpVectorTimesScalar' : 142, - 'OpMatrixTimesScalar' : 143, - 'OpVectorTimesMatrix' : 144, - 'OpMatrixTimesVector' : 145, - 'OpMatrixTimesMatrix' : 146, - 'OpOuterProduct' : 147, - 'OpDot' : 148, - 'OpIAddCarry' : 149, - 'OpISubBorrow' : 150, - 'OpUMulExtended' : 151, - 'OpSMulExtended' : 152, - 'OpAny' : 154, - 'OpAll' : 155, - 'OpIsNan' : 156, - 'OpIsInf' : 157, - 'OpIsFinite' : 158, - 'OpIsNormal' : 159, - 'OpSignBitSet' : 160, - 'OpLessOrGreater' : 161, - 'OpOrdered' : 162, - 'OpUnordered' : 163, - 'OpLogicalEqual' : 164, - 'OpLogicalNotEqual' : 165, - 'OpLogicalOr' : 166, - 'OpLogicalAnd' : 167, - 'OpLogicalNot' : 168, - 'OpSelect' : 169, - 'OpIEqual' : 170, - 'OpINotEqual' : 171, - 'OpUGreaterThan' : 172, - 'OpSGreaterThan' : 173, - 'OpUGreaterThanEqual' : 174, - 'OpSGreaterThanEqual' : 175, - 'OpULessThan' : 176, - 'OpSLessThan' : 177, - 'OpULessThanEqual' : 178, - 'OpSLessThanEqual' : 179, - 'OpFOrdEqual' : 180, - 'OpFUnordEqual' : 181, - 'OpFOrdNotEqual' : 182, - 'OpFUnordNotEqual' : 183, - 'OpFOrdLessThan' : 184, - 'OpFUnordLessThan' : 185, - 'OpFOrdGreaterThan' : 186, - 'OpFUnordGreaterThan' : 187, - 'OpFOrdLessThanEqual' : 188, - 'OpFUnordLessThanEqual' : 189, - 'OpFOrdGreaterThanEqual' : 190, - 'OpFUnordGreaterThanEqual' : 191, - 'OpShiftRightLogical' : 194, - 'OpShiftRightArithmetic' : 195, - 'OpShiftLeftLogical' : 196, - 'OpBitwiseOr' : 197, - 'OpBitwiseXor' : 198, - 'OpBitwiseAnd' : 199, - 'OpNot' : 200, - 'OpBitFieldInsert' : 201, - 'OpBitFieldSExtract' : 202, - 'OpBitFieldUExtract' : 203, - 'OpBitReverse' : 204, - 'OpBitCount' : 205, - 'OpDPdx' : 207, - 'OpDPdy' : 208, - 'OpFwidth' : 209, - 'OpDPdxFine' : 210, - 'OpDPdyFine' : 211, - 'OpFwidthFine' : 212, - 'OpDPdxCoarse' : 213, - 'OpDPdyCoarse' : 214, - 'OpFwidthCoarse' : 215, - 'OpEmitVertex' : 218, - 'OpEndPrimitive' : 219, - 'OpEmitStreamVertex' : 220, - 'OpEndStreamPrimitive' : 221, - 'OpControlBarrier' : 224, - 'OpMemoryBarrier' : 225, - 'OpAtomicLoad' : 227, - 'OpAtomicStore' : 228, - 'OpAtomicExchange' : 229, - 'OpAtomicCompareExchange' : 230, - 'OpAtomicCompareExchangeWeak' : 231, - 'OpAtomicIIncrement' : 232, - 'OpAtomicIDecrement' : 233, - 'OpAtomicIAdd' : 234, - 'OpAtomicISub' : 235, - 'OpAtomicSMin' : 236, - 'OpAtomicUMin' : 237, - 'OpAtomicSMax' : 238, - 'OpAtomicUMax' : 239, - 'OpAtomicAnd' : 240, - 'OpAtomicOr' : 241, - 'OpAtomicXor' : 242, - 'OpPhi' : 245, - 'OpLoopMerge' : 246, - 'OpSelectionMerge' : 247, - 'OpLabel' : 248, - 'OpBranch' : 249, - 'OpBranchConditional' : 250, - 'OpSwitch' : 251, - 'OpKill' : 252, - 'OpReturn' : 253, - 'OpReturnValue' : 254, - 'OpUnreachable' : 255, - 'OpLifetimeStart' : 256, - 'OpLifetimeStop' : 257, - 'OpGroupAsyncCopy' : 259, - 'OpGroupWaitEvents' : 260, - 'OpGroupAll' : 261, - 'OpGroupAny' : 262, - 'OpGroupBroadcast' : 263, - 'OpGroupIAdd' : 264, - 'OpGroupFAdd' : 265, - 'OpGroupFMin' : 266, - 'OpGroupUMin' : 267, - 'OpGroupSMin' : 268, - 'OpGroupFMax' : 269, - 'OpGroupUMax' : 270, - 'OpGroupSMax' : 271, - 'OpReadPipe' : 274, - 'OpWritePipe' : 275, - 'OpReservedReadPipe' : 276, - 'OpReservedWritePipe' : 277, - 'OpReserveReadPipePackets' : 278, - 'OpReserveWritePipePackets' : 279, - 'OpCommitReadPipe' : 280, - 'OpCommitWritePipe' : 281, - 'OpIsValidReserveId' : 282, - 'OpGetNumPipePackets' : 283, - 'OpGetMaxPipePackets' : 284, - 'OpGroupReserveReadPipePackets' : 285, - 'OpGroupReserveWritePipePackets' : 286, - 'OpGroupCommitReadPipe' : 287, - 'OpGroupCommitWritePipe' : 288, - 'OpEnqueueMarker' : 291, - 'OpEnqueueKernel' : 292, - 'OpGetKernelNDrangeSubGroupCount' : 293, - 'OpGetKernelNDrangeMaxSubGroupSize' : 294, - 'OpGetKernelWorkGroupSize' : 295, - 'OpGetKernelPreferredWorkGroupSizeMultiple' : 296, - 'OpRetainEvent' : 297, - 'OpReleaseEvent' : 298, - 'OpCreateUserEvent' : 299, - 'OpIsValidEvent' : 300, - 'OpSetUserEventStatus' : 301, - 'OpCaptureEventProfilingInfo' : 302, - 'OpGetDefaultQueue' : 303, - 'OpBuildNDRange' : 304, - 'OpImageSparseSampleImplicitLod' : 305, - 'OpImageSparseSampleExplicitLod' : 306, - 'OpImageSparseSampleDrefImplicitLod' : 307, - 'OpImageSparseSampleDrefExplicitLod' : 308, - 'OpImageSparseSampleProjImplicitLod' : 309, - 'OpImageSparseSampleProjExplicitLod' : 310, - 'OpImageSparseSampleProjDrefImplicitLod' : 311, - 'OpImageSparseSampleProjDrefExplicitLod' : 312, - 'OpImageSparseFetch' : 313, - 'OpImageSparseGather' : 314, - 'OpImageSparseDrefGather' : 315, - 'OpImageSparseTexelsResident' : 316, - 'OpNoLine' : 317, - 'OpAtomicFlagTestAndSet' : 318, - 'OpAtomicFlagClear' : 319, - 'OpImageSparseRead' : 320, - 'OpSizeOf' : 321, - 'OpTypePipeStorage' : 322, - 'OpConstantPipeStorage' : 323, - 'OpCreatePipeFromPipeStorage' : 324, - 'OpGetKernelLocalSizeForSubgroupCount' : 325, - 'OpGetKernelMaxNumSubgroups' : 326, - 'OpTypeNamedBarrier' : 327, - 'OpNamedBarrierInitialize' : 328, - 'OpMemoryNamedBarrier' : 329, - 'OpModuleProcessed' : 330, - 'OpExecutionModeId' : 331, - 'OpDecorateId' : 332, - 'OpGroupNonUniformElect' : 333, - 'OpGroupNonUniformAll' : 334, - 'OpGroupNonUniformAny' : 335, - 'OpGroupNonUniformAllEqual' : 336, - 'OpGroupNonUniformBroadcast' : 337, - 'OpGroupNonUniformBroadcastFirst' : 338, - 'OpGroupNonUniformBallot' : 339, - 'OpGroupNonUniformInverseBallot' : 340, - 'OpGroupNonUniformBallotBitExtract' : 341, - 'OpGroupNonUniformBallotBitCount' : 342, - 'OpGroupNonUniformBallotFindLSB' : 343, - 'OpGroupNonUniformBallotFindMSB' : 344, - 'OpGroupNonUniformShuffle' : 345, - 'OpGroupNonUniformShuffleXor' : 346, - 'OpGroupNonUniformShuffleUp' : 347, - 'OpGroupNonUniformShuffleDown' : 348, - 'OpGroupNonUniformIAdd' : 349, - 'OpGroupNonUniformFAdd' : 350, - 'OpGroupNonUniformIMul' : 351, - 'OpGroupNonUniformFMul' : 352, - 'OpGroupNonUniformSMin' : 353, - 'OpGroupNonUniformUMin' : 354, - 'OpGroupNonUniformFMin' : 355, - 'OpGroupNonUniformSMax' : 356, - 'OpGroupNonUniformUMax' : 357, - 'OpGroupNonUniformFMax' : 358, - 'OpGroupNonUniformBitwiseAnd' : 359, - 'OpGroupNonUniformBitwiseOr' : 360, - 'OpGroupNonUniformBitwiseXor' : 361, - 'OpGroupNonUniformLogicalAnd' : 362, - 'OpGroupNonUniformLogicalOr' : 363, - 'OpGroupNonUniformLogicalXor' : 364, - 'OpGroupNonUniformQuadBroadcast' : 365, - 'OpGroupNonUniformQuadSwap' : 366, - 'OpCopyLogical' : 400, - 'OpPtrEqual' : 401, - 'OpPtrNotEqual' : 402, - 'OpPtrDiff' : 403, - 'OpTerminateInvocation' : 4416, - 'OpSubgroupBallotKHR' : 4421, - 'OpSubgroupFirstInvocationKHR' : 4422, - 'OpSubgroupAllKHR' : 4428, - 'OpSubgroupAnyKHR' : 4429, - 'OpSubgroupAllEqualKHR' : 4430, - 'OpSubgroupReadInvocationKHR' : 4432, - 'OpTraceRayKHR' : 4445, - 'OpExecuteCallableKHR' : 4446, - 'OpConvertUToAccelerationStructureKHR' : 4447, - 'OpIgnoreIntersectionKHR' : 4448, - 'OpTerminateRayKHR' : 4449, - 'OpSDotKHR' : 4450, - 'OpUDotKHR' : 4451, - 'OpSUDotKHR' : 4452, - 'OpSDotAccSatKHR' : 4453, - 'OpUDotAccSatKHR' : 4454, - 'OpSUDotAccSatKHR' : 4455, - 'OpTypeRayQueryKHR' : 4472, - 'OpRayQueryInitializeKHR' : 4473, - 'OpRayQueryTerminateKHR' : 4474, - 'OpRayQueryGenerateIntersectionKHR' : 4475, - 'OpRayQueryConfirmIntersectionKHR' : 4476, - 'OpRayQueryProceedKHR' : 4477, - 'OpRayQueryGetIntersectionTypeKHR' : 4479, - 'OpGroupIAddNonUniformAMD' : 5000, - 'OpGroupFAddNonUniformAMD' : 5001, - 'OpGroupFMinNonUniformAMD' : 5002, - 'OpGroupUMinNonUniformAMD' : 5003, - 'OpGroupSMinNonUniformAMD' : 5004, - 'OpGroupFMaxNonUniformAMD' : 5005, - 'OpGroupUMaxNonUniformAMD' : 5006, - 'OpGroupSMaxNonUniformAMD' : 5007, - 'OpFragmentMaskFetchAMD' : 5011, - 'OpFragmentFetchAMD' : 5012, - 'OpReadClockKHR' : 5056, - 'OpImageSampleFootprintNV' : 5283, - 'OpGroupNonUniformPartitionNV' : 5296, - 'OpWritePackedPrimitiveIndices4x8NV' : 5299, - 'OpReportIntersectionKHR' : 5334, - 'OpReportIntersectionNV' : 5334, - 'OpIgnoreIntersectionNV' : 5335, - 'OpTerminateRayNV' : 5336, - 'OpTraceNV' : 5337, - 'OpTraceMotionNV' : 5338, - 'OpTraceRayMotionNV' : 5339, - 'OpTypeAccelerationStructureKHR' : 5341, - 'OpTypeAccelerationStructureNV' : 5341, - 'OpExecuteCallableNV' : 5344, - 'OpTypeCooperativeMatrixNV' : 5358, - 'OpCooperativeMatrixLoadNV' : 5359, - 'OpCooperativeMatrixStoreNV' : 5360, - 'OpCooperativeMatrixMulAddNV' : 5361, - 'OpCooperativeMatrixLengthNV' : 5362, - 'OpBeginInvocationInterlockEXT' : 5364, - 'OpEndInvocationInterlockEXT' : 5365, - 'OpDemoteToHelperInvocationEXT' : 5380, - 'OpIsHelperInvocationEXT' : 5381, - 'OpSubgroupShuffleINTEL' : 5571, - 'OpSubgroupShuffleDownINTEL' : 5572, - 'OpSubgroupShuffleUpINTEL' : 5573, - 'OpSubgroupShuffleXorINTEL' : 5574, - 'OpSubgroupBlockReadINTEL' : 5575, - 'OpSubgroupBlockWriteINTEL' : 5576, - 'OpSubgroupImageBlockReadINTEL' : 5577, - 'OpSubgroupImageBlockWriteINTEL' : 5578, - 'OpSubgroupImageMediaBlockReadINTEL' : 5580, - 'OpSubgroupImageMediaBlockWriteINTEL' : 5581, - 'OpUCountLeadingZerosINTEL' : 5585, - 'OpUCountTrailingZerosINTEL' : 5586, - 'OpAbsISubINTEL' : 5587, - 'OpAbsUSubINTEL' : 5588, - 'OpIAddSatINTEL' : 5589, - 'OpUAddSatINTEL' : 5590, - 'OpIAverageINTEL' : 5591, - 'OpUAverageINTEL' : 5592, - 'OpIAverageRoundedINTEL' : 5593, - 'OpUAverageRoundedINTEL' : 5594, - 'OpISubSatINTEL' : 5595, - 'OpUSubSatINTEL' : 5596, - 'OpIMul32x16INTEL' : 5597, - 'OpUMul32x16INTEL' : 5598, - 'OpConstFunctionPointerINTEL' : 5600, - 'OpFunctionPointerCallINTEL' : 5601, - 'OpAsmTargetINTEL' : 5609, - 'OpAsmINTEL' : 5610, - 'OpAsmCallINTEL' : 5611, - 'OpAtomicFMinEXT' : 5614, - 'OpAtomicFMaxEXT' : 5615, - 'OpAssumeTrueKHR' : 5630, - 'OpExpectKHR' : 5631, - 'OpDecorateString' : 5632, - 'OpDecorateStringGOOGLE' : 5632, - 'OpMemberDecorateString' : 5633, - 'OpMemberDecorateStringGOOGLE' : 5633, - 'OpVmeImageINTEL' : 5699, - 'OpTypeVmeImageINTEL' : 5700, - 'OpTypeAvcImePayloadINTEL' : 5701, - 'OpTypeAvcRefPayloadINTEL' : 5702, - 'OpTypeAvcSicPayloadINTEL' : 5703, - 'OpTypeAvcMcePayloadINTEL' : 5704, - 'OpTypeAvcMceResultINTEL' : 5705, - 'OpTypeAvcImeResultINTEL' : 5706, - 'OpTypeAvcImeResultSingleReferenceStreamoutINTEL' : 5707, - 'OpTypeAvcImeResultDualReferenceStreamoutINTEL' : 5708, - 'OpTypeAvcImeSingleReferenceStreaminINTEL' : 5709, - 'OpTypeAvcImeDualReferenceStreaminINTEL' : 5710, - 'OpTypeAvcRefResultINTEL' : 5711, - 'OpTypeAvcSicResultINTEL' : 5712, - 'OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL' : 5713, - 'OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL' : 5714, - 'OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL' : 5715, - 'OpSubgroupAvcMceSetInterShapePenaltyINTEL' : 5716, - 'OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL' : 5717, - 'OpSubgroupAvcMceSetInterDirectionPenaltyINTEL' : 5718, - 'OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL' : 5719, - 'OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL' : 5720, - 'OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL' : 5721, - 'OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL' : 5722, - 'OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL' : 5723, - 'OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL' : 5724, - 'OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL' : 5725, - 'OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL' : 5726, - 'OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL' : 5727, - 'OpSubgroupAvcMceSetAcOnlyHaarINTEL' : 5728, - 'OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL' : 5729, - 'OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL' : 5730, - 'OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL' : 5731, - 'OpSubgroupAvcMceConvertToImePayloadINTEL' : 5732, - 'OpSubgroupAvcMceConvertToImeResultINTEL' : 5733, - 'OpSubgroupAvcMceConvertToRefPayloadINTEL' : 5734, - 'OpSubgroupAvcMceConvertToRefResultINTEL' : 5735, - 'OpSubgroupAvcMceConvertToSicPayloadINTEL' : 5736, - 'OpSubgroupAvcMceConvertToSicResultINTEL' : 5737, - 'OpSubgroupAvcMceGetMotionVectorsINTEL' : 5738, - 'OpSubgroupAvcMceGetInterDistortionsINTEL' : 5739, - 'OpSubgroupAvcMceGetBestInterDistortionsINTEL' : 5740, - 'OpSubgroupAvcMceGetInterMajorShapeINTEL' : 5741, - 'OpSubgroupAvcMceGetInterMinorShapeINTEL' : 5742, - 'OpSubgroupAvcMceGetInterDirectionsINTEL' : 5743, - 'OpSubgroupAvcMceGetInterMotionVectorCountINTEL' : 5744, - 'OpSubgroupAvcMceGetInterReferenceIdsINTEL' : 5745, - 'OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL' : 5746, - 'OpSubgroupAvcImeInitializeINTEL' : 5747, - 'OpSubgroupAvcImeSetSingleReferenceINTEL' : 5748, - 'OpSubgroupAvcImeSetDualReferenceINTEL' : 5749, - 'OpSubgroupAvcImeRefWindowSizeINTEL' : 5750, - 'OpSubgroupAvcImeAdjustRefOffsetINTEL' : 5751, - 'OpSubgroupAvcImeConvertToMcePayloadINTEL' : 5752, - 'OpSubgroupAvcImeSetMaxMotionVectorCountINTEL' : 5753, - 'OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL' : 5754, - 'OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL' : 5755, - 'OpSubgroupAvcImeSetWeightedSadINTEL' : 5756, - 'OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL' : 5757, - 'OpSubgroupAvcImeEvaluateWithDualReferenceINTEL' : 5758, - 'OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL' : 5759, - 'OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL' : 5760, - 'OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL' : 5761, - 'OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL' : 5762, - 'OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL' : 5763, - 'OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL' : 5764, - 'OpSubgroupAvcImeConvertToMceResultINTEL' : 5765, - 'OpSubgroupAvcImeGetSingleReferenceStreaminINTEL' : 5766, - 'OpSubgroupAvcImeGetDualReferenceStreaminINTEL' : 5767, - 'OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL' : 5768, - 'OpSubgroupAvcImeStripDualReferenceStreamoutINTEL' : 5769, - 'OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL' : 5770, - 'OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL' : 5771, - 'OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL' : 5772, - 'OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL' : 5773, - 'OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL' : 5774, - 'OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL' : 5775, - 'OpSubgroupAvcImeGetBorderReachedINTEL' : 5776, - 'OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL' : 5777, - 'OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL' : 5778, - 'OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL' : 5779, - 'OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL' : 5780, - 'OpSubgroupAvcFmeInitializeINTEL' : 5781, - 'OpSubgroupAvcBmeInitializeINTEL' : 5782, - 'OpSubgroupAvcRefConvertToMcePayloadINTEL' : 5783, - 'OpSubgroupAvcRefSetBidirectionalMixDisableINTEL' : 5784, - 'OpSubgroupAvcRefSetBilinearFilterEnableINTEL' : 5785, - 'OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL' : 5786, - 'OpSubgroupAvcRefEvaluateWithDualReferenceINTEL' : 5787, - 'OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL' : 5788, - 'OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL' : 5789, - 'OpSubgroupAvcRefConvertToMceResultINTEL' : 5790, - 'OpSubgroupAvcSicInitializeINTEL' : 5791, - 'OpSubgroupAvcSicConfigureSkcINTEL' : 5792, - 'OpSubgroupAvcSicConfigureIpeLumaINTEL' : 5793, - 'OpSubgroupAvcSicConfigureIpeLumaChromaINTEL' : 5794, - 'OpSubgroupAvcSicGetMotionVectorMaskINTEL' : 5795, - 'OpSubgroupAvcSicConvertToMcePayloadINTEL' : 5796, - 'OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL' : 5797, - 'OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL' : 5798, - 'OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL' : 5799, - 'OpSubgroupAvcSicSetBilinearFilterEnableINTEL' : 5800, - 'OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL' : 5801, - 'OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL' : 5802, - 'OpSubgroupAvcSicEvaluateIpeINTEL' : 5803, - 'OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL' : 5804, - 'OpSubgroupAvcSicEvaluateWithDualReferenceINTEL' : 5805, - 'OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL' : 5806, - 'OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL' : 5807, - 'OpSubgroupAvcSicConvertToMceResultINTEL' : 5808, - 'OpSubgroupAvcSicGetIpeLumaShapeINTEL' : 5809, - 'OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL' : 5810, - 'OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL' : 5811, - 'OpSubgroupAvcSicGetPackedIpeLumaModesINTEL' : 5812, - 'OpSubgroupAvcSicGetIpeChromaModeINTEL' : 5813, - 'OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL' : 5814, - 'OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL' : 5815, - 'OpSubgroupAvcSicGetInterRawSadsINTEL' : 5816, - 'OpVariableLengthArrayINTEL' : 5818, - 'OpSaveMemoryINTEL' : 5819, - 'OpRestoreMemoryINTEL' : 5820, - 'OpArbitraryFloatSinCosPiINTEL' : 5840, - 'OpArbitraryFloatCastINTEL' : 5841, - 'OpArbitraryFloatCastFromIntINTEL' : 5842, - 'OpArbitraryFloatCastToIntINTEL' : 5843, - 'OpArbitraryFloatAddINTEL' : 5846, - 'OpArbitraryFloatSubINTEL' : 5847, - 'OpArbitraryFloatMulINTEL' : 5848, - 'OpArbitraryFloatDivINTEL' : 5849, - 'OpArbitraryFloatGTINTEL' : 5850, - 'OpArbitraryFloatGEINTEL' : 5851, - 'OpArbitraryFloatLTINTEL' : 5852, - 'OpArbitraryFloatLEINTEL' : 5853, - 'OpArbitraryFloatEQINTEL' : 5854, - 'OpArbitraryFloatRecipINTEL' : 5855, - 'OpArbitraryFloatRSqrtINTEL' : 5856, - 'OpArbitraryFloatCbrtINTEL' : 5857, - 'OpArbitraryFloatHypotINTEL' : 5858, - 'OpArbitraryFloatSqrtINTEL' : 5859, - 'OpArbitraryFloatLogINTEL' : 5860, - 'OpArbitraryFloatLog2INTEL' : 5861, - 'OpArbitraryFloatLog10INTEL' : 5862, - 'OpArbitraryFloatLog1pINTEL' : 5863, - 'OpArbitraryFloatExpINTEL' : 5864, - 'OpArbitraryFloatExp2INTEL' : 5865, - 'OpArbitraryFloatExp10INTEL' : 5866, - 'OpArbitraryFloatExpm1INTEL' : 5867, - 'OpArbitraryFloatSinINTEL' : 5868, - 'OpArbitraryFloatCosINTEL' : 5869, - 'OpArbitraryFloatSinCosINTEL' : 5870, - 'OpArbitraryFloatSinPiINTEL' : 5871, - 'OpArbitraryFloatCosPiINTEL' : 5872, - 'OpArbitraryFloatASinINTEL' : 5873, - 'OpArbitraryFloatASinPiINTEL' : 5874, - 'OpArbitraryFloatACosINTEL' : 5875, - 'OpArbitraryFloatACosPiINTEL' : 5876, - 'OpArbitraryFloatATanINTEL' : 5877, - 'OpArbitraryFloatATanPiINTEL' : 5878, - 'OpArbitraryFloatATan2INTEL' : 5879, - 'OpArbitraryFloatPowINTEL' : 5880, - 'OpArbitraryFloatPowRINTEL' : 5881, - 'OpArbitraryFloatPowNINTEL' : 5882, - 'OpLoopControlINTEL' : 5887, - 'OpFixedSqrtINTEL' : 5923, - 'OpFixedRecipINTEL' : 5924, - 'OpFixedRsqrtINTEL' : 5925, - 'OpFixedSinINTEL' : 5926, - 'OpFixedCosINTEL' : 5927, - 'OpFixedSinCosINTEL' : 5928, - 'OpFixedSinPiINTEL' : 5929, - 'OpFixedCosPiINTEL' : 5930, - 'OpFixedSinCosPiINTEL' : 5931, - 'OpFixedLogINTEL' : 5932, - 'OpFixedExpINTEL' : 5933, - 'OpPtrCastToCrossWorkgroupINTEL' : 5934, - 'OpCrossWorkgroupCastToPtrINTEL' : 5938, - 'OpReadPipeBlockingINTEL' : 5946, - 'OpWritePipeBlockingINTEL' : 5947, - 'OpFPGARegINTEL' : 5949, - 'OpRayQueryGetRayTMinKHR' : 6016, - 'OpRayQueryGetRayFlagsKHR' : 6017, - 'OpRayQueryGetIntersectionTKHR' : 6018, - 'OpRayQueryGetIntersectionInstanceCustomIndexKHR' : 6019, - 'OpRayQueryGetIntersectionInstanceIdKHR' : 6020, - 'OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR' : 6021, - 'OpRayQueryGetIntersectionGeometryIndexKHR' : 6022, - 'OpRayQueryGetIntersectionPrimitiveIndexKHR' : 6023, - 'OpRayQueryGetIntersectionBarycentricsKHR' : 6024, - 'OpRayQueryGetIntersectionFrontFaceKHR' : 6025, - 'OpRayQueryGetIntersectionCandidateAABBOpaqueKHR' : 6026, - 'OpRayQueryGetIntersectionObjectRayDirectionKHR' : 6027, - 'OpRayQueryGetIntersectionObjectRayOriginKHR' : 6028, - 'OpRayQueryGetWorldRayDirectionKHR' : 6029, - 'OpRayQueryGetWorldRayOriginKHR' : 6030, - 'OpRayQueryGetIntersectionObjectToWorldKHR' : 6031, - 'OpRayQueryGetIntersectionWorldToObjectKHR' : 6032, - 'OpAtomicFAddEXT' : 6035, - 'OpTypeBufferSurfaceINTEL' : 6086, - 'OpTypeStructContinuedINTEL' : 6090, - 'OpConstantCompositeContinuedINTEL' : 6091, - 'OpSpecConstantCompositeContinuedINTEL' : 6092, - }, - -} - diff --git a/include/spirv/unified1/spv.d b/include/spirv/unified1/spv.d deleted file mode 100644 index b85517a2..00000000 --- a/include/spirv/unified1/spv.d +++ /dev/null @@ -1,1814 +0,0 @@ -/+ - + Copyright (c) 2014-2020 The Khronos Group Inc. - + - + Permission is hereby granted, free of charge, to any person obtaining a copy - + of this software and/or associated documentation files (the "Materials"), - + to deal in the Materials without restriction, including without limitation - + the rights to use, copy, modify, merge, publish, distribute, sublicense, - + and/or sell copies of the Materials, and to permit persons to whom the - + Materials are furnished to do so, subject to the following conditions: - + - + The above copyright notice and this permission notice shall be included in - + all copies or substantial portions of the Materials. - + - + MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS - + STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND - + HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ - + - + THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - + FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS - + IN THE MATERIALS. - +/ - -/+ - + This header is automatically generated by the same tool that creates - + the Binary Section of the SPIR-V specification. - +/ - -/+ - + Enumeration tokens for SPIR-V, in various styles: - + C, C++, C++11, JSON, Lua, Python, C#, D - + - + - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL - + - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL - + - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL - + - Lua will use tables, e.g.: spv.SourceLanguage.GLSL - + - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] - + - C# will use enum classes in the Specification class located in the "Spv" namespace, - + e.g.: Spv.Specification.SourceLanguage.GLSL - + - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL - + - + Some tokens act like mask values, which can be OR'd together, - + while others are mutually exclusive. The mask-like ones have - + "Mask" in their name, and a parallel enum that has the shift - + amount (1 << x) for each corresponding enumerant. - +/ - -module spv; - -enum uint MagicNumber = 0x07230203; -enum uint Version = 0x00010500; -enum uint Revision = 4; -enum uint OpCodeMask = 0xffff; -enum uint WordCountShift = 16; - -enum SourceLanguage : uint -{ - Unknown = 0, - ESSL = 1, - GLSL = 2, - OpenCL_C = 3, - OpenCL_CPP = 4, - HLSL = 5, - CPP_for_OpenCL = 6, -} - -enum ExecutionModel : uint -{ - Vertex = 0, - TessellationControl = 1, - TessellationEvaluation = 2, - Geometry = 3, - Fragment = 4, - GLCompute = 5, - Kernel = 6, - TaskNV = 5267, - MeshNV = 5268, - RayGenerationKHR = 5313, - RayGenerationNV = 5313, - IntersectionKHR = 5314, - IntersectionNV = 5314, - AnyHitKHR = 5315, - AnyHitNV = 5315, - ClosestHitKHR = 5316, - ClosestHitNV = 5316, - MissKHR = 5317, - MissNV = 5317, - CallableKHR = 5318, - CallableNV = 5318, -} - -enum AddressingModel : uint -{ - Logical = 0, - Physical32 = 1, - Physical64 = 2, - PhysicalStorageBuffer64 = 5348, - PhysicalStorageBuffer64EXT = 5348, -} - -enum MemoryModel : uint -{ - Simple = 0, - GLSL450 = 1, - OpenCL = 2, - Vulkan = 3, - VulkanKHR = 3, -} - -enum ExecutionMode : uint -{ - Invocations = 0, - SpacingEqual = 1, - SpacingFractionalEven = 2, - SpacingFractionalOdd = 3, - VertexOrderCw = 4, - VertexOrderCcw = 5, - PixelCenterInteger = 6, - OriginUpperLeft = 7, - OriginLowerLeft = 8, - EarlyFragmentTests = 9, - PointMode = 10, - Xfb = 11, - DepthReplacing = 12, - DepthGreater = 14, - DepthLess = 15, - DepthUnchanged = 16, - LocalSize = 17, - LocalSizeHint = 18, - InputPoints = 19, - InputLines = 20, - InputLinesAdjacency = 21, - Triangles = 22, - InputTrianglesAdjacency = 23, - Quads = 24, - Isolines = 25, - OutputVertices = 26, - OutputPoints = 27, - OutputLineStrip = 28, - OutputTriangleStrip = 29, - VecTypeHint = 30, - ContractionOff = 31, - Initializer = 33, - Finalizer = 34, - SubgroupSize = 35, - SubgroupsPerWorkgroup = 36, - SubgroupsPerWorkgroupId = 37, - LocalSizeId = 38, - LocalSizeHintId = 39, - SubgroupUniformControlFlowKHR = 4421, - PostDepthCoverage = 4446, - DenormPreserve = 4459, - DenormFlushToZero = 4460, - SignedZeroInfNanPreserve = 4461, - RoundingModeRTE = 4462, - RoundingModeRTZ = 4463, - StencilRefReplacingEXT = 5027, - OutputLinesNV = 5269, - OutputPrimitivesNV = 5270, - DerivativeGroupQuadsNV = 5289, - DerivativeGroupLinearNV = 5290, - OutputTrianglesNV = 5298, - PixelInterlockOrderedEXT = 5366, - PixelInterlockUnorderedEXT = 5367, - SampleInterlockOrderedEXT = 5368, - SampleInterlockUnorderedEXT = 5369, - ShadingRateInterlockOrderedEXT = 5370, - ShadingRateInterlockUnorderedEXT = 5371, - SharedLocalMemorySizeINTEL = 5618, - RoundingModeRTPINTEL = 5620, - RoundingModeRTNINTEL = 5621, - FloatingPointModeALTINTEL = 5622, - FloatingPointModeIEEEINTEL = 5623, - MaxWorkgroupSizeINTEL = 5893, - MaxWorkDimINTEL = 5894, - NoGlobalOffsetINTEL = 5895, - NumSIMDWorkitemsINTEL = 5896, - SchedulerTargetFmaxMhzINTEL = 5903, -} - -enum StorageClass : uint -{ - UniformConstant = 0, - Input = 1, - Uniform = 2, - Output = 3, - Workgroup = 4, - CrossWorkgroup = 5, - Private = 6, - Function = 7, - Generic = 8, - PushConstant = 9, - AtomicCounter = 10, - Image = 11, - StorageBuffer = 12, - CallableDataKHR = 5328, - CallableDataNV = 5328, - IncomingCallableDataKHR = 5329, - IncomingCallableDataNV = 5329, - RayPayloadKHR = 5338, - RayPayloadNV = 5338, - HitAttributeKHR = 5339, - HitAttributeNV = 5339, - IncomingRayPayloadKHR = 5342, - IncomingRayPayloadNV = 5342, - ShaderRecordBufferKHR = 5343, - ShaderRecordBufferNV = 5343, - PhysicalStorageBuffer = 5349, - PhysicalStorageBufferEXT = 5349, - CodeSectionINTEL = 5605, - DeviceOnlyINTEL = 5936, - HostOnlyINTEL = 5937, -} - -enum Dim : uint -{ - _1D = 0, - _2D = 1, - _3D = 2, - Cube = 3, - Rect = 4, - Buffer = 5, - SubpassData = 6, -} - -enum SamplerAddressingMode : uint -{ - None = 0, - ClampToEdge = 1, - Clamp = 2, - Repeat = 3, - RepeatMirrored = 4, -} - -enum SamplerFilterMode : uint -{ - Nearest = 0, - Linear = 1, -} - -enum ImageFormat : uint -{ - Unknown = 0, - Rgba32f = 1, - Rgba16f = 2, - R32f = 3, - Rgba8 = 4, - Rgba8Snorm = 5, - Rg32f = 6, - Rg16f = 7, - R11fG11fB10f = 8, - R16f = 9, - Rgba16 = 10, - Rgb10A2 = 11, - Rg16 = 12, - Rg8 = 13, - R16 = 14, - R8 = 15, - Rgba16Snorm = 16, - Rg16Snorm = 17, - Rg8Snorm = 18, - R16Snorm = 19, - R8Snorm = 20, - Rgba32i = 21, - Rgba16i = 22, - Rgba8i = 23, - R32i = 24, - Rg32i = 25, - Rg16i = 26, - Rg8i = 27, - R16i = 28, - R8i = 29, - Rgba32ui = 30, - Rgba16ui = 31, - Rgba8ui = 32, - R32ui = 33, - Rgb10a2ui = 34, - Rg32ui = 35, - Rg16ui = 36, - Rg8ui = 37, - R16ui = 38, - R8ui = 39, - R64ui = 40, - R64i = 41, -} - -enum ImageChannelOrder : uint -{ - R = 0, - A = 1, - RG = 2, - RA = 3, - RGB = 4, - RGBA = 5, - BGRA = 6, - ARGB = 7, - Intensity = 8, - Luminance = 9, - Rx = 10, - RGx = 11, - RGBx = 12, - Depth = 13, - DepthStencil = 14, - sRGB = 15, - sRGBx = 16, - sRGBA = 17, - sBGRA = 18, - ABGR = 19, -} - -enum ImageChannelDataType : uint -{ - SnormInt8 = 0, - SnormInt16 = 1, - UnormInt8 = 2, - UnormInt16 = 3, - UnormShort565 = 4, - UnormShort555 = 5, - UnormInt101010 = 6, - SignedInt8 = 7, - SignedInt16 = 8, - SignedInt32 = 9, - UnsignedInt8 = 10, - UnsignedInt16 = 11, - UnsignedInt32 = 12, - HalfFloat = 13, - Float = 14, - UnormInt24 = 15, - UnormInt101010_2 = 16, -} - -enum ImageOperandsShift : uint -{ - Bias = 0, - Lod = 1, - Grad = 2, - ConstOffset = 3, - Offset = 4, - ConstOffsets = 5, - Sample = 6, - MinLod = 7, - MakeTexelAvailable = 8, - MakeTexelAvailableKHR = 8, - MakeTexelVisible = 9, - MakeTexelVisibleKHR = 9, - NonPrivateTexel = 10, - NonPrivateTexelKHR = 10, - VolatileTexel = 11, - VolatileTexelKHR = 11, - SignExtend = 12, - ZeroExtend = 13, -} - -enum ImageOperandsMask : uint -{ - MaskNone = 0, - Bias = 0x00000001, - Lod = 0x00000002, - Grad = 0x00000004, - ConstOffset = 0x00000008, - Offset = 0x00000010, - ConstOffsets = 0x00000020, - Sample = 0x00000040, - MinLod = 0x00000080, - MakeTexelAvailable = 0x00000100, - MakeTexelAvailableKHR = 0x00000100, - MakeTexelVisible = 0x00000200, - MakeTexelVisibleKHR = 0x00000200, - NonPrivateTexel = 0x00000400, - NonPrivateTexelKHR = 0x00000400, - VolatileTexel = 0x00000800, - VolatileTexelKHR = 0x00000800, - SignExtend = 0x00001000, - ZeroExtend = 0x00002000, -} - -enum FPFastMathModeShift : uint -{ - NotNaN = 0, - NotInf = 1, - NSZ = 2, - AllowRecip = 3, - Fast = 4, - AllowContractFastINTEL = 16, - AllowReassocINTEL = 17, -} - -enum FPFastMathModeMask : uint -{ - MaskNone = 0, - NotNaN = 0x00000001, - NotInf = 0x00000002, - NSZ = 0x00000004, - AllowRecip = 0x00000008, - Fast = 0x00000010, - AllowContractFastINTEL = 0x00010000, - AllowReassocINTEL = 0x00020000, -} - -enum FPRoundingMode : uint -{ - RTE = 0, - RTZ = 1, - RTP = 2, - RTN = 3, -} - -enum LinkageType : uint -{ - Export = 0, - Import = 1, - LinkOnceODR = 2, -} - -enum AccessQualifier : uint -{ - ReadOnly = 0, - WriteOnly = 1, - ReadWrite = 2, -} - -enum FunctionParameterAttribute : uint -{ - Zext = 0, - Sext = 1, - ByVal = 2, - Sret = 3, - NoAlias = 4, - NoCapture = 5, - NoWrite = 6, - NoReadWrite = 7, -} - -enum Decoration : uint -{ - RelaxedPrecision = 0, - SpecId = 1, - Block = 2, - BufferBlock = 3, - RowMajor = 4, - ColMajor = 5, - ArrayStride = 6, - MatrixStride = 7, - GLSLShared = 8, - GLSLPacked = 9, - CPacked = 10, - BuiltIn = 11, - NoPerspective = 13, - Flat = 14, - Patch = 15, - Centroid = 16, - Sample = 17, - Invariant = 18, - Restrict = 19, - Aliased = 20, - Volatile = 21, - Constant = 22, - Coherent = 23, - NonWritable = 24, - NonReadable = 25, - Uniform = 26, - UniformId = 27, - SaturatedConversion = 28, - Stream = 29, - Location = 30, - Component = 31, - Index = 32, - Binding = 33, - DescriptorSet = 34, - Offset = 35, - XfbBuffer = 36, - XfbStride = 37, - FuncParamAttr = 38, - FPRoundingMode = 39, - FPFastMathMode = 40, - LinkageAttributes = 41, - NoContraction = 42, - InputAttachmentIndex = 43, - Alignment = 44, - MaxByteOffset = 45, - AlignmentId = 46, - MaxByteOffsetId = 47, - NoSignedWrap = 4469, - NoUnsignedWrap = 4470, - ExplicitInterpAMD = 4999, - OverrideCoverageNV = 5248, - PassthroughNV = 5250, - ViewportRelativeNV = 5252, - SecondaryViewportRelativeNV = 5256, - PerPrimitiveNV = 5271, - PerViewNV = 5272, - PerTaskNV = 5273, - PerVertexNV = 5285, - NonUniform = 5300, - NonUniformEXT = 5300, - RestrictPointer = 5355, - RestrictPointerEXT = 5355, - AliasedPointer = 5356, - AliasedPointerEXT = 5356, - SIMTCallINTEL = 5599, - ReferencedIndirectlyINTEL = 5602, - ClobberINTEL = 5607, - SideEffectsINTEL = 5608, - VectorComputeVariableINTEL = 5624, - FuncParamIOKindINTEL = 5625, - VectorComputeFunctionINTEL = 5626, - StackCallINTEL = 5627, - GlobalVariableOffsetINTEL = 5628, - CounterBuffer = 5634, - HlslCounterBufferGOOGLE = 5634, - HlslSemanticGOOGLE = 5635, - UserSemantic = 5635, - UserTypeGOOGLE = 5636, - FunctionRoundingModeINTEL = 5822, - FunctionDenormModeINTEL = 5823, - RegisterINTEL = 5825, - MemoryINTEL = 5826, - NumbanksINTEL = 5827, - BankwidthINTEL = 5828, - MaxPrivateCopiesINTEL = 5829, - SinglepumpINTEL = 5830, - DoublepumpINTEL = 5831, - MaxReplicatesINTEL = 5832, - SimpleDualPortINTEL = 5833, - MergeINTEL = 5834, - BankBitsINTEL = 5835, - ForcePow2DepthINTEL = 5836, - BurstCoalesceINTEL = 5899, - CacheSizeINTEL = 5900, - DontStaticallyCoalesceINTEL = 5901, - PrefetchINTEL = 5902, - StallEnableINTEL = 5905, - FuseLoopsInFunctionINTEL = 5907, - BufferLocationINTEL = 5921, - IOPipeStorageINTEL = 5944, - FunctionFloatingPointModeINTEL = 6080, - SingleElementVectorINTEL = 6085, - VectorComputeCallableFunctionINTEL = 6087, -} - -enum BuiltIn : uint -{ - Position = 0, - PointSize = 1, - ClipDistance = 3, - CullDistance = 4, - VertexId = 5, - InstanceId = 6, - PrimitiveId = 7, - InvocationId = 8, - Layer = 9, - ViewportIndex = 10, - TessLevelOuter = 11, - TessLevelInner = 12, - TessCoord = 13, - PatchVertices = 14, - FragCoord = 15, - PointCoord = 16, - FrontFacing = 17, - SampleId = 18, - SamplePosition = 19, - SampleMask = 20, - FragDepth = 22, - HelperInvocation = 23, - NumWorkgroups = 24, - WorkgroupSize = 25, - WorkgroupId = 26, - LocalInvocationId = 27, - GlobalInvocationId = 28, - LocalInvocationIndex = 29, - WorkDim = 30, - GlobalSize = 31, - EnqueuedWorkgroupSize = 32, - GlobalOffset = 33, - GlobalLinearId = 34, - SubgroupSize = 36, - SubgroupMaxSize = 37, - NumSubgroups = 38, - NumEnqueuedSubgroups = 39, - SubgroupId = 40, - SubgroupLocalInvocationId = 41, - VertexIndex = 42, - InstanceIndex = 43, - SubgroupEqMask = 4416, - SubgroupEqMaskKHR = 4416, - SubgroupGeMask = 4417, - SubgroupGeMaskKHR = 4417, - SubgroupGtMask = 4418, - SubgroupGtMaskKHR = 4418, - SubgroupLeMask = 4419, - SubgroupLeMaskKHR = 4419, - SubgroupLtMask = 4420, - SubgroupLtMaskKHR = 4420, - BaseVertex = 4424, - BaseInstance = 4425, - DrawIndex = 4426, - PrimitiveShadingRateKHR = 4432, - DeviceIndex = 4438, - ViewIndex = 4440, - ShadingRateKHR = 4444, - BaryCoordNoPerspAMD = 4992, - BaryCoordNoPerspCentroidAMD = 4993, - BaryCoordNoPerspSampleAMD = 4994, - BaryCoordSmoothAMD = 4995, - BaryCoordSmoothCentroidAMD = 4996, - BaryCoordSmoothSampleAMD = 4997, - BaryCoordPullModelAMD = 4998, - FragStencilRefEXT = 5014, - ViewportMaskNV = 5253, - SecondaryPositionNV = 5257, - SecondaryViewportMaskNV = 5258, - PositionPerViewNV = 5261, - ViewportMaskPerViewNV = 5262, - FullyCoveredEXT = 5264, - TaskCountNV = 5274, - PrimitiveCountNV = 5275, - PrimitiveIndicesNV = 5276, - ClipDistancePerViewNV = 5277, - CullDistancePerViewNV = 5278, - LayerPerViewNV = 5279, - MeshViewCountNV = 5280, - MeshViewIndicesNV = 5281, - BaryCoordNV = 5286, - BaryCoordNoPerspNV = 5287, - FragSizeEXT = 5292, - FragmentSizeNV = 5292, - FragInvocationCountEXT = 5293, - InvocationsPerPixelNV = 5293, - LaunchIdKHR = 5319, - LaunchIdNV = 5319, - LaunchSizeKHR = 5320, - LaunchSizeNV = 5320, - WorldRayOriginKHR = 5321, - WorldRayOriginNV = 5321, - WorldRayDirectionKHR = 5322, - WorldRayDirectionNV = 5322, - ObjectRayOriginKHR = 5323, - ObjectRayOriginNV = 5323, - ObjectRayDirectionKHR = 5324, - ObjectRayDirectionNV = 5324, - RayTminKHR = 5325, - RayTminNV = 5325, - RayTmaxKHR = 5326, - RayTmaxNV = 5326, - InstanceCustomIndexKHR = 5327, - InstanceCustomIndexNV = 5327, - ObjectToWorldKHR = 5330, - ObjectToWorldNV = 5330, - WorldToObjectKHR = 5331, - WorldToObjectNV = 5331, - HitTNV = 5332, - HitKindKHR = 5333, - HitKindNV = 5333, - CurrentRayTimeNV = 5334, - IncomingRayFlagsKHR = 5351, - IncomingRayFlagsNV = 5351, - RayGeometryIndexKHR = 5352, - WarpsPerSMNV = 5374, - SMCountNV = 5375, - WarpIDNV = 5376, - SMIDNV = 5377, -} - -enum SelectionControlShift : uint -{ - Flatten = 0, - DontFlatten = 1, -} - -enum SelectionControlMask : uint -{ - MaskNone = 0, - Flatten = 0x00000001, - DontFlatten = 0x00000002, -} - -enum LoopControlShift : uint -{ - Unroll = 0, - DontUnroll = 1, - DependencyInfinite = 2, - DependencyLength = 3, - MinIterations = 4, - MaxIterations = 5, - IterationMultiple = 6, - PeelCount = 7, - PartialCount = 8, - InitiationIntervalINTEL = 16, - MaxConcurrencyINTEL = 17, - DependencyArrayINTEL = 18, - PipelineEnableINTEL = 19, - LoopCoalesceINTEL = 20, - MaxInterleavingINTEL = 21, - SpeculatedIterationsINTEL = 22, - NoFusionINTEL = 23, -} - -enum LoopControlMask : uint -{ - MaskNone = 0, - Unroll = 0x00000001, - DontUnroll = 0x00000002, - DependencyInfinite = 0x00000004, - DependencyLength = 0x00000008, - MinIterations = 0x00000010, - MaxIterations = 0x00000020, - IterationMultiple = 0x00000040, - PeelCount = 0x00000080, - PartialCount = 0x00000100, - InitiationIntervalINTEL = 0x00010000, - MaxConcurrencyINTEL = 0x00020000, - DependencyArrayINTEL = 0x00040000, - PipelineEnableINTEL = 0x00080000, - LoopCoalesceINTEL = 0x00100000, - MaxInterleavingINTEL = 0x00200000, - SpeculatedIterationsINTEL = 0x00400000, - NoFusionINTEL = 0x00800000, -} - -enum FunctionControlShift : uint -{ - Inline = 0, - DontInline = 1, - Pure = 2, - Const = 3, - OptNoneINTEL = 16, -} - -enum FunctionControlMask : uint -{ - MaskNone = 0, - Inline = 0x00000001, - DontInline = 0x00000002, - Pure = 0x00000004, - Const = 0x00000008, - OptNoneINTEL = 0x00010000, -} - -enum MemorySemanticsShift : uint -{ - Acquire = 1, - Release = 2, - AcquireRelease = 3, - SequentiallyConsistent = 4, - UniformMemory = 6, - SubgroupMemory = 7, - WorkgroupMemory = 8, - CrossWorkgroupMemory = 9, - AtomicCounterMemory = 10, - ImageMemory = 11, - OutputMemory = 12, - OutputMemoryKHR = 12, - MakeAvailable = 13, - MakeAvailableKHR = 13, - MakeVisible = 14, - MakeVisibleKHR = 14, - Volatile = 15, -} - -enum MemorySemanticsMask : uint -{ - MaskNone = 0, - Acquire = 0x00000002, - Release = 0x00000004, - AcquireRelease = 0x00000008, - SequentiallyConsistent = 0x00000010, - UniformMemory = 0x00000040, - SubgroupMemory = 0x00000080, - WorkgroupMemory = 0x00000100, - CrossWorkgroupMemory = 0x00000200, - AtomicCounterMemory = 0x00000400, - ImageMemory = 0x00000800, - OutputMemory = 0x00001000, - OutputMemoryKHR = 0x00001000, - MakeAvailable = 0x00002000, - MakeAvailableKHR = 0x00002000, - MakeVisible = 0x00004000, - MakeVisibleKHR = 0x00004000, - Volatile = 0x00008000, -} - -enum MemoryAccessShift : uint -{ - Volatile = 0, - Aligned = 1, - Nontemporal = 2, - MakePointerAvailable = 3, - MakePointerAvailableKHR = 3, - MakePointerVisible = 4, - MakePointerVisibleKHR = 4, - NonPrivatePointer = 5, - NonPrivatePointerKHR = 5, -} - -enum MemoryAccessMask : uint -{ - MaskNone = 0, - Volatile = 0x00000001, - Aligned = 0x00000002, - Nontemporal = 0x00000004, - MakePointerAvailable = 0x00000008, - MakePointerAvailableKHR = 0x00000008, - MakePointerVisible = 0x00000010, - MakePointerVisibleKHR = 0x00000010, - NonPrivatePointer = 0x00000020, - NonPrivatePointerKHR = 0x00000020, -} - -enum Scope : uint -{ - CrossDevice = 0, - Device = 1, - Workgroup = 2, - Subgroup = 3, - Invocation = 4, - QueueFamily = 5, - QueueFamilyKHR = 5, - ShaderCallKHR = 6, -} - -enum GroupOperation : uint -{ - Reduce = 0, - InclusiveScan = 1, - ExclusiveScan = 2, - ClusteredReduce = 3, - PartitionedReduceNV = 6, - PartitionedInclusiveScanNV = 7, - PartitionedExclusiveScanNV = 8, -} - -enum KernelEnqueueFlags : uint -{ - NoWait = 0, - WaitKernel = 1, - WaitWorkGroup = 2, -} - -enum KernelProfilingInfoShift : uint -{ - CmdExecTime = 0, -} - -enum KernelProfilingInfoMask : uint -{ - MaskNone = 0, - CmdExecTime = 0x00000001, -} - -enum Capability : uint -{ - Matrix = 0, - Shader = 1, - Geometry = 2, - Tessellation = 3, - Addresses = 4, - Linkage = 5, - Kernel = 6, - Vector16 = 7, - Float16Buffer = 8, - Float16 = 9, - Float64 = 10, - Int64 = 11, - Int64Atomics = 12, - ImageBasic = 13, - ImageReadWrite = 14, - ImageMipmap = 15, - Pipes = 17, - Groups = 18, - DeviceEnqueue = 19, - LiteralSampler = 20, - AtomicStorage = 21, - Int16 = 22, - TessellationPointSize = 23, - GeometryPointSize = 24, - ImageGatherExtended = 25, - StorageImageMultisample = 27, - UniformBufferArrayDynamicIndexing = 28, - SampledImageArrayDynamicIndexing = 29, - StorageBufferArrayDynamicIndexing = 30, - StorageImageArrayDynamicIndexing = 31, - ClipDistance = 32, - CullDistance = 33, - ImageCubeArray = 34, - SampleRateShading = 35, - ImageRect = 36, - SampledRect = 37, - GenericPointer = 38, - Int8 = 39, - InputAttachment = 40, - SparseResidency = 41, - MinLod = 42, - Sampled1D = 43, - Image1D = 44, - SampledCubeArray = 45, - SampledBuffer = 46, - ImageBuffer = 47, - ImageMSArray = 48, - StorageImageExtendedFormats = 49, - ImageQuery = 50, - DerivativeControl = 51, - InterpolationFunction = 52, - TransformFeedback = 53, - GeometryStreams = 54, - StorageImageReadWithoutFormat = 55, - StorageImageWriteWithoutFormat = 56, - MultiViewport = 57, - SubgroupDispatch = 58, - NamedBarrier = 59, - PipeStorage = 60, - GroupNonUniform = 61, - GroupNonUniformVote = 62, - GroupNonUniformArithmetic = 63, - GroupNonUniformBallot = 64, - GroupNonUniformShuffle = 65, - GroupNonUniformShuffleRelative = 66, - GroupNonUniformClustered = 67, - GroupNonUniformQuad = 68, - ShaderLayer = 69, - ShaderViewportIndex = 70, - FragmentShadingRateKHR = 4422, - SubgroupBallotKHR = 4423, - DrawParameters = 4427, - WorkgroupMemoryExplicitLayoutKHR = 4428, - WorkgroupMemoryExplicitLayout8BitAccessKHR = 4429, - WorkgroupMemoryExplicitLayout16BitAccessKHR = 4430, - SubgroupVoteKHR = 4431, - StorageBuffer16BitAccess = 4433, - StorageUniformBufferBlock16 = 4433, - StorageUniform16 = 4434, - UniformAndStorageBuffer16BitAccess = 4434, - StoragePushConstant16 = 4435, - StorageInputOutput16 = 4436, - DeviceGroup = 4437, - MultiView = 4439, - VariablePointersStorageBuffer = 4441, - VariablePointers = 4442, - AtomicStorageOps = 4445, - SampleMaskPostDepthCoverage = 4447, - StorageBuffer8BitAccess = 4448, - UniformAndStorageBuffer8BitAccess = 4449, - StoragePushConstant8 = 4450, - DenormPreserve = 4464, - DenormFlushToZero = 4465, - SignedZeroInfNanPreserve = 4466, - RoundingModeRTE = 4467, - RoundingModeRTZ = 4468, - RayQueryProvisionalKHR = 4471, - RayQueryKHR = 4472, - RayTraversalPrimitiveCullingKHR = 4478, - RayTracingKHR = 4479, - Float16ImageAMD = 5008, - ImageGatherBiasLodAMD = 5009, - FragmentMaskAMD = 5010, - StencilExportEXT = 5013, - ImageReadWriteLodAMD = 5015, - Int64ImageEXT = 5016, - ShaderClockKHR = 5055, - SampleMaskOverrideCoverageNV = 5249, - GeometryShaderPassthroughNV = 5251, - ShaderViewportIndexLayerEXT = 5254, - ShaderViewportIndexLayerNV = 5254, - ShaderViewportMaskNV = 5255, - ShaderStereoViewNV = 5259, - PerViewAttributesNV = 5260, - FragmentFullyCoveredEXT = 5265, - MeshShadingNV = 5266, - ImageFootprintNV = 5282, - FragmentBarycentricNV = 5284, - ComputeDerivativeGroupQuadsNV = 5288, - FragmentDensityEXT = 5291, - ShadingRateNV = 5291, - GroupNonUniformPartitionedNV = 5297, - ShaderNonUniform = 5301, - ShaderNonUniformEXT = 5301, - RuntimeDescriptorArray = 5302, - RuntimeDescriptorArrayEXT = 5302, - InputAttachmentArrayDynamicIndexing = 5303, - InputAttachmentArrayDynamicIndexingEXT = 5303, - UniformTexelBufferArrayDynamicIndexing = 5304, - UniformTexelBufferArrayDynamicIndexingEXT = 5304, - StorageTexelBufferArrayDynamicIndexing = 5305, - StorageTexelBufferArrayDynamicIndexingEXT = 5305, - UniformBufferArrayNonUniformIndexing = 5306, - UniformBufferArrayNonUniformIndexingEXT = 5306, - SampledImageArrayNonUniformIndexing = 5307, - SampledImageArrayNonUniformIndexingEXT = 5307, - StorageBufferArrayNonUniformIndexing = 5308, - StorageBufferArrayNonUniformIndexingEXT = 5308, - StorageImageArrayNonUniformIndexing = 5309, - StorageImageArrayNonUniformIndexingEXT = 5309, - InputAttachmentArrayNonUniformIndexing = 5310, - InputAttachmentArrayNonUniformIndexingEXT = 5310, - UniformTexelBufferArrayNonUniformIndexing = 5311, - UniformTexelBufferArrayNonUniformIndexingEXT = 5311, - StorageTexelBufferArrayNonUniformIndexing = 5312, - StorageTexelBufferArrayNonUniformIndexingEXT = 5312, - RayTracingNV = 5340, - RayTracingMotionBlurNV = 5341, - VulkanMemoryModel = 5345, - VulkanMemoryModelKHR = 5345, - VulkanMemoryModelDeviceScope = 5346, - VulkanMemoryModelDeviceScopeKHR = 5346, - PhysicalStorageBufferAddresses = 5347, - PhysicalStorageBufferAddressesEXT = 5347, - ComputeDerivativeGroupLinearNV = 5350, - RayTracingProvisionalKHR = 5353, - CooperativeMatrixNV = 5357, - FragmentShaderSampleInterlockEXT = 5363, - FragmentShaderShadingRateInterlockEXT = 5372, - ShaderSMBuiltinsNV = 5373, - FragmentShaderPixelInterlockEXT = 5378, - DemoteToHelperInvocationEXT = 5379, - SubgroupShuffleINTEL = 5568, - SubgroupBufferBlockIOINTEL = 5569, - SubgroupImageBlockIOINTEL = 5570, - SubgroupImageMediaBlockIOINTEL = 5579, - RoundToInfinityINTEL = 5582, - FloatingPointModeINTEL = 5583, - IntegerFunctions2INTEL = 5584, - FunctionPointersINTEL = 5603, - IndirectReferencesINTEL = 5604, - AsmINTEL = 5606, - AtomicFloat32MinMaxEXT = 5612, - AtomicFloat64MinMaxEXT = 5613, - AtomicFloat16MinMaxEXT = 5616, - VectorComputeINTEL = 5617, - VectorAnyINTEL = 5619, - ExpectAssumeKHR = 5629, - SubgroupAvcMotionEstimationINTEL = 5696, - SubgroupAvcMotionEstimationIntraINTEL = 5697, - SubgroupAvcMotionEstimationChromaINTEL = 5698, - VariableLengthArrayINTEL = 5817, - FunctionFloatControlINTEL = 5821, - FPGAMemoryAttributesINTEL = 5824, - FPFastMathModeINTEL = 5837, - ArbitraryPrecisionIntegersINTEL = 5844, - ArbitraryPrecisionFloatingPointINTEL = 5845, - UnstructuredLoopControlsINTEL = 5886, - FPGALoopControlsINTEL = 5888, - KernelAttributesINTEL = 5892, - FPGAKernelAttributesINTEL = 5897, - FPGAMemoryAccessesINTEL = 5898, - FPGAClusterAttributesINTEL = 5904, - LoopFuseINTEL = 5906, - FPGABufferLocationINTEL = 5920, - ArbitraryPrecisionFixedPointINTEL = 5922, - USMStorageClassesINTEL = 5935, - IOPipesINTEL = 5943, - BlockingPipesINTEL = 5945, - FPGARegINTEL = 5948, - DotProductInputAllKHR = 6016, - DotProductInput4x8BitKHR = 6017, - DotProductInput4x8BitPackedKHR = 6018, - DotProductKHR = 6019, - BitInstructions = 6025, - AtomicFloat32AddEXT = 6033, - AtomicFloat64AddEXT = 6034, - LongConstantCompositeINTEL = 6089, - OptNoneINTEL = 6094, - AtomicFloat16AddEXT = 6095, - DebugInfoModuleINTEL = 6114, -} - -enum RayFlagsShift : uint -{ - OpaqueKHR = 0, - NoOpaqueKHR = 1, - TerminateOnFirstHitKHR = 2, - SkipClosestHitShaderKHR = 3, - CullBackFacingTrianglesKHR = 4, - CullFrontFacingTrianglesKHR = 5, - CullOpaqueKHR = 6, - CullNoOpaqueKHR = 7, - SkipTrianglesKHR = 8, - SkipAABBsKHR = 9, -} - -enum RayFlagsMask : uint -{ - MaskNone = 0, - OpaqueKHR = 0x00000001, - NoOpaqueKHR = 0x00000002, - TerminateOnFirstHitKHR = 0x00000004, - SkipClosestHitShaderKHR = 0x00000008, - CullBackFacingTrianglesKHR = 0x00000010, - CullFrontFacingTrianglesKHR = 0x00000020, - CullOpaqueKHR = 0x00000040, - CullNoOpaqueKHR = 0x00000080, - SkipTrianglesKHR = 0x00000100, - SkipAABBsKHR = 0x00000200, -} - -enum RayQueryIntersection : uint -{ - RayQueryCandidateIntersectionKHR = 0, - RayQueryCommittedIntersectionKHR = 1, -} - -enum RayQueryCommittedIntersectionType : uint -{ - RayQueryCommittedIntersectionNoneKHR = 0, - RayQueryCommittedIntersectionTriangleKHR = 1, - RayQueryCommittedIntersectionGeneratedKHR = 2, -} - -enum RayQueryCandidateIntersectionType : uint -{ - RayQueryCandidateIntersectionTriangleKHR = 0, - RayQueryCandidateIntersectionAABBKHR = 1, -} - -enum FragmentShadingRateShift : uint -{ - Vertical2Pixels = 0, - Vertical4Pixels = 1, - Horizontal2Pixels = 2, - Horizontal4Pixels = 3, -} - -enum FragmentShadingRateMask : uint -{ - MaskNone = 0, - Vertical2Pixels = 0x00000001, - Vertical4Pixels = 0x00000002, - Horizontal2Pixels = 0x00000004, - Horizontal4Pixels = 0x00000008, -} - -enum FPDenormMode : uint -{ - Preserve = 0, - FlushToZero = 1, -} - -enum FPOperationMode : uint -{ - IEEE = 0, - ALT = 1, -} - -enum QuantizationModes : uint -{ - TRN = 0, - TRN_ZERO = 1, - RND = 2, - RND_ZERO = 3, - RND_INF = 4, - RND_MIN_INF = 5, - RND_CONV = 6, - RND_CONV_ODD = 7, -} - -enum OverflowModes : uint -{ - WRAP = 0, - SAT = 1, - SAT_ZERO = 2, - SAT_SYM = 3, -} - -enum PackedVectorFormat : uint -{ - PackedVectorFormat4x8BitKHR = 0, -} - -enum Op : uint -{ - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, - OpImageSparseRead = 320, - OpSizeOf = 321, - OpTypePipeStorage = 322, - OpConstantPipeStorage = 323, - OpCreatePipeFromPipeStorage = 324, - OpGetKernelLocalSizeForSubgroupCount = 325, - OpGetKernelMaxNumSubgroups = 326, - OpTypeNamedBarrier = 327, - OpNamedBarrierInitialize = 328, - OpMemoryNamedBarrier = 329, - OpModuleProcessed = 330, - OpExecutionModeId = 331, - OpDecorateId = 332, - OpGroupNonUniformElect = 333, - OpGroupNonUniformAll = 334, - OpGroupNonUniformAny = 335, - OpGroupNonUniformAllEqual = 336, - OpGroupNonUniformBroadcast = 337, - OpGroupNonUniformBroadcastFirst = 338, - OpGroupNonUniformBallot = 339, - OpGroupNonUniformInverseBallot = 340, - OpGroupNonUniformBallotBitExtract = 341, - OpGroupNonUniformBallotBitCount = 342, - OpGroupNonUniformBallotFindLSB = 343, - OpGroupNonUniformBallotFindMSB = 344, - OpGroupNonUniformShuffle = 345, - OpGroupNonUniformShuffleXor = 346, - OpGroupNonUniformShuffleUp = 347, - OpGroupNonUniformShuffleDown = 348, - OpGroupNonUniformIAdd = 349, - OpGroupNonUniformFAdd = 350, - OpGroupNonUniformIMul = 351, - OpGroupNonUniformFMul = 352, - OpGroupNonUniformSMin = 353, - OpGroupNonUniformUMin = 354, - OpGroupNonUniformFMin = 355, - OpGroupNonUniformSMax = 356, - OpGroupNonUniformUMax = 357, - OpGroupNonUniformFMax = 358, - OpGroupNonUniformBitwiseAnd = 359, - OpGroupNonUniformBitwiseOr = 360, - OpGroupNonUniformBitwiseXor = 361, - OpGroupNonUniformLogicalAnd = 362, - OpGroupNonUniformLogicalOr = 363, - OpGroupNonUniformLogicalXor = 364, - OpGroupNonUniformQuadBroadcast = 365, - OpGroupNonUniformQuadSwap = 366, - OpCopyLogical = 400, - OpPtrEqual = 401, - OpPtrNotEqual = 402, - OpPtrDiff = 403, - OpTerminateInvocation = 4416, - OpSubgroupBallotKHR = 4421, - OpSubgroupFirstInvocationKHR = 4422, - OpSubgroupAllKHR = 4428, - OpSubgroupAnyKHR = 4429, - OpSubgroupAllEqualKHR = 4430, - OpSubgroupReadInvocationKHR = 4432, - OpTraceRayKHR = 4445, - OpExecuteCallableKHR = 4446, - OpConvertUToAccelerationStructureKHR = 4447, - OpIgnoreIntersectionKHR = 4448, - OpTerminateRayKHR = 4449, - OpSDotKHR = 4450, - OpUDotKHR = 4451, - OpSUDotKHR = 4452, - OpSDotAccSatKHR = 4453, - OpUDotAccSatKHR = 4454, - OpSUDotAccSatKHR = 4455, - OpTypeRayQueryKHR = 4472, - OpRayQueryInitializeKHR = 4473, - OpRayQueryTerminateKHR = 4474, - OpRayQueryGenerateIntersectionKHR = 4475, - OpRayQueryConfirmIntersectionKHR = 4476, - OpRayQueryProceedKHR = 4477, - OpRayQueryGetIntersectionTypeKHR = 4479, - OpGroupIAddNonUniformAMD = 5000, - OpGroupFAddNonUniformAMD = 5001, - OpGroupFMinNonUniformAMD = 5002, - OpGroupUMinNonUniformAMD = 5003, - OpGroupSMinNonUniformAMD = 5004, - OpGroupFMaxNonUniformAMD = 5005, - OpGroupUMaxNonUniformAMD = 5006, - OpGroupSMaxNonUniformAMD = 5007, - OpFragmentMaskFetchAMD = 5011, - OpFragmentFetchAMD = 5012, - OpReadClockKHR = 5056, - OpImageSampleFootprintNV = 5283, - OpGroupNonUniformPartitionNV = 5296, - OpWritePackedPrimitiveIndices4x8NV = 5299, - OpReportIntersectionKHR = 5334, - OpReportIntersectionNV = 5334, - OpIgnoreIntersectionNV = 5335, - OpTerminateRayNV = 5336, - OpTraceNV = 5337, - OpTraceMotionNV = 5338, - OpTraceRayMotionNV = 5339, - OpTypeAccelerationStructureKHR = 5341, - OpTypeAccelerationStructureNV = 5341, - OpExecuteCallableNV = 5344, - OpTypeCooperativeMatrixNV = 5358, - OpCooperativeMatrixLoadNV = 5359, - OpCooperativeMatrixStoreNV = 5360, - OpCooperativeMatrixMulAddNV = 5361, - OpCooperativeMatrixLengthNV = 5362, - OpBeginInvocationInterlockEXT = 5364, - OpEndInvocationInterlockEXT = 5365, - OpDemoteToHelperInvocationEXT = 5380, - OpIsHelperInvocationEXT = 5381, - OpSubgroupShuffleINTEL = 5571, - OpSubgroupShuffleDownINTEL = 5572, - OpSubgroupShuffleUpINTEL = 5573, - OpSubgroupShuffleXorINTEL = 5574, - OpSubgroupBlockReadINTEL = 5575, - OpSubgroupBlockWriteINTEL = 5576, - OpSubgroupImageBlockReadINTEL = 5577, - OpSubgroupImageBlockWriteINTEL = 5578, - OpSubgroupImageMediaBlockReadINTEL = 5580, - OpSubgroupImageMediaBlockWriteINTEL = 5581, - OpUCountLeadingZerosINTEL = 5585, - OpUCountTrailingZerosINTEL = 5586, - OpAbsISubINTEL = 5587, - OpAbsUSubINTEL = 5588, - OpIAddSatINTEL = 5589, - OpUAddSatINTEL = 5590, - OpIAverageINTEL = 5591, - OpUAverageINTEL = 5592, - OpIAverageRoundedINTEL = 5593, - OpUAverageRoundedINTEL = 5594, - OpISubSatINTEL = 5595, - OpUSubSatINTEL = 5596, - OpIMul32x16INTEL = 5597, - OpUMul32x16INTEL = 5598, - OpConstFunctionPointerINTEL = 5600, - OpFunctionPointerCallINTEL = 5601, - OpAsmTargetINTEL = 5609, - OpAsmINTEL = 5610, - OpAsmCallINTEL = 5611, - OpAtomicFMinEXT = 5614, - OpAtomicFMaxEXT = 5615, - OpAssumeTrueKHR = 5630, - OpExpectKHR = 5631, - OpDecorateString = 5632, - OpDecorateStringGOOGLE = 5632, - OpMemberDecorateString = 5633, - OpMemberDecorateStringGOOGLE = 5633, - OpVmeImageINTEL = 5699, - OpTypeVmeImageINTEL = 5700, - OpTypeAvcImePayloadINTEL = 5701, - OpTypeAvcRefPayloadINTEL = 5702, - OpTypeAvcSicPayloadINTEL = 5703, - OpTypeAvcMcePayloadINTEL = 5704, - OpTypeAvcMceResultINTEL = 5705, - OpTypeAvcImeResultINTEL = 5706, - OpTypeAvcImeResultSingleReferenceStreamoutINTEL = 5707, - OpTypeAvcImeResultDualReferenceStreamoutINTEL = 5708, - OpTypeAvcImeSingleReferenceStreaminINTEL = 5709, - OpTypeAvcImeDualReferenceStreaminINTEL = 5710, - OpTypeAvcRefResultINTEL = 5711, - OpTypeAvcSicResultINTEL = 5712, - OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL = 5713, - OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL = 5714, - OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL = 5715, - OpSubgroupAvcMceSetInterShapePenaltyINTEL = 5716, - OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL = 5717, - OpSubgroupAvcMceSetInterDirectionPenaltyINTEL = 5718, - OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL = 5719, - OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL = 5720, - OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL = 5721, - OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL = 5722, - OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL = 5723, - OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL = 5724, - OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL = 5725, - OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL = 5726, - OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL = 5727, - OpSubgroupAvcMceSetAcOnlyHaarINTEL = 5728, - OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL = 5729, - OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL = 5730, - OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL = 5731, - OpSubgroupAvcMceConvertToImePayloadINTEL = 5732, - OpSubgroupAvcMceConvertToImeResultINTEL = 5733, - OpSubgroupAvcMceConvertToRefPayloadINTEL = 5734, - OpSubgroupAvcMceConvertToRefResultINTEL = 5735, - OpSubgroupAvcMceConvertToSicPayloadINTEL = 5736, - OpSubgroupAvcMceConvertToSicResultINTEL = 5737, - OpSubgroupAvcMceGetMotionVectorsINTEL = 5738, - OpSubgroupAvcMceGetInterDistortionsINTEL = 5739, - OpSubgroupAvcMceGetBestInterDistortionsINTEL = 5740, - OpSubgroupAvcMceGetInterMajorShapeINTEL = 5741, - OpSubgroupAvcMceGetInterMinorShapeINTEL = 5742, - OpSubgroupAvcMceGetInterDirectionsINTEL = 5743, - OpSubgroupAvcMceGetInterMotionVectorCountINTEL = 5744, - OpSubgroupAvcMceGetInterReferenceIdsINTEL = 5745, - OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL = 5746, - OpSubgroupAvcImeInitializeINTEL = 5747, - OpSubgroupAvcImeSetSingleReferenceINTEL = 5748, - OpSubgroupAvcImeSetDualReferenceINTEL = 5749, - OpSubgroupAvcImeRefWindowSizeINTEL = 5750, - OpSubgroupAvcImeAdjustRefOffsetINTEL = 5751, - OpSubgroupAvcImeConvertToMcePayloadINTEL = 5752, - OpSubgroupAvcImeSetMaxMotionVectorCountINTEL = 5753, - OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL = 5754, - OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL = 5755, - OpSubgroupAvcImeSetWeightedSadINTEL = 5756, - OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL = 5757, - OpSubgroupAvcImeEvaluateWithDualReferenceINTEL = 5758, - OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL = 5759, - OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL = 5760, - OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL = 5761, - OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL = 5762, - OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL = 5763, - OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL = 5764, - OpSubgroupAvcImeConvertToMceResultINTEL = 5765, - OpSubgroupAvcImeGetSingleReferenceStreaminINTEL = 5766, - OpSubgroupAvcImeGetDualReferenceStreaminINTEL = 5767, - OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL = 5768, - OpSubgroupAvcImeStripDualReferenceStreamoutINTEL = 5769, - OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL = 5770, - OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL = 5771, - OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL = 5772, - OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL = 5773, - OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL = 5774, - OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL = 5775, - OpSubgroupAvcImeGetBorderReachedINTEL = 5776, - OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL = 5777, - OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL = 5778, - OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL = 5779, - OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL = 5780, - OpSubgroupAvcFmeInitializeINTEL = 5781, - OpSubgroupAvcBmeInitializeINTEL = 5782, - OpSubgroupAvcRefConvertToMcePayloadINTEL = 5783, - OpSubgroupAvcRefSetBidirectionalMixDisableINTEL = 5784, - OpSubgroupAvcRefSetBilinearFilterEnableINTEL = 5785, - OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL = 5786, - OpSubgroupAvcRefEvaluateWithDualReferenceINTEL = 5787, - OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL = 5788, - OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL = 5789, - OpSubgroupAvcRefConvertToMceResultINTEL = 5790, - OpSubgroupAvcSicInitializeINTEL = 5791, - OpSubgroupAvcSicConfigureSkcINTEL = 5792, - OpSubgroupAvcSicConfigureIpeLumaINTEL = 5793, - OpSubgroupAvcSicConfigureIpeLumaChromaINTEL = 5794, - OpSubgroupAvcSicGetMotionVectorMaskINTEL = 5795, - OpSubgroupAvcSicConvertToMcePayloadINTEL = 5796, - OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL = 5797, - OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL = 5798, - OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL = 5799, - OpSubgroupAvcSicSetBilinearFilterEnableINTEL = 5800, - OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL = 5801, - OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL = 5802, - OpSubgroupAvcSicEvaluateIpeINTEL = 5803, - OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL = 5804, - OpSubgroupAvcSicEvaluateWithDualReferenceINTEL = 5805, - OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL = 5806, - OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL = 5807, - OpSubgroupAvcSicConvertToMceResultINTEL = 5808, - OpSubgroupAvcSicGetIpeLumaShapeINTEL = 5809, - OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL = 5810, - OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL = 5811, - OpSubgroupAvcSicGetPackedIpeLumaModesINTEL = 5812, - OpSubgroupAvcSicGetIpeChromaModeINTEL = 5813, - OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL = 5814, - OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL = 5815, - OpSubgroupAvcSicGetInterRawSadsINTEL = 5816, - OpVariableLengthArrayINTEL = 5818, - OpSaveMemoryINTEL = 5819, - OpRestoreMemoryINTEL = 5820, - OpArbitraryFloatSinCosPiINTEL = 5840, - OpArbitraryFloatCastINTEL = 5841, - OpArbitraryFloatCastFromIntINTEL = 5842, - OpArbitraryFloatCastToIntINTEL = 5843, - OpArbitraryFloatAddINTEL = 5846, - OpArbitraryFloatSubINTEL = 5847, - OpArbitraryFloatMulINTEL = 5848, - OpArbitraryFloatDivINTEL = 5849, - OpArbitraryFloatGTINTEL = 5850, - OpArbitraryFloatGEINTEL = 5851, - OpArbitraryFloatLTINTEL = 5852, - OpArbitraryFloatLEINTEL = 5853, - OpArbitraryFloatEQINTEL = 5854, - OpArbitraryFloatRecipINTEL = 5855, - OpArbitraryFloatRSqrtINTEL = 5856, - OpArbitraryFloatCbrtINTEL = 5857, - OpArbitraryFloatHypotINTEL = 5858, - OpArbitraryFloatSqrtINTEL = 5859, - OpArbitraryFloatLogINTEL = 5860, - OpArbitraryFloatLog2INTEL = 5861, - OpArbitraryFloatLog10INTEL = 5862, - OpArbitraryFloatLog1pINTEL = 5863, - OpArbitraryFloatExpINTEL = 5864, - OpArbitraryFloatExp2INTEL = 5865, - OpArbitraryFloatExp10INTEL = 5866, - OpArbitraryFloatExpm1INTEL = 5867, - OpArbitraryFloatSinINTEL = 5868, - OpArbitraryFloatCosINTEL = 5869, - OpArbitraryFloatSinCosINTEL = 5870, - OpArbitraryFloatSinPiINTEL = 5871, - OpArbitraryFloatCosPiINTEL = 5872, - OpArbitraryFloatASinINTEL = 5873, - OpArbitraryFloatASinPiINTEL = 5874, - OpArbitraryFloatACosINTEL = 5875, - OpArbitraryFloatACosPiINTEL = 5876, - OpArbitraryFloatATanINTEL = 5877, - OpArbitraryFloatATanPiINTEL = 5878, - OpArbitraryFloatATan2INTEL = 5879, - OpArbitraryFloatPowINTEL = 5880, - OpArbitraryFloatPowRINTEL = 5881, - OpArbitraryFloatPowNINTEL = 5882, - OpLoopControlINTEL = 5887, - OpFixedSqrtINTEL = 5923, - OpFixedRecipINTEL = 5924, - OpFixedRsqrtINTEL = 5925, - OpFixedSinINTEL = 5926, - OpFixedCosINTEL = 5927, - OpFixedSinCosINTEL = 5928, - OpFixedSinPiINTEL = 5929, - OpFixedCosPiINTEL = 5930, - OpFixedSinCosPiINTEL = 5931, - OpFixedLogINTEL = 5932, - OpFixedExpINTEL = 5933, - OpPtrCastToCrossWorkgroupINTEL = 5934, - OpCrossWorkgroupCastToPtrINTEL = 5938, - OpReadPipeBlockingINTEL = 5946, - OpWritePipeBlockingINTEL = 5947, - OpFPGARegINTEL = 5949, - OpRayQueryGetRayTMinKHR = 6016, - OpRayQueryGetRayFlagsKHR = 6017, - OpRayQueryGetIntersectionTKHR = 6018, - OpRayQueryGetIntersectionInstanceCustomIndexKHR = 6019, - OpRayQueryGetIntersectionInstanceIdKHR = 6020, - OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR = 6021, - OpRayQueryGetIntersectionGeometryIndexKHR = 6022, - OpRayQueryGetIntersectionPrimitiveIndexKHR = 6023, - OpRayQueryGetIntersectionBarycentricsKHR = 6024, - OpRayQueryGetIntersectionFrontFaceKHR = 6025, - OpRayQueryGetIntersectionCandidateAABBOpaqueKHR = 6026, - OpRayQueryGetIntersectionObjectRayDirectionKHR = 6027, - OpRayQueryGetIntersectionObjectRayOriginKHR = 6028, - OpRayQueryGetWorldRayDirectionKHR = 6029, - OpRayQueryGetWorldRayOriginKHR = 6030, - OpRayQueryGetIntersectionObjectToWorldKHR = 6031, - OpRayQueryGetIntersectionWorldToObjectKHR = 6032, - OpAtomicFAddEXT = 6035, - OpTypeBufferSurfaceINTEL = 6086, - OpTypeStructContinuedINTEL = 6090, - OpConstantCompositeContinuedINTEL = 6091, - OpSpecConstantCompositeContinuedINTEL = 6092, -} - - diff --git a/kokoro/linux-clang-ubsan/build.sh b/kokoro/linux-clang-ubsan/build.sh deleted file mode 100755 index b5941e34..00000000 --- a/kokoro/linux-clang-ubsan/build.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Google LLC. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Linux Build Script. - -# Fail on any error. -set -e -# Display commands being run. -set -x - -SCRIPT_DIR=`dirname "$BASH_SOURCE"` -source $SCRIPT_DIR/../scripts/linux/build.sh UBSAN clang cmake diff --git a/kokoro/linux-clang-ubsan/presubmit.cfg b/kokoro/linux-clang-ubsan/presubmit.cfg deleted file mode 100644 index 029c74a5..00000000 --- a/kokoro/linux-clang-ubsan/presubmit.cfg +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) 2021 Google LLC. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Presubmit build configuration. -build_file: "SPIRV-Tools/kokoro/linux-clang-ubsan/build.sh" diff --git a/kokoro/scripts/linux/build-docker.sh b/kokoro/scripts/linux/build-docker.sh index c6bbe951..ba216987 100755 --- a/kokoro/scripts/linux/build-docker.sh +++ b/kokoro/scripts/linux/build-docker.sh @@ -51,7 +51,7 @@ clone_if_missing https://github.com/google/googletest external/googlete pushd external/googletest; git reset --hard 1fb1bb23bb8418dc73a5a9a82bbed31dc610fec7; popd clone_if_missing https://github.com/google/effcee external/effcee --depth=1 clone_if_missing https://github.com/google/re2 external/re2 --depth=1 -clone_if_missing https://github.com/protocolbuffers/protobuf external/protobuf --branch v3.13.0.1 +clone_if_missing https://github.com/protocolbuffers/protobuf external/protobuf --branch v3.13.0 if [ $TOOL = "cmake" ]; then using cmake-3.17.2 @@ -79,10 +79,6 @@ if [ $TOOL = "cmake" ]; then SKIP_TESTS="True" fi - if [ $COMPILER = "clang" ]; then - ADDITIONAL_CMAKE_FLAGS="$ADDITIONAL_CMAKE_FLAGS -DSPIRV_BUILD_LIBFUZZER_TARGETS=ON" - fi - clean_dir "$ROOT_DIR/build" cd "$ROOT_DIR/build" diff --git a/kokoro/scripts/macos/build.sh b/kokoro/scripts/macos/build.sh index 46128238..44c9a412 100644 --- a/kokoro/scripts/macos/build.sh +++ b/kokoro/scripts/macos/build.sh @@ -36,7 +36,7 @@ git clone https://github.com/google/googletest external/googletest cd external && cd googletest && git reset --hard 1fb1bb23bb8418dc73a5a9a82bbed31dc610fec7 && cd .. && cd .. git clone --depth=1 https://github.com/google/effcee external/effcee git clone --depth=1 https://github.com/google/re2 external/re2 -git clone --depth=1 --branch v3.13.0.1 https://github.com/protocolbuffers/protobuf external/protobuf +git clone --depth=1 --branch v3.13.0 https://github.com/protocolbuffers/protobuf external/protobuf mkdir build && cd $SRC/build diff --git a/kokoro/scripts/windows/build.bat b/kokoro/scripts/windows/build.bat index 24e29ccf..a4ce792a 100644 --- a/kokoro/scripts/windows/build.bat +++ b/kokoro/scripts/windows/build.bat @@ -30,7 +30,7 @@ git clone https://github.com/google/googletest external/googletest cd external && cd googletest && git reset --hard 1fb1bb23bb8418dc73a5a9a82bbed31dc610fec7 && cd .. && cd .. git clone --depth=1 https://github.com/google/effcee external/effcee git clone --depth=1 https://github.com/google/re2 external/re2 -git clone --depth=1 --branch v3.13.0.1 https://github.com/protocolbuffers/protobuf external/protobuf +git clone --depth=1 --branch v3.13.0 https://github.com/protocolbuffers/protobuf external/protobuf :: ######################################### :: set up msvc build env @@ -41,6 +41,9 @@ if %VS_VERSION% == 2017 ( ) else if %VS_VERSION% == 2015 ( call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 echo "Using VS 2015..." +) else if %VS_VERSION% == 2013 ( + call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x64 + echo "Using VS 2013..." ) cd %SRC% @@ -59,8 +62,15 @@ if "%KOKORO_GITHUB_COMMIT%." == "." ( set CMAKE_FLAGS=-DCMAKE_INSTALL_PREFIX=%KOKORO_ARTIFACTS_DIR%\install -GNinja -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DRE2_BUILD_TESTING=OFF -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe -:: Build spirv-fuzz -set CMAKE_FLAGS=%CMAKE_FLAGS% -DSPIRV_BUILD_FUZZER=ON +:: Skip building tests for VS2013 +if %VS_VERSION% == 2013 ( + set CMAKE_FLAGS=%CMAKE_FLAGS% -DSPIRV_SKIP_TESTS=ON +) + +:: Skip building spirv-fuzz for VS2013; it relies on protobufs which VS2013 cannot handle. +if %VS_VERSION% NEQ 2013 ( + set CMAKE_FLAGS=%CMAKE_FLAGS% -DSPIRV_BUILD_FUZZER=ON +) cmake %CMAKE_FLAGS% .. @@ -75,11 +85,13 @@ echo "Build Completed %DATE% %TIME%" setlocal ENABLEDELAYEDEXPANSION :: ################################################ -:: Run the tests +:: Run the tests (We no longer run tests on VS2013) :: ################################################ echo "Running Tests... %DATE% %TIME%" -ctest -C %BUILD_TYPE% --output-on-failure --timeout 300 -if !ERRORLEVEL! NEQ 0 exit /b !ERRORLEVEL! +if %VS_VERSION% NEQ 2013 ( + ctest -C %BUILD_TYPE% --output-on-failure --timeout 300 + if !ERRORLEVEL! NEQ 0 exit /b !ERRORLEVEL! +) echo "Tests Completed %DATE% %TIME%" :: ################################################ @@ -94,3 +106,4 @@ rm -rf %SRC%\build rm -rf %SRC%\external exit /b 0 + diff --git a/kokoro/linux-clang-ubsan/continuous.cfg b/kokoro/windows-msvc-2013-release/continuous.cfg similarity index 85% rename from kokoro/linux-clang-ubsan/continuous.cfg rename to kokoro/windows-msvc-2013-release/continuous.cfg index cb5535e1..5dfcba63 100644 --- a/kokoro/linux-clang-ubsan/continuous.cfg +++ b/kokoro/windows-msvc-2013-release/continuous.cfg @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Google LLC. +# Copyright (c) 2018 Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,4 +13,4 @@ # limitations under the License. # Continuous build configuration. -build_file: "SPIRV-Tools/kokoro/linux-clang-ubsan/build.sh" +build_file: "SPIRV-Tools/kokoro/windows-msvc-2013-release/build.bat" diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 6530f060..8247f6f8 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -17,14 +17,11 @@ set(VIMSYNTAX_PROCESSING_SCRIPT "${spirv-tools_SOURCE_DIR}/utils/generate_vim_sy set(XML_REGISTRY_PROCESSING_SCRIPT "${spirv-tools_SOURCE_DIR}/utils/generate_registry_tables.py") set(LANG_HEADER_PROCESSING_SCRIPT "${spirv-tools_SOURCE_DIR}/utils/generate_language_headers.py") -# Pull in grammar files that have migrated to SPIRV-Headers +# For now, assume the DebugInfo grammar file is in the current directory. +# It might migrate to SPIRV-Headers. set(DEBUGINFO_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/unified1/extinst.debuginfo.grammar.json") set(CLDEBUGINFO100_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json") -# For now, assume the NonSemantic.Vulkan.DebugInfo grammar file is in the current directory. -# It will later migrate to SPIRV-Headers. -set(VKDEBUGINFO100_GRAMMAR_JSON_FILE "${CMAKE_CURRENT_SOURCE_DIR}/extinst.nonsemantic.vulkan.debuginfo.100.grammar.json") - # macro() definitions are used in the following because we need to append .inc # file paths into some global lists (*_CPP_DEPENDS). And those global lists are # later used by set_source_files_properties() calls. @@ -116,9 +113,6 @@ endmacro(spvtools_opencl_tables) macro(spvtools_vendor_tables VENDOR_TABLE SHORT_NAME OPERAND_KIND_PREFIX) set(INSTS_FILE "${spirv-tools_BINARY_DIR}/${VENDOR_TABLE}.insts.inc") set(GRAMMAR_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/unified1/extinst.${VENDOR_TABLE}.grammar.json") - if(NOT EXISTS ${GRAMMAR_FILE}) - set(GRAMMAR_FILE "${spirv-tools_SOURCE_DIR}/source/extinst.${VENDOR_TABLE}.grammar.json") - endif() add_custom_command(OUTPUT ${INSTS_FILE} COMMAND ${PYTHON_EXECUTABLE} ${GRAMMAR_PROCESSING_SCRIPT} --extinst-vendor-grammar=${GRAMMAR_FILE} @@ -154,11 +148,9 @@ spvtools_vendor_tables("spv-amd-gcn-shader" "spv-amd-gs" "") spvtools_vendor_tables("spv-amd-shader-ballot" "spv-amd-sb" "") spvtools_vendor_tables("debuginfo" "debuginfo" "") spvtools_vendor_tables("opencl.debuginfo.100" "cldi100" "CLDEBUG100_") -spvtools_vendor_tables("nonsemantic.vulkan.debuginfo.100" "vkdi100" "VKDEBUG100_") spvtools_vendor_tables("nonsemantic.clspvreflection" "clspvreflection" "") spvtools_extinst_lang_headers("DebugInfo" ${DEBUGINFO_GRAMMAR_JSON_FILE}) spvtools_extinst_lang_headers("OpenCLDebugInfo100" ${CLDEBUGINFO100_GRAMMAR_JSON_FILE}) -spvtools_extinst_lang_headers("NonSemanticVulkanDebugInfo100" ${VKDEBUGINFO100_GRAMMAR_JSON_FILE}) spvtools_vimsyntax("unified1" "1.0") add_custom_target(spirv-tools-vimsyntax DEPENDS ${VIMSYNTAX_FILE}) @@ -219,7 +211,6 @@ add_subdirectory(opt) add_subdirectory(reduce) add_subdirectory(fuzz) add_subdirectory(link) -add_subdirectory(lint) set(SPIRV_SOURCES ${spirv-tools_SOURCE_DIR}/include/spirv-tools/libspirv.h @@ -235,7 +226,6 @@ set(SPIRV_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/assembly_grammar.h ${CMAKE_CURRENT_SOURCE_DIR}/binary.h ${CMAKE_CURRENT_SOURCE_DIR}/cfa.h - ${CMAKE_CURRENT_SOURCE_DIR}/common_debug_info.h ${CMAKE_CURRENT_SOURCE_DIR}/diagnostic.h ${CMAKE_CURRENT_SOURCE_DIR}/disassemble.h ${CMAKE_CURRENT_SOURCE_DIR}/enum_set.h @@ -412,12 +402,6 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") endif() endif() -if (ANDROID) - foreach(target ${SPIRV_TOOLS_TARGETS}) - target_link_libraries(${target} PRIVATE android log) - endforeach() -endif() - if(ENABLE_SPIRV_TOOLS_INSTALL) install(TARGETS ${SPIRV_TOOLS_TARGETS} EXPORT ${SPIRV_TOOLS}Targets RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} diff --git a/source/binary.cpp b/source/binary.cpp index 090cccfe..7448721b 100644 --- a/source/binary.cpp +++ b/source/binary.cpp @@ -657,18 +657,12 @@ spv_result_t Parser::parseOperand(size_t inst_offset, case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_OPERATION: case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_IMPORTED_ENTITY: case SPV_OPERAND_TYPE_FPDENORM_MODE: - case SPV_OPERAND_TYPE_FPOPERATION_MODE: - case SPV_OPERAND_TYPE_QUANTIZATION_MODES: - case SPV_OPERAND_TYPE_OVERFLOW_MODES: - case SPV_OPERAND_TYPE_PACKED_VECTOR_FORMAT: - case SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT: { + case SPV_OPERAND_TYPE_FPOPERATION_MODE: { // A single word that is a plain enum value. // Map an optional operand type to its corresponding concrete type. if (type == SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER) parsed_operand.type = SPV_OPERAND_TYPE_ACCESS_QUALIFIER; - if (type == SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT) - parsed_operand.type = SPV_OPERAND_TYPE_PACKED_VECTOR_FORMAT; spv_operand_desc entry; if (grammar_.lookupOperand(type, word, &entry)) { diff --git a/source/common_debug_info.h b/source/common_debug_info.h deleted file mode 100644 index 0ae85aa0..00000000 --- a/source/common_debug_info.h +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) 2021 The Khronos Group Inc. -// Copyright (c) 2021 Valve Corporation -// Copyright (c) 2021 LunarG Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SOURCE_COMMON_DEBUG_INFO_HEADER_H_ -#define SOURCE_COMMON_DEBUG_INFO_HEADER_H_ - -// This enum defines the known common set of instructions that are the same -// between OpenCL.DebugInfo.100 and NonSemantic.Vulkan.DebugInfo.100. -// note that NonSemantic.DebugInfo.100 instructions can still have slightly -// different encoding, as it does not use literals anywhere and only constants. -enum CommonDebugInfoInstructions { - CommonDebugInfoDebugInfoNone = 0, - CommonDebugInfoDebugCompilationUnit = 1, - CommonDebugInfoDebugTypeBasic = 2, - CommonDebugInfoDebugTypePointer = 3, - CommonDebugInfoDebugTypeQualifier = 4, - CommonDebugInfoDebugTypeArray = 5, - CommonDebugInfoDebugTypeVector = 6, - CommonDebugInfoDebugTypedef = 7, - CommonDebugInfoDebugTypeFunction = 8, - CommonDebugInfoDebugTypeEnum = 9, - CommonDebugInfoDebugTypeComposite = 10, - CommonDebugInfoDebugTypeMember = 11, - CommonDebugInfoDebugTypeInheritance = 12, - CommonDebugInfoDebugTypePtrToMember = 13, - CommonDebugInfoDebugTypeTemplate = 14, - CommonDebugInfoDebugTypeTemplateParameter = 15, - CommonDebugInfoDebugTypeTemplateTemplateParameter = 16, - CommonDebugInfoDebugTypeTemplateParameterPack = 17, - CommonDebugInfoDebugGlobalVariable = 18, - CommonDebugInfoDebugFunctionDeclaration = 19, - CommonDebugInfoDebugFunction = 20, - CommonDebugInfoDebugLexicalBlock = 21, - CommonDebugInfoDebugLexicalBlockDiscriminator = 22, - CommonDebugInfoDebugScope = 23, - CommonDebugInfoDebugNoScope = 24, - CommonDebugInfoDebugInlinedAt = 25, - CommonDebugInfoDebugLocalVariable = 26, - CommonDebugInfoDebugInlinedVariable = 27, - CommonDebugInfoDebugDeclare = 28, - CommonDebugInfoDebugValue = 29, - CommonDebugInfoDebugOperation = 30, - CommonDebugInfoDebugExpression = 31, - CommonDebugInfoDebugMacroDef = 32, - CommonDebugInfoDebugMacroUndef = 33, - CommonDebugInfoDebugImportedEntity = 34, - CommonDebugInfoDebugSource = 35, - CommonDebugInfoInstructionsMax = 0x7ffffff -}; - -#endif // SOURCE_COMMON_DEBUG_INFO_HEADER_H_ diff --git a/source/diagnostic.cpp b/source/diagnostic.cpp index f3aa2594..edc27c8f 100644 --- a/source/diagnostic.cpp +++ b/source/diagnostic.cpp @@ -37,7 +37,7 @@ spv_diagnostic spvDiagnosticCreate(const spv_position position, diagnostic->position = *position; diagnostic->isTextSource = false; memset(diagnostic->error, 0, length); - strcpy(diagnostic->error, message); + strncpy(diagnostic->error, message, length); return diagnostic; } diff --git a/source/diff/CMakeLists.txt b/source/diff/CMakeLists.txt deleted file mode 100644 index 1328699a..00000000 --- a/source/diff/CMakeLists.txt +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (c) 2022 Google LLC. - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -set(SPIRV_TOOLS_DIFF_SOURCES - diff.h - lcs.h - - diff.cpp -) - -add_library(SPIRV-Tools-diff ${SPIRV_TOOLS_LIBRARY_TYPE} ${SPIRV_TOOLS_DIFF_SOURCES}) - -spvtools_default_compile_options(SPIRV-Tools-diff) -target_include_directories(SPIRV-Tools-diff - PUBLIC - $ - $ - $ - PRIVATE ${spirv-tools_BINARY_DIR} -) -# We need the assembling and disassembling functionalities in the main library. -target_link_libraries(SPIRV-Tools-diff - PUBLIC ${SPIRV_TOOLS_FULL_VISIBILITY}) -# We need the internals of spirv-opt. -target_link_libraries(SPIRV-Tools-diff - PUBLIC SPIRV-Tools-opt) - -set_property(TARGET SPIRV-Tools-diff PROPERTY FOLDER "SPIRV-Tools libraries") -spvtools_check_symbol_exports(SPIRV-Tools-diff) - -if(ENABLE_SPIRV_TOOLS_INSTALL) - install(TARGETS SPIRV-Tools-diff EXPORT SPIRV-Tools-diffTargets - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - export(EXPORT SPIRV-Tools-diffTargets FILE SPIRV-Tools-diffTargets.cmake) - - spvtools_config_package_dir(SPIRV-Tools-diff PACKAGE_DIR) - install(EXPORT SPIRV-Tools-diffTargets FILE SPIRV-Tools-diffTargets.cmake - DESTINATION ${PACKAGE_DIR}) - - spvtools_generate_config_file(SPIRV-Tools-diff) - install(FILES ${CMAKE_BINARY_DIR}/SPIRV-Tools-diffConfig.cmake DESTINATION ${PACKAGE_DIR}) -endif(ENABLE_SPIRV_TOOLS_INSTALL) diff --git a/source/diff/diff.cpp b/source/diff/diff.cpp deleted file mode 100644 index bca31b06..00000000 --- a/source/diff/diff.cpp +++ /dev/null @@ -1,2862 +0,0 @@ -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/diff/diff.h" - -#include "source/diff/lcs.h" -#include "source/disassemble.h" -#include "source/ext_inst.h" -#include "source/latest_version_spirv_header.h" -#include "source/print.h" -#include "spirv-tools/libspirv.hpp" - -namespace spvtools { -namespace diff { - -namespace { - -// A map from an id to the instruction that defines it. -using IdToInstructionMap = std::vector; -// A map from an id to the instructions that decorate it, or name it, etc. -using IdToInfoMap = std::vector>; -// A map from an instruction to another, used for instructions without id. -using InstructionToInstructionMap = - std::unordered_map; -// A flat list of instructions in a function for easier iteration. -using InstructionList = std::vector; -// A map from a function to its list of instructions. -using FunctionInstMap = std::map; -// A list of ids with some similar property, for example functions with the same -// name. -using IdGroup = std::vector; -// A map of names to ids with the same name. This is an ordered map so -// different implementations produce identical results. -using IdGroupMapByName = std::map; -using IdGroupMapByTypeId = std::map; -using IdGroupMapByOp = std::map; -using IdGroupMapByStorageClass = std::map; - -// A set of potential id mappings that haven't been resolved yet. Any id in src -// may map in any id in dst. Note that ids are added in the same order as they -// appear in src and dst to facilitate matching dependent instructions. For -// example, this guarantees that when matching OpTypeVector, the basic type of -// the vector is already (potentially) matched. -struct PotentialIdMap { - std::vector src_ids; - std::vector dst_ids; -}; - -void CompactIds(std::vector& ids) { - size_t write_index = 0; - for (size_t i = 0; i < ids.size(); ++i) { - if (ids[i] != 0) { - ids[write_index++] = ids[i]; - } - } - ids.resize(write_index); -} - -// A mapping between src and dst ids. -class IdMap { - public: - IdMap(size_t id_bound) { id_map_.resize(id_bound, 0); } - - void MapIds(uint32_t from, uint32_t to) { - assert(from != 0); - assert(to != 0); - assert(from < id_map_.size()); - assert(id_map_[from] == 0); - - id_map_[from] = to; - } - - uint32_t MappedId(uint32_t from) const { - assert(from != 0); - return from < id_map_.size() ? id_map_[from] : 0; - } - const opt::Instruction* MappedInst(const opt::Instruction* from_inst) const { - assert(from_inst != nullptr); - assert(!from_inst->HasResultId()); - - auto mapped = inst_map_.find(from_inst); - if (mapped == inst_map_.end()) { - return nullptr; - } - return mapped->second; - } - - bool IsMapped(uint32_t from) const { - assert(from != 0); - return from < id_map_.size() && id_map_[from] != 0; - } - - // Map any ids in src and dst that have not been mapped to new ids in dst and - // src respectively. - void MapUnmatchedIds(IdMap& other_way); - - // Some instructions don't have result ids. Those are mapped by pointer. - void MapInsts(const opt::Instruction* from_inst, - const opt::Instruction* to_inst) { - assert(from_inst != nullptr); - assert(to_inst != nullptr); - assert(inst_map_.find(from_inst) == inst_map_.end()); - - inst_map_[from_inst] = to_inst; - } - - uint32_t IdBound() const { return static_cast(id_map_.size()); } - - private: - // Given an id, returns the corresponding id in the other module, or 0 if not - // matched yet. - std::vector id_map_; - - // Same for instructions that don't have an id. - InstructionToInstructionMap inst_map_; -}; - -// Two way mapping of ids. -class SrcDstIdMap { - public: - SrcDstIdMap(size_t src_id_bound, size_t dst_id_bound) - : src_to_dst_(src_id_bound), dst_to_src_(dst_id_bound) {} - - void MapIds(uint32_t src, uint32_t dst) { - src_to_dst_.MapIds(src, dst); - dst_to_src_.MapIds(dst, src); - } - - uint32_t MappedDstId(uint32_t src) { - uint32_t dst = src_to_dst_.MappedId(src); - assert(dst == 0 || dst_to_src_.MappedId(dst) == src); - return dst; - } - uint32_t MappedSrcId(uint32_t dst) { - uint32_t src = dst_to_src_.MappedId(dst); - assert(src == 0 || src_to_dst_.MappedId(src) == dst); - return src; - } - - bool IsSrcMapped(uint32_t src) { return src_to_dst_.IsMapped(src); } - bool IsDstMapped(uint32_t dst) { return dst_to_src_.IsMapped(dst); } - - // Map any ids in src and dst that have not been mapped to new ids in dst and - // src respectively. - void MapUnmatchedIds(); - - // Some instructions don't have result ids. Those are mapped by pointer. - void MapInsts(const opt::Instruction* src_inst, - const opt::Instruction* dst_inst) { - assert(src_inst->HasResultId() == dst_inst->HasResultId()); - if (src_inst->HasResultId()) { - MapIds(src_inst->result_id(), dst_inst->result_id()); - } else { - src_to_dst_.MapInsts(src_inst, dst_inst); - dst_to_src_.MapInsts(dst_inst, src_inst); - } - } - - const IdMap& SrcToDstMap() const { return src_to_dst_; } - const IdMap& DstToSrcMap() const { return dst_to_src_; } - - private: - IdMap src_to_dst_; - IdMap dst_to_src_; -}; - -struct IdInstructions { - IdInstructions(const opt::Module* module) - : inst_map_(module->IdBound(), nullptr), - name_map_(module->IdBound()), - decoration_map_(module->IdBound()), - forward_pointer_map_(module->IdBound()) { - // Map ids from all sections to instructions that define them. - MapIdsToInstruction(module->ext_inst_imports()); - MapIdsToInstruction(module->types_values()); - for (const opt::Function& function : *module) { - function.ForEachInst( - [this](const opt::Instruction* inst) { - if (inst->HasResultId()) { - MapIdToInstruction(inst->result_id(), inst); - } - }, - true, true); - } - - // Gather decorations applied to ids that could be useful in matching them - // between src and dst modules. - MapIdsToInfos(module->debugs2()); - MapIdsToInfos(module->annotations()); - MapIdsToInfos(module->types_values()); - } - - void MapIdToInstruction(uint32_t id, const opt::Instruction* inst); - - void MapIdsToInstruction( - opt::IteratorRange section); - void MapIdsToInfos( - opt::IteratorRange section); - - IdToInstructionMap inst_map_; - IdToInfoMap name_map_; - IdToInfoMap decoration_map_; - IdToInstructionMap forward_pointer_map_; -}; - -class Differ { - public: - Differ(opt::IRContext* src, opt::IRContext* dst, std::ostream& out, - Options options) - : src_context_(src), - dst_context_(dst), - src_(src->module()), - dst_(dst->module()), - options_(options), - out_(out), - src_id_to_(src_), - dst_id_to_(dst_), - id_map_(src_->IdBound(), dst_->IdBound()) { - // Cache function bodies in canonicalization order. - GetFunctionBodies(src_context_, &src_funcs_, &src_func_insts_); - GetFunctionBodies(dst_context_, &dst_funcs_, &dst_func_insts_); - } - - // Match ids or instructions of different sections. - void MatchCapabilities(); - void MatchExtensions(); - void MatchExtInstImportIds(); - void MatchMemoryModel(); - void MatchEntryPointIds(); - void MatchExecutionModes(); - void MatchTypeForwardPointers(); - void MatchTypeIds(); - void MatchConstants(); - void MatchVariableIds(); - void MatchFunctions(); - - // Debug info and annotations are matched only after ids are matched. - void MatchDebugs1(); - void MatchDebugs2(); - void MatchDebugs3(); - void MatchExtInstDebugInfo(); - void MatchAnnotations(); - - // Output the diff. - spv_result_t Output(); - - void DumpIdMap() { - if (!options_.dump_id_map) { - return; - } - - out_ << " Src -> Dst\n"; - for (uint32_t src_id = 1; src_id < src_->IdBound(); ++src_id) { - uint32_t dst_id = id_map_.MappedDstId(src_id); - if (src_id_to_.inst_map_[src_id] != nullptr && dst_id != 0) - out_ << std::setw(4) << src_id << " -> " << std::setw(4) << dst_id - << " [" << spvOpcodeString(src_id_to_.inst_map_[src_id]->opcode()) - << "]\n"; - } - } - - private: - // Helper functions that match ids between src and dst - void PoolPotentialIds( - opt::IteratorRange section, - std::vector& ids, bool is_src, - std::function filter, - std::function get_id); - void MatchIds( - PotentialIdMap& potential, - std::function - match); - // Helper functions that match id-less instructions between src and dst. - void MatchPreambleInstructions( - opt::IteratorRange src_insts, - opt::IteratorRange dst_insts); - InstructionList SortPreambleInstructions( - const opt::Module* module, - opt::IteratorRange insts); - int ComparePreambleInstructions(const opt::Instruction* a, - const opt::Instruction* b, - const opt::Module* src_inst_module, - const opt::Module* dst_inst_module); - // Helper functions that match debug and annotation instructions of already - // matched ids. - void MatchDebugAndAnnotationInstructions( - opt::IteratorRange src_insts, - opt::IteratorRange dst_insts); - - // Get various properties from an id. These Helper functions are passed to - // `GroupIds` and `GroupIdsAndMatch` below (as the `get_group` argument). - uint32_t GroupIdsHelperGetTypeId(const IdInstructions& id_to, uint32_t id); - SpvStorageClass GroupIdsHelperGetTypePointerStorageClass( - const IdInstructions& id_to, uint32_t id); - SpvOp GroupIdsHelperGetTypePointerTypeOp(const IdInstructions& id_to, - uint32_t id); - - // Given a list of ids, groups them based on some value. The `get_group` - // function extracts a piece of information corresponding to each id, and the - // ids are bucketed based on that (and output in `groups`). This is useful to - // attempt to match ids between src and dst only when said property is - // identical. - template - void GroupIds(const IdGroup& ids, bool is_src, std::map* groups, - T (Differ::*get_group)(const IdInstructions&, uint32_t)); - - // Calls GroupIds to bucket ids in src and dst based on a property returned by - // `get_group`. This function then calls `match_group` for each bucket (i.e. - // "group") with identical values for said property. - // - // For example, say src and dst ids have the following properties - // correspondingly: - // - // - src ids' properties: {id0: A, id1: A, id2: B, id3: C, id4: B} - // - dst ids' properties: {id0': B, id1': C, id2': B, id3': D, id4': B} - // - // Then `match_group` is called 2 times: - // - // - Once with: ([id2, id4], [id0', id2', id4']) corresponding to B - // - Once with: ([id3], [id2']) corresponding to C - // - // Ids corresponding to A and D cannot match based on this property. - template - void GroupIdsAndMatch( - const IdGroup& src_ids, const IdGroup& dst_ids, T invalid_group_key, - T (Differ::*get_group)(const IdInstructions&, uint32_t), - std::function - match_group); - - // Helper functions that determine if two instructions match - bool DoIdsMatch(uint32_t src_id, uint32_t dst_id); - bool DoesOperandMatch(const opt::Operand& src_operand, - const opt::Operand& dst_operand); - bool DoOperandsMatch(const opt::Instruction* src_inst, - const opt::Instruction* dst_inst, - uint32_t in_operand_index_start, - uint32_t in_operand_count); - bool DoInstructionsMatch(const opt::Instruction* src_inst, - const opt::Instruction* dst_inst); - bool DoIdsMatchFuzzy(uint32_t src_id, uint32_t dst_id); - bool DoesOperandMatchFuzzy(const opt::Operand& src_operand, - const opt::Operand& dst_operand); - bool DoInstructionsMatchFuzzy(const opt::Instruction* src_inst, - const opt::Instruction* dst_inst); - bool AreIdenticalUintConstants(uint32_t src_id, uint32_t dst_id); - bool DoDebugAndAnnotationInstructionsMatch(const opt::Instruction* src_inst, - const opt::Instruction* dst_inst); - bool AreVariablesMatchable(uint32_t src_id, uint32_t dst_id, - uint32_t flexibility); - bool MatchOpTypeStruct(const opt::Instruction* src_inst, - const opt::Instruction* dst_inst, - uint32_t flexibility); - bool MatchOpConstant(const opt::Instruction* src_inst, - const opt::Instruction* dst_inst, uint32_t flexibility); - bool MatchOpSpecConstant(const opt::Instruction* src_inst, - const opt::Instruction* dst_inst); - bool MatchOpVariable(const opt::Instruction* src_inst, - const opt::Instruction* dst_inst, uint32_t flexibility); - bool MatchPerVertexType(uint32_t src_type_id, uint32_t dst_type_id); - bool MatchPerVertexVariable(const opt::Instruction* src_inst, - const opt::Instruction* dst_inst); - - // Helper functions for matching OpTypeForwardPointer - void MatchTypeForwardPointersByName(const IdGroup& src, const IdGroup& dst); - void MatchTypeForwardPointersByTypeOp(const IdGroup& src, const IdGroup& dst); - - // Helper functions for function matching. - using FunctionMap = std::map; - - InstructionList GetFunctionBody(opt::IRContext* context, - opt::Function& function); - InstructionList GetFunctionHeader(const opt::Function& function); - void GetFunctionBodies(opt::IRContext* context, FunctionMap* functions, - FunctionInstMap* function_insts); - void GetFunctionHeaderInstructions(const opt::Module* module, - FunctionInstMap* function_insts); - void BestEffortMatchFunctions(const IdGroup& src_func_ids, - const IdGroup& dst_func_ids, - const FunctionInstMap& src_func_insts, - const FunctionInstMap& dst_func_insts); - - // Calculates the diff of two function bodies. Note that the matched - // instructions themselves may not be identical; output of exact matches - // should produce the exact instruction while inexact matches should produce a - // diff as well. - // - // Returns the similarity of the two bodies = 2*N_match / (N_src + N_dst) - void MatchFunctionParamIds(const opt::Function* src_func, - const opt::Function* dst_func); - float MatchFunctionBodies(const InstructionList& src_body, - const InstructionList& dst_body, - DiffMatch* src_match_result, - DiffMatch* dst_match_result); - void MatchIdsInFunctionBodies(const InstructionList& src_body, - const InstructionList& dst_body, - const DiffMatch& src_match_result, - const DiffMatch& dst_match_result, - uint32_t flexibility); - void MatchVariablesUsedByMatchedInstructions(const opt::Instruction* src_inst, - const opt::Instruction* dst_inst, - uint32_t flexibility); - - // Helper functions to retrieve information pertaining to an id - const opt::Instruction* GetInst(const IdInstructions& id_to, uint32_t id); - uint32_t GetConstantUint(const IdInstructions& id_to, uint32_t constant_id); - SpvExecutionModel GetExecutionModel(const opt::Module* module, - uint32_t entry_point_id); - bool HasName(const IdInstructions& id_to, uint32_t id); - // Get the OpName associated with an id - std::string GetName(const IdInstructions& id_to, uint32_t id, bool* has_name); - // Get the OpName associated with an id, with argument types stripped for - // functions. Some tools don't encode function argument types in the OpName - // string, and this improves diff between SPIR-V from those tools and others. - std::string GetSanitizedName(const IdInstructions& id_to, uint32_t id); - uint32_t GetVarTypeId(const IdInstructions& id_to, uint32_t var_id, - SpvStorageClass* storage_class); - bool GetDecorationValue(const IdInstructions& id_to, uint32_t id, - SpvDecoration decoration, uint32_t* decoration_value); - const opt::Instruction* GetForwardPointerInst(const IdInstructions& id_to, - uint32_t id); - bool IsIntType(const IdInstructions& id_to, uint32_t type_id); - bool IsFloatType(const IdInstructions& id_to, uint32_t type_id); - bool IsConstantUint(const IdInstructions& id_to, uint32_t id); - bool IsVariable(const IdInstructions& id_to, uint32_t pointer_id); - bool IsOp(const IdInstructions& id_to, uint32_t id, SpvOp opcode); - bool IsPerVertexType(const IdInstructions& id_to, uint32_t type_id); - bool IsPerVertexVariable(const IdInstructions& id_to, uint32_t type_id); - SpvStorageClass GetPerVertexStorageClass(const opt::Module* module, - uint32_t type_id); - spv_ext_inst_type_t GetExtInstType(const IdInstructions& id_to, - uint32_t set_id); - spv_number_kind_t GetNumberKind(const IdInstructions& id_to, - const opt::Instruction& inst, - uint32_t operand_index, - uint32_t* number_bit_width); - spv_number_kind_t GetTypeNumberKind(const IdInstructions& id_to, uint32_t id, - uint32_t* number_bit_width); - - // Helper functions to output a diff line - const opt::Instruction* MappedDstInst(const opt::Instruction* src_inst); - const opt::Instruction* MappedSrcInst(const opt::Instruction* dst_inst); - const opt::Instruction* MappedInstImpl(const opt::Instruction* inst, - const IdMap& to_other, - const IdInstructions& other_id_to); - void OutputLine(std::function are_lines_identical, - std::function output_src_line, - std::function output_dst_line); - template - void OutputSection( - const InstList& src_insts, const InstList& dst_insts, - std::function - write_inst); - void ToParsedInstruction(const opt::Instruction& inst, - const IdInstructions& id_to, - const opt::Instruction& original_inst, - spv_parsed_instruction_t* parsed_inst, - std::vector& parsed_operands, - std::vector& inst_binary); - opt::Instruction ToMappedSrcIds(const opt::Instruction& dst_inst); - - void OutputRed() { - if (options_.color_output) out_ << spvtools::clr::red{true}; - } - void OutputGreen() { - if (options_.color_output) out_ << spvtools::clr::green{true}; - } - void OutputResetColor() { - if (options_.color_output) out_ << spvtools::clr::reset{true}; - } - - opt::IRContext* src_context_; - opt::IRContext* dst_context_; - const opt::Module* src_; - const opt::Module* dst_; - Options options_; - std::ostream& out_; - - // Helpers to look up instructions based on id. - IdInstructions src_id_to_; - IdInstructions dst_id_to_; - - // The ids that have been matched between src and dst so far. - SrcDstIdMap id_map_; - - // List of instructions in function bodies after canonicalization. Cached - // here to avoid duplicate work. More importantly, some maps use - // opt::Instruction pointers so they need to be unique. - FunctionInstMap src_func_insts_; - FunctionInstMap dst_func_insts_; - FunctionMap src_funcs_; - FunctionMap dst_funcs_; -}; - -void IdMap::MapUnmatchedIds(IdMap& other_way) { - const uint32_t src_id_bound = static_cast(id_map_.size()); - const uint32_t dst_id_bound = static_cast(other_way.id_map_.size()); - - uint32_t next_src_id = src_id_bound; - uint32_t next_dst_id = dst_id_bound; - - for (uint32_t src_id = 1; src_id < src_id_bound; ++src_id) { - if (!IsMapped(src_id)) { - MapIds(src_id, next_dst_id); - - other_way.id_map_.push_back(0); - other_way.MapIds(next_dst_id++, src_id); - } - } - - for (uint32_t dst_id = 1; dst_id < dst_id_bound; ++dst_id) { - if (!other_way.IsMapped(dst_id)) { - id_map_.push_back(0); - MapIds(next_src_id, dst_id); - - other_way.MapIds(dst_id, next_src_id++); - } - } -} - -void SrcDstIdMap::MapUnmatchedIds() { - src_to_dst_.MapUnmatchedIds(dst_to_src_); -} - -void IdInstructions::MapIdToInstruction(uint32_t id, - const opt::Instruction* inst) { - assert(id != 0); - assert(id < inst_map_.size()); - assert(inst_map_[id] == nullptr); - - inst_map_[id] = inst; -} - -void IdInstructions::MapIdsToInstruction( - opt::IteratorRange section) { - for (const opt::Instruction& inst : section) { - uint32_t result_id = inst.result_id(); - if (result_id == 0) { - continue; - } - - MapIdToInstruction(result_id, &inst); - } -} - -void IdInstructions::MapIdsToInfos( - opt::IteratorRange section) { - for (const opt::Instruction& inst : section) { - IdToInfoMap* info_map = nullptr; - uint32_t id_operand = 0; - - switch (inst.opcode()) { - case SpvOpName: - info_map = &name_map_; - break; - case SpvOpMemberName: - info_map = &name_map_; - break; - case SpvOpDecorate: - info_map = &decoration_map_; - break; - case SpvOpMemberDecorate: - info_map = &decoration_map_; - break; - case SpvOpTypeForwardPointer: { - uint32_t id = inst.GetSingleWordOperand(0); - assert(id != 0); - - assert(id < forward_pointer_map_.size()); - forward_pointer_map_[id] = &inst; - continue; - } - default: - // Currently unsupported instruction, don't attempt to use it for - // matching. - break; - } - - if (info_map == nullptr) { - continue; - } - - uint32_t id = inst.GetOperand(id_operand).AsId(); - assert(id != 0); - - assert(id < info_map->size()); - assert(std::find((*info_map)[id].begin(), (*info_map)[id].end(), &inst) == - (*info_map)[id].end()); - - (*info_map)[id].push_back(&inst); - } -} - -void Differ::PoolPotentialIds( - opt::IteratorRange section, - std::vector& ids, bool is_src, - std::function filter, - std::function get_id) { - for (const opt::Instruction& inst : section) { - if (!filter(inst)) { - continue; - } - - uint32_t result_id = get_id(inst); - assert(result_id != 0); - - assert(std::find(ids.begin(), ids.end(), result_id) == ids.end()); - - // Don't include ids that are already matched, for example through - // OpTypeForwardPointer. - const bool is_matched = is_src ? id_map_.IsSrcMapped(result_id) - : id_map_.IsDstMapped(result_id); - if (is_matched) { - continue; - } - - ids.push_back(result_id); - } -} - -void Differ::MatchIds( - PotentialIdMap& potential, - std::function - match) { - for (size_t src_index = 0; src_index < potential.src_ids.size(); - ++src_index) { - for (size_t dst_index = 0; dst_index < potential.dst_ids.size(); - ++dst_index) { - const uint32_t src_id = potential.src_ids[src_index]; - const uint32_t dst_id = potential.dst_ids[dst_index]; - - if (dst_id == 0) { - // Already matched. - continue; - } - - const opt::Instruction* src_inst = src_id_to_.inst_map_[src_id]; - const opt::Instruction* dst_inst = dst_id_to_.inst_map_[dst_id]; - - if (match(src_inst, dst_inst)) { - id_map_.MapIds(src_id, dst_id); - - // Remove the ids from the potential list. - potential.src_ids[src_index] = 0; - potential.dst_ids[dst_index] = 0; - - // Find a match for the next src id. - break; - } - } - } - - // Remove matched ids to make the next iteration faster. - CompactIds(potential.src_ids); - CompactIds(potential.dst_ids); -} - -void Differ::MatchPreambleInstructions( - opt::IteratorRange src_insts, - opt::IteratorRange dst_insts) { - // First, pool all instructions from each section and sort them. - InstructionList sorted_src_insts = SortPreambleInstructions(src_, src_insts); - InstructionList sorted_dst_insts = SortPreambleInstructions(dst_, dst_insts); - - // Then walk and match them. - size_t src_cur = 0; - size_t dst_cur = 0; - - while (src_cur < sorted_src_insts.size() && - dst_cur < sorted_dst_insts.size()) { - const opt::Instruction* src_inst = sorted_src_insts[src_cur]; - const opt::Instruction* dst_inst = sorted_dst_insts[dst_cur]; - - int compare = ComparePreambleInstructions(src_inst, dst_inst, src_, dst_); - if (compare == 0) { - id_map_.MapInsts(src_inst, dst_inst); - } - if (compare <= 0) { - ++src_cur; - } - if (compare >= 0) { - ++dst_cur; - } - } -} - -InstructionList Differ::SortPreambleInstructions( - const opt::Module* module, - opt::IteratorRange insts) { - InstructionList sorted; - for (const opt::Instruction& inst : insts) { - sorted.push_back(&inst); - } - std::sort( - sorted.begin(), sorted.end(), - [this, module](const opt::Instruction* a, const opt::Instruction* b) { - return ComparePreambleInstructions(a, b, module, module) < 0; - }); - return sorted; -} - -int Differ::ComparePreambleInstructions(const opt::Instruction* a, - const opt::Instruction* b, - const opt::Module* src_inst_module, - const opt::Module* dst_inst_module) { - assert(a->opcode() == b->opcode()); - assert(!a->HasResultId()); - assert(!a->HasResultType()); - - const uint32_t a_operand_count = a->NumOperands(); - const uint32_t b_operand_count = b->NumOperands(); - - if (a_operand_count < b_operand_count) { - return -1; - } - if (a_operand_count > b_operand_count) { - return 1; - } - - // Instead of comparing OpExecutionMode entry point ids as ids, compare them - // through their corresponding execution model. This simplifies traversing - // the sorted list of instructions between src and dst modules. - if (a->opcode() == SpvOpExecutionMode) { - const SpvExecutionModel src_model = - GetExecutionModel(src_inst_module, a->GetSingleWordOperand(0)); - const SpvExecutionModel dst_model = - GetExecutionModel(dst_inst_module, b->GetSingleWordOperand(0)); - - if (src_model < dst_model) { - return -1; - } - if (src_model > dst_model) { - return 1; - } - } - - // Match every operand of the instruction. - for (uint32_t operand_index = 0; operand_index < a_operand_count; - ++operand_index) { - const opt::Operand& a_operand = a->GetOperand(operand_index); - const opt::Operand& b_operand = b->GetOperand(operand_index); - - if (a_operand.type < b_operand.type) { - return -1; - } - if (a_operand.type > b_operand.type) { - return 1; - } - - assert(a_operand.words.size() == 1); - assert(b_operand.words.size() == 1); - - switch (a_operand.type) { - case SPV_OPERAND_TYPE_ID: - // Don't compare ids, there can't be multiple instances of the - // OpExecutionMode with different ids of the same execution model. - break; - case SPV_OPERAND_TYPE_TYPE_ID: - case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID: - case SPV_OPERAND_TYPE_SCOPE_ID: - assert(false && "Unreachable"); - break; - case SPV_OPERAND_TYPE_LITERAL_STRING: { - int str_compare = - strcmp(a_operand.AsString().c_str(), b_operand.AsString().c_str()); - if (str_compare != 0) { - return str_compare; - } - break; - } - default: - // Expect literal values to match. - if (a_operand.words[0] < b_operand.words[0]) { - return -1; - } - if (a_operand.words[0] > b_operand.words[0]) { - return 1; - } - break; - } - } - - return 0; -} - -void Differ::MatchDebugAndAnnotationInstructions( - opt::IteratorRange src_insts, - opt::IteratorRange dst_insts) { - for (const opt::Instruction& src_inst : src_insts) { - for (const opt::Instruction& dst_inst : dst_insts) { - if (MappedSrcInst(&dst_inst) != nullptr) { - continue; - } - - // Map instructions as soon as they match. Debug and annotation - // instructions are matched such that there can't be multiple matches. - if (DoDebugAndAnnotationInstructionsMatch(&src_inst, &dst_inst)) { - id_map_.MapInsts(&src_inst, &dst_inst); - break; - } - } - } -} - -uint32_t Differ::GroupIdsHelperGetTypeId(const IdInstructions& id_to, - uint32_t id) { - return GetInst(id_to, id)->type_id(); -} - -SpvStorageClass Differ::GroupIdsHelperGetTypePointerStorageClass( - const IdInstructions& id_to, uint32_t id) { - const opt::Instruction* inst = GetInst(id_to, id); - assert(inst && inst->opcode() == SpvOpTypePointer); - return SpvStorageClass(inst->GetSingleWordInOperand(0)); -} - -SpvOp Differ::GroupIdsHelperGetTypePointerTypeOp(const IdInstructions& id_to, - uint32_t id) { - const opt::Instruction* inst = GetInst(id_to, id); - assert(inst && inst->opcode() == SpvOpTypePointer); - - const uint32_t type_id = inst->GetSingleWordInOperand(1); - const opt::Instruction* type_inst = GetInst(id_to, type_id); - assert(type_inst); - - return type_inst->opcode(); -} - -template -void Differ::GroupIds(const IdGroup& ids, bool is_src, - std::map* groups, - T (Differ::*get_group)(const IdInstructions&, uint32_t)) { - assert(groups->empty()); - - const IdInstructions& id_to = is_src ? src_id_to_ : dst_id_to_; - - for (const uint32_t id : ids) { - // Don't include ids that are already matched, for example through - // OpEntryPoint. - const bool is_matched = - is_src ? id_map_.IsSrcMapped(id) : id_map_.IsDstMapped(id); - if (is_matched) { - continue; - } - - T group = (this->*get_group)(id_to, id); - (*groups)[group].push_back(id); - } -} - -template -void Differ::GroupIdsAndMatch( - const IdGroup& src_ids, const IdGroup& dst_ids, T invalid_group_key, - T (Differ::*get_group)(const IdInstructions&, uint32_t), - std::function - match_group) { - // Group the ids based on a key (get_group) - std::map src_groups; - std::map dst_groups; - - GroupIds(src_ids, true, &src_groups, get_group); - GroupIds(dst_ids, false, &dst_groups, get_group); - - // Iterate over the groups, and match those with identical keys - for (const auto& iter : src_groups) { - const T& key = iter.first; - const IdGroup& src_group = iter.second; - - if (key == invalid_group_key) { - continue; - } - - const IdGroup& dst_group = dst_groups[key]; - - // Let the caller match the groups as appropriate. - match_group(src_group, dst_group); - } -} - -bool Differ::DoIdsMatch(uint32_t src_id, uint32_t dst_id) { - assert(dst_id != 0); - return id_map_.MappedDstId(src_id) == dst_id; -} - -bool Differ::DoesOperandMatch(const opt::Operand& src_operand, - const opt::Operand& dst_operand) { - assert(src_operand.type == dst_operand.type); - - switch (src_operand.type) { - case SPV_OPERAND_TYPE_ID: - case SPV_OPERAND_TYPE_TYPE_ID: - case SPV_OPERAND_TYPE_RESULT_ID: - case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID: - case SPV_OPERAND_TYPE_SCOPE_ID: - // Match ids only if they are already matched in the id map. - return DoIdsMatch(src_operand.AsId(), dst_operand.AsId()); - case SPV_OPERAND_TYPE_LITERAL_STRING: - return src_operand.AsString() == dst_operand.AsString(); - default: - // Otherwise expect them to match exactly. - assert(src_operand.type != SPV_OPERAND_TYPE_LITERAL_STRING); - if (src_operand.words.size() != dst_operand.words.size()) { - return false; - } - for (size_t i = 0; i < src_operand.words.size(); ++i) { - if (src_operand.words[i] != dst_operand.words[i]) { - return false; - } - } - return true; - } -} - -bool Differ::DoOperandsMatch(const opt::Instruction* src_inst, - const opt::Instruction* dst_inst, - uint32_t in_operand_index_start, - uint32_t in_operand_count) { - // Caller should have returned early for instructions with different opcode. - assert(src_inst->opcode() == dst_inst->opcode()); - - bool match = true; - for (uint32_t i = 0; i < in_operand_count; ++i) { - const uint32_t in_operand_index = in_operand_index_start + i; - - const opt::Operand& src_operand = src_inst->GetInOperand(in_operand_index); - const opt::Operand& dst_operand = dst_inst->GetInOperand(in_operand_index); - - match = match && DoesOperandMatch(src_operand, dst_operand); - } - - return match; -} - -bool Differ::DoInstructionsMatch(const opt::Instruction* src_inst, - const opt::Instruction* dst_inst) { - // Check whether the two instructions are identical, that is the instructions - // themselves are matched, every id is matched, and every other value is - // identical. - if (MappedDstInst(src_inst) != dst_inst) { - return false; - } - - assert(src_inst->opcode() == dst_inst->opcode()); - if (src_inst->NumOperands() != dst_inst->NumOperands()) { - return false; - } - - for (uint32_t operand_index = 0; operand_index < src_inst->NumOperands(); - ++operand_index) { - const opt::Operand& src_operand = src_inst->GetOperand(operand_index); - const opt::Operand& dst_operand = dst_inst->GetOperand(operand_index); - - if (!DoesOperandMatch(src_operand, dst_operand)) { - return false; - } - } - - return true; -} - -bool Differ::DoIdsMatchFuzzy(uint32_t src_id, uint32_t dst_id) { - assert(dst_id != 0); - const uint32_t mapped_dst_id = id_map_.MappedDstId(src_id); - - // Consider unmatched ids as a match. In function bodies, no result id is - // matched yet and thus they are excluded from instruction matching when used - // as parameters in subsequent instructions. - if (mapped_dst_id == 0 || mapped_dst_id == dst_id) { - return true; - } - - // Int and Uint constants are interchangeable, match them in that case. - if (AreIdenticalUintConstants(src_id, dst_id)) { - return true; - } - - return false; -} - -bool Differ::DoesOperandMatchFuzzy(const opt::Operand& src_operand, - const opt::Operand& dst_operand) { - if (src_operand.type != dst_operand.type) { - return false; - } - - assert(src_operand.type != SPV_OPERAND_TYPE_RESULT_ID); - assert(dst_operand.type != SPV_OPERAND_TYPE_RESULT_ID); - - switch (src_operand.type) { - case SPV_OPERAND_TYPE_ID: - case SPV_OPERAND_TYPE_TYPE_ID: - case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID: - case SPV_OPERAND_TYPE_SCOPE_ID: - // Match id operands only if they are already matched in the id map. - return DoIdsMatchFuzzy(src_operand.AsId(), dst_operand.AsId()); - default: - // Otherwise allow everything to match. - return true; - } -} - -bool Differ::DoInstructionsMatchFuzzy(const opt::Instruction* src_inst, - const opt::Instruction* dst_inst) { - // Similar to DoOperandsMatch, but only checks that ids that have already been - // matched are identical. Ids that are unknown are allowed to match, as well - // as any non-id operand. - if (src_inst->opcode() != dst_inst->opcode()) { - return false; - } - // For external instructions, make sure the set and opcode of the external - // instruction matches too. - if (src_inst->opcode() == SpvOpExtInst) { - if (!DoOperandsMatch(src_inst, dst_inst, 0, 2)) { - return false; - } - } - - assert(src_inst->HasResultType() == dst_inst->HasResultType()); - if (src_inst->HasResultType() && - !DoIdsMatchFuzzy(src_inst->type_id(), dst_inst->type_id())) { - return false; - } - - // TODO: allow some instructions to match with different instruction lengths, - // for example OpImage* with additional operands. - if (src_inst->NumInOperandWords() != dst_inst->NumInOperandWords()) { - return false; - } - - bool match = true; - for (uint32_t in_operand_index = 0; - in_operand_index < src_inst->NumInOperandWords(); ++in_operand_index) { - const opt::Operand& src_operand = src_inst->GetInOperand(in_operand_index); - const opt::Operand& dst_operand = dst_inst->GetInOperand(in_operand_index); - - match = match && DoesOperandMatchFuzzy(src_operand, dst_operand); - } - - return match; -} - -bool Differ::AreIdenticalUintConstants(uint32_t src_id, uint32_t dst_id) { - return IsConstantUint(src_id_to_, src_id) && - IsConstantUint(dst_id_to_, dst_id) && - GetConstantUint(src_id_to_, src_id) == - GetConstantUint(dst_id_to_, dst_id); -} - -bool Differ::DoDebugAndAnnotationInstructionsMatch( - const opt::Instruction* src_inst, const opt::Instruction* dst_inst) { - if (src_inst->opcode() != dst_inst->opcode()) { - return false; - } - - switch (src_inst->opcode()) { - case SpvOpString: - case SpvOpSourceExtension: - case SpvOpModuleProcessed: - return DoesOperandMatch(src_inst->GetOperand(0), dst_inst->GetOperand(0)); - case SpvOpSource: - return DoOperandsMatch(src_inst, dst_inst, 0, 2); - case SpvOpSourceContinued: - return true; - case SpvOpName: - return DoOperandsMatch(src_inst, dst_inst, 0, 1); - case SpvOpMemberName: - return DoOperandsMatch(src_inst, dst_inst, 0, 2); - case SpvOpDecorate: - return DoOperandsMatch(src_inst, dst_inst, 0, 2); - case SpvOpMemberDecorate: - return DoOperandsMatch(src_inst, dst_inst, 0, 3); - case SpvOpExtInst: - case SpvOpDecorationGroup: - case SpvOpGroupDecorate: - case SpvOpGroupMemberDecorate: - return false; - default: - return false; - } -} - -bool Differ::AreVariablesMatchable(uint32_t src_id, uint32_t dst_id, - uint32_t flexibility) { - // Variables must match by their built-in decorations. - uint32_t src_built_in_decoration = 0, dst_built_in_decoration = 0; - const bool src_is_built_in = GetDecorationValue( - src_id_to_, src_id, SpvDecorationBuiltIn, &src_built_in_decoration); - const bool dst_is_built_in = GetDecorationValue( - dst_id_to_, dst_id, SpvDecorationBuiltIn, &dst_built_in_decoration); - - if (src_is_built_in != dst_is_built_in) { - return false; - } - if (src_is_built_in && src_built_in_decoration != dst_built_in_decoration) { - return false; - } - - // Check their types and storage classes. - SpvStorageClass src_storage_class, dst_storage_class; - const uint32_t src_type_id = - GetVarTypeId(src_id_to_, src_id, &src_storage_class); - const uint32_t dst_type_id = - GetVarTypeId(dst_id_to_, dst_id, &dst_storage_class); - - if (!DoIdsMatch(src_type_id, dst_type_id)) { - return false; - } - switch (flexibility) { - case 0: - if (src_storage_class != dst_storage_class) { - return false; - } - break; - case 1: - if (src_storage_class != dst_storage_class) { - // Allow one of the two to be Private while the other is Input or - // Output, this allows matching in/out variables that have been turned - // global as part of linking two stages (as done in ANGLE). - const bool src_is_io = src_storage_class == SpvStorageClassInput || - src_storage_class == SpvStorageClassOutput; - const bool dst_is_io = dst_storage_class == SpvStorageClassInput || - dst_storage_class == SpvStorageClassOutput; - const bool src_is_private = src_storage_class == SpvStorageClassPrivate; - const bool dst_is_private = dst_storage_class == SpvStorageClassPrivate; - - if (!((src_is_io && dst_is_private) || (src_is_private && dst_is_io))) { - return false; - } - } - break; - default: - assert(false && "Unreachable"); - return false; - } - - // TODO: Is there any other way to check compatiblity of the variables? It's - // easy to tell when the variables definitely don't match, but there's little - // information that can be used for a definite match. - return true; -} - -bool Differ::MatchOpTypeStruct(const opt::Instruction* src_inst, - const opt::Instruction* dst_inst, - uint32_t flexibility) { - const uint32_t src_type_id = src_inst->result_id(); - const uint32_t dst_type_id = dst_inst->result_id(); - - bool src_has_name = false, dst_has_name = false; - std::string src_name = GetName(src_id_to_, src_type_id, &src_has_name); - std::string dst_name = GetName(dst_id_to_, dst_type_id, &dst_has_name); - - // If debug info is present, always match the structs by name. - if (src_has_name && dst_has_name) { - if (src_name != dst_name) { - return false; - } - - // For gl_PerVertex, find the type pointer of this type (array) and make - // sure the storage classes of src and dst match; geometry and tessellation - // shaders have two instances of gl_PerVertex. - if (src_name == "gl_PerVertex") { - return MatchPerVertexType(src_type_id, dst_type_id); - } - - return true; - } - - // If debug info is not present, match the structs by their type. - - // For gl_PerVertex, find the type pointer of this type (array) and match by - // storage class. The gl_PerVertex struct is itself found by the BuiltIn - // decorations applied to its members. - const bool src_is_per_vertex = IsPerVertexType(src_id_to_, src_type_id); - const bool dst_is_per_vertex = IsPerVertexType(dst_id_to_, dst_type_id); - if (src_is_per_vertex != dst_is_per_vertex) { - return false; - } - - if (src_is_per_vertex) { - return MatchPerVertexType(src_type_id, dst_type_id); - } - - switch (flexibility) { - case 0: - if (src_inst->NumInOperandWords() != dst_inst->NumInOperandWords()) { - return false; - } - return DoOperandsMatch(src_inst, dst_inst, 0, - src_inst->NumInOperandWords()); - case 1: - // TODO: match by taking a diff of the fields, and see if there's a >75% - // match. Need to then make sure OpMemberName, OpMemberDecorate, - // OpAccessChain etc are aware of the struct field matching. - return false; - default: - assert(false && "Unreachable"); - return false; - } -} - -bool Differ::MatchOpConstant(const opt::Instruction* src_inst, - const opt::Instruction* dst_inst, - uint32_t flexibility) { - // The constants' type must match. In flexibility == 1, match constants of - // int and uint, as they are generally interchangeable. - switch (flexibility) { - case 0: - if (!DoesOperandMatch(src_inst->GetOperand(0), dst_inst->GetOperand(0))) { - return false; - } - break; - case 1: - if (!IsIntType(src_id_to_, src_inst->type_id()) || - !IsIntType(dst_id_to_, dst_inst->type_id())) { - return false; - } - break; - default: - assert(false && "Unreachable"); - return false; - } - - const opt::Operand& src_value_operand = src_inst->GetOperand(2); - const opt::Operand& dst_value_operand = dst_inst->GetOperand(2); - - const uint64_t src_value = src_value_operand.AsLiteralUint64(); - const uint64_t dst_value = dst_value_operand.AsLiteralUint64(); - - // If values are identical, it's a match. - if (src_value == dst_value) { - return true; - } - - // Otherwise, only allow flexibility for float types. - if (IsFloatType(src_id_to_, src_inst->type_id()) && flexibility == 1) { - // Tolerance is: - // - // - For float: allow 4 bits of mantissa as error - // - For double: allow 6 bits of mantissa as error - // - // TODO: the above values are arbitrary and a placeholder; investigate the - // amount of error resulting from using `printf("%f", f)` and `printf("%lf", - // d)` and having glslang parse them. - const uint64_t tolerance = src_value_operand.words.size() == 1 ? 16 : 64; - return src_value - dst_value < tolerance || - dst_value - src_value < tolerance; - } - - return false; -} - -bool Differ::MatchOpSpecConstant(const opt::Instruction* src_inst, - const opt::Instruction* dst_inst) { - const uint32_t src_id = src_inst->result_id(); - const uint32_t dst_id = dst_inst->result_id(); - - bool src_has_name = false, dst_has_name = false; - std::string src_name = GetName(src_id_to_, src_id, &src_has_name); - std::string dst_name = GetName(dst_id_to_, dst_id, &dst_has_name); - - // If debug info is present, always match the spec consts by name. - if (src_has_name && dst_has_name) { - return src_name == dst_name; - } - - // Otherwise, match them by SpecId. - uint32_t src_spec_id, dst_spec_id; - - if (GetDecorationValue(src_id_to_, src_id, SpvDecorationSpecId, - &src_spec_id) && - GetDecorationValue(dst_id_to_, dst_id, SpvDecorationSpecId, - &dst_spec_id)) { - return src_spec_id == dst_spec_id; - } - - // There is no spec id, this is not valid. - assert(false && "Unreachable"); - return false; -} - -bool Differ::MatchOpVariable(const opt::Instruction* src_inst, - const opt::Instruction* dst_inst, - uint32_t flexibility) { - const uint32_t src_id = src_inst->result_id(); - const uint32_t dst_id = dst_inst->result_id(); - - const bool src_is_pervertex = IsPerVertexVariable(src_id_to_, src_id); - const bool dst_is_pervertex = IsPerVertexVariable(dst_id_to_, dst_id); - - // For gl_PerVertex, make sure the input and output instances are matched - // correctly. - if (src_is_pervertex != dst_is_pervertex) { - return false; - } - if (src_is_pervertex) { - return MatchPerVertexVariable(src_inst, dst_inst); - } - - bool src_has_name = false, dst_has_name = false; - std::string src_name = GetName(src_id_to_, src_id, &src_has_name); - std::string dst_name = GetName(dst_id_to_, dst_id, &dst_has_name); - - // If debug info is present, always match the variables by name. - if (src_has_name && dst_has_name) { - return src_name == dst_name; - } - - // If debug info is not present, see if the variables can be matched by their - // built-in decorations. - uint32_t src_built_in_decoration; - const bool src_is_built_in = GetDecorationValue( - src_id_to_, src_id, SpvDecorationBuiltIn, &src_built_in_decoration); - - if (src_is_built_in && AreVariablesMatchable(src_id, dst_id, flexibility)) { - return true; - } - - SpvStorageClass src_storage_class, dst_storage_class; - GetVarTypeId(src_id_to_, src_id, &src_storage_class); - GetVarTypeId(dst_id_to_, dst_id, &dst_storage_class); - - if (src_storage_class != dst_storage_class) { - return false; - } - - // If variables are decorated with set/binding, match by the value of those - // decorations. - if (!options_.ignore_set_binding) { - uint32_t src_set = 0, dst_set = 0; - uint32_t src_binding = 0, dst_binding = 0; - - const bool src_has_set = GetDecorationValue( - src_id_to_, src_id, SpvDecorationDescriptorSet, &src_set); - const bool dst_has_set = GetDecorationValue( - dst_id_to_, dst_id, SpvDecorationDescriptorSet, &dst_set); - const bool src_has_binding = - GetDecorationValue(src_id_to_, src_id, SpvDecorationBinding, &src_set); - const bool dst_has_binding = - GetDecorationValue(dst_id_to_, dst_id, SpvDecorationBinding, &dst_set); - - if (src_has_set && dst_has_set && src_has_binding && dst_has_binding) { - return src_set == dst_set && src_binding == dst_binding; - } - } - - // If variables are decorated with location, match by the value of that - // decoration. - if (!options_.ignore_location) { - uint32_t src_location, dst_location; - - const bool src_has_location = GetDecorationValue( - src_id_to_, src_id, SpvDecorationLocation, &src_location); - const bool dst_has_location = GetDecorationValue( - dst_id_to_, dst_id, SpvDecorationLocation, &dst_location); - - if (src_has_location && dst_has_location) { - return src_location == dst_location; - } - } - - // Currently, there's no other way to match variables. - return false; -} - -bool Differ::MatchPerVertexType(uint32_t src_type_id, uint32_t dst_type_id) { - // For gl_PerVertex, find the type pointer of this type (array) and make sure - // the storage classes of src and dst match; geometry and tessellation shaders - // have two instances of gl_PerVertex. - SpvStorageClass src_storage_class = - GetPerVertexStorageClass(src_, src_type_id); - SpvStorageClass dst_storage_class = - GetPerVertexStorageClass(dst_, dst_type_id); - - assert(src_storage_class == SpvStorageClassInput || - src_storage_class == SpvStorageClassOutput); - assert(dst_storage_class == SpvStorageClassInput || - dst_storage_class == SpvStorageClassOutput); - - return src_storage_class == dst_storage_class; -} - -bool Differ::MatchPerVertexVariable(const opt::Instruction* src_inst, - const opt::Instruction* dst_inst) { - SpvStorageClass src_storage_class = - SpvStorageClass(src_inst->GetSingleWordInOperand(0)); - SpvStorageClass dst_storage_class = - SpvStorageClass(dst_inst->GetSingleWordInOperand(0)); - - return src_storage_class == dst_storage_class; -} - -void Differ::MatchTypeForwardPointersByName(const IdGroup& src, - const IdGroup& dst) { - // Given two sets of compatible groups of OpTypeForwardPointer instructions, - // attempts to match them by name. - - // Group them by debug info and loop over them. - GroupIdsAndMatch( - src, dst, "", &Differ::GetSanitizedName, - [this](const IdGroup& src_group, const IdGroup& dst_group) { - - // Match only if there's a unique forward declaration with this debug - // name. - if (src_group.size() == 1 && dst_group.size() == 1) { - id_map_.MapIds(src_group[0], dst_group[0]); - } - }); -} - -void Differ::MatchTypeForwardPointersByTypeOp(const IdGroup& src, - const IdGroup& dst) { - // Given two sets of compatible groups of OpTypeForwardPointer instructions, - // attempts to match them by type op. Must be called after - // MatchTypeForwardPointersByName to match as many as possible by debug info. - - // Remove ids that are matched with debug info in - // MatchTypeForwardPointersByName. - IdGroup src_unmatched_ids; - IdGroup dst_unmatched_ids; - - std::copy_if(src.begin(), src.end(), std::back_inserter(src_unmatched_ids), - [this](uint32_t id) { return !id_map_.IsSrcMapped(id); }); - std::copy_if(dst.begin(), dst.end(), std::back_inserter(dst_unmatched_ids), - [this](uint32_t id) { return !id_map_.IsDstMapped(id); }); - - // Match only if there's a unique forward declaration with this - // storage class and type opcode. If both have debug info, they - // must not have been matchable. - if (src_unmatched_ids.size() == 1 && dst_unmatched_ids.size() == 1) { - uint32_t src_id = src_unmatched_ids[0]; - uint32_t dst_id = dst_unmatched_ids[0]; - if (!HasName(src_id_to_, src_id) || !HasName(dst_id_to_, dst_id)) { - id_map_.MapIds(src_id, dst_id); - } - } -} - -InstructionList Differ::GetFunctionBody(opt::IRContext* context, - opt::Function& function) { - // Canonicalize the blocks of the function to produce better diff, for example - // to not produce any diff if the src and dst have the same switch/case blocks - // but with the cases simply reordered. - std::list order; - context->cfg()->ComputeStructuredOrder(&function, &*function.begin(), &order); - - // Go over the instructions of the function and add the instructions to a flat - // list to simplify future iterations. - InstructionList body; - for (opt::BasicBlock* block : order) { - block->ForEachInst( - [&body](const opt::Instruction* inst) { body.push_back(inst); }, true); - } - body.push_back(function.EndInst()); - - return body; -} - -InstructionList Differ::GetFunctionHeader(const opt::Function& function) { - // Go over the instructions of the function and add the header instructions to - // a flat list to simplify diff generation. - InstructionList body; - function.WhileEachInst( - [&body](const opt::Instruction* inst) { - if (inst->opcode() == SpvOpLabel) { - return false; - } - body.push_back(inst); - return true; - }, - true, true); - - return body; -} - -void Differ::GetFunctionBodies(opt::IRContext* context, FunctionMap* functions, - FunctionInstMap* function_insts) { - for (opt::Function& function : *context->module()) { - uint32_t id = function.result_id(); - assert(functions->find(id) == functions->end()); - assert(function_insts->find(id) == function_insts->end()); - - (*functions)[id] = &function; - - InstructionList body = GetFunctionBody(context, function); - (*function_insts)[id] = std::move(body); - } -} - -void Differ::GetFunctionHeaderInstructions(const opt::Module* module, - FunctionInstMap* function_insts) { - for (opt::Function& function : *module) { - InstructionList body = GetFunctionHeader(function); - (*function_insts)[function.result_id()] = std::move(body); - } -} - -void Differ::BestEffortMatchFunctions(const IdGroup& src_func_ids, - const IdGroup& dst_func_ids, - const FunctionInstMap& src_func_insts, - const FunctionInstMap& dst_func_insts) { - struct MatchResult { - uint32_t src_id; - uint32_t dst_id; - DiffMatch src_match; - DiffMatch dst_match; - float match_rate; - bool operator<(const MatchResult& other) const { - return match_rate > other.match_rate; - } - }; - std::vector all_match_results; - - for (const uint32_t src_func_id : src_func_ids) { - if (id_map_.IsSrcMapped(src_func_id)) { - continue; - } - const std::string src_name = GetSanitizedName(src_id_to_, src_func_id); - - for (const uint32_t dst_func_id : dst_func_ids) { - if (id_map_.IsDstMapped(dst_func_id)) { - continue; - } - - // Don't match functions that are named, but the names are different. - const std::string dst_name = GetSanitizedName(dst_id_to_, dst_func_id); - if (src_name != "" && dst_name != "" && src_name != dst_name) { - continue; - } - - DiffMatch src_match_result, dst_match_result; - float match_rate = MatchFunctionBodies( - src_func_insts.at(src_func_id), dst_func_insts.at(dst_func_id), - &src_match_result, &dst_match_result); - - // Only consider the functions a match if there's at least 60% match. - // This is an arbitrary limit that should be tuned. - constexpr float pass_match_rate = 0.6f; - if (match_rate >= pass_match_rate) { - all_match_results.emplace_back( - MatchResult{src_func_id, dst_func_id, std::move(src_match_result), - std::move(dst_match_result), match_rate}); - } - } - } - - std::sort(all_match_results.begin(), all_match_results.end()); - - for (const MatchResult& match_result : all_match_results) { - if (id_map_.IsSrcMapped(match_result.src_id) || - id_map_.IsDstMapped(match_result.dst_id)) { - continue; - } - - id_map_.MapIds(match_result.src_id, match_result.dst_id); - - MatchIdsInFunctionBodies(src_func_insts.at(match_result.src_id), - dst_func_insts.at(match_result.dst_id), - match_result.src_match, match_result.dst_match, 0); - } -} - -void Differ::MatchFunctionParamIds(const opt::Function* src_func, - const opt::Function* dst_func) { - IdGroup src_params; - IdGroup dst_params; - src_func->ForEachParam( - [&src_params](const opt::Instruction* param) { - src_params.push_back(param->result_id()); - }, - false); - dst_func->ForEachParam( - [&dst_params](const opt::Instruction* param) { - dst_params.push_back(param->result_id()); - }, - false); - - GroupIdsAndMatch( - src_params, dst_params, "", &Differ::GetSanitizedName, - [this](const IdGroup& src_group, const IdGroup& dst_group) { - - // There shouldn't be two parameters with the same name, so the ids - // should match. There is nothing restricting the SPIR-V however to have - // two parameters with the same name, so be resilient against that. - if (src_group.size() == 1 && dst_group.size() == 1) { - id_map_.MapIds(src_group[0], dst_group[0]); - } - }); - - // Then match the parameters by their type. If there are multiple of them, - // match them by their order. - GroupIdsAndMatch( - src_params, dst_params, 0, &Differ::GroupIdsHelperGetTypeId, - [this](const IdGroup& src_group_by_type_id, - const IdGroup& dst_group_by_type_id) { - - const size_t shared_param_count = - std::min(src_group_by_type_id.size(), dst_group_by_type_id.size()); - - for (size_t param_index = 0; param_index < shared_param_count; - ++param_index) { - id_map_.MapIds(src_group_by_type_id[0], dst_group_by_type_id[0]); - } - }); -} - -float Differ::MatchFunctionBodies(const InstructionList& src_body, - const InstructionList& dst_body, - DiffMatch* src_match_result, - DiffMatch* dst_match_result) { - LongestCommonSubsequence> lcs(src_body, - dst_body); - - uint32_t best_match_length = lcs.Get( - [this](const opt::Instruction* src_inst, - const opt::Instruction* dst_inst) { - return DoInstructionsMatchFuzzy(src_inst, dst_inst); - }, - src_match_result, dst_match_result); - - // TODO: take the gaps in between matches and match those again with a relaxed - // instruction-and-type-only comparison. This can produce a better diff for - // example if an array index is changed, causing the OpAccessChain id to not - // match and subsequently every operation that's derived from that id. - // Usually this mismatch cascades until the next OpStore which doesn't produce - // an id. - - return static_cast(best_match_length) * 2.0f / - static_cast(src_body.size() + dst_body.size()); -} - -void Differ::MatchIdsInFunctionBodies(const InstructionList& src_body, - const InstructionList& dst_body, - const DiffMatch& src_match_result, - const DiffMatch& dst_match_result, - uint32_t flexibility) { - size_t src_cur = 0; - size_t dst_cur = 0; - - while (src_cur < src_body.size() && dst_cur < dst_body.size()) { - if (src_match_result[src_cur] && dst_match_result[dst_cur]) { - // Match instructions the src and dst instructions. - // - // TODO: count the matchings between variables discovered this way and - // choose the "best match" after all functions have been diffed and all - // instructions analyzed. - const opt::Instruction* src_inst = src_body[src_cur++]; - const opt::Instruction* dst_inst = dst_body[dst_cur++]; - - // Record the matching between the instructions. This is done only once - // (hence flexibility == 0). Calls with non-zero flexibility values will - // only deal with matching other ids based on the operands. - if (flexibility == 0) { - id_map_.MapInsts(src_inst, dst_inst); - } - - // Match any unmatched variables referenced by the instructions. - MatchVariablesUsedByMatchedInstructions(src_inst, dst_inst, flexibility); - continue; - } - if (!src_match_result[src_cur]) { - ++src_cur; - } - if (!dst_match_result[dst_cur]) { - ++dst_cur; - } - } -} - -void Differ::MatchVariablesUsedByMatchedInstructions( - const opt::Instruction* src_inst, const opt::Instruction* dst_inst, - uint32_t flexibility) { - // For OpAccessChain, OpLoad and OpStore instructions that reference unmatched - // variables, match them as a best effort. - assert(src_inst->opcode() == dst_inst->opcode()); - switch (src_inst->opcode()) { - default: - // TODO: match functions based on OpFunctionCall? - break; - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: - case SpvOpPtrAccessChain: - case SpvOpInBoundsPtrAccessChain: - case SpvOpLoad: - case SpvOpStore: - const uint32_t src_pointer_id = src_inst->GetSingleWordInOperand(0); - const uint32_t dst_pointer_id = dst_inst->GetSingleWordInOperand(0); - if (IsVariable(src_id_to_, src_pointer_id) && - IsVariable(dst_id_to_, dst_pointer_id) && - !id_map_.IsSrcMapped(src_pointer_id) && - !id_map_.IsDstMapped(dst_pointer_id) && - AreVariablesMatchable(src_pointer_id, dst_pointer_id, flexibility)) { - id_map_.MapIds(src_pointer_id, dst_pointer_id); - } - break; - } -} - -const opt::Instruction* Differ::GetInst(const IdInstructions& id_to, - uint32_t id) { - assert(id != 0); - assert(id < id_to.inst_map_.size()); - - const opt::Instruction* inst = id_to.inst_map_[id]; - assert(inst != nullptr); - - return inst; -} - -uint32_t Differ::GetConstantUint(const IdInstructions& id_to, - uint32_t constant_id) { - const opt::Instruction* constant_inst = GetInst(id_to, constant_id); - assert(constant_inst->opcode() == SpvOpConstant); - assert(GetInst(id_to, constant_inst->type_id())->opcode() == SpvOpTypeInt); - - return constant_inst->GetSingleWordInOperand(0); -} - -SpvExecutionModel Differ::GetExecutionModel(const opt::Module* module, - uint32_t entry_point_id) { - for (const opt::Instruction& inst : module->entry_points()) { - assert(inst.opcode() == SpvOpEntryPoint); - if (inst.GetSingleWordOperand(1) == entry_point_id) { - return SpvExecutionModel(inst.GetSingleWordOperand(0)); - } - } - - assert(false && "Unreachable"); - return SpvExecutionModel(0xFFF); -} - -bool Differ::HasName(const IdInstructions& id_to, uint32_t id) { - assert(id != 0); - assert(id < id_to.name_map_.size()); - - for (const opt::Instruction* inst : id_to.name_map_[id]) { - if (inst->opcode() == SpvOpName) { - return true; - } - } - - return false; -} - -std::string Differ::GetName(const IdInstructions& id_to, uint32_t id, - bool* has_name) { - assert(id != 0); - assert(id < id_to.name_map_.size()); - - for (const opt::Instruction* inst : id_to.name_map_[id]) { - if (inst->opcode() == SpvOpName) { - *has_name = true; - return inst->GetOperand(1).AsString(); - } - } - - *has_name = false; - return ""; -} - -std::string Differ::GetSanitizedName(const IdInstructions& id_to, uint32_t id) { - bool has_name = false; - std::string name = GetName(id_to, id, &has_name); - - if (!has_name) { - return ""; - } - - // Remove args from the name, in case this is a function name - return name.substr(0, name.find('(')); -} - -uint32_t Differ::GetVarTypeId(const IdInstructions& id_to, uint32_t var_id, - SpvStorageClass* storage_class) { - const opt::Instruction* var_inst = GetInst(id_to, var_id); - assert(var_inst->opcode() == SpvOpVariable); - - *storage_class = SpvStorageClass(var_inst->GetSingleWordInOperand(0)); - - // Get the type pointer from the variable. - const uint32_t type_pointer_id = var_inst->type_id(); - const opt::Instruction* type_pointer_inst = GetInst(id_to, type_pointer_id); - - // Get the type from the type pointer. - return type_pointer_inst->GetSingleWordInOperand(1); -} - -bool Differ::GetDecorationValue(const IdInstructions& id_to, uint32_t id, - SpvDecoration decoration, - uint32_t* decoration_value) { - assert(id != 0); - assert(id < id_to.decoration_map_.size()); - - for (const opt::Instruction* inst : id_to.decoration_map_[id]) { - if (inst->opcode() == SpvOpDecorate && - inst->GetSingleWordOperand(0) == id && - inst->GetSingleWordOperand(1) == decoration) { - *decoration_value = inst->GetSingleWordOperand(2); - return true; - } - } - - return false; -} - -const opt::Instruction* Differ::GetForwardPointerInst( - const IdInstructions& id_to, uint32_t id) { - assert(id != 0); - assert(id < id_to.forward_pointer_map_.size()); - return id_to.forward_pointer_map_[id]; -} - -bool Differ::IsIntType(const IdInstructions& id_to, uint32_t type_id) { - return IsOp(id_to, type_id, SpvOpTypeInt); -} - -bool Differ::IsFloatType(const IdInstructions& id_to, uint32_t type_id) { - return IsOp(id_to, type_id, SpvOpTypeFloat); -} - -bool Differ::IsConstantUint(const IdInstructions& id_to, uint32_t id) { - const opt::Instruction* constant_inst = GetInst(id_to, id); - if (constant_inst->opcode() != SpvOpConstant) { - return false; - } - - const opt::Instruction* type_inst = GetInst(id_to, constant_inst->type_id()); - return type_inst->opcode() == SpvOpTypeInt; -} - -bool Differ::IsVariable(const IdInstructions& id_to, uint32_t pointer_id) { - return IsOp(id_to, pointer_id, SpvOpVariable); -} - -bool Differ::IsOp(const IdInstructions& id_to, uint32_t id, SpvOp op) { - return GetInst(id_to, id)->opcode() == op; -} - -bool Differ::IsPerVertexType(const IdInstructions& id_to, uint32_t type_id) { - assert(type_id != 0); - assert(type_id < id_to.decoration_map_.size()); - - for (const opt::Instruction* inst : id_to.decoration_map_[type_id]) { - if (inst->opcode() == SpvOpMemberDecorate && - inst->GetSingleWordOperand(0) == type_id && - inst->GetSingleWordOperand(2) == SpvDecorationBuiltIn) { - SpvBuiltIn built_in = SpvBuiltIn(inst->GetSingleWordOperand(3)); - - // Only gl_PerVertex can have, and it can only have, the following - // built-in decorations. - return built_in == SpvBuiltInPosition || - built_in == SpvBuiltInPointSize || - built_in == SpvBuiltInClipDistance || - built_in == SpvBuiltInCullDistance; - } - } - - return false; -} - -bool Differ::IsPerVertexVariable(const IdInstructions& id_to, uint32_t var_id) { - // Get the type from the type pointer. - SpvStorageClass storage_class; - uint32_t type_id = GetVarTypeId(id_to, var_id, &storage_class); - const opt::Instruction* type_inst = GetInst(id_to, type_id); - - // If array, get the element type. - if (type_inst->opcode() == SpvOpTypeArray) { - type_id = type_inst->GetSingleWordInOperand(0); - } - - // Now check if the type is gl_PerVertex. - return IsPerVertexType(id_to, type_id); -} - -SpvStorageClass Differ::GetPerVertexStorageClass(const opt::Module* module, - uint32_t type_id) { - for (const opt::Instruction& inst : module->types_values()) { - switch (inst.opcode()) { - case SpvOpTypeArray: - // The gl_PerVertex instance could be an array, look for a variable of - // the array type instead. - if (inst.GetSingleWordInOperand(0) == type_id) { - type_id = inst.result_id(); - } - break; - case SpvOpTypePointer: - // Find the storage class of the pointer to this type. - if (inst.GetSingleWordInOperand(1) == type_id) { - return SpvStorageClass(inst.GetSingleWordInOperand(0)); - } - break; - default: - break; - } - } - - // gl_PerVertex is declared, but is unused. Return either of Input or Output - // classes just so it matches one in the other module. This should be highly - // unlikely, perhaps except for ancient GS-used-to-emulate-CS scenarios. - return SpvStorageClassOutput; -} - -spv_ext_inst_type_t Differ::GetExtInstType(const IdInstructions& id_to, - uint32_t set_id) { - const opt::Instruction* set_inst = GetInst(id_to, set_id); - return spvExtInstImportTypeGet(set_inst->GetInOperand(0).AsString().c_str()); -} - -spv_number_kind_t Differ::GetNumberKind(const IdInstructions& id_to, - const opt::Instruction& inst, - uint32_t operand_index, - uint32_t* number_bit_width) { - const opt::Operand& operand = inst.GetOperand(operand_index); - *number_bit_width = 0; - - // A very limited version of Parser::parseOperand. - switch (operand.type) { - case SPV_OPERAND_TYPE_LITERAL_INTEGER: - case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER: - // Always unsigned integers. - *number_bit_width = 32; - return SPV_NUMBER_UNSIGNED_INT; - case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER: - case SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER: - switch (inst.opcode()) { - case SpvOpSwitch: - case SpvOpConstant: - case SpvOpSpecConstant: - // Same kind of number as the selector (OpSwitch) or the type - // (Op*Constant). - return GetTypeNumberKind(id_to, inst.GetSingleWordOperand(0), - number_bit_width); - default: - assert(false && "Unreachable"); - break; - } - break; - default: - break; - } - - return SPV_NUMBER_NONE; -} - -spv_number_kind_t Differ::GetTypeNumberKind(const IdInstructions& id_to, - uint32_t id, - uint32_t* number_bit_width) { - const opt::Instruction* type_inst = GetInst(id_to, id); - if (!spvOpcodeIsScalarType(type_inst->opcode())) { - type_inst = GetInst(id_to, type_inst->type_id()); - } - - switch (type_inst->opcode()) { - case SpvOpTypeInt: - *number_bit_width = type_inst->GetSingleWordOperand(1); - return type_inst->GetSingleWordOperand(2) == 0 ? SPV_NUMBER_UNSIGNED_INT - : SPV_NUMBER_SIGNED_INT; - break; - case SpvOpTypeFloat: - *number_bit_width = type_inst->GetSingleWordOperand(1); - return SPV_NUMBER_FLOATING; - default: - assert(false && "Unreachable"); - return SPV_NUMBER_NONE; - } -} - -void Differ::MatchCapabilities() { - MatchPreambleInstructions(src_->capabilities(), dst_->capabilities()); -} - -void Differ::MatchExtensions() { - MatchPreambleInstructions(src_->extensions(), dst_->extensions()); -} - -void Differ::MatchExtInstImportIds() { - // Bunch all of this section's ids as potential matches. - PotentialIdMap potential_id_map; - auto get_result_id = [](const opt::Instruction& inst) { - return inst.result_id(); - }; - auto accept_all = [](const opt::Instruction&) { return true; }; - - PoolPotentialIds(src_->ext_inst_imports(), potential_id_map.src_ids, true, - accept_all, get_result_id); - PoolPotentialIds(dst_->ext_inst_imports(), potential_id_map.dst_ids, false, - accept_all, get_result_id); - - // Then match the ids. - MatchIds(potential_id_map, [](const opt::Instruction* src_inst, - const opt::Instruction* dst_inst) { - // Match OpExtInstImport by exact name, which is operand 1 - const opt::Operand& src_name = src_inst->GetOperand(1); - const opt::Operand& dst_name = dst_inst->GetOperand(1); - - return src_name.AsString() == dst_name.AsString(); - }); -} -void Differ::MatchMemoryModel() { - // Always match the memory model instructions, there is always a single one of - // it. - id_map_.MapInsts(src_->GetMemoryModel(), dst_->GetMemoryModel()); -} - -void Differ::MatchEntryPointIds() { - // Match OpEntryPoint ids (at index 1) by ExecutionModel (at index 0) and - // possibly name (at index 2). OpEntryPoint doesn't produce a result id, so - // this function doesn't use the helpers the other functions use. - - // Map from execution model to OpEntryPoint instructions of that model. - using ExecutionModelMap = - std::unordered_map>; - ExecutionModelMap src_entry_points_map; - ExecutionModelMap dst_entry_points_map; - std::set all_execution_models; - - for (const opt::Instruction& src_inst : src_->entry_points()) { - uint32_t execution_model = src_inst.GetSingleWordOperand(0); - src_entry_points_map[execution_model].push_back(&src_inst); - all_execution_models.insert(execution_model); - } - for (const opt::Instruction& dst_inst : dst_->entry_points()) { - uint32_t execution_model = dst_inst.GetSingleWordOperand(0); - dst_entry_points_map[execution_model].push_back(&dst_inst); - all_execution_models.insert(execution_model); - } - - // Go through each model and match the ids. - for (const uint32_t execution_model : all_execution_models) { - auto& src_insts = src_entry_points_map[execution_model]; - auto& dst_insts = dst_entry_points_map[execution_model]; - - // If there is only one entry point in src and dst with that model, match - // them unconditionally. - if (src_insts.size() == 1 && dst_insts.size() == 1) { - uint32_t src_id = src_insts[0]->GetSingleWordOperand(1); - uint32_t dst_id = dst_insts[0]->GetSingleWordOperand(1); - id_map_.MapIds(src_id, dst_id); - id_map_.MapInsts(src_insts[0], dst_insts[0]); - continue; - } - - // Otherwise match them by name. - bool matched = false; - for (const opt::Instruction* src_inst : src_insts) { - for (const opt::Instruction* dst_inst : dst_insts) { - const opt::Operand& src_name = src_inst->GetOperand(2); - const opt::Operand& dst_name = dst_inst->GetOperand(2); - - if (src_name.AsString() == dst_name.AsString()) { - uint32_t src_id = src_inst->GetSingleWordOperand(1); - uint32_t dst_id = dst_inst->GetSingleWordOperand(1); - id_map_.MapIds(src_id, dst_id); - id_map_.MapInsts(src_inst, dst_inst); - matched = true; - break; - } - } - if (matched) { - break; - } - } - } -} - -void Differ::MatchExecutionModes() { - MatchPreambleInstructions(src_->execution_modes(), dst_->execution_modes()); -} - -void Differ::MatchTypeForwardPointers() { - // Bunch all of type forward pointers as potential matches. - PotentialIdMap potential_id_map; - auto get_pointer_type_id = [](const opt::Instruction& inst) { - return inst.GetSingleWordOperand(0); - }; - auto accept_type_forward_pointer_ops = [](const opt::Instruction& inst) { - return inst.opcode() == SpvOpTypeForwardPointer; - }; - - PoolPotentialIds(src_->types_values(), potential_id_map.src_ids, true, - accept_type_forward_pointer_ops, get_pointer_type_id); - PoolPotentialIds(dst_->types_values(), potential_id_map.dst_ids, false, - accept_type_forward_pointer_ops, get_pointer_type_id); - - // Matching types with cyclical references (i.e. in the style of linked lists) - // can get very complex. Currently, the diff tool matches types bottom up, so - // on every instruction it expects to know if its operands are already matched - // or not. With cyclical references, it cannot know that. Type matching may - // need significant modifications to be able to support this use case. - // - // Currently, forwarded types are only matched by storage class and debug - // info, with minimal matching of the type being forwarded: - // - // - Group by class - // - Group by OpType being pointed to - // - Group by debug info - // - If same name and unique, match - // - If leftover is unique, match - - // Group forwarded pointers by storage class first and loop over them. - GroupIdsAndMatch( - potential_id_map.src_ids, potential_id_map.dst_ids, SpvStorageClassMax, - &Differ::GroupIdsHelperGetTypePointerStorageClass, - [this](const IdGroup& src_group_by_storage_class, - const IdGroup& dst_group_by_storage_class) { - - // Group them further by the type they are pointing to and loop over - // them. - GroupIdsAndMatch( - src_group_by_storage_class, dst_group_by_storage_class, SpvOpMax, - &Differ::GroupIdsHelperGetTypePointerTypeOp, - [this](const IdGroup& src_group_by_type_op, - const IdGroup& dst_group_by_type_op) { - - // Group them even further by debug info, if possible and match by - // debug name. - MatchTypeForwardPointersByName(src_group_by_type_op, - dst_group_by_type_op); - - // Match the leftovers only if they lack debug info and there is - // only one instance of them. - MatchTypeForwardPointersByTypeOp(src_group_by_type_op, - dst_group_by_type_op); - }); - }); - - // Match the instructions that forward declare the same type themselves - for (uint32_t src_id : potential_id_map.src_ids) { - uint32_t dst_id = id_map_.MappedDstId(src_id); - if (dst_id == 0) continue; - - const opt::Instruction* src_forward_inst = - GetForwardPointerInst(src_id_to_, src_id); - const opt::Instruction* dst_forward_inst = - GetForwardPointerInst(dst_id_to_, dst_id); - - assert(src_forward_inst); - assert(dst_forward_inst); - - id_map_.MapInsts(src_forward_inst, dst_forward_inst); - } -} - -void Differ::MatchTypeIds() { - // Bunch all of type ids as potential matches. - PotentialIdMap potential_id_map; - auto get_result_id = [](const opt::Instruction& inst) { - return inst.result_id(); - }; - auto accept_type_ops = [](const opt::Instruction& inst) { - return spvOpcodeGeneratesType(inst.opcode()); - }; - - PoolPotentialIds(src_->types_values(), potential_id_map.src_ids, true, - accept_type_ops, get_result_id); - PoolPotentialIds(dst_->types_values(), potential_id_map.dst_ids, false, - accept_type_ops, get_result_id); - - // Then match the ids. Start with exact matches, then match the leftover with - // gradually loosening degrees of strictness. For example, in the absence of - // debug info, two block types will be matched if they differ only in a few of - // the fields. - for (uint32_t flexibility = 0; flexibility < 2; ++flexibility) { - MatchIds(potential_id_map, [this, flexibility]( - const opt::Instruction* src_inst, - const opt::Instruction* dst_inst) { - const SpvOp src_op = src_inst->opcode(); - const SpvOp dst_op = dst_inst->opcode(); - - // Don't match if the opcode is not the same. - if (src_op != dst_op) { - return false; - } - - switch (src_op) { - case SpvOpTypeVoid: - case SpvOpTypeBool: - case SpvOpTypeSampler: - // void, bool and sampler are unique, match them. - return true; - case SpvOpTypeInt: - case SpvOpTypeFloat: - case SpvOpTypeVector: - case SpvOpTypeMatrix: - case SpvOpTypeSampledImage: - case SpvOpTypeRuntimeArray: - case SpvOpTypePointer: - // Match these instructions when all operands match. - assert(src_inst->NumInOperandWords() == - dst_inst->NumInOperandWords()); - return DoOperandsMatch(src_inst, dst_inst, 0, - src_inst->NumInOperandWords()); - - case SpvOpTypeFunction: - case SpvOpTypeImage: - // Match function types only if they have the same number of operands, - // and they all match. - // Match image types similarly, expecting the optional final parameter - // to match (if provided in both) - if (src_inst->NumInOperandWords() != dst_inst->NumInOperandWords()) { - return false; - } - return DoOperandsMatch(src_inst, dst_inst, 0, - src_inst->NumInOperandWords()); - - case SpvOpTypeArray: - // Match arrays only if the element type and length match. The length - // is an id of a constant, so the actual constant it's defining is - // compared instead. - if (!DoOperandsMatch(src_inst, dst_inst, 0, 1)) { - return false; - } - - if (AreIdenticalUintConstants(src_inst->GetSingleWordInOperand(1), - dst_inst->GetSingleWordInOperand(1))) { - return true; - } - - // If size is not OpConstant, expect the ids to match exactly (for - // example if a spec contant is used). - return DoOperandsMatch(src_inst, dst_inst, 1, 1); - - case SpvOpTypeStruct: - return MatchOpTypeStruct(src_inst, dst_inst, flexibility); - - default: - return false; - } - }); - } -} - -void Differ::MatchConstants() { - // Bunch all of constant ids as potential matches. - PotentialIdMap potential_id_map; - auto get_result_id = [](const opt::Instruction& inst) { - return inst.result_id(); - }; - auto accept_type_ops = [](const opt::Instruction& inst) { - return spvOpcodeIsConstant(inst.opcode()); - }; - - PoolPotentialIds(src_->types_values(), potential_id_map.src_ids, true, - accept_type_ops, get_result_id); - PoolPotentialIds(dst_->types_values(), potential_id_map.dst_ids, false, - accept_type_ops, get_result_id); - - // Then match the ids. Constants are matched exactly, except for float types - // that are first matched exactly, then leftovers are matched with a small - // error. - for (uint32_t flexibility = 0; flexibility < 2; ++flexibility) { - MatchIds(potential_id_map, [this, flexibility]( - const opt::Instruction* src_inst, - const opt::Instruction* dst_inst) { - const SpvOp src_op = src_inst->opcode(); - const SpvOp dst_op = dst_inst->opcode(); - - // Don't match if the opcode is not the same. - if (src_op != dst_op) { - return false; - } - - switch (src_op) { - case SpvOpConstantTrue: - case SpvOpConstantFalse: - // true and false are unique, match them. - return true; - case SpvOpConstant: - return MatchOpConstant(src_inst, dst_inst, flexibility); - case SpvOpConstantComposite: - case SpvOpSpecConstantComposite: - // Composite constants must match in type and value. - // - // TODO: match OpConstantNull with OpConstantComposite with all zeros - // at flexibility == 1 - // TODO: match constants from structs that have been flexibly-matched. - if (src_inst->NumInOperandWords() != dst_inst->NumInOperandWords()) { - return false; - } - return DoesOperandMatch(src_inst->GetOperand(0), - dst_inst->GetOperand(0)) && - DoOperandsMatch(src_inst, dst_inst, 0, - src_inst->NumInOperandWords()); - case SpvOpConstantSampler: - // Match sampler constants exactly. - // TODO: Allow flexibility in parameters to better diff shaders where - // the sampler param has changed. - assert(src_inst->NumInOperandWords() == - dst_inst->NumInOperandWords()); - return DoOperandsMatch(src_inst, dst_inst, 0, - src_inst->NumInOperandWords()); - case SpvOpConstantNull: - // Match null constants as long as the type matches. - return DoesOperandMatch(src_inst->GetOperand(0), - dst_inst->GetOperand(0)); - - case SpvOpSpecConstantTrue: - case SpvOpSpecConstantFalse: - case SpvOpSpecConstant: - case SpvOpSpecConstantOp: - // Match spec constants by name if available, then by the SpecId - // decoration. - return MatchOpSpecConstant(src_inst, dst_inst); - - default: - return false; - } - }); - } -} - -void Differ::MatchVariableIds() { - // Bunch all of variable ids as potential matches. - PotentialIdMap potential_id_map; - auto get_result_id = [](const opt::Instruction& inst) { - return inst.result_id(); - }; - auto accept_type_ops = [](const opt::Instruction& inst) { - return inst.opcode() == SpvOpVariable; - }; - - PoolPotentialIds(src_->types_values(), potential_id_map.src_ids, true, - accept_type_ops, get_result_id); - PoolPotentialIds(dst_->types_values(), potential_id_map.dst_ids, false, - accept_type_ops, get_result_id); - - // Then match the ids. Start with exact matches, then match the leftover with - // gradually loosening degrees of strictness. For example, in the absence of - // debug info, two otherwise identical variables will be matched if one of - // them has a Private storage class and the other doesn't. - for (uint32_t flexibility = 0; flexibility < 2; ++flexibility) { - MatchIds(potential_id_map, - [this, flexibility](const opt::Instruction* src_inst, - const opt::Instruction* dst_inst) { - assert(src_inst->opcode() == SpvOpVariable); - assert(dst_inst->opcode() == SpvOpVariable); - - return MatchOpVariable(src_inst, dst_inst, flexibility); - }); - } -} - -void Differ::MatchFunctions() { - IdGroup src_func_ids; - IdGroup dst_func_ids; - - for (const auto& func : src_funcs_) { - src_func_ids.push_back(func.first); - } - for (const auto& func : dst_funcs_) { - dst_func_ids.push_back(func.first); - } - - // Base the matching of functions on debug info when available. - GroupIdsAndMatch( - src_func_ids, dst_func_ids, "", &Differ::GetSanitizedName, - [this](const IdGroup& src_group, const IdGroup& dst_group) { - - // If there is a single function with this name in src and dst, it's a - // definite match. - if (src_group.size() == 1 && dst_group.size() == 1) { - id_map_.MapIds(src_group[0], dst_group[0]); - return; - } - - // If there are multiple functions with the same name, group them by - // type, and match only if the types match (and are unique). - GroupIdsAndMatch(src_group, dst_group, 0, - &Differ::GroupIdsHelperGetTypeId, - [this](const IdGroup& src_group_by_type_id, - const IdGroup& dst_group_by_type_id) { - - if (src_group_by_type_id.size() == 1 && - dst_group_by_type_id.size() == 1) { - id_map_.MapIds(src_group_by_type_id[0], - dst_group_by_type_id[0]); - } - }); - }); - - // Any functions that are left are pooled together and matched as if unnamed, - // with the only exception that two functions with mismatching names are not - // matched. - // - // Before that however, the diff of the functions that are matched are taken - // and processed, so that more of the global variables can be matched before - // attempting to match the rest of the functions. They can contribute to the - // precision of the diff of those functions. - for (const uint32_t src_func_id : src_func_ids) { - const uint32_t dst_func_id = id_map_.MappedDstId(src_func_id); - if (dst_func_id == 0) { - continue; - } - - // Since these functions are definite matches, match their parameters for a - // better diff. - MatchFunctionParamIds(src_funcs_[src_func_id], dst_funcs_[dst_func_id]); - - // Take the diff of the two functions. - DiffMatch src_match_result, dst_match_result; - MatchFunctionBodies(src_func_insts_[src_func_id], - dst_func_insts_[dst_func_id], &src_match_result, - &dst_match_result); - - // Match ids between the two function bodies; which can also result in - // global variables getting matched. - MatchIdsInFunctionBodies(src_func_insts_[src_func_id], - dst_func_insts_[dst_func_id], src_match_result, - dst_match_result, 0); - } - - // Best effort match functions with matching type. - GroupIdsAndMatch( - src_func_ids, dst_func_ids, 0, &Differ::GroupIdsHelperGetTypeId, - [this](const IdGroup& src_group_by_type_id, - const IdGroup& dst_group_by_type_id) { - - BestEffortMatchFunctions(src_group_by_type_id, dst_group_by_type_id, - src_func_insts_, dst_func_insts_); - }); - - // Any function that's left, best effort match them. - BestEffortMatchFunctions(src_func_ids, dst_func_ids, src_func_insts_, - dst_func_insts_); -} - -void Differ::MatchDebugs1() { - // This section in cludes: OpString, OpSourceExtension, OpSource, - // OpSourceContinued - MatchDebugAndAnnotationInstructions(src_->debugs1(), dst_->debugs1()); -} - -void Differ::MatchDebugs2() { - // This section includes: OpName, OpMemberName - MatchDebugAndAnnotationInstructions(src_->debugs2(), dst_->debugs2()); -} - -void Differ::MatchDebugs3() { - // This section includes: OpModuleProcessed - MatchDebugAndAnnotationInstructions(src_->debugs3(), dst_->debugs3()); -} - -void Differ::MatchExtInstDebugInfo() { - // This section includes OpExtInst for DebugInfo extension - MatchDebugAndAnnotationInstructions(src_->ext_inst_debuginfo(), - dst_->ext_inst_debuginfo()); -} - -void Differ::MatchAnnotations() { - // This section includes OpDecorate and family. - MatchDebugAndAnnotationInstructions(src_->annotations(), dst_->annotations()); -} - -const opt::Instruction* Differ::MappedDstInst( - const opt::Instruction* src_inst) { - return MappedInstImpl(src_inst, id_map_.SrcToDstMap(), dst_id_to_); -} - -const opt::Instruction* Differ::MappedSrcInst( - const opt::Instruction* dst_inst) { - return MappedInstImpl(dst_inst, id_map_.DstToSrcMap(), src_id_to_); -} - -const opt::Instruction* Differ::MappedInstImpl( - const opt::Instruction* inst, const IdMap& to_other, - const IdInstructions& other_id_to) { - if (inst->HasResultId()) { - if (to_other.IsMapped(inst->result_id())) { - const uint32_t other_result_id = to_other.MappedId(inst->result_id()); - - assert(other_result_id < other_id_to.inst_map_.size()); - return other_id_to.inst_map_[other_result_id]; - } - - return nullptr; - } - - return to_other.MappedInst(inst); -} - -void Differ::OutputLine(std::function are_lines_identical, - std::function output_src_line, - std::function output_dst_line) { - if (are_lines_identical()) { - out_ << " "; - output_src_line(); - } else { - OutputRed(); - out_ << "-"; - output_src_line(); - - OutputGreen(); - out_ << "+"; - output_dst_line(); - - OutputResetColor(); - } -} - -const opt::Instruction* IterInst(opt::Module::const_inst_iterator& iter) { - return &*iter; -} - -const opt::Instruction* IterInst(InstructionList::const_iterator& iter) { - return *iter; -} - -template -void Differ::OutputSection( - const InstList& src_insts, const InstList& dst_insts, - std::function - write_inst) { - auto src_iter = src_insts.begin(); - auto dst_iter = dst_insts.begin(); - - // - While src_inst doesn't have a match, output it with - - // - While dst_inst doesn't have a match, output it with + - // - Now src_inst and dst_inst both have matches; might not match each other! - // * If section is unordered, just process src_inst and its match (dst_inst - // or not), - // dst_inst will eventually be processed when its match is seen. - // * If section is ordered, also just process src_inst and its match. Its - // match must - // necessarily be dst_inst. - while (src_iter != src_insts.end() || dst_iter != dst_insts.end()) { - OutputRed(); - while (src_iter != src_insts.end() && - MappedDstInst(IterInst(src_iter)) == nullptr) { - out_ << "-"; - write_inst(*IterInst(src_iter), src_id_to_, *IterInst(src_iter)); - ++src_iter; - } - OutputGreen(); - while (dst_iter != dst_insts.end() && - MappedSrcInst(IterInst(dst_iter)) == nullptr) { - out_ << "+"; - write_inst(ToMappedSrcIds(*IterInst(dst_iter)), dst_id_to_, - *IterInst(dst_iter)); - ++dst_iter; - } - OutputResetColor(); - - if (src_iter != src_insts.end() && dst_iter != dst_insts.end()) { - const opt::Instruction* src_inst = IterInst(src_iter); - const opt::Instruction* matched_dst_inst = MappedDstInst(src_inst); - - assert(matched_dst_inst != nullptr); - assert(MappedSrcInst(IterInst(dst_iter)) != nullptr); - - OutputLine( - [this, src_inst, matched_dst_inst]() { - return DoInstructionsMatch(src_inst, matched_dst_inst); - }, - [this, src_inst, &write_inst]() { - write_inst(*src_inst, src_id_to_, *src_inst); - }, - [this, matched_dst_inst, &write_inst]() { - write_inst(ToMappedSrcIds(*matched_dst_inst), dst_id_to_, - *matched_dst_inst); - }); - - ++src_iter; - ++dst_iter; - } - } -} - -void Differ::ToParsedInstruction( - const opt::Instruction& inst, const IdInstructions& id_to, - const opt::Instruction& original_inst, - spv_parsed_instruction_t* parsed_inst, - std::vector& parsed_operands, - std::vector& inst_binary) { - inst.ToBinaryWithoutAttachedDebugInsts(&inst_binary); - parsed_operands.resize(inst.NumOperands()); - - parsed_inst->words = inst_binary.data(); - parsed_inst->num_words = static_cast(inst_binary.size()); - parsed_inst->opcode = static_cast(inst.opcode()); - parsed_inst->ext_inst_type = - inst.opcode() == SpvOpExtInst - ? GetExtInstType(id_to, original_inst.GetSingleWordInOperand(0)) - : SPV_EXT_INST_TYPE_NONE; - parsed_inst->type_id = - inst.HasResultType() ? inst.GetSingleWordOperand(0) : 0; - parsed_inst->result_id = inst.HasResultId() ? inst.result_id() : 0; - parsed_inst->operands = parsed_operands.data(); - parsed_inst->num_operands = static_cast(parsed_operands.size()); - - // Word 0 is always op and num_words, so operands start at offset 1. - uint32_t offset = 1; - for (uint16_t operand_index = 0; operand_index < parsed_inst->num_operands; - ++operand_index) { - const opt::Operand& operand = inst.GetOperand(operand_index); - spv_parsed_operand_t& parsed_operand = parsed_operands[operand_index]; - - parsed_operand.offset = static_cast(offset); - parsed_operand.num_words = static_cast(operand.words.size()); - parsed_operand.type = operand.type; - parsed_operand.number_kind = GetNumberKind( - id_to, original_inst, operand_index, &parsed_operand.number_bit_width); - - offset += parsed_operand.num_words; - } -} - -opt::Instruction Differ::ToMappedSrcIds(const opt::Instruction& dst_inst) { - // Create an identical instruction to dst_inst, except ids are changed to the - // mapped one. - opt::Instruction mapped_inst = dst_inst; - - for (uint32_t operand_index = 0; operand_index < mapped_inst.NumOperands(); - ++operand_index) { - opt::Operand& operand = mapped_inst.GetOperand(operand_index); - - if (spvIsIdType(operand.type)) { - assert(id_map_.IsDstMapped(operand.AsId())); - operand.words[0] = id_map_.MappedSrcId(operand.AsId()); - } - } - - return mapped_inst; -} - -spv_result_t Differ::Output() { - id_map_.MapUnmatchedIds(); - src_id_to_.inst_map_.resize(id_map_.SrcToDstMap().IdBound(), nullptr); - dst_id_to_.inst_map_.resize(id_map_.DstToSrcMap().IdBound(), nullptr); - - const spv_target_env target_env = SPV_ENV_UNIVERSAL_1_6; - spv_opcode_table opcode_table; - spv_operand_table operand_table; - spv_ext_inst_table ext_inst_table; - spv_result_t result; - - result = spvOpcodeTableGet(&opcode_table, target_env); - if (result != SPV_SUCCESS) return result; - - result = spvOperandTableGet(&operand_table, target_env); - if (result != SPV_SUCCESS) return result; - - result = spvExtInstTableGet(&ext_inst_table, target_env); - if (result != SPV_SUCCESS) return result; - - spv_context_t context{ - target_env, - opcode_table, - operand_table, - ext_inst_table, - }; - - const AssemblyGrammar grammar(&context); - if (!grammar.isValid()) return SPV_ERROR_INVALID_TABLE; - - uint32_t disassembly_options = SPV_BINARY_TO_TEXT_OPTION_PRINT; - if (options_.indent) { - disassembly_options |= SPV_BINARY_TO_TEXT_OPTION_INDENT; - } - - NameMapper name_mapper = GetTrivialNameMapper(); - disassemble::InstructionDisassembler dis(grammar, out_, disassembly_options, - name_mapper); - - if (!options_.no_header) { - // Output the header - // TODO: when using diff with text, the assembler overrides the version and - // generator, so these aren't reflected correctly in the output. Could - // potentially extract this info from the header comment. - OutputLine([]() { return true; }, [&dis]() { dis.EmitHeaderSpirv(); }, - []() { assert(false && "Unreachable"); }); - OutputLine([this]() { return src_->version() == dst_->version(); }, - [this, &dis]() { dis.EmitHeaderVersion(src_->version()); }, - [this, &dis]() { dis.EmitHeaderVersion(dst_->version()); }); - OutputLine([this]() { return src_->generator() == dst_->generator(); }, - [this, &dis]() { dis.EmitHeaderGenerator(src_->generator()); }, - [this, &dis]() { dis.EmitHeaderGenerator(dst_->generator()); }); - OutputLine( - [this]() { return src_->IdBound() == id_map_.SrcToDstMap().IdBound(); }, - [this, &dis]() { dis.EmitHeaderIdBound(src_->IdBound()); }, - [this, &dis]() { - dis.EmitHeaderIdBound(id_map_.SrcToDstMap().IdBound()); - }); - OutputLine([this]() { return src_->schema() == dst_->schema(); }, - [this, &dis]() { dis.EmitHeaderSchema(src_->schema()); }, - [this, &dis]() { dis.EmitHeaderSchema(dst_->schema()); }); - } - - // For each section, iterate both modules and output the disassembly. - auto write_inst = [this, &dis](const opt::Instruction& inst, - const IdInstructions& id_to, - const opt::Instruction& original_inst) { - spv_parsed_instruction_t parsed_inst; - std::vector parsed_operands; - std::vector inst_binary; - - ToParsedInstruction(inst, id_to, original_inst, &parsed_inst, - parsed_operands, inst_binary); - - dis.EmitInstruction(parsed_inst, 0); - }; - - OutputSection(src_->capabilities(), dst_->capabilities(), write_inst); - OutputSection(src_->extensions(), dst_->extensions(), write_inst); - OutputSection(src_->ext_inst_imports(), dst_->ext_inst_imports(), write_inst); - - // There is only one memory model. - OutputLine( - [this]() { - return DoInstructionsMatch(src_->GetMemoryModel(), - dst_->GetMemoryModel()); - }, - [this, &write_inst]() { - write_inst(*src_->GetMemoryModel(), src_id_to_, - *src_->GetMemoryModel()); - }, - [this, &write_inst]() { - write_inst(*dst_->GetMemoryModel(), dst_id_to_, - *dst_->GetMemoryModel()); - }); - - OutputSection(src_->entry_points(), dst_->entry_points(), write_inst); - OutputSection(src_->execution_modes(), dst_->execution_modes(), write_inst); - OutputSection(src_->debugs1(), dst_->debugs1(), write_inst); - OutputSection(src_->debugs2(), dst_->debugs2(), write_inst); - OutputSection(src_->debugs3(), dst_->debugs3(), write_inst); - OutputSection(src_->ext_inst_debuginfo(), dst_->ext_inst_debuginfo(), - write_inst); - OutputSection(src_->annotations(), dst_->annotations(), write_inst); - OutputSection(src_->types_values(), dst_->types_values(), write_inst); - - // Get the body of all the functions. - FunctionInstMap src_func_header_insts; - FunctionInstMap dst_func_header_insts; - - GetFunctionHeaderInstructions(src_, &src_func_header_insts); - GetFunctionHeaderInstructions(dst_, &dst_func_header_insts); - - for (const auto& src_func : src_func_insts_) { - const uint32_t src_func_id = src_func.first; - const InstructionList& src_insts = src_func.second; - const InstructionList& src_header_insts = - src_func_header_insts[src_func_id]; - - const uint32_t dst_func_id = id_map_.MappedDstId(src_func_id); - if (dst_func_insts_.find(dst_func_id) == dst_func_insts_.end()) { - OutputSection(src_header_insts, InstructionList(), write_inst); - OutputSection(src_insts, InstructionList(), write_inst); - continue; - } - - const InstructionList& dst_insts = dst_func_insts_[dst_func_id]; - const InstructionList& dst_header_insts = - dst_func_header_insts[dst_func_id]; - OutputSection(src_header_insts, dst_header_insts, write_inst); - OutputSection(src_insts, dst_insts, write_inst); - } - - for (const auto& dst_func : dst_func_insts_) { - const uint32_t dst_func_id = dst_func.first; - const InstructionList& dst_insts = dst_func.second; - const InstructionList& dst_header_insts = - dst_func_header_insts[dst_func_id]; - - const uint32_t src_func_id = id_map_.MappedSrcId(dst_func_id); - if (src_func_insts_.find(src_func_id) == src_func_insts_.end()) { - OutputSection(InstructionList(), dst_header_insts, write_inst); - OutputSection(InstructionList(), dst_insts, write_inst); - } - } - - out_ << std::flush; - - return SPV_SUCCESS; -} - -} // anonymous namespace - -spv_result_t Diff(opt::IRContext* src, opt::IRContext* dst, std::ostream& out, - Options options) { - // High level algorithm: - // - // - Some sections of SPIR-V don't deal with ids; instructions in those - // sections are matched identically. For example OpCapability instructions. - // - Some sections produce ids, and they can be trivially matched by their - // parameters. For example OpExtInstImport instructions. - // - Some sections annotate ids. These are matched at the end, after the ids - // themselves are matched. For example OpName or OpDecorate instructions. - // - Some sections produce ids that depend on other ids and they can be - // recursively matched. For example OpType* instructions. - // - Some sections produce ids that are not trivially matched. For these ids, - // the debug info is used when possible, or a best guess (such as through - // decorations) is used. For example OpVariable instructions. - // - Matching functions is done with multiple attempts: - // * Functions with identical debug names are matched if there are no - // overloads. - // * Otherwise, functions with identical debug names and types are matched. - // * The rest of the functions are best-effort matched, first in groups of - // identical type, then any with any. - // * The best-effort matching takes the diff of every pair of functions in - // a group and selects the top matches that also meet a similarity - // index. - // * Once a pair of functions are matched, the fuzzy diff of the - // instructions is used to match the instructions in the function body. - // The fuzzy diff makes sure that sufficiently similar instructions are - // matched and that yet-to-be-matched result ids don't result in a larger - // diff. - // - // Once the instructions are matched between the src and dst SPIR-V, the src - // is traversed and its disassembly is output. In the process, any unmatched - // instruction is prefixed with -, and any unmatched instruction in dst in the - // same section is output prefixed with +. To avoid confusion, the - // instructions in dst are output with matching ids in src so the output - // assembly is consistent. - - Differ differ(src, dst, out, options); - - // First, match instructions between the different non-annotation sections of - // the SPIR-V. - differ.MatchCapabilities(); - differ.MatchExtensions(); - differ.MatchExtInstImportIds(); - differ.MatchMemoryModel(); - differ.MatchEntryPointIds(); - differ.MatchExecutionModes(); - differ.MatchTypeForwardPointers(); - differ.MatchTypeIds(); - differ.MatchConstants(); - differ.MatchVariableIds(); - differ.MatchFunctions(); - - // Match instructions that annotate previously-matched ids. - differ.MatchDebugs1(); - differ.MatchDebugs2(); - differ.MatchDebugs3(); - differ.MatchExtInstDebugInfo(); - differ.MatchAnnotations(); - - // Show the disassembly with the diff. - // - // TODO: Based on an option, output either based on src or dst, i.e. the diff - // can show the ids and instruction/function order either from src or dst. - spv_result_t result = differ.Output(); - - differ.DumpIdMap(); - - return result; -} - -} // namespace diff -} // namespace spvtools diff --git a/source/diff/diff.h b/source/diff/diff.h deleted file mode 100644 index 932de9ee..00000000 --- a/source/diff/diff.h +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SOURCE_DIFF_DIFF_H_ -#define SOURCE_DIFF_DIFF_H_ - -#include "source/opt/ir_context.h" - -namespace spvtools { -namespace diff { - -struct Options { - bool ignore_set_binding = false; - bool ignore_location = false; - bool indent = false; - bool no_header = false; - bool color_output = false; - bool dump_id_map = false; -}; - -// Given two SPIR-V modules, this function outputs the textual diff of their -// assembly in `out`. The diff is *semantic*, so that the ordering of certain -// instructions wouldn't matter. -// -// The output is a disassembly of src, with diff(1)-style + and - lines that -// show how the src is changed into dst. To make this disassembly -// self-consistent, the ids that are output are all in the space of the src -// module; e.g. any + lines (showing instructions from the dst module) have -// their ids mapped to the matched instruction in the src module (or a new id -// allocated in the src module if unmatched). -spv_result_t Diff(opt::IRContext* src, opt::IRContext* dst, std::ostream& out, - Options options); - -} // namespace diff -} // namespace spvtools - -#endif // SOURCE_DIFF_DIFF_H_ diff --git a/source/diff/lcs.h b/source/diff/lcs.h deleted file mode 100644 index 6c00e864..00000000 --- a/source/diff/lcs.h +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SOURCE_DIFF_LCS_H_ -#define SOURCE_DIFF_LCS_H_ - -#include -#include -#include -#include -#include -#include -#include - -namespace spvtools { -namespace diff { - -// The result of a diff. -using DiffMatch = std::vector; - -// Helper class to find the longest common subsequence between two function -// bodies. -template -class LongestCommonSubsequence { - public: - LongestCommonSubsequence(const Sequence& src, const Sequence& dst) - : src_(src), - dst_(dst), - table_(src.size(), std::vector(dst.size())) {} - - // Given two sequences, it creates a matching between them. The elements are - // simply marked as matched in src and dst, with any unmatched element in src - // implying a removal and any unmatched element in dst implying an addition. - // - // Returns the length of the longest common subsequence. - template - uint32_t Get(std::function match, - DiffMatch* src_match_result, DiffMatch* dst_match_result); - - private: - struct DiffMatchIndex { - uint32_t src_offset; - uint32_t dst_offset; - }; - - template - void CalculateLCS(std::function match); - void RetrieveMatch(DiffMatch* src_match_result, DiffMatch* dst_match_result); - bool IsInBound(DiffMatchIndex index) { - return index.src_offset < src_.size() && index.dst_offset < dst_.size(); - } - bool IsCalculated(DiffMatchIndex index) { - assert(IsInBound(index)); - return table_[index.src_offset][index.dst_offset].valid; - } - bool IsCalculatedOrOutOfBound(DiffMatchIndex index) { - return !IsInBound(index) || IsCalculated(index); - } - uint32_t GetMemoizedLength(DiffMatchIndex index) { - if (!IsInBound(index)) { - return 0; - } - assert(IsCalculated(index)); - return table_[index.src_offset][index.dst_offset].best_match_length; - } - bool IsMatched(DiffMatchIndex index) { - assert(IsCalculated(index)); - return table_[index.src_offset][index.dst_offset].matched; - } - void MarkMatched(DiffMatchIndex index, uint32_t best_match_length, - bool matched) { - assert(IsInBound(index)); - DiffMatchEntry& entry = table_[index.src_offset][index.dst_offset]; - assert(!entry.valid); - - entry.best_match_length = best_match_length & 0x3FFFFFFF; - assert(entry.best_match_length == best_match_length); - entry.matched = matched; - entry.valid = true; - } - - const Sequence& src_; - const Sequence& dst_; - - struct DiffMatchEntry { - DiffMatchEntry() : best_match_length(0), matched(false), valid(false) {} - - uint32_t best_match_length : 30; - // Whether src[i] and dst[j] matched. This is an optimization to avoid - // calling the `match` function again when walking the LCS table. - uint32_t matched : 1; - // Use for the recursive algorithm to know if the contents of this entry are - // valid. - uint32_t valid : 1; - }; - - std::vector> table_; -}; - -template -template -uint32_t LongestCommonSubsequence::Get( - std::function match, - DiffMatch* src_match_result, DiffMatch* dst_match_result) { - CalculateLCS(match); - RetrieveMatch(src_match_result, dst_match_result); - return GetMemoizedLength({0, 0}); -} - -template -template -void LongestCommonSubsequence::CalculateLCS( - std::function match) { - // The LCS algorithm is simple. Given sequences s and d, with a:b depicting a - // range in python syntax: - // - // lcs(s[i:], d[j:]) = - // lcs(s[i+1:], d[j+1:]) + 1 if s[i] == d[j] - // max(lcs(s[i+1:], d[j:]), lcs(s[i:], d[j+1:])) o.w. - // - // Once the LCS table is filled according to the above, it can be walked and - // the best match retrieved. - // - // This is a recursive function with memoization, which avoids filling table - // entries where unnecessary. This makes the best case O(N) instead of - // O(N^2). The implemention uses a std::stack to avoid stack overflow on long - // sequences. - - if (src_.empty() || dst_.empty()) { - return; - } - - std::stack to_calculate; - to_calculate.push({0, 0}); - - while (!to_calculate.empty()) { - DiffMatchIndex current = to_calculate.top(); - to_calculate.pop(); - assert(IsInBound(current)); - - // If already calculated through another path, ignore it. - if (IsCalculated(current)) { - continue; - } - - if (match(src_[current.src_offset], dst_[current.dst_offset])) { - // If the current elements match, advance both indices and calculate the - // LCS if not already. Visit `current` again afterwards, so its - // corresponding entry will be updated. - DiffMatchIndex next = {current.src_offset + 1, current.dst_offset + 1}; - if (IsCalculatedOrOutOfBound(next)) { - MarkMatched(current, GetMemoizedLength(next) + 1, true); - } else { - to_calculate.push(current); - to_calculate.push(next); - } - continue; - } - - // We've reached a pair of elements that don't match. Calculate the LCS for - // both cases of either being left unmatched and take the max. Visit - // `current` again afterwards, so its corresponding entry will be updated. - DiffMatchIndex next_src = {current.src_offset + 1, current.dst_offset}; - DiffMatchIndex next_dst = {current.src_offset, current.dst_offset + 1}; - - if (IsCalculatedOrOutOfBound(next_src) && - IsCalculatedOrOutOfBound(next_dst)) { - uint32_t best_match_length = - std::max(GetMemoizedLength(next_src), GetMemoizedLength(next_dst)); - MarkMatched(current, best_match_length, false); - continue; - } - - to_calculate.push(current); - if (!IsCalculatedOrOutOfBound(next_src)) { - to_calculate.push(next_src); - } - if (!IsCalculatedOrOutOfBound(next_dst)) { - to_calculate.push(next_dst); - } - } -} - -template -void LongestCommonSubsequence::RetrieveMatch( - DiffMatch* src_match_result, DiffMatch* dst_match_result) { - src_match_result->clear(); - dst_match_result->clear(); - - src_match_result->resize(src_.size(), false); - dst_match_result->resize(dst_.size(), false); - - DiffMatchIndex current = {0, 0}; - while (IsInBound(current)) { - if (IsMatched(current)) { - (*src_match_result)[current.src_offset++] = true; - (*dst_match_result)[current.dst_offset++] = true; - continue; - } - - if (GetMemoizedLength({current.src_offset + 1, current.dst_offset}) >= - GetMemoizedLength({current.src_offset, current.dst_offset + 1})) { - ++current.src_offset; - } else { - ++current.dst_offset; - } - } -} - -} // namespace diff -} // namespace spvtools - -#endif // SOURCE_DIFF_LCS_H_ diff --git a/source/disassemble.cpp b/source/disassemble.cpp index c553988f..966a59c7 100644 --- a/source/disassemble.cpp +++ b/source/disassemble.cpp @@ -328,9 +328,7 @@ void Disassembler::EmitOperand(const spv_parsed_instruction_t& inst, case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_OPERATION: case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_IMPORTED_ENTITY: case SPV_OPERAND_TYPE_FPDENORM_MODE: - case SPV_OPERAND_TYPE_FPOPERATION_MODE: - case SPV_OPERAND_TYPE_QUANTIZATION_MODES: - case SPV_OPERAND_TYPE_OVERFLOW_MODES: { + case SPV_OPERAND_TYPE_FPOPERATION_MODE: { spv_operand_desc entry; if (grammar_.lookupOperand(operand.type, word, &entry)) assert(false && "should have caught this earlier"); @@ -347,17 +345,7 @@ void Disassembler::EmitOperand(const spv_parsed_instruction_t& inst, EmitMaskOperand(operand.type, word); break; default: - if (spvOperandIsConcreteMask(operand.type)) { - EmitMaskOperand(operand.type, word); - } else if (spvOperandIsConcrete(operand.type)) { - spv_operand_desc entry; - if (grammar_.lookupOperand(operand.type, word, &entry)) - assert(false && "should have caught this earlier"); - stream_ << entry->name; - } else { - assert(false && "unhandled or invalid case"); - } - break; + assert(false && "unhandled or invalid case"); } ResetColor(); } diff --git a/source/ext_inst.cpp b/source/ext_inst.cpp index 8246c204..795cb0f3 100644 --- a/source/ext_inst.cpp +++ b/source/ext_inst.cpp @@ -29,7 +29,6 @@ #include "debuginfo.insts.inc" #include "glsl.std.450.insts.inc" #include "nonsemantic.clspvreflection.insts.inc" -#include "nonsemantic.vulkan.debuginfo.100.insts.inc" #include "opencl.debuginfo.100.insts.inc" #include "opencl.std.insts.inc" @@ -56,9 +55,6 @@ static const spv_ext_inst_group_t kGroups_1_0[] = { debuginfo_entries}, {SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100, ARRAY_SIZE(opencl_debuginfo_100_entries), opencl_debuginfo_100_entries}, - {SPV_EXT_INST_TYPE_NONSEMANTIC_VULKAN_DEBUGINFO_100, - ARRAY_SIZE(nonsemantic_vulkan_debuginfo_100_entries), - nonsemantic_vulkan_debuginfo_100_entries}, {SPV_EXT_INST_TYPE_NONSEMANTIC_CLSPVREFLECTION, ARRAY_SIZE(nonsemantic_clspvreflection_entries), nonsemantic_clspvreflection_entries}, @@ -130,9 +126,6 @@ spv_ext_inst_type_t spvExtInstImportTypeGet(const char* name) { if (!strcmp("OpenCL.DebugInfo.100", name)) { return SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100; } - if (!strcmp("NonSemantic.Vulkan.DebugInfo.100", name)) { - return SPV_EXT_INST_TYPE_NONSEMANTIC_VULKAN_DEBUGINFO_100; - } if (!strncmp("NonSemantic.ClspvReflection.", name, 28)) { return SPV_EXT_INST_TYPE_NONSEMANTIC_CLSPVREFLECTION; } @@ -146,7 +139,6 @@ spv_ext_inst_type_t spvExtInstImportTypeGet(const char* name) { bool spvExtInstIsNonSemantic(const spv_ext_inst_type_t type) { if (type == SPV_EXT_INST_TYPE_NONSEMANTIC_UNKNOWN || - type == SPV_EXT_INST_TYPE_NONSEMANTIC_VULKAN_DEBUGINFO_100 || type == SPV_EXT_INST_TYPE_NONSEMANTIC_CLSPVREFLECTION) { return true; } @@ -155,7 +147,6 @@ bool spvExtInstIsNonSemantic(const spv_ext_inst_type_t type) { bool spvExtInstIsDebugInfo(const spv_ext_inst_type_t type) { if (type == SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100 || - type == SPV_EXT_INST_TYPE_NONSEMANTIC_VULKAN_DEBUGINFO_100 || type == SPV_EXT_INST_TYPE_DEBUGINFO) { return true; } diff --git a/source/extinst.nonsemantic.vulkan.debuginfo.100.grammar.json b/source/extinst.nonsemantic.vulkan.debuginfo.100.grammar.json deleted file mode 100644 index 1d7914d7..00000000 --- a/source/extinst.nonsemantic.vulkan.debuginfo.100.grammar.json +++ /dev/null @@ -1,638 +0,0 @@ -{ - "copyright" : [ - "Copyright (c) 2018 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - "version" : 100, - "revision" : 2, - "instructions" : [ - { - "opname" : "DebugInfoNone", - "opcode" : 0 - }, - { - "opname" : "DebugCompilationUnit", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'Version'" }, - { "kind" : "IdRef", "name" : "'DWARF Version'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Language'" } - ] - }, - { - "opname" : "DebugTypeBasic", - "opcode" : 2, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "IdRef", "name" : "'Encoding'" }, - { "kind" : "IdRef", "name" : "'Flags'" } - ] - }, - { - "opname" : "DebugTypePointer", - "opcode" : 3, - "operands" : [ - { "kind" : "IdRef", "name" : "'Base Type'" }, - { "kind" : "IdRef", "name" : "'Storage Class'" }, - { "kind" : "IdRef", "name" : "'Flags'" } - ] - }, - { - "opname" : "DebugTypeQualifier", - "opcode" : 4, - "operands" : [ - { "kind" : "IdRef", "name" : "'Base Type'" }, - { "kind" : "IdRef", "name" : "'Type Qualifier'" } - ] - }, - { - "opname" : "DebugTypeArray", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'Base Type'" }, - { "kind" : "IdRef", "name" : "'Component Counts'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugTypeVector", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'Base Type'" }, - { "kind" : "IdRef", "name" : "'Component Count'" } - ] - }, - { - "opname" : "DebugTypedef", - "opcode" : 7, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Base Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" } - ] - }, - { - "opname" : "DebugTypeFunction", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "'Flags'" }, - { "kind" : "IdRef", "name" : "'Return Type'" }, - { "kind" : "IdRef", "name" : "'Parameter Types'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugTypeEnum", - "opcode" : 9, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Underlying Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "IdRef", "name" : "'Flags'" }, - { "kind" : "PairIdRefIdRef", "name" : "'Value, Name, Value, Name, ...'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugTypeComposite", - "opcode" : 10, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Tag'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Linkage Name'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "IdRef", "name" : "'Flags'" }, - { "kind" : "IdRef", "name" : "'Members'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugTypeMember", - "opcode" : 11, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "IdRef", "name" : "'Flags'" }, - { "kind" : "IdRef", "name" : "'Value'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugTypeInheritance", - "opcode" : 12, - "operands" : [ - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "IdRef", "name" : "'Flags'" } - ] - }, - { - "opname" : "DebugTypePtrToMember", - "opcode" : 13, - "operands" : [ - { "kind" : "IdRef", "name" : "'Member Type'" }, - { "kind" : "IdRef", "name" : "'Parent'" } - ] - }, - { - "opname" : "DebugTypeTemplate", - "opcode" : 14, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "IdRef", "name" : "'Parameters'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugTypeTemplateParameter", - "opcode" : 15, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Actual Type'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Column'" } - ] - }, - { - "opname" : "DebugTypeTemplateTemplateParameter", - "opcode" : 16, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Template Name'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Column'" } - ] - }, - { - "opname" : "DebugTypeTemplateParameterPack", - "opcode" : 17, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Template Parameters'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugGlobalVariable", - "opcode" : 18, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Linkage Name'" }, - { "kind" : "IdRef", "name" : "'Variable'" }, - { "kind" : "IdRef", "name" : "'Flags'" }, - { "kind" : "IdRef", "name" : "'Static Member Declaration'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugFunctionDeclaration", - "opcode" : 19, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Linkage Name'" }, - { "kind" : "IdRef", "name" : "'Flags'" } - ] - }, - { - "opname" : "DebugFunction", - "opcode" : 20, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Linkage Name'" }, - { "kind" : "IdRef", "name" : "'Flags'" }, - { "kind" : "IdRef", "name" : "'Scope Line'" }, - { "kind" : "IdRef", "name" : "'Declaration'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugLexicalBlock", - "opcode" : 21, - "operands" : [ - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Name'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugLexicalBlockDiscriminator", - "opcode" : 22, - "operands" : [ - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Discriminator'" }, - { "kind" : "IdRef", "name" : "'Parent'" } - ] - }, - { - "opname" : "DebugScope", - "opcode" : 23, - "operands" : [ - { "kind" : "IdRef", "name" : "'Scope'" }, - { "kind" : "IdRef", "name" : "'Inlined At'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugNoScope", - "opcode" : 24 - }, - { - "opname" : "DebugInlinedAt", - "opcode" : 25, - "operands" : [ - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Scope'" }, - { "kind" : "IdRef", "name" : "'Inlined'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugLocalVariable", - "opcode" : 26, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" }, - { "kind" : "IdRef", "name" : "'Flags'" }, - { "kind" : "IdRef", "name" : "'Arg Number'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugInlinedVariable", - "opcode" : 27, - "operands" : [ - { "kind" : "IdRef", "name" : "'Variable'" }, - { "kind" : "IdRef", "name" : "'Inlined'" } - ] - }, - { - "opname" : "DebugDeclare", - "opcode" : 28, - "operands" : [ - { "kind" : "IdRef", "name" : "'Local Variable'" }, - { "kind" : "IdRef", "name" : "'Variable'" }, - { "kind" : "IdRef", "name" : "'Expression'" } - ] - }, - { - "opname" : "DebugValue", - "opcode" : 29, - "operands" : [ - { "kind" : "IdRef", "name" : "'Local Variable'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Expression'" }, - { "kind" : "IdRef", "name" : "'Indexes'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugOperation", - "opcode" : 30, - "operands" : [ - { "kind" : "IdRef", "name" : "'OpCode'" }, - { "kind" : "IdRef", "name" : "'Operands ...'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugExpression", - "opcode" : 31, - "operands" : [ - { "kind" : "IdRef", "name" : "'Operands ...'", "quantifier" : "*" } - ] - }, - { - "opname" : "DebugMacroDef", - "opcode" : 32, - "operands" : [ - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Value'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugMacroUndef", - "opcode" : 33, - "operands" : [ - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Macro'" } - ] - }, - { - "opname" : "DebugImportedEntity", - "opcode" : 34, - "operands" : [ - { "kind" : "IdRef", "name" : "'Name'" }, - { "kind" : "IdRef", "name" : "'Tag'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Entity'" }, - { "kind" : "IdRef", "name" : "'Line'" }, - { "kind" : "IdRef", "name" : "'Column'" }, - { "kind" : "IdRef", "name" : "'Parent'" } - ] - }, - { - "opname" : "DebugSource", - "opcode" : 35, - "operands" : [ - { "kind" : "IdRef", "name" : "'File'" }, - { "kind" : "IdRef", "name" : "'Text'", "quantifier" : "?" } - ] - }, - { - "opname" : "DebugFunctionDefinition", - "opcode" : 101, - "operands" : [ - { "kind" : "IdRef", "name" : "'Function'" }, - { "kind" : "IdRef", "name" : "'Definition'" } - ] - } - ], - "operand_kinds" : [ - { - "category" : "BitEnum", - "kind" : "DebugInfoFlags", - "enumerants" : [ - { - "enumerant" : "FlagIsProtected", - "value" : "0x01" - }, - { - "enumerant" : "FlagIsPrivate", - "value" : "0x02" - }, - { - "enumerant" : "FlagIsPublic", - "value" : "0x03" - }, - { - "enumerant" : "FlagIsLocal", - "value" : "0x04" - }, - { - "enumerant" : "FlagIsDefinition", - "value" : "0x08" - }, - { - "enumerant" : "FlagFwdDecl", - "value" : "0x10" - }, - { - "enumerant" : "FlagArtificial", - "value" : "0x20" - }, - { - "enumerant" : "FlagExplicit", - "value" : "0x40" - }, - { - "enumerant" : "FlagPrototyped", - "value" : "0x80" - }, - { - "enumerant" : "FlagObjectPointer", - "value" : "0x100" - }, - { - "enumerant" : "FlagStaticMember", - "value" : "0x200" - }, - { - "enumerant" : "FlagIndirectVariable", - "value" : "0x400" - }, - { - "enumerant" : "FlagLValueReference", - "value" : "0x800" - }, - { - "enumerant" : "FlagRValueReference", - "value" : "0x1000" - }, - { - "enumerant" : "FlagIsOptimized", - "value" : "0x2000" - }, - { - "enumerant" : "FlagIsEnumClass", - "value" : "0x4000" - }, - { - "enumerant" : "FlagTypePassByValue", - "value" : "0x8000" - }, - { - "enumerant" : "FlagTypePassByReference", - "value" : "0x10000" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "DebugBaseTypeAttributeEncoding", - "enumerants" : [ - { - "enumerant" : "Unspecified", - "value" : "0" - }, - { - "enumerant" : "Address", - "value" : "1" - }, - { - "enumerant" : "Boolean", - "value" : "2" - }, - { - "enumerant" : "Float", - "value" : "3" - }, - { - "enumerant" : "Signed", - "value" : "4" - }, - { - "enumerant" : "SignedChar", - "value" : "5" - }, - { - "enumerant" : "Unsigned", - "value" : "6" - }, - { - "enumerant" : "UnsignedChar", - "value" : "7" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "DebugCompositeType", - "enumerants" : [ - { - "enumerant" : "Class", - "value" : "0" - }, - { - "enumerant" : "Structure", - "value" : "1" - }, - { - "enumerant" : "Union", - "value" : "2" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "DebugTypeQualifier", - "enumerants" : [ - { - "enumerant" : "ConstType", - "value" : "0" - }, - { - "enumerant" : "VolatileType", - "value" : "1" - }, - { - "enumerant" : "RestrictType", - "value" : "2" - }, - { - "enumerant" : "AtomicType", - "value" : "3" - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "DebugOperation", - "enumerants" : [ - { - "enumerant" : "Deref", - "value" : "0" - }, - { - "enumerant" : "Plus", - "value" : "1" - }, - { - "enumerant" : "Minus", - "value" : "2" - }, - { - "enumerant" : "PlusUconst", - "value" : "3", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "BitPiece", - "value" : "4", - "parameters" : [ - { "kind" : "IdRef" }, - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Swap", - "value" : "5" - }, - { - "enumerant" : "Xderef", - "value" : "6" - }, - { - "enumerant" : "StackValue", - "value" : "7" - }, - { - "enumerant" : "Constu", - "value" : "8", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Fragment", - "value" : "9", - "parameters" : [ - { "kind" : "IdRef" }, - { "kind" : "IdRef" } - ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "DebugImportedEntity", - "enumerants" : [ - { - "enumerant" : "ImportedModule", - "value" : "0" - }, - { - "enumerant" : "ImportedDeclaration", - "value" : "1" - } - ] - } - ] -} diff --git a/source/fuzz/CMakeLists.txt b/source/fuzz/CMakeLists.txt index dd674dd0..804fcf07 100644 --- a/source/fuzz/CMakeLists.txt +++ b/source/fuzz/CMakeLists.txt @@ -101,7 +101,6 @@ if(SPIRV_BUILD_FUZZER) fuzzer_pass_outline_functions.h fuzzer_pass_permute_blocks.h fuzzer_pass_permute_function_parameters.h - fuzzer_pass_permute_function_variables.h fuzzer_pass_permute_instructions.h fuzzer_pass_permute_phi_operands.h fuzzer_pass_propagate_instructions_down.h @@ -121,10 +120,8 @@ if(SPIRV_BUILD_FUZZER) fuzzer_pass_split_blocks.h fuzzer_pass_swap_commutable_operands.h fuzzer_pass_swap_conditional_branch_operands.h - fuzzer_pass_swap_functions.h fuzzer_pass_toggle_access_chain_instruction.h fuzzer_pass_wrap_regions_in_selections.h - fuzzer_pass_wrap_vector_synonym.h fuzzer_util.h id_use_descriptor.h instruction_descriptor.h @@ -225,13 +222,10 @@ if(SPIRV_BUILD_FUZZER) transformation_store.h transformation_swap_commutable_operands.h transformation_swap_conditional_branch_operands.h - transformation_swap_function_variables.h - transformation_swap_two_functions.h transformation_toggle_access_chain_instruction.h transformation_vector_shuffle.h transformation_wrap_early_terminator_in_function.h transformation_wrap_region_in_selection.h - transformation_wrap_vector_synonym.h uniform_buffer_element_descriptor.h ${CMAKE_CURRENT_BINARY_DIR}/protobufs/spvtoolsfuzz.pb.h @@ -298,7 +292,6 @@ if(SPIRV_BUILD_FUZZER) fuzzer_pass_outline_functions.cpp fuzzer_pass_permute_blocks.cpp fuzzer_pass_permute_function_parameters.cpp - fuzzer_pass_permute_function_variables.cpp fuzzer_pass_permute_instructions.cpp fuzzer_pass_permute_phi_operands.cpp fuzzer_pass_propagate_instructions_down.cpp @@ -318,10 +311,8 @@ if(SPIRV_BUILD_FUZZER) fuzzer_pass_split_blocks.cpp fuzzer_pass_swap_commutable_operands.cpp fuzzer_pass_swap_conditional_branch_operands.cpp - fuzzer_pass_swap_functions.cpp fuzzer_pass_toggle_access_chain_instruction.cpp fuzzer_pass_wrap_regions_in_selections.cpp - fuzzer_pass_wrap_vector_synonym.cpp fuzzer_util.cpp id_use_descriptor.cpp instruction_descriptor.cpp @@ -420,13 +411,10 @@ if(SPIRV_BUILD_FUZZER) transformation_store.cpp transformation_swap_commutable_operands.cpp transformation_swap_conditional_branch_operands.cpp - transformation_swap_function_variables.cpp - transformation_swap_two_functions.cpp transformation_toggle_access_chain_instruction.cpp transformation_vector_shuffle.cpp transformation_wrap_early_terminator_in_function.cpp transformation_wrap_region_in_selection.cpp - transformation_wrap_vector_synonym.cpp uniform_buffer_element_descriptor.cpp ${CMAKE_CURRENT_BINARY_DIR}/protobufs/spvtoolsfuzz.pb.cc ) diff --git a/source/fuzz/available_instructions.cpp b/source/fuzz/available_instructions.cpp index 0db8b207..e25ed900 100644 --- a/source/fuzz/available_instructions.cpp +++ b/source/fuzz/available_instructions.cpp @@ -44,7 +44,7 @@ AvailableInstructions::AvailableInstructions( // Consider every reachable block in the function. auto dominator_analysis = ir_context->GetDominatorAnalysis(&function); for (auto& block : function) { - if (!ir_context->IsReachable(block)) { + if (!fuzzerutil::BlockIsReachableInItsFunction(ir_context, &block)) { // The block is not reachable. continue; } diff --git a/source/fuzz/fuzzer.cpp b/source/fuzz/fuzzer.cpp index 9838e64f..9d1af752 100644 --- a/source/fuzz/fuzzer.cpp +++ b/source/fuzz/fuzzer.cpp @@ -67,7 +67,6 @@ #include "source/fuzz/fuzzer_pass_outline_functions.h" #include "source/fuzz/fuzzer_pass_permute_blocks.h" #include "source/fuzz/fuzzer_pass_permute_function_parameters.h" -#include "source/fuzz/fuzzer_pass_permute_function_variables.h" #include "source/fuzz/fuzzer_pass_permute_instructions.h" #include "source/fuzz/fuzzer_pass_permute_phi_operands.h" #include "source/fuzz/fuzzer_pass_propagate_instructions_down.h" @@ -87,10 +86,8 @@ #include "source/fuzz/fuzzer_pass_split_blocks.h" #include "source/fuzz/fuzzer_pass_swap_commutable_operands.h" #include "source/fuzz/fuzzer_pass_swap_conditional_branch_operands.h" -#include "source/fuzz/fuzzer_pass_swap_functions.h" #include "source/fuzz/fuzzer_pass_toggle_access_chain_instruction.h" #include "source/fuzz/fuzzer_pass_wrap_regions_in_selections.h" -#include "source/fuzz/fuzzer_pass_wrap_vector_synonym.h" #include "source/fuzz/pass_management/repeated_pass_manager.h" #include "source/fuzz/pass_management/repeated_pass_recommender_standard.h" #include "source/fuzz/protobufs/spirvfuzz_protobufs.h" @@ -110,8 +107,7 @@ Fuzzer::Fuzzer(std::unique_ptr ir_context, bool enable_all_passes, RepeatedPassStrategy repeated_pass_strategy, bool validate_after_each_fuzzer_pass, - spv_validator_options validator_options, - bool ignore_inapplicable_transformations /* = true */) + spv_validator_options validator_options) : consumer_(std::move(consumer)), enable_all_passes_(enable_all_passes), validate_after_each_fuzzer_pass_(validate_after_each_fuzzer_pass), @@ -125,9 +121,7 @@ Fuzzer::Fuzzer(std::unique_ptr ir_context, pass_instances_(), repeated_pass_recommender_(nullptr), repeated_pass_manager_(nullptr), - final_passes_(), - ignore_inapplicable_transformations_( - ignore_inapplicable_transformations) { + final_passes_() { assert(ir_context_ && "IRContext is not initialized"); assert(fuzzer_context_ && "FuzzerContext is not initialized"); assert(transformation_context_ && "TransformationContext is not initialized"); @@ -218,7 +212,6 @@ Fuzzer::Fuzzer(std::unique_ptr ir_context, MaybeAddRepeatedPass( &pass_instances_); MaybeAddRepeatedPass(&pass_instances_); - MaybeAddRepeatedPass(&pass_instances_); // There is a theoretical possibility that no pass instances were created // until now; loop again if so. } while (pass_instances_.GetPasses().empty()); @@ -243,10 +236,8 @@ Fuzzer::Fuzzer(std::unique_ptr ir_context, &final_passes_); } MaybeAddFinalPass(&final_passes_); - MaybeAddFinalPass(&final_passes_); MaybeAddFinalPass(&final_passes_); MaybeAddFinalPass(&final_passes_); - MaybeAddFinalPass(&final_passes_); MaybeAddFinalPass(&final_passes_); } @@ -260,8 +251,7 @@ void Fuzzer::MaybeAddRepeatedPass(uint32_t percentage_chance_of_adding_pass, fuzzer_context_->ChoosePercentage(percentage_chance_of_adding_pass)) { pass_instances->SetPass(MakeUnique( ir_context_.get(), transformation_context_.get(), fuzzer_context_.get(), - &transformation_sequence_out_, ignore_inapplicable_transformations_, - std::forward(extra_args)...)); + &transformation_sequence_out_, std::forward(extra_args)...)); } } @@ -271,8 +261,7 @@ void Fuzzer::MaybeAddFinalPass(std::vector>* passes, if (enable_all_passes_ || fuzzer_context_->ChooseEven()) { passes->push_back(MakeUnique( ir_context_.get(), transformation_context_.get(), fuzzer_context_.get(), - &transformation_sequence_out_, ignore_inapplicable_transformations_, - std::forward(extra_args)...)); + &transformation_sequence_out_, std::forward(extra_args)...)); } } diff --git a/source/fuzz/fuzzer.h b/source/fuzz/fuzzer.h index 4c38977f..1e7d6860 100644 --- a/source/fuzz/fuzzer.h +++ b/source/fuzz/fuzzer.h @@ -62,8 +62,7 @@ class Fuzzer { const std::vector& donor_suppliers, bool enable_all_passes, RepeatedPassStrategy repeated_pass_strategy, bool validate_after_each_fuzzer_pass, - spv_validator_options validator_options, - bool ignore_inapplicable_transformations = true); + spv_validator_options validator_options); // Disables copy/move constructor/assignment operations. Fuzzer(const Fuzzer&) = delete; @@ -188,12 +187,6 @@ class Fuzzer { // Some passes that it does not make sense to apply repeatedly, as they do not // unlock other passes. std::vector> final_passes_; - - // When set, this flag causes inapplicable transformations that should be - // applicable by construction to be ignored. This is useful when the fuzzer - // is being deployed at scale to test a SPIR-V processing tool, and where it - // is desirable to ignore bugs in the fuzzer itself. - const bool ignore_inapplicable_transformations_; }; } // namespace fuzz diff --git a/source/fuzz/fuzzer_context.cpp b/source/fuzz/fuzzer_context.cpp index c2175425..ef93e719 100644 --- a/source/fuzz/fuzzer_context.cpp +++ b/source/fuzz/fuzzer_context.cpp @@ -42,8 +42,6 @@ const std::pair kChanceOfAddingAnotherPassToPassLoop = {50, const std::pair kChanceOfAddingAnotherStructField = {20, 90}; const std::pair kChanceOfAddingArrayOrStructType = {20, 90}; -const std::pair KChanceOfAddingAtomicLoad = {30, 90}; -const std::pair KChanceOfAddingAtomicStore = {20, 90}; const std::pair kChanceOfAddingBitInstructionSynonym = {5, 20}; const std::pair @@ -122,8 +120,6 @@ const std::pair kChanceOfMovingBlockDown = {20, 50}; const std::pair kChanceOfMutatingPointer = {20, 90}; const std::pair kChanceOfObfuscatingConstant = {10, 90}; const std::pair kChanceOfOutliningFunction = {10, 90}; -const std::pair kChanceOfPermutingFunctionVariables = {30, - 90}; const std::pair kChanceOfPermutingInstructions = {20, 70}; const std::pair kChanceOfPermutingParameters = {30, 90}; const std::pair kChanceOfPermutingPhiOperands = {30, 90}; @@ -155,16 +151,12 @@ const std::pair kChanceOfReplacingParametersWithGlobals = { const std::pair kChanceOfReplacingParametersWithStruct = { 20, 40}; const std::pair kChanceOfSplittingBlock = {40, 95}; -const std::pair - kChanceOfSwappingAnotherPairOfFunctionVariables = {30, 90}; const std::pair kChanceOfSwappingConditionalBranchOperands = {10, 70}; -const std::pair kChanceOfSwappingFunctions = {10, 90}; const std::pair kChanceOfTogglingAccessChainInstruction = { 20, 90}; const std::pair kChanceOfWrappingRegionInSelection = {70, 90}; -const std::pair kChanceOfWrappingVectorSynonym = {10, 90}; // Default limits for various quantities that are chosen during fuzzing. // Keep them in alphabetical order. @@ -218,10 +210,6 @@ FuzzerContext::FuzzerContext(std::unique_ptr random_generator, ChooseBetweenMinAndMax(kChanceOfAddingAnotherStructField); chance_of_adding_array_or_struct_type_ = ChooseBetweenMinAndMax(kChanceOfAddingArrayOrStructType); - chance_of_adding_atomic_load_ = - ChooseBetweenMinAndMax(KChanceOfAddingAtomicLoad); - chance_of_adding_atomic_store_ = - ChooseBetweenMinAndMax(KChanceOfAddingAtomicStore); chance_of_adding_bit_instruction_synonym_ = ChooseBetweenMinAndMax(kChanceOfAddingBitInstructionSynonym); chance_of_adding_both_branches_when_replacing_opselect_ = @@ -327,8 +315,6 @@ FuzzerContext::FuzzerContext(std::unique_ptr random_generator, ChooseBetweenMinAndMax(kChanceOfObfuscatingConstant); chance_of_outlining_function_ = ChooseBetweenMinAndMax(kChanceOfOutliningFunction); - chance_of_permuting_function_variables_ = - ChooseBetweenMinAndMax(kChanceOfPermutingFunctionVariables); chance_of_permuting_instructions_ = ChooseBetweenMinAndMax(kChanceOfPermutingInstructions); chance_of_permuting_parameters_ = @@ -366,18 +352,12 @@ FuzzerContext::FuzzerContext(std::unique_ptr random_generator, chance_of_replacing_parameters_with_struct_ = ChooseBetweenMinAndMax(kChanceOfReplacingParametersWithStruct); chance_of_splitting_block_ = ChooseBetweenMinAndMax(kChanceOfSplittingBlock); - chance_of_swapping_another_pair_of_function_variables_ = - ChooseBetweenMinAndMax(kChanceOfSwappingAnotherPairOfFunctionVariables); chance_of_swapping_conditional_branch_operands_ = ChooseBetweenMinAndMax(kChanceOfSwappingConditionalBranchOperands); - chance_of_swapping_functions_ = - ChooseBetweenMinAndMax(kChanceOfSwappingFunctions); chance_of_toggling_access_chain_instruction_ = ChooseBetweenMinAndMax(kChanceOfTogglingAccessChainInstruction); chance_of_wrapping_region_in_selection_ = ChooseBetweenMinAndMax(kChanceOfWrappingRegionInSelection); - chance_of_wrapping_vector_synonym_ = - ChooseBetweenMinAndMax(kChanceOfWrappingVectorSynonym); } FuzzerContext::~FuzzerContext() = default; diff --git a/source/fuzz/fuzzer_context.h b/source/fuzz/fuzzer_context.h index 77a5d400..40fd8783 100644 --- a/source/fuzz/fuzzer_context.h +++ b/source/fuzz/fuzzer_context.h @@ -142,12 +142,6 @@ class FuzzerContext { uint32_t GetChanceOfAddingArrayOrStructType() const { return chance_of_adding_array_or_struct_type_; } - uint32_t GetChanceOfAddingAtomicLoad() const { - return chance_of_adding_atomic_load_; - } - uint32_t GetChanceOfAddingAtomicStore() const { - return chance_of_adding_atomic_store_; - } uint32_t GetChanceOfAddingBitInstructionSynonym() const { return chance_of_adding_bit_instruction_synonym_; } @@ -309,9 +303,6 @@ class FuzzerContext { uint32_t GetChanceOfOutliningFunction() const { return chance_of_outlining_function_; } - uint32_t GetChanceOfPermutingFunctionVariables() const { - return chance_of_permuting_function_variables_; - } uint32_t GetChanceOfPermutingInstructions() const { return chance_of_permuting_instructions_; } @@ -369,17 +360,9 @@ class FuzzerContext { uint32_t GetChanceOfSplittingBlock() const { return chance_of_splitting_block_; } - uint32_t GetChanceOfSwappingAnotherPairOfFunctionVariables() const { - return chance_of_swapping_another_pair_of_function_variables_; - } uint32_t GetChanceOfSwappingConditionalBranchOperands() const { return chance_of_swapping_conditional_branch_operands_; } - - uint32_t GetChanceOfSwappingFunctions() const { - return chance_of_swapping_functions_; - } - uint32_t GetChanceOfTogglingAccessChainInstruction() const { return chance_of_toggling_access_chain_instruction_; } @@ -387,10 +370,6 @@ class FuzzerContext { return chance_of_wrapping_region_in_selection_; } - uint32_t GetChanceOfWrappingVectorSynonym() const { - return chance_of_wrapping_vector_synonym_; - } - // Other functions to control transformations. Keep them in alphabetical // order. uint32_t GetMaximumEquivalenceClassSizeForDataSynonymFactClosure() const { @@ -435,9 +414,6 @@ class FuzzerContext { uint32_t GetRandomIndexForCompositeInsert(uint32_t number_of_components) { return random_generator_->RandomUint32(number_of_components); } - uint32_t GetRandomIndexForWrappingVector(uint32_t vector_width) { - return random_generator_->RandomUint32(vector_width); - } int64_t GetRandomValueForStepConstantInLoop() { return random_generator_->RandomUint64(UINT64_MAX); } @@ -475,9 +451,6 @@ class FuzzerContext { // Ensure that the number of unused components is non-zero. return random_generator_->RandomUint32(max_unused_component_count) + 1; } - uint32_t GetWidthOfWrappingVector() { - return 2 + random_generator_->RandomUint32(3); - } bool GoDeeperInConstantObfuscation(uint32_t depth) { return go_deeper_in_constant_obfuscation_(depth, random_generator_.get()); } @@ -498,8 +471,6 @@ class FuzzerContext { uint32_t chance_of_adding_another_pass_to_pass_loop_; uint32_t chance_of_adding_another_struct_field_; uint32_t chance_of_adding_array_or_struct_type_; - uint32_t chance_of_adding_atomic_load_; - uint32_t chance_of_adding_atomic_store_; uint32_t chance_of_adding_bit_instruction_synonym_; uint32_t chance_of_adding_both_branches_when_replacing_opselect_; uint32_t chance_of_adding_composite_extract_; @@ -555,7 +526,6 @@ class FuzzerContext { uint32_t chance_of_mutating_pointer_; uint32_t chance_of_obfuscating_constant_; uint32_t chance_of_outlining_function_; - uint32_t chance_of_permuting_function_variables_; uint32_t chance_of_permuting_instructions_; uint32_t chance_of_permuting_parameters_; uint32_t chance_of_permuting_phi_operands_; @@ -575,12 +545,9 @@ class FuzzerContext { uint32_t chance_of_replacing_parameters_with_globals_; uint32_t chance_of_replacing_parameters_with_struct_; uint32_t chance_of_splitting_block_; - uint32_t chance_of_swapping_another_pair_of_function_variables_; uint32_t chance_of_swapping_conditional_branch_operands_; - uint32_t chance_of_swapping_functions_; uint32_t chance_of_toggling_access_chain_instruction_; uint32_t chance_of_wrapping_region_in_selection_; - uint32_t chance_of_wrapping_vector_synonym_; // Limits associated with various quantities for which random values are // chosen during fuzzing. diff --git a/source/fuzz/fuzzer_pass.cpp b/source/fuzz/fuzzer_pass.cpp index d91482cc..486f18fa 100644 --- a/source/fuzz/fuzzer_pass.cpp +++ b/source/fuzz/fuzzer_pass.cpp @@ -43,14 +43,11 @@ namespace fuzz { FuzzerPass::FuzzerPass(opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : ir_context_(ir_context), transformation_context_(transformation_context), fuzzer_context_(fuzzer_context), - transformations_(transformations), - ignore_inapplicable_transformations_( - ignore_inapplicable_transformations) {} + transformations_(transformations) {} FuzzerPass::~FuzzerPass() = default; @@ -114,8 +111,10 @@ void FuzzerPass::ForEachInstructionWithInstructionDescriptor( // module. std::vector reachable_blocks; + const auto* dominator_analysis = + GetIRContext()->GetDominatorAnalysis(function); for (auto& block : *function) { - if (GetIRContext()->IsReachable(block)) { + if (dominator_analysis->IsReachable(&block)) { reachable_blocks.push_back(&block); } } @@ -185,49 +184,6 @@ void FuzzerPass::ForEachInstructionWithInstructionDescriptor( } } -void FuzzerPass::ApplyTransformation(const Transformation& transformation) { - if (ignore_inapplicable_transformations_) { - // If an applicable-by-construction transformation turns out to be - // inapplicable, this is a bug in the fuzzer. However, when deploying the - // fuzzer at scale for finding bugs in SPIR-V processing tools it is - // desirable to silently ignore such bugs. This code path caters for that - // scenario. - if (!transformation.IsApplicable(GetIRContext(), - *GetTransformationContext())) { - return; - } - } else { - // This code path caters for debugging bugs in the fuzzer, where an - // applicable-by-construction transformation turns out to be inapplicable. - assert(transformation.IsApplicable(GetIRContext(), - *GetTransformationContext()) && - "Transformation should be applicable by construction."); - } - transformation.Apply(GetIRContext(), GetTransformationContext()); - auto transformation_message = transformation.ToMessage(); - assert(transformation_message.transformation_case() != - protobufs::Transformation::TRANSFORMATION_NOT_SET && - "Bad transformation."); - *GetTransformations()->add_transformation() = - std::move(transformation_message); -} - -bool FuzzerPass::MaybeApplyTransformation( - const Transformation& transformation) { - if (transformation.IsApplicable(GetIRContext(), - *GetTransformationContext())) { - transformation.Apply(GetIRContext(), GetTransformationContext()); - auto transformation_message = transformation.ToMessage(); - assert(transformation_message.transformation_case() != - protobufs::Transformation::TRANSFORMATION_NOT_SET && - "Bad transformation."); - *GetTransformations()->add_transformation() = - std::move(transformation_message); - return true; - } - return false; -} - uint32_t FuzzerPass::FindOrCreateBoolType() { if (auto existing_id = fuzzerutil::MaybeGetBoolType(GetIRContext())) { return existing_id; diff --git a/source/fuzz/fuzzer_pass.h b/source/fuzz/fuzzer_pass.h index 2655b540..da3f2390 100644 --- a/source/fuzz/fuzzer_pass.h +++ b/source/fuzz/fuzzer_pass.h @@ -33,8 +33,7 @@ class FuzzerPass { FuzzerPass(opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); virtual ~FuzzerPass(); @@ -107,13 +106,37 @@ class FuzzerPass { // A generic helper for applying a transformation that should be applicable // by construction, and adding it to the sequence of applied transformations. - void ApplyTransformation(const Transformation& transformation); + void ApplyTransformation(const Transformation& transformation) { + assert(transformation.IsApplicable(GetIRContext(), + *GetTransformationContext()) && + "Transformation should be applicable by construction."); + transformation.Apply(GetIRContext(), GetTransformationContext()); + protobufs::Transformation transformation_message = + transformation.ToMessage(); + assert(transformation_message.transformation_case() != + protobufs::Transformation::TRANSFORMATION_NOT_SET && + "Bad transformation."); + *GetTransformations()->add_transformation() = transformation_message; + } // A generic helper for applying a transformation only if it is applicable. // If it is applicable, the transformation is applied and then added to the // sequence of applied transformations and the function returns true. // Otherwise, the function returns false. - bool MaybeApplyTransformation(const Transformation& transformation); + bool MaybeApplyTransformation(const Transformation& transformation) { + if (transformation.IsApplicable(GetIRContext(), + *GetTransformationContext())) { + transformation.Apply(GetIRContext(), GetTransformationContext()); + protobufs::Transformation transformation_message = + transformation.ToMessage(); + assert(transformation_message.transformation_case() != + protobufs::Transformation::TRANSFORMATION_NOT_SET && + "Bad transformation."); + *GetTransformations()->add_transformation() = transformation_message; + return true; + } + return false; + } // Returns the id of an OpTypeBool instruction. If such an instruction does // not exist, a transformation is applied to add it. @@ -322,10 +345,6 @@ class FuzzerPass { TransformationContext* transformation_context_; FuzzerContext* fuzzer_context_; protobufs::TransformationSequence* transformations_; - // If set, then transformations that should be applicable by construction are - // still tested for applicability, and ignored if they turn out to be - // inapplicable. Otherwise, applicability by construction is asserted. - const bool ignore_inapplicable_transformations_; }; } // namespace fuzz diff --git a/source/fuzz/fuzzer_pass_add_access_chains.cpp b/source/fuzz/fuzzer_pass_add_access_chains.cpp index 39f193d9..c498642c 100644 --- a/source/fuzz/fuzzer_pass_add_access_chains.cpp +++ b/source/fuzz/fuzzer_pass_add_access_chains.cpp @@ -23,10 +23,9 @@ namespace fuzz { FuzzerPassAddAccessChains::FuzzerPassAddAccessChains( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAddAccessChains::Apply() { ForEachInstructionWithInstructionDescriptor( diff --git a/source/fuzz/fuzzer_pass_add_access_chains.h b/source/fuzz/fuzzer_pass_add_access_chains.h index 5e209cd2..e80c2c6c 100644 --- a/source/fuzz/fuzzer_pass_add_access_chains.h +++ b/source/fuzz/fuzzer_pass_add_access_chains.h @@ -28,8 +28,7 @@ class FuzzerPassAddAccessChains : public FuzzerPass { FuzzerPassAddAccessChains(opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_add_bit_instruction_synonyms.cpp b/source/fuzz/fuzzer_pass_add_bit_instruction_synonyms.cpp index 1b0d7b10..b2edc194 100644 --- a/source/fuzz/fuzzer_pass_add_bit_instruction_synonyms.cpp +++ b/source/fuzz/fuzzer_pass_add_bit_instruction_synonyms.cpp @@ -24,10 +24,9 @@ namespace fuzz { FuzzerPassAddBitInstructionSynonyms::FuzzerPassAddBitInstructionSynonyms( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAddBitInstructionSynonyms::Apply() { for (auto& function : *GetIRContext()->module()) { @@ -46,11 +45,22 @@ void FuzzerPassAddBitInstructionSynonyms::Apply() { continue; } - // Make sure fuzzer never applies a transformation to a bitwise - // instruction with differently signed operands, only integer operands - // are supported and bitwise operations are supported only. - if (!TransformationAddBitInstructionSynonym::IsInstructionSupported( - GetIRContext(), &instruction)) { + // TODO(https://github.com/KhronosGroup/SPIRV-Tools/issues/3557): + // Right now we only support certain operations. When this issue is + // addressed the following conditional can use the function + // |spvOpcodeIsBit|. + if (instruction.opcode() != SpvOpBitwiseOr && + instruction.opcode() != SpvOpBitwiseXor && + instruction.opcode() != SpvOpBitwiseAnd && + instruction.opcode() != SpvOpNot) { + continue; + } + + // Right now, only integer operands are supported. + if (GetIRContext() + ->get_type_mgr() + ->GetType(instruction.type_id()) + ->AsVector()) { continue; } diff --git a/source/fuzz/fuzzer_pass_add_bit_instruction_synonyms.h b/source/fuzz/fuzzer_pass_add_bit_instruction_synonyms.h index 38d81aa7..28f95779 100644 --- a/source/fuzz/fuzzer_pass_add_bit_instruction_synonyms.h +++ b/source/fuzz/fuzzer_pass_add_bit_instruction_synonyms.h @@ -28,8 +28,7 @@ class FuzzerPassAddBitInstructionSynonyms : public FuzzerPass { FuzzerPassAddBitInstructionSynonyms( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_add_composite_extract.cpp b/source/fuzz/fuzzer_pass_add_composite_extract.cpp index dbbec0ca..19f99024 100644 --- a/source/fuzz/fuzzer_pass_add_composite_extract.cpp +++ b/source/fuzz/fuzzer_pass_add_composite_extract.cpp @@ -26,10 +26,9 @@ namespace fuzz { FuzzerPassAddCompositeExtract::FuzzerPassAddCompositeExtract( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAddCompositeExtract::Apply() { std::vector composite_synonyms; diff --git a/source/fuzz/fuzzer_pass_add_composite_extract.h b/source/fuzz/fuzzer_pass_add_composite_extract.h index e7ed18af..32ac190a 100644 --- a/source/fuzz/fuzzer_pass_add_composite_extract.h +++ b/source/fuzz/fuzzer_pass_add_composite_extract.h @@ -27,8 +27,7 @@ class FuzzerPassAddCompositeExtract : public FuzzerPass { FuzzerPassAddCompositeExtract( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_add_composite_inserts.cpp b/source/fuzz/fuzzer_pass_add_composite_inserts.cpp index 2ac12de4..cf314d30 100644 --- a/source/fuzz/fuzzer_pass_add_composite_inserts.cpp +++ b/source/fuzz/fuzzer_pass_add_composite_inserts.cpp @@ -25,10 +25,9 @@ namespace fuzz { FuzzerPassAddCompositeInserts::FuzzerPassAddCompositeInserts( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAddCompositeInserts::Apply() { ForEachInstructionWithInstructionDescriptor( diff --git a/source/fuzz/fuzzer_pass_add_composite_inserts.h b/source/fuzz/fuzzer_pass_add_composite_inserts.h index d9f42d58..4d511f6c 100644 --- a/source/fuzz/fuzzer_pass_add_composite_inserts.h +++ b/source/fuzz/fuzzer_pass_add_composite_inserts.h @@ -27,8 +27,7 @@ class FuzzerPassAddCompositeInserts : public FuzzerPass { FuzzerPassAddCompositeInserts( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; diff --git a/source/fuzz/fuzzer_pass_add_composite_types.cpp b/source/fuzz/fuzzer_pass_add_composite_types.cpp index af36ad06..3dfbd690 100644 --- a/source/fuzz/fuzzer_pass_add_composite_types.cpp +++ b/source/fuzz/fuzzer_pass_add_composite_types.cpp @@ -24,10 +24,9 @@ namespace fuzz { FuzzerPassAddCompositeTypes::FuzzerPassAddCompositeTypes( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAddCompositeTypes::Apply() { MaybeAddMissingVectorTypes(); diff --git a/source/fuzz/fuzzer_pass_add_composite_types.h b/source/fuzz/fuzzer_pass_add_composite_types.h index f16c79e3..89d48f8a 100644 --- a/source/fuzz/fuzzer_pass_add_composite_types.h +++ b/source/fuzz/fuzzer_pass_add_composite_types.h @@ -27,8 +27,7 @@ class FuzzerPassAddCompositeTypes : public FuzzerPass { FuzzerPassAddCompositeTypes( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; diff --git a/source/fuzz/fuzzer_pass_add_copy_memory.cpp b/source/fuzz/fuzzer_pass_add_copy_memory.cpp index 6551f49f..b654927f 100644 --- a/source/fuzz/fuzzer_pass_add_copy_memory.cpp +++ b/source/fuzz/fuzzer_pass_add_copy_memory.cpp @@ -25,10 +25,9 @@ namespace fuzz { FuzzerPassAddCopyMemory::FuzzerPassAddCopyMemory( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAddCopyMemory::Apply() { ForEachInstructionWithInstructionDescriptor( diff --git a/source/fuzz/fuzzer_pass_add_copy_memory.h b/source/fuzz/fuzzer_pass_add_copy_memory.h index e258752c..0f7db0c7 100644 --- a/source/fuzz/fuzzer_pass_add_copy_memory.h +++ b/source/fuzz/fuzzer_pass_add_copy_memory.h @@ -27,8 +27,7 @@ class FuzzerPassAddCopyMemory : public FuzzerPass { FuzzerPassAddCopyMemory(opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_add_dead_blocks.cpp b/source/fuzz/fuzzer_pass_add_dead_blocks.cpp index 82d53ebb..8c166a20 100644 --- a/source/fuzz/fuzzer_pass_add_dead_blocks.cpp +++ b/source/fuzz/fuzzer_pass_add_dead_blocks.cpp @@ -31,10 +31,9 @@ const size_t kMaxTransformationsInOnePass = 100U; FuzzerPassAddDeadBlocks::FuzzerPassAddDeadBlocks( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAddDeadBlocks::Apply() { // We iterate over all blocks in the module collecting up those at which we diff --git a/source/fuzz/fuzzer_pass_add_dead_blocks.h b/source/fuzz/fuzzer_pass_add_dead_blocks.h index 4567e87d..a87c05c3 100644 --- a/source/fuzz/fuzzer_pass_add_dead_blocks.h +++ b/source/fuzz/fuzzer_pass_add_dead_blocks.h @@ -27,8 +27,7 @@ class FuzzerPassAddDeadBlocks : public FuzzerPass { FuzzerPassAddDeadBlocks(opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_add_dead_breaks.cpp b/source/fuzz/fuzzer_pass_add_dead_breaks.cpp index c3664c87..0c18da90 100644 --- a/source/fuzz/fuzzer_pass_add_dead_breaks.cpp +++ b/source/fuzz/fuzzer_pass_add_dead_breaks.cpp @@ -24,10 +24,9 @@ namespace fuzz { FuzzerPassAddDeadBreaks::FuzzerPassAddDeadBreaks( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAddDeadBreaks::Apply() { // We first collect up lots of possibly-applicable transformations. diff --git a/source/fuzz/fuzzer_pass_add_dead_breaks.h b/source/fuzz/fuzzer_pass_add_dead_breaks.h index 361c3464..d1086fc4 100644 --- a/source/fuzz/fuzzer_pass_add_dead_breaks.h +++ b/source/fuzz/fuzzer_pass_add_dead_breaks.h @@ -26,8 +26,7 @@ class FuzzerPassAddDeadBreaks : public FuzzerPass { FuzzerPassAddDeadBreaks(opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_add_dead_continues.cpp b/source/fuzz/fuzzer_pass_add_dead_continues.cpp index 38814811..1ab40b73 100644 --- a/source/fuzz/fuzzer_pass_add_dead_continues.cpp +++ b/source/fuzz/fuzzer_pass_add_dead_continues.cpp @@ -24,10 +24,9 @@ namespace fuzz { FuzzerPassAddDeadContinues::FuzzerPassAddDeadContinues( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAddDeadContinues::Apply() { // Consider every block in every function. diff --git a/source/fuzz/fuzzer_pass_add_dead_continues.h b/source/fuzz/fuzzer_pass_add_dead_continues.h index 4f1bd601..bf0009e4 100644 --- a/source/fuzz/fuzzer_pass_add_dead_continues.h +++ b/source/fuzz/fuzzer_pass_add_dead_continues.h @@ -23,11 +23,10 @@ namespace fuzz { // A fuzzer pass for adding dead continue edges to the module. class FuzzerPassAddDeadContinues : public FuzzerPass { public: - FuzzerPassAddDeadContinues(opt::IRContext* ir_context, - TransformationContext* transformation_context, - FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + FuzzerPassAddDeadContinues( + opt::IRContext* ir_context, TransformationContext* transformation_context, + FuzzerContext* fuzzer_context, + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_add_equation_instructions.cpp b/source/fuzz/fuzzer_pass_add_equation_instructions.cpp index 4bbded8e..15554b7a 100644 --- a/source/fuzz/fuzzer_pass_add_equation_instructions.cpp +++ b/source/fuzz/fuzzer_pass_add_equation_instructions.cpp @@ -45,10 +45,9 @@ bool IsBitWidthSupported(opt::IRContext* ir_context, uint32_t bit_width) { FuzzerPassAddEquationInstructions::FuzzerPassAddEquationInstructions( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAddEquationInstructions::Apply() { ForEachInstructionWithInstructionDescriptor( diff --git a/source/fuzz/fuzzer_pass_add_equation_instructions.h b/source/fuzz/fuzzer_pass_add_equation_instructions.h index dc9a27b3..dbec5bac 100644 --- a/source/fuzz/fuzzer_pass_add_equation_instructions.h +++ b/source/fuzz/fuzzer_pass_add_equation_instructions.h @@ -29,8 +29,7 @@ class FuzzerPassAddEquationInstructions : public FuzzerPass { FuzzerPassAddEquationInstructions( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; diff --git a/source/fuzz/fuzzer_pass_add_function_calls.cpp b/source/fuzz/fuzzer_pass_add_function_calls.cpp index 033f4a27..2240696b 100644 --- a/source/fuzz/fuzzer_pass_add_function_calls.cpp +++ b/source/fuzz/fuzzer_pass_add_function_calls.cpp @@ -26,10 +26,9 @@ namespace fuzz { FuzzerPassAddFunctionCalls::FuzzerPassAddFunctionCalls( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAddFunctionCalls::Apply() { ForEachInstructionWithInstructionDescriptor( diff --git a/source/fuzz/fuzzer_pass_add_function_calls.h b/source/fuzz/fuzzer_pass_add_function_calls.h index 80b03d7b..081510c1 100644 --- a/source/fuzz/fuzzer_pass_add_function_calls.h +++ b/source/fuzz/fuzzer_pass_add_function_calls.h @@ -24,11 +24,10 @@ namespace fuzz { // anywhere, and (b) any functions, from dead blocks. class FuzzerPassAddFunctionCalls : public FuzzerPass { public: - FuzzerPassAddFunctionCalls(opt::IRContext* ir_context, - TransformationContext* transformation_context, - FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + FuzzerPassAddFunctionCalls( + opt::IRContext* ir_context, TransformationContext* transformation_context, + FuzzerContext* fuzzer_context, + protobufs::TransformationSequence* transformations); void Apply() override; diff --git a/source/fuzz/fuzzer_pass_add_global_variables.cpp b/source/fuzz/fuzzer_pass_add_global_variables.cpp index 061f44d0..06797413 100644 --- a/source/fuzz/fuzzer_pass_add_global_variables.cpp +++ b/source/fuzz/fuzzer_pass_add_global_variables.cpp @@ -23,10 +23,9 @@ namespace fuzz { FuzzerPassAddGlobalVariables::FuzzerPassAddGlobalVariables( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAddGlobalVariables::Apply() { SpvStorageClass variable_storage_class = SpvStorageClassPrivate; @@ -48,10 +47,6 @@ void FuzzerPassAddGlobalVariables::Apply() { // These are the basic types that are available to this fuzzer pass. auto& basic_types = basic_type_ids_and_pointers.first; - if (basic_types.empty()) { - // There are no basic types, so there is nothing this fuzzer pass can do. - return; - } // These are the pointers to those basic types that are *initially* available // to the fuzzer pass. The fuzzer pass might add pointer types in cases where diff --git a/source/fuzz/fuzzer_pass_add_global_variables.h b/source/fuzz/fuzzer_pass_add_global_variables.h index 1496646e..3745c5c3 100644 --- a/source/fuzz/fuzzer_pass_add_global_variables.h +++ b/source/fuzz/fuzzer_pass_add_global_variables.h @@ -27,8 +27,7 @@ class FuzzerPassAddGlobalVariables : public FuzzerPass { FuzzerPassAddGlobalVariables( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_add_image_sample_unused_components.cpp b/source/fuzz/fuzzer_pass_add_image_sample_unused_components.cpp index 19661d10..c10db720 100644 --- a/source/fuzz/fuzzer_pass_add_image_sample_unused_components.cpp +++ b/source/fuzz/fuzzer_pass_add_image_sample_unused_components.cpp @@ -27,10 +27,9 @@ FuzzerPassAddImageSampleUnusedComponents:: opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAddImageSampleUnusedComponents::Apply() { // SPIR-V module to help understand the transformation. diff --git a/source/fuzz/fuzzer_pass_add_image_sample_unused_components.h b/source/fuzz/fuzzer_pass_add_image_sample_unused_components.h index 1a278931..f5dea8bf 100644 --- a/source/fuzz/fuzzer_pass_add_image_sample_unused_components.h +++ b/source/fuzz/fuzzer_pass_add_image_sample_unused_components.h @@ -28,8 +28,7 @@ class FuzzerPassAddImageSampleUnusedComponents : public FuzzerPass { FuzzerPassAddImageSampleUnusedComponents( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_add_loads.cpp b/source/fuzz/fuzzer_pass_add_loads.cpp index ab91543b..2e50da26 100644 --- a/source/fuzz/fuzzer_pass_add_loads.cpp +++ b/source/fuzz/fuzzer_pass_add_loads.cpp @@ -23,10 +23,9 @@ namespace fuzz { FuzzerPassAddLoads::FuzzerPassAddLoads( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAddLoads::Apply() { ForEachInstructionWithInstructionDescriptor( @@ -39,19 +38,15 @@ void FuzzerPassAddLoads::Apply() { "The opcode of the instruction we might insert before must be " "the same as the opcode in the descriptor for the instruction"); - // Randomly decide whether to try inserting a load here. - if (!GetFuzzerContext()->ChoosePercentage( - GetFuzzerContext()->GetChanceOfAddingLoad())) { - return; - } - - // Check whether it is legitimate to insert a load or atomic load before - // this instruction. + // Check whether it is legitimate to insert a load before this + // instruction. if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(SpvOpLoad, inst_it)) { return; } - if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(SpvOpAtomicLoad, - inst_it)) { + + // Randomly decide whether to try inserting a load here. + if (!GetFuzzerContext()->ChoosePercentage( + GetFuzzerContext()->GetChanceOfAddingLoad())) { return; } @@ -84,53 +79,13 @@ void FuzzerPassAddLoads::Apply() { return; } - auto chosen_instruction = - relevant_instructions[GetFuzzerContext()->RandomIndex( - relevant_instructions)]; - - bool is_atomic_load = false; - uint32_t memory_scope_id = 0; - uint32_t memory_semantics_id = 0; - - auto storage_class = static_cast( - GetIRContext() - ->get_def_use_mgr() - ->GetDef(chosen_instruction->type_id()) - ->GetSingleWordInOperand(0)); - - switch (storage_class) { - case SpvStorageClassStorageBuffer: - case SpvStorageClassPhysicalStorageBuffer: - case SpvStorageClassWorkgroup: - case SpvStorageClassCrossWorkgroup: - case SpvStorageClassAtomicCounter: - case SpvStorageClassImage: - if (GetFuzzerContext()->ChoosePercentage( - GetFuzzerContext()->GetChanceOfAddingAtomicLoad())) { - is_atomic_load = true; - - memory_scope_id = FindOrCreateConstant( - {SpvScopeInvocation}, - FindOrCreateIntegerType(32, GetFuzzerContext()->ChooseEven()), - false); - - memory_semantics_id = FindOrCreateConstant( - {static_cast( - fuzzerutil::GetMemorySemanticsForStorageClass( - storage_class))}, - FindOrCreateIntegerType(32, GetFuzzerContext()->ChooseEven()), - false); - } - break; - - default: - break; - } - - // Create and apply the transformation. + // Choose a pointer at random, and create and apply a loading + // transformation based on it. ApplyTransformation(TransformationLoad( - GetFuzzerContext()->GetFreshId(), chosen_instruction->result_id(), - is_atomic_load, memory_scope_id, memory_semantics_id, + GetFuzzerContext()->GetFreshId(), + relevant_instructions[GetFuzzerContext()->RandomIndex( + relevant_instructions)] + ->result_id(), instruction_descriptor)); }); } diff --git a/source/fuzz/fuzzer_pass_add_loads.h b/source/fuzz/fuzzer_pass_add_loads.h index 14460e7f..3913c624 100644 --- a/source/fuzz/fuzzer_pass_add_loads.h +++ b/source/fuzz/fuzzer_pass_add_loads.h @@ -26,8 +26,7 @@ class FuzzerPassAddLoads : public FuzzerPass { FuzzerPassAddLoads(opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_add_local_variables.cpp b/source/fuzz/fuzzer_pass_add_local_variables.cpp index a4e739f8..a50b0b07 100644 --- a/source/fuzz/fuzzer_pass_add_local_variables.cpp +++ b/source/fuzz/fuzzer_pass_add_local_variables.cpp @@ -24,10 +24,9 @@ namespace fuzz { FuzzerPassAddLocalVariables::FuzzerPassAddLocalVariables( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAddLocalVariables::Apply() { auto basic_type_ids_and_pointers = @@ -35,10 +34,6 @@ void FuzzerPassAddLocalVariables::Apply() { // These are the basic types that are available to this fuzzer pass. auto& basic_types = basic_type_ids_and_pointers.first; - if (basic_types.empty()) { - // The pass cannot do anything if there are no basic types. - return; - } // These are the pointers to those basic types that are *initially* available // to the fuzzer pass. The fuzzer pass might add pointer types in cases where diff --git a/source/fuzz/fuzzer_pass_add_local_variables.h b/source/fuzz/fuzzer_pass_add_local_variables.h index c969ba06..d73dae29 100644 --- a/source/fuzz/fuzzer_pass_add_local_variables.h +++ b/source/fuzz/fuzzer_pass_add_local_variables.h @@ -27,8 +27,7 @@ class FuzzerPassAddLocalVariables : public FuzzerPass { FuzzerPassAddLocalVariables( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_add_loop_preheaders.cpp b/source/fuzz/fuzzer_pass_add_loop_preheaders.cpp index e8c9e964..1cfed866 100644 --- a/source/fuzz/fuzzer_pass_add_loop_preheaders.cpp +++ b/source/fuzz/fuzzer_pass_add_loop_preheaders.cpp @@ -23,10 +23,9 @@ namespace fuzz { FuzzerPassAddLoopPreheaders::FuzzerPassAddLoopPreheaders( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAddLoopPreheaders::Apply() { for (auto& function : *GetIRContext()->module()) { diff --git a/source/fuzz/fuzzer_pass_add_loop_preheaders.h b/source/fuzz/fuzzer_pass_add_loop_preheaders.h index 2a13dbac..8ac2dac8 100644 --- a/source/fuzz/fuzzer_pass_add_loop_preheaders.h +++ b/source/fuzz/fuzzer_pass_add_loop_preheaders.h @@ -30,8 +30,7 @@ class FuzzerPassAddLoopPreheaders : public FuzzerPass { FuzzerPassAddLoopPreheaders( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_add_loops_to_create_int_constant_synonyms.cpp b/source/fuzz/fuzzer_pass_add_loops_to_create_int_constant_synonyms.cpp index 1a65ef61..69e0697f 100644 --- a/source/fuzz/fuzzer_pass_add_loops_to_create_int_constant_synonyms.cpp +++ b/source/fuzz/fuzzer_pass_add_loops_to_create_int_constant_synonyms.cpp @@ -29,10 +29,9 @@ FuzzerPassAddLoopsToCreateIntConstantSynonyms:: opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAddLoopsToCreateIntConstantSynonyms::Apply() { std::vector constants; diff --git a/source/fuzz/fuzzer_pass_add_loops_to_create_int_constant_synonyms.h b/source/fuzz/fuzzer_pass_add_loops_to_create_int_constant_synonyms.h index 14e17542..2eacef5f 100644 --- a/source/fuzz/fuzzer_pass_add_loops_to_create_int_constant_synonyms.h +++ b/source/fuzz/fuzzer_pass_add_loops_to_create_int_constant_synonyms.h @@ -28,8 +28,7 @@ class FuzzerPassAddLoopsToCreateIntConstantSynonyms : public FuzzerPass { FuzzerPassAddLoopsToCreateIntConstantSynonyms( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; diff --git a/source/fuzz/fuzzer_pass_add_no_contraction_decorations.cpp b/source/fuzz/fuzzer_pass_add_no_contraction_decorations.cpp index 8ae6e90a..d0753100 100644 --- a/source/fuzz/fuzzer_pass_add_no_contraction_decorations.cpp +++ b/source/fuzz/fuzzer_pass_add_no_contraction_decorations.cpp @@ -22,10 +22,9 @@ namespace fuzz { FuzzerPassAddNoContractionDecorations::FuzzerPassAddNoContractionDecorations( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAddNoContractionDecorations::Apply() { // Consider every instruction in every block in every function. diff --git a/source/fuzz/fuzzer_pass_add_no_contraction_decorations.h b/source/fuzz/fuzzer_pass_add_no_contraction_decorations.h index 7aeb26de..74212d87 100644 --- a/source/fuzz/fuzzer_pass_add_no_contraction_decorations.h +++ b/source/fuzz/fuzzer_pass_add_no_contraction_decorations.h @@ -26,8 +26,7 @@ class FuzzerPassAddNoContractionDecorations : public FuzzerPass { FuzzerPassAddNoContractionDecorations( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_add_opphi_synonyms.cpp b/source/fuzz/fuzzer_pass_add_opphi_synonyms.cpp index 73b6b0ac..be6e7ea1 100644 --- a/source/fuzz/fuzzer_pass_add_opphi_synonyms.cpp +++ b/source/fuzz/fuzzer_pass_add_opphi_synonyms.cpp @@ -23,10 +23,9 @@ namespace fuzz { FuzzerPassAddOpPhiSynonyms::FuzzerPassAddOpPhiSynonyms( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAddOpPhiSynonyms::Apply() { // Get a list of synonymous ids with the same type that can be used in the diff --git a/source/fuzz/fuzzer_pass_add_opphi_synonyms.h b/source/fuzz/fuzzer_pass_add_opphi_synonyms.h index c45c9a8a..9077118e 100644 --- a/source/fuzz/fuzzer_pass_add_opphi_synonyms.h +++ b/source/fuzz/fuzzer_pass_add_opphi_synonyms.h @@ -25,11 +25,10 @@ namespace fuzz { // synonymous with the others. class FuzzerPassAddOpPhiSynonyms : public FuzzerPass { public: - FuzzerPassAddOpPhiSynonyms(opt::IRContext* ir_context, - TransformationContext* transformation_context, - FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + FuzzerPassAddOpPhiSynonyms( + opt::IRContext* ir_context, TransformationContext* transformation_context, + FuzzerContext* fuzzer_context, + protobufs::TransformationSequence* transformations); void Apply() override; diff --git a/source/fuzz/fuzzer_pass_add_parameters.cpp b/source/fuzz/fuzzer_pass_add_parameters.cpp index 1cb6a79d..784653d8 100644 --- a/source/fuzz/fuzzer_pass_add_parameters.cpp +++ b/source/fuzz/fuzzer_pass_add_parameters.cpp @@ -25,10 +25,9 @@ namespace fuzz { FuzzerPassAddParameters::FuzzerPassAddParameters( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAddParameters::Apply() { // Compute type candidates for the new parameter. diff --git a/source/fuzz/fuzzer_pass_add_parameters.h b/source/fuzz/fuzzer_pass_add_parameters.h index c79f0e09..47dde390 100644 --- a/source/fuzz/fuzzer_pass_add_parameters.h +++ b/source/fuzz/fuzzer_pass_add_parameters.h @@ -30,8 +30,7 @@ class FuzzerPassAddParameters : public FuzzerPass { FuzzerPassAddParameters(opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; diff --git a/source/fuzz/fuzzer_pass_add_relaxed_decorations.cpp b/source/fuzz/fuzzer_pass_add_relaxed_decorations.cpp index b8c2b559..58c6d1b2 100644 --- a/source/fuzz/fuzzer_pass_add_relaxed_decorations.cpp +++ b/source/fuzz/fuzzer_pass_add_relaxed_decorations.cpp @@ -22,10 +22,9 @@ namespace fuzz { FuzzerPassAddRelaxedDecorations::FuzzerPassAddRelaxedDecorations( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAddRelaxedDecorations::Apply() { // Consider every instruction in every block in every function. diff --git a/source/fuzz/fuzzer_pass_add_relaxed_decorations.h b/source/fuzz/fuzzer_pass_add_relaxed_decorations.h index 51eb5942..723c4a0a 100644 --- a/source/fuzz/fuzzer_pass_add_relaxed_decorations.h +++ b/source/fuzz/fuzzer_pass_add_relaxed_decorations.h @@ -26,8 +26,7 @@ class FuzzerPassAddRelaxedDecorations : public FuzzerPass { FuzzerPassAddRelaxedDecorations( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_add_stores.cpp b/source/fuzz/fuzzer_pass_add_stores.cpp index 606e4a63..f89428d3 100644 --- a/source/fuzz/fuzzer_pass_add_stores.cpp +++ b/source/fuzz/fuzzer_pass_add_stores.cpp @@ -23,10 +23,9 @@ namespace fuzz { FuzzerPassAddStores::FuzzerPassAddStores( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAddStores::Apply() { ForEachInstructionWithInstructionDescriptor( @@ -39,20 +38,16 @@ void FuzzerPassAddStores::Apply() { "The opcode of the instruction we might insert before must be " "the same as the opcode in the descriptor for the instruction"); - // Randomly decide whether to try inserting a store here. - if (!GetFuzzerContext()->ChoosePercentage( - GetFuzzerContext()->GetChanceOfAddingStore())) { - return; - } - // Check whether it is legitimate to insert a store before this // instruction. if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(SpvOpStore, inst_it)) { return; } - if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(SpvOpAtomicStore, - inst_it)) { + + // Randomly decide whether to try inserting a store here. + if (!GetFuzzerContext()->ChoosePercentage( + GetFuzzerContext()->GetChanceOfAddingStore())) { return; } @@ -121,49 +116,10 @@ void FuzzerPassAddStores::Apply() { return; } - bool is_atomic_store = false; - uint32_t memory_scope_id = 0; - uint32_t memory_semantics_id = 0; - - auto storage_class = - static_cast(GetIRContext() - ->get_def_use_mgr() - ->GetDef(pointer->type_id()) - ->GetSingleWordInOperand(0)); - - switch (storage_class) { - case SpvStorageClassStorageBuffer: - case SpvStorageClassPhysicalStorageBuffer: - case SpvStorageClassWorkgroup: - case SpvStorageClassCrossWorkgroup: - case SpvStorageClassAtomicCounter: - case SpvStorageClassImage: - if (GetFuzzerContext()->ChoosePercentage( - GetFuzzerContext()->GetChanceOfAddingAtomicStore())) { - is_atomic_store = true; - - memory_scope_id = FindOrCreateConstant( - {SpvScopeInvocation}, - FindOrCreateIntegerType(32, GetFuzzerContext()->ChooseEven()), - false); - - memory_semantics_id = FindOrCreateConstant( - {static_cast( - fuzzerutil::GetMemorySemanticsForStorageClass( - storage_class))}, - FindOrCreateIntegerType(32, GetFuzzerContext()->ChooseEven()), - false); - } - break; - - default: - break; - } - - // Create and apply the transformation. + // Choose a value at random, and create and apply a storing + // transformation based on it and the pointer. ApplyTransformation(TransformationStore( - pointer->result_id(), is_atomic_store, memory_scope_id, - memory_semantics_id, + pointer->result_id(), relevant_values[GetFuzzerContext()->RandomIndex(relevant_values)] ->result_id(), instruction_descriptor)); diff --git a/source/fuzz/fuzzer_pass_add_stores.h b/source/fuzz/fuzzer_pass_add_stores.h index b18dde1f..9519c385 100644 --- a/source/fuzz/fuzzer_pass_add_stores.h +++ b/source/fuzz/fuzzer_pass_add_stores.h @@ -28,8 +28,7 @@ class FuzzerPassAddStores : public FuzzerPass { FuzzerPassAddStores(opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_add_synonyms.cpp b/source/fuzz/fuzzer_pass_add_synonyms.cpp index 1d188deb..2a85e52c 100644 --- a/source/fuzz/fuzzer_pass_add_synonyms.cpp +++ b/source/fuzz/fuzzer_pass_add_synonyms.cpp @@ -25,10 +25,9 @@ namespace fuzz { FuzzerPassAddSynonyms::FuzzerPassAddSynonyms( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAddSynonyms::Apply() { ForEachInstructionWithInstructionDescriptor( @@ -80,8 +79,6 @@ void FuzzerPassAddSynonyms::Apply() { case protobufs::TransformationAddSynonym::ADD_ZERO: case protobufs::TransformationAddSynonym::SUB_ZERO: case protobufs::TransformationAddSynonym::LOGICAL_OR: - case protobufs::TransformationAddSynonym::BITWISE_OR: - case protobufs::TransformationAddSynonym::BITWISE_XOR: // Create a zero constant to be used as an operand of the synonymous // instruction. FindOrCreateZeroConstant(existing_synonym->type_id(), false); diff --git a/source/fuzz/fuzzer_pass_add_synonyms.h b/source/fuzz/fuzzer_pass_add_synonyms.h index b0c174bc..ccf4a886 100644 --- a/source/fuzz/fuzzer_pass_add_synonyms.h +++ b/source/fuzz/fuzzer_pass_add_synonyms.h @@ -27,8 +27,7 @@ class FuzzerPassAddSynonyms : public FuzzerPass { FuzzerPassAddSynonyms(opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_add_vector_shuffle_instructions.cpp b/source/fuzz/fuzzer_pass_add_vector_shuffle_instructions.cpp index a29d1d34..e2eaaa0a 100644 --- a/source/fuzz/fuzzer_pass_add_vector_shuffle_instructions.cpp +++ b/source/fuzz/fuzzer_pass_add_vector_shuffle_instructions.cpp @@ -24,10 +24,9 @@ namespace fuzz { FuzzerPassAddVectorShuffleInstructions::FuzzerPassAddVectorShuffleInstructions( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAddVectorShuffleInstructions::Apply() { ForEachInstructionWithInstructionDescriptor( @@ -76,7 +75,7 @@ void FuzzerPassAddVectorShuffleInstructions::Apply() { ->IdIsIrrelevant(instruction->result_id()) && !fuzzerutil::CanMakeSynonymOf(ir_context, *GetTransformationContext(), - *instruction)) { + instruction)) { // If the id is irrelevant, we can use it since it will not // participate in DataSynonym fact. Otherwise, we should be // able to produce a synonym out of the id. diff --git a/source/fuzz/fuzzer_pass_add_vector_shuffle_instructions.h b/source/fuzz/fuzzer_pass_add_vector_shuffle_instructions.h index 64d6608a..c5af374c 100644 --- a/source/fuzz/fuzzer_pass_add_vector_shuffle_instructions.h +++ b/source/fuzz/fuzzer_pass_add_vector_shuffle_instructions.h @@ -26,8 +26,7 @@ class FuzzerPassAddVectorShuffleInstructions : public FuzzerPass { FuzzerPassAddVectorShuffleInstructions( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_adjust_branch_weights.cpp b/source/fuzz/fuzzer_pass_adjust_branch_weights.cpp index 94428f72..3c4f3803 100644 --- a/source/fuzz/fuzzer_pass_adjust_branch_weights.cpp +++ b/source/fuzz/fuzzer_pass_adjust_branch_weights.cpp @@ -24,10 +24,9 @@ namespace fuzz { FuzzerPassAdjustBranchWeights::FuzzerPassAdjustBranchWeights( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAdjustBranchWeights::Apply() { // For all OpBranchConditional instructions, diff --git a/source/fuzz/fuzzer_pass_adjust_branch_weights.h b/source/fuzz/fuzzer_pass_adjust_branch_weights.h index ae1ea345..de2f33d3 100644 --- a/source/fuzz/fuzzer_pass_adjust_branch_weights.h +++ b/source/fuzz/fuzzer_pass_adjust_branch_weights.h @@ -28,8 +28,7 @@ class FuzzerPassAdjustBranchWeights : public FuzzerPass { FuzzerPassAdjustBranchWeights( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_adjust_function_controls.cpp b/source/fuzz/fuzzer_pass_adjust_function_controls.cpp index 1c2bc8cf..b38bd212 100644 --- a/source/fuzz/fuzzer_pass_adjust_function_controls.cpp +++ b/source/fuzz/fuzzer_pass_adjust_function_controls.cpp @@ -22,10 +22,9 @@ namespace fuzz { FuzzerPassAdjustFunctionControls::FuzzerPassAdjustFunctionControls( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAdjustFunctionControls::Apply() { // Consider every function in the module. diff --git a/source/fuzz/fuzzer_pass_adjust_function_controls.h b/source/fuzz/fuzzer_pass_adjust_function_controls.h index 7a8c4927..5ef32a18 100644 --- a/source/fuzz/fuzzer_pass_adjust_function_controls.h +++ b/source/fuzz/fuzzer_pass_adjust_function_controls.h @@ -26,8 +26,7 @@ class FuzzerPassAdjustFunctionControls : public FuzzerPass { FuzzerPassAdjustFunctionControls( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_adjust_loop_controls.cpp b/source/fuzz/fuzzer_pass_adjust_loop_controls.cpp index fe855cad..0f7cf037 100644 --- a/source/fuzz/fuzzer_pass_adjust_loop_controls.cpp +++ b/source/fuzz/fuzzer_pass_adjust_loop_controls.cpp @@ -22,10 +22,9 @@ namespace fuzz { FuzzerPassAdjustLoopControls::FuzzerPassAdjustLoopControls( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAdjustLoopControls::Apply() { // Consider every merge instruction in the module (via looking through all diff --git a/source/fuzz/fuzzer_pass_adjust_loop_controls.h b/source/fuzz/fuzzer_pass_adjust_loop_controls.h index 25e83047..4ca670b7 100644 --- a/source/fuzz/fuzzer_pass_adjust_loop_controls.h +++ b/source/fuzz/fuzzer_pass_adjust_loop_controls.h @@ -26,8 +26,7 @@ class FuzzerPassAdjustLoopControls : public FuzzerPass { FuzzerPassAdjustLoopControls( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_adjust_memory_operands_masks.cpp b/source/fuzz/fuzzer_pass_adjust_memory_operands_masks.cpp index d2ff40e6..778d43ff 100644 --- a/source/fuzz/fuzzer_pass_adjust_memory_operands_masks.cpp +++ b/source/fuzz/fuzzer_pass_adjust_memory_operands_masks.cpp @@ -23,10 +23,9 @@ namespace fuzz { FuzzerPassAdjustMemoryOperandsMasks::FuzzerPassAdjustMemoryOperandsMasks( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAdjustMemoryOperandsMasks::Apply() { // Consider every block in every function. diff --git a/source/fuzz/fuzzer_pass_adjust_memory_operands_masks.h b/source/fuzz/fuzzer_pass_adjust_memory_operands_masks.h index 3197f91b..a068b8dd 100644 --- a/source/fuzz/fuzzer_pass_adjust_memory_operands_masks.h +++ b/source/fuzz/fuzzer_pass_adjust_memory_operands_masks.h @@ -27,8 +27,7 @@ class FuzzerPassAdjustMemoryOperandsMasks : public FuzzerPass { FuzzerPassAdjustMemoryOperandsMasks( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_adjust_selection_controls.cpp b/source/fuzz/fuzzer_pass_adjust_selection_controls.cpp index 7d8e6b57..d9b4e293 100644 --- a/source/fuzz/fuzzer_pass_adjust_selection_controls.cpp +++ b/source/fuzz/fuzzer_pass_adjust_selection_controls.cpp @@ -22,10 +22,9 @@ namespace fuzz { FuzzerPassAdjustSelectionControls::FuzzerPassAdjustSelectionControls( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassAdjustSelectionControls::Apply() { // Consider every merge instruction in the module (via looking through all diff --git a/source/fuzz/fuzzer_pass_adjust_selection_controls.h b/source/fuzz/fuzzer_pass_adjust_selection_controls.h index ac55de79..6931f942 100644 --- a/source/fuzz/fuzzer_pass_adjust_selection_controls.h +++ b/source/fuzz/fuzzer_pass_adjust_selection_controls.h @@ -26,8 +26,7 @@ class FuzzerPassAdjustSelectionControls : public FuzzerPass { FuzzerPassAdjustSelectionControls( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_apply_id_synonyms.cpp b/source/fuzz/fuzzer_pass_apply_id_synonyms.cpp index 8965c15e..71208313 100644 --- a/source/fuzz/fuzzer_pass_apply_id_synonyms.cpp +++ b/source/fuzz/fuzzer_pass_apply_id_synonyms.cpp @@ -28,10 +28,9 @@ namespace fuzz { FuzzerPassApplyIdSynonyms::FuzzerPassApplyIdSynonyms( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassApplyIdSynonyms::Apply() { // Compute a closure of data synonym facts, to enrich the pool of synonyms diff --git a/source/fuzz/fuzzer_pass_apply_id_synonyms.h b/source/fuzz/fuzzer_pass_apply_id_synonyms.h index 3da9c5d6..b402b509 100644 --- a/source/fuzz/fuzzer_pass_apply_id_synonyms.h +++ b/source/fuzz/fuzzer_pass_apply_id_synonyms.h @@ -28,8 +28,7 @@ class FuzzerPassApplyIdSynonyms : public FuzzerPass { FuzzerPassApplyIdSynonyms(opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; diff --git a/source/fuzz/fuzzer_pass_construct_composites.cpp b/source/fuzz/fuzzer_pass_construct_composites.cpp index ff022fcc..1a174cf1 100644 --- a/source/fuzz/fuzzer_pass_construct_composites.cpp +++ b/source/fuzz/fuzzer_pass_construct_composites.cpp @@ -26,10 +26,9 @@ namespace fuzz { FuzzerPassConstructComposites::FuzzerPassConstructComposites( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassConstructComposites::Apply() { // Gather up the ids of all composite types, but skip block-/buffer @@ -62,7 +61,7 @@ void FuzzerPassConstructComposites::Apply() { return GetTransformationContext()->GetFactManager()->IdIsIrrelevant( inst->result_id()) || fuzzerutil::CanMakeSynonymOf(ir_context, - *GetTransformationContext(), *inst); + *GetTransformationContext(), inst); }); ForEachInstructionWithInstructionDescriptor( diff --git a/source/fuzz/fuzzer_pass_construct_composites.h b/source/fuzz/fuzzer_pass_construct_composites.h index 81413980..333ac931 100644 --- a/source/fuzz/fuzzer_pass_construct_composites.h +++ b/source/fuzz/fuzzer_pass_construct_composites.h @@ -29,8 +29,7 @@ class FuzzerPassConstructComposites : public FuzzerPass { FuzzerPassConstructComposites( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; diff --git a/source/fuzz/fuzzer_pass_copy_objects.cpp b/source/fuzz/fuzzer_pass_copy_objects.cpp index 80cc2a57..09b5368a 100644 --- a/source/fuzz/fuzzer_pass_copy_objects.cpp +++ b/source/fuzz/fuzzer_pass_copy_objects.cpp @@ -24,10 +24,9 @@ namespace fuzz { FuzzerPassCopyObjects::FuzzerPassCopyObjects( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassCopyObjects::Apply() { ForEachInstructionWithInstructionDescriptor( diff --git a/source/fuzz/fuzzer_pass_copy_objects.h b/source/fuzz/fuzzer_pass_copy_objects.h index 2fb5a53f..461cd979 100644 --- a/source/fuzz/fuzzer_pass_copy_objects.h +++ b/source/fuzz/fuzzer_pass_copy_objects.h @@ -26,8 +26,7 @@ class FuzzerPassCopyObjects : public FuzzerPass { FuzzerPassCopyObjects(opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_donate_modules.cpp b/source/fuzz/fuzzer_pass_donate_modules.cpp index 5bdf6973..2f2ed50a 100644 --- a/source/fuzz/fuzzer_pass_donate_modules.cpp +++ b/source/fuzz/fuzzer_pass_donate_modules.cpp @@ -45,11 +45,10 @@ FuzzerPassDonateModules::FuzzerPassDonateModules( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations, - std::vector donor_suppliers) + const std::vector& donor_suppliers) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations), - donor_suppliers_(std::move(donor_suppliers)) {} + transformations), + donor_suppliers_(donor_suppliers) {} void FuzzerPassDonateModules::Apply() { // If there are no donor suppliers, this fuzzer pass is a no-op. diff --git a/source/fuzz/fuzzer_pass_donate_modules.h b/source/fuzz/fuzzer_pass_donate_modules.h index 924dd358..1581a8a4 100644 --- a/source/fuzz/fuzzer_pass_donate_modules.h +++ b/source/fuzz/fuzzer_pass_donate_modules.h @@ -31,8 +31,7 @@ class FuzzerPassDonateModules : public FuzzerPass { opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations, - std::vector donor_suppliers); + const std::vector& donor_suppliers); void Apply() override; diff --git a/source/fuzz/fuzzer_pass_duplicate_regions_with_selections.cpp b/source/fuzz/fuzzer_pass_duplicate_regions_with_selections.cpp index 3a9a7e66..e08d65b1 100644 --- a/source/fuzz/fuzzer_pass_duplicate_regions_with_selections.cpp +++ b/source/fuzz/fuzzer_pass_duplicate_regions_with_selections.cpp @@ -25,10 +25,9 @@ FuzzerPassDuplicateRegionsWithSelections:: opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassDuplicateRegionsWithSelections::Apply() { // Iterate over all of the functions in the module. diff --git a/source/fuzz/fuzzer_pass_duplicate_regions_with_selections.h b/source/fuzz/fuzzer_pass_duplicate_regions_with_selections.h index 74343a66..7cb1197d 100644 --- a/source/fuzz/fuzzer_pass_duplicate_regions_with_selections.h +++ b/source/fuzz/fuzzer_pass_duplicate_regions_with_selections.h @@ -29,8 +29,7 @@ class FuzzerPassDuplicateRegionsWithSelections : public FuzzerPass { FuzzerPassDuplicateRegionsWithSelections( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_expand_vector_reductions.cpp b/source/fuzz/fuzzer_pass_expand_vector_reductions.cpp index 5bf0461d..e25dcbc3 100644 --- a/source/fuzz/fuzzer_pass_expand_vector_reductions.cpp +++ b/source/fuzz/fuzzer_pass_expand_vector_reductions.cpp @@ -24,10 +24,9 @@ namespace fuzz { FuzzerPassExpandVectorReductions::FuzzerPassExpandVectorReductions( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassExpandVectorReductions::Apply() { for (auto& function : *GetIRContext()->module()) { @@ -47,7 +46,7 @@ void FuzzerPassExpandVectorReductions::Apply() { // It must be able to make a synonym of |instruction|. if (!fuzzerutil::CanMakeSynonymOf( - GetIRContext(), *GetTransformationContext(), instruction)) { + GetIRContext(), *GetTransformationContext(), &instruction)) { continue; } diff --git a/source/fuzz/fuzzer_pass_expand_vector_reductions.h b/source/fuzz/fuzzer_pass_expand_vector_reductions.h index c0673e12..ed0225df 100644 --- a/source/fuzz/fuzzer_pass_expand_vector_reductions.h +++ b/source/fuzz/fuzzer_pass_expand_vector_reductions.h @@ -28,8 +28,7 @@ class FuzzerPassExpandVectorReductions : public FuzzerPass { FuzzerPassExpandVectorReductions( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_flatten_conditional_branches.cpp b/source/fuzz/fuzzer_pass_flatten_conditional_branches.cpp index 70fa6a12..84da7a74 100644 --- a/source/fuzz/fuzzer_pass_flatten_conditional_branches.cpp +++ b/source/fuzz/fuzzer_pass_flatten_conditional_branches.cpp @@ -26,10 +26,9 @@ namespace fuzz { FuzzerPassFlattenConditionalBranches::FuzzerPassFlattenConditionalBranches( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassFlattenConditionalBranches::Apply() { for (auto& function : *GetIRContext()->module()) { diff --git a/source/fuzz/fuzzer_pass_flatten_conditional_branches.h b/source/fuzz/fuzzer_pass_flatten_conditional_branches.h index abfbc3c1..e7d7dc36 100644 --- a/source/fuzz/fuzzer_pass_flatten_conditional_branches.h +++ b/source/fuzz/fuzzer_pass_flatten_conditional_branches.h @@ -25,8 +25,7 @@ class FuzzerPassFlattenConditionalBranches : public FuzzerPass { FuzzerPassFlattenConditionalBranches( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; diff --git a/source/fuzz/fuzzer_pass_inline_functions.cpp b/source/fuzz/fuzzer_pass_inline_functions.cpp index 4024096f..405afd8b 100644 --- a/source/fuzz/fuzzer_pass_inline_functions.cpp +++ b/source/fuzz/fuzzer_pass_inline_functions.cpp @@ -25,10 +25,9 @@ namespace fuzz { FuzzerPassInlineFunctions::FuzzerPassInlineFunctions( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassInlineFunctions::Apply() { // |function_call_instructions| are the instructions that will be inlined. diff --git a/source/fuzz/fuzzer_pass_inline_functions.h b/source/fuzz/fuzzer_pass_inline_functions.h index c4e0b831..a6ed8cad 100644 --- a/source/fuzz/fuzzer_pass_inline_functions.h +++ b/source/fuzz/fuzzer_pass_inline_functions.h @@ -28,8 +28,7 @@ class FuzzerPassInlineFunctions : public FuzzerPass { FuzzerPassInlineFunctions(opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_interchange_signedness_of_integer_operands.cpp b/source/fuzz/fuzzer_pass_interchange_signedness_of_integer_operands.cpp index d8780ff7..675cae9a 100644 --- a/source/fuzz/fuzzer_pass_interchange_signedness_of_integer_operands.cpp +++ b/source/fuzz/fuzzer_pass_interchange_signedness_of_integer_operands.cpp @@ -27,10 +27,9 @@ FuzzerPassInterchangeSignednessOfIntegerOperands:: opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassInterchangeSignednessOfIntegerOperands::Apply() { assert(!GetFuzzerContext()->IsWgslCompatible() && diff --git a/source/fuzz/fuzzer_pass_interchange_signedness_of_integer_operands.h b/source/fuzz/fuzzer_pass_interchange_signedness_of_integer_operands.h index 6a10e897..11b8fb6e 100644 --- a/source/fuzz/fuzzer_pass_interchange_signedness_of_integer_operands.h +++ b/source/fuzz/fuzzer_pass_interchange_signedness_of_integer_operands.h @@ -32,8 +32,7 @@ class FuzzerPassInterchangeSignednessOfIntegerOperands : public FuzzerPass { FuzzerPassInterchangeSignednessOfIntegerOperands( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; diff --git a/source/fuzz/fuzzer_pass_interchange_zero_like_constants.cpp b/source/fuzz/fuzzer_pass_interchange_zero_like_constants.cpp index 2c16cd5b..5d0a2223 100644 --- a/source/fuzz/fuzzer_pass_interchange_zero_like_constants.cpp +++ b/source/fuzz/fuzzer_pass_interchange_zero_like_constants.cpp @@ -25,10 +25,9 @@ namespace fuzz { FuzzerPassInterchangeZeroLikeConstants::FuzzerPassInterchangeZeroLikeConstants( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} uint32_t FuzzerPassInterchangeZeroLikeConstants::FindOrCreateToggledConstant( opt::Instruction* declaration) { diff --git a/source/fuzz/fuzzer_pass_interchange_zero_like_constants.h b/source/fuzz/fuzzer_pass_interchange_zero_like_constants.h index bb4a4dc7..012f03d3 100644 --- a/source/fuzz/fuzzer_pass_interchange_zero_like_constants.h +++ b/source/fuzz/fuzzer_pass_interchange_zero_like_constants.h @@ -33,8 +33,7 @@ class FuzzerPassInterchangeZeroLikeConstants : public FuzzerPass { FuzzerPassInterchangeZeroLikeConstants( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; diff --git a/source/fuzz/fuzzer_pass_invert_comparison_operators.cpp b/source/fuzz/fuzzer_pass_invert_comparison_operators.cpp index 130f7502..542748e9 100644 --- a/source/fuzz/fuzzer_pass_invert_comparison_operators.cpp +++ b/source/fuzz/fuzzer_pass_invert_comparison_operators.cpp @@ -24,10 +24,9 @@ namespace fuzz { FuzzerPassInvertComparisonOperators::FuzzerPassInvertComparisonOperators( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassInvertComparisonOperators::Apply() { GetIRContext()->module()->ForEachInst([this](const opt::Instruction* inst) { diff --git a/source/fuzz/fuzzer_pass_invert_comparison_operators.h b/source/fuzz/fuzzer_pass_invert_comparison_operators.h index d0d09edb..5f015c28 100644 --- a/source/fuzz/fuzzer_pass_invert_comparison_operators.h +++ b/source/fuzz/fuzzer_pass_invert_comparison_operators.h @@ -27,8 +27,7 @@ class FuzzerPassInvertComparisonOperators : public FuzzerPass { FuzzerPassInvertComparisonOperators( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_make_vector_operations_dynamic.cpp b/source/fuzz/fuzzer_pass_make_vector_operations_dynamic.cpp index b755d235..7bf07a49 100644 --- a/source/fuzz/fuzzer_pass_make_vector_operations_dynamic.cpp +++ b/source/fuzz/fuzzer_pass_make_vector_operations_dynamic.cpp @@ -24,10 +24,9 @@ namespace fuzz { FuzzerPassMakeVectorOperationsDynamic::FuzzerPassMakeVectorOperationsDynamic( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassMakeVectorOperationsDynamic::Apply() { for (auto& function : *GetIRContext()->module()) { diff --git a/source/fuzz/fuzzer_pass_make_vector_operations_dynamic.h b/source/fuzz/fuzzer_pass_make_vector_operations_dynamic.h index b6a46c78..da27825a 100644 --- a/source/fuzz/fuzzer_pass_make_vector_operations_dynamic.h +++ b/source/fuzz/fuzzer_pass_make_vector_operations_dynamic.h @@ -27,8 +27,7 @@ class FuzzerPassMakeVectorOperationsDynamic : public FuzzerPass { FuzzerPassMakeVectorOperationsDynamic( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_merge_blocks.cpp b/source/fuzz/fuzzer_pass_merge_blocks.cpp index 70200629..a8ec784c 100644 --- a/source/fuzz/fuzzer_pass_merge_blocks.cpp +++ b/source/fuzz/fuzzer_pass_merge_blocks.cpp @@ -24,10 +24,9 @@ namespace fuzz { FuzzerPassMergeBlocks::FuzzerPassMergeBlocks( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassMergeBlocks::Apply() { // First we populate a sequence of transformations that we might consider diff --git a/source/fuzz/fuzzer_pass_merge_blocks.h b/source/fuzz/fuzzer_pass_merge_blocks.h index 46e257f1..66cf4c64 100644 --- a/source/fuzz/fuzzer_pass_merge_blocks.h +++ b/source/fuzz/fuzzer_pass_merge_blocks.h @@ -26,8 +26,7 @@ class FuzzerPassMergeBlocks : public FuzzerPass { FuzzerPassMergeBlocks(opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_merge_function_returns.cpp b/source/fuzz/fuzzer_pass_merge_function_returns.cpp index 220f707b..70fa8200 100644 --- a/source/fuzz/fuzzer_pass_merge_function_returns.cpp +++ b/source/fuzz/fuzzer_pass_merge_function_returns.cpp @@ -26,10 +26,9 @@ namespace fuzz { FuzzerPassMergeFunctionReturns::FuzzerPassMergeFunctionReturns( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassMergeFunctionReturns::Apply() { // The pass might add new functions to the module (due to wrapping early @@ -173,9 +172,8 @@ void FuzzerPassMergeFunctionReturns::Apply() { } // Get the ids needed by the transformation. - const uint32_t outer_header_id = GetFuzzerContext()->GetFreshId(); - const uint32_t unreachable_continue_id = GetFuzzerContext()->GetFreshId(); - const uint32_t outer_return_id = GetFuzzerContext()->GetFreshId(); + uint32_t outer_header_id = GetFuzzerContext()->GetFreshId(); + uint32_t outer_return_id = GetFuzzerContext()->GetFreshId(); bool function_is_void = GetIRContext()->get_type_mgr()->GetType(function->type_id())->AsVoid(); @@ -211,8 +209,8 @@ void FuzzerPassMergeFunctionReturns::Apply() { // Apply the transformation if it is applicable (it could be inapplicable if // adding new predecessors to merge blocks breaks dominance rules). MaybeApplyTransformation(TransformationMergeFunctionReturns( - function->result_id(), outer_header_id, unreachable_continue_id, - outer_return_id, return_val_id, returnable_val_id, merge_blocks_info)); + function->result_id(), outer_header_id, outer_return_id, return_val_id, + returnable_val_id, merge_blocks_info)); } } diff --git a/source/fuzz/fuzzer_pass_merge_function_returns.h b/source/fuzz/fuzzer_pass_merge_function_returns.h index a799b8be..ddd2c9dc 100644 --- a/source/fuzz/fuzzer_pass_merge_function_returns.h +++ b/source/fuzz/fuzzer_pass_merge_function_returns.h @@ -31,8 +31,7 @@ class FuzzerPassMergeFunctionReturns : public FuzzerPass { FuzzerPassMergeFunctionReturns( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; diff --git a/source/fuzz/fuzzer_pass_mutate_pointers.cpp b/source/fuzz/fuzzer_pass_mutate_pointers.cpp index bbe05409..f021a978 100644 --- a/source/fuzz/fuzzer_pass_mutate_pointers.cpp +++ b/source/fuzz/fuzzer_pass_mutate_pointers.cpp @@ -24,10 +24,9 @@ namespace fuzz { FuzzerPassMutatePointers::FuzzerPassMutatePointers( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassMutatePointers::Apply() { ForEachInstructionWithInstructionDescriptor( diff --git a/source/fuzz/fuzzer_pass_mutate_pointers.h b/source/fuzz/fuzzer_pass_mutate_pointers.h index 45c6a7cc..5ef6a2ab 100644 --- a/source/fuzz/fuzzer_pass_mutate_pointers.h +++ b/source/fuzz/fuzzer_pass_mutate_pointers.h @@ -26,8 +26,7 @@ class FuzzerPassMutatePointers : public FuzzerPass { FuzzerPassMutatePointers(opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_obfuscate_constants.cpp b/source/fuzz/fuzzer_pass_obfuscate_constants.cpp index f60c1b4c..32318e89 100644 --- a/source/fuzz/fuzzer_pass_obfuscate_constants.cpp +++ b/source/fuzz/fuzzer_pass_obfuscate_constants.cpp @@ -30,10 +30,9 @@ namespace fuzz { FuzzerPassObfuscateConstants::FuzzerPassObfuscateConstants( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassObfuscateConstants::ObfuscateBoolConstantViaConstantPair( uint32_t depth, const protobufs::IdUseDescriptor& bool_constant_use, diff --git a/source/fuzz/fuzzer_pass_obfuscate_constants.h b/source/fuzz/fuzzer_pass_obfuscate_constants.h index 30e64d28..82b1092c 100644 --- a/source/fuzz/fuzzer_pass_obfuscate_constants.h +++ b/source/fuzz/fuzzer_pass_obfuscate_constants.h @@ -30,8 +30,7 @@ class FuzzerPassObfuscateConstants : public FuzzerPass { FuzzerPassObfuscateConstants( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; diff --git a/source/fuzz/fuzzer_pass_outline_functions.cpp b/source/fuzz/fuzzer_pass_outline_functions.cpp index b90c12dc..bfde61f7 100644 --- a/source/fuzz/fuzzer_pass_outline_functions.cpp +++ b/source/fuzz/fuzzer_pass_outline_functions.cpp @@ -27,10 +27,9 @@ namespace fuzz { FuzzerPassOutlineFunctions::FuzzerPassOutlineFunctions( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassOutlineFunctions::Apply() { std::vector original_functions; diff --git a/source/fuzz/fuzzer_pass_outline_functions.h b/source/fuzz/fuzzer_pass_outline_functions.h index d80dc4a7..45e52ff4 100644 --- a/source/fuzz/fuzzer_pass_outline_functions.h +++ b/source/fuzz/fuzzer_pass_outline_functions.h @@ -24,11 +24,10 @@ namespace fuzz { // flow graph into their own functions. class FuzzerPassOutlineFunctions : public FuzzerPass { public: - FuzzerPassOutlineFunctions(opt::IRContext* ir_context, - TransformationContext* transformation_context, - FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + FuzzerPassOutlineFunctions( + opt::IRContext* ir_context, TransformationContext* transformation_context, + FuzzerContext* fuzzer_context, + protobufs::TransformationSequence* transformations); void Apply() override; diff --git a/source/fuzz/fuzzer_pass_permute_blocks.cpp b/source/fuzz/fuzzer_pass_permute_blocks.cpp index e55fae32..769c49f0 100644 --- a/source/fuzz/fuzzer_pass_permute_blocks.cpp +++ b/source/fuzz/fuzzer_pass_permute_blocks.cpp @@ -22,10 +22,9 @@ namespace fuzz { FuzzerPassPermuteBlocks::FuzzerPassPermuteBlocks( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassPermuteBlocks::Apply() { // For now we do something very simple: we randomly decide whether to move a diff --git a/source/fuzz/fuzzer_pass_permute_blocks.h b/source/fuzz/fuzzer_pass_permute_blocks.h index 39326c2b..e40178e6 100644 --- a/source/fuzz/fuzzer_pass_permute_blocks.h +++ b/source/fuzz/fuzzer_pass_permute_blocks.h @@ -27,8 +27,7 @@ class FuzzerPassPermuteBlocks : public FuzzerPass { FuzzerPassPermuteBlocks(opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_permute_function_parameters.cpp b/source/fuzz/fuzzer_pass_permute_function_parameters.cpp index a8035b90..9a61bea0 100644 --- a/source/fuzz/fuzzer_pass_permute_function_parameters.cpp +++ b/source/fuzz/fuzzer_pass_permute_function_parameters.cpp @@ -28,10 +28,9 @@ namespace fuzz { FuzzerPassPermuteFunctionParameters::FuzzerPassPermuteFunctionParameters( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassPermuteFunctionParameters::Apply() { for (const auto& function : *GetIRContext()->module()) { diff --git a/source/fuzz/fuzzer_pass_permute_function_parameters.h b/source/fuzz/fuzzer_pass_permute_function_parameters.h index c5b6ad43..a4bf2ca5 100644 --- a/source/fuzz/fuzzer_pass_permute_function_parameters.h +++ b/source/fuzz/fuzzer_pass_permute_function_parameters.h @@ -32,8 +32,7 @@ class FuzzerPassPermuteFunctionParameters : public FuzzerPass { FuzzerPassPermuteFunctionParameters( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_permute_function_variables.cpp b/source/fuzz/fuzzer_pass_permute_function_variables.cpp deleted file mode 100644 index f8b9b450..00000000 --- a/source/fuzz/fuzzer_pass_permute_function_variables.cpp +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) 2021 Mostafa Ashraf -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/fuzz/fuzzer_pass_permute_function_variables.h" - -#include -#include -#include - -#include "source/fuzz/fuzzer_context.h" -#include "source/fuzz/fuzzer_util.h" -#include "source/fuzz/instruction_descriptor.h" -#include "source/fuzz/transformation_swap_function_variables.h" - -namespace spvtools { -namespace fuzz { - -FuzzerPassPermuteFunctionVariables::FuzzerPassPermuteFunctionVariables( - opt::IRContext* ir_context, TransformationContext* transformation_context, - FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) - : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) { -} // Here we call parent constructor. - -void FuzzerPassPermuteFunctionVariables::Apply() { - // Permuting OpVariable instructions in each function. - for (auto& function : *GetIRContext()->module()) { - if (!GetFuzzerContext()->ChoosePercentage( - GetFuzzerContext()->GetChanceOfPermutingFunctionVariables())) { - continue; - } - - auto first_block = function.entry().get(); - - std::vector variables; - for (auto& instruction : *first_block) { - if (instruction.opcode() == SpvOpVariable) { - variables.push_back(&instruction); - } - } - if (variables.size() <= 1) { - continue; - } - do { - uint32_t instruction_1_index = GetFuzzerContext()->RandomIndex(variables); - uint32_t instruction_2_index = GetFuzzerContext()->RandomIndex(variables); - - if (instruction_1_index != instruction_2_index) { - ApplyTransformation(TransformationSwapFunctionVariables( - variables[instruction_1_index]->result_id(), - variables[instruction_2_index]->result_id())); - } - - } while (GetFuzzerContext()->ChoosePercentage( - GetFuzzerContext() - ->GetChanceOfSwappingAnotherPairOfFunctionVariables()) && - variables.size() > 2); - } -} - -} // namespace fuzz -} // namespace spvtools diff --git a/source/fuzz/fuzzer_pass_permute_function_variables.h b/source/fuzz/fuzzer_pass_permute_function_variables.h deleted file mode 100644 index 2ebc15f2..00000000 --- a/source/fuzz/fuzzer_pass_permute_function_variables.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) 2021 Mostafa Ashraf -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SOURCE_FUZZ_FUZZER_PASS_PERMUTE_FUNCTION_VARIABLES_H_ -#define SOURCE_FUZZ_FUZZER_PASS_PERMUTE_FUNCTION_VARIABLES_H_ - -#include "source/fuzz/fuzzer_pass.h" - -namespace spvtools { -namespace fuzz { - -// This fuzzer pass permutes variables in functions in the module. -class FuzzerPassPermuteFunctionVariables : public FuzzerPass { - public: - FuzzerPassPermuteFunctionVariables( - opt::IRContext* ir_context, TransformationContext* transformation_context, - FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); - - void Apply() override; -}; - -} // namespace fuzz -} // namespace spvtools - -#endif // SOURCE_FUZZ_FUZZER_PASS_PERMUTE_FUNCTION_VARIABLES_H_ diff --git a/source/fuzz/fuzzer_pass_permute_instructions.cpp b/source/fuzz/fuzzer_pass_permute_instructions.cpp index 3ef76be4..f17e0187 100644 --- a/source/fuzz/fuzzer_pass_permute_instructions.cpp +++ b/source/fuzz/fuzzer_pass_permute_instructions.cpp @@ -25,10 +25,9 @@ namespace fuzz { FuzzerPassPermuteInstructions::FuzzerPassPermuteInstructions( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassPermuteInstructions::Apply() { // We are iterating over all instructions in all basic blocks. diff --git a/source/fuzz/fuzzer_pass_permute_instructions.h b/source/fuzz/fuzzer_pass_permute_instructions.h index b7ccbccb..027101dd 100644 --- a/source/fuzz/fuzzer_pass_permute_instructions.h +++ b/source/fuzz/fuzzer_pass_permute_instructions.h @@ -27,8 +27,7 @@ class FuzzerPassPermuteInstructions : public FuzzerPass { FuzzerPassPermuteInstructions( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_permute_phi_operands.cpp b/source/fuzz/fuzzer_pass_permute_phi_operands.cpp index 5fac9816..f2cc5231 100644 --- a/source/fuzz/fuzzer_pass_permute_phi_operands.cpp +++ b/source/fuzz/fuzzer_pass_permute_phi_operands.cpp @@ -28,10 +28,9 @@ namespace fuzz { FuzzerPassPermutePhiOperands::FuzzerPassPermutePhiOperands( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassPermutePhiOperands::Apply() { ForEachInstructionWithInstructionDescriptor( diff --git a/source/fuzz/fuzzer_pass_permute_phi_operands.h b/source/fuzz/fuzzer_pass_permute_phi_operands.h index 30a9d4f5..79999562 100644 --- a/source/fuzz/fuzzer_pass_permute_phi_operands.h +++ b/source/fuzz/fuzzer_pass_permute_phi_operands.h @@ -27,8 +27,7 @@ class FuzzerPassPermutePhiOperands : public FuzzerPass { FuzzerPassPermutePhiOperands( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_propagate_instructions_down.cpp b/source/fuzz/fuzzer_pass_propagate_instructions_down.cpp index 4c46dcd3..af27a5da 100644 --- a/source/fuzz/fuzzer_pass_propagate_instructions_down.cpp +++ b/source/fuzz/fuzzer_pass_propagate_instructions_down.cpp @@ -23,16 +23,16 @@ namespace fuzz { FuzzerPassPropagateInstructionsDown::FuzzerPassPropagateInstructionsDown( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassPropagateInstructionsDown::Apply() { for (const auto& function : *GetIRContext()->module()) { std::vector reachable_blocks; for (const auto& block : function) { - if (GetIRContext()->IsReachable(block)) { + if (GetIRContext()->GetDominatorAnalysis(&function)->IsReachable( + &block)) { reachable_blocks.push_back(&block); } } diff --git a/source/fuzz/fuzzer_pass_propagate_instructions_down.h b/source/fuzz/fuzzer_pass_propagate_instructions_down.h index 18f01654..a2a0aac8 100644 --- a/source/fuzz/fuzzer_pass_propagate_instructions_down.h +++ b/source/fuzz/fuzzer_pass_propagate_instructions_down.h @@ -26,8 +26,7 @@ class FuzzerPassPropagateInstructionsDown : public FuzzerPass { FuzzerPassPropagateInstructionsDown( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_propagate_instructions_up.cpp b/source/fuzz/fuzzer_pass_propagate_instructions_up.cpp index 5e45da83..8cd7437b 100644 --- a/source/fuzz/fuzzer_pass_propagate_instructions_up.cpp +++ b/source/fuzz/fuzzer_pass_propagate_instructions_up.cpp @@ -25,10 +25,9 @@ namespace fuzz { FuzzerPassPropagateInstructionsUp::FuzzerPassPropagateInstructionsUp( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassPropagateInstructionsUp::Apply() { for (const auto& function : *GetIRContext()->module()) { diff --git a/source/fuzz/fuzzer_pass_propagate_instructions_up.h b/source/fuzz/fuzzer_pass_propagate_instructions_up.h index 0cb8396b..b89be48d 100644 --- a/source/fuzz/fuzzer_pass_propagate_instructions_up.h +++ b/source/fuzz/fuzzer_pass_propagate_instructions_up.h @@ -27,8 +27,7 @@ class FuzzerPassPropagateInstructionsUp : public FuzzerPass { FuzzerPassPropagateInstructionsUp( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_push_ids_through_variables.cpp b/source/fuzz/fuzzer_pass_push_ids_through_variables.cpp index a6c07b4b..54e589c9 100644 --- a/source/fuzz/fuzzer_pass_push_ids_through_variables.cpp +++ b/source/fuzz/fuzzer_pass_push_ids_through_variables.cpp @@ -24,10 +24,9 @@ namespace fuzz { FuzzerPassPushIdsThroughVariables::FuzzerPassPushIdsThroughVariables( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassPushIdsThroughVariables::Apply() { ForEachInstructionWithInstructionDescriptor( @@ -48,7 +47,7 @@ void FuzzerPassPushIdsThroughVariables::Apply() { // The block containing the instruction we are going to insert before // must be reachable. - if (!GetIRContext()->IsReachable(*block)) { + if (!fuzzerutil::BlockIsReachableInItsFunction(GetIRContext(), block)) { return; } @@ -70,12 +69,6 @@ void FuzzerPassPushIdsThroughVariables::Apply() { auto basic_type_ids_and_pointers = GetAvailableBasicTypesAndPointers(variable_storage_class); auto& basic_types = basic_type_ids_and_pointers.first; - - // There must be at least some basic types. - if (basic_types.empty()) { - return; - } - uint32_t basic_type_id = basic_types[GetFuzzerContext()->RandomIndex(basic_types)]; @@ -103,7 +96,7 @@ void FuzzerPassPushIdsThroughVariables::Apply() { ->IdIsIrrelevant(instruction->result_id()) && !fuzzerutil::CanMakeSynonymOf(ir_context, *GetTransformationContext(), - *instruction)) { + instruction)) { return false; } diff --git a/source/fuzz/fuzzer_pass_push_ids_through_variables.h b/source/fuzz/fuzzer_pass_push_ids_through_variables.h index 71b69492..53008ee2 100644 --- a/source/fuzz/fuzzer_pass_push_ids_through_variables.h +++ b/source/fuzz/fuzzer_pass_push_ids_through_variables.h @@ -28,8 +28,7 @@ class FuzzerPassPushIdsThroughVariables : public FuzzerPass { FuzzerPassPushIdsThroughVariables( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_replace_adds_subs_muls_with_carrying_extended.cpp b/source/fuzz/fuzzer_pass_replace_adds_subs_muls_with_carrying_extended.cpp index 467e6134..8a83d3bc 100644 --- a/source/fuzz/fuzzer_pass_replace_adds_subs_muls_with_carrying_extended.cpp +++ b/source/fuzz/fuzzer_pass_replace_adds_subs_muls_with_carrying_extended.cpp @@ -29,10 +29,9 @@ FuzzerPassReplaceAddsSubsMulsWithCarryingExtended:: opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassReplaceAddsSubsMulsWithCarryingExtended::Apply() { std::vector instructions_for_transformation; diff --git a/source/fuzz/fuzzer_pass_replace_adds_subs_muls_with_carrying_extended.h b/source/fuzz/fuzzer_pass_replace_adds_subs_muls_with_carrying_extended.h index 268655f9..0e29a6c6 100644 --- a/source/fuzz/fuzzer_pass_replace_adds_subs_muls_with_carrying_extended.h +++ b/source/fuzz/fuzzer_pass_replace_adds_subs_muls_with_carrying_extended.h @@ -29,8 +29,7 @@ class FuzzerPassReplaceAddsSubsMulsWithCarryingExtended : public FuzzerPass { FuzzerPassReplaceAddsSubsMulsWithCarryingExtended( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_replace_branches_from_dead_blocks_with_exits.cpp b/source/fuzz/fuzzer_pass_replace_branches_from_dead_blocks_with_exits.cpp index 995657cc..a516f3d4 100644 --- a/source/fuzz/fuzzer_pass_replace_branches_from_dead_blocks_with_exits.cpp +++ b/source/fuzz/fuzzer_pass_replace_branches_from_dead_blocks_with_exits.cpp @@ -28,10 +28,9 @@ FuzzerPassReplaceBranchesFromDeadBlocksWithExits:: opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassReplaceBranchesFromDeadBlocksWithExits::Apply() { // OpKill can only be used as a terminator in a function that is guaranteed diff --git a/source/fuzz/fuzzer_pass_replace_branches_from_dead_blocks_with_exits.h b/source/fuzz/fuzzer_pass_replace_branches_from_dead_blocks_with_exits.h index cdbb66f2..ab7e00e5 100644 --- a/source/fuzz/fuzzer_pass_replace_branches_from_dead_blocks_with_exits.h +++ b/source/fuzz/fuzzer_pass_replace_branches_from_dead_blocks_with_exits.h @@ -28,8 +28,7 @@ class FuzzerPassReplaceBranchesFromDeadBlocksWithExits : public FuzzerPass { FuzzerPassReplaceBranchesFromDeadBlocksWithExits( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_replace_copy_memories_with_loads_stores.cpp b/source/fuzz/fuzzer_pass_replace_copy_memories_with_loads_stores.cpp index af1aacee..f17339a9 100644 --- a/source/fuzz/fuzzer_pass_replace_copy_memories_with_loads_stores.cpp +++ b/source/fuzz/fuzzer_pass_replace_copy_memories_with_loads_stores.cpp @@ -26,10 +26,9 @@ FuzzerPassReplaceCopyMemoriesWithLoadsStores:: opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassReplaceCopyMemoriesWithLoadsStores::Apply() { GetIRContext()->module()->ForEachInst([this](opt::Instruction* instruction) { diff --git a/source/fuzz/fuzzer_pass_replace_copy_memories_with_loads_stores.h b/source/fuzz/fuzzer_pass_replace_copy_memories_with_loads_stores.h index 7d954abe..cffe1cb9 100644 --- a/source/fuzz/fuzzer_pass_replace_copy_memories_with_loads_stores.h +++ b/source/fuzz/fuzzer_pass_replace_copy_memories_with_loads_stores.h @@ -28,8 +28,7 @@ class FuzzerPassReplaceCopyMemoriesWithLoadsStores : public FuzzerPass { FuzzerPassReplaceCopyMemoriesWithLoadsStores( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_replace_copy_objects_with_stores_loads.cpp b/source/fuzz/fuzzer_pass_replace_copy_objects_with_stores_loads.cpp index d0992a3f..24f2255b 100644 --- a/source/fuzz/fuzzer_pass_replace_copy_objects_with_stores_loads.cpp +++ b/source/fuzz/fuzzer_pass_replace_copy_objects_with_stores_loads.cpp @@ -26,10 +26,9 @@ FuzzerPassReplaceCopyObjectsWithStoresLoads:: opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassReplaceCopyObjectsWithStoresLoads::Apply() { GetIRContext()->module()->ForEachInst([this](opt::Instruction* instruction) { diff --git a/source/fuzz/fuzzer_pass_replace_copy_objects_with_stores_loads.h b/source/fuzz/fuzzer_pass_replace_copy_objects_with_stores_loads.h index 2ffc00b6..e7b11ce1 100644 --- a/source/fuzz/fuzzer_pass_replace_copy_objects_with_stores_loads.h +++ b/source/fuzz/fuzzer_pass_replace_copy_objects_with_stores_loads.h @@ -28,8 +28,7 @@ class FuzzerPassReplaceCopyObjectsWithStoresLoads : public FuzzerPass { FuzzerPassReplaceCopyObjectsWithStoresLoads( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_replace_irrelevant_ids.cpp b/source/fuzz/fuzzer_pass_replace_irrelevant_ids.cpp index 4d55ae84..7e9d7baa 100644 --- a/source/fuzz/fuzzer_pass_replace_irrelevant_ids.cpp +++ b/source/fuzz/fuzzer_pass_replace_irrelevant_ids.cpp @@ -27,10 +27,9 @@ namespace fuzz { FuzzerPassReplaceIrrelevantIds::FuzzerPassReplaceIrrelevantIds( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassReplaceIrrelevantIds::Apply() { // Keep track of the irrelevant ids. This includes all the ids that are diff --git a/source/fuzz/fuzzer_pass_replace_irrelevant_ids.h b/source/fuzz/fuzzer_pass_replace_irrelevant_ids.h index 80f8eb86..1dc6b5d3 100644 --- a/source/fuzz/fuzzer_pass_replace_irrelevant_ids.h +++ b/source/fuzz/fuzzer_pass_replace_irrelevant_ids.h @@ -28,8 +28,7 @@ class FuzzerPassReplaceIrrelevantIds : public FuzzerPass { FuzzerPassReplaceIrrelevantIds( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_replace_linear_algebra_instructions.cpp b/source/fuzz/fuzzer_pass_replace_linear_algebra_instructions.cpp index 445dbfe1..0890c2fe 100644 --- a/source/fuzz/fuzzer_pass_replace_linear_algebra_instructions.cpp +++ b/source/fuzz/fuzzer_pass_replace_linear_algebra_instructions.cpp @@ -26,10 +26,9 @@ FuzzerPassReplaceLinearAlgebraInstructions:: opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassReplaceLinearAlgebraInstructions::Apply() { // For each instruction, checks whether it is a linear algebra instruction. In diff --git a/source/fuzz/fuzzer_pass_replace_linear_algebra_instructions.h b/source/fuzz/fuzzer_pass_replace_linear_algebra_instructions.h index 5734bf1f..5d2f2042 100644 --- a/source/fuzz/fuzzer_pass_replace_linear_algebra_instructions.h +++ b/source/fuzz/fuzzer_pass_replace_linear_algebra_instructions.h @@ -27,8 +27,7 @@ class FuzzerPassReplaceLinearAlgebraInstructions : public FuzzerPass { FuzzerPassReplaceLinearAlgebraInstructions( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_replace_loads_stores_with_copy_memories.cpp b/source/fuzz/fuzzer_pass_replace_loads_stores_with_copy_memories.cpp index 38ac048b..f2cf80fa 100644 --- a/source/fuzz/fuzzer_pass_replace_loads_stores_with_copy_memories.cpp +++ b/source/fuzz/fuzzer_pass_replace_loads_stores_with_copy_memories.cpp @@ -27,10 +27,9 @@ FuzzerPassReplaceLoadsStoresWithCopyMemories:: opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassReplaceLoadsStoresWithCopyMemories::Apply() { // We look for matching pairs of instructions OpLoad and diff --git a/source/fuzz/fuzzer_pass_replace_loads_stores_with_copy_memories.h b/source/fuzz/fuzzer_pass_replace_loads_stores_with_copy_memories.h index f6209fc0..f30fc2b7 100644 --- a/source/fuzz/fuzzer_pass_replace_loads_stores_with_copy_memories.h +++ b/source/fuzz/fuzzer_pass_replace_loads_stores_with_copy_memories.h @@ -28,8 +28,7 @@ class FuzzerPassReplaceLoadsStoresWithCopyMemories : public FuzzerPass { FuzzerPassReplaceLoadsStoresWithCopyMemories( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_replace_opphi_ids_from_dead_predecessors.cpp b/source/fuzz/fuzzer_pass_replace_opphi_ids_from_dead_predecessors.cpp index ea90a7ac..b0a3d57c 100644 --- a/source/fuzz/fuzzer_pass_replace_opphi_ids_from_dead_predecessors.cpp +++ b/source/fuzz/fuzzer_pass_replace_opphi_ids_from_dead_predecessors.cpp @@ -24,10 +24,9 @@ FuzzerPassReplaceOpPhiIdsFromDeadPredecessors:: opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassReplaceOpPhiIdsFromDeadPredecessors::Apply() { // Keep a vector of the transformations to apply. diff --git a/source/fuzz/fuzzer_pass_replace_opphi_ids_from_dead_predecessors.h b/source/fuzz/fuzzer_pass_replace_opphi_ids_from_dead_predecessors.h index b01e242f..a2bc1886 100644 --- a/source/fuzz/fuzzer_pass_replace_opphi_ids_from_dead_predecessors.h +++ b/source/fuzz/fuzzer_pass_replace_opphi_ids_from_dead_predecessors.h @@ -27,8 +27,7 @@ class FuzzerPassReplaceOpPhiIdsFromDeadPredecessors : public FuzzerPass { FuzzerPassReplaceOpPhiIdsFromDeadPredecessors( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_replace_opselects_with_conditional_branches.cpp b/source/fuzz/fuzzer_pass_replace_opselects_with_conditional_branches.cpp index 72ed0936..10bb90ad 100644 --- a/source/fuzz/fuzzer_pass_replace_opselects_with_conditional_branches.cpp +++ b/source/fuzz/fuzzer_pass_replace_opselects_with_conditional_branches.cpp @@ -27,10 +27,9 @@ FuzzerPassReplaceOpSelectsWithConditionalBranches:: opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassReplaceOpSelectsWithConditionalBranches::Apply() { // Keep track of the instructions that we want to replace. We need to collect diff --git a/source/fuzz/fuzzer_pass_replace_opselects_with_conditional_branches.h b/source/fuzz/fuzzer_pass_replace_opselects_with_conditional_branches.h index 174962ee..ec743890 100644 --- a/source/fuzz/fuzzer_pass_replace_opselects_with_conditional_branches.h +++ b/source/fuzz/fuzzer_pass_replace_opselects_with_conditional_branches.h @@ -27,8 +27,7 @@ class FuzzerPassReplaceOpSelectsWithConditionalBranches : public FuzzerPass { FuzzerPassReplaceOpSelectsWithConditionalBranches( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; diff --git a/source/fuzz/fuzzer_pass_replace_parameter_with_global.cpp b/source/fuzz/fuzzer_pass_replace_parameter_with_global.cpp index 7fb7b0d2..5c256bb0 100644 --- a/source/fuzz/fuzzer_pass_replace_parameter_with_global.cpp +++ b/source/fuzz/fuzzer_pass_replace_parameter_with_global.cpp @@ -27,10 +27,9 @@ namespace fuzz { FuzzerPassReplaceParameterWithGlobal::FuzzerPassReplaceParameterWithGlobal( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassReplaceParameterWithGlobal::Apply() { for (const auto& function : *GetIRContext()->module()) { diff --git a/source/fuzz/fuzzer_pass_replace_parameter_with_global.h b/source/fuzz/fuzzer_pass_replace_parameter_with_global.h index 4eb50866..2ae49469 100644 --- a/source/fuzz/fuzzer_pass_replace_parameter_with_global.h +++ b/source/fuzz/fuzzer_pass_replace_parameter_with_global.h @@ -27,8 +27,7 @@ class FuzzerPassReplaceParameterWithGlobal : public FuzzerPass { FuzzerPassReplaceParameterWithGlobal( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_replace_params_with_struct.cpp b/source/fuzz/fuzzer_pass_replace_params_with_struct.cpp index f029316e..c045e19f 100644 --- a/source/fuzz/fuzzer_pass_replace_params_with_struct.cpp +++ b/source/fuzz/fuzzer_pass_replace_params_with_struct.cpp @@ -27,10 +27,9 @@ namespace fuzz { FuzzerPassReplaceParamsWithStruct::FuzzerPassReplaceParamsWithStruct( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassReplaceParamsWithStruct::Apply() { for (const auto& function : *GetIRContext()->module()) { diff --git a/source/fuzz/fuzzer_pass_replace_params_with_struct.h b/source/fuzz/fuzzer_pass_replace_params_with_struct.h index 3af7367a..f17f5207 100644 --- a/source/fuzz/fuzzer_pass_replace_params_with_struct.h +++ b/source/fuzz/fuzzer_pass_replace_params_with_struct.h @@ -27,8 +27,7 @@ class FuzzerPassReplaceParamsWithStruct : public FuzzerPass { FuzzerPassReplaceParamsWithStruct( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_split_blocks.cpp b/source/fuzz/fuzzer_pass_split_blocks.cpp index 40a4151d..7b493559 100644 --- a/source/fuzz/fuzzer_pass_split_blocks.cpp +++ b/source/fuzz/fuzzer_pass_split_blocks.cpp @@ -25,10 +25,9 @@ namespace fuzz { FuzzerPassSplitBlocks::FuzzerPassSplitBlocks( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassSplitBlocks::Apply() { // Gather up pointers to all the blocks in the module. We are then able to diff --git a/source/fuzz/fuzzer_pass_split_blocks.h b/source/fuzz/fuzzer_pass_split_blocks.h index b1b94240..58f10ddb 100644 --- a/source/fuzz/fuzzer_pass_split_blocks.h +++ b/source/fuzz/fuzzer_pass_split_blocks.h @@ -27,8 +27,7 @@ class FuzzerPassSplitBlocks : public FuzzerPass { FuzzerPassSplitBlocks(opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_swap_commutable_operands.cpp b/source/fuzz/fuzzer_pass_swap_commutable_operands.cpp index dce65f08..27fadd17 100644 --- a/source/fuzz/fuzzer_pass_swap_commutable_operands.cpp +++ b/source/fuzz/fuzzer_pass_swap_commutable_operands.cpp @@ -24,10 +24,9 @@ namespace fuzz { FuzzerPassSwapCommutableOperands::FuzzerPassSwapCommutableOperands( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassSwapCommutableOperands::Apply() { auto context = GetIRContext(); diff --git a/source/fuzz/fuzzer_pass_swap_commutable_operands.h b/source/fuzz/fuzzer_pass_swap_commutable_operands.h index 13d8fb6e..93de1728 100644 --- a/source/fuzz/fuzzer_pass_swap_commutable_operands.h +++ b/source/fuzz/fuzzer_pass_swap_commutable_operands.h @@ -28,8 +28,7 @@ class FuzzerPassSwapCommutableOperands : public FuzzerPass { FuzzerPassSwapCommutableOperands( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_swap_conditional_branch_operands.cpp b/source/fuzz/fuzzer_pass_swap_conditional_branch_operands.cpp index f8bf111d..b145b3bc 100644 --- a/source/fuzz/fuzzer_pass_swap_conditional_branch_operands.cpp +++ b/source/fuzz/fuzzer_pass_swap_conditional_branch_operands.cpp @@ -27,10 +27,9 @@ FuzzerPassSwapBranchConditionalOperands:: opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassSwapBranchConditionalOperands::Apply() { ForEachInstructionWithInstructionDescriptor( diff --git a/source/fuzz/fuzzer_pass_swap_conditional_branch_operands.h b/source/fuzz/fuzzer_pass_swap_conditional_branch_operands.h index 7f71f9b1..0137f38b 100644 --- a/source/fuzz/fuzzer_pass_swap_conditional_branch_operands.h +++ b/source/fuzz/fuzzer_pass_swap_conditional_branch_operands.h @@ -27,8 +27,7 @@ class FuzzerPassSwapBranchConditionalOperands : public FuzzerPass { FuzzerPassSwapBranchConditionalOperands( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_swap_functions.cpp b/source/fuzz/fuzzer_pass_swap_functions.cpp deleted file mode 100644 index 8eeec850..00000000 --- a/source/fuzz/fuzzer_pass_swap_functions.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) 2021 Shiyu Liu -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/fuzz/fuzzer_pass_swap_functions.h" - -#include "source/fuzz/fuzzer_context.h" -#include "source/fuzz/transformation_swap_two_functions.h" - -namespace spvtools { -namespace fuzz { - -FuzzerPassSwapFunctions::FuzzerPassSwapFunctions( - opt::IRContext* ir_context, TransformationContext* transformation_context, - FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) - : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} - -void FuzzerPassSwapFunctions::Apply() { - // Collect all function ids in a module. - std::vector function_ids; - for (auto& function : *GetIRContext()->module()) { - function_ids.emplace_back(function.result_id()); - } - - // Iterate through every combination of id i & j where i!=j. - for (size_t i = 0; i < function_ids.size(); ++i) { - for (size_t j = i + 1; j < function_ids.size(); ++j) { - // Perform function swap randomly. - if (!GetFuzzerContext()->ChoosePercentage( - GetFuzzerContext()->GetChanceOfSwappingFunctions())) { - continue; - } - TransformationSwapTwoFunctions transformation(function_ids[i], - function_ids[j]); - } - } -} - -} // namespace fuzz -} // namespace spvtools diff --git a/source/fuzz/fuzzer_pass_swap_functions.h b/source/fuzz/fuzzer_pass_swap_functions.h deleted file mode 100644 index 7af527f0..00000000 --- a/source/fuzz/fuzzer_pass_swap_functions.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) 2021 Shiyu Liu -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SOURCE_FUZZ_FUZZER_PASS_SWAP_FUNCTIONS_H_ -#define SOURCE_FUZZ_FUZZER_PASS_SWAP_FUNCTIONS_H_ - -#include "source/fuzz/fuzzer_pass.h" - -namespace spvtools { -namespace fuzz { - -// Randomly swap functions within a module. -class FuzzerPassSwapFunctions : public FuzzerPass { - public: - FuzzerPassSwapFunctions(opt::IRContext* ir_context, - TransformationContext* transformation_context, - FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); - - void Apply() override; -}; - -} // namespace fuzz -} // namespace spvtools - -#endif // SOURCE_FUZZ_FUZZER_PASS_SWAP_FUNCTIONS_H_ diff --git a/source/fuzz/fuzzer_pass_toggle_access_chain_instruction.cpp b/source/fuzz/fuzzer_pass_toggle_access_chain_instruction.cpp index ac2b1565..e5afd9ee 100644 --- a/source/fuzz/fuzzer_pass_toggle_access_chain_instruction.cpp +++ b/source/fuzz/fuzzer_pass_toggle_access_chain_instruction.cpp @@ -24,10 +24,9 @@ namespace fuzz { FuzzerPassToggleAccessChainInstruction::FuzzerPassToggleAccessChainInstruction( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassToggleAccessChainInstruction::Apply() { auto context = GetIRContext(); diff --git a/source/fuzz/fuzzer_pass_toggle_access_chain_instruction.h b/source/fuzz/fuzzer_pass_toggle_access_chain_instruction.h index f0b6166b..ff2f5d45 100644 --- a/source/fuzz/fuzzer_pass_toggle_access_chain_instruction.h +++ b/source/fuzz/fuzzer_pass_toggle_access_chain_instruction.h @@ -27,8 +27,7 @@ class FuzzerPassToggleAccessChainInstruction : public FuzzerPass { FuzzerPassToggleAccessChainInstruction( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; }; diff --git a/source/fuzz/fuzzer_pass_wrap_regions_in_selections.cpp b/source/fuzz/fuzzer_pass_wrap_regions_in_selections.cpp index 3a3b12c1..66bbcd81 100644 --- a/source/fuzz/fuzzer_pass_wrap_regions_in_selections.cpp +++ b/source/fuzz/fuzzer_pass_wrap_regions_in_selections.cpp @@ -25,10 +25,9 @@ namespace fuzz { FuzzerPassWrapRegionsInSelections::FuzzerPassWrapRegionsInSelections( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) + protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} + transformations) {} void FuzzerPassWrapRegionsInSelections::Apply() { for (auto& function : *GetIRContext()->module()) { diff --git a/source/fuzz/fuzzer_pass_wrap_regions_in_selections.h b/source/fuzz/fuzzer_pass_wrap_regions_in_selections.h index fc3d7df9..822c308f 100644 --- a/source/fuzz/fuzzer_pass_wrap_regions_in_selections.h +++ b/source/fuzz/fuzzer_pass_wrap_regions_in_selections.h @@ -27,8 +27,7 @@ class FuzzerPassWrapRegionsInSelections : public FuzzerPass { FuzzerPassWrapRegionsInSelections( opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); + protobufs::TransformationSequence* transformations); void Apply() override; diff --git a/source/fuzz/fuzzer_pass_wrap_vector_synonym.cpp b/source/fuzz/fuzzer_pass_wrap_vector_synonym.cpp deleted file mode 100644 index 37c93b30..00000000 --- a/source/fuzz/fuzzer_pass_wrap_vector_synonym.cpp +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) 2021 Shiyu Liu -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/fuzz/fuzzer_pass_wrap_vector_synonym.h" -#include "source/fuzz/fuzzer_context.h" -#include "source/fuzz/fuzzer_util.h" -#include "source/fuzz/transformation_composite_construct.h" -#include "source/fuzz/transformation_wrap_vector_synonym.h" - -namespace spvtools { -namespace fuzz { - -FuzzerPassWrapVectorSynonym::FuzzerPassWrapVectorSynonym( - opt::IRContext* ir_context, TransformationContext* transformation_context, - FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations) - : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, ignore_inapplicable_transformations) {} - -void FuzzerPassWrapVectorSynonym::Apply() { - ForEachInstructionWithInstructionDescriptor( - [this](opt::Function* /*unused*/, opt::BasicBlock* /*unused*/, - opt::BasicBlock::iterator instruction_iterator, - const protobufs::InstructionDescriptor& instruction_descriptor) - -> void { - - // Randomly decide whether to wrap it to a vector operation. - if (!GetFuzzerContext()->ChoosePercentage( - GetFuzzerContext()->GetChanceOfWrappingVectorSynonym())) { - return; - } - - // The transformation is not applicable if the instruction has missing - // result id, type id, or is not supported type. - if (!TransformationWrapVectorSynonym::IsInstructionSupported( - GetIRContext(), *instruction_iterator)) { - return; - } - - // It must be valid to insert an OpCompositeConstruct instruction - // before |instruction_iterator|. - if (!fuzzerutil::CanInsertOpcodeBeforeInstruction( - SpvOpCompositeConstruct, instruction_iterator)) { - return; - } - // Get the scalar type represented by the targeted instruction id. - uint32_t operand_type_id = instruction_iterator->type_id(); - - // Get a random vector size from 2 to 4. - uint32_t vector_size = GetFuzzerContext()->GetWidthOfWrappingVector(); - - // Randomly choose a position that target ids should be placed at. - // The position is in range [0, n - 1], where n is the size of the - // vector. - uint32_t position = - GetFuzzerContext()->GetRandomIndexForWrappingVector(vector_size); - - // Target ids are the two scalar ids from the original instruction. - uint32_t target_id1 = instruction_iterator->GetSingleWordInOperand(0); - uint32_t target_id2 = instruction_iterator->GetSingleWordInOperand(1); - - // We need to be able to make a synonym of the scalar operation's result - // id, as well as the operand ids (for example, they cannot be - // irrelevant). - if (!fuzzerutil::CanMakeSynonymOf(GetIRContext(), - *GetTransformationContext(), - *instruction_iterator)) { - return; - } - if (!fuzzerutil::CanMakeSynonymOf( - GetIRContext(), *GetTransformationContext(), - *GetIRContext()->get_def_use_mgr()->GetDef(target_id1))) { - return; - } - if (!fuzzerutil::CanMakeSynonymOf( - GetIRContext(), *GetTransformationContext(), - *GetIRContext()->get_def_use_mgr()->GetDef(target_id2))) { - return; - } - - // Stores the ids of scalar constants. - std::vector vec1_components; - std::vector vec2_components; - - // Populate components based on vector type and size. - for (uint32_t i = 0; i < vector_size; ++i) { - if (i == position) { - vec1_components.emplace_back(target_id1); - vec2_components.emplace_back(target_id2); - } else { - vec1_components.emplace_back( - FindOrCreateZeroConstant(operand_type_id, true)); - vec2_components.emplace_back( - FindOrCreateZeroConstant(operand_type_id, true)); - } - } - - // Add two OpCompositeConstruct to the module with result id returned. - const uint32_t vector_type_id = - FindOrCreateVectorType(operand_type_id, vector_size); - - // Add the first OpCompositeConstruct that wraps the id of the first - // operand. - uint32_t result_id1 = GetFuzzerContext()->GetFreshId(); - ApplyTransformation(TransformationCompositeConstruct( - vector_type_id, vec1_components, instruction_descriptor, - result_id1)); - - // Add the second OpCompositeConstruct that wraps the id of the second - // operand. - uint32_t result_id2 = GetFuzzerContext()->GetFreshId(); - ApplyTransformation(TransformationCompositeConstruct( - vector_type_id, vec2_components, instruction_descriptor, - result_id2)); - - // Apply transformation to do vector operation and add synonym between - // the result vector id and the id of the original instruction. - ApplyTransformation(TransformationWrapVectorSynonym( - instruction_iterator->result_id(), result_id1, result_id2, - GetFuzzerContext()->GetFreshId(), position)); - }); -} - -} // namespace fuzz -} // namespace spvtools diff --git a/source/fuzz/fuzzer_pass_wrap_vector_synonym.h b/source/fuzz/fuzzer_pass_wrap_vector_synonym.h deleted file mode 100644 index 51458383..00000000 --- a/source/fuzz/fuzzer_pass_wrap_vector_synonym.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) 2021 Shiyu Liu -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SOURCE_FUZZ_FUZZER_PASS_WRAP_VECTOR_SYNONYM_H_ -#define SOURCE_FUZZ_FUZZER_PASS_WRAP_VECTOR_SYNONYM_H_ - -#include "source/fuzz/fuzzer_pass.h" - -namespace spvtools { -namespace fuzz { - -// Randomly wrap a scalar operation into a vector operation. -class FuzzerPassWrapVectorSynonym : public FuzzerPass { - public: - FuzzerPassWrapVectorSynonym( - opt::IRContext* ir_context, TransformationContext* transformation_context, - FuzzerContext* fuzzer_context, - protobufs::TransformationSequence* transformations, - bool ignore_inapplicable_transformations); - - void Apply() override; -}; - -} // namespace fuzz -} // namespace spvtools - -#endif // SOURCE_FUZZ_FUZZER_PASS_WRAP_VECTOR_SYNONYM_H_ diff --git a/source/fuzz/fuzzer_util.cpp b/source/fuzz/fuzzer_util.cpp index ea7cde7f..aa0d30e2 100644 --- a/source/fuzz/fuzzer_util.cpp +++ b/source/fuzz/fuzzer_util.cpp @@ -252,11 +252,11 @@ bool BlockIsBackEdge(opt::IRContext* context, uint32_t block_id, return false; } - // |block| must be reachable and be dominated by |loop_header|. + // |block_id| must be reachable and be dominated by |loop_header|. opt::DominatorAnalysis* dominator_analysis = context->GetDominatorAnalysis(loop_header->GetParent()); - return context->IsReachable(*block) && - dominator_analysis->Dominates(loop_header, block); + return dominator_analysis->IsReachable(block_id) && + dominator_analysis->Dominates(loop_header_id, block_id); } bool BlockIsInLoopContinueConstruct(opt::IRContext* context, uint32_t block_id, @@ -284,6 +284,13 @@ opt::BasicBlock::iterator GetIteratorForInstruction( return block->end(); } +bool BlockIsReachableInItsFunction(opt::IRContext* context, + opt::BasicBlock* bb) { + auto enclosing_function = bb->GetParent(); + return context->GetDominatorAnalysis(enclosing_function) + ->Dominates(enclosing_function->entry().get(), bb); +} + bool CanInsertOpcodeBeforeInstruction( SpvOp opcode, const opt::BasicBlock::iterator& instruction_in_block) { if (instruction_in_block->PreviousNode() && @@ -305,34 +312,34 @@ bool CanInsertOpcodeBeforeInstruction( bool CanMakeSynonymOf(opt::IRContext* ir_context, const TransformationContext& transformation_context, - const opt::Instruction& inst) { - if (inst.opcode() == SpvOpSampledImage) { + opt::Instruction* inst) { + if (inst->opcode() == SpvOpSampledImage) { // The SPIR-V data rules say that only very specific instructions may // may consume the result id of an OpSampledImage, and this excludes the // instructions that are used for making synonyms. return false; } - if (!inst.HasResultId()) { + if (!inst->HasResultId()) { // We can only make a synonym of an instruction that generates an id. return false; } if (transformation_context.GetFactManager()->IdIsIrrelevant( - inst.result_id())) { + inst->result_id())) { // An irrelevant id can't be a synonym of anything. return false; } - if (!inst.type_id()) { + if (!inst->type_id()) { // We can only make a synonym of an instruction that has a type. return false; } - auto type_inst = ir_context->get_def_use_mgr()->GetDef(inst.type_id()); + auto type_inst = ir_context->get_def_use_mgr()->GetDef(inst->type_id()); if (type_inst->opcode() == SpvOpTypeVoid) { // We only make synonyms of instructions that define objects, and an object // cannot have void type. return false; } if (type_inst->opcode() == SpvOpTypePointer) { - switch (inst.opcode()) { + switch (inst->opcode()) { case SpvOpConstantNull: case SpvOpUndef: // We disallow making synonyms of null or undefined pointers. This is @@ -348,7 +355,7 @@ bool CanMakeSynonymOf(opt::IRContext* ir_context, // not decorated analogously, using the original object vs. its synonymous // form may not be equivalent. return ir_context->get_decoration_mgr() - ->GetDecorationsFor(inst.result_id(), true) + ->GetDecorationsFor(inst->result_id(), true) .empty(); } @@ -455,30 +462,6 @@ uint32_t GetBoundForCompositeIndex(const opt::Instruction& composite_type_inst, } } -SpvMemorySemanticsMask GetMemorySemanticsForStorageClass( - SpvStorageClass storage_class) { - switch (storage_class) { - case SpvStorageClassWorkgroup: - return SpvMemorySemanticsWorkgroupMemoryMask; - - case SpvStorageClassStorageBuffer: - case SpvStorageClassPhysicalStorageBuffer: - return SpvMemorySemanticsUniformMemoryMask; - - case SpvStorageClassCrossWorkgroup: - return SpvMemorySemanticsCrossWorkgroupMemoryMask; - - case SpvStorageClassAtomicCounter: - return SpvMemorySemanticsAtomicCounterMemoryMask; - - case SpvStorageClassImage: - return SpvMemorySemanticsImageMemoryMask; - - default: - return SpvMemorySemanticsMaskNone; - } -} - bool IsValid(const opt::IRContext* context, spv_validator_options validator_options, MessageConsumer consumer) { @@ -526,12 +509,8 @@ bool IsValidAndWellFormed(const opt::IRContext* ir_context, // this is a useful aid to debugging. std::unordered_map unique_ids; bool found_duplicate = false; - ir_context->module()->ForEachInst([&consumer, &found_duplicate, ir_context, + ir_context->module()->ForEachInst([&consumer, &found_duplicate, &unique_ids](opt::Instruction* inst) { - (void)ir_context; // Only used in an assertion; keep release-mode compilers - // happy. - assert(inst->context() == ir_context && - "Instruction has wrong IR context."); if (unique_ids.count(inst->unique_id()) != 0) { consumer(SPV_MSG_INFO, nullptr, {}, "Two instructions have the same unique id (set a breakpoint to " @@ -681,12 +660,13 @@ bool IdIsAvailableAtUse(opt::IRContext* context, // It is not OK for a definition to use itself. return false; } - if (!context->IsReachable(*context->get_instr_block(use_instruction)) || - !context->IsReachable(*context->get_instr_block(id))) { + auto dominator_analysis = context->GetDominatorAnalysis(enclosing_function); + if (!dominator_analysis->IsReachable( + context->get_instr_block(use_instruction)) || + !dominator_analysis->IsReachable(context->get_instr_block(id))) { // Skip unreachable blocks. return false; } - auto dominator_analysis = context->GetDominatorAnalysis(enclosing_function); if (use_instruction->opcode() == SpvOpPhi) { // In the case where the use is an operand to OpPhi, it is actually the // *parent* block associated with the operand that must be dominated by @@ -724,8 +704,8 @@ bool IdIsAvailableBeforeInstruction(opt::IRContext* context, } const auto* dominator_analysis = context->GetDominatorAnalysis(function_enclosing_instruction); - if (context->IsReachable(*context->get_instr_block(instruction)) && - context->IsReachable(*context->get_instr_block(id)) && + if (dominator_analysis->IsReachable(context->get_instr_block(instruction)) && + dominator_analysis->IsReachable(context->get_instr_block(id)) && dominator_analysis->Dominates(id_definition, instruction)) { // The id's definition dominates the instruction, and both the definition // and the instruction are in reachable blocks, thus the id is available at @@ -735,7 +715,8 @@ bool IdIsAvailableBeforeInstruction(opt::IRContext* context, if (id_definition->opcode() == SpvOpVariable && function_enclosing_instruction == context->get_instr_block(id)->GetParent()) { - assert(!context->IsReachable(*context->get_instr_block(instruction)) && + assert(!dominator_analysis->IsReachable( + context->get_instr_block(instruction)) && "If the instruction were in a reachable block we should already " "have returned true."); // The id is a variable and it is in the same function as |instruction|. @@ -815,38 +796,11 @@ uint32_t InOperandIndexFromOperandIndex(const opt::Instruction& inst, return absolute_index - inst.NumOperands() + inst.NumInOperands(); } -bool IsNullConstantSupported(opt::IRContext* ir_context, - const opt::Instruction& type_inst) { - switch (type_inst.opcode()) { - case SpvOpTypeArray: - case SpvOpTypeBool: - case SpvOpTypeDeviceEvent: - case SpvOpTypeEvent: - case SpvOpTypeFloat: - case SpvOpTypeInt: - case SpvOpTypeMatrix: - case SpvOpTypeQueue: - case SpvOpTypeReserveId: - case SpvOpTypeVector: - case SpvOpTypeStruct: - return true; - case SpvOpTypePointer: - // Null pointers are allowed if the VariablePointers capability is - // enabled, or if the VariablePointersStorageBuffer capability is enabled - // and the pointer type has StorageBuffer as its storage class. - if (ir_context->get_feature_mgr()->HasCapability( - SpvCapabilityVariablePointers)) { - return true; - } - if (ir_context->get_feature_mgr()->HasCapability( - SpvCapabilityVariablePointersStorageBuffer)) { - return type_inst.GetSingleWordInOperand(0) == - SpvStorageClassStorageBuffer; - } - return false; - default: - return false; - } +bool IsNullConstantSupported(const opt::analysis::Type& type) { + return type.AsBool() || type.AsInteger() || type.AsFloat() || + type.AsMatrix() || type.AsVector() || type.AsArray() || + type.AsStruct() || type.AsPointer() || type.AsEvent() || + type.AsDeviceEvent() || type.AsReserveId() || type.AsQueue(); } bool GlobalVariablesMustBeDeclaredInEntryPointInterfaces( @@ -1671,44 +1625,6 @@ bool IdUseCanBeReplaced(opt::IRContext* ir_context, return false; } - if (ir_context->get_feature_mgr()->HasCapability(SpvCapabilityShader)) { - // With the Shader capability, memory scope and memory semantics operands - // are required to be constants, so they cannot be replaced arbitrarily. - switch (use_instruction->opcode()) { - case SpvOpAtomicLoad: - case SpvOpAtomicStore: - case SpvOpAtomicExchange: - case SpvOpAtomicIIncrement: - case SpvOpAtomicIDecrement: - case SpvOpAtomicIAdd: - case SpvOpAtomicISub: - case SpvOpAtomicSMin: - case SpvOpAtomicUMin: - case SpvOpAtomicSMax: - case SpvOpAtomicUMax: - case SpvOpAtomicAnd: - case SpvOpAtomicOr: - case SpvOpAtomicXor: - if (use_in_operand_index == 1 || use_in_operand_index == 2) { - return false; - } - break; - case SpvOpAtomicCompareExchange: - if (use_in_operand_index == 1 || use_in_operand_index == 2 || - use_in_operand_index == 3) { - return false; - } - break; - case SpvOpAtomicCompareExchangeWeak: - case SpvOpAtomicFlagTestAndSet: - case SpvOpAtomicFlagClear: - case SpvOpAtomicFAddEXT: - assert(false && "Not allowed with the Shader capability."); - default: - break; - } - } - return true; } @@ -1967,7 +1883,7 @@ bool NewTerminatorPreservesDominationRules(opt::IRContext* ir_context, // all its dependencies satisfy domination rules (i.e. all id operands // dominate that instruction). for (const auto& block : *mutated_block->GetParent()) { - if (!ir_context->IsReachable(block)) { + if (!dominator_analysis.IsReachable(&block)) { // If some block is not reachable then we don't need to worry about the // preservation of domination rules for its instructions. continue; @@ -2009,15 +1925,6 @@ bool NewTerminatorPreservesDominationRules(opt::IRContext* ir_context, return true; } -opt::Module::iterator GetFunctionIterator(opt::IRContext* ir_context, - uint32_t function_id) { - return std::find_if(ir_context->module()->begin(), - ir_context->module()->end(), - [function_id](const opt::Function& f) { - return f.result_id() == function_id; - }); -} - } // namespace fuzzerutil } // namespace fuzz } // namespace spvtools diff --git a/source/fuzz/fuzzer_util.h b/source/fuzz/fuzzer_util.h index e4697a1a..fcbf1c65 100644 --- a/source/fuzz/fuzzer_util.h +++ b/source/fuzz/fuzzer_util.h @@ -24,7 +24,6 @@ #include "source/opt/basic_block.h" #include "source/opt/instruction.h" #include "source/opt/ir_context.h" -#include "source/opt/module.h" #include "spirv-tools/libspirv.hpp" namespace spvtools { @@ -108,6 +107,11 @@ bool BlockIsInLoopContinueConstruct(opt::IRContext* context, uint32_t block_id, opt::BasicBlock::iterator GetIteratorForInstruction( opt::BasicBlock* block, const opt::Instruction* inst); +// Returns true if and only if there is a path to |bb| from the entry block of +// the function that contains |bb|. +bool BlockIsReachableInItsFunction(opt::IRContext* context, + opt::BasicBlock* bb); + // Determines whether it is OK to insert an instruction with opcode |opcode| // before |instruction_in_block|. bool CanInsertOpcodeBeforeInstruction( @@ -118,7 +122,7 @@ bool CanInsertOpcodeBeforeInstruction( // does not participate in IdIsIrrelevant fact. bool CanMakeSynonymOf(opt::IRContext* ir_context, const TransformationContext& transformation_context, - const opt::Instruction& inst); + opt::Instruction* inst); // Determines whether the given type is a composite; that is: an array, matrix, // struct or vector. @@ -169,10 +173,6 @@ uint32_t GetArraySize(const opt::Instruction& array_type_instruction, uint32_t GetBoundForCompositeIndex(const opt::Instruction& composite_type_inst, opt::IRContext* ir_context); -// Returns memory semantics mask for specific storage class. -SpvMemorySemanticsMask GetMemorySemanticsForStorageClass( - SpvStorageClass storage_class); - // Returns true if and only if |context| is valid, according to the validator // instantiated with |validator_options|. |consumer| is used for error // reporting. @@ -277,10 +277,8 @@ uint32_t InOperandIndexFromOperandIndex(const opt::Instruction& inst, uint32_t absolute_index); // Returns true if and only if |type| is one of the types for which it is legal -// to have an OpConstantNull value. This may depend on the capabilities declared -// in |context|. -bool IsNullConstantSupported(opt::IRContext* context, - const opt::Instruction& type); +// to have an OpConstantNull value. +bool IsNullConstantSupported(const opt::analysis::Type& type); // Returns true if and only if the SPIR-V version being used requires that // global variables accessed in the static call graph of an entry point need @@ -598,12 +596,6 @@ bool NewTerminatorPreservesDominationRules(opt::IRContext* ir_context, uint32_t block_id, opt::Instruction new_terminator); -// Return the iterator that points to the function with the corresponding -// function id. If the function is not found, return the pointer pointing to -// module()->end(). -opt::Module::iterator GetFunctionIterator(opt::IRContext* ir_context, - uint32_t function_id); - } // namespace fuzzerutil } // namespace fuzz } // namespace spvtools diff --git a/source/fuzz/pass_management/repeated_pass_instances.h b/source/fuzz/pass_management/repeated_pass_instances.h index da61fdab..80ac0875 100644 --- a/source/fuzz/pass_management/repeated_pass_instances.h +++ b/source/fuzz/pass_management/repeated_pass_instances.h @@ -73,7 +73,6 @@ #include "source/fuzz/fuzzer_pass_split_blocks.h" #include "source/fuzz/fuzzer_pass_swap_conditional_branch_operands.h" #include "source/fuzz/fuzzer_pass_wrap_regions_in_selections.h" -#include "source/fuzz/fuzzer_pass_wrap_vector_synonym.h" namespace spvtools { namespace fuzz { @@ -169,7 +168,6 @@ class RepeatedPassInstances { REPEATED_PASS_INSTANCE(SplitBlocks); REPEATED_PASS_INSTANCE(SwapBranchConditionalOperands); REPEATED_PASS_INSTANCE(WrapRegionsInSelections); - REPEATED_PASS_INSTANCE(WrapVectorSynonym); #undef REPEATED_PASS_INSTANCE public: diff --git a/source/fuzz/pass_management/repeated_pass_recommender_standard.cpp b/source/fuzz/pass_management/repeated_pass_recommender_standard.cpp index 6c61c0d4..a933848d 100644 --- a/source/fuzz/pass_management/repeated_pass_recommender_standard.cpp +++ b/source/fuzz/pass_management/repeated_pass_recommender_standard.cpp @@ -351,12 +351,6 @@ RepeatedPassRecommenderStandard::GetFuturePassRecommendations( pass_instances_->GetReplaceIrrelevantIds(), pass_instances_->GetFlattenConditionalBranches()}); } - if (&pass == pass_instances_->GetWrapVectorSynonym()) { - // This transformation introduces synonym facts and irrelevant ids. - return RandomOrderAndNonNull({pass_instances_->GetApplyIdSynonyms(), - pass_instances_->GetReplaceIrrelevantIds()}); - } - assert(false && "Unreachable: every fuzzer pass should be dealt with."); return {}; } diff --git a/source/fuzz/protobufs/spirvfuzz_protobufs.h b/source/fuzz/protobufs/spirvfuzz_protobufs.h index 429f341e..eb8cb145 100644 --- a/source/fuzz/protobufs/spirvfuzz_protobufs.h +++ b/source/fuzz/protobufs/spirvfuzz_protobufs.h @@ -23,10 +23,8 @@ #if defined(__clang__) #pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunknown-warning-option" // Must come first -#pragma clang diagnostic ignored "-Wshadow" -#pragma clang diagnostic ignored "-Wsuggest-destructor-override" #pragma clang diagnostic ignored "-Wunused-parameter" +#pragma clang diagnostic ignored "-Wshadow" #elif defined(__GNUC__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" diff --git a/source/fuzz/protobufs/spvtoolsfuzz.proto b/source/fuzz/protobufs/spvtoolsfuzz.proto index cba9397b..770a2dd3 100644 --- a/source/fuzz/protobufs/spvtoolsfuzz.proto +++ b/source/fuzz/protobufs/spvtoolsfuzz.proto @@ -557,9 +557,6 @@ message Transformation { TransformationWrapEarlyTerminatorInFunction wrap_early_terminator_in_function = 83; TransformationMergeFunctionReturns merge_function_returns = 84; TransformationExpandVectorReduction expand_vector_reduction = 85; - TransformationSwapFunctionVariables swap_function_variables = 86; - TransformationSwapTwoFunctions swap_two_functions = 87; - TransformationWrapVectorSynonym wrap_vector_synonym = 88; // Add additional option using the next available number. } } @@ -1137,14 +1134,6 @@ message TransformationAddSynonym { // New synonym is derived by applying OpLogicalAnd to |result_id| with the second // operand being 'true'. LOGICAL_AND = 5; - - // New synonym is derived by applying OpBitwiseOr to |result_id| with the second - // operand being 0 taken with the same bit length as |result_id| - BITWISE_OR = 6; - - // New synonym is derived by applying OpBitwiseXor to |result_id| with the second - // operand being 0 taken with the same bit length as |result_id| - BITWISE_XOR = 7; } // Type of the synonym to create. See SynonymType for more details. @@ -1569,26 +1558,17 @@ message TransformationInvertComparisonOperator { message TransformationLoad { - // Transformation that adds an OpLoad or OpAtomicLoad instruction from a pointer into an id. + // Transformation that adds an OpLoad instruction from a pointer into an id. - // The result of the load instruction. + // The result of the load instruction uint32 fresh_id = 1; - // The pointer to be loaded from. + // The pointer to be loaded from uint32 pointer_id = 2; - // True if and only if the load should be atomic. - bool is_atomic = 3; - - // The memory scope for the atomic load. Ignored unless |is_atomic| is true. - uint32 memory_scope_id = 4; - - // The memory semantics for the atomic load. Ignored unless |is_atomic| is true. - uint32 memory_semantics_id = 5; - // A descriptor for an instruction in a block before which the new OpLoad - // instruction should be inserted. - InstructionDescriptor instruction_to_insert_before = 6; + // instruction should be inserted + InstructionDescriptor instruction_to_insert_before = 3; } @@ -1652,9 +1632,6 @@ message TransformationMergeFunctionReturns { // A fresh id for the header of the new outer loop. uint32 outer_header_id = 2; - // A fresh id for an unreachable continue construct for the new outer loop. - uint32 unreachable_continue_id = 7; - // A fresh id for the new return block of the function, // i.e. the merge block of the new outer loop. uint32 outer_return_id = 3; @@ -2245,26 +2222,17 @@ message TransformationSplitBlock { message TransformationStore { - // Transformation that adds an OpStore or OpAtomicStore instruction of an id to a pointer. + // Transformation that adds an OpStore instruction of an id to a pointer. - // The pointer to be stored to. + // The pointer to be stored to uint32 pointer_id = 1; - // True if and only if the load should be atomic. - bool is_atomic = 2; - - // The memory scope for the atomic load. Ignored unless |is_atomic| is true. - uint32 memory_scope_id = 3; - - // The memory semantics for the atomic load. Ignored unless |is_atomic| is true. - uint32 memory_semantics_id = 4; - - // The value to be stored. - uint32 value_id = 5; + // The value to be stored + uint32 value_id = 2; // A descriptor for an instruction in a block before which the new OpStore - // instruction should be inserted. - InstructionDescriptor instruction_to_insert_before = 6; + // instruction should be inserted + InstructionDescriptor instruction_to_insert_before = 3; } @@ -2292,24 +2260,6 @@ message TransformationSwapConditionalBranchOperands { } -message TransformationSwapFunctionVariables { - // A transformation that swaps function variables - - // Result id of the first variable. - uint32 result_id1 = 1; - // Result id of the second variable. - uint32 result_id2 = 2; - -} - -message TransformationSwapTwoFunctions { - // A transformation that swaps the position of two functions within the same module. - - // the IDs for the two functions that are swapped. - uint32 function_id1 = 1; - uint32 function_id2 = 2; -} - message TransformationToggleAccessChainInstruction { // A transformation that toggles an access chain instruction. @@ -2390,39 +2340,3 @@ message TransformationWrapRegionInSelection { bool branch_condition = 3; } - -message TransformationWrapVectorSynonym { - // A transformation that wraps an arithmetic operation into a vector operation - // and get the result of the original operation from the corresponding index. - // For instance, for this transformation, an scalar operation between two scalars: - // define op ∈ {+, -, *} - // c = a op b - // - // requires the availability of two vectors: - // - // va = vector(..., a, ...) - // vb = vector(..., b, ...) - // - // where a and b are in the same position i in each of their correponding vector - // and a is synonymous with va[i] and b is synonymous with vb[i]. - // - // The transformation then add an instruction vc = va op vb where c is synonymous - // with vc[i]. - - // The result if of the original scalar operation instruction. - uint32 instruction_id = 1; - - // The result id for the first vector that contains the first value of the scalar operation. - uint32 vector_operand1 = 2; - - // The result id for the second vector that contains the second value of the scalar operation. - uint32 vector_operand2 = 3; - - // A fresh id for the resulted vector from the addition of the first and second vector. - uint32 fresh_id = 4; - - // The position in the vector where the value of original instruction is located. Must be in - // the corresponding vector range. - uint32 scalar_position = 5; - -} diff --git a/source/fuzz/transformation.cpp b/source/fuzz/transformation.cpp index 70a302b7..ebbc3937 100644 --- a/source/fuzz/transformation.cpp +++ b/source/fuzz/transformation.cpp @@ -98,13 +98,10 @@ #include "source/fuzz/transformation_store.h" #include "source/fuzz/transformation_swap_commutable_operands.h" #include "source/fuzz/transformation_swap_conditional_branch_operands.h" -#include "source/fuzz/transformation_swap_function_variables.h" -#include "source/fuzz/transformation_swap_two_functions.h" #include "source/fuzz/transformation_toggle_access_chain_instruction.h" #include "source/fuzz/transformation_vector_shuffle.h" #include "source/fuzz/transformation_wrap_early_terminator_in_function.h" #include "source/fuzz/transformation_wrap_region_in_selection.h" -#include "source/fuzz/transformation_wrap_vector_synonym.h" #include "source/util/make_unique.h" namespace spvtools { @@ -364,12 +361,6 @@ std::unique_ptr Transformation::FromMessage( kSwapConditionalBranchOperands: return MakeUnique( message.swap_conditional_branch_operands()); - case protobufs::Transformation::TransformationCase::kSwapFunctionVariables: - return MakeUnique( - message.swap_function_variables()); - case protobufs::Transformation::TransformationCase::kSwapTwoFunctions: - return MakeUnique( - message.swap_two_functions()); case protobufs::Transformation::TransformationCase:: kToggleAccessChainInstruction: return MakeUnique( @@ -383,9 +374,6 @@ std::unique_ptr Transformation::FromMessage( case protobufs::Transformation::TransformationCase::kWrapRegionInSelection: return MakeUnique( message.wrap_region_in_selection()); - case protobufs::Transformation::TransformationCase::kWrapVectorSynonym: - return MakeUnique( - message.wrap_vector_synonym()); case protobufs::Transformation::TRANSFORMATION_NOT_SET: assert(false && "An unset transformation was encountered."); return nullptr; diff --git a/source/fuzz/transformation_access_chain.cpp b/source/fuzz/transformation_access_chain.cpp index 3fe9e656..97d4e041 100644 --- a/source/fuzz/transformation_access_chain.cpp +++ b/source/fuzz/transformation_access_chain.cpp @@ -122,7 +122,7 @@ bool TransformationAccessChain::IsApplicable( bool successful; std::tie(successful, index_value) = - GetStructIndexValue(ir_context, index_id, subobject_type_id); + GetIndexValue(ir_context, index_id, subobject_type_id); if (!successful) { return false; @@ -247,7 +247,7 @@ void TransformationAccessChain::Apply( // It is a struct: we need to retrieve the integer value. index_value = - GetStructIndexValue(ir_context, index_id, subobject_type_id).second; + GetIndexValue(ir_context, index_id, subobject_type_id).second; new_index_id = index_id; @@ -363,12 +363,9 @@ protobufs::Transformation TransformationAccessChain::ToMessage() const { return result; } -std::pair TransformationAccessChain::GetStructIndexValue( +std::pair TransformationAccessChain::GetIndexValue( opt::IRContext* ir_context, uint32_t index_id, uint32_t object_type_id) const { - assert(ir_context->get_def_use_mgr()->GetDef(object_type_id)->opcode() == - SpvOpTypeStruct && - "Precondition: the type must be a struct type."); if (!ValidIndexToComposite(ir_context, index_id, object_type_id)) { return {false, 0}; } @@ -377,9 +374,10 @@ std::pair TransformationAccessChain::GetStructIndexValue( uint32_t bound = fuzzerutil::GetBoundForCompositeIndex( *ir_context->get_def_use_mgr()->GetDef(object_type_id), ir_context); - // Ensure that the index given must represent a constant. - assert(spvOpcodeIsConstant(index_instruction->opcode()) && - "A non-constant index should already have been rejected."); + // The index must be a constant + if (!spvOpcodeIsConstant(index_instruction->opcode())) { + return {false, 0}; + } // The index must be in bounds. uint32_t value = index_instruction->GetSingleWordInOperand(0); diff --git a/source/fuzz/transformation_access_chain.h b/source/fuzz/transformation_access_chain.h index 4e4fd2b6..5582de39 100644 --- a/source/fuzz/transformation_access_chain.h +++ b/source/fuzz/transformation_access_chain.h @@ -83,13 +83,13 @@ class TransformationAccessChain : public Transformation { private: // Returns {false, 0} in each of the following cases: // - |index_id| does not correspond to a 32-bit integer constant - // - |object_type_id| must be a struct type + // - the object being indexed is not a composite type // - the constant at |index_id| is out of bounds. // Otherwise, returns {true, value}, where value is the value of the constant // at |index_id|. - std::pair GetStructIndexValue(opt::IRContext* ir_context, - uint32_t index_id, - uint32_t object_type_id) const; + std::pair GetIndexValue(opt::IRContext* ir_context, + uint32_t index_id, + uint32_t object_type_id) const; // Returns true if |index_id| corresponds, in the given context, to a 32-bit // integer which can be used to index an object of the type specified by diff --git a/source/fuzz/transformation_add_bit_instruction_synonym.cpp b/source/fuzz/transformation_add_bit_instruction_synonym.cpp index 636c0a38..d232e13a 100644 --- a/source/fuzz/transformation_add_bit_instruction_synonym.cpp +++ b/source/fuzz/transformation_add_bit_instruction_synonym.cpp @@ -39,9 +39,20 @@ bool TransformationAddBitInstructionSynonym::IsApplicable( auto instruction = ir_context->get_def_use_mgr()->GetDef(message_.instruction_result_id()); - // Checks on: only integer operands are supported, instructions are bitwise - // operations only. Signedness of the operands must be the same. - if (!IsInstructionSupported(ir_context, instruction)) { + // TODO(https://github.com/KhronosGroup/SPIRV-Tools/issues/3557): + // Right now we only support certain operations. When this issue is addressed + // the following conditional can use the function |spvOpcodeIsBit|. + // |instruction| must be defined and must be a supported bit instruction. + if (!instruction || (instruction->opcode() != SpvOpBitwiseOr && + instruction->opcode() != SpvOpBitwiseXor && + instruction->opcode() != SpvOpBitwiseAnd && + instruction->opcode() != SpvOpNot)) { + return false; + } + + // TODO(https://github.com/KhronosGroup/SPIRV-Tools/issues/3792): + // Right now, only integer operands are supported. + if (ir_context->get_type_mgr()->GetType(instruction->type_id())->AsVector()) { return false; } @@ -100,65 +111,6 @@ void TransformationAddBitInstructionSynonym::Apply( } } -bool TransformationAddBitInstructionSynonym::IsInstructionSupported( - opt::IRContext* ir_context, opt::Instruction* instruction) { - // TODO(https://github.com/KhronosGroup/SPIRV-Tools/issues/3557): - // Right now we only support certain operations. When this issue is addressed - // the following conditional can use the function |spvOpcodeIsBit|. - // |instruction| must be defined and must be a supported bit instruction. - if (!instruction || (instruction->opcode() != SpvOpBitwiseOr && - instruction->opcode() != SpvOpBitwiseXor && - instruction->opcode() != SpvOpBitwiseAnd && - instruction->opcode() != SpvOpNot)) { - return false; - } - - // TODO(https://github.com/KhronosGroup/SPIRV-Tools/issues/3792): - // Right now, only integer operands are supported. - if (ir_context->get_type_mgr()->GetType(instruction->type_id())->AsVector()) { - return false; - } - - if (instruction->opcode() == SpvOpNot) { - auto operand = instruction->GetInOperand(0).words[0]; - auto operand_inst = ir_context->get_def_use_mgr()->GetDef(operand); - auto operand_type = - ir_context->get_type_mgr()->GetType(operand_inst->type_id()); - auto operand_sign = operand_type->AsInteger()->IsSigned(); - - auto type_id_sign = ir_context->get_type_mgr() - ->GetType(instruction->type_id()) - ->AsInteger() - ->IsSigned(); - - return operand_sign == type_id_sign; - - } else { - // Other BitWise operations that takes two operands. - auto first_operand = instruction->GetInOperand(0).words[0]; - auto first_operand_inst = - ir_context->get_def_use_mgr()->GetDef(first_operand); - auto first_operand_type = - ir_context->get_type_mgr()->GetType(first_operand_inst->type_id()); - auto first_operand_sign = first_operand_type->AsInteger()->IsSigned(); - - auto second_operand = instruction->GetInOperand(1).words[0]; - auto second_operand_inst = - ir_context->get_def_use_mgr()->GetDef(second_operand); - auto second_operand_type = - ir_context->get_type_mgr()->GetType(second_operand_inst->type_id()); - auto second_operand_sign = second_operand_type->AsInteger()->IsSigned(); - - auto type_id_sign = ir_context->get_type_mgr() - ->GetType(instruction->type_id()) - ->AsInteger() - ->IsSigned(); - - return first_operand_sign == second_operand_sign && - first_operand_sign == type_id_sign; - } -} - protobufs::Transformation TransformationAddBitInstructionSynonym::ToMessage() const { protobufs::Transformation result; diff --git a/source/fuzz/transformation_add_bit_instruction_synonym.h b/source/fuzz/transformation_add_bit_instruction_synonym.h index 40b947a2..ad9d32d9 100644 --- a/source/fuzz/transformation_add_bit_instruction_synonym.h +++ b/source/fuzz/transformation_add_bit_instruction_synonym.h @@ -128,14 +128,6 @@ class TransformationAddBitInstructionSynonym : public Transformation { static uint32_t GetRequiredFreshIdCount(opt::IRContext* ir_context, opt::Instruction* bit_instruction); - // Returns true if: - // - A |bit_instruction| is one of OpBitwiseOr, OpBitwiseAnd, OpBitwiseXor or - // OpNot. - // - |bit_instruction|'s operands are scalars. - // - The operands have the same signedness. - static bool IsInstructionSupported(opt::IRContext* ir_context, - opt::Instruction* instruction); - private: protobufs::TransformationAddBitInstructionSynonym message_; diff --git a/source/fuzz/transformation_add_constant_null.cpp b/source/fuzz/transformation_add_constant_null.cpp index c0f73670..32544e6d 100644 --- a/source/fuzz/transformation_add_constant_null.cpp +++ b/source/fuzz/transformation_add_constant_null.cpp @@ -35,14 +35,14 @@ bool TransformationAddConstantNull::IsApplicable( if (!fuzzerutil::IsFreshId(context, message_.fresh_id())) { return false; } - auto type = context->get_def_use_mgr()->GetDef(message_.type_id()); + auto type = context->get_type_mgr()->GetType(message_.type_id()); // The type must exist. if (!type) { return false; } // The type must be one of the types for which null constants are allowed, // according to the SPIR-V spec. - return fuzzerutil::IsNullConstantSupported(context, *type); + return fuzzerutil::IsNullConstantSupported(*type); } void TransformationAddConstantNull::Apply( diff --git a/source/fuzz/transformation_add_dead_block.cpp b/source/fuzz/transformation_add_dead_block.cpp index df700ce5..82e8cd8f 100644 --- a/source/fuzz/transformation_add_dead_block.cpp +++ b/source/fuzz/transformation_add_dead_block.cpp @@ -79,7 +79,9 @@ bool TransformationAddDeadBlock::IsApplicable( } // |existing_block| must be reachable. - if (!ir_context->IsReachable(*existing_block)) { + opt::DominatorAnalysis* dominator_analysis = + ir_context->GetDominatorAnalysis(existing_block->GetParent()); + if (!dominator_analysis->IsReachable(existing_block->id())) { return false; } @@ -92,8 +94,6 @@ bool TransformationAddDeadBlock::IsApplicable( // the selection construct, its header |existing_block| will not dominate the // merge block |successor_block_id|, which is invalid. Thus, |existing_block| // must dominate |successor_block_id|. - opt::DominatorAnalysis* dominator_analysis = - ir_context->GetDominatorAnalysis(existing_block->GetParent()); if (!dominator_analysis->Dominates(existing_block->id(), successor_block_id)) { return false; diff --git a/source/fuzz/transformation_add_dead_break.cpp b/source/fuzz/transformation_add_dead_break.cpp index 32080ca4..ad46ce7f 100644 --- a/source/fuzz/transformation_add_dead_break.cpp +++ b/source/fuzz/transformation_add_dead_break.cpp @@ -134,7 +134,7 @@ bool TransformationAddDeadBreak::IsApplicable( return false; } - if (!ir_context->IsReachable(*bb_to)) { + if (!fuzzerutil::BlockIsReachableInItsFunction(ir_context, bb_to)) { // If the target of the break is unreachable, we conservatively do not // allow adding a dead break, to avoid the compilations that arise due to // the lack of sensible dominance information for unreachable blocks. diff --git a/source/fuzz/transformation_add_dead_continue.cpp b/source/fuzz/transformation_add_dead_continue.cpp index f2b9ab3f..be6294e8 100644 --- a/source/fuzz/transformation_add_dead_continue.cpp +++ b/source/fuzz/transformation_add_dead_continue.cpp @@ -83,7 +83,8 @@ bool TransformationAddDeadContinue::IsApplicable( auto continue_block = ir_context->cfg()->block(loop_header)->ContinueBlockId(); - if (!ir_context->IsReachable(*ir_context->cfg()->block(continue_block))) { + if (!fuzzerutil::BlockIsReachableInItsFunction( + ir_context, ir_context->cfg()->block(continue_block))) { // If the loop's continue block is unreachable, we conservatively do not // allow adding a dead continue, to avoid the compilations that arise due to // the lack of sensible dominance information for unreachable blocks. diff --git a/source/fuzz/transformation_add_global_undef.cpp b/source/fuzz/transformation_add_global_undef.cpp index ec0574a4..eb390ea0 100644 --- a/source/fuzz/transformation_add_global_undef.cpp +++ b/source/fuzz/transformation_add_global_undef.cpp @@ -15,7 +15,6 @@ #include "source/fuzz/transformation_add_global_undef.h" #include "source/fuzz/fuzzer_util.h" -#include "source/opt/reflect.h" namespace spvtools { namespace fuzz { @@ -36,11 +35,9 @@ bool TransformationAddGlobalUndef::IsApplicable( if (!fuzzerutil::IsFreshId(ir_context, message_.fresh_id())) { return false; } - auto type = ir_context->get_def_use_mgr()->GetDef(message_.type_id()); - // The type must exist, and must not be a function or pointer type. - return type != nullptr && opt::IsTypeInst(type->opcode()) && - type->opcode() != SpvOpTypeFunction && - type->opcode() != SpvOpTypePointer; + auto type = ir_context->get_type_mgr()->GetType(message_.type_id()); + // The type must exist, and must not be a function type. + return type && !type->AsFunction(); } void TransformationAddGlobalUndef::Apply( diff --git a/source/fuzz/transformation_add_global_undef.h b/source/fuzz/transformation_add_global_undef.h index fff1ad9d..37542c3f 100644 --- a/source/fuzz/transformation_add_global_undef.h +++ b/source/fuzz/transformation_add_global_undef.h @@ -31,7 +31,7 @@ class TransformationAddGlobalUndef : public Transformation { TransformationAddGlobalUndef(uint32_t fresh_id, uint32_t type_id); // - |message_.fresh_id| must be fresh - // - |message_.type_id| must be the id of a non-function, non-pointer type + // - |message_.type_id| must be the id of a non-function type bool IsApplicable( opt::IRContext* ir_context, const TransformationContext& transformation_context) const override; diff --git a/source/fuzz/transformation_add_synonym.cpp b/source/fuzz/transformation_add_synonym.cpp index 69269e5e..40768e2e 100644 --- a/source/fuzz/transformation_add_synonym.cpp +++ b/source/fuzz/transformation_add_synonym.cpp @@ -151,8 +151,7 @@ bool TransformationAddSynonym::IsInstructionValid( return false; } - if (!fuzzerutil::CanMakeSynonymOf(ir_context, transformation_context, - *inst)) { + if (!fuzzerutil::CanMakeSynonymOf(ir_context, transformation_context, inst)) { return false; } @@ -171,18 +170,6 @@ bool TransformationAddSynonym::IsInstructionValid( return type->AsInteger() || type->AsFloat(); } - case protobufs::TransformationAddSynonym::BITWISE_OR: - case protobufs::TransformationAddSynonym::BITWISE_XOR: { - // The instruction must be either an integer or a vector of integers. - const auto* type = ir_context->get_type_mgr()->GetType(inst->type_id()); - assert(type && "Instruction's result id is invalid"); - - if (const auto* vector = type->AsVector()) { - return vector->element_type()->AsInteger(); - } - - return type->AsInteger(); - } case protobufs::TransformationAddSynonym::COPY_OBJECT: // All checks for OpCopyObject are handled by // fuzzerutil::CanMakeSynonymOf. @@ -208,56 +195,68 @@ TransformationAddSynonym::MakeSynonymousInstruction( auto synonym_type_id = fuzzerutil::GetTypeId(ir_context, message_.result_id()); assert(synonym_type_id && "Synonym has invalid type id"); - auto opcode = SpvOpNop; - const auto* synonym_type = - ir_context->get_type_mgr()->GetType(synonym_type_id); - assert(synonym_type && "Synonym has invalid type"); - - auto is_integral = (synonym_type->AsVector() && - synonym_type->AsVector()->element_type()->AsInteger()) || - synonym_type->AsInteger(); switch (message_.synonym_type()) { case protobufs::TransformationAddSynonym::SUB_ZERO: - opcode = is_integral ? SpvOpISub : SpvOpFSub; - break; case protobufs::TransformationAddSynonym::MUL_ONE: - opcode = is_integral ? SpvOpIMul : SpvOpFMul; - break; - case protobufs::TransformationAddSynonym::ADD_ZERO: - opcode = is_integral ? SpvOpIAdd : SpvOpFAdd; - break; - case protobufs::TransformationAddSynonym::LOGICAL_OR: - opcode = SpvOpLogicalOr; - break; - case protobufs::TransformationAddSynonym::LOGICAL_AND: - opcode = SpvOpLogicalAnd; - break; - case protobufs::TransformationAddSynonym::BITWISE_OR: - opcode = SpvOpBitwiseOr; - break; - case protobufs::TransformationAddSynonym::BITWISE_XOR: - opcode = SpvOpBitwiseXor; - break; + case protobufs::TransformationAddSynonym::ADD_ZERO: { + const auto* synonym_type = + ir_context->get_type_mgr()->GetType(synonym_type_id); + assert(synonym_type && "Synonym has invalid type"); + // Compute instruction's opcode based on the type of the operand. + // We have already checked that the operand is either a scalar or a vector + // of either integers or floats. + auto is_integral = + (synonym_type->AsVector() && + synonym_type->AsVector()->element_type()->AsInteger()) || + synonym_type->AsInteger(); + auto opcode = SpvOpNop; + switch (message_.synonym_type()) { + case protobufs::TransformationAddSynonym::SUB_ZERO: + opcode = is_integral ? SpvOpISub : SpvOpFSub; + break; + case protobufs::TransformationAddSynonym::MUL_ONE: + opcode = is_integral ? SpvOpIMul : SpvOpFMul; + break; + case protobufs::TransformationAddSynonym::ADD_ZERO: + opcode = is_integral ? SpvOpIAdd : SpvOpFAdd; + break; + default: + assert(false && "Unreachable"); + break; + } + + return MakeUnique( + ir_context, opcode, synonym_type_id, message_.synonym_fresh_id(), + opt::Instruction::OperandList{ + {SPV_OPERAND_TYPE_ID, {message_.result_id()}}, + {SPV_OPERAND_TYPE_ID, + {MaybeGetConstantId(ir_context, transformation_context)}}}); + } case protobufs::TransformationAddSynonym::COPY_OBJECT: return MakeUnique( ir_context, SpvOpCopyObject, synonym_type_id, message_.synonym_fresh_id(), opt::Instruction::OperandList{ {SPV_OPERAND_TYPE_ID, {message_.result_id()}}}); - + case protobufs::TransformationAddSynonym::LOGICAL_OR: + case protobufs::TransformationAddSynonym::LOGICAL_AND: { + auto opcode = message_.synonym_type() == + protobufs::TransformationAddSynonym::LOGICAL_OR + ? SpvOpLogicalOr + : SpvOpLogicalAnd; + return MakeUnique( + ir_context, opcode, synonym_type_id, message_.synonym_fresh_id(), + opt::Instruction::OperandList{ + {SPV_OPERAND_TYPE_ID, {message_.result_id()}}, + {SPV_OPERAND_TYPE_ID, + {MaybeGetConstantId(ir_context, transformation_context)}}}); + } default: assert(false && "Unhandled synonym type"); return nullptr; } - - return MakeUnique( - ir_context, opcode, synonym_type_id, message_.synonym_fresh_id(), - opt::Instruction::OperandList{ - {SPV_OPERAND_TYPE_ID, {message_.result_id()}}, - {SPV_OPERAND_TYPE_ID, - {MaybeGetConstantId(ir_context, transformation_context)}}}); } uint32_t TransformationAddSynonym::MaybeGetConstantId( @@ -274,8 +273,6 @@ uint32_t TransformationAddSynonym::MaybeGetConstantId( case protobufs::TransformationAddSynonym::ADD_ZERO: case protobufs::TransformationAddSynonym::SUB_ZERO: case protobufs::TransformationAddSynonym::LOGICAL_OR: - case protobufs::TransformationAddSynonym::BITWISE_OR: - case protobufs::TransformationAddSynonym::BITWISE_XOR: return fuzzerutil::MaybeGetZeroConstant( ir_context, transformation_context, synonym_type_id, false); case protobufs::TransformationAddSynonym::MUL_ONE: @@ -322,8 +319,6 @@ bool TransformationAddSynonym::IsAdditionalConstantRequired( case protobufs::TransformationAddSynonym::LOGICAL_OR: case protobufs::TransformationAddSynonym::MUL_ONE: case protobufs::TransformationAddSynonym::LOGICAL_AND: - case protobufs::TransformationAddSynonym::BITWISE_OR: - case protobufs::TransformationAddSynonym::BITWISE_XOR: return true; default: return false; diff --git a/source/fuzz/transformation_composite_construct.cpp b/source/fuzz/transformation_composite_construct.cpp index 2d8e5991..0cd2308b 100644 --- a/source/fuzz/transformation_composite_construct.cpp +++ b/source/fuzz/transformation_composite_construct.cpp @@ -297,7 +297,7 @@ void TransformationCompositeConstruct::AddDataSynonymFacts( composite_type->AsVector() && component_type->AsVector(); if (!fuzzerutil::CanMakeSynonymOf( ir_context, *transformation_context, - *ir_context->get_def_use_mgr()->GetDef(component))) { + ir_context->get_def_use_mgr()->GetDef(component))) { // We can't make a synonym of this component, so we skip on to the next // component. In the case where we're packing a vector into a vector we // have to skip as many components of the resulting vectors as there are diff --git a/source/fuzz/transformation_composite_extract.cpp b/source/fuzz/transformation_composite_extract.cpp index 0fbd4e1b..647cd74e 100644 --- a/source/fuzz/transformation_composite_extract.cpp +++ b/source/fuzz/transformation_composite_extract.cpp @@ -125,7 +125,7 @@ void TransformationCompositeExtract::AddDataSynonymFacts( // or if the result id into which we are extracting is irrelevant. if (!fuzzerutil::CanMakeSynonymOf( ir_context, *transformation_context, - *ir_context->get_def_use_mgr()->GetDef(message_.composite_id())) || + ir_context->get_def_use_mgr()->GetDef(message_.composite_id())) || transformation_context->GetFactManager()->IdIsIrrelevant( message_.fresh_id())) { return; diff --git a/source/fuzz/transformation_composite_insert.cpp b/source/fuzz/transformation_composite_insert.cpp index 60fa5628..14c3a1b0 100644 --- a/source/fuzz/transformation_composite_insert.cpp +++ b/source/fuzz/transformation_composite_insert.cpp @@ -14,6 +14,7 @@ #include "transformation_composite_insert.h" +#include "source/fuzz/fuzzer_pass_add_composite_inserts.h" #include "source/fuzz/fuzzer_util.h" #include "source/fuzz/instruction_descriptor.h" @@ -219,9 +220,9 @@ void TransformationCompositeInsert::AddDataSynonymFacts( continue; } current_index.push_back(i); - if (fuzzerutil::CanMakeSynonymOf(ir_context, *transformation_context, - *ir_context->get_def_use_mgr()->GetDef( - message_.composite_id()))) { + if (fuzzerutil::CanMakeSynonymOf( + ir_context, *transformation_context, + ir_context->get_def_use_mgr()->GetDef(message_.composite_id()))) { transformation_context->GetFactManager()->AddFactDataSynonym( MakeDataDescriptor(message_.fresh_id(), current_index), MakeDataDescriptor(message_.composite_id(), current_index)); @@ -235,7 +236,7 @@ void TransformationCompositeInsert::AddDataSynonymFacts( // synonymous with the result of the insert instruction at the given index. if (fuzzerutil::CanMakeSynonymOf( ir_context, *transformation_context, - *ir_context->get_def_use_mgr()->GetDef(message_.object_id()))) { + ir_context->get_def_use_mgr()->GetDef(message_.object_id()))) { transformation_context->GetFactManager()->AddFactDataSynonym( MakeDataDescriptor(message_.object_id(), {}), MakeDataDescriptor(message_.fresh_id(), index)); diff --git a/source/fuzz/transformation_duplicate_region_with_selection.cpp b/source/fuzz/transformation_duplicate_region_with_selection.cpp index a80becd9..dee1207f 100644 --- a/source/fuzz/transformation_duplicate_region_with_selection.cpp +++ b/source/fuzz/transformation_duplicate_region_with_selection.cpp @@ -309,9 +309,9 @@ void TransformationDuplicateRegionWithSelection::Apply( // Construct the merge block. std::unique_ptr merge_block = - MakeUnique(MakeUnique( + MakeUnique(MakeUnique(opt::Instruction( ir_context, SpvOpLabel, 0, message_.merge_label_fresh_id(), - opt::Instruction::OperandList())); + opt::Instruction::OperandList()))); // Get the maps from the protobuf. std::map original_label_to_duplicate_label = diff --git a/source/fuzz/transformation_expand_vector_reduction.cpp b/source/fuzz/transformation_expand_vector_reduction.cpp index bafcf929..99387066 100644 --- a/source/fuzz/transformation_expand_vector_reduction.cpp +++ b/source/fuzz/transformation_expand_vector_reduction.cpp @@ -129,7 +129,7 @@ void TransformationExpandVectorReduction::Apply( // If it's possible to make a synonym of |instruction|, then add the fact that // the last |logical_instruction| is a synonym of |instruction|. if (fuzzerutil::CanMakeSynonymOf(ir_context, *transformation_context, - *instruction)) { + instruction)) { transformation_context->GetFactManager()->AddFactDataSynonym( MakeDataDescriptor(logical_instruction.result_id(), {}), MakeDataDescriptor(instruction->result_id(), {})); diff --git a/source/fuzz/transformation_flatten_conditional_branch.cpp b/source/fuzz/transformation_flatten_conditional_branch.cpp index 127e7628..b8c6de0c 100644 --- a/source/fuzz/transformation_flatten_conditional_branch.cpp +++ b/source/fuzz/transformation_flatten_conditional_branch.cpp @@ -441,17 +441,17 @@ bool TransformationFlattenConditionalBranch:: header->terminator()->opcode() == SpvOpBranchConditional && "|header| must be the header of a conditional."); - // |header| must be reachable. - if (!ir_context->IsReachable(*header)) { - return false; - } - auto enclosing_function = header->GetParent(); auto dominator_analysis = ir_context->GetDominatorAnalysis(enclosing_function); auto postdominator_analysis = ir_context->GetPostDominatorAnalysis(enclosing_function); + // |header| must be reachable. + if (!dominator_analysis->IsReachable(header)) { + return false; + } + // Check that the header and the merge block describe a single-entry, // single-exit region. if (!dominator_analysis->Dominates(header->id(), merge_block_id) || diff --git a/source/fuzz/transformation_load.cpp b/source/fuzz/transformation_load.cpp index bf48d996..e22f8dd2 100644 --- a/source/fuzz/transformation_load.cpp +++ b/source/fuzz/transformation_load.cpp @@ -24,15 +24,10 @@ TransformationLoad::TransformationLoad(protobufs::TransformationLoad message) : message_(std::move(message)) {} TransformationLoad::TransformationLoad( - uint32_t fresh_id, uint32_t pointer_id, bool is_atomic, - uint32_t memory_scope, uint32_t memory_semantics, + uint32_t fresh_id, uint32_t pointer_id, const protobufs::InstructionDescriptor& instruction_to_insert_before) { message_.set_fresh_id(fresh_id); message_.set_pointer_id(pointer_id); - message_.set_is_atomic(is_atomic); - message_.set_memory_scope_id(memory_scope); - message_.set_memory_semantics_id(memory_semantics); - *message_.mutable_instruction_to_insert_before() = instruction_to_insert_before; } @@ -73,98 +68,11 @@ bool TransformationLoad::IsApplicable( if (!insert_before) { return false; } - // ... and it must be legitimate to insert a load before it. - if (!message_.is_atomic() && - !fuzzerutil::CanInsertOpcodeBeforeInstruction(SpvOpLoad, insert_before)) { + // ... and it must be legitimate to insert a store before it. + if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(SpvOpLoad, insert_before)) { return false; } - if (message_.is_atomic() && !fuzzerutil::CanInsertOpcodeBeforeInstruction( - SpvOpAtomicLoad, insert_before)) { - return false; - } - - if (message_.is_atomic()) { - // Check the exists of memory scope and memory semantics ids. - auto memory_scope_instruction = - ir_context->get_def_use_mgr()->GetDef(message_.memory_scope_id()); - auto memory_semantics_instruction = - ir_context->get_def_use_mgr()->GetDef(message_.memory_semantics_id()); - - if (!memory_scope_instruction) { - return false; - } - if (!memory_semantics_instruction) { - return false; - } - // The memory scope and memory semantics instructions must have the - // 'OpConstant' opcode. - if (memory_scope_instruction->opcode() != SpvOpConstant) { - return false; - } - if (memory_semantics_instruction->opcode() != SpvOpConstant) { - return false; - } - // The memory scope and memory semantics need to be available before - // |insert_before|. - if (!fuzzerutil::IdIsAvailableBeforeInstruction( - ir_context, insert_before, message_.memory_scope_id())) { - return false; - } - if (!fuzzerutil::IdIsAvailableBeforeInstruction( - ir_context, insert_before, message_.memory_semantics_id())) { - return false; - } - // The memory scope and memory semantics instructions must have an Integer - // operand type with signedness does not matters. - if (ir_context->get_def_use_mgr() - ->GetDef(memory_scope_instruction->type_id()) - ->opcode() != SpvOpTypeInt) { - return false; - } - if (ir_context->get_def_use_mgr() - ->GetDef(memory_semantics_instruction->type_id()) - ->opcode() != SpvOpTypeInt) { - return false; - } - - // The size of the integer for memory scope and memory semantics - // instructions must be equal to 32 bits. - auto memory_scope_int_width = - ir_context->get_def_use_mgr() - ->GetDef(memory_scope_instruction->type_id()) - ->GetSingleWordInOperand(0); - auto memory_semantics_int_width = - ir_context->get_def_use_mgr() - ->GetDef(memory_semantics_instruction->type_id()) - ->GetSingleWordInOperand(0); - - if (memory_scope_int_width != 32) { - return false; - } - if (memory_semantics_int_width != 32) { - return false; - } - - // The memory scope constant value must be that of SpvScopeInvocation. - auto memory_scope_const_value = - memory_scope_instruction->GetSingleWordInOperand(0); - if (memory_scope_const_value != SpvScopeInvocation) { - return false; - } - - // The memory semantics constant value must match the storage class of the - // pointer being loaded from. - auto memory_semantics_const_value = static_cast( - memory_semantics_instruction->GetSingleWordInOperand(0)); - if (memory_semantics_const_value != - fuzzerutil::GetMemorySemanticsForStorageClass( - static_cast( - pointer_type->GetSingleWordInOperand(0)))) { - return false; - } - } - // The pointer needs to be available at the insertion point. return fuzzerutil::IdIsAvailableBeforeInstruction(ir_context, insert_before, message_.pointer_id()); @@ -172,46 +80,22 @@ bool TransformationLoad::IsApplicable( void TransformationLoad::Apply(opt::IRContext* ir_context, TransformationContext* /*unused*/) const { - if (message_.is_atomic()) { - // OpAtomicLoad instruction. - uint32_t result_type = fuzzerutil::GetPointeeTypeIdFromPointerType( - ir_context, fuzzerutil::GetTypeId(ir_context, message_.pointer_id())); - fuzzerutil::UpdateModuleIdBound(ir_context, message_.fresh_id()); - auto insert_before = - FindInstruction(message_.instruction_to_insert_before(), ir_context); - auto new_instruction = MakeUnique( - ir_context, SpvOpAtomicLoad, result_type, message_.fresh_id(), - opt::Instruction::OperandList( - {{SPV_OPERAND_TYPE_ID, {message_.pointer_id()}}, - {SPV_OPERAND_TYPE_SCOPE_ID, {message_.memory_scope_id()}}, - {SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, - {message_.memory_semantics_id()}}})); - auto new_instruction_ptr = new_instruction.get(); - insert_before->InsertBefore(std::move(new_instruction)); - // Inform the def-use manager about the new instruction and record its basic - // block. - ir_context->get_def_use_mgr()->AnalyzeInstDefUse(new_instruction_ptr); - ir_context->set_instr_block(new_instruction_ptr, - ir_context->get_instr_block(insert_before)); - } else { - // OpLoad instruction. - uint32_t result_type = fuzzerutil::GetPointeeTypeIdFromPointerType( - ir_context, fuzzerutil::GetTypeId(ir_context, message_.pointer_id())); - fuzzerutil::UpdateModuleIdBound(ir_context, message_.fresh_id()); - auto insert_before = - FindInstruction(message_.instruction_to_insert_before(), ir_context); - auto new_instruction = MakeUnique( - ir_context, SpvOpLoad, result_type, message_.fresh_id(), - opt::Instruction::OperandList( - {{SPV_OPERAND_TYPE_ID, {message_.pointer_id()}}})); - auto new_instruction_ptr = new_instruction.get(); - insert_before->InsertBefore(std::move(new_instruction)); - // Inform the def-use manager about the new instruction and record its basic - // block. - ir_context->get_def_use_mgr()->AnalyzeInstDefUse(new_instruction_ptr); - ir_context->set_instr_block(new_instruction_ptr, - ir_context->get_instr_block(insert_before)); - } + uint32_t result_type = fuzzerutil::GetPointeeTypeIdFromPointerType( + ir_context, fuzzerutil::GetTypeId(ir_context, message_.pointer_id())); + fuzzerutil::UpdateModuleIdBound(ir_context, message_.fresh_id()); + auto insert_before = + FindInstruction(message_.instruction_to_insert_before(), ir_context); + auto new_instruction = MakeUnique( + ir_context, SpvOpLoad, result_type, message_.fresh_id(), + opt::Instruction::OperandList( + {{SPV_OPERAND_TYPE_ID, {message_.pointer_id()}}})); + auto new_instruction_ptr = new_instruction.get(); + insert_before->InsertBefore(std::move(new_instruction)); + // Inform the def-use manager about the new instruction and record its basic + // block. + ir_context->get_def_use_mgr()->AnalyzeInstDefUse(new_instruction_ptr); + ir_context->set_instr_block(new_instruction_ptr, + ir_context->get_instr_block(insert_before)); } protobufs::Transformation TransformationLoad::ToMessage() const { diff --git a/source/fuzz/transformation_load.h b/source/fuzz/transformation_load.h index 57b4a535..d10b0073 100644 --- a/source/fuzz/transformation_load.h +++ b/source/fuzz/transformation_load.h @@ -28,20 +28,11 @@ class TransformationLoad : public Transformation { explicit TransformationLoad(protobufs::TransformationLoad message); TransformationLoad( - uint32_t fresh_id, uint32_t pointer_id, bool is_atomic, - uint32_t memory_scope, uint32_t memory_semantics, + uint32_t fresh_id, uint32_t pointer_id, const protobufs::InstructionDescriptor& instruction_to_insert_before); // - |message_.fresh_id| must be fresh // - |message_.pointer_id| must be the id of a pointer - // - |message_.is_atomic| must be true if want to work with OpAtomicLoad - // - If |is_atomic| is true then |message_memory_scope_id| must be the id of - // an OpConstant 32 bit integer instruction with the value - // SpvScopeInvocation. - // - If |is_atomic| is true then |message_.memory_semantics_id| must be the id - // of an OpConstant 32 bit integer instruction with the values - // SpvMemorySemanticsWorkgroupMemoryMask or - // SpvMemorySemanticsUniformMemoryMask. // - The pointer must not be OpConstantNull or OpUndef // - |message_.instruction_to_insert_before| must identify an instruction // before which it is valid to insert an OpLoad, and where diff --git a/source/fuzz/transformation_merge_blocks.cpp b/source/fuzz/transformation_merge_blocks.cpp index dbf782e2..22236795 100644 --- a/source/fuzz/transformation_merge_blocks.cpp +++ b/source/fuzz/transformation_merge_blocks.cpp @@ -43,9 +43,6 @@ bool TransformationMergeBlocks::IsApplicable( } auto first_block = ir_context->cfg()->block(predecessors.at(0)); - if (!ir_context->IsReachable(*first_block)) { - return false; - } return opt::blockmergeutil::CanMergeWithSuccessor(ir_context, first_block); } diff --git a/source/fuzz/transformation_merge_blocks.h b/source/fuzz/transformation_merge_blocks.h index f3462fae..f6306c5a 100644 --- a/source/fuzz/transformation_merge_blocks.h +++ b/source/fuzz/transformation_merge_blocks.h @@ -31,7 +31,6 @@ class TransformationMergeBlocks : public Transformation { TransformationMergeBlocks(uint32_t block_id); // - |message_.block_id| must be the id of a block, b - // - b must be statically reachable in the control flow graph of its function // - b must have a single predecessor, a // - b must be the sole successor of a // - Replacing a with the merge of a and b (and removing b) must lead to a diff --git a/source/fuzz/transformation_merge_function_returns.cpp b/source/fuzz/transformation_merge_function_returns.cpp index 022e1b6d..1aefedc0 100644 --- a/source/fuzz/transformation_merge_function_returns.cpp +++ b/source/fuzz/transformation_merge_function_returns.cpp @@ -25,13 +25,11 @@ TransformationMergeFunctionReturns::TransformationMergeFunctionReturns( : message_(std::move(message)) {} TransformationMergeFunctionReturns::TransformationMergeFunctionReturns( - uint32_t function_id, uint32_t outer_header_id, - uint32_t unreachable_continue_id, uint32_t outer_return_id, + uint32_t function_id, uint32_t outer_header_id, uint32_t outer_return_id, uint32_t return_val_id, uint32_t any_returnable_val_id, const std::vector& returns_merging_info) { message_.set_function_id(function_id); message_.set_outer_header_id(outer_header_id); - message_.set_unreachable_continue_id(unreachable_continue_id); message_.set_outer_return_id(outer_return_id); message_.set_return_val_id(return_val_id); message_.set_any_returnable_val_id(any_returnable_val_id); @@ -68,9 +66,7 @@ bool TransformationMergeFunctionReturns::IsApplicable( // Check that the fresh ids provided are fresh and distinct. std::set used_fresh_ids; - for (uint32_t id : - {message_.outer_header_id(), message_.unreachable_continue_id(), - message_.outer_return_id()}) { + for (uint32_t id : {message_.outer_header_id(), message_.outer_return_id()}) { if (!id || !CheckIdIsFreshAndNotUsedByThisTransformation(id, ir_context, &used_fresh_ids)) { return false; @@ -503,20 +499,25 @@ void TransformationMergeFunctionReturns::Apply( fuzzerutil::UpdateModuleIdBound(ir_context, message_.outer_header_id()); - // Add the instruction: - // OpLoopMerge %outer_return_id %unreachable_continue_id None + // Add the instruction: OpLoopMerge %outer_return_id %outer_header_id None + // The header is the continue block of the outer loop. outer_loop_header->AddInstruction(MakeUnique( ir_context, SpvOpLoopMerge, 0, 0, opt::Instruction::OperandList{ {SPV_OPERAND_TYPE_ID, {message_.outer_return_id()}}, - {SPV_OPERAND_TYPE_ID, {message_.unreachable_continue_id()}}, + {SPV_OPERAND_TYPE_ID, {message_.outer_header_id()}}, {SPV_OPERAND_TYPE_LOOP_CONTROL, {SpvLoopControlMaskNone}}})); - // Add unconditional branch to %block_after_entry. + // Add conditional branch: + // OpBranchConditional %true %block_after_entry %outer_header_id + // This will always branch to %block_after_entry, but it also creates a back + // edge for the loop (which is never traversed). outer_loop_header->AddInstruction(MakeUnique( - ir_context, SpvOpBranch, 0, 0, + ir_context, SpvOpBranchConditional, 0, 0, opt::Instruction::OperandList{ - {SPV_OPERAND_TYPE_ID, {block_after_entry}}})); + {SPV_OPERAND_TYPE_ID, {constant_true}}, + {SPV_OPERAND_TYPE_ID, {block_after_entry}}, + {SPV_OPERAND_TYPE_ID, {message_.outer_header_id()}}})); // Insert the header right after the entry block. function->InsertBasicBlockAfter(std::move(outer_loop_header), @@ -580,24 +581,6 @@ void TransformationMergeFunctionReturns::Apply( // Insert the new return block at the end of the function. function->AddBasicBlock(std::move(outer_return_block)); - // Create the unreachable continue block associated with the enclosing loop. - auto unreachable_continue_block = - MakeUnique(MakeUnique( - ir_context, SpvOpLabel, 0, message_.unreachable_continue_id(), - opt::Instruction::OperandList())); - - fuzzerutil::UpdateModuleIdBound(ir_context, - message_.unreachable_continue_id()); - - // Insert an branch back to the loop header, to create a back edge. - unreachable_continue_block->AddInstruction(MakeUnique( - ir_context, SpvOpBranch, 0, 0, - opt::Instruction::OperandList{ - {SPV_OPERAND_TYPE_ID, {message_.outer_header_id()}}})); - - // Insert the unreachable continue block at the end of the function. - function->AddBasicBlock(std::move(unreachable_continue_block)); - // All analyses must be invalidated because the structure of the module was // changed. ir_context->InvalidateAnalysesExceptFor(opt::IRContext::kAnalysisNone); @@ -607,14 +590,13 @@ std::unordered_set TransformationMergeFunctionReturns::GetFreshIds() const { std::unordered_set result; result.emplace(message_.outer_header_id()); - result.emplace(message_.unreachable_continue_id()); result.emplace(message_.outer_return_id()); // |message_.return_val_info| can be 0 if the function is void. if (message_.return_val_id()) { result.emplace(message_.return_val_id()); } - for (const auto& merging_info : message_.return_merging_info()) { + for (auto merging_info : message_.return_merging_info()) { result.emplace(merging_info.is_returning_id()); // |maybe_return_val_id| can be 0 if the function is void. if (merging_info.maybe_return_val_id()) { diff --git a/source/fuzz/transformation_merge_function_returns.h b/source/fuzz/transformation_merge_function_returns.h index b3208acf..8f0937c2 100644 --- a/source/fuzz/transformation_merge_function_returns.h +++ b/source/fuzz/transformation_merge_function_returns.h @@ -25,8 +25,7 @@ class TransformationMergeFunctionReturns : public Transformation { protobufs::TransformationMergeFunctionReturns message); TransformationMergeFunctionReturns( - uint32_t function_id, uint32_t outer_header_id, - uint32_t unreachable_continue_id, uint32_t outer_return_id, + uint32_t function_id, uint32_t outer_header_id, uint32_t outer_return_id, uint32_t return_val_id, uint32_t any_returnable_val_id, const std::vector& returns_merging_info); @@ -41,7 +40,7 @@ class TransformationMergeFunctionReturns : public Transformation { // statements, this id will be ignored. // - Merge blocks of reachable loops that contain return statements only // consist of OpLabel, OpPhi or OpBranch instructions. - // - The module contains OpConstantTrue and OpConstantFalse instructions. + // - The model contains OpConstantTrue and OpConstantFalse instructions. // - For all merge blocks of reachable loops that contain return statements, // either: // - a mapping is provided in |message_.return_merging_info|, all of the diff --git a/source/fuzz/transformation_outline_function.cpp b/source/fuzz/transformation_outline_function.cpp index 3140fa6b..6ee91225 100644 --- a/source/fuzz/transformation_outline_function.cpp +++ b/source/fuzz/transformation_outline_function.cpp @@ -175,18 +175,6 @@ bool TransformationOutlineFunction::IsApplicable( // This is achieved by going through every block in the function that contains // the region. for (auto& block : *entry_block->GetParent()) { - if (region_set.count(&block) != 0) { - // The block is in the region. Check that it does not have any unreachable - // predecessors. If it does, then we do not regard the region as single- - // entry-single-exit and hence do not outline it. - for (auto pred : ir_context->cfg()->preds(block.id())) { - if (!ir_context->IsReachable(*ir_context->cfg()->block(pred))) { - // The predecessor is unreachable. - return false; - } - } - } - if (&block == exit_block) { // It is OK (and typically expected) for the exit block of the region to // have successors outside the region. diff --git a/source/fuzz/transformation_permute_phi_operands.cpp b/source/fuzz/transformation_permute_phi_operands.cpp index 7ee7a82f..60563312 100644 --- a/source/fuzz/transformation_permute_phi_operands.cpp +++ b/source/fuzz/transformation_permute_phi_operands.cpp @@ -81,7 +81,8 @@ void TransformationPermutePhiOperands::Apply( inst->SetInOperands(std::move(permuted_operands)); // Update the def-use manager. - ir_context->UpdateDefUse(inst); + ir_context->get_def_use_mgr()->ClearInst(inst); + ir_context->get_def_use_mgr()->AnalyzeInstDefUse(inst); } protobufs::Transformation TransformationPermutePhiOperands::ToMessage() const { diff --git a/source/fuzz/transformation_propagate_instruction_down.cpp b/source/fuzz/transformation_propagate_instruction_down.cpp index c3b7c4d9..7713562e 100644 --- a/source/fuzz/transformation_propagate_instruction_down.cpp +++ b/source/fuzz/transformation_propagate_instruction_down.cpp @@ -386,8 +386,11 @@ bool TransformationPropagateInstructionDown::IsApplicableToBlock( return false; } + const auto* dominator_analysis = + ir_context->GetDominatorAnalysis(block->GetParent()); + // |block| must be reachable. - if (!ir_context->IsReachable(*block)) { + if (!dominator_analysis->IsReachable(block)) { return false; } @@ -427,9 +430,6 @@ bool TransformationPropagateInstructionDown::IsApplicableToBlock( auto phi_block_id = GetOpPhiBlockId(ir_context, block_id, *inst_to_propagate, successor_ids); - const auto* dominator_analysis = - ir_context->GetDominatorAnalysis(block->GetParent()); - // Make sure we can adjust all users of the propagated instruction. return ir_context->get_def_use_mgr()->WhileEachUse( inst_to_propagate, @@ -537,7 +537,7 @@ uint32_t TransformationPropagateInstructionDown::GetOpPhiBlockId( // Check that |merge_block_id| is reachable in the CFG and |block_id| // dominates |merge_block_id|. - if (!ir_context->IsReachable(*ir_context->cfg()->block(merge_block_id)) || + if (!dominator_analysis->IsReachable(merge_block_id) || !dominator_analysis->Dominates(block_id, merge_block_id)) { return 0; } diff --git a/source/fuzz/transformation_push_id_through_variable.cpp b/source/fuzz/transformation_push_id_through_variable.cpp index 55a57a15..0df1da6b 100644 --- a/source/fuzz/transformation_push_id_through_variable.cpp +++ b/source/fuzz/transformation_push_id_through_variable.cpp @@ -61,7 +61,7 @@ bool TransformationPushIdThroughVariable::IsApplicable( // The instruction to insert before must belong to a reachable block. auto basic_block = ir_context->get_instr_block(instruction_to_insert_before); - if (!ir_context->IsReachable(*basic_block)) { + if (!fuzzerutil::BlockIsReachableInItsFunction(ir_context, basic_block)) { return false; } @@ -155,7 +155,7 @@ void TransformationPushIdThroughVariable::Apply( // We should be able to create a synonym of |value_id| if it's not irrelevant. if (fuzzerutil::CanMakeSynonymOf(ir_context, *transformation_context, - *value_instruction) && + value_instruction) && !transformation_context->GetFactManager()->IdIsIrrelevant( message_.value_synonym_id())) { // Adds the fact that |message_.value_synonym_id| diff --git a/source/fuzz/transformation_replace_id_with_synonym.cpp b/source/fuzz/transformation_replace_id_with_synonym.cpp index 14555315..92ce751d 100644 --- a/source/fuzz/transformation_replace_id_with_synonym.cpp +++ b/source/fuzz/transformation_replace_id_with_synonym.cpp @@ -140,43 +140,9 @@ bool TransformationReplaceIdWithSynonym::IsAgnosticToSignednessOfOperand( case SpvOpUGreaterThanEqual: case SpvOpSGreaterThanEqual: return true; - - case SpvOpAtomicStore: - case SpvOpAtomicExchange: - case SpvOpAtomicIAdd: - case SpvOpAtomicISub: - case SpvOpAtomicSMin: - case SpvOpAtomicUMin: - case SpvOpAtomicSMax: - case SpvOpAtomicUMax: - case SpvOpAtomicAnd: - case SpvOpAtomicOr: - case SpvOpAtomicXor: - case SpvOpAtomicFAddEXT: // Capability AtomicFloat32AddEXT, - // AtomicFloat64AddEXT. - assert(use_in_operand_index != 0 && - "Signedness check should not occur on a pointer operand."); - return use_in_operand_index == 1 || use_in_operand_index == 2; - - case SpvOpAtomicCompareExchange: - case SpvOpAtomicCompareExchangeWeak: // Capability Kernel. - assert(use_in_operand_index != 0 && - "Signedness check should not occur on a pointer operand."); - return use_in_operand_index >= 1 && use_in_operand_index <= 3; - - case SpvOpAtomicLoad: - case SpvOpAtomicIIncrement: - case SpvOpAtomicIDecrement: - case SpvOpAtomicFlagTestAndSet: // Capability Kernel. - case SpvOpAtomicFlagClear: // Capability Kernel. - assert(use_in_operand_index != 0 && - "Signedness check should not occur on a pointer operand."); - return use_in_operand_index >= 1; - case SpvOpAccessChain: // The signedness of indices does not matter. return use_in_operand_index > 0; - default: // Conservatively assume that the id cannot be swapped in other // instructions. diff --git a/source/fuzz/transformation_store.cpp b/source/fuzz/transformation_store.cpp index c00cd345..f8c6d013 100644 --- a/source/fuzz/transformation_store.cpp +++ b/source/fuzz/transformation_store.cpp @@ -24,13 +24,9 @@ TransformationStore::TransformationStore(protobufs::TransformationStore message) : message_(std::move(message)) {} TransformationStore::TransformationStore( - uint32_t pointer_id, bool is_atomic, uint32_t memory_scope, - uint32_t memory_semantics, uint32_t value_id, + uint32_t pointer_id, uint32_t value_id, const protobufs::InstructionDescriptor& instruction_to_insert_before) { message_.set_pointer_id(pointer_id); - message_.set_is_atomic(is_atomic); - message_.set_memory_scope_id(memory_scope); - message_.set_memory_semantics_id(memory_semantics); message_.set_value_id(value_id); *message_.mutable_instruction_to_insert_before() = instruction_to_insert_before; @@ -74,12 +70,8 @@ bool TransformationStore::IsApplicable( return false; } // ... and it must be legitimate to insert a store before it. - if (!message_.is_atomic() && !fuzzerutil::CanInsertOpcodeBeforeInstruction( - SpvOpStore, insert_before)) { - return false; - } - if (message_.is_atomic() && !fuzzerutil::CanInsertOpcodeBeforeInstruction( - SpvOpAtomicStore, insert_before)) { + if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(SpvOpStore, + insert_before)) { return false; } @@ -110,87 +102,6 @@ bool TransformationStore::IsApplicable( return false; } - if (message_.is_atomic()) { - // Check the exists of memory scope and memory semantics ids. - auto memory_scope_instruction = - ir_context->get_def_use_mgr()->GetDef(message_.memory_scope_id()); - auto memory_semantics_instruction = - ir_context->get_def_use_mgr()->GetDef(message_.memory_semantics_id()); - - if (!memory_scope_instruction) { - return false; - } - if (!memory_semantics_instruction) { - return false; - } - // The memory scope and memory semantics instructions must have the - // 'OpConstant' opcode. - if (memory_scope_instruction->opcode() != SpvOpConstant) { - return false; - } - if (memory_semantics_instruction->opcode() != SpvOpConstant) { - return false; - } - // The memory scope and memory semantics need to be available before - // |insert_before|. - if (!fuzzerutil::IdIsAvailableBeforeInstruction( - ir_context, insert_before, message_.memory_scope_id())) { - return false; - } - if (!fuzzerutil::IdIsAvailableBeforeInstruction( - ir_context, insert_before, message_.memory_semantics_id())) { - return false; - } - // The memory scope and memory semantics instructions must have an Integer - // operand type with signedness does not matters. - if (ir_context->get_def_use_mgr() - ->GetDef(memory_scope_instruction->type_id()) - ->opcode() != SpvOpTypeInt) { - return false; - } - if (ir_context->get_def_use_mgr() - ->GetDef(memory_semantics_instruction->type_id()) - ->opcode() != SpvOpTypeInt) { - return false; - } - - // The size of the integer for memory scope and memory semantics - // instructions must be equal to 32 bits. - auto memory_scope_int_width = - ir_context->get_def_use_mgr() - ->GetDef(memory_scope_instruction->type_id()) - ->GetSingleWordInOperand(0); - auto memory_semantics_int_width = - ir_context->get_def_use_mgr() - ->GetDef(memory_semantics_instruction->type_id()) - ->GetSingleWordInOperand(0); - - if (memory_scope_int_width != 32) { - return false; - } - if (memory_semantics_int_width != 32) { - return false; - } - - // The memory scope constant value must be that of SpvScopeInvocation. - auto memory_scope_const_value = - memory_scope_instruction->GetSingleWordInOperand(0); - if (memory_scope_const_value != SpvScopeInvocation) { - return false; - } - - // The memory semantics constant value must match the storage class of the - // pointer being loaded from. - auto memory_semantics_const_value = static_cast( - memory_semantics_instruction->GetSingleWordInOperand(0)); - if (memory_semantics_const_value != - fuzzerutil::GetMemorySemanticsForStorageClass( - static_cast( - pointer_type->GetSingleWordInOperand(0)))) { - return false; - } - } - // The value needs to be available at the insertion point. return fuzzerutil::IdIsAvailableBeforeInstruction(ir_context, insert_before, message_.value_id()); @@ -198,43 +109,20 @@ bool TransformationStore::IsApplicable( void TransformationStore::Apply(opt::IRContext* ir_context, TransformationContext* /*unused*/) const { - if (message_.is_atomic()) { - // OpAtomicStore instruction. - auto insert_before = - FindInstruction(message_.instruction_to_insert_before(), ir_context); - auto new_instruction = MakeUnique( - ir_context, SpvOpAtomicStore, 0, 0, - opt::Instruction::OperandList( - {{SPV_OPERAND_TYPE_ID, {message_.pointer_id()}}, - {SPV_OPERAND_TYPE_SCOPE_ID, {message_.memory_scope_id()}}, - {SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, - {message_.memory_semantics_id()}}, - {SPV_OPERAND_TYPE_ID, {message_.value_id()}}})); - auto new_instruction_ptr = new_instruction.get(); - insert_before->InsertBefore(std::move(new_instruction)); - // Inform the def-use manager about the new instruction and record its basic - // block. - ir_context->get_def_use_mgr()->AnalyzeInstDefUse(new_instruction_ptr); - ir_context->set_instr_block(new_instruction_ptr, - ir_context->get_instr_block(insert_before)); - - } else { - // OpStore instruction. - auto insert_before = - FindInstruction(message_.instruction_to_insert_before(), ir_context); - auto new_instruction = MakeUnique( - ir_context, SpvOpStore, 0, 0, - opt::Instruction::OperandList( - {{SPV_OPERAND_TYPE_ID, {message_.pointer_id()}}, - {SPV_OPERAND_TYPE_ID, {message_.value_id()}}})); - auto new_instruction_ptr = new_instruction.get(); - insert_before->InsertBefore(std::move(new_instruction)); - // Inform the def-use manager about the new instruction and record its basic - // block. - ir_context->get_def_use_mgr()->AnalyzeInstDefUse(new_instruction_ptr); - ir_context->set_instr_block(new_instruction_ptr, - ir_context->get_instr_block(insert_before)); - } + auto insert_before = + FindInstruction(message_.instruction_to_insert_before(), ir_context); + auto new_instruction = MakeUnique( + ir_context, SpvOpStore, 0, 0, + opt::Instruction::OperandList( + {{SPV_OPERAND_TYPE_ID, {message_.pointer_id()}}, + {SPV_OPERAND_TYPE_ID, {message_.value_id()}}})); + auto new_instruction_ptr = new_instruction.get(); + insert_before->InsertBefore(std::move(new_instruction)); + // Inform the def-use manager about the new instruction and record its basic + // block. + ir_context->get_def_use_mgr()->AnalyzeInstDefUse(new_instruction_ptr); + ir_context->set_instr_block(new_instruction_ptr, + ir_context->get_instr_block(insert_before)); } protobufs::Transformation TransformationStore::ToMessage() const { diff --git a/source/fuzz/transformation_store.h b/source/fuzz/transformation_store.h index 638713bb..18ba1d7d 100644 --- a/source/fuzz/transformation_store.h +++ b/source/fuzz/transformation_store.h @@ -28,21 +28,12 @@ class TransformationStore : public Transformation { explicit TransformationStore(protobufs::TransformationStore message); TransformationStore( - uint32_t pointer_id, bool is_atomic, uint32_t memory_scope, - uint32_t memory_semantics, uint32_t value_id, + uint32_t pointer_id, uint32_t value_id, const protobufs::InstructionDescriptor& instruction_to_insert_before); // - |message_.pointer_id| must be the id of a pointer // - The pointer type must not have read-only storage class // - The pointer must not be OpConstantNull or OpUndef - // - |message_.is_atomic| must be true if want to work with OpAtomicStore. - // - If |is_atomic| is true then |message_memory_scope_id| must be the id of - // an OpConstant 32 bit integer instruction with the value - // SpvScopeInvocation. - // - If |is_atomic| is true then |message_.memory_semantics_id| must be the id - // of an OpConstant 32 bit integer instruction with the values - // SpvMemorySemanticsWorkgroupMemoryMask or - // SpvMemorySemanticsUniformMemoryMask. // - |message_.value_id| must be an instruction result id that has the same // type as the pointee type of |message_.pointer_id| // - |message_.instruction_to_insert_before| must identify an instruction diff --git a/source/fuzz/transformation_swap_function_variables.cpp b/source/fuzz/transformation_swap_function_variables.cpp deleted file mode 100644 index aec32fe1..00000000 --- a/source/fuzz/transformation_swap_function_variables.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) 2021 Mostafa Ashraf -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/fuzz/transformation_swap_function_variables.h" - -#include "source/fuzz/fuzzer_util.h" - -namespace spvtools { -namespace fuzz { - -TransformationSwapFunctionVariables::TransformationSwapFunctionVariables( - protobufs::TransformationSwapFunctionVariables message) - : message_(std::move(message)) {} - -TransformationSwapFunctionVariables::TransformationSwapFunctionVariables( - uint32_t result_id1, uint32_t result_id2) { - message_.set_result_id1(result_id1); - message_.set_result_id2(result_id2); -} - -bool TransformationSwapFunctionVariables::IsApplicable( - opt::IRContext* ir_context, const TransformationContext& /*unused*/) const { - uint32_t result_id1 = message_.result_id1(); - uint32_t result_id2 = message_.result_id2(); - - assert((result_id1 != result_id2) && "Two results ids are equal"); - - // The result ids used in the message must refer to instructions. - auto instruction1 = ir_context->get_def_use_mgr()->GetDef(result_id1); - auto instruction2 = ir_context->get_def_use_mgr()->GetDef(result_id2); - if (instruction1 == nullptr || instruction2 == nullptr) { - return false; - } - // Both instructions must be variables. - if (instruction1->opcode() != SpvOpVariable || - instruction2->opcode() != SpvOpVariable) { - return false; - } - - // Both variable instructions must be in some basic block (as they are - // function-local variables), and they must be in the same block (as they need - // to be variables of the same function). - auto* block_1 = ir_context->get_instr_block(result_id1); - auto* block_2 = ir_context->get_instr_block(result_id2); - if (block_1 == nullptr || block_2 == nullptr) { - return false; - } - - return block_1 == block_2; -} - -void TransformationSwapFunctionVariables::Apply( - opt::IRContext* ir_context, TransformationContext* /*unused*/) const { - // The result ids used in the message must refer to instructions. - auto instruction1 = - ir_context->get_def_use_mgr()->GetDef(message_.result_id1()); - auto instruction2 = - ir_context->get_def_use_mgr()->GetDef(message_.result_id2()); - - std::unique_ptr temp_instruction = - MakeUnique(); - - temp_instruction->InsertBefore(instruction1); - instruction1->InsertAfter(instruction2); - instruction2->InsertAfter(temp_instruction.get()); - temp_instruction->RemoveFromList(); -} - -protobufs::Transformation TransformationSwapFunctionVariables::ToMessage() - const { - protobufs::Transformation result; - *result.mutable_swap_function_variables() = message_; - return result; -} - -std::unordered_set TransformationSwapFunctionVariables::GetFreshIds() - const { - return std::unordered_set(); -} - -} // namespace fuzz -} // namespace spvtools diff --git a/source/fuzz/transformation_swap_function_variables.h b/source/fuzz/transformation_swap_function_variables.h deleted file mode 100644 index eb383f4f..00000000 --- a/source/fuzz/transformation_swap_function_variables.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 2021 Mostafa Ashraf -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SOURCE_FUZZ_TRANSFORMATION_SWAP_FUNCTION_VARIABLES_H_ -#define SOURCE_FUZZ_TRANSFORMATION_SWAP_FUNCTION_VARIABLES_H_ - -#include "source/fuzz/protobufs/spirvfuzz_protobufs.h" -#include "source/fuzz/transformation.h" -#include "source/fuzz/transformation_context.h" -#include "source/opt/ir_context.h" - -namespace spvtools { -namespace fuzz { - -// A transformation that swaps two variable declaration instructions that appear -// in the same function. -class TransformationSwapFunctionVariables : public Transformation { - public: - explicit TransformationSwapFunctionVariables( - protobufs::TransformationSwapFunctionVariables message); - - TransformationSwapFunctionVariables(uint32_t result_id1, uint32_t result_id2); - - // - |message_.result_id1| and |message_.result_id2| must be the ids of - // distinct OpVariable instructions appearing in the same function. - bool IsApplicable( - opt::IRContext* ir_context, - const TransformationContext& transformation_context) const override; - - // Swaps two OpVariable instructions with result ids |message_.result_id1| - // and |message_.result_id2|. - void Apply(opt::IRContext* ir_context, - TransformationContext* transformation_context) const override; - - protobufs::Transformation ToMessage() const override; - - std::unordered_set GetFreshIds() const override; - - private: - protobufs::TransformationSwapFunctionVariables message_; -}; - -} // namespace fuzz -} // namespace spvtools - -#endif // SOURCE_FUZZ_TRANSFORMATION_SWAP_FUNCTION_VARIABLES_H_ diff --git a/source/fuzz/transformation_swap_two_functions.cpp b/source/fuzz/transformation_swap_two_functions.cpp deleted file mode 100644 index 85d9e79c..00000000 --- a/source/fuzz/transformation_swap_two_functions.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) 2021 Shiyu Liu -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/fuzz/transformation_swap_two_functions.h" - -#include "source/opt/function.h" -#include "source/opt/module.h" - -#include "source/fuzz/fuzzer_util.h" - -namespace spvtools { -namespace fuzz { - -TransformationSwapTwoFunctions::TransformationSwapTwoFunctions( - protobufs::TransformationSwapTwoFunctions message) - : message_(std::move(message)) {} - -TransformationSwapTwoFunctions::TransformationSwapTwoFunctions(uint32_t id1, - uint32_t id2) { - assert(id1 != id2 && "The two function ids cannot be the same."); - message_.set_function_id1(id1); - message_.set_function_id2(id2); -} - -bool TransformationSwapTwoFunctions::IsApplicable( - opt::IRContext* ir_context, const TransformationContext& /*unused*/) const { - auto func1_ptr = ir_context->GetFunction(message_.function_id1()); - auto func2_ptr = ir_context->GetFunction(message_.function_id2()); - return func1_ptr != nullptr && func2_ptr != nullptr; -} - -void TransformationSwapTwoFunctions::Apply( - opt::IRContext* ir_context, TransformationContext* /*unused*/) const { - opt::Module::iterator func1_it = - fuzzerutil::GetFunctionIterator(ir_context, message_.function_id1()); - opt::Module::iterator func2_it = - fuzzerutil::GetFunctionIterator(ir_context, message_.function_id2()); - - assert(func1_it != ir_context->module()->end() && - "Could not find function 1."); - assert(func2_it != ir_context->module()->end() && - "Could not find function 2."); - - // Two function pointers are all set, swap the two functions within the - // module. - std::iter_swap(func1_it.Get(), func2_it.Get()); -} - -protobufs::Transformation TransformationSwapTwoFunctions::ToMessage() const { - protobufs::Transformation result; - *result.mutable_swap_two_functions() = message_; - return result; -} - -std::unordered_set TransformationSwapTwoFunctions::GetFreshIds() - const { - return std::unordered_set(); -} - -} // namespace fuzz -} // namespace spvtools diff --git a/source/fuzz/transformation_swap_two_functions.h b/source/fuzz/transformation_swap_two_functions.h deleted file mode 100644 index 1b6d6e80..00000000 --- a/source/fuzz/transformation_swap_two_functions.h +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2021 Shiyu Liu -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SOURCE_FUZZ_TRANSFORMATION_SWAP_TWO_FUNCTIONS_H_ -#define SOURCE_FUZZ_TRANSFORMATION_SWAP_TWO_FUNCTIONS_H_ - -#include "source/fuzz/protobufs/spirvfuzz_protobufs.h" -#include "source/fuzz/transformation.h" -#include "source/fuzz/transformation_context.h" -#include "source/opt/ir_context.h" - -namespace spvtools { -namespace fuzz { - -class TransformationSwapTwoFunctions : public Transformation { - public: - explicit TransformationSwapTwoFunctions( - protobufs::TransformationSwapTwoFunctions message); - - TransformationSwapTwoFunctions(uint32_t function_id1, uint32_t function_id2); - - // |function_id1| and |function_id1| should all be existing ids. - // Swap function operation is only permitted if: - // - both ids must be ids of functions. - // - both ids can be found in the module. - // - function_id1 and function_id2 are not the same. - bool IsApplicable( - opt::IRContext* ir_context, - const TransformationContext& transformation_context) const override; - - // OpFunction with |function_id1| and |function_id1| are swapped. - void Apply(opt::IRContext* ir_context, - TransformationContext* transformation_context) const override; - - std::unordered_set GetFreshIds() const override; - protobufs::Transformation ToMessage() const override; - - private: - protobufs::TransformationSwapTwoFunctions message_; -}; - -} // namespace fuzz -} // namespace spvtools - -#endif // SOURCE_FUZZ_TRANSFORMATION_SWAP_TWO_FUNCTIONS_H_ diff --git a/source/fuzz/transformation_vector_shuffle.cpp b/source/fuzz/transformation_vector_shuffle.cpp index 742a2c80..ac0e3ccb 100644 --- a/source/fuzz/transformation_vector_shuffle.cpp +++ b/source/fuzz/transformation_vector_shuffle.cpp @@ -204,7 +204,7 @@ void TransformationVectorShuffle::AddDataSynonymFacts( // Check that the first vector can participate in data synonym facts. if (!fuzzerutil::CanMakeSynonymOf( ir_context, *transformation_context, - *ir_context->get_def_use_mgr()->GetDef(message_.vector1()))) { + ir_context->get_def_use_mgr()->GetDef(message_.vector1()))) { continue; } descriptor_for_source_component = @@ -213,7 +213,7 @@ void TransformationVectorShuffle::AddDataSynonymFacts( // Check that the second vector can participate in data synonym facts. if (!fuzzerutil::CanMakeSynonymOf( ir_context, *transformation_context, - *ir_context->get_def_use_mgr()->GetDef(message_.vector2()))) { + ir_context->get_def_use_mgr()->GetDef(message_.vector2()))) { continue; } auto index_into_vector_2 = diff --git a/source/fuzz/transformation_wrap_vector_synonym.cpp b/source/fuzz/transformation_wrap_vector_synonym.cpp deleted file mode 100644 index d0eddd44..00000000 --- a/source/fuzz/transformation_wrap_vector_synonym.cpp +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) 2021 Shiyu Liu -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/fuzz/transformation_wrap_vector_synonym.h" - -#include "source/fuzz/data_descriptor.h" -#include "source/fuzz/fuzzer_util.h" -#include "source/opt/instruction.h" - -namespace spvtools { -namespace fuzz { - -TransformationWrapVectorSynonym::TransformationWrapVectorSynonym( - protobufs::TransformationWrapVectorSynonym message) - : message_(std::move(message)) {} - -TransformationWrapVectorSynonym::TransformationWrapVectorSynonym( - uint32_t instruction_id, uint32_t vector_operand1, uint32_t vector_operand2, - uint32_t fresh_id, uint32_t pos) { - message_.set_instruction_id(instruction_id); - message_.set_vector_operand1(vector_operand1); - message_.set_vector_operand2(vector_operand2); - message_.set_fresh_id(fresh_id); - message_.set_scalar_position(pos); -} - -bool TransformationWrapVectorSynonym::IsApplicable( - opt::IRContext* ir_context, - const TransformationContext& transformation_context) const { - // |fresh_id| must be fresh. - if (!fuzzerutil::IsFreshId(ir_context, message_.fresh_id())) { - return false; - } - - const opt::Instruction* instruction = - ir_context->get_def_use_mgr()->GetDef(message_.instruction_id()); - - // |instruction_id| must refer to an existing instruction. - if (instruction == nullptr) { - return false; - } - - if (!IsInstructionSupported(ir_context, *instruction)) { - return false; - } - - // It must be possible to make a synonym of the result id of the scalar - // operation - if (!fuzzerutil::CanMakeSynonymOf(ir_context, transformation_context, - *instruction)) { - return false; - } - - // |vector_operand1| and |vector_operand2| must exist. - auto vec1 = ir_context->get_def_use_mgr()->GetDef(message_.vector_operand1()); - auto vec2 = ir_context->get_def_use_mgr()->GetDef(message_.vector_operand2()); - - if (vec1 == nullptr || vec2 == nullptr) { - return false; - } - - // The 2 vectors must be the same valid vector type. - auto vec1_type_id = vec1->type_id(); - auto vec2_type_id = vec2->type_id(); - - if (vec1_type_id != vec2_type_id) { - return false; - } - - if (ir_context->get_def_use_mgr()->GetDef(vec1_type_id)->opcode() != - SpvOpTypeVector) { - return false; - } - - // |scalar_position| needs to be a non-negative integer less than the vector - // length. - // OpTypeVector instruction has the component count at index 2. - if (message_.scalar_position() >= ir_context->get_def_use_mgr() - ->GetDef(vec1_type_id) - ->GetSingleWordInOperand(1)) { - return false; - } - - if (!transformation_context.GetFactManager()->IsSynonymous( - MakeDataDescriptor(message_.vector_operand1(), - {message_.scalar_position()}), - MakeDataDescriptor(instruction->GetSingleWordInOperand(0), {}))) { - return false; - } - - if (!transformation_context.GetFactManager()->IsSynonymous( - MakeDataDescriptor(message_.vector_operand2(), - {message_.scalar_position()}), - MakeDataDescriptor(instruction->GetSingleWordInOperand(1), {}))) { - return false; - } - - return true; -} - -void TransformationWrapVectorSynonym::Apply( - opt::IRContext* ir_context, - TransformationContext* transformation_context) const { - // Create an instruction descriptor for the original instruction. - auto instruction = - ir_context->get_def_use_mgr()->GetDef(message_.instruction_id()); - auto destination_block = ir_context->get_instr_block(instruction); - - // Populate input operand list with two vectors for vector operation. - opt::Instruction::OperandList in_operands; - in_operands.push_back({SPV_OPERAND_TYPE_ID, {message_.vector_operand1()}}); - in_operands.push_back({SPV_OPERAND_TYPE_ID, {message_.vector_operand2()}}); - - // Make a new arithmetic instruction: %fresh_id = OpXX %type_id %result_id1 - // %result_id2. - auto vec_type_id = ir_context->get_def_use_mgr() - ->GetDef(message_.vector_operand1()) - ->type_id(); - auto new_instruction = MakeUnique( - ir_context, instruction->opcode(), vec_type_id, message_.fresh_id(), - std::move(in_operands)); - auto new_instruction_ptr = new_instruction.get(); - instruction->InsertBefore(std::move(new_instruction)); - ir_context->get_def_use_mgr()->AnalyzeInstDefUse(new_instruction_ptr); - ir_context->set_instr_block(new_instruction_ptr, destination_block); - - // Add |fresh_id| to id bound. - fuzzerutil::UpdateModuleIdBound(ir_context, message_.fresh_id()); - - // Add synonyms between |fresh_id| and |instruction_id|. - transformation_context->GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(message_.fresh_id(), {message_.scalar_position()}), - MakeDataDescriptor(message_.instruction_id(), {})); -} - -protobufs::Transformation TransformationWrapVectorSynonym::ToMessage() const { - protobufs::Transformation result; - *result.mutable_wrap_vector_synonym() = message_; - return result; -} - -std::unordered_set TransformationWrapVectorSynonym::GetFreshIds() - const { - return std::unordered_set{message_.fresh_id()}; -} - -bool TransformationWrapVectorSynonym::IsInstructionSupported( - opt::IRContext* ir_context, const opt::Instruction& instruction) { - if (!instruction.result_id() || !instruction.type_id()) { - return false; - } - auto type_instruction = - ir_context->get_def_use_mgr()->GetDef(instruction.type_id()); - - if ((type_instruction->opcode() != SpvOpTypeInt && - type_instruction->opcode() != SpvOpTypeFloat)) { - return false; - } - - switch (instruction.opcode()) { - case SpvOpIAdd: - case SpvOpISub: - case SpvOpIMul: - case SpvOpFAdd: - case SpvOpFSub: - case SpvOpFMul: - return true; - default: - return false; - } -} - -} // namespace fuzz -} // namespace spvtools diff --git a/source/fuzz/transformation_wrap_vector_synonym.h b/source/fuzz/transformation_wrap_vector_synonym.h deleted file mode 100644 index 008211a2..00000000 --- a/source/fuzz/transformation_wrap_vector_synonym.h +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) 2021 Shiyu Liu -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SOURCE_FUZZ_TRANSFORMATION_WRAP_VECTOR_SYNONYM_H_ -#define SOURCE_FUZZ_TRANSFORMATION_WRAP_VECTOR_SYNONYM_H_ - -#include "source/fuzz/protobufs/spirvfuzz_protobufs.h" -#include "source/fuzz/transformation.h" -#include "source/fuzz/transformation_context.h" -#include "source/opt/ir_context.h" - -namespace spvtools { -namespace fuzz { - -class TransformationWrapVectorSynonym : public Transformation { - public: - explicit TransformationWrapVectorSynonym( - protobufs::TransformationWrapVectorSynonym message); - - TransformationWrapVectorSynonym(uint32_t instruction_id, - uint32_t vector_operand1, - uint32_t vector_operand2, uint32_t fresh_id, - uint32_t pos); - // - |instruction_id| must be the id of a supported arithmetic operation - // and must be relevant. - // - |vector_operand1| and |vector_operand2| represents the result ids of the - // two vector operands. - // - |fresh_id| is an unused id that will be used as a result id of the - // created instruction. - // - |vector_operand1| and |vector_operand2| must have the same vector type - // that is supported by this transformation. - // - |pos| is an index of the operands of |instruction_id| in the - // |vector_operand1| and |vector_operand2|. It must be less than the size - // of those vector operands. - bool IsApplicable( - opt::IRContext* ir_context, - const TransformationContext& transformation_context) const override; - - // Adds a new instruction before the |instruction_id| with |fresh_id| - // result id and |instruction_id|'s opcode. The added instruction has - // two operands: |vector_operand1| and |vector_operand2| and its type - // id is equal to the type ids of those operands. A new fact is added - // to the fact manager specifying that |fresh_id[pos]| is synonymous - // to |instruction_id|. - void Apply(opt::IRContext* ir_context, - TransformationContext* transformation_context) const override; - - std::unordered_set GetFreshIds() const override; - protobufs::Transformation ToMessage() const override; - - // Checks whether the instruction given is supported by the transformation. - // A valid instruction must: - // - has both result id and type id. - // - is a supported scalar operation instruction. - // - has a supported type that is either int or float. - static bool IsInstructionSupported(opt::IRContext* ir_context, - const opt::Instruction& instruction); - - private: - protobufs::TransformationWrapVectorSynonym message_; -}; - -} // namespace fuzz -} // namespace spvtools - -#endif // SOURCE_FUZZ_TRANSFORMATION_WRAP_VECTOR_SYNONYM_H_ diff --git a/source/operand.cpp b/source/operand.cpp index bff36a26..5a69fb24 100644 --- a/source/operand.cpp +++ b/source/operand.cpp @@ -229,9 +229,6 @@ const char* spvOperandTypeStr(spv_operand_type_t type) { return "ray query committed intersection type"; case SPV_OPERAND_TYPE_RAY_QUERY_CANDIDATE_INTERSECTION_TYPE: return "ray query candidate intersection type"; - case SPV_OPERAND_TYPE_PACKED_VECTOR_FORMAT: - case SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT: - return "packed vector format"; case SPV_OPERAND_TYPE_IMAGE: case SPV_OPERAND_TYPE_OPTIONAL_IMAGE: return "image"; @@ -272,10 +269,6 @@ const char* spvOperandTypeStr(spv_operand_type_t type) { return "FP denorm mode"; case SPV_OPERAND_TYPE_FPOPERATION_MODE: return "FP operation mode"; - case SPV_OPERAND_TYPE_QUANTIZATION_MODES: - return "quantization mode"; - case SPV_OPERAND_TYPE_OVERFLOW_MODES: - return "overflow mode"; case SPV_OPERAND_TYPE_NONE: return "NONE"; @@ -362,9 +355,6 @@ bool spvOperandIsConcrete(spv_operand_type_t type) { case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_IMPORTED_ENTITY: case SPV_OPERAND_TYPE_FPDENORM_MODE: case SPV_OPERAND_TYPE_FPOPERATION_MODE: - case SPV_OPERAND_TYPE_QUANTIZATION_MODES: - case SPV_OPERAND_TYPE_OVERFLOW_MODES: - case SPV_OPERAND_TYPE_PACKED_VECTOR_FORMAT: return true; default: break; @@ -400,7 +390,6 @@ bool spvOperandIsOptional(spv_operand_type_t type) { case SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER: case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_STRING: case SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER: - case SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT: case SPV_OPERAND_TYPE_OPTIONAL_CIV: return true; default: @@ -578,12 +567,6 @@ std::function spvOperandCanBeForwardDeclaredFunction( std::function spvDbgInfoExtOperandCanBeForwardDeclaredFunction( spv_ext_inst_type_t ext_type, uint32_t key) { - // The Vulkan debug info extended instruction set is non-semantic so allows no - // forward references ever. - if (ext_type == SPV_EXT_INST_TYPE_NONSEMANTIC_VULKAN_DEBUGINFO_100) { - return [](unsigned) { return false; }; - } - // TODO(https://gitlab.khronos.org/spirv/SPIR-V/issues/532): Forward // references for debug info instructions are still in discussion. We must // update the following lines of code when we conclude the spec. diff --git a/source/opt/BUILD.gn b/source/opt/BUILD.gn index 0fca131a..f6c6663b 100644 --- a/source/opt/BUILD.gn +++ b/source/opt/BUILD.gn @@ -43,7 +43,7 @@ ohos_source_set("deqp_spirvtool_opt_source") { "//third_party/spirv-tools/source/opt/const_folding_rules.cpp", "//third_party/spirv-tools/source/opt/constants.cpp", "//third_party/spirv-tools/source/opt/control_dependence.cpp", - "//third_party/spirv-tools/source/opt/convert_to_sampled_image_pass.cpp", + #"//third_party/spirv-tools/source/opt/convert_to_sampled_image_pass.cpp", "//third_party/spirv-tools/source/opt/convert_to_half_pass.cpp", "//third_party/spirv-tools/source/opt/copy_prop_arrays.cpp", "//third_party/spirv-tools/source/opt/dataflow.cpp", @@ -110,7 +110,7 @@ ohos_source_set("deqp_spirvtool_opt_source") { "//third_party/spirv-tools/source/opt/register_pressure.cpp", "//third_party/spirv-tools/source/opt/relax_float_ops_pass.cpp", "//third_party/spirv-tools/source/opt/remove_duplicates_pass.cpp", - "//third_party/spirv-tools/source/opt/remove_unused_interface_variables_pass.cpp", + #"//third_party/spirv-tools/source/opt/remove_unused_interface_variables_pass.cpp", "//third_party/spirv-tools/source/opt/replace_invalid_opc.cpp", "//third_party/spirv-tools/source/opt/scalar_analysis.cpp", "//third_party/spirv-tools/source/opt/scalar_analysis_simplification.cpp", @@ -148,4 +148,4 @@ ohos_static_library("libdeqp_spirvtools-opt") { "//third_party/spirv-tools:libdeqp_spirvtools", ] part_name = "graphic_standard" subsystem_name = "graphic" -} \ No newline at end of file +} diff --git a/source/opt/CMakeLists.txt b/source/opt/CMakeLists.txt index 63af5c1d..88d56589 100644 --- a/source/opt/CMakeLists.txt +++ b/source/opt/CMakeLists.txt @@ -27,11 +27,8 @@ set(SPIRV_TOOLS_OPT_SOURCES composite.h const_folding_rules.h constants.h - control_dependence.h - convert_to_sampled_image_pass.h convert_to_half_pass.h copy_prop_arrays.h - dataflow.h dead_branch_elim_pass.h dead_insert_elim_pass.h dead_variable_elimination.h @@ -99,7 +96,6 @@ set(SPIRV_TOOLS_OPT_SOURCES register_pressure.h relax_float_ops_pass.h remove_duplicates_pass.h - remove_unused_interface_variables_pass.h replace_invalid_opc.h scalar_analysis.h scalar_analysis_nodes.h @@ -136,11 +132,8 @@ set(SPIRV_TOOLS_OPT_SOURCES composite.cpp const_folding_rules.cpp constants.cpp - control_dependence.cpp - convert_to_sampled_image_pass.cpp convert_to_half_pass.cpp copy_prop_arrays.cpp - dataflow.cpp dead_branch_elim_pass.cpp dead_insert_elim_pass.cpp dead_variable_elimination.cpp @@ -204,7 +197,6 @@ set(SPIRV_TOOLS_OPT_SOURCES register_pressure.cpp relax_float_ops_pass.cpp remove_duplicates_pass.cpp - remove_unused_interface_variables_pass.cpp replace_invalid_opc.cpp scalar_analysis.cpp scalar_analysis_simplification.cpp diff --git a/source/opt/aggressive_dead_code_elim_pass.cpp b/source/opt/aggressive_dead_code_elim_pass.cpp index 90d30e9a..81b2232f 100644 --- a/source/opt/aggressive_dead_code_elim_pass.cpp +++ b/source/opt/aggressive_dead_code_elim_pass.cpp @@ -474,13 +474,14 @@ bool AggressiveDCEPass::AggressiveDCE(Function* func) { ProcessLoad(func, varId); } // If DebugDeclare, process as load of variable - } else if (liveInst->GetCommonDebugOpcode() == - CommonDebugInfoDebugDeclare) { + } else if (liveInst->GetOpenCL100DebugOpcode() == + OpenCLDebugInfo100DebugDeclare) { uint32_t varId = liveInst->GetSingleWordOperand(kDebugDeclareOperandVariableIndex); ProcessLoad(func, varId); // If DebugValue with Deref, process as load of variable - } else if (liveInst->GetCommonDebugOpcode() == CommonDebugInfoDebugValue) { + } else if (liveInst->GetOpenCL100DebugOpcode() == + OpenCLDebugInfo100DebugValue) { uint32_t varId = context() ->get_debug_info_mgr() ->GetVariableIdOfDebugValueUsedForDeclare(liveInst); @@ -651,7 +652,7 @@ void AggressiveDCEPass::InitializeModuleScopeLiveInstructions() { // For each DebugInfo GlobalVariable keep all operands except the Variable. // Later, if the variable is dead, we will set the operand to DebugInfoNone. for (auto& dbg : get_module()->ext_inst_debuginfo()) { - if (dbg.GetCommonDebugOpcode() != CommonDebugInfoDebugGlobalVariable) + if (dbg.GetOpenCL100DebugOpcode() != OpenCLDebugInfo100DebugGlobalVariable) continue; dbg.ForEachInId([this](const uint32_t* iid) { Instruction* inInst = get_def_use_mgr()->GetDef(*iid); @@ -876,7 +877,8 @@ bool AggressiveDCEPass::ProcessGlobalValues() { if (!IsDead(&dbg)) continue; // Save GlobalVariable if its variable is live, otherwise null out variable // index - if (dbg.GetCommonDebugOpcode() == CommonDebugInfoDebugGlobalVariable) { + if (dbg.GetOpenCL100DebugOpcode() == + OpenCLDebugInfo100DebugGlobalVariable) { auto var_id = dbg.GetSingleWordOperand(kGlobalVariableVariableIndex); Instruction* var_inst = get_def_use_mgr()->GetDef(var_id); if (!IsDead(var_inst)) continue; @@ -994,10 +996,6 @@ void AggressiveDCEPass::InitExtensions() { "SPV_EXT_physical_storage_buffer", "SPV_KHR_terminate_invocation", "SPV_KHR_shader_clock", - "SPV_KHR_vulkan_memory_model", - "SPV_KHR_subgroup_uniform_control_flow", - "SPV_KHR_integer_dot_product", - "SPV_EXT_shader_image_int64", }); } diff --git a/source/opt/block_merge_pass.cpp b/source/opt/block_merge_pass.cpp index 04e47f1c..c7315baf 100644 --- a/source/opt/block_merge_pass.cpp +++ b/source/opt/block_merge_pass.cpp @@ -28,9 +28,7 @@ namespace opt { bool BlockMergePass::MergeBlocks(Function* func) { bool modified = false; for (auto bi = func->begin(); bi != func->end();) { - // Don't bother trying to merge unreachable blocks. - if (context()->IsReachable(*bi) && - blockmergeutil::CanMergeWithSuccessor(context(), &*bi)) { + if (blockmergeutil::CanMergeWithSuccessor(context(), &*bi)) { blockmergeutil::MergeWithSuccessor(context(), func, bi); // Reprocess block. modified = true; diff --git a/source/opt/block_merge_util.cpp b/source/opt/block_merge_util.cpp index 15e8c6ff..14b5d364 100644 --- a/source/opt/block_merge_util.cpp +++ b/source/opt/block_merge_util.cpp @@ -103,6 +103,11 @@ bool CanMergeWithSuccessor(IRContext* context, BasicBlock* block) { return false; } + // Don't bother trying to merge unreachable blocks. + if (auto dominators = context->GetDominatorAnalysis(block->GetParent())) { + if (!dominators->IsReachable(block)) return false; + } + Instruction* merge_inst = block->GetMergeInst(); const bool pred_is_header = IsHeader(block); if (pred_is_header && lab_id != merge_inst->GetSingleWordInOperand(0u)) { diff --git a/source/opt/const_folding_rules.cpp b/source/opt/const_folding_rules.cpp index 515a3ed5..d262a7ec 100644 --- a/source/opt/const_folding_rules.cpp +++ b/source/opt/const_folding_rules.cpp @@ -1002,7 +1002,7 @@ const analysis::Constant* FoldClamp1( "Expecting a GLSLstd450 extended instruction."); // Make sure all Clamp operands are constants. - for (uint32_t i = 1; i < 4; i++) { + for (uint32_t i = 1; i < 3; i++) { if (constants[i] == nullptr) { return nullptr; } @@ -1017,7 +1017,7 @@ const analysis::Constant* FoldClamp1( context); } -// Fold a clamp instruction when |x <= min_val|. +// Fold a clamp instruction when |x >= min_val|. const analysis::Constant* FoldClamp2( IRContext* context, Instruction* inst, const std::vector& constants) { diff --git a/source/opt/constants.cpp b/source/opt/constants.cpp index a3dac5d7..cf24295d 100644 --- a/source/opt/constants.cpp +++ b/source/opt/constants.cpp @@ -389,36 +389,6 @@ const Constant* ConstantManager::GetConstant( return cst ? RegisterConstant(std::move(cst)) : nullptr; } -const Constant* ConstantManager::GetNumericVectorConstantWithWords( - const Vector* type, const std::vector& literal_words) { - const auto* element_type = type->element_type(); - uint32_t words_per_element = 0; - if (const auto* float_type = element_type->AsFloat()) - words_per_element = float_type->width() / 32; - else if (const auto* int_type = element_type->AsInteger()) - words_per_element = int_type->width() / 32; - - if (words_per_element != 1 && words_per_element != 2) return nullptr; - - if (words_per_element * type->element_count() != - static_cast(literal_words.size())) { - return nullptr; - } - - std::vector element_ids; - for (uint32_t i = 0; i < type->element_count(); ++i) { - auto first_word = literal_words.begin() + (words_per_element * i); - std::vector const_data(first_word, - first_word + words_per_element); - const analysis::Constant* element_constant = - GetConstant(element_type, const_data); - auto element_id = GetDefiningInstruction(element_constant)->result_id(); - element_ids.push_back(element_id); - } - - return GetConstant(type, element_ids); -} - uint32_t ConstantManager::GetFloatConst(float val) { Type* float_type = context()->get_type_mgr()->GetFloatType(); utils::FloatProxy v(val); @@ -432,12 +402,6 @@ uint32_t ConstantManager::GetSIntConst(int32_t val) { return GetDefiningInstruction(c)->result_id(); } -uint32_t ConstantManager::GetUIntConst(uint32_t val) { - Type* uint_type = context()->get_type_mgr()->GetUIntType(); - const Constant* c = GetConstant(uint_type, {val}); - return GetDefiningInstruction(c)->result_id(); -} - std::vector Constant::GetVectorComponents( analysis::ConstantManager* const_mgr) const { std::vector components; diff --git a/source/opt/constants.h b/source/opt/constants.h index 52bd809a..5bd0ae32 100644 --- a/source/opt/constants.h +++ b/source/opt/constants.h @@ -506,11 +506,10 @@ class ConstantManager { IRContext* context() const { return ctx_; } // Gets or creates a unique Constant instance of type |type| and a vector of - // constant defining words or ids for elements of Vector type - // |literal_words_or_ids|. If a Constant instance existed already in the - // constant pool, it returns a pointer to it. Otherwise, it creates one using - // CreateConstant. If a new Constant instance cannot be created, it returns - // nullptr. + // constant defining words |words|. If a Constant instance existed already in + // the constant pool, it returns a pointer to it. Otherwise, it creates one + // using CreateConstant. If a new Constant instance cannot be created, it + // returns nullptr. const Constant* GetConstant( const Type* type, const std::vector& literal_words_or_ids); @@ -520,14 +519,6 @@ class ConstantManager { literal_words_or_ids.end())); } - // Gets or creates a unique Constant instance of Vector type |type| with - // numeric elements and a vector of constant defining words |literal_words|. - // If a Constant instance existed already in the constant pool, it returns a - // pointer to it. Otherwise, it creates one using CreateConstant. If a new - // Constant instance cannot be created, it returns nullptr. - const Constant* GetNumericVectorConstantWithWords( - const Vector* type, const std::vector& literal_words); - // Gets or creates a Constant instance to hold the constant value of the given // instruction. It returns a pointer to a Constant instance or nullptr if it // could not create the constant. @@ -642,9 +633,6 @@ class ConstantManager { // Returns the id of a 32-bit signed integer constant with value |val|. uint32_t GetSIntConst(int32_t val); - // Returns the id of a 32-bit unsigned integer constant with value |val|. - uint32_t GetUIntConst(uint32_t val); - private: // Creates a Constant instance with the given type and a vector of constant // defining words. Returns a unique pointer to the created Constant instance diff --git a/source/opt/convert_to_sampled_image_pass.cpp b/source/opt/convert_to_sampled_image_pass.cpp deleted file mode 100644 index e84d3578..00000000 --- a/source/opt/convert_to_sampled_image_pass.cpp +++ /dev/null @@ -1,437 +0,0 @@ -// Copyright (c) 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/opt/convert_to_sampled_image_pass.h" - -#include -#include -#include - -#include "source/opt/ir_builder.h" -#include "source/util/make_unique.h" -#include "source/util/parse_number.h" - -namespace spvtools { -namespace opt { - -using VectorOfDescriptorSetAndBindingPairs = - std::vector; -using DescriptorSetBindingToInstruction = - ConvertToSampledImagePass::DescriptorSetBindingToInstruction; - -namespace { - -using utils::ParseNumber; - -// Returns true if the given char is ':', '\0' or considered as blank space -// (i.e.: '\n', '\r', '\v', '\t', '\f' and ' '). -bool IsSeparator(char ch) { - return std::strchr(":\0", ch) || std::isspace(ch) != 0; -} - -// Reads characters starting from |str| until it meets a separator. Parses a -// number from the characters and stores it into |number|. Returns the pointer -// to the separator if it succeeds. Otherwise, returns nullptr. -const char* ParseNumberUntilSeparator(const char* str, uint32_t* number) { - const char* number_begin = str; - while (!IsSeparator(*str)) str++; - const char* number_end = str; - std::string number_in_str(number_begin, number_end - number_begin); - if (!utils::ParseNumber(number_in_str.c_str(), number)) { - // The descriptor set is not a valid uint32 number. - return nullptr; - } - return str; -} - -// Returns id of the image type used for the sampled image type of -// |sampled_image|. -uint32_t GetImageTypeOfSampledImage(analysis::TypeManager* type_mgr, - Instruction* sampled_image) { - auto* sampled_image_type = - type_mgr->GetType(sampled_image->type_id())->AsSampledImage(); - return type_mgr->GetTypeInstruction(sampled_image_type->image_type()); -} - -// Finds the instruction whose id is |inst_id|. Follows the operand of -// OpCopyObject recursively if the opcode of the instruction is OpCopyObject -// and returns the first instruction that does not have OpCopyObject as opcode. -Instruction* GetNonCopyObjectDef(analysis::DefUseManager* def_use_mgr, - uint32_t inst_id) { - Instruction* inst = def_use_mgr->GetDef(inst_id); - while (inst->opcode() == SpvOpCopyObject) { - inst_id = inst->GetSingleWordInOperand(0u); - inst = def_use_mgr->GetDef(inst_id); - } - return inst; -} - -} // namespace - -bool ConvertToSampledImagePass::GetDescriptorSetBinding( - const Instruction& inst, - DescriptorSetAndBinding* descriptor_set_binding) const { - auto* decoration_manager = context()->get_decoration_mgr(); - bool found_descriptor_set_to_convert = false; - bool found_binding_to_convert = false; - for (auto decorate : - decoration_manager->GetDecorationsFor(inst.result_id(), false)) { - uint32_t decoration = decorate->GetSingleWordInOperand(1u); - if (decoration == SpvDecorationDescriptorSet) { - if (found_descriptor_set_to_convert) { - assert(false && "A resource has two OpDecorate for the descriptor set"); - return false; - } - descriptor_set_binding->descriptor_set = - decorate->GetSingleWordInOperand(2u); - found_descriptor_set_to_convert = true; - } else if (decoration == SpvDecorationBinding) { - if (found_binding_to_convert) { - assert(false && "A resource has two OpDecorate for the binding"); - return false; - } - descriptor_set_binding->binding = decorate->GetSingleWordInOperand(2u); - found_binding_to_convert = true; - } - } - return found_descriptor_set_to_convert && found_binding_to_convert; -} - -bool ConvertToSampledImagePass::ShouldResourceBeConverted( - const DescriptorSetAndBinding& descriptor_set_binding) const { - return descriptor_set_binding_pairs_.find(descriptor_set_binding) != - descriptor_set_binding_pairs_.end(); -} - -const analysis::Type* ConvertToSampledImagePass::GetVariableType( - const Instruction& variable) const { - if (variable.opcode() != SpvOpVariable) return nullptr; - auto* type = context()->get_type_mgr()->GetType(variable.type_id()); - auto* pointer_type = type->AsPointer(); - if (!pointer_type) return nullptr; - - return pointer_type->pointee_type(); -} - -SpvStorageClass ConvertToSampledImagePass::GetStorageClass( - const Instruction& variable) const { - assert(variable.opcode() == SpvOpVariable); - auto* type = context()->get_type_mgr()->GetType(variable.type_id()); - auto* pointer_type = type->AsPointer(); - if (!pointer_type) return SpvStorageClassMax; - - return pointer_type->storage_class(); -} - -bool ConvertToSampledImagePass::CollectResourcesToConvert( - DescriptorSetBindingToInstruction* descriptor_set_binding_pair_to_sampler, - DescriptorSetBindingToInstruction* descriptor_set_binding_pair_to_image) - const { - for (auto& inst : context()->types_values()) { - const auto* variable_type = GetVariableType(inst); - if (variable_type == nullptr) continue; - - DescriptorSetAndBinding descriptor_set_binding; - if (!GetDescriptorSetBinding(inst, &descriptor_set_binding)) continue; - - if (!ShouldResourceBeConverted(descriptor_set_binding)) { - continue; - } - - if (variable_type->AsImage()) { - if (!descriptor_set_binding_pair_to_image - ->insert({descriptor_set_binding, &inst}) - .second) { - return false; - } - } else if (variable_type->AsSampler()) { - if (!descriptor_set_binding_pair_to_sampler - ->insert({descriptor_set_binding, &inst}) - .second) { - return false; - } - } - } - return true; -} - -Pass::Status ConvertToSampledImagePass::Process() { - Status status = Status::SuccessWithoutChange; - - DescriptorSetBindingToInstruction descriptor_set_binding_pair_to_sampler, - descriptor_set_binding_pair_to_image; - if (!CollectResourcesToConvert(&descriptor_set_binding_pair_to_sampler, - &descriptor_set_binding_pair_to_image)) { - return Status::Failure; - } - - for (auto& image : descriptor_set_binding_pair_to_image) { - status = CombineStatus( - status, UpdateImageVariableToSampledImage(image.second, image.first)); - if (status == Status::Failure) { - return status; - } - } - - for (const auto& sampler : descriptor_set_binding_pair_to_sampler) { - // Converting only a Sampler to Sampled Image is not allowed. It must have a - // corresponding image to combine the sampler with. - auto image_itr = descriptor_set_binding_pair_to_image.find(sampler.first); - if (image_itr == descriptor_set_binding_pair_to_image.end() || - image_itr->second == nullptr) { - return Status::Failure; - } - - status = CombineStatus( - status, CheckUsesOfSamplerVariable(sampler.second, image_itr->second)); - if (status == Status::Failure) { - return status; - } - } - - return status; -} - -void ConvertToSampledImagePass::FindUses(const Instruction* inst, - std::vector* uses, - uint32_t user_opcode) const { - auto* def_use_mgr = context()->get_def_use_mgr(); - def_use_mgr->ForEachUser(inst, [uses, user_opcode, this](Instruction* user) { - if (user->opcode() == user_opcode) { - uses->push_back(user); - } else if (user->opcode() == SpvOpCopyObject) { - FindUses(user, uses, user_opcode); - } - }); -} - -void ConvertToSampledImagePass::FindUsesOfImage( - const Instruction* image, std::vector* uses) const { - auto* def_use_mgr = context()->get_def_use_mgr(); - def_use_mgr->ForEachUser(image, [uses, this](Instruction* user) { - switch (user->opcode()) { - case SpvOpImageFetch: - case SpvOpImageRead: - case SpvOpImageWrite: - case SpvOpImageQueryFormat: - case SpvOpImageQueryOrder: - case SpvOpImageQuerySizeLod: - case SpvOpImageQuerySize: - case SpvOpImageQueryLevels: - case SpvOpImageQuerySamples: - case SpvOpImageSparseFetch: - uses->push_back(user); - default: - break; - } - if (user->opcode() == SpvOpCopyObject) { - FindUsesOfImage(user, uses); - } - }); -} - -Instruction* ConvertToSampledImagePass::CreateImageExtraction( - Instruction* sampled_image) { - InstructionBuilder builder( - context(), sampled_image->NextNode(), - IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping); - return builder.AddUnaryOp( - GetImageTypeOfSampledImage(context()->get_type_mgr(), sampled_image), - SpvOpImage, sampled_image->result_id()); -} - -uint32_t ConvertToSampledImagePass::GetSampledImageTypeForImage( - Instruction* image_variable) { - const auto* variable_type = GetVariableType(*image_variable); - if (variable_type == nullptr) return 0; - const auto* image_type = variable_type->AsImage(); - if (image_type == nullptr) return 0; - - analysis::Image image_type_for_sampled_image(*image_type); - analysis::SampledImage sampled_image_type(&image_type_for_sampled_image); - return context()->get_type_mgr()->GetTypeInstruction(&sampled_image_type); -} - -Instruction* ConvertToSampledImagePass::UpdateImageUses( - Instruction* sampled_image_load) { - std::vector uses_of_load; - FindUsesOfImage(sampled_image_load, &uses_of_load); - if (uses_of_load.empty()) return nullptr; - - auto* extracted_image = CreateImageExtraction(sampled_image_load); - for (auto* user : uses_of_load) { - user->SetInOperand(0, {extracted_image->result_id()}); - context()->get_def_use_mgr()->AnalyzeInstUse(user); - } - return extracted_image; -} - -bool ConvertToSampledImagePass:: - IsSamplerOfSampledImageDecoratedByDescriptorSetBinding( - Instruction* sampled_image_inst, - const DescriptorSetAndBinding& descriptor_set_binding) { - auto* def_use_mgr = context()->get_def_use_mgr(); - uint32_t sampler_id = sampled_image_inst->GetSingleWordInOperand(1u); - auto* sampler_load = def_use_mgr->GetDef(sampler_id); - if (sampler_load->opcode() != SpvOpLoad) return false; - auto* sampler = def_use_mgr->GetDef(sampler_load->GetSingleWordInOperand(0u)); - DescriptorSetAndBinding sampler_descriptor_set_binding; - return GetDescriptorSetBinding(*sampler, &sampler_descriptor_set_binding) && - sampler_descriptor_set_binding == descriptor_set_binding; -} - -void ConvertToSampledImagePass::UpdateSampledImageUses( - Instruction* image_load, Instruction* image_extraction, - const DescriptorSetAndBinding& image_descriptor_set_binding) { - std::vector sampled_image_users; - FindUses(image_load, &sampled_image_users, SpvOpSampledImage); - - auto* def_use_mgr = context()->get_def_use_mgr(); - for (auto* sampled_image_inst : sampled_image_users) { - if (IsSamplerOfSampledImageDecoratedByDescriptorSetBinding( - sampled_image_inst, image_descriptor_set_binding)) { - context()->ReplaceAllUsesWith(sampled_image_inst->result_id(), - image_load->result_id()); - def_use_mgr->AnalyzeInstUse(image_load); - context()->KillInst(sampled_image_inst); - } else { - if (!image_extraction) - image_extraction = CreateImageExtraction(image_load); - sampled_image_inst->SetInOperand(0, {image_extraction->result_id()}); - def_use_mgr->AnalyzeInstUse(sampled_image_inst); - } - } -} - -void ConvertToSampledImagePass::MoveInstructionNextToType(Instruction* inst, - uint32_t type_id) { - auto* type_inst = context()->get_def_use_mgr()->GetDef(type_id); - inst->SetResultType(type_id); - inst->RemoveFromList(); - inst->InsertAfter(type_inst); -} - -bool ConvertToSampledImagePass::ConvertImageVariableToSampledImage( - Instruction* image_variable, uint32_t sampled_image_type_id) { - auto* sampled_image_type = - context()->get_type_mgr()->GetType(sampled_image_type_id); - if (sampled_image_type == nullptr) return false; - auto storage_class = GetStorageClass(*image_variable); - if (storage_class == SpvStorageClassMax) return false; - analysis::Pointer sampled_image_pointer(sampled_image_type, storage_class); - - // Make sure |image_variable| is behind its type i.e., avoid the forward - // reference. - uint32_t type_id = - context()->get_type_mgr()->GetTypeInstruction(&sampled_image_pointer); - MoveInstructionNextToType(image_variable, type_id); - return true; -} - -Pass::Status ConvertToSampledImagePass::UpdateImageVariableToSampledImage( - Instruction* image_variable, - const DescriptorSetAndBinding& descriptor_set_binding) { - std::vector image_variable_loads; - FindUses(image_variable, &image_variable_loads, SpvOpLoad); - if (image_variable_loads.empty()) return Status::SuccessWithoutChange; - - const uint32_t sampled_image_type_id = - GetSampledImageTypeForImage(image_variable); - if (!sampled_image_type_id) return Status::Failure; - - for (auto* load : image_variable_loads) { - load->SetResultType(sampled_image_type_id); - auto* image_extraction = UpdateImageUses(load); - UpdateSampledImageUses(load, image_extraction, descriptor_set_binding); - } - - return ConvertImageVariableToSampledImage(image_variable, - sampled_image_type_id) - ? Status::SuccessWithChange - : Status::Failure; -} - -bool ConvertToSampledImagePass::DoesSampledImageReferenceImage( - Instruction* sampled_image_inst, Instruction* image_variable) { - if (sampled_image_inst->opcode() != SpvOpSampledImage) return false; - auto* def_use_mgr = context()->get_def_use_mgr(); - auto* image_load = GetNonCopyObjectDef( - def_use_mgr, sampled_image_inst->GetSingleWordInOperand(0u)); - if (image_load->opcode() != SpvOpLoad) return false; - auto* image = - GetNonCopyObjectDef(def_use_mgr, image_load->GetSingleWordInOperand(0u)); - return image->opcode() == SpvOpVariable && - image->result_id() == image_variable->result_id(); -} - -Pass::Status ConvertToSampledImagePass::CheckUsesOfSamplerVariable( - const Instruction* sampler_variable, - Instruction* image_to_be_combined_with) { - if (image_to_be_combined_with == nullptr) return Status::Failure; - - std::vector sampler_variable_loads; - FindUses(sampler_variable, &sampler_variable_loads, SpvOpLoad); - for (auto* load : sampler_variable_loads) { - std::vector sampled_image_users; - FindUses(load, &sampled_image_users, SpvOpSampledImage); - for (auto* sampled_image_inst : sampled_image_users) { - if (!DoesSampledImageReferenceImage(sampled_image_inst, - image_to_be_combined_with)) { - return Status::Failure; - } - } - } - return Status::SuccessWithoutChange; -} - -std::unique_ptr -ConvertToSampledImagePass::ParseDescriptorSetBindingPairsString( - const char* str) { - if (!str) return nullptr; - - auto descriptor_set_binding_pairs = - MakeUnique(); - - while (std::isspace(*str)) str++; // skip leading spaces. - - // The parsing loop, break when points to the end. - while (*str) { - // Parse the descriptor set. - uint32_t descriptor_set = 0; - str = ParseNumberUntilSeparator(str, &descriptor_set); - if (str == nullptr) return nullptr; - - // Find the ':', spaces between the descriptor set and the ':' are not - // allowed. - if (*str++ != ':') { - // ':' not found - return nullptr; - } - - // Parse the binding. - uint32_t binding = 0; - str = ParseNumberUntilSeparator(str, &binding); - if (str == nullptr) return nullptr; - - descriptor_set_binding_pairs->push_back({descriptor_set, binding}); - - // Skip trailing spaces. - while (std::isspace(*str)) str++; - } - - return descriptor_set_binding_pairs; -} - -} // namespace opt -} // namespace spvtools diff --git a/source/opt/convert_to_sampled_image_pass.h b/source/opt/convert_to_sampled_image_pass.h deleted file mode 100644 index d3938af7..00000000 --- a/source/opt/convert_to_sampled_image_pass.h +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright (c) 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SOURCE_OPT_CONVERT_TO_SAMPLED_IMAGE_PASS_H_ -#define SOURCE_OPT_CONVERT_TO_SAMPLED_IMAGE_PASS_H_ - -#include -#include -#include - -#include "source/opt/pass.h" -#include "source/opt/types.h" - -namespace spvtools { -namespace opt { - -// A struct for a pair of descriptor set and binding. -struct DescriptorSetAndBinding { - uint32_t descriptor_set; - uint32_t binding; - - bool operator==(const DescriptorSetAndBinding& descriptor_set_binding) const { - return descriptor_set_binding.descriptor_set == descriptor_set && - descriptor_set_binding.binding == binding; - } -}; - -// See optimizer.hpp for documentation. -class ConvertToSampledImagePass : public Pass { - public: - // Hashing functor for the pair of descriptor set and binding. - struct DescriptorSetAndBindingHash { - size_t operator()( - const DescriptorSetAndBinding& descriptor_set_binding) const { - return std::hash()(descriptor_set_binding.descriptor_set) ^ - std::hash()(descriptor_set_binding.binding); - } - }; - - using SetOfDescriptorSetAndBindingPairs = - std::unordered_set; - using DescriptorSetBindingToInstruction = - std::unordered_map; - - explicit ConvertToSampledImagePass( - const std::vector& descriptor_set_binding_pairs) - : descriptor_set_binding_pairs_(descriptor_set_binding_pairs.begin(), - descriptor_set_binding_pairs.end()) {} - - const char* name() const override { return "convert-to-sampled-image"; } - Status Process() override; - - // Parses the given null-terminated C string to get a vector of descriptor set - // and binding pairs. Returns a unique pointer to the vector of descriptor set - // and binding pairs built from the given |str| on success. Returns a nullptr - // if the given string is not valid for building the vector of pairs. - // A valid string for building the vector of pairs should follow the rule - // below: - // - // ": : ..." - // Example: - // "3:5 2:1 0:4" - // - // Entries are separated with blank spaces (i.e.:' ', '\n', '\r', '\t', - // '\f', '\v'). Each entry corresponds to a descriptor set and binding pair. - // Multiple spaces between, before or after entries are allowed. However, - // spaces are not allowed within a descriptor set or binding. - // - // In each entry, the descriptor set and binding are separated by ':'. - // Missing ':' in any entry is invalid. And it is invalid to have blank - // spaces in between the descriptor set and ':' or ':' and the binding. - // - // : the descriptor set. - // The text must represent a valid uint32_t number. - // - // : the binding. - // The text must represent a valid uint32_t number. - static std::unique_ptr> - ParseDescriptorSetBindingPairsString(const char* str); - - private: - // Collects resources to convert to sampled image and saves them in - // |descriptor_set_binding_pair_to_sampler| if the resource is a sampler and - // saves them in |descriptor_set_binding_pair_to_image| if the resource is an - // image. Returns false if two samplers or two images have the same descriptor - // set and binding. Otherwise, returns true. - bool CollectResourcesToConvert( - DescriptorSetBindingToInstruction* descriptor_set_binding_pair_to_sampler, - DescriptorSetBindingToInstruction* descriptor_set_binding_pair_to_image) - const; - - // Finds an OpDecorate with DescriptorSet decorating |inst| and another - // OpDecorate with Binding decorating |inst|. Stores the descriptor set and - // binding in |descriptor_set_binding|. Returns whether it successfully finds - // the descriptor set and binding or not. - bool GetDescriptorSetBinding( - const Instruction& inst, - DescriptorSetAndBinding* descriptor_set_binding) const; - - // Returns whether |descriptor_set_binding| is a pair of a descriptor set - // and a binding that we have to convert resources with it to a sampled image - // or not. - bool ShouldResourceBeConverted( - const DescriptorSetAndBinding& descriptor_set_binding) const; - - // Returns the pointee type of the type of variable |variable|. If |variable| - // is not an OpVariable instruction, just returns nullptr. - const analysis::Type* GetVariableType(const Instruction& variable) const; - - // Returns the storage class of |variable|. - SpvStorageClass GetStorageClass(const Instruction& variable) const; - - // Finds |inst|'s users whose opcode is |user_opcode| or users of OpCopyObject - // instructions of |inst| whose opcode is |user_opcode| and puts them in - // |uses|. - void FindUses(const Instruction* inst, std::vector* uses, - uint32_t user_opcode) const; - - // Finds OpImage* instructions using |image| or OpCopyObject instructions that - // copy |image| and puts them in |uses|. - void FindUsesOfImage(const Instruction* image, - std::vector* uses) const; - - // Creates an OpImage instruction that extracts the image from the sampled - // image |sampled_image|. - Instruction* CreateImageExtraction(Instruction* sampled_image); - - // Converts |image_variable| whose type is an image pointer to sampled image - // type. Updates users of |image_variable| accordingly. If some instructions - // e.g., OpImageRead use |image_variable| as an Image operand, creates an - // image extracted from the sampled image using OpImage and replace the Image - // operands of the users with the extracted image. If some OpSampledImage - // instructions use |image_variable| and sampler whose descriptor set and - // binding are the same with |image_variable|, just combines |image_variable| - // and the sampler to a sampled image. - Pass::Status UpdateImageVariableToSampledImage( - Instruction* image_variable, - const DescriptorSetAndBinding& descriptor_set_binding); - - // Returns the id of type sampled image type whose image type is the one of - // |image_variable|. - uint32_t GetSampledImageTypeForImage(Instruction* image_variable); - - // Moves |inst| next to the OpType* instruction with |type_id|. - void MoveInstructionNextToType(Instruction* inst, uint32_t type_id); - - // Converts |image_variable| whose type is an image pointer to sampled image - // with the type id |sampled_image_type_id|. Returns whether it successfully - // converts the type of |image_variable| or not. - bool ConvertImageVariableToSampledImage(Instruction* image_variable, - uint32_t sampled_image_type_id); - - // Replaces |sampled_image_load| instruction used by OpImage* with the image - // extracted from |sampled_image_load|. Returns the extracted image or nullptr - // if it does not have uses. - Instruction* UpdateImageUses(Instruction* sampled_image_load); - - // Returns true if the sampler of |sampled_image_inst| is decorated by a - // descriptor set and a binding |descriptor_set_binding|. - bool IsSamplerOfSampledImageDecoratedByDescriptorSetBinding( - Instruction* sampled_image_inst, - const DescriptorSetAndBinding& descriptor_set_binding); - - // Replaces OpSampledImage instructions using |image_load| with |image_load| - // if the sampler of the OpSampledImage instruction has descriptor set and - // binding |image_descriptor_set_binding|. Otherwise, replaces |image_load| - // with |image_extraction|. - void UpdateSampledImageUses( - Instruction* image_load, Instruction* image_extraction, - const DescriptorSetAndBinding& image_descriptor_set_binding); - - // Checks the uses of |sampler_variable|. When a sampler is used by - // OpSampledImage instruction, the corresponding image must be - // |image_to_be_combined_with| that should be already converted to a sampled - // image by UpdateImageVariableToSampledImage() method. - Pass::Status CheckUsesOfSamplerVariable( - const Instruction* sampler_variable, - Instruction* image_to_be_combined_with); - - // Returns true if Image operand of |sampled_image_inst| is the image of - // |image_variable|. - bool DoesSampledImageReferenceImage(Instruction* sampled_image_inst, - Instruction* image_variable); - - // A set of pairs of descriptor set and binding. If an image and/or a sampler - // have a pair of descriptor set and binding that is an element of - // |descriptor_set_binding_pairs_|, they/it will be converted to a sampled - // image by this pass. - const SetOfDescriptorSetAndBindingPairs descriptor_set_binding_pairs_; -}; - -} // namespace opt -} // namespace spvtools - -#endif // SOURCE_OPT_CONVERT_TO_SAMPLED_IMAGE_PASS_H_ diff --git a/source/opt/copy_prop_arrays.cpp b/source/opt/copy_prop_arrays.cpp index f505d8a5..67a97b6a 100644 --- a/source/opt/copy_prop_arrays.cpp +++ b/source/opt/copy_prop_arrays.cpp @@ -29,10 +29,10 @@ const uint32_t kCompositeExtractObjectInOperand = 0; const uint32_t kTypePointerStorageClassInIdx = 0; const uint32_t kTypePointerPointeeInIdx = 1; -bool IsDebugDeclareOrValue(Instruction* di) { - auto dbg_opcode = di->GetCommonDebugOpcode(); - return dbg_opcode == CommonDebugInfoDebugDeclare || - dbg_opcode == CommonDebugInfoDebugValue; +bool IsOpenCL100DebugDeclareOrValue(Instruction* di) { + auto dbg_opcode = di->GetOpenCL100DebugOpcode(); + return dbg_opcode == OpenCLDebugInfo100DebugDeclare || + dbg_opcode == OpenCLDebugInfo100DebugValue; } } // namespace @@ -194,7 +194,7 @@ bool CopyPropagateArrays::HasValidReferencesOnly(Instruction* ptr_inst, return ptr_inst->opcode() == SpvOpVariable && store_inst->GetSingleWordInOperand(kStorePointerInOperand) == ptr_inst->result_id(); - } else if (IsDebugDeclareOrValue(use)) { + } else if (IsOpenCL100DebugDeclareOrValue(use)) { return true; } // Some other instruction. Be conservative. @@ -500,7 +500,7 @@ bool CopyPropagateArrays::CanUpdateUses(Instruction* original_ptr_inst, const_mgr, type](Instruction* use, uint32_t) { - if (IsDebugDeclareOrValue(use)) return true; + if (IsOpenCL100DebugDeclareOrValue(use)) return true; switch (use->opcode()) { case SpvOpLoad: { @@ -592,9 +592,9 @@ void CopyPropagateArrays::UpdateUses(Instruction* original_ptr_inst, Instruction* use = pair.first; uint32_t index = pair.second; - if (use->IsCommonDebugInstr()) { - switch (use->GetCommonDebugOpcode()) { - case CommonDebugInfoDebugDeclare: { + if (use->IsOpenCL100DebugInstr()) { + switch (use->GetOpenCL100DebugOpcode()) { + case OpenCLDebugInfo100DebugDeclare: { if (new_ptr_inst->opcode() == SpvOpVariable || new_ptr_inst->opcode() == SpvOpFunctionParameter) { context()->ForgetUses(use); @@ -608,8 +608,9 @@ void CopyPropagateArrays::UpdateUses(Instruction* original_ptr_inst, context()->ForgetUses(use); // Change DebugDeclare to DebugValue. - use->SetOperand(index - 2, - {static_cast(CommonDebugInfoDebugValue)}); + use->SetOperand( + index - 2, + {static_cast(OpenCLDebugInfo100DebugValue)}); use->SetOperand(index, {new_ptr_inst->result_id()}); // Add Deref operation. @@ -624,7 +625,7 @@ void CopyPropagateArrays::UpdateUses(Instruction* original_ptr_inst, } break; } - case CommonDebugInfoDebugValue: + case OpenCLDebugInfo100DebugValue: context()->ForgetUses(use); use->SetOperand(index, {new_ptr_inst->result_id()}); context()->AnalyzeUses(use); diff --git a/source/opt/dead_insert_elim_pass.cpp b/source/opt/dead_insert_elim_pass.cpp index fb5c1634..46f4f124 100644 --- a/source/opt/dead_insert_elim_pass.cpp +++ b/source/opt/dead_insert_elim_pass.cpp @@ -196,7 +196,7 @@ bool DeadInsertElimPass::EliminateDeadInsertsOnePass(Function* func) { } const uint32_t id = ii->result_id(); get_def_use_mgr()->ForEachUser(id, [&ii, this](Instruction* user) { - if (user->IsCommonDebugInstr()) return; + if (user->IsOpenCL100DebugInstr()) return; switch (user->opcode()) { case SpvOpCompositeInsert: case SpvOpPhi: diff --git a/source/opt/debug_info_manager.cpp b/source/opt/debug_info_manager.cpp index 2e8e1327..e782641f 100644 --- a/source/opt/debug_info_manager.cpp +++ b/source/opt/debug_info_manager.cpp @@ -18,15 +18,12 @@ #include "source/opt/ir_context.h" -// Constants for OpenCL.DebugInfo.100 & NonSemantic.Vulkan.DebugInfo.100 -// extension instructions. +// Constants for OpenCL.DebugInfo.100 extension instructions. static const uint32_t kOpLineOperandLineIndex = 1; static const uint32_t kLineOperandIndexDebugFunction = 7; static const uint32_t kLineOperandIndexDebugLexicalBlock = 5; static const uint32_t kDebugFunctionOperandFunctionIndex = 13; -static const uint32_t kDebugFunctionDefinitionOperandDebugFunctionIndex = 4; -static const uint32_t kDebugFunctionDefinitionOperandOpFunctionIndex = 5; static const uint32_t kDebugFunctionOperandParentIndex = 9; static const uint32_t kDebugTypeCompositeOperandParentIndex = 9; static const uint32_t kDebugLexicalBlockOperandParentIndex = 7; @@ -49,8 +46,8 @@ namespace { void SetInlinedOperand(Instruction* dbg_inlined_at, uint32_t inlined_operand) { assert(dbg_inlined_at); - assert(dbg_inlined_at->GetCommonDebugOpcode() == - CommonDebugInfoDebugInlinedAt); + assert(dbg_inlined_at->GetOpenCL100DebugOpcode() == + OpenCLDebugInfo100DebugInlinedAt); if (dbg_inlined_at->NumOperands() <= kDebugInlinedAtOperandInlinedIndex) { dbg_inlined_at->AddOperand( {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {inlined_operand}}); @@ -62,8 +59,8 @@ void SetInlinedOperand(Instruction* dbg_inlined_at, uint32_t inlined_operand) { uint32_t GetInlinedOperand(Instruction* dbg_inlined_at) { assert(dbg_inlined_at); - assert(dbg_inlined_at->GetCommonDebugOpcode() == - CommonDebugInfoDebugInlinedAt); + assert(dbg_inlined_at->GetOpenCL100DebugOpcode() == + OpenCLDebugInfo100DebugInlinedAt); if (dbg_inlined_at->NumOperands() <= kDebugInlinedAtOperandInlinedIndex) return kNoInlinedAt; return dbg_inlined_at->GetSingleWordOperand( @@ -71,7 +68,8 @@ uint32_t GetInlinedOperand(Instruction* dbg_inlined_at) { } bool IsEmptyDebugExpression(Instruction* instr) { - return (instr->GetCommonDebugOpcode() == CommonDebugInfoDebugExpression) && + return instr->GetOpenCL100DebugOpcode() == + OpenCLDebugInfo100DebugExpression && instr->NumOperands() == kDebugExpressOperandOperationIndex; } @@ -81,63 +79,43 @@ DebugInfoManager::DebugInfoManager(IRContext* c) : context_(c) { AnalyzeDebugInsts(*c->module()); } -uint32_t DebugInfoManager::GetDbgSetImportId() { - uint32_t setId = - context()->get_feature_mgr()->GetExtInstImportId_OpenCL100DebugInfo(); - if (setId == 0) { - setId = - context()->get_feature_mgr()->GetExtInstImportId_Vulkan100DebugInfo(); - } - return setId; -} - Instruction* DebugInfoManager::GetDbgInst(uint32_t id) { auto dbg_inst_it = id_to_dbg_inst_.find(id); return dbg_inst_it == id_to_dbg_inst_.end() ? nullptr : dbg_inst_it->second; } void DebugInfoManager::RegisterDbgInst(Instruction* inst) { - assert(inst->NumInOperands() != 0 && - (GetDbgSetImportId() == inst->GetInOperand(0).words[0]) && - "Given instruction is not a debug instruction"); + assert( + inst->NumInOperands() != 0 && + context()->get_feature_mgr()->GetExtInstImportId_OpenCL100DebugInfo() == + inst->GetInOperand(0).words[0] && + "Given instruction is not a debug instruction"); id_to_dbg_inst_[inst->result_id()] = inst; } void DebugInfoManager::RegisterDbgFunction(Instruction* inst) { - if (inst->GetOpenCL100DebugOpcode() == OpenCLDebugInfo100DebugFunction) { - auto fn_id = inst->GetSingleWordOperand(kDebugFunctionOperandFunctionIndex); - // Do not register function that has been optimized away. - auto fn_inst = GetDbgInst(fn_id); - if (fn_inst != nullptr) { - assert(GetDbgInst(fn_id)->GetOpenCL100DebugOpcode() == - OpenCLDebugInfo100DebugInfoNone); - return; - } - assert( - fn_id_to_dbg_fn_.find(fn_id) == fn_id_to_dbg_fn_.end() && - "Register DebugFunction for a function that already has DebugFunction"); - fn_id_to_dbg_fn_[fn_id] = inst; - } else if (inst->GetVulkan100DebugOpcode() == - NonSemanticVulkanDebugInfo100DebugFunctionDefinition) { - auto fn_id = inst->GetSingleWordOperand( - kDebugFunctionDefinitionOperandOpFunctionIndex); - auto fn_inst = GetDbgInst(inst->GetSingleWordOperand( - kDebugFunctionDefinitionOperandDebugFunctionIndex)); - assert(fn_inst && fn_inst->GetVulkan100DebugOpcode() == - NonSemanticVulkanDebugInfo100DebugFunction); - assert(fn_id_to_dbg_fn_.find(fn_id) == fn_id_to_dbg_fn_.end() && - "Register DebugFunctionDefinition for a function that already has " - "DebugFunctionDefinition"); - fn_id_to_dbg_fn_[fn_id] = fn_inst; - } else { - assert(false && "inst is not a DebugFunction"); + assert(inst->GetOpenCL100DebugOpcode() == OpenCLDebugInfo100DebugFunction && + "inst is not a DebugFunction"); + auto fn_id = inst->GetSingleWordOperand(kDebugFunctionOperandFunctionIndex); + // Do not register function that has been optimized away + auto fn_inst = GetDbgInst(fn_id); + if (fn_inst != nullptr) { + assert(GetDbgInst(fn_id)->GetOpenCL100DebugOpcode() == + OpenCLDebugInfo100DebugInfoNone); + return; } + assert( + fn_id_to_dbg_fn_.find(fn_id) == fn_id_to_dbg_fn_.end() && + "Register DebugFunction for a function that already has DebugFunction"); + fn_id_to_dbg_fn_[fn_id] = inst; } void DebugInfoManager::RegisterDbgDeclare(uint32_t var_id, Instruction* dbg_declare) { - assert(dbg_declare->GetCommonDebugOpcode() == CommonDebugInfoDebugDeclare || - dbg_declare->GetCommonDebugOpcode() == CommonDebugInfoDebugValue); + assert(dbg_declare->GetOpenCL100DebugOpcode() == + OpenCLDebugInfo100DebugDeclare || + dbg_declare->GetOpenCL100DebugOpcode() == + OpenCLDebugInfo100DebugValue); auto dbg_decl_itr = var_id_to_dbg_decl_.find(var_id); if (dbg_decl_itr == var_id_to_dbg_decl_.end()) { var_id_to_dbg_decl_[var_id] = {dbg_declare}; @@ -148,36 +126,27 @@ void DebugInfoManager::RegisterDbgDeclare(uint32_t var_id, uint32_t DebugInfoManager::CreateDebugInlinedAt(const Instruction* line, const DebugScope& scope) { - uint32_t setId = GetDbgSetImportId(); - - if (setId == 0) return kNoInlinedAt; - - spv_operand_type_t line_number_type = - spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER; - - // In NonSemantic.Vulkan.DebugInfo.100, all constants are IDs of OpConstant, - // not literals. - if (setId == - context()->get_feature_mgr()->GetExtInstImportId_Vulkan100DebugInfo()) - line_number_type = spv_operand_type_t::SPV_OPERAND_TYPE_ID; + if (context()->get_feature_mgr()->GetExtInstImportId_OpenCL100DebugInfo() == + 0) + return kNoInlinedAt; uint32_t line_number = 0; if (line == nullptr) { auto* lexical_scope_inst = GetDbgInst(scope.GetLexicalScope()); if (lexical_scope_inst == nullptr) return kNoInlinedAt; - CommonDebugInfoInstructions debug_opcode = - lexical_scope_inst->GetCommonDebugOpcode(); + OpenCLDebugInfo100Instructions debug_opcode = + lexical_scope_inst->GetOpenCL100DebugOpcode(); switch (debug_opcode) { - case CommonDebugInfoDebugFunction: + case OpenCLDebugInfo100DebugFunction: line_number = lexical_scope_inst->GetSingleWordOperand( kLineOperandIndexDebugFunction); break; - case CommonDebugInfoDebugLexicalBlock: + case OpenCLDebugInfo100DebugLexicalBlock: line_number = lexical_scope_inst->GetSingleWordOperand( kLineOperandIndexDebugLexicalBlock); break; - case CommonDebugInfoDebugTypeComposite: - case CommonDebugInfoDebugCompilationUnit: + case OpenCLDebugInfo100DebugTypeComposite: + case OpenCLDebugInfo100DebugCompilationUnit: assert(false && "DebugTypeComposite and DebugCompilationUnit are lexical " "scopes, but we inline functions into a function or a block " @@ -192,13 +161,6 @@ uint32_t DebugInfoManager::CreateDebugInlinedAt(const Instruction* line, } } else { line_number = line->GetSingleWordOperand(kOpLineOperandLineIndex); - - // If we need the line number as an ID, generate that constant now. - if (line_number_type == spv_operand_type_t::SPV_OPERAND_TYPE_ID) { - uint32_t line_id = - context()->get_constant_mgr()->GetUIntConst(line_number); - line_number = line_id; - } } uint32_t result_id = context()->TakeNextId(); @@ -206,10 +168,13 @@ uint32_t DebugInfoManager::CreateDebugInlinedAt(const Instruction* line, context(), SpvOpExtInst, context()->get_type_mgr()->GetVoidTypeId(), result_id, { - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {setId}}, + {spv_operand_type_t::SPV_OPERAND_TYPE_ID, + {context() + ->get_feature_mgr() + ->GetExtInstImportId_OpenCL100DebugInfo()}}, {spv_operand_type_t::SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER, - {static_cast(CommonDebugInfoDebugInlinedAt)}}, - {line_number_type, {line_number}}, + {static_cast(OpenCLDebugInfo100DebugInlinedAt)}}, + {spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, {line_number}}, {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {scope.GetLexicalScope()}}, })); // |scope| already has DebugInlinedAt. We put the existing DebugInlinedAt @@ -292,34 +257,19 @@ Instruction* DebugInfoManager::GetDebugOperationWithDeref() { if (deref_operation_ != nullptr) return deref_operation_; uint32_t result_id = context()->TakeNextId(); - std::unique_ptr deref_operation; - - if (context()->get_feature_mgr()->GetExtInstImportId_OpenCL100DebugInfo()) { - deref_operation = std::unique_ptr(new Instruction( - context(), SpvOpExtInst, context()->get_type_mgr()->GetVoidTypeId(), - result_id, - { - {SPV_OPERAND_TYPE_ID, {GetDbgSetImportId()}}, - {SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER, - {static_cast(OpenCLDebugInfo100DebugOperation)}}, - {SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_OPERATION, - {static_cast(OpenCLDebugInfo100Deref)}}, - })); - } else { - uint32_t deref_id = context()->get_constant_mgr()->GetUIntConst( - NonSemanticVulkanDebugInfo100Deref); - - deref_operation = std::unique_ptr( - new Instruction(context(), SpvOpExtInst, - context()->get_type_mgr()->GetVoidTypeId(), result_id, - { - {SPV_OPERAND_TYPE_ID, {GetDbgSetImportId()}}, - {SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER, - {static_cast( - NonSemanticVulkanDebugInfo100DebugOperation)}}, - {SPV_OPERAND_TYPE_ID, {deref_id}}, - })); - } + std::unique_ptr deref_operation(new Instruction( + context(), SpvOpExtInst, context()->get_type_mgr()->GetVoidTypeId(), + result_id, + { + {SPV_OPERAND_TYPE_ID, + {context() + ->get_feature_mgr() + ->GetExtInstImportId_OpenCL100DebugInfo()}}, + {SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER, + {static_cast(OpenCLDebugInfo100DebugOperation)}}, + {SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_OPERATION, + {static_cast(OpenCLDebugInfo100Deref)}}, + })); // Add to the front of |ext_inst_debuginfo_|. deref_operation_ = @@ -333,7 +283,8 @@ Instruction* DebugInfoManager::GetDebugOperationWithDeref() { } Instruction* DebugInfoManager::DerefDebugExpression(Instruction* dbg_expr) { - assert(dbg_expr->GetCommonDebugOpcode() == CommonDebugInfoDebugExpression); + assert(dbg_expr->GetOpenCL100DebugOpcode() == + OpenCLDebugInfo100DebugExpression); std::unique_ptr deref_expr(dbg_expr->Clone(context())); deref_expr->SetResultId(context()->TakeNextId()); deref_expr->InsertOperand( @@ -355,9 +306,12 @@ Instruction* DebugInfoManager::GetDebugInfoNone() { context(), SpvOpExtInst, context()->get_type_mgr()->GetVoidTypeId(), result_id, { - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {GetDbgSetImportId()}}, + {spv_operand_type_t::SPV_OPERAND_TYPE_ID, + {context() + ->get_feature_mgr() + ->GetExtInstImportId_OpenCL100DebugInfo()}}, {spv_operand_type_t::SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER, - {static_cast(CommonDebugInfoDebugInfoNone)}}, + {static_cast(OpenCLDebugInfo100DebugInfoNone)}}, })); // Add to the front of |ext_inst_debuginfo_|. @@ -379,9 +333,12 @@ Instruction* DebugInfoManager::GetEmptyDebugExpression() { context(), SpvOpExtInst, context()->get_type_mgr()->GetVoidTypeId(), result_id, { - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {GetDbgSetImportId()}}, + {spv_operand_type_t::SPV_OPERAND_TYPE_ID, + {context() + ->get_feature_mgr() + ->GetExtInstImportId_OpenCL100DebugInfo()}}, {spv_operand_type_t::SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER, - {static_cast(CommonDebugInfoDebugExpression)}}, + {static_cast(OpenCLDebugInfo100DebugExpression)}}, })); // Add to the front of |ext_inst_debuginfo_|. @@ -398,7 +355,8 @@ Instruction* DebugInfoManager::GetEmptyDebugExpression() { Instruction* DebugInfoManager::GetDebugInlinedAt(uint32_t dbg_inlined_at_id) { auto* inlined_at = GetDbgInst(dbg_inlined_at_id); if (inlined_at == nullptr) return nullptr; - if (inlined_at->GetCommonDebugOpcode() != CommonDebugInfoDebugInlinedAt) { + if (inlined_at->GetOpenCL100DebugOpcode() != + OpenCLDebugInfo100DebugInlinedAt) { return nullptr; } return inlined_at; @@ -445,23 +403,23 @@ bool DebugInfoManager::KillDebugDeclares(uint32_t variable_id) { uint32_t DebugInfoManager::GetParentScope(uint32_t child_scope) { auto dbg_scope_itr = id_to_dbg_inst_.find(child_scope); assert(dbg_scope_itr != id_to_dbg_inst_.end()); - CommonDebugInfoInstructions debug_opcode = - dbg_scope_itr->second->GetCommonDebugOpcode(); + OpenCLDebugInfo100Instructions debug_opcode = + dbg_scope_itr->second->GetOpenCL100DebugOpcode(); uint32_t parent_scope = kNoDebugScope; switch (debug_opcode) { - case CommonDebugInfoDebugFunction: + case OpenCLDebugInfo100DebugFunction: parent_scope = dbg_scope_itr->second->GetSingleWordOperand( kDebugFunctionOperandParentIndex); break; - case CommonDebugInfoDebugLexicalBlock: + case OpenCLDebugInfo100DebugLexicalBlock: parent_scope = dbg_scope_itr->second->GetSingleWordOperand( kDebugLexicalBlockOperandParentIndex); break; - case CommonDebugInfoDebugTypeComposite: + case OpenCLDebugInfo100DebugTypeComposite: parent_scope = dbg_scope_itr->second->GetSingleWordOperand( kDebugTypeCompositeOperandParentIndex); break; - case CommonDebugInfoDebugCompilationUnit: + case OpenCLDebugInfo100DebugCompilationUnit: // DebugCompilationUnit does not have a parent scope. break; default: @@ -555,7 +513,8 @@ Instruction* DebugInfoManager::AddDebugValueForDecl( std::unique_ptr dbg_val(dbg_decl->Clone(context())); dbg_val->SetResultId(context()->TakeNextId()); - dbg_val->SetInOperand(kExtInstInstructionInIdx, {CommonDebugInfoDebugValue}); + dbg_val->SetInOperand(kExtInstInstructionInIdx, + {OpenCLDebugInfo100DebugValue}); dbg_val->SetOperand(kDebugDeclareOperandVariableIndex, {value_id}); dbg_val->SetOperand(kDebugValueOperandExpressionIndex, {GetEmptyDebugExpression()->result_id()}); @@ -573,20 +532,9 @@ Instruction* DebugInfoManager::AddDebugValueForDecl( return added_dbg_val; } -uint32_t DebugInfoManager::GetVulkanDebugOperation(Instruction* inst) { - assert(inst->GetVulkan100DebugOpcode() == - NonSemanticVulkanDebugInfo100DebugOperation && - "inst must be Vulkan DebugOperation"); - return context() - ->get_constant_mgr() - ->GetConstantFromInst(context()->get_def_use_mgr()->GetDef( - inst->GetSingleWordOperand(kDebugOperationOperandOperationIndex))) - ->GetU32(); -} - uint32_t DebugInfoManager::GetVariableIdOfDebugValueUsedForDeclare( Instruction* inst) { - if (inst->GetCommonDebugOpcode() != CommonDebugInfoDebugValue) return 0; + if (inst->GetOpenCL100DebugOpcode() != OpenCLDebugInfo100DebugValue) return 0; auto* expr = GetDbgInst(inst->GetSingleWordOperand(kDebugValueOperandExpressionIndex)); @@ -596,19 +544,9 @@ uint32_t DebugInfoManager::GetVariableIdOfDebugValueUsedForDeclare( auto* operation = GetDbgInst( expr->GetSingleWordOperand(kDebugExpressOperandOperationIndex)); if (operation == nullptr) return 0; - - // OpenCL.DebugInfo.100 contains a literal for the operation, Vulkan uses an - // OpConstant. - if (inst->IsOpenCL100DebugInstr()) { - if (operation->GetSingleWordOperand(kDebugOperationOperandOperationIndex) != - OpenCLDebugInfo100Deref) { - return 0; - } - } else { - uint32_t operation_const = GetVulkanDebugOperation(operation); - if (operation_const != NonSemanticVulkanDebugInfo100Deref) { - return 0; - } + if (operation->GetSingleWordOperand(kDebugOperationOperandOperationIndex) != + OpenCLDebugInfo100Deref) { + return 0; } uint32_t var_id = @@ -629,8 +567,8 @@ uint32_t DebugInfoManager::GetVariableIdOfDebugValueUsedForDeclare( } bool DebugInfoManager::IsDebugDeclare(Instruction* instr) { - if (!instr->IsCommonDebugInstr()) return false; - return instr->GetCommonDebugOpcode() == CommonDebugInfoDebugDeclare || + if (!instr->IsOpenCL100DebugInstr()) return false; + return instr->GetOpenCL100DebugOpcode() == OpenCLDebugInfo100DebugDeclare || GetVariableIdOfDebugValueUsedForDeclare(instr) != 0; } @@ -677,13 +615,14 @@ void DebugInfoManager::AnalyzeDebugInst(Instruction* inst) { users.insert(inst); } - if (!inst->IsCommonDebugInstr()) return; + if (!inst->IsOpenCL100DebugInstr()) return; RegisterDbgInst(inst); - if (inst->GetOpenCL100DebugOpcode() == OpenCLDebugInfo100DebugFunction || - inst->GetVulkan100DebugOpcode() == - NonSemanticVulkanDebugInfo100DebugFunctionDefinition) { + if (inst->GetOpenCL100DebugOpcode() == OpenCLDebugInfo100DebugFunction) { + assert(GetDebugFunction(inst->GetSingleWordOperand( + kDebugFunctionOperandFunctionIndex)) == nullptr && + "Two DebugFunction instruction exists for a single OpFunction."); RegisterDbgFunction(inst); } @@ -694,17 +633,8 @@ void DebugInfoManager::AnalyzeDebugInst(Instruction* inst) { deref_operation_ = inst; } - if (deref_operation_ == nullptr && - inst->GetVulkan100DebugOpcode() == - NonSemanticVulkanDebugInfo100DebugOperation) { - uint32_t operation_const = GetVulkanDebugOperation(inst); - if (operation_const == NonSemanticVulkanDebugInfo100Deref) { - deref_operation_ = inst; - } - } - if (debug_info_none_inst_ == nullptr && - inst->GetCommonDebugOpcode() == CommonDebugInfoDebugInfoNone) { + inst->GetOpenCL100DebugOpcode() == OpenCLDebugInfo100DebugInfoNone) { debug_info_none_inst_ = inst; } @@ -712,7 +642,7 @@ void DebugInfoManager::AnalyzeDebugInst(Instruction* inst) { empty_debug_expr_inst_ = inst; } - if (inst->GetCommonDebugOpcode() == CommonDebugInfoDebugDeclare) { + if (inst->GetOpenCL100DebugOpcode() == OpenCLDebugInfo100DebugDeclare) { uint32_t var_id = inst->GetSingleWordOperand(kDebugDeclareOperandVariableIndex); RegisterDbgDeclare(var_id, inst); @@ -725,8 +655,8 @@ void DebugInfoManager::AnalyzeDebugInst(Instruction* inst) { void DebugInfoManager::ConvertDebugGlobalToLocalVariable( Instruction* dbg_global_var, Instruction* local_var) { - if (dbg_global_var->GetCommonDebugOpcode() != - CommonDebugInfoDebugGlobalVariable) { + if (dbg_global_var->GetOpenCL100DebugOpcode() != + OpenCLDebugInfo100DebugGlobalVariable) { return; } assert(local_var->opcode() == SpvOpVariable || @@ -734,7 +664,7 @@ void DebugInfoManager::ConvertDebugGlobalToLocalVariable( // Convert |dbg_global_var| to DebugLocalVariable dbg_global_var->SetInOperand(kExtInstInstructionInIdx, - {CommonDebugInfoDebugLocalVariable}); + {OpenCLDebugInfo100DebugLocalVariable}); auto flags = dbg_global_var->GetSingleWordOperand( kDebugGlobalVariableOperandFlagsIndex); for (uint32_t i = dbg_global_var->NumInOperands() - 1; @@ -750,9 +680,12 @@ void DebugInfoManager::ConvertDebugGlobalToLocalVariable( context(), SpvOpExtInst, context()->get_type_mgr()->GetVoidTypeId(), context()->TakeNextId(), { - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {GetDbgSetImportId()}}, + {spv_operand_type_t::SPV_OPERAND_TYPE_ID, + {context() + ->get_feature_mgr() + ->GetExtInstImportId_OpenCL100DebugInfo()}}, {spv_operand_type_t::SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER, - {static_cast(CommonDebugInfoDebugDeclare)}}, + {static_cast(OpenCLDebugInfo100DebugDeclare)}}, {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {dbg_global_var->result_id()}}, {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {local_var->result_id()}}, @@ -780,7 +713,7 @@ void DebugInfoManager::AnalyzeDebugInsts(Module& module) { // list. if (empty_debug_expr_inst_ != nullptr && empty_debug_expr_inst_->PreviousNode() != nullptr && - empty_debug_expr_inst_->PreviousNode()->IsCommonDebugInstr()) { + empty_debug_expr_inst_->PreviousNode()->IsOpenCL100DebugInstr()) { empty_debug_expr_inst_->InsertBefore( &*context()->module()->ext_inst_debuginfo_begin()); } @@ -789,7 +722,7 @@ void DebugInfoManager::AnalyzeDebugInsts(Module& module) { // list. if (debug_info_none_inst_ != nullptr && debug_info_none_inst_->PreviousNode() != nullptr && - debug_info_none_inst_->PreviousNode()->IsCommonDebugInstr()) { + debug_info_none_inst_->PreviousNode()->IsOpenCL100DebugInstr()) { debug_info_none_inst_->InsertBefore( &*context()->module()->ext_inst_debuginfo_begin()); } @@ -807,7 +740,7 @@ void DebugInfoManager::ClearDebugInfo(Instruction* instr) { inlinedat_id_to_users_itr->second.erase(instr); } - if (instr == nullptr || !instr->IsCommonDebugInstr()) { + if (instr == nullptr || !instr->IsOpenCL100DebugInstr()) { return; } @@ -818,15 +751,9 @@ void DebugInfoManager::ClearDebugInfo(Instruction* instr) { instr->GetSingleWordOperand(kDebugFunctionOperandFunctionIndex); fn_id_to_dbg_fn_.erase(fn_id); } - if (instr->GetVulkan100DebugOpcode() == - NonSemanticVulkanDebugInfo100DebugFunction) { - auto fn_id = instr->GetSingleWordOperand( - kDebugFunctionDefinitionOperandOpFunctionIndex); - fn_id_to_dbg_fn_.erase(fn_id); - } - if (instr->GetCommonDebugOpcode() == CommonDebugInfoDebugDeclare || - instr->GetCommonDebugOpcode() == CommonDebugInfoDebugValue) { + if (instr->GetOpenCL100DebugOpcode() == OpenCLDebugInfo100DebugDeclare || + instr->GetOpenCL100DebugOpcode() == OpenCLDebugInfo100DebugValue) { auto var_or_value_id = instr->GetSingleWordOperand(kDebugDeclareOperandVariableIndex); auto dbg_decl_itr = var_id_to_dbg_decl_.find(var_or_value_id); @@ -840,8 +767,6 @@ void DebugInfoManager::ClearDebugInfo(Instruction* instr) { for (auto dbg_instr_itr = context()->module()->ext_inst_debuginfo_begin(); dbg_instr_itr != context()->module()->ext_inst_debuginfo_end(); ++dbg_instr_itr) { - // OpenCL.DebugInfo.100 contains the operation as a literal operand, in - // Vulkan it's referenced as an OpConstant. if (instr != &*dbg_instr_itr && dbg_instr_itr->GetOpenCL100DebugOpcode() == OpenCLDebugInfo100DebugOperation && @@ -850,15 +775,6 @@ void DebugInfoManager::ClearDebugInfo(Instruction* instr) { OpenCLDebugInfo100Deref) { deref_operation_ = &*dbg_instr_itr; break; - } else if (instr != &*dbg_instr_itr && - dbg_instr_itr->GetVulkan100DebugOpcode() == - NonSemanticVulkanDebugInfo100DebugOperation) { - uint32_t operation_const = GetVulkanDebugOperation(&*dbg_instr_itr); - - if (operation_const == NonSemanticVulkanDebugInfo100Deref) { - deref_operation_ = &*dbg_instr_itr; - break; - } } } } @@ -868,8 +784,9 @@ void DebugInfoManager::ClearDebugInfo(Instruction* instr) { for (auto dbg_instr_itr = context()->module()->ext_inst_debuginfo_begin(); dbg_instr_itr != context()->module()->ext_inst_debuginfo_end(); ++dbg_instr_itr) { - if (instr != &*dbg_instr_itr && dbg_instr_itr->GetCommonDebugOpcode() == - CommonDebugInfoDebugInfoNone) { + if (instr != &*dbg_instr_itr && + dbg_instr_itr->GetOpenCL100DebugOpcode() == + OpenCLDebugInfo100DebugInfoNone) { debug_info_none_inst_ = &*dbg_instr_itr; break; } diff --git a/source/opt/debug_info_manager.h b/source/opt/debug_info_manager.h index 679ae138..776e9baa 100644 --- a/source/opt/debug_info_manager.h +++ b/source/opt/debug_info_manager.h @@ -67,8 +67,8 @@ class DebugInlinedAtContext { std::unordered_map callee_inlined_at2chain_; }; -// A class for analyzing, managing, and creating OpenCL.DebugInfo.100 and -// NonSemantic.Vulkan.DebugInfo.100 extension instructions. +// A class for analyzing, managing, and creating OpenCL.DebugInfo.100 extension +// instructions. class DebugInfoManager { public: // Constructs a debug information manager from the given |context|. @@ -85,7 +85,7 @@ class DebugInfoManager { return !(lhs == rhs); } - // Analyzes DebugInfo instruction |dbg_inst|. + // Analyzes OpenCL.DebugInfo.100 instruction |dbg_inst|. void AnalyzeDebugInst(Instruction* dbg_inst); // Creates new DebugInlinedAt and returns its id. Its line operand is the @@ -164,9 +164,6 @@ class DebugInfoManager { // Erases |instr| from data structures of this class. void ClearDebugInfo(Instruction* instr); - // Return the opcode for the Vulkan DebugOperation inst - uint32_t GetVulkanDebugOperation(Instruction* inst); - // Returns the id of Value operand if |inst| is DebugValue who has Deref // operation and its Value operand is a result id of OpVariable with // Function storage class. Otherwise, returns 0. @@ -193,13 +190,10 @@ class DebugInfoManager { private: IRContext* context() { return context_; } - // Analyzes DebugInfo instructions in the given |module| and + // Analyzes OpenCL.DebugInfo.100 instructions in the given |module| and // populates data structures in this class. void AnalyzeDebugInsts(Module& module); - // Get the DebugInfo ExtInstImport Id, or 0 if no DebugInfo is available. - uint32_t GetDbgSetImportId(); - // Returns the debug instruction whose id is |id|. Returns |nullptr| if one // does not exists. Instruction* GetDbgInst(uint32_t id); @@ -236,7 +230,7 @@ class DebugInfoManager { IRContext* context_; - // Mapping from ids of DebugInfo extension instructions. + // Mapping from ids of OpenCL.DebugInfo.100 extension instructions // to their Instruction instances. std::unordered_map id_to_dbg_inst_; diff --git a/source/opt/desc_sroa_util.cpp b/source/opt/desc_sroa_util.cpp deleted file mode 100644 index 1954e2cc..00000000 --- a/source/opt/desc_sroa_util.cpp +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/opt/desc_sroa_util.h" - -namespace spvtools { -namespace opt { -namespace { - -const uint32_t kOpAccessChainInOperandIndexes = 1; - -// Returns the length of array type |type|. -uint32_t GetLengthOfArrayType(IRContext* context, Instruction* type) { - assert(type->opcode() == SpvOpTypeArray && "type must be array"); - uint32_t length_id = type->GetSingleWordInOperand(1); - const analysis::Constant* length_const = - context->get_constant_mgr()->FindDeclaredConstant(length_id); - assert(length_const != nullptr); - return length_const->GetU32(); -} - -} // namespace - -namespace descsroautil { - -bool IsDescriptorArray(IRContext* context, Instruction* var) { - if (var->opcode() != SpvOpVariable) { - return false; - } - - uint32_t ptr_type_id = var->type_id(); - Instruction* ptr_type_inst = context->get_def_use_mgr()->GetDef(ptr_type_id); - if (ptr_type_inst->opcode() != SpvOpTypePointer) { - return false; - } - - uint32_t var_type_id = ptr_type_inst->GetSingleWordInOperand(1); - Instruction* var_type_inst = context->get_def_use_mgr()->GetDef(var_type_id); - if (var_type_inst->opcode() != SpvOpTypeArray && - var_type_inst->opcode() != SpvOpTypeStruct) { - return false; - } - - // All structures with descriptor assignments must be replaced by variables, - // one for each of their members - with the exceptions of buffers. - if (IsTypeOfStructuredBuffer(context, var_type_inst)) { - return false; - } - - if (!context->get_decoration_mgr()->HasDecoration( - var->result_id(), SpvDecorationDescriptorSet)) { - return false; - } - - return context->get_decoration_mgr()->HasDecoration(var->result_id(), - SpvDecorationBinding); -} - -bool IsTypeOfStructuredBuffer(IRContext* context, const Instruction* type) { - if (type->opcode() != SpvOpTypeStruct) { - return false; - } - - // All buffers have offset decorations for members of their structure types. - // This is how we distinguish it from a structure of descriptors. - return context->get_decoration_mgr()->HasDecoration(type->result_id(), - SpvDecorationOffset); -} - -const analysis::Constant* GetAccessChainIndexAsConst( - IRContext* context, Instruction* access_chain) { - if (access_chain->NumInOperands() <= 1) { - return nullptr; - } - uint32_t idx_id = GetFirstIndexOfAccessChain(access_chain); - const analysis::Constant* idx_const = - context->get_constant_mgr()->FindDeclaredConstant(idx_id); - return idx_const; -} - -uint32_t GetFirstIndexOfAccessChain(Instruction* access_chain) { - assert(access_chain->NumInOperands() > 1 && - "OpAccessChain does not have Indexes operand"); - return access_chain->GetSingleWordInOperand(kOpAccessChainInOperandIndexes); -} - -uint32_t GetNumberOfElementsForArrayOrStruct(IRContext* context, - Instruction* var) { - uint32_t ptr_type_id = var->type_id(); - Instruction* ptr_type_inst = context->get_def_use_mgr()->GetDef(ptr_type_id); - assert(ptr_type_inst->opcode() == SpvOpTypePointer && - "Variable should be a pointer to an array or structure."); - uint32_t pointee_type_id = ptr_type_inst->GetSingleWordInOperand(1); - Instruction* pointee_type_inst = - context->get_def_use_mgr()->GetDef(pointee_type_id); - if (pointee_type_inst->opcode() == SpvOpTypeArray) { - return GetLengthOfArrayType(context, pointee_type_inst); - } - assert(pointee_type_inst->opcode() == SpvOpTypeStruct && - "Variable should be a pointer to an array or structure."); - return pointee_type_inst->NumInOperands(); -} - -} // namespace descsroautil -} // namespace opt -} // namespace spvtools diff --git a/source/opt/desc_sroa_util.h b/source/opt/desc_sroa_util.h deleted file mode 100644 index 2f45c0c2..00000000 --- a/source/opt/desc_sroa_util.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SOURCE_OPT_DESC_SROA_UTIL_H_ -#define SOURCE_OPT_DESC_SROA_UTIL_H_ - -#include "source/opt/ir_context.h" - -namespace spvtools { -namespace opt { - -// Provides functions for the descriptor array SROA. -namespace descsroautil { - -// Returns true if |var| is an OpVariable instruction that represents a -// descriptor array. -bool IsDescriptorArray(IRContext* context, Instruction* var); - -// Returns true if |type| is a type that could be used for a structured buffer -// as opposed to a type that would be used for a structure of resource -// descriptors. -bool IsTypeOfStructuredBuffer(IRContext* context, const Instruction* type); - -// Returns the first index of the OpAccessChain instruction |access_chain| as -// a constant. Returns nullptr if it is not a constant. -const analysis::Constant* GetAccessChainIndexAsConst(IRContext* context, - Instruction* access_chain); - -// Returns the number of elements of an OpVariable instruction |var| whose type -// must be a pointer to an array or a struct. -uint32_t GetNumberOfElementsForArrayOrStruct(IRContext* context, - Instruction* var); - -// Returns the first Indexes operand id of the OpAccessChain or -// OpInBoundsAccessChain instruction |access_chain|. The access chain must have -// at least 1 index. -uint32_t GetFirstIndexOfAccessChain(Instruction* access_chain); - -} // namespace descsroautil -} // namespace opt -} // namespace spvtools - -#endif // SOURCE_OPT_DESC_SROA_UTIL_H_ diff --git a/source/opt/eliminate_dead_functions_util.cpp b/source/opt/eliminate_dead_functions_util.cpp index 1379120f..6b5234bb 100644 --- a/source/opt/eliminate_dead_functions_util.cpp +++ b/source/opt/eliminate_dead_functions_util.cpp @@ -23,11 +23,9 @@ Module::iterator EliminateFunction(IRContext* context, Module::iterator* func_iter) { bool first_func = *func_iter == context->module()->begin(); bool seen_func_end = false; - std::unordered_set to_kill; (*func_iter) ->ForEachInst( - [context, first_func, func_iter, &seen_func_end, - &to_kill](Instruction* inst) { + [context, first_func, func_iter, &seen_func_end](Instruction* inst) { if (inst->opcode() == SpvOpFunctionEnd) { seen_func_end = true; } @@ -35,7 +33,6 @@ Module::iterator EliminateFunction(IRContext* context, // global values if this is the first function. if (seen_func_end && inst->opcode() == SpvOpExtInst) { assert(inst->IsNonSemanticInstruction()); - if (to_kill.find(inst) != to_kill.end()) return; std::unique_ptr clone(inst->Clone(context)); context->ForgetUses(inst); context->AnalyzeDefUse(clone.get()); @@ -47,17 +44,12 @@ Module::iterator EliminateFunction(IRContext* context, prev_func_iter->AddNonSemanticInstruction(std::move(clone)); } inst->ToNop(); - } else if (to_kill.find(inst) == to_kill.end()) { - context->CollectNonSemanticTree(inst, &to_kill); + } else { + context->KillNonSemanticInfo(inst); context->KillInst(inst); } }, true, true); - - for (auto* dead : to_kill) { - context->KillInst(dead); - } - return func_iter->Erase(); } diff --git a/source/opt/eliminate_dead_input_components_pass.cpp b/source/opt/eliminate_dead_input_components_pass.cpp deleted file mode 100644 index f383136d..00000000 --- a/source/opt/eliminate_dead_input_components_pass.cpp +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) 2022 The Khronos Group Inc. -// Copyright (c) 2022 LunarG Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/opt/eliminate_dead_input_components_pass.h" - -#include -#include - -#include "source/opt/instruction.h" -#include "source/opt/ir_builder.h" -#include "source/opt/ir_context.h" -#include "source/util/bit_vector.h" - -namespace { - -const uint32_t kAccessChainBaseInIdx = 0; -const uint32_t kAccessChainIndex0InIdx = 1; -const uint32_t kConstantValueInIdx = 0; -const uint32_t kVariableStorageClassInIdx = 0; - -} // namespace - -namespace spvtools { -namespace opt { - -Pass::Status EliminateDeadInputComponentsPass::Process() { - // Current functionality assumes shader capability - if (!context()->get_feature_mgr()->HasCapability(SpvCapabilityShader)) - return Status::SuccessWithoutChange; - analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - bool modified = false; - std::vector> arrays_to_change; - for (auto& var : context()->types_values()) { - if (var.opcode() != SpvOpVariable) { - continue; - } - analysis::Type* var_type = type_mgr->GetType(var.type_id()); - analysis::Pointer* ptr_type = var_type->AsPointer(); - if (ptr_type == nullptr) { - continue; - } - if (ptr_type->storage_class() != SpvStorageClassInput) { - continue; - } - const analysis::Array* arr_type = ptr_type->pointee_type()->AsArray(); - if (arr_type == nullptr) { - continue; - } - unsigned arr_len_id = arr_type->LengthId(); - Instruction* arr_len_inst = def_use_mgr->GetDef(arr_len_id); - if (arr_len_inst->opcode() != SpvOpConstant) { - continue; - } - // SPIR-V requires array size is >= 1, so this works for signed or - // unsigned size - unsigned original_max = - arr_len_inst->GetSingleWordInOperand(kConstantValueInIdx) - 1; - unsigned max_idx = FindMaxIndex(var, original_max); - if (max_idx != original_max) { - ChangeArrayLength(var, max_idx + 1); - modified = true; - } - } - - return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; -} - -unsigned EliminateDeadInputComponentsPass::FindMaxIndex(Instruction& var, - unsigned original_max) { - unsigned max = 0; - bool seen_non_const_ac = false; - assert(var.opcode() == SpvOpVariable && "must be variable"); - context()->get_def_use_mgr()->WhileEachUser( - var.result_id(), [&max, &seen_non_const_ac, var, this](Instruction* use) { - auto use_opcode = use->opcode(); - if (use_opcode == SpvOpLoad || use_opcode == SpvOpCopyMemory || - use_opcode == SpvOpCopyMemorySized || - use_opcode == SpvOpCopyObject) { - seen_non_const_ac = true; - return false; - } - if (use->opcode() != SpvOpAccessChain && - use->opcode() != SpvOpInBoundsAccessChain) { - return true; - } - // OpAccessChain with no indices currently not optimized - if (use->NumInOperands() == 1) { - seen_non_const_ac = true; - return false; - } - unsigned base_id = use->GetSingleWordInOperand(kAccessChainBaseInIdx); - USE_ASSERT(base_id == var.result_id() && "unexpected base"); - unsigned idx_id = use->GetSingleWordInOperand(kAccessChainIndex0InIdx); - Instruction* idx_inst = context()->get_def_use_mgr()->GetDef(idx_id); - if (idx_inst->opcode() != SpvOpConstant) { - seen_non_const_ac = true; - return false; - } - unsigned value = idx_inst->GetSingleWordInOperand(kConstantValueInIdx); - if (value > max) max = value; - return true; - }); - return seen_non_const_ac ? original_max : max; -} - -void EliminateDeadInputComponentsPass::ChangeArrayLength(Instruction& arr, - unsigned length) { - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - analysis::ConstantManager* const_mgr = context()->get_constant_mgr(); - analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); - analysis::Pointer* ptr_type = type_mgr->GetType(arr.type_id())->AsPointer(); - const analysis::Array* arr_ty = ptr_type->pointee_type()->AsArray(); - assert(arr_ty && "expecting array type"); - uint32_t length_id = const_mgr->GetUIntConst(length); - analysis::Array new_arr_ty(arr_ty->element_type(), - arr_ty->GetConstantLengthInfo(length_id, length)); - analysis::Type* reg_new_arr_ty = type_mgr->GetRegisteredType(&new_arr_ty); - analysis::Pointer new_ptr_ty(reg_new_arr_ty, SpvStorageClassInput); - analysis::Type* reg_new_ptr_ty = type_mgr->GetRegisteredType(&new_ptr_ty); - uint32_t new_ptr_ty_id = type_mgr->GetTypeInstruction(reg_new_ptr_ty); - arr.SetResultType(new_ptr_ty_id); - def_use_mgr->AnalyzeInstUse(&arr); - // Move array OpVariable instruction after its new type to preserve order - USE_ASSERT(arr.GetSingleWordInOperand(kVariableStorageClassInIdx) != - SpvStorageClassFunction && - "cannot move Function variable"); - Instruction* new_ptr_ty_inst = def_use_mgr->GetDef(new_ptr_ty_id); - arr.RemoveFromList(); - arr.InsertAfter(new_ptr_ty_inst); -} - -} // namespace opt -} // namespace spvtools diff --git a/source/opt/eliminate_dead_input_components_pass.h b/source/opt/eliminate_dead_input_components_pass.h deleted file mode 100644 index b77857f4..00000000 --- a/source/opt/eliminate_dead_input_components_pass.h +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) 2022 The Khronos Group Inc. -// Copyright (c) 2022 LunarG Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SOURCE_OPT_ELIMINATE_DEAD_INPUT_COMPONENTS_H_ -#define SOURCE_OPT_ELIMINATE_DEAD_INPUT_COMPONENTS_H_ - -#include - -#include "source/opt/ir_context.h" -#include "source/opt/module.h" -#include "source/opt/pass.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class EliminateDeadInputComponentsPass : public Pass { - public: - explicit EliminateDeadInputComponentsPass() {} - - const char* name() const override { return "reduce-load-size"; } - Status Process() override; - - // Return the mask of preserved Analyses. - IRContext::Analysis GetPreservedAnalyses() override { - return IRContext::kAnalysisDefUse | - IRContext::kAnalysisInstrToBlockMapping | - IRContext::kAnalysisCombinators | IRContext::kAnalysisCFG | - IRContext::kAnalysisDominatorAnalysis | - IRContext::kAnalysisLoopAnalysis | IRContext::kAnalysisNameMap | - IRContext::kAnalysisConstants | IRContext::kAnalysisTypes; - } - - private: - // Find the max constant used to index the variable declared by |var| - // through OpAccessChain or OpInBoundsAccessChain. If any non-constant - // indices or non-Op*AccessChain use of |var|, return |original_max|. - unsigned FindMaxIndex(Instruction& var, unsigned original_max); - - // Change the length of the array |inst| to |length| - void ChangeArrayLength(Instruction& inst, unsigned length); -}; - -} // namespace opt -} // namespace spvtools - -#endif // SOURCE_OPT_ELIMINATE_DEAD_INPUT_COMPONENTS_H_ diff --git a/source/opt/feature_manager.cpp b/source/opt/feature_manager.cpp index db3abddf..ad70c1e4 100644 --- a/source/opt/feature_manager.cpp +++ b/source/opt/feature_manager.cpp @@ -80,8 +80,6 @@ void FeatureManager::AddExtInstImportIds(Module* module) { extinst_importid_GLSLstd450_ = module->GetExtInstImportId("GLSL.std.450"); extinst_importid_OpenCL100DebugInfo_ = module->GetExtInstImportId("OpenCL.DebugInfo.100"); - extinst_importid_Vulkan100DebugInfo_ = - module->GetExtInstImportId("NonSemantic.Vulkan.DebugInfo.100"); } bool operator==(const FeatureManager& a, const FeatureManager& b) { @@ -109,11 +107,6 @@ bool operator==(const FeatureManager& a, const FeatureManager& b) { return false; } - if (a.extinst_importid_Vulkan100DebugInfo_ != - b.extinst_importid_Vulkan100DebugInfo_) { - return false; - } - return true; } } // namespace opt diff --git a/source/opt/feature_manager.h b/source/opt/feature_manager.h index 4720c6dc..66d1cbac 100644 --- a/source/opt/feature_manager.h +++ b/source/opt/feature_manager.h @@ -55,10 +55,6 @@ class FeatureManager { return extinst_importid_OpenCL100DebugInfo_; } - uint32_t GetExtInstImportId_Vulkan100DebugInfo() const { - return extinst_importid_Vulkan100DebugInfo_; - } - friend bool operator==(const FeatureManager& a, const FeatureManager& b); friend bool operator!=(const FeatureManager& a, const FeatureManager& b) { return !(a == b); @@ -96,10 +92,6 @@ class FeatureManager { // Common OpenCL100DebugInfo external instruction import ids, cached // for performance. uint32_t extinst_importid_OpenCL100DebugInfo_ = 0; - - // Common NonSemanticVulkan100DebugInfo external instruction import ids, - // cached for performance. - uint32_t extinst_importid_Vulkan100DebugInfo_ = 0; }; } // namespace opt diff --git a/source/opt/fix_func_call_arguments.cpp b/source/opt/fix_func_call_arguments.cpp deleted file mode 100644 index d140fb4b..00000000 --- a/source/opt/fix_func_call_arguments.cpp +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) 2022 Advanced Micro Devices, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "fix_func_call_arguments.h" - -#include "ir_builder.h" - -using namespace spvtools; -using namespace opt; - -bool FixFuncCallArgumentsPass::ModuleHasASingleFunction() { - auto funcsNum = get_module()->end() - get_module()->begin(); - return funcsNum == 1; -} - -Pass::Status FixFuncCallArgumentsPass::Process() { - bool modified = false; - if (ModuleHasASingleFunction()) return Status::SuccessWithoutChange; - for (auto& func : *get_module()) { - func.ForEachInst([this, &modified](Instruction* inst) { - if (inst->opcode() == SpvOpFunctionCall) { - modified |= FixFuncCallArguments(inst); - } - }); - } - return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; -} - -bool FixFuncCallArgumentsPass::FixFuncCallArguments( - Instruction* func_call_inst) { - bool modified = false; - for (uint32_t i = 0; i < func_call_inst->NumInOperands(); ++i) { - Operand& op = func_call_inst->GetInOperand(i); - if (op.type != SPV_OPERAND_TYPE_ID) continue; - Instruction* operand_inst = get_def_use_mgr()->GetDef(op.AsId()); - if (operand_inst->opcode() == SpvOpAccessChain) { - uint32_t var_id = - ReplaceAccessChainFuncCallArguments(func_call_inst, operand_inst); - func_call_inst->SetInOperand(i, {var_id}); - modified = true; - } - } - if (modified) { - context()->UpdateDefUse(func_call_inst); - } - return modified; -} - -uint32_t FixFuncCallArgumentsPass::ReplaceAccessChainFuncCallArguments( - Instruction* func_call_inst, Instruction* operand_inst) { - InstructionBuilder builder( - context(), func_call_inst, - IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping); - - Instruction* next_insert_point = func_call_inst->NextNode(); - // Get Variable insertion point - Function* func = context()->get_instr_block(func_call_inst)->GetParent(); - Instruction* variable_insertion_point = &*(func->begin()->begin()); - Instruction* op_ptr_type = get_def_use_mgr()->GetDef(operand_inst->type_id()); - Instruction* op_type = - get_def_use_mgr()->GetDef(op_ptr_type->GetSingleWordInOperand(1)); - uint32_t varType = context()->get_type_mgr()->FindPointerToType( - op_type->result_id(), SpvStorageClassFunction); - // Create new variable - builder.SetInsertPoint(variable_insertion_point); - Instruction* var = builder.AddVariable(varType, SpvStorageClassFunction); - // Load access chain to the new variable before function call - builder.SetInsertPoint(func_call_inst); - - uint32_t operand_id = operand_inst->result_id(); - Instruction* load = builder.AddLoad(op_type->result_id(), operand_id); - builder.AddStore(var->result_id(), load->result_id()); - // Load return value to the acesschain after function call - builder.SetInsertPoint(next_insert_point); - load = builder.AddLoad(op_type->result_id(), var->result_id()); - builder.AddStore(operand_id, load->result_id()); - - return var->result_id(); -} diff --git a/source/opt/fix_func_call_arguments.h b/source/opt/fix_func_call_arguments.h deleted file mode 100644 index 15781b8c..00000000 --- a/source/opt/fix_func_call_arguments.h +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2022 Advanced Micro Devices, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef _VAR_FUNC_CALL_PASS_H -#define _VAR_FUNC_CALL_PASS_H - -#include "source/opt/pass.h" - -namespace spvtools { -namespace opt { -class FixFuncCallArgumentsPass : public Pass { - public: - FixFuncCallArgumentsPass() {} - const char* name() const override { return "fix-for-funcall-param"; } - Status Process() override; - // Returns true if the module has one one function. - bool ModuleHasASingleFunction(); - // Copies from the memory pointed to by |operand_inst| to a new function scope - // variable created before |func_call_inst|, and - // copies the value of the new variable back to the memory pointed to by - // |operand_inst| after |funct_call_inst| Returns the id of - // the new variable. - uint32_t ReplaceAccessChainFuncCallArguments(Instruction* func_call_inst, - Instruction* operand_inst); - - // Fix function call |func_call_inst| non memory object arguments - bool FixFuncCallArguments(Instruction* func_call_inst); - - IRContext::Analysis GetPreservedAnalyses() override { - return IRContext::kAnalysisTypes; - } -}; -} // namespace opt -} // namespace spvtools - -#endif // _VAR_FUNC_CALL_PASS_H \ No newline at end of file diff --git a/source/opt/folding_rules.cpp b/source/opt/folding_rules.cpp index 6ae078fb..1e7c424b 100644 --- a/source/opt/folding_rules.cpp +++ b/source/opt/folding_rules.cpp @@ -124,66 +124,6 @@ Instruction* NonConstInput(IRContext* context, const analysis::Constant* c, inst->GetSingleWordInOperand(in_op)); } -std::vector ExtractInts(uint64_t val) { - std::vector words; - words.push_back(static_cast(val)); - words.push_back(static_cast(val >> 32)); - return words; -} - -std::vector GetWordsFromScalarIntConstant( - const analysis::IntConstant* c) { - assert(c != nullptr); - uint32_t width = c->type()->AsInteger()->width(); - assert(width == 32 || width == 64); - if (width == 64) { - uint64_t uval = static_cast(c->GetU64()); - return ExtractInts(uval); - } - return {c->GetU32()}; -} - -std::vector GetWordsFromScalarFloatConstant( - const analysis::FloatConstant* c) { - assert(c != nullptr); - uint32_t width = c->type()->AsFloat()->width(); - assert(width == 32 || width == 64); - if (width == 64) { - utils::FloatProxy result(c->GetDouble()); - return result.GetWords(); - } - utils::FloatProxy result(c->GetFloat()); - return result.GetWords(); -} - -std::vector GetWordsFromNumericScalarOrVectorConstant( - analysis::ConstantManager* const_mgr, const analysis::Constant* c) { - if (const auto* float_constant = c->AsFloatConstant()) { - return GetWordsFromScalarFloatConstant(float_constant); - } else if (const auto* int_constant = c->AsIntConstant()) { - return GetWordsFromScalarIntConstant(int_constant); - } else if (const auto* vec_constant = c->AsVectorConstant()) { - std::vector words; - for (const auto* comp : vec_constant->GetComponents()) { - auto comp_in_words = - GetWordsFromNumericScalarOrVectorConstant(const_mgr, comp); - words.insert(words.end(), comp_in_words.begin(), comp_in_words.end()); - } - return words; - } - return {}; -} - -const analysis::Constant* ConvertWordsToNumericScalarOrVectorConstant( - analysis::ConstantManager* const_mgr, const std::vector& words, - const analysis::Type* type) { - if (type->AsInteger() || type->AsFloat()) - return const_mgr->GetConstant(type, words); - if (const auto* vec_type = type->AsVector()) - return const_mgr->GetNumericVectorConstantWithWords(vec_type, words); - return nullptr; -} - // Returns the negation of |c|. |c| must be a 32 or 64 bit floating point // constant. uint32_t NegateFloatingPointConstant(analysis::ConstantManager* const_mgr, @@ -206,6 +146,13 @@ uint32_t NegateFloatingPointConstant(analysis::ConstantManager* const_mgr, return const_mgr->GetDefiningInstruction(negated_const)->result_id(); } +std::vector ExtractInts(uint64_t val) { + std::vector words; + words.push_back(static_cast(val)); + words.push_back(static_cast(val >> 32)); + return words; +} + // Negates the integer constant |c|. Returns the id of the defining instruction. uint32_t NegateIntegerConstant(analysis::ConstantManager* const_mgr, const analysis::Constant* c) { @@ -967,11 +914,12 @@ FoldingRule MergeDivMulArithmetic() { // Fold divides of a constant and a negation. // Cases: // (-x) / 2 = x / -2 -// 2 / (-x) = -2 / x +// 2 / (-x) = 2 / -x FoldingRule MergeDivNegateArithmetic() { return [](IRContext* context, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpFDiv || inst->opcode() == SpvOpSDiv); + assert(inst->opcode() == SpvOpFDiv || inst->opcode() == SpvOpSDiv || + inst->opcode() == SpvOpUDiv); analysis::ConstantManager* const_mgr = context->get_constant_mgr(); const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); @@ -1848,35 +1796,6 @@ FoldingRule RedundantPhi() { }; } -FoldingRule BitCastScalarOrVector() { - return [](IRContext* context, Instruction* inst, - const std::vector& constants) { - assert(inst->opcode() == SpvOpBitcast && constants.size() == 1); - if (constants[0] == nullptr) return false; - - const analysis::Type* type = - context->get_type_mgr()->GetType(inst->type_id()); - if (HasFloatingPoint(type) && !inst->IsFloatingPointFoldingAllowed()) - return false; - - analysis::ConstantManager* const_mgr = context->get_constant_mgr(); - std::vector words = - GetWordsFromNumericScalarOrVectorConstant(const_mgr, constants[0]); - if (words.size() == 0) return false; - - const analysis::Constant* bitcasted_constant = - ConvertWordsToNumericScalarOrVectorConstant(const_mgr, words, type); - if (!bitcasted_constant) return false; - - auto new_feeder_id = - const_mgr->GetDefiningInstruction(bitcasted_constant, inst->type_id()) - ->result_id(); - inst->SetOpcode(SpvOpCopyObject); - inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {new_feeder_id}}}); - return true; - }; -} - FoldingRule RedundantSelect() { // An OpSelect instruction where both values are the same or the condition is // constant can be replaced by one of the values @@ -2504,8 +2423,6 @@ void FoldingRules::AddFoldingRules() { // Note that the order in which rules are added to the list matters. If a rule // applies to the instruction, the rest of the rules will not be attempted. // Take that into consideration. - rules_[SpvOpBitcast].push_back(BitCastScalarOrVector()); - rules_[SpvOpCompositeConstruct].push_back(CompositeExtractFeedingConstruct); rules_[SpvOpCompositeExtract].push_back(InsertFeedingExtract()); @@ -2571,6 +2488,8 @@ void FoldingRules::AddFoldingRules() { rules_[SpvOpStore].push_back(StoringUndef()); + rules_[SpvOpUDiv].push_back(MergeDivNegateArithmetic()); + rules_[SpvOpVectorShuffle].push_back(VectorShuffleFeedingShuffle()); rules_[SpvOpImageSampleImplicitLod].push_back(UpdateImageOperands()); diff --git a/source/opt/graphics_robust_access_pass.cpp b/source/opt/graphics_robust_access_pass.cpp index 1b28f9b5..46483e48 100644 --- a/source/opt/graphics_robust_access_pass.cpp +++ b/source/opt/graphics_robust_access_pass.cpp @@ -272,11 +272,10 @@ void GraphicsRobustAccessPass::ClampIndicesForAccessChain( // Replaces one of the OpAccessChain index operands with a new value. // Updates def-use analysis. - auto replace_index = [this, &inst, def_use_mgr](uint32_t operand_index, - Instruction* new_value) { + auto replace_index = [&inst, def_use_mgr](uint32_t operand_index, + Instruction* new_value) { inst.SetOperand(operand_index, {new_value->result_id()}); def_use_mgr->AnalyzeInstUse(&inst); - module_status_.modified = true; return SPV_SUCCESS; }; diff --git a/source/opt/inline_pass.cpp b/source/opt/inline_pass.cpp index a6bdaaff..8159ebf7 100644 --- a/source/opt/inline_pass.cpp +++ b/source/opt/inline_pass.cpp @@ -158,8 +158,8 @@ bool InlinePass::CloneAndMapLocals( auto callee_block_itr = calleeFn->begin(); auto callee_var_itr = callee_block_itr->begin(); while (callee_var_itr->opcode() == SpvOp::SpvOpVariable || - callee_var_itr->GetCommonDebugOpcode() == - CommonDebugInfoDebugDeclare) { + callee_var_itr->GetOpenCL100DebugOpcode() == + OpenCLDebugInfo100DebugDeclare) { if (callee_var_itr->opcode() != SpvOp::SpvOpVariable) { ++callee_var_itr; continue; @@ -300,7 +300,8 @@ InstructionList::iterator InlinePass::AddStoresForVariableInitializers( UptrVectorIterator callee_first_block_itr) { auto callee_itr = callee_first_block_itr->begin(); while (callee_itr->opcode() == SpvOp::SpvOpVariable || - callee_itr->GetCommonDebugOpcode() == CommonDebugInfoDebugDeclare) { + callee_itr->GetOpenCL100DebugOpcode() == + OpenCLDebugInfo100DebugDeclare) { if (callee_itr->opcode() == SpvOp::SpvOpVariable && callee_itr->NumInOperands() == 2) { assert(callee2caller.count(callee_itr->result_id()) && @@ -314,7 +315,8 @@ InstructionList::iterator InlinePass::AddStoresForVariableInitializers( context()->get_debug_info_mgr()->BuildDebugScope( callee_itr->GetDebugScope(), inlined_at_ctx)); } - if (callee_itr->GetCommonDebugOpcode() == CommonDebugInfoDebugDeclare) { + if (callee_itr->GetOpenCL100DebugOpcode() == + OpenCLDebugInfo100DebugDeclare) { InlineSingleInstruction( callee2caller, new_blk_ptr->get(), &*callee_itr, context()->get_debug_info_mgr()->BuildDebugInlinedAtChain( @@ -403,14 +405,6 @@ bool InlinePass::InlineEntryBlock( callee2caller, inlined_at_ctx, new_blk_ptr, callee_first_block); while (callee_inst_itr != callee_first_block->end()) { - // Don't inline function definition links, the calling function is not a - // definition. - if (callee_inst_itr->GetVulkan100DebugOpcode() == - NonSemanticVulkanDebugInfo100DebugFunctionDefinition) { - ++callee_inst_itr; - continue; - } - if (!InlineSingleInstruction( callee2caller, new_blk_ptr->get(), &*callee_inst_itr, context()->get_debug_info_mgr()->BuildDebugInlinedAtChain( diff --git a/source/opt/instruction.cpp b/source/opt/instruction.cpp index 577c0a67..1054a203 100644 --- a/source/opt/instruction.cpp +++ b/source/opt/instruction.cpp @@ -16,7 +16,6 @@ #include -#include "NonSemanticVulkanDebugInfo100.h" #include "OpenCLDebugInfo100.h" #include "source/disassemble.h" #include "source/opt/fold.h" @@ -33,8 +32,7 @@ const uint32_t kLoadBaseIndex = 0; const uint32_t kPointerTypeStorageClassIndex = 0; const uint32_t kTypeImageSampledIndex = 5; -// Constants for OpenCL.DebugInfo.100 / NonSemantic.Vulkan.DebugInfo.100 -// extension instructions. +// Constants for OpenCL.DebugInfo.100 extension instructions. const uint32_t kExtInstSetIdInIdx = 0; const uint32_t kExtInstInstructionInIdx = 1; const uint32_t kDebugScopeNumWords = 7; @@ -66,8 +64,7 @@ Instruction::Instruction(IRContext* c, SpvOp op) Instruction::Instruction(IRContext* c, const spv_parsed_instruction_t& inst, std::vector&& dbg_line) - : utils::IntrusiveNodeBase(), - context_(c), + : context_(c), opcode_(static_cast(inst.opcode)), has_type_id_(inst.type_id != 0), has_result_id_(inst.result_id != 0), @@ -87,8 +84,7 @@ Instruction::Instruction(IRContext* c, const spv_parsed_instruction_t& inst, Instruction::Instruction(IRContext* c, const spv_parsed_instruction_t& inst, const DebugScope& dbg_scope) - : utils::IntrusiveNodeBase(), - context_(c), + : context_(c), opcode_(static_cast(inst.opcode)), has_type_id_(inst.type_id != 0), has_result_id_(inst.result_id != 0), @@ -126,7 +122,6 @@ Instruction::Instruction(IRContext* c, SpvOp op, uint32_t ty_id, Instruction::Instruction(Instruction&& that) : utils::IntrusiveNodeBase(), - context_(that.context_), opcode_(that.opcode_), has_type_id_(that.has_type_id_), has_result_id_(that.has_result_id_), @@ -140,7 +135,6 @@ Instruction::Instruction(Instruction&& that) } Instruction& Instruction::operator=(Instruction&& that) { - context_ = that.context_; opcode_ = that.opcode_; has_type_id_ = that.has_type_id_; has_result_id_ = that.has_result_id_; @@ -624,49 +618,6 @@ OpenCLDebugInfo100Instructions Instruction::GetOpenCL100DebugOpcode() const { GetSingleWordInOperand(kExtInstInstructionInIdx)); } -NonSemanticVulkanDebugInfo100Instructions Instruction::GetVulkan100DebugOpcode() - const { - if (opcode() != SpvOpExtInst) { - return NonSemanticVulkanDebugInfo100InstructionsMax; - } - - if (!context()->get_feature_mgr()->GetExtInstImportId_Vulkan100DebugInfo()) { - return NonSemanticVulkanDebugInfo100InstructionsMax; - } - - if (GetSingleWordInOperand(kExtInstSetIdInIdx) != - context()->get_feature_mgr()->GetExtInstImportId_Vulkan100DebugInfo()) { - return NonSemanticVulkanDebugInfo100InstructionsMax; - } - - return NonSemanticVulkanDebugInfo100Instructions( - GetSingleWordInOperand(kExtInstInstructionInIdx)); -} - -CommonDebugInfoInstructions Instruction::GetCommonDebugOpcode() const { - if (opcode() != SpvOpExtInst) { - return CommonDebugInfoInstructionsMax; - } - - const uint32_t opencl_set_id = - context()->get_feature_mgr()->GetExtInstImportId_OpenCL100DebugInfo(); - const uint32_t vulkan_set_id = - context()->get_feature_mgr()->GetExtInstImportId_Vulkan100DebugInfo(); - - if (!opencl_set_id && !vulkan_set_id) { - return CommonDebugInfoInstructionsMax; - } - - const uint32_t used_set_id = GetSingleWordInOperand(kExtInstSetIdInIdx); - - if (used_set_id != opencl_set_id && used_set_id != vulkan_set_id) { - return CommonDebugInfoInstructionsMax; - } - - return CommonDebugInfoInstructions( - GetSingleWordInOperand(kExtInstInstructionInIdx)); -} - bool Instruction::IsValidBaseImage() const { uint32_t tid = type_id(); if (tid == 0) { @@ -989,10 +940,10 @@ void DebugScope::ToBinary(uint32_t type_id, uint32_t result_id, uint32_t ext_set, std::vector* binary) const { uint32_t num_words = kDebugScopeNumWords; - CommonDebugInfoInstructions dbg_opcode = CommonDebugInfoDebugScope; + OpenCLDebugInfo100Instructions dbg_opcode = OpenCLDebugInfo100DebugScope; if (GetLexicalScope() == kNoDebugScope) { num_words = kDebugNoScopeNumWords; - dbg_opcode = CommonDebugInfoDebugNoScope; + dbg_opcode = OpenCLDebugInfo100DebugNoScope; } else if (GetInlinedAt() == kNoInlinedAt) { num_words = kDebugScopeNumWordsWithoutInlinedAt; } diff --git a/source/opt/instruction.h b/source/opt/instruction.h index 7cdfc44d..3e557dd7 100644 --- a/source/opt/instruction.h +++ b/source/opt/instruction.h @@ -22,9 +22,7 @@ #include #include -#include "NonSemanticVulkanDebugInfo100.h" #include "OpenCLDebugInfo100.h" -#include "source/common_debug_info.h" #include "source/latest_version_glsl_std_450_header.h" #include "source/latest_version_spirv_header.h" #include "source/opcode.h" @@ -552,28 +550,10 @@ class Instruction : public utils::IntrusiveNodeBase { // OpenCLDebugInfo100InstructionsMax. OpenCLDebugInfo100Instructions GetOpenCL100DebugOpcode() const; - // Returns debug opcode of a NonSemantic.Vulkan.DebugInfo.100 instruction. If - // it is not a NonSemantic.Vulkan.DebugInfo.100 instruction, just returns - // NonSemanticVulkanDebugInfo100InstructionsMax. - NonSemanticVulkanDebugInfo100Instructions GetVulkan100DebugOpcode() const; - - // Returns debug opcode of an OpenCL.100.DebugInfo or - // NonSemantic.Vulkan.DebugInfo.100 instruction. Since these overlap, we - // return the OpenCLDebugInfo code - CommonDebugInfoInstructions GetCommonDebugOpcode() const; - // Returns true if it is an OpenCL.DebugInfo.100 instruction. bool IsOpenCL100DebugInstr() const { return GetOpenCL100DebugOpcode() != OpenCLDebugInfo100InstructionsMax; } - // Returns true if it is a NonSemantic.Vulkan.DebugInfo.100 instruction. - bool IsVulkan100DebugInstr() const { - return GetVulkan100DebugOpcode() != - NonSemanticVulkanDebugInfo100InstructionsMax; - } - bool IsCommonDebugInstr() const { - return GetCommonDebugOpcode() != CommonDebugInfoInstructionsMax; - } // Returns true if this instructions a non-semantic instruction. bool IsNonSemanticInstruction() const; diff --git a/source/opt/interface_var_sroa.cpp b/source/opt/interface_var_sroa.cpp deleted file mode 100644 index 58ed897c..00000000 --- a/source/opt/interface_var_sroa.cpp +++ /dev/null @@ -1,964 +0,0 @@ -// Copyright (c) 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/opt/interface_var_sroa.h" - -#include - -#include "source/opt/decoration_manager.h" -#include "source/opt/def_use_manager.h" -#include "source/opt/function.h" -#include "source/opt/log.h" -#include "source/opt/type_manager.h" -#include "source/util/make_unique.h" - -const static uint32_t kOpDecorateDecorationInOperandIndex = 1; -const static uint32_t kOpDecorateLiteralInOperandIndex = 2; -const static uint32_t kOpEntryPointInOperandInterface = 3; -const static uint32_t kOpVariableStorageClassInOperandIndex = 0; -const static uint32_t kOpTypeArrayElemTypeInOperandIndex = 0; -const static uint32_t kOpTypeArrayLengthInOperandIndex = 1; -const static uint32_t kOpTypeMatrixColCountInOperandIndex = 1; -const static uint32_t kOpTypeMatrixColTypeInOperandIndex = 0; -const static uint32_t kOpTypePtrTypeInOperandIndex = 1; -const static uint32_t kOpConstantValueInOperandIndex = 0; - -namespace spvtools { -namespace opt { -namespace { - -// Get the length of the OpTypeArray |array_type|. -uint32_t GetArrayLength(analysis::DefUseManager* def_use_mgr, - Instruction* array_type) { - assert(array_type->opcode() == SpvOpTypeArray); - uint32_t const_int_id = - array_type->GetSingleWordInOperand(kOpTypeArrayLengthInOperandIndex); - Instruction* array_length_inst = def_use_mgr->GetDef(const_int_id); - assert(array_length_inst->opcode() == SpvOpConstant); - return array_length_inst->GetSingleWordInOperand( - kOpConstantValueInOperandIndex); -} - -// Get the element type instruction of the OpTypeArray |array_type|. -Instruction* GetArrayElementType(analysis::DefUseManager* def_use_mgr, - Instruction* array_type) { - assert(array_type->opcode() == SpvOpTypeArray); - uint32_t elem_type_id = - array_type->GetSingleWordInOperand(kOpTypeArrayElemTypeInOperandIndex); - return def_use_mgr->GetDef(elem_type_id); -} - -// Get the column type instruction of the OpTypeMatrix |matrix_type|. -Instruction* GetMatrixColumnType(analysis::DefUseManager* def_use_mgr, - Instruction* matrix_type) { - assert(matrix_type->opcode() == SpvOpTypeMatrix); - uint32_t column_type_id = - matrix_type->GetSingleWordInOperand(kOpTypeMatrixColTypeInOperandIndex); - return def_use_mgr->GetDef(column_type_id); -} - -// Traverses the component type of OpTypeArray or OpTypeMatrix. Repeats it -// |depth_to_component| times recursively and returns the component type. -// |type_id| is the result id of the OpTypeArray or OpTypeMatrix instruction. -uint32_t GetComponentTypeOfArrayMatrix(analysis::DefUseManager* def_use_mgr, - uint32_t type_id, - uint32_t depth_to_component) { - if (depth_to_component == 0) return type_id; - - Instruction* type_inst = def_use_mgr->GetDef(type_id); - if (type_inst->opcode() == SpvOpTypeArray) { - uint32_t elem_type_id = - type_inst->GetSingleWordInOperand(kOpTypeArrayElemTypeInOperandIndex); - return GetComponentTypeOfArrayMatrix(def_use_mgr, elem_type_id, - depth_to_component - 1); - } - - assert(type_inst->opcode() == SpvOpTypeMatrix); - uint32_t column_type_id = - type_inst->GetSingleWordInOperand(kOpTypeMatrixColTypeInOperandIndex); - return GetComponentTypeOfArrayMatrix(def_use_mgr, column_type_id, - depth_to_component - 1); -} - -// Creates an OpDecorate instruction whose Target is |var_id| and Decoration is -// |decoration|. Adds |literal| as an extra operand of the instruction. -void CreateDecoration(analysis::DecorationManager* decoration_mgr, - uint32_t var_id, SpvDecoration decoration, - uint32_t literal) { - std::vector operands({ - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {var_id}}, - {spv_operand_type_t::SPV_OPERAND_TYPE_DECORATION, - {static_cast(decoration)}}, - {spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, {literal}}, - }); - decoration_mgr->AddDecoration(SpvOpDecorate, std::move(operands)); -} - -// Replaces load instructions with composite construct instructions in all the -// users of the loads. |loads_to_composites| is the mapping from each load to -// its corresponding OpCompositeConstruct. -void ReplaceLoadWithCompositeConstruct( - IRContext* context, - const std::unordered_map& loads_to_composites) { - for (const auto& load_and_composite : loads_to_composites) { - Instruction* load = load_and_composite.first; - Instruction* composite_construct = load_and_composite.second; - - std::vector users; - context->get_def_use_mgr()->ForEachUse( - load, [&users, composite_construct](Instruction* user, uint32_t index) { - user->GetOperand(index).words[0] = composite_construct->result_id(); - users.push_back(user); - }); - - for (Instruction* user : users) - context->get_def_use_mgr()->AnalyzeInstUse(user); - } -} - -// Returns the storage class of the instruction |var|. -SpvStorageClass GetStorageClass(Instruction* var) { - return static_cast( - var->GetSingleWordInOperand(kOpVariableStorageClassInOperandIndex)); -} - -} // namespace - -bool InterfaceVariableScalarReplacement::HasExtraArrayness( - Instruction& entry_point, Instruction* var) { - SpvExecutionModel execution_model = - static_cast(entry_point.GetSingleWordInOperand(0)); - if (execution_model != SpvExecutionModelTessellationEvaluation && - execution_model != SpvExecutionModelTessellationControl) { - return false; - } - if (!context()->get_decoration_mgr()->HasDecoration(var->result_id(), - SpvDecorationPatch)) { - if (execution_model == SpvExecutionModelTessellationControl) return true; - return GetStorageClass(var) != SpvStorageClassOutput; - } - return false; -} - -bool InterfaceVariableScalarReplacement:: - CheckExtraArraynessConflictBetweenEntries(Instruction* interface_var, - bool has_extra_arrayness) { - if (has_extra_arrayness) { - return !ReportErrorIfHasNoExtraArraynessForOtherEntry(interface_var); - } - return !ReportErrorIfHasExtraArraynessForOtherEntry(interface_var); -} - -bool InterfaceVariableScalarReplacement::GetVariableLocation( - Instruction* var, uint32_t* location) { - return !context()->get_decoration_mgr()->WhileEachDecoration( - var->result_id(), SpvDecorationLocation, - [location](const Instruction& inst) { - *location = - inst.GetSingleWordInOperand(kOpDecorateLiteralInOperandIndex); - return false; - }); -} - -bool InterfaceVariableScalarReplacement::GetVariableComponent( - Instruction* var, uint32_t* component) { - return !context()->get_decoration_mgr()->WhileEachDecoration( - var->result_id(), SpvDecorationComponent, - [component](const Instruction& inst) { - *component = - inst.GetSingleWordInOperand(kOpDecorateLiteralInOperandIndex); - return false; - }); -} - -std::vector -InterfaceVariableScalarReplacement::CollectInterfaceVariables( - Instruction& entry_point) { - std::vector interface_vars; - for (uint32_t i = kOpEntryPointInOperandInterface; - i < entry_point.NumInOperands(); ++i) { - Instruction* interface_var = context()->get_def_use_mgr()->GetDef( - entry_point.GetSingleWordInOperand(i)); - assert(interface_var->opcode() == SpvOpVariable); - - SpvStorageClass storage_class = GetStorageClass(interface_var); - if (storage_class != SpvStorageClassInput && - storage_class != SpvStorageClassOutput) { - continue; - } - - interface_vars.push_back(interface_var); - } - return interface_vars; -} - -void InterfaceVariableScalarReplacement::KillInstructionAndUsers( - Instruction* inst) { - if (inst->opcode() == SpvOpEntryPoint) { - return; - } - if (inst->opcode() != SpvOpAccessChain) { - context()->KillInst(inst); - return; - } - context()->get_def_use_mgr()->ForEachUser( - inst, [this](Instruction* user) { KillInstructionAndUsers(user); }); - context()->KillInst(inst); -} - -void InterfaceVariableScalarReplacement::KillInstructionsAndUsers( - const std::vector& insts) { - for (Instruction* inst : insts) { - KillInstructionAndUsers(inst); - } -} - -void InterfaceVariableScalarReplacement::KillLocationAndComponentDecorations( - uint32_t var_id) { - context()->get_decoration_mgr()->RemoveDecorationsFrom( - var_id, [](const Instruction& inst) { - uint32_t decoration = - inst.GetSingleWordInOperand(kOpDecorateDecorationInOperandIndex); - return decoration == SpvDecorationLocation || - decoration == SpvDecorationComponent; - }); -} - -bool InterfaceVariableScalarReplacement::ReplaceInterfaceVariableWithScalars( - Instruction* interface_var, Instruction* interface_var_type, - uint32_t location, uint32_t component, uint32_t extra_array_length) { - NestedCompositeComponents scalar_interface_vars = - CreateScalarInterfaceVarsForReplacement(interface_var_type, - GetStorageClass(interface_var), - extra_array_length); - - AddLocationAndComponentDecorations(scalar_interface_vars, &location, - component); - KillLocationAndComponentDecorations(interface_var->result_id()); - - if (!ReplaceInterfaceVarWith(interface_var, extra_array_length, - scalar_interface_vars)) { - return false; - } - - context()->KillInst(interface_var); - return true; -} - -bool InterfaceVariableScalarReplacement::ReplaceInterfaceVarWith( - Instruction* interface_var, uint32_t extra_array_length, - const NestedCompositeComponents& scalar_interface_vars) { - std::vector users; - context()->get_def_use_mgr()->ForEachUser( - interface_var, [&users](Instruction* user) { users.push_back(user); }); - - std::vector interface_var_component_indices; - std::unordered_map loads_to_composites; - std::unordered_map - loads_for_access_chain_to_composites; - if (extra_array_length != 0) { - // Note that the extra arrayness is the first dimension of the array - // interface variable. - for (uint32_t index = 0; index < extra_array_length; ++index) { - std::unordered_map loads_to_component_values; - if (!ReplaceComponentsOfInterfaceVarWith( - interface_var, users, scalar_interface_vars, - interface_var_component_indices, &index, - &loads_to_component_values, - &loads_for_access_chain_to_composites)) { - return false; - } - AddComponentsToCompositesForLoads(loads_to_component_values, - &loads_to_composites, 0); - } - } else if (!ReplaceComponentsOfInterfaceVarWith( - interface_var, users, scalar_interface_vars, - interface_var_component_indices, nullptr, &loads_to_composites, - &loads_for_access_chain_to_composites)) { - return false; - } - - ReplaceLoadWithCompositeConstruct(context(), loads_to_composites); - ReplaceLoadWithCompositeConstruct(context(), - loads_for_access_chain_to_composites); - - KillInstructionsAndUsers(users); - return true; -} - -void InterfaceVariableScalarReplacement::AddLocationAndComponentDecorations( - const NestedCompositeComponents& vars, uint32_t* location, - uint32_t component) { - if (!vars.HasMultipleComponents()) { - uint32_t var_id = vars.GetComponentVariable()->result_id(); - CreateDecoration(context()->get_decoration_mgr(), var_id, - SpvDecorationLocation, *location); - CreateDecoration(context()->get_decoration_mgr(), var_id, - SpvDecorationComponent, component); - ++(*location); - return; - } - for (const auto& var : vars.GetComponents()) { - AddLocationAndComponentDecorations(var, location, component); - } -} - -bool InterfaceVariableScalarReplacement::ReplaceComponentsOfInterfaceVarWith( - Instruction* interface_var, - const std::vector& interface_var_users, - const NestedCompositeComponents& scalar_interface_vars, - std::vector& interface_var_component_indices, - const uint32_t* extra_array_index, - std::unordered_map* loads_to_composites, - std::unordered_map* - loads_for_access_chain_to_composites) { - if (!scalar_interface_vars.HasMultipleComponents()) { - for (Instruction* interface_var_user : interface_var_users) { - if (!ReplaceComponentOfInterfaceVarWith( - interface_var, interface_var_user, - scalar_interface_vars.GetComponentVariable(), - interface_var_component_indices, extra_array_index, - loads_to_composites, loads_for_access_chain_to_composites)) { - return false; - } - } - return true; - } - return ReplaceMultipleComponentsOfInterfaceVarWith( - interface_var, interface_var_users, scalar_interface_vars.GetComponents(), - interface_var_component_indices, extra_array_index, loads_to_composites, - loads_for_access_chain_to_composites); -} - -bool InterfaceVariableScalarReplacement:: - ReplaceMultipleComponentsOfInterfaceVarWith( - Instruction* interface_var, - const std::vector& interface_var_users, - const std::vector& components, - std::vector& interface_var_component_indices, - const uint32_t* extra_array_index, - std::unordered_map* loads_to_composites, - std::unordered_map* - loads_for_access_chain_to_composites) { - for (uint32_t i = 0; i < components.size(); ++i) { - interface_var_component_indices.push_back(i); - std::unordered_map loads_to_component_values; - std::unordered_map - loads_for_access_chain_to_component_values; - if (!ReplaceComponentsOfInterfaceVarWith( - interface_var, interface_var_users, components[i], - interface_var_component_indices, extra_array_index, - &loads_to_component_values, - &loads_for_access_chain_to_component_values)) { - return false; - } - interface_var_component_indices.pop_back(); - - uint32_t depth_to_component = - static_cast(interface_var_component_indices.size()); - AddComponentsToCompositesForLoads( - loads_for_access_chain_to_component_values, - loads_for_access_chain_to_composites, depth_to_component); - if (extra_array_index) ++depth_to_component; - AddComponentsToCompositesForLoads(loads_to_component_values, - loads_to_composites, depth_to_component); - } - return true; -} - -bool InterfaceVariableScalarReplacement::ReplaceComponentOfInterfaceVarWith( - Instruction* interface_var, Instruction* interface_var_user, - Instruction* scalar_var, - const std::vector& interface_var_component_indices, - const uint32_t* extra_array_index, - std::unordered_map* loads_to_component_values, - std::unordered_map* - loads_for_access_chain_to_component_values) { - SpvOp opcode = interface_var_user->opcode(); - if (opcode == SpvOpStore) { - uint32_t value_id = interface_var_user->GetSingleWordInOperand(1); - StoreComponentOfValueToScalarVar(value_id, interface_var_component_indices, - scalar_var, extra_array_index, - interface_var_user); - return true; - } - if (opcode == SpvOpLoad) { - Instruction* scalar_load = - LoadScalarVar(scalar_var, extra_array_index, interface_var_user); - loads_to_component_values->insert({interface_var_user, scalar_load}); - return true; - } - - // Copy OpName and annotation instructions only once. Therefore, we create - // them only for the first element of the extra array. - if (extra_array_index && *extra_array_index != 0) return true; - - if (opcode == SpvOpDecorateId || opcode == SpvOpDecorateString || - opcode == SpvOpDecorate) { - CloneAnnotationForVariable(interface_var_user, scalar_var->result_id()); - return true; - } - - if (opcode == SpvOpName) { - std::unique_ptr new_inst(interface_var_user->Clone(context())); - new_inst->SetInOperand(0, {scalar_var->result_id()}); - context()->AddDebug2Inst(std::move(new_inst)); - return true; - } - - if (opcode == SpvOpEntryPoint) { - return ReplaceInterfaceVarInEntryPoint(interface_var, interface_var_user, - scalar_var->result_id()); - } - - if (opcode == SpvOpAccessChain) { - ReplaceAccessChainWith(interface_var_user, interface_var_component_indices, - scalar_var, - loads_for_access_chain_to_component_values); - return true; - } - - std::string message("Unhandled instruction"); - message += "\n " + interface_var_user->PrettyPrint( - SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES); - message += - "\nfor interface variable scalar replacement\n " + - interface_var->PrettyPrint(SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES); - context()->consumer()(SPV_MSG_ERROR, "", {0, 0, 0}, message.c_str()); - return false; -} - -void InterfaceVariableScalarReplacement::UseBaseAccessChainForAccessChain( - Instruction* access_chain, Instruction* base_access_chain) { - assert(base_access_chain->opcode() == SpvOpAccessChain && - access_chain->opcode() == SpvOpAccessChain && - access_chain->GetSingleWordInOperand(0) == - base_access_chain->result_id()); - Instruction::OperandList new_operands; - for (uint32_t i = 0; i < base_access_chain->NumInOperands(); ++i) { - new_operands.emplace_back(base_access_chain->GetInOperand(i)); - } - for (uint32_t i = 1; i < access_chain->NumInOperands(); ++i) { - new_operands.emplace_back(access_chain->GetInOperand(i)); - } - access_chain->SetInOperands(std::move(new_operands)); -} - -Instruction* InterfaceVariableScalarReplacement::CreateAccessChainToVar( - uint32_t var_type_id, Instruction* var, - const std::vector& index_ids, Instruction* insert_before, - uint32_t* component_type_id) { - analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); - *component_type_id = GetComponentTypeOfArrayMatrix( - def_use_mgr, var_type_id, static_cast(index_ids.size())); - - uint32_t ptr_type_id = - GetPointerType(*component_type_id, GetStorageClass(var)); - - std::unique_ptr new_access_chain( - new Instruction(context(), SpvOpAccessChain, ptr_type_id, TakeNextId(), - std::initializer_list{ - {SPV_OPERAND_TYPE_ID, {var->result_id()}}})); - for (uint32_t index_id : index_ids) { - new_access_chain->AddOperand({SPV_OPERAND_TYPE_ID, {index_id}}); - } - - Instruction* inst = new_access_chain.get(); - def_use_mgr->AnalyzeInstDefUse(inst); - insert_before->InsertBefore(std::move(new_access_chain)); - return inst; -} - -Instruction* InterfaceVariableScalarReplacement::CreateAccessChainWithIndex( - uint32_t component_type_id, Instruction* var, uint32_t index, - Instruction* insert_before) { - uint32_t ptr_type_id = - GetPointerType(component_type_id, GetStorageClass(var)); - uint32_t index_id = context()->get_constant_mgr()->GetUIntConst(index); - std::unique_ptr new_access_chain( - new Instruction(context(), SpvOpAccessChain, ptr_type_id, TakeNextId(), - std::initializer_list{ - {SPV_OPERAND_TYPE_ID, {var->result_id()}}, - {SPV_OPERAND_TYPE_ID, {index_id}}, - })); - Instruction* inst = new_access_chain.get(); - context()->get_def_use_mgr()->AnalyzeInstDefUse(inst); - insert_before->InsertBefore(std::move(new_access_chain)); - return inst; -} - -void InterfaceVariableScalarReplacement::ReplaceAccessChainWith( - Instruction* access_chain, - const std::vector& interface_var_component_indices, - Instruction* scalar_var, - std::unordered_map* loads_to_component_values) { - std::vector indexes; - for (uint32_t i = 1; i < access_chain->NumInOperands(); ++i) { - indexes.push_back(access_chain->GetSingleWordInOperand(i)); - } - - // Note that we have a strong assumption that |access_chain| has only a single - // index that is for the extra arrayness. - context()->get_def_use_mgr()->ForEachUser( - access_chain, - [this, access_chain, &indexes, &interface_var_component_indices, - scalar_var, loads_to_component_values](Instruction* user) { - switch (user->opcode()) { - case SpvOpAccessChain: { - UseBaseAccessChainForAccessChain(user, access_chain); - ReplaceAccessChainWith(user, interface_var_component_indices, - scalar_var, loads_to_component_values); - return; - } - case SpvOpStore: { - uint32_t value_id = user->GetSingleWordInOperand(1); - StoreComponentOfValueToAccessChainToScalarVar( - value_id, interface_var_component_indices, scalar_var, indexes, - user); - return; - } - case SpvOpLoad: { - Instruction* value = - LoadAccessChainToVar(scalar_var, indexes, user); - loads_to_component_values->insert({user, value}); - return; - } - default: - break; - } - }); -} - -void InterfaceVariableScalarReplacement::CloneAnnotationForVariable( - Instruction* annotation_inst, uint32_t var_id) { - assert(annotation_inst->opcode() == SpvOpDecorate || - annotation_inst->opcode() == SpvOpDecorateId || - annotation_inst->opcode() == SpvOpDecorateString); - std::unique_ptr new_inst(annotation_inst->Clone(context())); - new_inst->SetInOperand(0, {var_id}); - context()->AddAnnotationInst(std::move(new_inst)); -} - -bool InterfaceVariableScalarReplacement::ReplaceInterfaceVarInEntryPoint( - Instruction* interface_var, Instruction* entry_point, - uint32_t scalar_var_id) { - analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); - uint32_t interface_var_id = interface_var->result_id(); - if (interface_vars_removed_from_entry_point_operands_.find( - interface_var_id) != - interface_vars_removed_from_entry_point_operands_.end()) { - entry_point->AddOperand({SPV_OPERAND_TYPE_ID, {scalar_var_id}}); - def_use_mgr->AnalyzeInstUse(entry_point); - return true; - } - - bool success = !entry_point->WhileEachInId( - [&interface_var_id, &scalar_var_id](uint32_t* id) { - if (*id == interface_var_id) { - *id = scalar_var_id; - return false; - } - return true; - }); - if (!success) { - std::string message( - "interface variable is not an operand of the entry point"); - message += "\n " + interface_var->PrettyPrint( - SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES); - message += "\n " + entry_point->PrettyPrint( - SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES); - context()->consumer()(SPV_MSG_ERROR, "", {0, 0, 0}, message.c_str()); - return false; - } - - def_use_mgr->AnalyzeInstUse(entry_point); - interface_vars_removed_from_entry_point_operands_.insert(interface_var_id); - return true; -} - -uint32_t InterfaceVariableScalarReplacement::GetPointeeTypeIdOfVar( - Instruction* var) { - assert(var->opcode() == SpvOpVariable); - - uint32_t ptr_type_id = var->type_id(); - analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); - Instruction* ptr_type_inst = def_use_mgr->GetDef(ptr_type_id); - - assert(ptr_type_inst->opcode() == SpvOpTypePointer && - "Variable must have a pointer type."); - return ptr_type_inst->GetSingleWordInOperand(kOpTypePtrTypeInOperandIndex); -} - -void InterfaceVariableScalarReplacement::StoreComponentOfValueToScalarVar( - uint32_t value_id, const std::vector& component_indices, - Instruction* scalar_var, const uint32_t* extra_array_index, - Instruction* insert_before) { - uint32_t component_type_id = GetPointeeTypeIdOfVar(scalar_var); - Instruction* ptr = scalar_var; - if (extra_array_index) { - auto* ty_mgr = context()->get_type_mgr(); - analysis::Array* array_type = ty_mgr->GetType(component_type_id)->AsArray(); - assert(array_type != nullptr); - component_type_id = ty_mgr->GetTypeInstruction(array_type->element_type()); - ptr = CreateAccessChainWithIndex(component_type_id, scalar_var, - *extra_array_index, insert_before); - } - - StoreComponentOfValueTo(component_type_id, value_id, component_indices, ptr, - extra_array_index, insert_before); -} - -Instruction* InterfaceVariableScalarReplacement::LoadScalarVar( - Instruction* scalar_var, const uint32_t* extra_array_index, - Instruction* insert_before) { - uint32_t component_type_id = GetPointeeTypeIdOfVar(scalar_var); - Instruction* ptr = scalar_var; - if (extra_array_index) { - auto* ty_mgr = context()->get_type_mgr(); - analysis::Array* array_type = ty_mgr->GetType(component_type_id)->AsArray(); - assert(array_type != nullptr); - component_type_id = ty_mgr->GetTypeInstruction(array_type->element_type()); - ptr = CreateAccessChainWithIndex(component_type_id, scalar_var, - *extra_array_index, insert_before); - } - - return CreateLoad(component_type_id, ptr, insert_before); -} - -Instruction* InterfaceVariableScalarReplacement::CreateLoad( - uint32_t type_id, Instruction* ptr, Instruction* insert_before) { - std::unique_ptr load( - new Instruction(context(), SpvOpLoad, type_id, TakeNextId(), - std::initializer_list{ - {SPV_OPERAND_TYPE_ID, {ptr->result_id()}}})); - Instruction* load_inst = load.get(); - context()->get_def_use_mgr()->AnalyzeInstDefUse(load_inst); - insert_before->InsertBefore(std::move(load)); - return load_inst; -} - -void InterfaceVariableScalarReplacement::StoreComponentOfValueTo( - uint32_t component_type_id, uint32_t value_id, - const std::vector& component_indices, Instruction* ptr, - const uint32_t* extra_array_index, Instruction* insert_before) { - std::unique_ptr composite_extract(CreateCompositeExtract( - component_type_id, value_id, component_indices, extra_array_index)); - - std::unique_ptr new_store( - new Instruction(context(), SpvOpStore)); - new_store->AddOperand({SPV_OPERAND_TYPE_ID, {ptr->result_id()}}); - new_store->AddOperand( - {SPV_OPERAND_TYPE_ID, {composite_extract->result_id()}}); - - analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); - def_use_mgr->AnalyzeInstDefUse(composite_extract.get()); - def_use_mgr->AnalyzeInstDefUse(new_store.get()); - - insert_before->InsertBefore(std::move(composite_extract)); - insert_before->InsertBefore(std::move(new_store)); -} - -Instruction* InterfaceVariableScalarReplacement::CreateCompositeExtract( - uint32_t type_id, uint32_t composite_id, - const std::vector& indexes, const uint32_t* extra_first_index) { - uint32_t component_id = TakeNextId(); - Instruction* composite_extract = new Instruction( - context(), SpvOpCompositeExtract, type_id, component_id, - std::initializer_list{{SPV_OPERAND_TYPE_ID, {composite_id}}}); - if (extra_first_index) { - composite_extract->AddOperand( - {SPV_OPERAND_TYPE_LITERAL_INTEGER, {*extra_first_index}}); - } - for (uint32_t index : indexes) { - composite_extract->AddOperand({SPV_OPERAND_TYPE_LITERAL_INTEGER, {index}}); - } - return composite_extract; -} - -void InterfaceVariableScalarReplacement:: - StoreComponentOfValueToAccessChainToScalarVar( - uint32_t value_id, const std::vector& component_indices, - Instruction* scalar_var, - const std::vector& access_chain_indices, - Instruction* insert_before) { - uint32_t component_type_id = GetPointeeTypeIdOfVar(scalar_var); - Instruction* ptr = scalar_var; - if (!access_chain_indices.empty()) { - ptr = CreateAccessChainToVar(component_type_id, scalar_var, - access_chain_indices, insert_before, - &component_type_id); - } - - StoreComponentOfValueTo(component_type_id, value_id, component_indices, ptr, - nullptr, insert_before); -} - -Instruction* InterfaceVariableScalarReplacement::LoadAccessChainToVar( - Instruction* var, const std::vector& indexes, - Instruction* insert_before) { - uint32_t component_type_id = GetPointeeTypeIdOfVar(var); - Instruction* ptr = var; - if (!indexes.empty()) { - ptr = CreateAccessChainToVar(component_type_id, var, indexes, insert_before, - &component_type_id); - } - - return CreateLoad(component_type_id, ptr, insert_before); -} - -Instruction* -InterfaceVariableScalarReplacement::CreateCompositeConstructForComponentOfLoad( - Instruction* load, uint32_t depth_to_component) { - analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); - uint32_t type_id = load->type_id(); - if (depth_to_component != 0) { - type_id = GetComponentTypeOfArrayMatrix(def_use_mgr, load->type_id(), - depth_to_component); - } - uint32_t new_id = context()->TakeNextId(); - std::unique_ptr new_composite_construct( - new Instruction(context(), SpvOpCompositeConstruct, type_id, new_id, {})); - Instruction* composite_construct = new_composite_construct.get(); - def_use_mgr->AnalyzeInstDefUse(composite_construct); - - // Insert |new_composite_construct| after |load|. When there are multiple - // recursive composite construct instructions for a load, we have to place the - // composite construct with a lower depth later because it constructs the - // composite that contains other composites with lower depths. - auto* insert_before = load->NextNode(); - while (true) { - auto itr = - composite_ids_to_component_depths.find(insert_before->result_id()); - if (itr == composite_ids_to_component_depths.end()) break; - if (itr->second <= depth_to_component) break; - insert_before = insert_before->NextNode(); - } - insert_before->InsertBefore(std::move(new_composite_construct)); - composite_ids_to_component_depths.insert({new_id, depth_to_component}); - return composite_construct; -} - -void InterfaceVariableScalarReplacement::AddComponentsToCompositesForLoads( - const std::unordered_map& - loads_to_component_values, - std::unordered_map* loads_to_composites, - uint32_t depth_to_component) { - analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); - for (auto& load_and_component_vale : loads_to_component_values) { - Instruction* load = load_and_component_vale.first; - Instruction* component_value = load_and_component_vale.second; - Instruction* composite_construct = nullptr; - auto itr = loads_to_composites->find(load); - if (itr == loads_to_composites->end()) { - composite_construct = - CreateCompositeConstructForComponentOfLoad(load, depth_to_component); - loads_to_composites->insert({load, composite_construct}); - } else { - composite_construct = itr->second; - } - composite_construct->AddOperand( - {SPV_OPERAND_TYPE_ID, {component_value->result_id()}}); - def_use_mgr->AnalyzeInstDefUse(composite_construct); - } -} - -uint32_t InterfaceVariableScalarReplacement::GetArrayType( - uint32_t elem_type_id, uint32_t array_length) { - analysis::Type* elem_type = context()->get_type_mgr()->GetType(elem_type_id); - uint32_t array_length_id = - context()->get_constant_mgr()->GetUIntConst(array_length); - analysis::Array array_type( - elem_type, - analysis::Array::LengthInfo{array_length_id, {0, array_length}}); - return context()->get_type_mgr()->GetTypeInstruction(&array_type); -} - -uint32_t InterfaceVariableScalarReplacement::GetPointerType( - uint32_t type_id, SpvStorageClass storage_class) { - analysis::Type* type = context()->get_type_mgr()->GetType(type_id); - analysis::Pointer ptr_type(type, storage_class); - return context()->get_type_mgr()->GetTypeInstruction(&ptr_type); -} - -InterfaceVariableScalarReplacement::NestedCompositeComponents -InterfaceVariableScalarReplacement::CreateScalarInterfaceVarsForArray( - Instruction* interface_var_type, SpvStorageClass storage_class, - uint32_t extra_array_length) { - assert(interface_var_type->opcode() == SpvOpTypeArray); - - analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); - uint32_t array_length = GetArrayLength(def_use_mgr, interface_var_type); - Instruction* elem_type = GetArrayElementType(def_use_mgr, interface_var_type); - - NestedCompositeComponents scalar_vars; - while (array_length > 0) { - NestedCompositeComponents scalar_vars_for_element = - CreateScalarInterfaceVarsForReplacement(elem_type, storage_class, - extra_array_length); - scalar_vars.AddComponent(scalar_vars_for_element); - --array_length; - } - return scalar_vars; -} - -InterfaceVariableScalarReplacement::NestedCompositeComponents -InterfaceVariableScalarReplacement::CreateScalarInterfaceVarsForMatrix( - Instruction* interface_var_type, SpvStorageClass storage_class, - uint32_t extra_array_length) { - assert(interface_var_type->opcode() == SpvOpTypeMatrix); - - analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); - uint32_t column_count = interface_var_type->GetSingleWordInOperand( - kOpTypeMatrixColCountInOperandIndex); - Instruction* column_type = - GetMatrixColumnType(def_use_mgr, interface_var_type); - - NestedCompositeComponents scalar_vars; - while (column_count > 0) { - NestedCompositeComponents scalar_vars_for_column = - CreateScalarInterfaceVarsForReplacement(column_type, storage_class, - extra_array_length); - scalar_vars.AddComponent(scalar_vars_for_column); - --column_count; - } - return scalar_vars; -} - -InterfaceVariableScalarReplacement::NestedCompositeComponents -InterfaceVariableScalarReplacement::CreateScalarInterfaceVarsForReplacement( - Instruction* interface_var_type, SpvStorageClass storage_class, - uint32_t extra_array_length) { - // Handle array case. - if (interface_var_type->opcode() == SpvOpTypeArray) { - return CreateScalarInterfaceVarsForArray(interface_var_type, storage_class, - extra_array_length); - } - - // Handle matrix case. - if (interface_var_type->opcode() == SpvOpTypeMatrix) { - return CreateScalarInterfaceVarsForMatrix(interface_var_type, storage_class, - extra_array_length); - } - - // Handle scalar or vector case. - NestedCompositeComponents scalar_var; - uint32_t type_id = interface_var_type->result_id(); - if (extra_array_length != 0) { - type_id = GetArrayType(type_id, extra_array_length); - } - uint32_t ptr_type_id = - context()->get_type_mgr()->FindPointerToType(type_id, storage_class); - uint32_t id = TakeNextId(); - std::unique_ptr variable( - new Instruction(context(), SpvOpVariable, ptr_type_id, id, - std::initializer_list{ - {SPV_OPERAND_TYPE_STORAGE_CLASS, - {static_cast(storage_class)}}})); - scalar_var.SetSingleComponentVariable(variable.get()); - context()->AddGlobalValue(std::move(variable)); - return scalar_var; -} - -Instruction* InterfaceVariableScalarReplacement::GetTypeOfVariable( - Instruction* var) { - uint32_t pointee_type_id = GetPointeeTypeIdOfVar(var); - analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); - return def_use_mgr->GetDef(pointee_type_id); -} - -Pass::Status InterfaceVariableScalarReplacement::Process() { - Pass::Status status = Status::SuccessWithoutChange; - for (Instruction& entry_point : get_module()->entry_points()) { - status = - CombineStatus(status, ReplaceInterfaceVarsWithScalars(entry_point)); - } - return status; -} - -bool InterfaceVariableScalarReplacement:: - ReportErrorIfHasExtraArraynessForOtherEntry(Instruction* var) { - if (vars_with_extra_arrayness.find(var) == vars_with_extra_arrayness.end()) - return false; - - std::string message( - "A variable is arrayed for an entry point but it is not " - "arrayed for another entry point"); - message += - "\n " + var->PrettyPrint(SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES); - context()->consumer()(SPV_MSG_ERROR, "", {0, 0, 0}, message.c_str()); - return true; -} - -bool InterfaceVariableScalarReplacement:: - ReportErrorIfHasNoExtraArraynessForOtherEntry(Instruction* var) { - if (vars_without_extra_arrayness.find(var) == - vars_without_extra_arrayness.end()) - return false; - - std::string message( - "A variable is not arrayed for an entry point but it is " - "arrayed for another entry point"); - message += - "\n " + var->PrettyPrint(SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES); - context()->consumer()(SPV_MSG_ERROR, "", {0, 0, 0}, message.c_str()); - return true; -} - -Pass::Status -InterfaceVariableScalarReplacement::ReplaceInterfaceVarsWithScalars( - Instruction& entry_point) { - std::vector interface_vars = - CollectInterfaceVariables(entry_point); - - Pass::Status status = Status::SuccessWithoutChange; - for (Instruction* interface_var : interface_vars) { - uint32_t location, component; - if (!GetVariableLocation(interface_var, &location)) continue; - if (!GetVariableComponent(interface_var, &component)) component = 0; - - Instruction* interface_var_type = GetTypeOfVariable(interface_var); - uint32_t extra_array_length = 0; - if (HasExtraArrayness(entry_point, interface_var)) { - extra_array_length = - GetArrayLength(context()->get_def_use_mgr(), interface_var_type); - interface_var_type = - GetArrayElementType(context()->get_def_use_mgr(), interface_var_type); - vars_with_extra_arrayness.insert(interface_var); - } else { - vars_without_extra_arrayness.insert(interface_var); - } - - if (!CheckExtraArraynessConflictBetweenEntries(interface_var, - extra_array_length != 0)) { - return Pass::Status::Failure; - } - - if (interface_var_type->opcode() != SpvOpTypeArray && - interface_var_type->opcode() != SpvOpTypeMatrix) { - continue; - } - - if (!ReplaceInterfaceVariableWithScalars(interface_var, interface_var_type, - location, component, - extra_array_length)) { - return Pass::Status::Failure; - } - status = Pass::Status::SuccessWithChange; - } - - return status; -} - -} // namespace opt -} // namespace spvtools diff --git a/source/opt/interface_var_sroa.h b/source/opt/interface_var_sroa.h deleted file mode 100644 index 23baad0a..00000000 --- a/source/opt/interface_var_sroa.h +++ /dev/null @@ -1,401 +0,0 @@ -// Copyright (c) 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SOURCE_OPT_INTERFACE_VAR_SROA_H_ -#define SOURCE_OPT_INTERFACE_VAR_SROA_H_ - -#include - -#include "source/opt/pass.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -// -// Note that the current implementation of this pass covers only store, load, -// access chain instructions for the interface variables. Supporting other types -// of instructions is a future work. -class InterfaceVariableScalarReplacement : public Pass { - public: - InterfaceVariableScalarReplacement() {} - - const char* name() const override { - return "interface-variable-scalar-replacement"; - } - Status Process() override; - - IRContext::Analysis GetPreservedAnalyses() override { - return IRContext::kAnalysisDecorations | IRContext::kAnalysisDefUse | - IRContext::kAnalysisConstants | IRContext::kAnalysisTypes; - } - - private: - // A struct containing components of a composite variable. If the composite - // consists of multiple or recursive components, |component_variable| is - // nullptr and |nested_composite_components| keeps the components. If it has a - // single component, |nested_composite_components| is empty and - // |component_variable| is the component. Note that each element of - // |nested_composite_components| has the NestedCompositeComponents struct as - // its type that can recursively keep the components. - struct NestedCompositeComponents { - NestedCompositeComponents() : component_variable(nullptr) {} - - bool HasMultipleComponents() const { - return !nested_composite_components.empty(); - } - - const std::vector& GetComponents() const { - return nested_composite_components; - } - - void AddComponent(const NestedCompositeComponents& component) { - nested_composite_components.push_back(component); - } - - Instruction* GetComponentVariable() const { return component_variable; } - - void SetSingleComponentVariable(Instruction* var) { - component_variable = var; - } - - private: - std::vector nested_composite_components; - Instruction* component_variable; - }; - - // Collects all interface variables used by the |entry_point|. - std::vector CollectInterfaceVariables(Instruction& entry_point); - - // Returns whether |var| has the extra arrayness for the entry point - // |entry_point| or not. - bool HasExtraArrayness(Instruction& entry_point, Instruction* var); - - // Finds a Location BuiltIn decoration of |var| and returns it via - // |location|. Returns true whether the location exists or not. - bool GetVariableLocation(Instruction* var, uint32_t* location); - - // Finds a Component BuiltIn decoration of |var| and returns it via - // |component|. Returns true whether the component exists or not. - bool GetVariableComponent(Instruction* var, uint32_t* component); - - // Returns the interface variable instruction whose result id is - // |interface_var_id|. - Instruction* GetInterfaceVariable(uint32_t interface_var_id); - - // Returns the type of |var| as an instruction. - Instruction* GetTypeOfVariable(Instruction* var); - - // Replaces an interface variable |interface_var| whose type is - // |interface_var_type| with scalars and returns whether it succeeds or not. - // |location| is the value of Location Decoration for |interface_var|. - // |component| is the value of Component Decoration for |interface_var|. - // If |extra_array_length| is 0, it means |interface_var| has a Patch - // decoration. Otherwise, |extra_array_length| denotes the length of the extra - // array of |interface_var|. - bool ReplaceInterfaceVariableWithScalars(Instruction* interface_var, - Instruction* interface_var_type, - uint32_t location, - uint32_t component, - uint32_t extra_array_length); - - // Creates scalar variables with the storage classe |storage_class| to replace - // an interface variable whose type is |interface_var_type|. If - // |extra_array_length| is not zero, adds the extra arrayness to the created - // scalar variables. - NestedCompositeComponents CreateScalarInterfaceVarsForReplacement( - Instruction* interface_var_type, SpvStorageClass storage_class, - uint32_t extra_array_length); - - // Creates scalar variables with the storage classe |storage_class| to replace - // the interface variable whose type is OpTypeArray |interface_var_type| with. - // If |extra_array_length| is not zero, adds the extra arrayness to all the - // scalar variables. - NestedCompositeComponents CreateScalarInterfaceVarsForArray( - Instruction* interface_var_type, SpvStorageClass storage_class, - uint32_t extra_array_length); - - // Creates scalar variables with the storage classe |storage_class| to replace - // the interface variable whose type is OpTypeMatrix |interface_var_type| - // with. If |extra_array_length| is not zero, adds the extra arrayness to all - // the scalar variables. - NestedCompositeComponents CreateScalarInterfaceVarsForMatrix( - Instruction* interface_var_type, SpvStorageClass storage_class, - uint32_t extra_array_length); - - // Recursively adds Location and Component decorations to variables in - // |vars| with |location| and |component|. Increases |location| by one after - // it actually adds Location and Component decorations for a variable. - void AddLocationAndComponentDecorations(const NestedCompositeComponents& vars, - uint32_t* location, - uint32_t component); - - // Replaces the interface variable |interface_var| with - // |scalar_interface_vars| and returns whether it succeeds or not. - // |extra_arrayness| is the extra arrayness of the interface variable. - // |scalar_interface_vars| contains the nested variables to replace the - // interface variable with. - bool ReplaceInterfaceVarWith( - Instruction* interface_var, uint32_t extra_arrayness, - const NestedCompositeComponents& scalar_interface_vars); - - // Replaces |interface_var| in the operands of instructions - // |interface_var_users| with |scalar_interface_vars|. This is a recursive - // method and |interface_var_component_indices| is used to specify which - // recursive component of |interface_var| is replaced. Returns composite - // construct instructions to be replaced with load instructions of - // |interface_var_users| via |loads_to_composites|. Returns composite - // construct instructions to be replaced with load instructions of access - // chain instructions in |interface_var_users| via - // |loads_for_access_chain_to_composites|. - bool ReplaceComponentsOfInterfaceVarWith( - Instruction* interface_var, - const std::vector& interface_var_users, - const NestedCompositeComponents& scalar_interface_vars, - std::vector& interface_var_component_indices, - const uint32_t* extra_array_index, - std::unordered_map* loads_to_composites, - std::unordered_map* - loads_for_access_chain_to_composites); - - // Replaces |interface_var| in the operands of instructions - // |interface_var_users| with |components| that is a vector of components for - // the interface variable |interface_var|. This is a recursive method and - // |interface_var_component_indices| is used to specify which recursive - // component of |interface_var| is replaced. Returns composite construct - // instructions to be replaced with load instructions of |interface_var_users| - // via |loads_to_composites|. Returns composite construct instructions to be - // replaced with load instructions of access chain instructions in - // |interface_var_users| via |loads_for_access_chain_to_composites|. - bool ReplaceMultipleComponentsOfInterfaceVarWith( - Instruction* interface_var, - const std::vector& interface_var_users, - const std::vector& components, - std::vector& interface_var_component_indices, - const uint32_t* extra_array_index, - std::unordered_map* loads_to_composites, - std::unordered_map* - loads_for_access_chain_to_composites); - - // Replaces a component of |interface_var| that is used as an operand of - // instruction |interface_var_user| with |scalar_var|. - // |interface_var_component_indices| is a vector of recursive indices for - // which recursive component of |interface_var| is replaced. If - // |interface_var_user| is a load, returns the component value via - // |loads_to_component_values|. If |interface_var_user| is an access chain, - // returns the component value for loads of |interface_var_user| via - // |loads_for_access_chain_to_component_values|. - bool ReplaceComponentOfInterfaceVarWith( - Instruction* interface_var, Instruction* interface_var_user, - Instruction* scalar_var, - const std::vector& interface_var_component_indices, - const uint32_t* extra_array_index, - std::unordered_map* loads_to_component_values, - std::unordered_map* - loads_for_access_chain_to_component_values); - - // Creates instructions to load |scalar_var| and inserts them before - // |insert_before|. If |extra_array_index| is not null, they load - // |extra_array_index| th component of |scalar_var| instead of |scalar_var| - // itself. - Instruction* LoadScalarVar(Instruction* scalar_var, - const uint32_t* extra_array_index, - Instruction* insert_before); - - // Creates instructions to load an access chain to |var| and inserts them - // before |insert_before|. |Indexes| will be Indexes operand of the access - // chain. - Instruction* LoadAccessChainToVar(Instruction* var, - const std::vector& indexes, - Instruction* insert_before); - - // Creates instructions to store a component of an aggregate whose id is - // |value_id| to an access chain to |scalar_var| and inserts the created - // instructions before |insert_before|. To get the component, recursively - // traverses the aggregate with |component_indices| as indexes. - // Numbers in |access_chain_indices| are the Indexes operand of the access - // chain to |scalar_var| - void StoreComponentOfValueToAccessChainToScalarVar( - uint32_t value_id, const std::vector& component_indices, - Instruction* scalar_var, - const std::vector& access_chain_indices, - Instruction* insert_before); - - // Creates instructions to store a component of an aggregate whose id is - // |value_id| to |scalar_var| and inserts the created instructions before - // |insert_before|. To get the component, recursively traverses the aggregate - // using |extra_array_index| and |component_indices| as indexes. - void StoreComponentOfValueToScalarVar( - uint32_t value_id, const std::vector& component_indices, - Instruction* scalar_var, const uint32_t* extra_array_index, - Instruction* insert_before); - - // Creates instructions to store a component of an aggregate whose id is - // |value_id| to |ptr| and inserts the created instructions before - // |insert_before|. To get the component, recursively traverses the aggregate - // using |extra_array_index| and |component_indices| as indexes. - // |component_type_id| is the id of the type instruction of the component. - void StoreComponentOfValueTo(uint32_t component_type_id, uint32_t value_id, - const std::vector& component_indices, - Instruction* ptr, - const uint32_t* extra_array_index, - Instruction* insert_before); - - // Creates new OpCompositeExtract with |type_id| for Result Type, - // |composite_id| for Composite operand, and |indexes| for Indexes operands. - // If |extra_first_index| is not nullptr, uses it as the first Indexes - // operand. - Instruction* CreateCompositeExtract(uint32_t type_id, uint32_t composite_id, - const std::vector& indexes, - const uint32_t* extra_first_index); - - // Creates a new OpLoad whose Result Type is |type_id| and Pointer operand is - // |ptr|. Inserts the new instruction before |insert_before|. - Instruction* CreateLoad(uint32_t type_id, Instruction* ptr, - Instruction* insert_before); - - // Clones an annotation instruction |annotation_inst| and sets the target - // operand of the new annotation instruction as |var_id|. - void CloneAnnotationForVariable(Instruction* annotation_inst, - uint32_t var_id); - - // Replaces the interface variable |interface_var| in the operands of the - // entry point |entry_point| with |scalar_var_id|. If it cannot find - // |interface_var| from the operands of the entry point |entry_point|, adds - // |scalar_var_id| as an operand of the entry point |entry_point|. - bool ReplaceInterfaceVarInEntryPoint(Instruction* interface_var, - Instruction* entry_point, - uint32_t scalar_var_id); - - // Creates an access chain instruction whose Base operand is |var| and Indexes - // operand is |index|. |component_type_id| is the id of the type instruction - // that is the type of component. Inserts the new access chain before - // |insert_before|. - Instruction* CreateAccessChainWithIndex(uint32_t component_type_id, - Instruction* var, uint32_t index, - Instruction* insert_before); - - // Returns the pointee type of the type of variable |var|. - uint32_t GetPointeeTypeIdOfVar(Instruction* var); - - // Replaces the access chain |access_chain| and its users with a new access - // chain that points |scalar_var| as the Base operand having - // |interface_var_component_indices| as Indexes operands and users of the new - // access chain. When some of the users are load instructions, returns the - // original load instruction to the new instruction that loads a component of - // the original load value via |loads_to_component_values|. - void ReplaceAccessChainWith( - Instruction* access_chain, - const std::vector& interface_var_component_indices, - Instruction* scalar_var, - std::unordered_map* - loads_to_component_values); - - // Assuming that |access_chain| is an access chain instruction whose Base - // operand is |base_access_chain|, replaces the operands of |access_chain| - // with operands of |base_access_chain| and Indexes operands of - // |access_chain|. - void UseBaseAccessChainForAccessChain(Instruction* access_chain, - Instruction* base_access_chain); - - // Creates composite construct instructions for load instructions that are the - // keys of |loads_to_component_values| if no such composite construct - // instructions exist. Adds a component of the composite as an operand of the - // created composite construct instruction. Each value of - // |loads_to_component_values| is the component. Returns the created composite - // construct instructions using |loads_to_composites|. |depth_to_component| is - // the number of recursive access steps to get the component from the - // composite. - void AddComponentsToCompositesForLoads( - const std::unordered_map& - loads_to_component_values, - std::unordered_map* loads_to_composites, - uint32_t depth_to_component); - - // Creates a composite construct instruction for a component of the value of - // instruction |load| in |depth_to_component| th recursive depth and inserts - // it after |load|. - Instruction* CreateCompositeConstructForComponentOfLoad( - Instruction* load, uint32_t depth_to_component); - - // Creates a new access chain instruction that points to variable |var| whose - // type is the instruction with |var_type_id| and inserts it before - // |insert_before|. The new access chain will have |index_ids| for Indexes - // operands. Returns the type id of the component that is pointed by the new - // access chain via |component_type_id|. - Instruction* CreateAccessChainToVar(uint32_t var_type_id, Instruction* var, - const std::vector& index_ids, - Instruction* insert_before, - uint32_t* component_type_id); - - // Returns the result id of OpTypeArray instrunction whose Element Type - // operand is |elem_type_id| and Length operand is |array_length|. - uint32_t GetArrayType(uint32_t elem_type_id, uint32_t array_length); - - // Returns the result id of OpTypePointer instrunction whose Type - // operand is |type_id| and Storage Class operand is |storage_class|. - uint32_t GetPointerType(uint32_t type_id, SpvStorageClass storage_class); - - // Kills an instrunction |inst| and its users. - void KillInstructionAndUsers(Instruction* inst); - - // Kills a vector of instrunctions |insts| and their users. - void KillInstructionsAndUsers(const std::vector& insts); - - // Kills all OpDecorate instructions for Location and Component of the - // variable whose id is |var_id|. - void KillLocationAndComponentDecorations(uint32_t var_id); - - // If |var| has the extra arrayness for an entry point, reports an error and - // returns true. Otherwise, returns false. - bool ReportErrorIfHasExtraArraynessForOtherEntry(Instruction* var); - - // If |var| does not have the extra arrayness for an entry point, reports an - // error and returns true. Otherwise, returns false. - bool ReportErrorIfHasNoExtraArraynessForOtherEntry(Instruction* var); - - // If |interface_var| has the extra arrayness for an entry point but it does - // not have one for another entry point, reports an error and returns false. - // Otherwise, returns true. |has_extra_arrayness| denotes whether it has an - // extra arrayness for an entry point or not. - bool CheckExtraArraynessConflictBetweenEntries(Instruction* interface_var, - bool has_extra_arrayness); - - // Conducts the scalar replacement for the interface variables used by the - // |entry_point|. - Pass::Status ReplaceInterfaceVarsWithScalars(Instruction& entry_point); - - // A set of interface variable ids that were already removed from operands of - // the entry point. - std::unordered_set - interface_vars_removed_from_entry_point_operands_; - - // A mapping from ids of new composite construct instructions that load - // instructions are replaced with to the recursive depth of the component of - // load that the new component construct instruction is used for. - std::unordered_map composite_ids_to_component_depths; - - // A set of interface variables with the extra arrayness for any of the entry - // points. - std::unordered_set vars_with_extra_arrayness; - - // A set of interface variables without the extra arrayness for any of the - // entry points. - std::unordered_set vars_without_extra_arrayness; -}; - -} // namespace opt -} // namespace spvtools - -#endif // SOURCE_OPT_INTERFACE_VAR_SROA_H_ diff --git a/source/opt/ir_context.cpp b/source/opt/ir_context.cpp index 90873461..82107b5c 100644 --- a/source/opt/ir_context.cpp +++ b/source/opt/ir_context.cpp @@ -30,8 +30,7 @@ static const int kSpvDecorateBuiltinInIdx = 2; static const int kEntryPointInterfaceInIdx = 3; static const int kEntryPointFunctionIdInIdx = 1; -// Constants for OpenCL.DebugInfo.100 / NonSemantic.Vulkan.DebugInfo.100 -// extension instructions. +// Constants for OpenCL.DebugInfo.100 extension instructions. static const uint32_t kDebugFunctionOperandFunctionIndex = 13; static const uint32_t kDebugGlobalVariableOperandVariableIndex = 11; @@ -215,10 +214,10 @@ Instruction* IRContext::KillInst(Instruction* inst) { return next_instruction; } -void IRContext::CollectNonSemanticTree( - Instruction* inst, std::unordered_set* to_kill) { +void IRContext::KillNonSemanticInfo(Instruction* inst) { if (!inst->HasResultId()) return; std::vector work_list; + std::vector to_kill; std::unordered_set seen; work_list.push_back(inst); @@ -226,13 +225,17 @@ void IRContext::CollectNonSemanticTree( auto* i = work_list.back(); work_list.pop_back(); get_def_use_mgr()->ForEachUser( - i, [&work_list, to_kill, &seen](Instruction* user) { + i, [&work_list, &to_kill, &seen](Instruction* user) { if (user->IsNonSemanticInstruction() && seen.insert(user).second) { work_list.push_back(user); - to_kill->insert(user); + to_kill.push_back(user); } }); } + + for (auto* dead : to_kill) { + KillInst(dead); + } } bool IRContext::KillDef(uint32_t id) { @@ -438,7 +441,8 @@ void IRContext::KillOperandFromDebugInstructions(Instruction* inst) { if (opcode == SpvOpVariable || IsConstantInst(opcode)) { for (auto it = module()->ext_inst_debuginfo_begin(); it != module()->ext_inst_debuginfo_end(); ++it) { - if (it->GetCommonDebugOpcode() != CommonDebugInfoDebugGlobalVariable) + if (it->GetOpenCL100DebugOpcode() != + OpenCLDebugInfo100DebugGlobalVariable) continue; auto& operand = it->GetOperand(kDebugGlobalVariableOperandVariableIndex); if (operand.words[0] == id) { @@ -1034,11 +1038,5 @@ bool IRContext::CheckCFG() { return true; } - -bool IRContext::IsReachable(const opt::BasicBlock& bb) { - auto enclosing_function = bb.GetParent(); - return GetDominatorAnalysis(enclosing_function) - ->Dominates(enclosing_function->entry().get(), &bb); -} } // namespace opt } // namespace spvtools diff --git a/source/opt/ir_context.h b/source/opt/ir_context.h index 3b89d85c..5aa25acd 100644 --- a/source/opt/ir_context.h +++ b/source/opt/ir_context.h @@ -190,8 +190,8 @@ class IRContext { inline IteratorRange debugs3() const; // Iterators for debug info instructions (excluding OpLine & OpNoLine) - // contained in this module. These are OpExtInst for DebugInfo extension - // placed between section 9 and 10. + // contained in this module. These are OpExtInst for OpenCL.DebugInfo.100 + // or DebugInfo extension placed between section 9 and 10. inline Module::inst_iterator ext_inst_debuginfo_begin(); inline Module::inst_iterator ext_inst_debuginfo_end(); inline IteratorRange ext_inst_debuginfo(); @@ -403,10 +403,8 @@ class IRContext { // instruction exists. Instruction* KillInst(Instruction* inst); - // Collects the non-semantic instruction tree that uses |inst|'s result id - // to be killed later. - void CollectNonSemanticTree(Instruction* inst, - std::unordered_set* to_kill); + // Removes the non-semantic instruction tree that uses |inst|'s result id. + void KillNonSemanticInfo(Instruction* inst); // Returns true if all of the given analyses are valid. bool AreAnalysesValid(Analysis set) { return (set & valid_analyses_) == set; } @@ -598,14 +596,10 @@ class IRContext { bool ProcessCallTreeFromRoots(ProcessFunction& pfn, std::queue* roots); - // Emits a error message to the message consumer indicating the error + // Emmits a error message to the message consumer indicating the error // described by |message| occurred in |inst|. void EmitErrorMessage(std::string message, Instruction* inst); - // Returns true if and only if there is a path to |bb| from the entry block of - // the function that contains |bb|. - bool IsReachable(const opt::BasicBlock& bb); - private: // Builds the def-use manager from scratch, even if it was already valid. void BuildDefUseManager() { diff --git a/source/opt/ir_loader.cpp b/source/opt/ir_loader.cpp index bfdd59b3..e443ebb5 100644 --- a/source/opt/ir_loader.cpp +++ b/source/opt/ir_loader.cpp @@ -17,7 +17,6 @@ #include #include "DebugInfo.h" -#include "NonSemanticVulkanDebugInfo100.h" #include "OpenCLDebugInfo100.h" #include "source/ext_inst.h" #include "source/opt/log.h" @@ -54,12 +53,10 @@ bool IrLoader::AddInstruction(const spv_parsed_instruction_t* inst) { // struct DebugScope. if (opcode == SpvOpExtInst && spvExtInstIsDebugInfo(inst->ext_inst_type)) { const uint32_t ext_inst_index = inst->words[kExtInstSetIndex]; - if (inst->ext_inst_type == SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100 || - inst->ext_inst_type == - SPV_EXT_INST_TYPE_NONSEMANTIC_VULKAN_DEBUGINFO_100) { - const CommonDebugInfoInstructions ext_inst_key = - CommonDebugInfoInstructions(ext_inst_index); - if (ext_inst_key == CommonDebugInfoDebugScope) { + if (inst->ext_inst_type == SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100) { + const OpenCLDebugInfo100Instructions ext_inst_key = + OpenCLDebugInfo100Instructions(ext_inst_index); + if (ext_inst_key == OpenCLDebugInfo100DebugScope) { uint32_t inlined_at = 0; if (inst->num_words > kInlinedAtIndex) inlined_at = inst->words[kInlinedAtIndex]; @@ -68,7 +65,7 @@ bool IrLoader::AddInstruction(const spv_parsed_instruction_t* inst) { module()->SetContainsDebugInfo(); return true; } - if (ext_inst_key == CommonDebugInfoDebugNoScope) { + if (ext_inst_key == OpenCLDebugInfo100DebugNoScope) { last_dbg_scope_ = DebugScope(kNoDebugScope, kNoInlinedAt); module()->SetContainsDebugInfo(); return true; @@ -233,35 +230,6 @@ bool IrLoader::AddInstruction(const spv_parsed_instruction_t* inst) { block_->AddInstruction(std::move(spv_inst)); break; } - default: { - Errorf(consumer_, src, loc, - "Debug info extension instruction other than DebugScope, " - "DebugNoScope, DebugFunctionDefinition, DebugDeclare, and " - "DebugValue found inside function", - opcode); - return false; - } - } - } else if (inst->ext_inst_type == - SPV_EXT_INST_TYPE_NONSEMANTIC_VULKAN_DEBUGINFO_100) { - const NonSemanticVulkanDebugInfo100Instructions ext_inst_key = - NonSemanticVulkanDebugInfo100Instructions(ext_inst_index); - switch (ext_inst_key) { - case NonSemanticVulkanDebugInfo100DebugDeclare: - case NonSemanticVulkanDebugInfo100DebugValue: - case NonSemanticVulkanDebugInfo100DebugScope: - case NonSemanticVulkanDebugInfo100DebugNoScope: - case NonSemanticVulkanDebugInfo100DebugFunctionDefinition: { - if (block_ == nullptr) { // Inside function but outside blocks - Errorf(consumer_, src, loc, - "Debug info extension instruction found inside function " - "but outside block", - opcode); - } else { - block_->AddInstruction(std::move(spv_inst)); - } - break; - } default: { Errorf(consumer_, src, loc, "Debug info extension instruction other than DebugScope, " diff --git a/source/opt/local_access_chain_convert_pass.cpp b/source/opt/local_access_chain_convert_pass.cpp index e8dbdfc4..205cd7a3 100644 --- a/source/opt/local_access_chain_convert_pass.cpp +++ b/source/opt/local_access_chain_convert_pass.cpp @@ -184,8 +184,8 @@ bool LocalAccessChainConvertPass::IsConstantIndexAccessChain( bool LocalAccessChainConvertPass::HasOnlySupportedRefs(uint32_t ptrId) { if (supported_ref_ptrs_.find(ptrId) != supported_ref_ptrs_.end()) return true; if (get_def_use_mgr()->WhileEachUser(ptrId, [this](Instruction* user) { - if (user->GetCommonDebugOpcode() == CommonDebugInfoDebugValue || - user->GetCommonDebugOpcode() == CommonDebugInfoDebugDeclare) { + if (user->GetOpenCL100DebugOpcode() == OpenCLDebugInfo100DebugValue || + user->GetOpenCL100DebugOpcode() == OpenCLDebugInfo100DebugDeclare) { return true; } SpvOp op = user->opcode(); @@ -418,9 +418,6 @@ void LocalAccessChainConvertPass::InitExtensions() { "SPV_KHR_ray_query", "SPV_EXT_fragment_invocation_density", "SPV_KHR_terminate_invocation", - "SPV_KHR_subgroup_uniform_control_flow", - "SPV_KHR_integer_dot_product", - "SPV_EXT_shader_image_int64", }); } diff --git a/source/opt/local_single_block_elim_pass.cpp b/source/opt/local_single_block_elim_pass.cpp index a742e3b1..5f35ee1a 100644 --- a/source/opt/local_single_block_elim_pass.cpp +++ b/source/opt/local_single_block_elim_pass.cpp @@ -31,9 +31,9 @@ const uint32_t kStoreValIdInIdx = 1; bool LocalSingleBlockLoadStoreElimPass::HasOnlySupportedRefs(uint32_t ptrId) { if (supported_ref_ptrs_.find(ptrId) != supported_ref_ptrs_.end()) return true; if (get_def_use_mgr()->WhileEachUser(ptrId, [this](Instruction* user) { - auto dbg_op = user->GetCommonDebugOpcode(); - if (dbg_op == CommonDebugInfoDebugDeclare || - dbg_op == CommonDebugInfoDebugValue) { + auto dbg_op = user->GetOpenCL100DebugOpcode(); + if (dbg_op == OpenCLDebugInfo100DebugDeclare || + dbg_op == OpenCLDebugInfo100DebugValue) { return true; } SpvOp op = user->opcode(); @@ -270,9 +270,6 @@ void LocalSingleBlockLoadStoreElimPass::InitExtensions() { "SPV_EXT_fragment_invocation_density", "SPV_EXT_physical_storage_buffer", "SPV_KHR_terminate_invocation", - "SPV_KHR_subgroup_uniform_control_flow", - "SPV_KHR_integer_dot_product", - "SPV_EXT_shader_image_int64", }); } diff --git a/source/opt/local_single_store_elim_pass.cpp b/source/opt/local_single_store_elim_pass.cpp index 9701d10e..d322a2fb 100644 --- a/source/opt/local_single_store_elim_pass.cpp +++ b/source/opt/local_single_store_elim_pass.cpp @@ -123,9 +123,6 @@ void LocalSingleStoreElimPass::InitExtensionAllowList() { "SPV_EXT_fragment_invocation_density", "SPV_EXT_physical_storage_buffer", "SPV_KHR_terminate_invocation", - "SPV_KHR_subgroup_uniform_control_flow", - "SPV_KHR_integer_dot_product", - "SPV_EXT_shader_image_int64", }); } bool LocalSingleStoreElimPass::ProcessVariable(Instruction* var_inst) { @@ -224,9 +221,9 @@ Instruction* LocalSingleStoreElimPass::FindSingleStoreAndCheckUses( case SpvOpCopyObject: break; case SpvOpExtInst: { - auto dbg_op = user->GetCommonDebugOpcode(); - if (dbg_op == CommonDebugInfoDebugDeclare || - dbg_op == CommonDebugInfoDebugValue) { + auto dbg_op = user->GetOpenCL100DebugOpcode(); + if (dbg_op == OpenCLDebugInfo100DebugDeclare || + dbg_op == OpenCLDebugInfo100DebugValue) { break; } return nullptr; @@ -293,9 +290,9 @@ bool LocalSingleStoreElimPass::RewriteLoads( bool modified = false; for (Instruction* use : uses) { if (use->opcode() == SpvOpStore) continue; - auto dbg_op = use->GetCommonDebugOpcode(); - if (dbg_op == CommonDebugInfoDebugDeclare || - dbg_op == CommonDebugInfoDebugValue) + auto dbg_op = use->GetOpenCL100DebugOpcode(); + if (dbg_op == OpenCLDebugInfo100DebugDeclare || + dbg_op == OpenCLDebugInfo100DebugValue) continue; if (use->opcode() == SpvOpLoad && dominator_analysis->Dominates(store_inst, use)) { diff --git a/source/opt/loop_unroller.cpp b/source/opt/loop_unroller.cpp index df68bd20..6cdced46 100644 --- a/source/opt/loop_unroller.cpp +++ b/source/opt/loop_unroller.cpp @@ -797,9 +797,6 @@ void LoopUnrollerUtilsImpl::CloseUnrolledLoop(Loop* loop) { for (BasicBlock* block : loop_blocks_inorder_) { RemapOperands(block); } - for (auto& block_itr : blocks_to_add_) { - RemapOperands(block_itr.get()); - } // Rewrite the last phis, since they may still reference the original phi. for (Instruction* last_phi : state_.previous_phis_) { diff --git a/source/opt/mem_pass.cpp b/source/opt/mem_pass.cpp index 72442a99..57387984 100644 --- a/source/opt/mem_pass.cpp +++ b/source/opt/mem_pass.cpp @@ -20,6 +20,7 @@ #include #include +#include "OpenCLDebugInfo100.h" #include "source/cfa.h" #include "source/opt/basic_block.h" #include "source/opt/dominator_analysis.h" @@ -225,9 +226,9 @@ MemPass::MemPass() {} bool MemPass::HasOnlySupportedRefs(uint32_t varId) { return get_def_use_mgr()->WhileEachUser(varId, [this](Instruction* user) { - auto dbg_op = user->GetCommonDebugOpcode(); - if (dbg_op == CommonDebugInfoDebugDeclare || - dbg_op == CommonDebugInfoDebugValue) { + auto dbg_op = user->GetOpenCL100DebugOpcode(); + if (dbg_op == OpenCLDebugInfo100DebugDeclare || + dbg_op == OpenCLDebugInfo100DebugValue) { return true; } SpvOp op = user->opcode(); diff --git a/source/opt/module.cpp b/source/opt/module.cpp index 6585012f..0c886010 100644 --- a/source/opt/module.cpp +++ b/source/opt/module.cpp @@ -145,10 +145,8 @@ void Module::ToBinary(std::vector* binary, bool skip_nop) const { DebugScope last_scope(kNoDebugScope, kNoInlinedAt); const Instruction* last_line_inst = nullptr; bool between_merge_and_branch = false; - bool between_label_and_phi_var = false; auto write_inst = [binary, skip_nop, &last_scope, &last_line_inst, - &between_merge_and_branch, &between_label_and_phi_var, - this](const Instruction* i) { + &between_merge_and_branch, this](const Instruction* i) { // Skip emitting line instructions between merge and branch instructions. auto opcode = i->opcode(); if (between_merge_and_branch && @@ -177,29 +175,13 @@ void Module::ToBinary(std::vector* binary, bool skip_nop) const { last_line_inst = nullptr; } } - - if (opcode == SpvOpLabel) { - between_label_and_phi_var = true; - } else if (opcode != SpvOpVariable && opcode != SpvOpPhi && - opcode != SpvOpLine && opcode != SpvOpNoLine) { - between_label_and_phi_var = false; - } - if (!(skip_nop && i->IsNop())) { const auto& scope = i->GetDebugScope(); if (scope != last_scope) { - // Can only emit nonsemantic instructions after all phi instructions - // in a block so don't emit scope instructions before phi instructions - // for Vulkan.NonSemantic.DebugInfo.100. - if (!between_label_and_phi_var || - context() - ->get_feature_mgr() - ->GetExtInstImportId_OpenCL100DebugInfo()) { - // Emit DebugScope |scope| to |binary|. - auto dbg_inst = ext_inst_debuginfo_.begin(); - scope.ToBinary(dbg_inst->type_id(), context()->TakeNextId(), - dbg_inst->GetSingleWordOperand(2), binary); - } + // Emit DebugScope |scope| to |binary|. + auto dbg_inst = ext_inst_debuginfo_.begin(); + scope.ToBinary(dbg_inst->type_id(), context()->TakeNextId(), + dbg_inst->GetSingleWordOperand(2), binary); last_scope = scope; } diff --git a/source/opt/module.h b/source/opt/module.h index 43b55ae1..d609b603 100644 --- a/source/opt/module.h +++ b/source/opt/module.h @@ -103,8 +103,8 @@ class Module { // This is due to decision by the SPIR Working Group, pending publication. inline void AddDebug3Inst(std::unique_ptr d); - // Appends a debug info extension (OpenCL.DebugInfo.100, - // NonSemantic.Vulkan.DebugInfo.100, or DebugInfo) instruction to this module. + // Appends a debug info extension (OpenCL.DebugInfo.100 or DebugInfo) + // instruction to this module. inline void AddExtInstDebugInfo(std::unique_ptr d); // Appends an annotation instruction to this module. @@ -192,8 +192,8 @@ class Module { inline IteratorRange debugs3() const; // Iterators for debug info instructions (excluding OpLine & OpNoLine) - // contained in this module. These are OpExtInst for DebugInfo extension - // placed between section 9 and 10. + // contained in this module. These are OpExtInst for OpenCL.DebugInfo.100 + // or DebugInfo extension placed between section 9 and 10. inline inst_iterator ext_inst_debuginfo_begin(); inline inst_iterator ext_inst_debuginfo_end(); inline IteratorRange ext_inst_debuginfo(); diff --git a/source/opt/optimizer.cpp b/source/opt/optimizer.cpp index 858c95ee..a5d10c3d 100644 --- a/source/opt/optimizer.cpp +++ b/source/opt/optimizer.cpp @@ -489,8 +489,6 @@ bool Optimizer::RegisterPassFromFlag(const std::string& flag) { RegisterSizePasses(); } else if (pass_name == "legalize-hlsl") { RegisterLegalizationPasses(); - } else if (pass_name == "remove-unused-interface-variables") { - RegisterPass(CreateRemoveUnusedInterfaceVariablesPass()); } else if (pass_name == "graphics-robust-access") { RegisterPass(CreateGraphicsRobustAccessPass()); } else if (pass_name == "wrap-opkill") { @@ -499,26 +497,6 @@ bool Optimizer::RegisterPassFromFlag(const std::string& flag) { RegisterPass(CreateAmdExtToKhrPass()); } else if (pass_name == "interpolate-fixup") { RegisterPass(CreateInterpolateFixupPass()); - } else if (pass_name == "convert-to-sampled-image") { - if (pass_args.size() > 0) { - auto descriptor_set_binding_pairs = - opt::ConvertToSampledImagePass::ParseDescriptorSetBindingPairsString( - pass_args.c_str()); - if (!descriptor_set_binding_pairs) { - Errorf(consumer(), nullptr, {}, - "Invalid argument for --convert-to-sampled-image: %s", - pass_args.c_str()); - return false; - } - RegisterPass(CreateConvertToSampledImagePass( - std::move(*descriptor_set_binding_pairs))); - } else { - Errorf(consumer(), nullptr, {}, - "Invalid pairs of descriptor set and binding '%s'. Expected a " - "string of : pairs.", - pass_args.c_str()); - return false; - } } else { Errorf(consumer(), nullptr, {}, "Unknown flag '--%s'. Use --help for a list of valid flags", @@ -751,11 +729,6 @@ Optimizer::PassToken CreateAggressiveDCEPass() { MakeUnique()); } -Optimizer::PassToken CreateRemoveUnusedInterfaceVariablesPass() { - return MakeUnique( - MakeUnique()); -} - Optimizer::PassToken CreatePropagateLineInfoPass() { return MakeUnique(MakeUnique()); } @@ -960,11 +933,4 @@ Optimizer::PassToken CreateInterpolateFixupPass() { MakeUnique()); } -Optimizer::PassToken CreateConvertToSampledImagePass( - const std::vector& - descriptor_set_binding_pairs) { - return MakeUnique( - MakeUnique(descriptor_set_binding_pairs)); -} - } // namespace spvtools diff --git a/source/opt/passes.h b/source/opt/passes.h index da837f2a..bfb34af7 100644 --- a/source/opt/passes.h +++ b/source/opt/passes.h @@ -26,7 +26,6 @@ #include "source/opt/combine_access_chains.h" #include "source/opt/compact_ids_pass.h" #include "source/opt/convert_to_half_pass.h" -#include "source/opt/convert_to_sampled_image_pass.h" #include "source/opt/copy_prop_arrays.h" #include "source/opt/dead_branch_elim_pass.h" #include "source/opt/dead_insert_elim_pass.h" @@ -65,7 +64,6 @@ #include "source/opt/redundancy_elimination.h" #include "source/opt/relax_float_ops_pass.h" #include "source/opt/remove_duplicates_pass.h" -#include "source/opt/remove_unused_interface_variables_pass.h" #include "source/opt/replace_invalid_opc.h" #include "source/opt/scalar_replacement_pass.h" #include "source/opt/set_spec_constant_default_value_pass.h" diff --git a/source/opt/private_to_local_pass.cpp b/source/opt/private_to_local_pass.cpp index 12a226d5..dd6cbbde 100644 --- a/source/opt/private_to_local_pass.cpp +++ b/source/opt/private_to_local_pass.cpp @@ -157,7 +157,8 @@ uint32_t PrivateToLocalPass::GetNewType(uint32_t old_type_id) { bool PrivateToLocalPass::IsValidUse(const Instruction* inst) const { // The cases in this switch have to match the cases in |UpdateUse|. // If we don't know how to update it, it is not valid. - if (inst->GetCommonDebugOpcode() == CommonDebugInfoDebugGlobalVariable) { + if (inst->GetOpenCL100DebugOpcode() == + OpenCLDebugInfo100DebugGlobalVariable) { return true; } switch (inst->opcode()) { @@ -182,7 +183,8 @@ bool PrivateToLocalPass::UpdateUse(Instruction* inst, Instruction* user) { // The cases in this switch have to match the cases in |IsValidUse|. If we // don't think it is valid, the optimization will not view the variable as a // candidate, and therefore the use will not be updated. - if (inst->GetCommonDebugOpcode() == CommonDebugInfoDebugGlobalVariable) { + if (inst->GetOpenCL100DebugOpcode() == + OpenCLDebugInfo100DebugGlobalVariable) { context()->get_debug_info_mgr()->ConvertDebugGlobalToLocalVariable(inst, user); return true; diff --git a/source/opt/reduce_load_size.cpp b/source/opt/reduce_load_size.cpp index 87d2c4c0..c58adf47 100644 --- a/source/opt/reduce_load_size.cpp +++ b/source/opt/reduce_load_size.cpp @@ -139,7 +139,7 @@ bool ReduceLoadSize::ShouldReplaceExtract(Instruction* inst) { all_elements_used = !def_use_mgr->WhileEachUser(op_inst, [&elements_used](Instruction* use) { - if (use->IsCommonDebugInstr()) return true; + if (use->IsOpenCL100DebugInstr()) return true; if (use->opcode() != SpvOpCompositeExtract || use->NumInOperands() == 1) { return false; diff --git a/source/opt/remove_dontinline_pass.cpp b/source/opt/remove_dontinline_pass.cpp deleted file mode 100644 index 4dd1cd4f..00000000 --- a/source/opt/remove_dontinline_pass.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/opt/remove_dontinline_pass.h" - -namespace spvtools { -namespace opt { - -Pass::Status RemoveDontInline::Process() { - bool modified = false; - modified = ClearDontInlineFunctionControl(); - return (modified ? Status::SuccessWithChange : Status::SuccessWithoutChange); -} - -bool RemoveDontInline::ClearDontInlineFunctionControl() { - bool modified = false; - for (auto& func : *get_module()) { - ClearDontInlineFunctionControl(&func); - } - return modified; -} - -bool RemoveDontInline::ClearDontInlineFunctionControl(Function* function) { - constexpr uint32_t kFunctionControlInOperandIdx = 0; - Instruction* function_inst = &function->DefInst(); - uint32_t function_control = - function_inst->GetSingleWordInOperand(kFunctionControlInOperandIdx); - - if ((function_control & SpvFunctionControlDontInlineMask) == 0) { - return false; - } - function_control &= ~SpvFunctionControlDontInlineMask; - function_inst->SetInOperand(kFunctionControlInOperandIdx, {function_control}); - return true; -} - -} // namespace opt -} // namespace spvtools diff --git a/source/opt/remove_dontinline_pass.h b/source/opt/remove_dontinline_pass.h deleted file mode 100644 index 16243199..00000000 --- a/source/opt/remove_dontinline_pass.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SOURCE_OPT_REMOVE_DONTINLINE_PASS_H_ -#define SOURCE_OPT_REMOVE_DONTINLINE_PASS_H_ - -#include "source/opt/pass.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class RemoveDontInline : public Pass { - public: - const char* name() const override { return "remove-dont-inline"; } - Status Process() override; - - private: - // Clears the DontInline function control from every function in the module. - // Returns true of a change was made. - bool ClearDontInlineFunctionControl(); - - // Clears the DontInline function control from |function|. - // Returns true of a change was made. - bool ClearDontInlineFunctionControl(Function* function); -}; - -} // namespace opt -} // namespace spvtools - -#endif // SOURCE_OPT_REMOVE_DONTINLINE_PASS_H_ diff --git a/source/opt/remove_unused_interface_variables_pass.cpp b/source/opt/remove_unused_interface_variables_pass.cpp deleted file mode 100644 index 31e87bd4..00000000 --- a/source/opt/remove_unused_interface_variables_pass.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) 2021 ZHOU He -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "remove_unused_interface_variables_pass.h" -#include "source/spirv_constant.h" -namespace spvtools { -namespace opt { - -class RemoveUnusedInterfaceVariablesContext { - RemoveUnusedInterfaceVariablesPass& parent_; - Instruction& entry_; - std::unordered_set used_variables_; - IRContext::ProcessFunction pfn_ = - std::bind(&RemoveUnusedInterfaceVariablesContext::processFunction, this, - std::placeholders::_1); - - bool processFunction(Function* func) { - for (const auto& basic_block : *func) - for (const auto& instruction : basic_block) - instruction.ForEachInId([&](const uint32_t* id) { - if (used_variables_.count(*id)) return; - auto* var = parent_.get_def_use_mgr()->GetDef(*id); - if (!var || var->opcode() != SpvOpVariable) return; - auto storage_class = var->GetSingleWordInOperand(0); - if (storage_class != SpvStorageClassFunction && - (parent_.get_module()->version() >= - SPV_SPIRV_VERSION_WORD(1, 4) || - storage_class == SpvStorageClassInput || - storage_class == SpvStorageClassOutput)) - used_variables_.insert(*id); - }); - return false; - } - - public: - RemoveUnusedInterfaceVariablesContext( - RemoveUnusedInterfaceVariablesPass& parent, Instruction& entry) - : parent_(parent), entry_(entry) {} - - void CollectUsedVariables() { - std::queue roots; - roots.push(entry_.GetSingleWordInOperand(1)); - parent_.context()->ProcessCallTreeFromRoots(pfn_, &roots); - } - - bool ShouldModify() { - std::unordered_set old_variables; - for (int i = entry_.NumInOperands() - 1; i >= 3; --i) { - auto variable = entry_.GetInOperand(i).words[0]; - if (!used_variables_.count(variable)) return true; // It is unused. - if (old_variables.count(variable)) return true; // It is duplicate. - old_variables.insert(variable); - } - if (old_variables.size() != used_variables_.size()) // Missing IDs. - return true; - return false; - } - - void Modify() { - for (int i = entry_.NumInOperands() - 1; i >= 3; --i) - entry_.RemoveInOperand(i); - for (auto id : used_variables_) { - entry_.AddOperand(Operand(SPV_OPERAND_TYPE_ID, {id})); - } - } -}; - -RemoveUnusedInterfaceVariablesPass::Status -RemoveUnusedInterfaceVariablesPass::Process() { - bool modified = false; - for (auto& entry : get_module()->entry_points()) { - RemoveUnusedInterfaceVariablesContext context(*this, entry); - context.CollectUsedVariables(); - if (context.ShouldModify()) { - context.Modify(); - modified = true; - } - } - return (modified ? Status::SuccessWithChange : Status::SuccessWithoutChange); -} -} // namespace opt -} // namespace spvtools \ No newline at end of file diff --git a/source/opt/remove_unused_interface_variables_pass.h b/source/opt/remove_unused_interface_variables_pass.h deleted file mode 100644 index 7f11187c..00000000 --- a/source/opt/remove_unused_interface_variables_pass.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2021 ZHOU He -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/opt/pass.h" -namespace spvtools { -namespace opt { - -class RemoveUnusedInterfaceVariablesPass : public Pass { - const char* name() const override { - return "remove-unused-interface-variables-pass"; - } - Status Process() override; -}; -} // namespace opt -} // namespace spvtools \ No newline at end of file diff --git a/source/opt/replace_desc_array_access_using_var_index.cpp b/source/opt/replace_desc_array_access_using_var_index.cpp deleted file mode 100644 index e97593ef..00000000 --- a/source/opt/replace_desc_array_access_using_var_index.cpp +++ /dev/null @@ -1,429 +0,0 @@ -// Copyright (c) 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/opt/replace_desc_array_access_using_var_index.h" - -#include "source/opt/desc_sroa_util.h" -#include "source/opt/ir_builder.h" -#include "source/util/string_utils.h" - -namespace spvtools { -namespace opt { -namespace { - -const uint32_t kOpAccessChainInOperandIndexes = 1; -const uint32_t kOpTypePointerInOperandType = 1; -const uint32_t kOpTypeArrayInOperandType = 0; -const uint32_t kOpTypeStructInOperandMember = 0; -IRContext::Analysis kAnalysisDefUseAndInstrToBlockMapping = - IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping; - -uint32_t GetValueWithKeyExistenceCheck( - uint32_t key, const std::unordered_map& map) { - auto itr = map.find(key); - assert(itr != map.end() && "Key does not exist"); - return itr->second; -} - -} // namespace - -Pass::Status ReplaceDescArrayAccessUsingVarIndex::Process() { - Status status = Status::SuccessWithoutChange; - for (Instruction& var : context()->types_values()) { - if (descsroautil::IsDescriptorArray(context(), &var)) { - if (ReplaceVariableAccessesWithConstantElements(&var)) - status = Status::SuccessWithChange; - } - } - return status; -} - -bool ReplaceDescArrayAccessUsingVarIndex:: - ReplaceVariableAccessesWithConstantElements(Instruction* var) const { - std::vector work_list; - get_def_use_mgr()->ForEachUser(var, [&work_list](Instruction* use) { - switch (use->opcode()) { - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: - work_list.push_back(use); - break; - default: - break; - } - }); - - bool updated = false; - for (Instruction* access_chain : work_list) { - if (descsroautil::GetAccessChainIndexAsConst(context(), access_chain) == - nullptr) { - ReplaceAccessChain(var, access_chain); - updated = true; - } - } - // Note that we do not consider OpLoad and OpCompositeExtract because - // OpCompositeExtract always has constant literals for indices. - return updated; -} - -void ReplaceDescArrayAccessUsingVarIndex::ReplaceAccessChain( - Instruction* var, Instruction* access_chain) const { - uint32_t number_of_elements = - descsroautil::GetNumberOfElementsForArrayOrStruct(context(), var); - assert(number_of_elements != 0 && "Number of element is 0"); - if (number_of_elements == 1) { - UseConstIndexForAccessChain(access_chain, 0); - get_def_use_mgr()->AnalyzeInstUse(access_chain); - return; - } - ReplaceUsersOfAccessChain(access_chain, number_of_elements); -} - -void ReplaceDescArrayAccessUsingVarIndex::ReplaceUsersOfAccessChain( - Instruction* access_chain, uint32_t number_of_elements) const { - std::vector final_users; - CollectRecursiveUsersWithConcreteType(access_chain, &final_users); - for (auto* inst : final_users) { - std::deque insts_to_be_cloned = - CollectRequiredImageAndAccessInsts(inst); - ReplaceNonUniformAccessWithSwitchCase( - inst, access_chain, number_of_elements, insts_to_be_cloned); - } -} - -void ReplaceDescArrayAccessUsingVarIndex::CollectRecursiveUsersWithConcreteType( - Instruction* access_chain, std::vector* final_users) const { - std::queue work_list; - work_list.push(access_chain); - while (!work_list.empty()) { - auto* inst_from_work_list = work_list.front(); - work_list.pop(); - get_def_use_mgr()->ForEachUser( - inst_from_work_list, [this, final_users, &work_list](Instruction* use) { - // TODO: Support Boolean type as well. - if (!use->HasResultId() || IsConcreteType(use->type_id())) { - final_users->push_back(use); - } else { - work_list.push(use); - } - }); - } -} - -std::deque -ReplaceDescArrayAccessUsingVarIndex::CollectRequiredImageAndAccessInsts( - Instruction* user) const { - std::unordered_set seen_inst_ids; - std::queue work_list; - - auto decision_to_include_operand = [this, &seen_inst_ids, - &work_list](uint32_t* idp) { - if (!seen_inst_ids.insert(*idp).second) return; - Instruction* operand = get_def_use_mgr()->GetDef(*idp); - if (context()->get_instr_block(operand) != nullptr && - (HasImageOrImagePtrType(operand) || - operand->opcode() == SpvOpAccessChain || - operand->opcode() == SpvOpInBoundsAccessChain)) { - work_list.push(operand); - } - }; - - std::deque required_insts; - required_insts.push_front(user); - user->ForEachInId(decision_to_include_operand); - while (!work_list.empty()) { - auto* inst_from_work_list = work_list.front(); - work_list.pop(); - required_insts.push_front(inst_from_work_list); - inst_from_work_list->ForEachInId(decision_to_include_operand); - } - return required_insts; -} - -bool ReplaceDescArrayAccessUsingVarIndex::HasImageOrImagePtrType( - const Instruction* inst) const { - assert(inst != nullptr && inst->type_id() != 0 && "Invalid instruction"); - return IsImageOrImagePtrType(get_def_use_mgr()->GetDef(inst->type_id())); -} - -bool ReplaceDescArrayAccessUsingVarIndex::IsImageOrImagePtrType( - const Instruction* type_inst) const { - if (type_inst->opcode() == SpvOpTypeImage || - type_inst->opcode() == SpvOpTypeSampler || - type_inst->opcode() == SpvOpTypeSampledImage) { - return true; - } - if (type_inst->opcode() == SpvOpTypePointer) { - Instruction* pointee_type_inst = get_def_use_mgr()->GetDef( - type_inst->GetSingleWordInOperand(kOpTypePointerInOperandType)); - return IsImageOrImagePtrType(pointee_type_inst); - } - if (type_inst->opcode() == SpvOpTypeArray) { - Instruction* element_type_inst = get_def_use_mgr()->GetDef( - type_inst->GetSingleWordInOperand(kOpTypeArrayInOperandType)); - return IsImageOrImagePtrType(element_type_inst); - } - if (type_inst->opcode() != SpvOpTypeStruct) return false; - for (uint32_t in_operand_idx = kOpTypeStructInOperandMember; - in_operand_idx < type_inst->NumInOperands(); ++in_operand_idx) { - Instruction* member_type_inst = get_def_use_mgr()->GetDef( - type_inst->GetSingleWordInOperand(kOpTypeStructInOperandMember)); - if (IsImageOrImagePtrType(member_type_inst)) return true; - } - return false; -} - -bool ReplaceDescArrayAccessUsingVarIndex::IsConcreteType( - uint32_t type_id) const { - Instruction* type_inst = get_def_use_mgr()->GetDef(type_id); - if (type_inst->opcode() == SpvOpTypeInt || - type_inst->opcode() == SpvOpTypeFloat) { - return true; - } - if (type_inst->opcode() == SpvOpTypeVector || - type_inst->opcode() == SpvOpTypeMatrix || - type_inst->opcode() == SpvOpTypeArray) { - return IsConcreteType(type_inst->GetSingleWordInOperand(0)); - } - if (type_inst->opcode() == SpvOpTypeStruct) { - for (uint32_t i = 0; i < type_inst->NumInOperands(); ++i) { - if (!IsConcreteType(type_inst->GetSingleWordInOperand(i))) return false; - } - return true; - } - return false; -} - -BasicBlock* ReplaceDescArrayAccessUsingVarIndex::CreateCaseBlock( - Instruction* access_chain, uint32_t element_index, - const std::deque& insts_to_be_cloned, - uint32_t branch_target_id, - std::unordered_map* old_ids_to_new_ids) const { - auto* case_block = CreateNewBlock(); - AddConstElementAccessToCaseBlock(case_block, access_chain, element_index, - old_ids_to_new_ids); - CloneInstsToBlock(case_block, access_chain, insts_to_be_cloned, - old_ids_to_new_ids); - AddBranchToBlock(case_block, branch_target_id); - UseNewIdsInBlock(case_block, *old_ids_to_new_ids); - return case_block; -} - -void ReplaceDescArrayAccessUsingVarIndex::CloneInstsToBlock( - BasicBlock* block, Instruction* inst_to_skip_cloning, - const std::deque& insts_to_be_cloned, - std::unordered_map* old_ids_to_new_ids) const { - for (auto* inst_to_be_cloned : insts_to_be_cloned) { - if (inst_to_be_cloned == inst_to_skip_cloning) continue; - std::unique_ptr clone(inst_to_be_cloned->Clone(context())); - if (inst_to_be_cloned->HasResultId()) { - uint32_t new_id = context()->TakeNextId(); - clone->SetResultId(new_id); - (*old_ids_to_new_ids)[inst_to_be_cloned->result_id()] = new_id; - } - get_def_use_mgr()->AnalyzeInstDefUse(clone.get()); - context()->set_instr_block(clone.get(), block); - block->AddInstruction(std::move(clone)); - } -} - -void ReplaceDescArrayAccessUsingVarIndex::UseNewIdsInBlock( - BasicBlock* block, - const std::unordered_map& old_ids_to_new_ids) const { - for (auto block_itr = block->begin(); block_itr != block->end(); - ++block_itr) { - (&*block_itr)->ForEachInId([&old_ids_to_new_ids](uint32_t* idp) { - auto old_ids_to_new_ids_itr = old_ids_to_new_ids.find(*idp); - if (old_ids_to_new_ids_itr == old_ids_to_new_ids.end()) return; - *idp = old_ids_to_new_ids_itr->second; - }); - get_def_use_mgr()->AnalyzeInstUse(&*block_itr); - } -} - -void ReplaceDescArrayAccessUsingVarIndex::ReplaceNonUniformAccessWithSwitchCase( - Instruction* access_chain_final_user, Instruction* access_chain, - uint32_t number_of_elements, - const std::deque& insts_to_be_cloned) const { - auto* block = context()->get_instr_block(access_chain_final_user); - // If the instruction does not belong to a block (i.e. in the case of - // OpDecorate), no replacement is needed. - if (!block) return; - - // Create merge block and add terminator - auto* merge_block = SeparateInstructionsIntoNewBlock( - block, access_chain_final_user->NextNode()); - - auto* function = block->GetParent(); - - // Add case blocks - std::vector phi_operands; - std::vector case_block_ids; - for (uint32_t idx = 0; idx < number_of_elements; ++idx) { - std::unordered_map old_ids_to_new_ids_for_cloned_insts; - std::unique_ptr case_block(CreateCaseBlock( - access_chain, idx, insts_to_be_cloned, merge_block->id(), - &old_ids_to_new_ids_for_cloned_insts)); - case_block_ids.push_back(case_block->id()); - function->InsertBasicBlockBefore(std::move(case_block), merge_block); - - // Keep the operand for OpPhi - if (!access_chain_final_user->HasResultId()) continue; - uint32_t phi_operand = - GetValueWithKeyExistenceCheck(access_chain_final_user->result_id(), - old_ids_to_new_ids_for_cloned_insts); - phi_operands.push_back(phi_operand); - } - - // Create default block - std::unique_ptr default_block( - CreateDefaultBlock(access_chain_final_user->HasResultId(), &phi_operands, - merge_block->id())); - uint32_t default_block_id = default_block->id(); - function->InsertBasicBlockBefore(std::move(default_block), merge_block); - - // Create OpSwitch - uint32_t access_chain_index_var_id = - descsroautil::GetFirstIndexOfAccessChain(access_chain); - AddSwitchForAccessChain(block, access_chain_index_var_id, default_block_id, - merge_block->id(), case_block_ids); - - // Create phi instructions - if (!phi_operands.empty()) { - uint32_t phi_id = CreatePhiInstruction(merge_block, phi_operands, - case_block_ids, default_block_id); - context()->ReplaceAllUsesWith(access_chain_final_user->result_id(), phi_id); - } - - // Replace OpPhi incoming block operand that uses |block| with |merge_block| - ReplacePhiIncomingBlock(block->id(), merge_block->id()); -} - -BasicBlock* -ReplaceDescArrayAccessUsingVarIndex::SeparateInstructionsIntoNewBlock( - BasicBlock* block, Instruction* separation_begin_inst) const { - auto separation_begin = block->begin(); - while (separation_begin != block->end() && - &*separation_begin != separation_begin_inst) { - ++separation_begin; - } - return block->SplitBasicBlock(context(), context()->TakeNextId(), - separation_begin); -} - -BasicBlock* ReplaceDescArrayAccessUsingVarIndex::CreateNewBlock() const { - auto* new_block = new BasicBlock(std::unique_ptr( - new Instruction(context(), SpvOpLabel, 0, context()->TakeNextId(), {}))); - get_def_use_mgr()->AnalyzeInstDefUse(new_block->GetLabelInst()); - context()->set_instr_block(new_block->GetLabelInst(), new_block); - return new_block; -} - -void ReplaceDescArrayAccessUsingVarIndex::UseConstIndexForAccessChain( - Instruction* access_chain, uint32_t const_element_idx) const { - uint32_t const_element_idx_id = - context()->get_constant_mgr()->GetUIntConst(const_element_idx); - access_chain->SetInOperand(kOpAccessChainInOperandIndexes, - {const_element_idx_id}); -} - -void ReplaceDescArrayAccessUsingVarIndex::AddConstElementAccessToCaseBlock( - BasicBlock* case_block, Instruction* access_chain, - uint32_t const_element_idx, - std::unordered_map* old_ids_to_new_ids) const { - std::unique_ptr access_clone(access_chain->Clone(context())); - UseConstIndexForAccessChain(access_clone.get(), const_element_idx); - - uint32_t new_access_id = context()->TakeNextId(); - (*old_ids_to_new_ids)[access_clone->result_id()] = new_access_id; - access_clone->SetResultId(new_access_id); - get_def_use_mgr()->AnalyzeInstDefUse(access_clone.get()); - - context()->set_instr_block(access_clone.get(), case_block); - case_block->AddInstruction(std::move(access_clone)); -} - -void ReplaceDescArrayAccessUsingVarIndex::AddBranchToBlock( - BasicBlock* parent_block, uint32_t branch_destination) const { - InstructionBuilder builder{context(), parent_block, - kAnalysisDefUseAndInstrToBlockMapping}; - builder.AddBranch(branch_destination); -} - -BasicBlock* ReplaceDescArrayAccessUsingVarIndex::CreateDefaultBlock( - bool null_const_for_phi_is_needed, std::vector* phi_operands, - uint32_t merge_block_id) const { - auto* default_block = CreateNewBlock(); - AddBranchToBlock(default_block, merge_block_id); - if (!null_const_for_phi_is_needed) return default_block; - - // Create null value for OpPhi - Instruction* inst = context()->get_def_use_mgr()->GetDef((*phi_operands)[0]); - auto* null_const_inst = GetConstNull(inst->type_id()); - phi_operands->push_back(null_const_inst->result_id()); - return default_block; -} - -Instruction* ReplaceDescArrayAccessUsingVarIndex::GetConstNull( - uint32_t type_id) const { - assert(type_id != 0 && "Result type is expected"); - auto* type = context()->get_type_mgr()->GetType(type_id); - auto* null_const = context()->get_constant_mgr()->GetConstant(type, {}); - return context()->get_constant_mgr()->GetDefiningInstruction(null_const); -} - -void ReplaceDescArrayAccessUsingVarIndex::AddSwitchForAccessChain( - BasicBlock* parent_block, uint32_t access_chain_index_var_id, - uint32_t default_id, uint32_t merge_id, - const std::vector& case_block_ids) const { - InstructionBuilder builder{context(), parent_block, - kAnalysisDefUseAndInstrToBlockMapping}; - std::vector> cases; - for (uint32_t i = 0; i < static_cast(case_block_ids.size()); ++i) { - cases.emplace_back(Operand::OperandData{i}, case_block_ids[i]); - } - builder.AddSwitch(access_chain_index_var_id, default_id, cases, merge_id); -} - -uint32_t ReplaceDescArrayAccessUsingVarIndex::CreatePhiInstruction( - BasicBlock* parent_block, const std::vector& phi_operands, - const std::vector& case_block_ids, - uint32_t default_block_id) const { - std::vector incomings; - assert(case_block_ids.size() + 1 == phi_operands.size() && - "Number of Phi operands must be exactly 1 bigger than the one of case " - "blocks"); - for (size_t i = 0; i < case_block_ids.size(); ++i) { - incomings.push_back(phi_operands[i]); - incomings.push_back(case_block_ids[i]); - } - incomings.push_back(phi_operands.back()); - incomings.push_back(default_block_id); - - InstructionBuilder builder{context(), &*parent_block->begin(), - kAnalysisDefUseAndInstrToBlockMapping}; - uint32_t phi_result_type_id = - context()->get_def_use_mgr()->GetDef(phi_operands[0])->type_id(); - auto* phi = builder.AddPhi(phi_result_type_id, incomings); - return phi->result_id(); -} - -void ReplaceDescArrayAccessUsingVarIndex::ReplacePhiIncomingBlock( - uint32_t old_incoming_block_id, uint32_t new_incoming_block_id) const { - context()->ReplaceAllUsesWithPredicate( - old_incoming_block_id, new_incoming_block_id, - [](Instruction* use) { return use->opcode() == SpvOpPhi; }); -} - -} // namespace opt -} // namespace spvtools diff --git a/source/opt/replace_desc_array_access_using_var_index.h b/source/opt/replace_desc_array_access_using_var_index.h deleted file mode 100644 index 51817c15..00000000 --- a/source/opt/replace_desc_array_access_using_var_index.h +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SOURCE_OPT_REPLACE_DESC_VAR_INDEX_ACCESS_H_ -#define SOURCE_OPT_REPLACE_DESC_VAR_INDEX_ACCESS_H_ - -#include -#include -#include -#include -#include -#include - -#include "source/opt/function.h" -#include "source/opt/pass.h" -#include "source/opt/type_manager.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class ReplaceDescArrayAccessUsingVarIndex : public Pass { - public: - ReplaceDescArrayAccessUsingVarIndex() {} - - const char* name() const override { - return "replace-desc-array-access-using-var-index"; - } - - Status Process() override; - - IRContext::Analysis GetPreservedAnalyses() override { - return IRContext::kAnalysisDefUse | - IRContext::kAnalysisInstrToBlockMapping | - IRContext::kAnalysisConstants | IRContext::kAnalysisTypes; - } - - private: - // Replaces all accesses to |var| using variable indices with constant - // elements of the array |var|. Creates switch-case statements to determine - // the value of the variable index for all the possible cases. Returns - // whether replacement is done or not. - bool ReplaceVariableAccessesWithConstantElements(Instruction* var) const; - - // Replaces the OpAccessChain or OpInBoundsAccessChain instruction |use| that - // uses the descriptor variable |var| with the OpAccessChain or - // OpInBoundsAccessChain instruction with a constant Indexes operand. - void ReplaceAccessChain(Instruction* var, Instruction* use) const; - - // Updates the first Indexes operand of the OpAccessChain or - // OpInBoundsAccessChain instruction |access_chain| to let it use a constant - // index |const_element_idx|. - void UseConstIndexForAccessChain(Instruction* access_chain, - uint32_t const_element_idx) const; - - // Replaces users of the OpAccessChain or OpInBoundsAccessChain instruction - // |access_chain| that accesses an array descriptor variable using variable - // indices with constant elements. |number_of_elements| is the number - // of array elements. - void ReplaceUsersOfAccessChain(Instruction* access_chain, - uint32_t number_of_elements) const; - - // Puts all the recursive users of |access_chain| with concrete result types - // or the ones without result it in |final_users|. - void CollectRecursiveUsersWithConcreteType( - Instruction* access_chain, std::vector* final_users) const; - - // Recursively collects the operands of |user| (and operands of the operands) - // whose result types are images/samplers (or pointers/arrays/ structs of - // them) and access chains instructions and returns them. The returned - // collection includes |user|. - std::deque CollectRequiredImageAndAccessInsts( - Instruction* user) const; - - // Returns whether result type of |inst| is an image/sampler/pointer of image - // or sampler or not. - bool HasImageOrImagePtrType(const Instruction* inst) const; - - // Returns whether |type_inst| is an image/sampler or pointer/array/struct of - // image or sampler or not. - bool IsImageOrImagePtrType(const Instruction* type_inst) const; - - // Returns whether the type with |type_id| is a concrete type or not. - bool IsConcreteType(uint32_t type_id) const; - - // Replaces the non-uniform access to a descriptor variable - // |access_chain_final_user| with OpSwitch instruction and case blocks. Each - // case block will contain a clone of |access_chain| and clones of - // |non_uniform_accesses_to_clone| that are recursively used by - // |access_chain_final_user|. The clone of |access_chain| (or - // OpInBoundsAccessChain) will have a constant index for its first index. The - // OpSwitch instruction will have the cases for the variable index of - // |access_chain| from 0 to |number_of_elements| - 1. - void ReplaceNonUniformAccessWithSwitchCase( - Instruction* access_chain_final_user, Instruction* access_chain, - uint32_t number_of_elements, - const std::deque& non_uniform_accesses_to_clone) const; - - // Creates and returns a new basic block that contains all instructions of - // |block| after |separation_begin_inst|. The new basic block is added to the - // function in this method. - BasicBlock* SeparateInstructionsIntoNewBlock( - BasicBlock* block, Instruction* separation_begin_inst) const; - - // Creates and returns a new block. - BasicBlock* CreateNewBlock() const; - - // Returns the first operand id of the OpAccessChain or OpInBoundsAccessChain - // instruction |access_chain|. - uint32_t GetFirstIndexOfAccessChain(Instruction* access_chain) const; - - // Adds a clone of the OpAccessChain or OpInBoundsAccessChain instruction - // |access_chain| to |case_block|. The clone of |access_chain| will use - // |const_element_idx| for its first index. |old_ids_to_new_ids| keeps the - // mapping from the result id of |access_chain| to the result of its clone. - void AddConstElementAccessToCaseBlock( - BasicBlock* case_block, Instruction* access_chain, - uint32_t const_element_idx, - std::unordered_map* old_ids_to_new_ids) const; - - // Clones all instructions in |insts_to_be_cloned| and put them to |block|. - // |old_ids_to_new_ids| keeps the mapping from the result id of each - // instruction of |insts_to_be_cloned| to the result of their clones. - void CloneInstsToBlock( - BasicBlock* block, Instruction* inst_to_skip_cloning, - const std::deque& insts_to_be_cloned, - std::unordered_map* old_ids_to_new_ids) const; - - // Adds OpBranch to |branch_destination| at the end of |parent_block|. - void AddBranchToBlock(BasicBlock* parent_block, - uint32_t branch_destination) const; - - // Replaces in-operands of all instructions in the basic block |block| using - // |old_ids_to_new_ids|. It conducts the replacement only if the in-operand - // id is a key of |old_ids_to_new_ids|. - void UseNewIdsInBlock( - BasicBlock* block, - const std::unordered_map& old_ids_to_new_ids) const; - - // Creates a case block for |element_index| case. It adds clones of - // |insts_to_be_cloned| and a clone of |access_chain| with |element_index| as - // its first index. The termination instruction of the created case block will - // be a branch to |branch_target_id|. Puts old ids to new ids map for the - // cloned instructions in |old_ids_to_new_ids|. - BasicBlock* CreateCaseBlock( - Instruction* access_chain, uint32_t element_index, - const std::deque& insts_to_be_cloned, - uint32_t branch_target_id, - std::unordered_map* old_ids_to_new_ids) const; - - // Creates a default block for switch-case statement that has only a single - // instruction OpBranch whose target is a basic block with |merge_block_id|. - // If |null_const_for_phi_is_needed| is true, gets or creates a default null - // constant value for a phi instruction whose operands are |phi_operands| and - // puts it in |phi_operands|. - BasicBlock* CreateDefaultBlock(bool null_const_for_phi_is_needed, - std::vector* phi_operands, - uint32_t merge_block_id) const; - - // Creates and adds an OpSwitch used for the selection of OpAccessChain whose - // first Indexes operand is |access_chain_index_var_id|. The OpSwitch will be - // added at the end of |parent_block|. It will jump to |default_id| for the - // default case and jumps to one of case blocks whose ids are |case_block_ids| - // if |access_chain_index_var_id| matches the case number. |merge_id| is the - // merge block id. - void AddSwitchForAccessChain( - BasicBlock* parent_block, uint32_t access_chain_index_var_id, - uint32_t default_id, uint32_t merge_id, - const std::vector& case_block_ids) const; - - // Creates a phi instruction with |phi_operands| as values and - // |case_block_ids| and |default_block_id| as incoming blocks. The size of - // |phi_operands| must be exactly 1 larger than the size of |case_block_ids|. - // The last element of |phi_operands| will be used for |default_block_id|. It - // adds the phi instruction to the beginning of |parent_block|. - uint32_t CreatePhiInstruction(BasicBlock* parent_block, - const std::vector& phi_operands, - const std::vector& case_block_ids, - uint32_t default_block_id) const; - - // Replaces the incoming block operand of OpPhi instructions with - // |new_incoming_block_id| if the incoming block operand is - // |old_incoming_block_id|. - void ReplacePhiIncomingBlock(uint32_t old_incoming_block_id, - uint32_t new_incoming_block_id) const; - - // Create an OpConstantNull instruction whose result type id is |type_id|. - Instruction* GetConstNull(uint32_t type_id) const; -}; - -} // namespace opt -} // namespace spvtools - -#endif // SOURCE_OPT_REPLACE_DESC_VAR_INDEX_ACCESS_H_ diff --git a/source/opt/scalar_replacement_pass.cpp b/source/opt/scalar_replacement_pass.cpp index 8adca7b9..4d47bdd8 100644 --- a/source/opt/scalar_replacement_pass.cpp +++ b/source/opt/scalar_replacement_pass.cpp @@ -83,14 +83,14 @@ Pass::Status ScalarReplacementPass::ReplaceVariable( std::vector dead; bool replaced_all_uses = get_def_use_mgr()->WhileEachUser( inst, [this, &replacements, &dead](Instruction* user) { - if (user->GetCommonDebugOpcode() == CommonDebugInfoDebugDeclare) { + if (user->GetOpenCL100DebugOpcode() == OpenCLDebugInfo100DebugDeclare) { if (ReplaceWholeDebugDeclare(user, replacements)) { dead.push_back(user); return true; } return false; } - if (user->GetCommonDebugOpcode() == CommonDebugInfoDebugValue) { + if (user->GetOpenCL100DebugOpcode() == OpenCLDebugInfo100DebugValue) { if (ReplaceWholeDebugValue(user, replacements)) { dead.push_back(user); return true; @@ -504,7 +504,7 @@ void ScalarReplacementPass::CreateVariable( } } - // Update the DebugInfo debug information. + // Update the OpenCL.DebugInfo.100 debug information. inst->UpdateDebugInfoFrom(varInst); replacements->push_back(inst); @@ -791,8 +791,8 @@ bool ScalarReplacementPass::CheckUses(const Instruction* inst, get_def_use_mgr()->ForEachUse(inst, [this, max_legal_index, stats, &ok]( const Instruction* user, uint32_t index) { - if (user->GetCommonDebugOpcode() == CommonDebugInfoDebugDeclare || - user->GetCommonDebugOpcode() == CommonDebugInfoDebugValue) { + if (user->GetOpenCL100DebugOpcode() == OpenCLDebugInfo100DebugDeclare || + user->GetOpenCL100DebugOpcode() == OpenCLDebugInfo100DebugValue) { // TODO: include num_partial_accesses if it uses Fragment operation or // DebugValue has Indexes operand. stats->num_full_accesses++; diff --git a/source/opt/spread_volatile_semantics.cpp b/source/opt/spread_volatile_semantics.cpp deleted file mode 100644 index b61fd0f4..00000000 --- a/source/opt/spread_volatile_semantics.cpp +++ /dev/null @@ -1,298 +0,0 @@ -// Copyright (c) 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/opt/spread_volatile_semantics.h" - -#include "source/opt/decoration_manager.h" -#include "source/opt/ir_builder.h" -#include "source/spirv_constant.h" - -namespace spvtools { -namespace opt { -namespace { - -const uint32_t kOpDecorateInOperandBuiltinDecoration = 2u; -const uint32_t kOpLoadInOperandMemoryOperands = 1u; -const uint32_t kOpEntryPointInOperandEntryPoint = 1u; -const uint32_t kOpEntryPointInOperandInterface = 3u; - -bool HasBuiltinDecoration(analysis::DecorationManager* decoration_manager, - uint32_t var_id, uint32_t built_in) { - return decoration_manager->FindDecoration( - var_id, SpvDecorationBuiltIn, [built_in](const Instruction& inst) { - return built_in == inst.GetSingleWordInOperand( - kOpDecorateInOperandBuiltinDecoration); - }); -} - -bool IsBuiltInForRayTracingVolatileSemantics(uint32_t built_in) { - switch (built_in) { - case SpvBuiltInSMIDNV: - case SpvBuiltInWarpIDNV: - case SpvBuiltInSubgroupSize: - case SpvBuiltInSubgroupLocalInvocationId: - case SpvBuiltInSubgroupEqMask: - case SpvBuiltInSubgroupGeMask: - case SpvBuiltInSubgroupGtMask: - case SpvBuiltInSubgroupLeMask: - case SpvBuiltInSubgroupLtMask: - return true; - default: - return false; - } -} - -bool HasBuiltinForRayTracingVolatileSemantics( - analysis::DecorationManager* decoration_manager, uint32_t var_id) { - return decoration_manager->FindDecoration( - var_id, SpvDecorationBuiltIn, [](const Instruction& inst) { - uint32_t built_in = - inst.GetSingleWordInOperand(kOpDecorateInOperandBuiltinDecoration); - return IsBuiltInForRayTracingVolatileSemantics(built_in); - }); -} - -bool HasVolatileDecoration(analysis::DecorationManager* decoration_manager, - uint32_t var_id) { - return decoration_manager->HasDecoration(var_id, SpvDecorationVolatile); -} - -} // namespace - -Pass::Status SpreadVolatileSemantics::Process() { - if (HasNoExecutionModel()) { - return Status::SuccessWithoutChange; - } - const bool is_vk_memory_model_enabled = - context()->get_feature_mgr()->HasCapability( - SpvCapabilityVulkanMemoryModel); - CollectTargetsForVolatileSemantics(is_vk_memory_model_enabled); - - // If VulkanMemoryModel capability is not enabled, we have to set Volatile - // decoration for interface variables instead of setting Volatile for load - // instructions. If an interface (or pointers to it) is used by two load - // instructions in two entry points and one must be volatile while another - // is not, we have to report an error for the conflict. - if (!is_vk_memory_model_enabled && - HasInterfaceInConflictOfVolatileSemantics()) { - return Status::Failure; - } - - return SpreadVolatileSemanticsToVariables(is_vk_memory_model_enabled); -} - -Pass::Status SpreadVolatileSemantics::SpreadVolatileSemanticsToVariables( - const bool is_vk_memory_model_enabled) { - Status status = Status::SuccessWithoutChange; - for (Instruction& var : context()->types_values()) { - auto entry_function_ids = - EntryFunctionsToSpreadVolatileSemanticsForVar(var.result_id()); - if (entry_function_ids.empty()) { - continue; - } - - if (is_vk_memory_model_enabled) { - SetVolatileForLoadsInEntries(&var, entry_function_ids); - } else { - DecorateVarWithVolatile(&var); - } - status = Status::SuccessWithChange; - } - return status; -} - -bool SpreadVolatileSemantics::IsTargetUsedByNonVolatileLoadInEntryPoint( - uint32_t var_id, Instruction* entry_point) { - uint32_t entry_function_id = - entry_point->GetSingleWordInOperand(kOpEntryPointInOperandEntryPoint); - std::unordered_set funcs; - context()->CollectCallTreeFromRoots(entry_function_id, &funcs); - return !VisitLoadsOfPointersToVariableInEntries( - var_id, - [](Instruction* load) { - // If it has a load without volatile memory operand, finish traversal - // and return false. - if (load->NumInOperands() <= kOpLoadInOperandMemoryOperands) { - return false; - } - uint32_t memory_operands = - load->GetSingleWordInOperand(kOpLoadInOperandMemoryOperands); - return (memory_operands & SpvMemoryAccessVolatileMask) != 0; - }, - funcs); -} - -bool SpreadVolatileSemantics::HasInterfaceInConflictOfVolatileSemantics() { - for (Instruction& entry_point : get_module()->entry_points()) { - SpvExecutionModel execution_model = - static_cast(entry_point.GetSingleWordInOperand(0)); - for (uint32_t operand_index = kOpEntryPointInOperandInterface; - operand_index < entry_point.NumInOperands(); ++operand_index) { - uint32_t var_id = entry_point.GetSingleWordInOperand(operand_index); - if (!EntryFunctionsToSpreadVolatileSemanticsForVar(var_id).empty() && - !IsTargetForVolatileSemantics(var_id, execution_model) && - IsTargetUsedByNonVolatileLoadInEntryPoint(var_id, &entry_point)) { - Instruction* inst = context()->get_def_use_mgr()->GetDef(var_id); - context()->EmitErrorMessage( - "Variable is a target for Volatile semantics for an entry point, " - "but it is not for another entry point", - inst); - return true; - } - } - } - return false; -} - -void SpreadVolatileSemantics::MarkVolatileSemanticsForVariable( - uint32_t var_id, Instruction* entry_point) { - uint32_t entry_function_id = - entry_point->GetSingleWordInOperand(kOpEntryPointInOperandEntryPoint); - auto itr = var_ids_to_entry_fn_for_volatile_semantics_.find(var_id); - if (itr == var_ids_to_entry_fn_for_volatile_semantics_.end()) { - var_ids_to_entry_fn_for_volatile_semantics_[var_id] = {entry_function_id}; - return; - } - itr->second.insert(entry_function_id); -} - -void SpreadVolatileSemantics::CollectTargetsForVolatileSemantics( - const bool is_vk_memory_model_enabled) { - for (Instruction& entry_point : get_module()->entry_points()) { - SpvExecutionModel execution_model = - static_cast(entry_point.GetSingleWordInOperand(0)); - for (uint32_t operand_index = kOpEntryPointInOperandInterface; - operand_index < entry_point.NumInOperands(); ++operand_index) { - uint32_t var_id = entry_point.GetSingleWordInOperand(operand_index); - if (!IsTargetForVolatileSemantics(var_id, execution_model)) { - continue; - } - if (is_vk_memory_model_enabled || - IsTargetUsedByNonVolatileLoadInEntryPoint(var_id, &entry_point)) { - MarkVolatileSemanticsForVariable(var_id, &entry_point); - } - } - } -} - -void SpreadVolatileSemantics::DecorateVarWithVolatile(Instruction* var) { - analysis::DecorationManager* decoration_manager = - context()->get_decoration_mgr(); - uint32_t var_id = var->result_id(); - if (HasVolatileDecoration(decoration_manager, var_id)) { - return; - } - get_decoration_mgr()->AddDecoration( - SpvOpDecorate, {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {var_id}}, - {spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, - {SpvDecorationVolatile}}}); -} - -bool SpreadVolatileSemantics::VisitLoadsOfPointersToVariableInEntries( - uint32_t var_id, const std::function& handle_load, - const std::unordered_set& function_ids) { - std::vector worklist({var_id}); - auto* def_use_mgr = context()->get_def_use_mgr(); - while (!worklist.empty()) { - uint32_t ptr_id = worklist.back(); - worklist.pop_back(); - bool finish_traversal = !def_use_mgr->WhileEachUser( - ptr_id, [this, &worklist, &ptr_id, handle_load, - &function_ids](Instruction* user) { - BasicBlock* block = context()->get_instr_block(user); - if (block == nullptr || - function_ids.find(block->GetParent()->result_id()) == - function_ids.end()) { - return true; - } - - if (user->opcode() == SpvOpAccessChain || - user->opcode() == SpvOpInBoundsAccessChain || - user->opcode() == SpvOpPtrAccessChain || - user->opcode() == SpvOpInBoundsPtrAccessChain || - user->opcode() == SpvOpCopyObject) { - if (ptr_id == user->GetSingleWordInOperand(0)) - worklist.push_back(user->result_id()); - return true; - } - - if (user->opcode() != SpvOpLoad) { - return true; - } - - return handle_load(user); - }); - if (finish_traversal) return false; - } - return true; -} - -void SpreadVolatileSemantics::SetVolatileForLoadsInEntries( - Instruction* var, const std::unordered_set& entry_function_ids) { - // Set Volatile memory operand for all load instructions if they do not have - // it. - for (auto entry_id : entry_function_ids) { - std::unordered_set funcs; - context()->CollectCallTreeFromRoots(entry_id, &funcs); - VisitLoadsOfPointersToVariableInEntries( - var->result_id(), - [](Instruction* load) { - if (load->NumInOperands() <= kOpLoadInOperandMemoryOperands) { - load->AddOperand({SPV_OPERAND_TYPE_MEMORY_ACCESS, - {SpvMemoryAccessVolatileMask}}); - return true; - } - uint32_t memory_operands = - load->GetSingleWordInOperand(kOpLoadInOperandMemoryOperands); - memory_operands |= SpvMemoryAccessVolatileMask; - load->SetInOperand(kOpLoadInOperandMemoryOperands, {memory_operands}); - return true; - }, - funcs); - } -} - -bool SpreadVolatileSemantics::IsTargetForVolatileSemantics( - uint32_t var_id, SpvExecutionModel execution_model) { - analysis::DecorationManager* decoration_manager = - context()->get_decoration_mgr(); - if (execution_model == SpvExecutionModelFragment) { - return get_module()->version() >= SPV_SPIRV_VERSION_WORD(1, 6) && - HasBuiltinDecoration(decoration_manager, var_id, - SpvBuiltInHelperInvocation); - } - - if (execution_model == SpvExecutionModelIntersectionKHR || - execution_model == SpvExecutionModelIntersectionNV) { - if (HasBuiltinDecoration(decoration_manager, var_id, - SpvBuiltInRayTmaxKHR)) { - return true; - } - } - - switch (execution_model) { - case SpvExecutionModelRayGenerationKHR: - case SpvExecutionModelClosestHitKHR: - case SpvExecutionModelMissKHR: - case SpvExecutionModelCallableKHR: - case SpvExecutionModelIntersectionKHR: - return HasBuiltinForRayTracingVolatileSemantics(decoration_manager, - var_id); - default: - return false; - } -} - -} // namespace opt -} // namespace spvtools diff --git a/source/opt/spread_volatile_semantics.h b/source/opt/spread_volatile_semantics.h deleted file mode 100644 index 014858d3..00000000 --- a/source/opt/spread_volatile_semantics.h +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SOURCE_OPT_SPREAD_VOLATILE_SEMANTICS_H_ -#define SOURCE_OPT_SPREAD_VOLATILE_SEMANTICS_H_ - -#include "source/opt/pass.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class SpreadVolatileSemantics : public Pass { - public: - SpreadVolatileSemantics() {} - - const char* name() const override { return "spread-volatile-semantics"; } - - Status Process() override; - - IRContext::Analysis GetPreservedAnalyses() override { - return IRContext::kAnalysisDefUse | IRContext::kAnalysisDecorations | - IRContext::kAnalysisInstrToBlockMapping; - } - - private: - // Returns true if it does not have an execution model. Linkage shaders do not - // have an execution model. - bool HasNoExecutionModel() { - return get_module()->entry_points().empty() && - context()->get_feature_mgr()->HasCapability(SpvCapabilityLinkage); - } - - // Iterates interface variables and spreads the Volatile semantics if it has - // load instructions for the Volatile semantics. - Pass::Status SpreadVolatileSemanticsToVariables( - const bool is_vk_memory_model_enabled); - - // Returns whether |var_id| is the result id of a target builtin variable for - // the volatile semantics for |execution_model| based on the Vulkan spec - // VUID-StandaloneSpirv-VulkanMemoryModel-04678 or - // VUID-StandaloneSpirv-VulkanMemoryModel-04679. - bool IsTargetForVolatileSemantics(uint32_t var_id, - SpvExecutionModel execution_model); - - // Collects interface variables that need the volatile semantics. - // |is_vk_memory_model_enabled| is true if VulkanMemoryModel capability is - // enabled. - void CollectTargetsForVolatileSemantics( - const bool is_vk_memory_model_enabled); - - // Reports an error if an interface variable is used by two entry points and - // it needs the Volatile decoration for one but not for another. Returns true - // if the error must be reported. - bool HasInterfaceInConflictOfVolatileSemantics(); - - // Returns whether the variable whose result is |var_id| is used by a - // non-volatile load or a pointer to it is used by a non-volatile load in - // |entry_point| or not. - bool IsTargetUsedByNonVolatileLoadInEntryPoint(uint32_t var_id, - Instruction* entry_point); - - // Visits load instructions of pointers to variable whose result id is - // |var_id| if the load instructions are in reachable functions from entry - // points. |handle_load| is a function to do some actions for the load - // instructions. Finishes the traversal and returns false if |handle_load| - // returns false for a load instruction. Otherwise, returns true after running - // |handle_load| for all the load instructions. - bool VisitLoadsOfPointersToVariableInEntries( - uint32_t var_id, const std::function& handle_load, - const std::unordered_set& function_ids); - - // Sets Memory Operands of OpLoad instructions that load |var| or pointers - // of |var| as Volatile if the function id of the OpLoad instruction is - // included in |entry_function_ids|. - void SetVolatileForLoadsInEntries( - Instruction* var, const std::unordered_set& entry_function_ids); - - // Adds OpDecorate Volatile for |var| if it does not exist. - void DecorateVarWithVolatile(Instruction* var); - - // Returns a set of entry function ids to spread the volatile semantics for - // the variable with the result id |var_id|. - std::unordered_set EntryFunctionsToSpreadVolatileSemanticsForVar( - uint32_t var_id) { - auto itr = var_ids_to_entry_fn_for_volatile_semantics_.find(var_id); - if (itr == var_ids_to_entry_fn_for_volatile_semantics_.end()) return {}; - return itr->second; - } - - // Specifies that we have to spread the volatile semantics for the - // variable with the result id |var_id| for the entry point |entry_point|. - void MarkVolatileSemanticsForVariable(uint32_t var_id, - Instruction* entry_point); - - // Result ids of variables to entry function ids for the volatile semantics - // spread. - std::unordered_map> - var_ids_to_entry_fn_for_volatile_semantics_; -}; - -} // namespace opt -} // namespace spvtools - -#endif // SOURCE_OPT_SPREAD_VOLATILE_SEMANTICS_H_ diff --git a/source/opt/strip_nonsemantic_info_pass.cpp b/source/opt/strip_nonsemantic_info_pass.cpp deleted file mode 100644 index cd1fbb63..00000000 --- a/source/opt/strip_nonsemantic_info_pass.cpp +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/opt/strip_nonsemantic_info_pass.h" - -#include -#include - -#include "source/opt/instruction.h" -#include "source/opt/ir_context.h" -#include "source/util/string_utils.h" - -namespace spvtools { -namespace opt { - -Pass::Status StripNonSemanticInfoPass::Process() { - bool modified = false; - - std::vector to_remove; - - bool other_uses_for_decorate_string = false; - for (auto& inst : context()->module()->annotations()) { - switch (inst.opcode()) { - case SpvOpDecorateStringGOOGLE: - if (inst.GetSingleWordInOperand(1) == SpvDecorationHlslSemanticGOOGLE || - inst.GetSingleWordInOperand(1) == SpvDecorationUserTypeGOOGLE) { - to_remove.push_back(&inst); - } else { - other_uses_for_decorate_string = true; - } - break; - - case SpvOpMemberDecorateStringGOOGLE: - if (inst.GetSingleWordInOperand(2) == SpvDecorationHlslSemanticGOOGLE || - inst.GetSingleWordInOperand(2) == SpvDecorationUserTypeGOOGLE) { - to_remove.push_back(&inst); - } else { - other_uses_for_decorate_string = true; - } - break; - - case SpvOpDecorateId: - if (inst.GetSingleWordInOperand(1) == - SpvDecorationHlslCounterBufferGOOGLE) { - to_remove.push_back(&inst); - } - break; - - default: - break; - } - } - - for (auto& inst : context()->module()->extensions()) { - const std::string ext_name = inst.GetInOperand(0).AsString(); - if (ext_name == "SPV_GOOGLE_hlsl_functionality1") { - to_remove.push_back(&inst); - } else if (ext_name == "SPV_GOOGLE_user_type") { - to_remove.push_back(&inst); - } else if (!other_uses_for_decorate_string && - ext_name == "SPV_GOOGLE_decorate_string") { - to_remove.push_back(&inst); - } else if (ext_name == "SPV_KHR_non_semantic_info") { - to_remove.push_back(&inst); - } - } - - // remove any extended inst imports that are non semantic - std::unordered_set non_semantic_sets; - for (auto& inst : context()->module()->ext_inst_imports()) { - assert(inst.opcode() == SpvOpExtInstImport && - "Expecting an import of an extension's instruction set."); - const std::string extension_name = inst.GetInOperand(0).AsString(); - if (spvtools::utils::starts_with(extension_name, "NonSemantic.")) { - non_semantic_sets.insert(inst.result_id()); - to_remove.push_back(&inst); - } - } - - // if we removed some non-semantic sets, then iterate over the instructions in - // the module to remove any OpExtInst that referenced those sets - if (!non_semantic_sets.empty()) { - context()->module()->ForEachInst( - [&non_semantic_sets, &to_remove](Instruction* inst) { - if (inst->opcode() == SpvOpExtInst) { - if (non_semantic_sets.find(inst->GetSingleWordInOperand(0)) != - non_semantic_sets.end()) { - to_remove.push_back(inst); - } - } - }, - true); - } - - for (auto* inst : to_remove) { - modified = true; - context()->KillInst(inst); - } - - return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; -} - -} // namespace opt -} // namespace spvtools diff --git a/source/opt/strip_nonsemantic_info_pass.h b/source/opt/strip_nonsemantic_info_pass.h deleted file mode 100644 index ff4e2e1d..00000000 --- a/source/opt/strip_nonsemantic_info_pass.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SOURCE_OPT_STRIP_NONSEMANTIC_INFO_PASS_H_ -#define SOURCE_OPT_STRIP_NONSEMANTIC_INFO_PASS_H_ - -#include "source/opt/ir_context.h" -#include "source/opt/module.h" -#include "source/opt/pass.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class StripNonSemanticInfoPass : public Pass { - public: - const char* name() const override { return "strip-nonsemantic"; } - Status Process() override; - - // Return the mask of preserved Analyses. - IRContext::Analysis GetPreservedAnalyses() override { - return IRContext::kAnalysisInstrToBlockMapping | - IRContext::kAnalysisCombinators | IRContext::kAnalysisCFG | - IRContext::kAnalysisDominatorAnalysis | - IRContext::kAnalysisLoopAnalysis | IRContext::kAnalysisNameMap | - IRContext::kAnalysisConstants | IRContext::kAnalysisTypes; - } -}; - -} // namespace opt -} // namespace spvtools - -#endif // SOURCE_OPT_STRIP_NONSEMANTIC_INFO_PASS_H_ diff --git a/source/opt/value_number_table.cpp b/source/opt/value_number_table.cpp index 5271e3fe..32d6de94 100644 --- a/source/opt/value_number_table.cpp +++ b/source/opt/value_number_table.cpp @@ -50,7 +50,7 @@ uint32_t ValueNumberTable::AssignValueNumber(Instruction* inst) { // OpSampledImage and OpImage must remain in the same basic block in which // they are used, because of this we will assign each one it own value number. if (!context()->IsCombinatorInstruction(inst) && - !inst->IsCommonDebugInstr()) { + !inst->IsOpenCL100DebugInstr()) { value = TakeNextValueNumber(); id_to_value_[inst->result_id()] = value; return value; diff --git a/source/opt/vector_dce.cpp b/source/opt/vector_dce.cpp index 3c9f9446..14a55c1e 100644 --- a/source/opt/vector_dce.cpp +++ b/source/opt/vector_dce.cpp @@ -52,7 +52,7 @@ void VectorDCE::FindLiveComponents(Function* function, // components are live because of arbitrary nesting of structs. function->ForEachInst( [&work_list, this, live_components](Instruction* current_inst) { - if (current_inst->IsCommonDebugInstr()) { + if (current_inst->IsOpenCL100DebugInstr()) { return; } if (!HasVectorOrScalarResult(current_inst) || @@ -394,7 +394,7 @@ void VectorDCE::MarkDebugValueUsesAsDead( Instruction* composite, std::vector* dead_dbg_value) { context()->get_def_use_mgr()->ForEachUser( composite, [&dead_dbg_value](Instruction* use) { - if (use->GetCommonDebugOpcode() == CommonDebugInfoDebugValue) + if (use->GetOpenCL100DebugOpcode() == OpenCLDebugInfo100DebugValue) dead_dbg_value->push_back(use); }); } diff --git a/source/print.cpp b/source/print.cpp index 2418c5bc..128587ae 100644 --- a/source/print.cpp +++ b/source/print.cpp @@ -15,7 +15,7 @@ #include "source/print.h" #if defined(SPIRV_ANDROID) || defined(SPIRV_LINUX) || defined(SPIRV_MAC) || \ - defined(SPIRV_IOS) || defined(SPIRV_TVOS) || defined(SPIRV_FREEBSD) || \ + defined(SPIRV_IOS) || defined(SPIRV_FREEBSD) || \ defined(SPIRV_EMSCRIPTEN) || defined(SPIRV_FUCHSIA) namespace spvtools { diff --git a/source/reduce/BUILD.gn b/source/reduce/BUILD.gn index 8feaf3a9..d05873ed 100644 --- a/source/reduce/BUILD.gn +++ b/source/reduce/BUILD.gn @@ -56,8 +56,8 @@ ohos_source_set("deqp_spirvtool_reduce_source") { "//third_party/spirv-tools/source/reduce/remove_unused_struct_member_reduction_opportunity_finder.cpp", "//third_party/spirv-tools/source/reduce/simple_conditional_branch_to_branch_opportunity_finder.cpp", "//third_party/spirv-tools/source/reduce/simple_conditional_branch_to_branch_reduction_opportunity.cpp", - "//third_party/spirv-tools/source/reduce/structured_construct_to_block_reduction_opportunity.cpp", - "//third_party/spirv-tools/source/reduce/structured_construct_to_block_reduction_opportunity_finder.cpp", + #"//third_party/spirv-tools/source/reduce/structured_construct_to_block_reduction_opportunity.cpp", + #"//third_party/spirv-tools/source/reduce/structured_construct_to_block_reduction_opportunity_finder.cpp", "//third_party/spirv-tools/source/reduce/structured_loop_to_selection_reduction_opportunity.cpp", "//third_party/spirv-tools/source/reduce/structured_loop_to_selection_reduction_opportunity_finder.cpp", @@ -80,4 +80,4 @@ ohos_static_library("libdeqp_spirvtools-reduce") { "//third_party/spirv-tools/source/opt:libdeqp_spirvtools-opt",] part_name = "graphic_standard" subsystem_name = "graphic" -} \ No newline at end of file +} diff --git a/source/reduce/CMakeLists.txt b/source/reduce/CMakeLists.txt index 6fd8409f..a3291c77 100644 --- a/source/reduce/CMakeLists.txt +++ b/source/reduce/CMakeLists.txt @@ -14,8 +14,6 @@ set(SPIRV_TOOLS_REDUCE_SOURCES change_operand_reduction_opportunity.h change_operand_to_undef_reduction_opportunity.h - conditional_branch_to_simple_conditional_branch_opportunity_finder.h - conditional_branch_to_simple_conditional_branch_reduction_opportunity.h merge_blocks_reduction_opportunity.h merge_blocks_reduction_opportunity_finder.h operand_to_const_reduction_opportunity_finder.h @@ -36,17 +34,15 @@ set(SPIRV_TOOLS_REDUCE_SOURCES remove_struct_member_reduction_opportunity.h remove_unused_instruction_reduction_opportunity_finder.h remove_unused_struct_member_reduction_opportunity_finder.h - simple_conditional_branch_to_branch_opportunity_finder.h - simple_conditional_branch_to_branch_reduction_opportunity.h - structured_construct_to_block_reduction_opportunity.h - structured_construct_to_block_reduction_opportunity_finder.h structured_loop_to_selection_reduction_opportunity.h structured_loop_to_selection_reduction_opportunity_finder.h + conditional_branch_to_simple_conditional_branch_opportunity_finder.h + conditional_branch_to_simple_conditional_branch_reduction_opportunity.h + simple_conditional_branch_to_branch_opportunity_finder.h + simple_conditional_branch_to_branch_reduction_opportunity.h change_operand_reduction_opportunity.cpp change_operand_to_undef_reduction_opportunity.cpp - conditional_branch_to_simple_conditional_branch_opportunity_finder.cpp - conditional_branch_to_simple_conditional_branch_reduction_opportunity.cpp merge_blocks_reduction_opportunity.cpp merge_blocks_reduction_opportunity_finder.cpp operand_to_const_reduction_opportunity_finder.cpp @@ -67,12 +63,12 @@ set(SPIRV_TOOLS_REDUCE_SOURCES remove_struct_member_reduction_opportunity.cpp remove_unused_instruction_reduction_opportunity_finder.cpp remove_unused_struct_member_reduction_opportunity_finder.cpp - simple_conditional_branch_to_branch_opportunity_finder.cpp - simple_conditional_branch_to_branch_reduction_opportunity.cpp - structured_construct_to_block_reduction_opportunity.cpp - structured_construct_to_block_reduction_opportunity_finder.cpp structured_loop_to_selection_reduction_opportunity.cpp structured_loop_to_selection_reduction_opportunity_finder.cpp + conditional_branch_to_simple_conditional_branch_opportunity_finder.cpp + conditional_branch_to_simple_conditional_branch_reduction_opportunity.cpp + simple_conditional_branch_to_branch_opportunity_finder.cpp + simple_conditional_branch_to_branch_reduction_opportunity.cpp ) if(MSVC AND (NOT ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))) diff --git a/source/reduce/change_operand_reduction_opportunity.cpp b/source/reduce/change_operand_reduction_opportunity.cpp index 18e340bf..c3f6fd7b 100644 --- a/source/reduce/change_operand_reduction_opportunity.cpp +++ b/source/reduce/change_operand_reduction_opportunity.cpp @@ -14,8 +14,6 @@ #include "source/reduce/change_operand_reduction_opportunity.h" -#include "source/opt/ir_context.h" - namespace spvtools { namespace reduce { @@ -28,7 +26,6 @@ bool ChangeOperandReductionOpportunity::PreconditionHolds() { void ChangeOperandReductionOpportunity::Apply() { inst_->SetOperand(operand_index_, {new_id_}); - inst_->context()->get_def_use_mgr()->UpdateDefUse(inst_); } } // namespace reduce diff --git a/source/reduce/change_operand_to_undef_reduction_opportunity.cpp b/source/reduce/change_operand_to_undef_reduction_opportunity.cpp index 7cc06a03..8e33da66 100644 --- a/source/reduce/change_operand_to_undef_reduction_opportunity.cpp +++ b/source/reduce/change_operand_to_undef_reduction_opportunity.cpp @@ -35,7 +35,6 @@ void ChangeOperandToUndefReductionOpportunity::Apply() { assert(operand_type_id); auto undef_id = FindOrCreateGlobalUndef(context_, operand_type_id); inst_->SetOperand(operand_index_, {undef_id}); - context_->InvalidateAnalyses(opt::IRContext::kAnalysisDefUse); } } // namespace reduce diff --git a/source/reduce/reducer.cpp b/source/reduce/reducer.cpp index b752f415..16bb94fe 100644 --- a/source/reduce/reducer.cpp +++ b/source/reduce/reducer.cpp @@ -28,7 +28,6 @@ #include "source/reduce/remove_unused_instruction_reduction_opportunity_finder.h" #include "source/reduce/remove_unused_struct_member_reduction_opportunity_finder.h" #include "source/reduce/simple_conditional_branch_to_branch_opportunity_finder.h" -#include "source/reduce/structured_construct_to_block_reduction_opportunity_finder.h" #include "source/reduce/structured_loop_to_selection_reduction_opportunity_finder.h" #include "source/spirv_reducer_options.h" @@ -113,8 +112,6 @@ void Reducer::AddDefaultReductionPasses() { spvtools::MakeUnique()); AddReductionPass( spvtools::MakeUnique()); - AddReductionPass(spvtools::MakeUnique< - StructuredConstructToBlockReductionOpportunityFinder>()); AddReductionPass(spvtools::MakeUnique< StructuredLoopToSelectionReductionOpportunityFinder>()); AddReductionPass( @@ -144,7 +141,7 @@ void Reducer::AddReductionPass( std::unique_ptr finder) { passes_.push_back( spvtools::MakeUnique(target_env_, std::move(finder))); -} +} void Reducer::AddCleanupReductionPass( std::unique_ptr finder) { diff --git a/source/reduce/remove_block_reduction_opportunity.cpp b/source/reduce/remove_block_reduction_opportunity.cpp index 55e95769..aa481059 100644 --- a/source/reduce/remove_block_reduction_opportunity.cpp +++ b/source/reduce/remove_block_reduction_opportunity.cpp @@ -20,11 +20,12 @@ namespace spvtools { namespace reduce { RemoveBlockReductionOpportunity::RemoveBlockReductionOpportunity( - opt::IRContext* context, opt::Function* function, opt::BasicBlock* block) - : context_(context), function_(function), block_(block) { + opt::Function* function, opt::BasicBlock* block) + : function_(function), block_(block) { // precondition: assert(block_->begin() != block_->end() && - context_->get_def_use_mgr()->NumUsers(block_->id()) == 0 && + block_->begin()->context()->get_def_use_mgr()->NumUsers( + block_->id()) == 0 && "RemoveBlockReductionOpportunity block must have 0 references"); } @@ -37,8 +38,10 @@ void RemoveBlockReductionOpportunity::Apply() { // We need an iterator pointing to the block, hence the loop. for (auto bi = function_->begin(); bi != function_->end(); ++bi) { if (bi->id() == block_->id()) { + bi->KillAllInsts(true); bi.Erase(); - context_->InvalidateAnalysesExceptFor(opt::IRContext::kAnalysisNone); + // Block removal changes the function, but we don't use analyses, so no + // need to invalidate them. return; } } diff --git a/source/reduce/remove_block_reduction_opportunity.h b/source/reduce/remove_block_reduction_opportunity.h index 03fede52..4b358abc 100644 --- a/source/reduce/remove_block_reduction_opportunity.h +++ b/source/reduce/remove_block_reduction_opportunity.h @@ -27,8 +27,7 @@ namespace reduce { class RemoveBlockReductionOpportunity : public ReductionOpportunity { public: // Creates the opportunity to remove |block| in |function| in |context|. - RemoveBlockReductionOpportunity(opt::IRContext* context, - opt::Function* function, + RemoveBlockReductionOpportunity(opt::Function* function, opt::BasicBlock* block); bool PreconditionHolds() override; @@ -37,7 +36,6 @@ class RemoveBlockReductionOpportunity : public ReductionOpportunity { void Apply() override; private: - opt::IRContext* context_; opt::Function* function_; opt::BasicBlock* block_; }; diff --git a/source/reduce/remove_block_reduction_opportunity_finder.cpp b/source/reduce/remove_block_reduction_opportunity_finder.cpp index 3b13728a..27a4570c 100644 --- a/source/reduce/remove_block_reduction_opportunity_finder.cpp +++ b/source/reduce/remove_block_reduction_opportunity_finder.cpp @@ -32,8 +32,8 @@ RemoveBlockReductionOpportunityFinder::GetAvailableOpportunities( for (auto* function : GetTargetFunctions(context, target_function)) { for (auto bi = function->begin(); bi != function->end(); ++bi) { if (IsBlockValidOpportunity(context, function, &bi)) { - result.push_back(MakeUnique( - context, function, &*bi)); + result.push_back( + MakeUnique(function, &*bi)); } } } diff --git a/source/reduce/remove_function_reduction_opportunity.cpp b/source/reduce/remove_function_reduction_opportunity.cpp index 4b85058b..ecad6707 100644 --- a/source/reduce/remove_function_reduction_opportunity.cpp +++ b/source/reduce/remove_function_reduction_opportunity.cpp @@ -29,8 +29,8 @@ void RemoveFunctionReductionOpportunity::Apply() { for (opt::Module::iterator function_it = context_->module()->begin(); function_it != context_->module()->end(); ++function_it) { if (&*function_it == function_) { - function_it.Erase(); - context_->InvalidateAnalysesExceptFor(opt::IRContext::kAnalysisNone); + opt::eliminatedeadfunctionsutil::EliminateFunction(context_, + &function_it); return; } } diff --git a/source/reduce/remove_struct_member_reduction_opportunity.cpp b/source/reduce/remove_struct_member_reduction_opportunity.cpp index da096e1e..787c629b 100644 --- a/source/reduce/remove_struct_member_reduction_opportunity.cpp +++ b/source/reduce/remove_struct_member_reduction_opportunity.cpp @@ -129,8 +129,6 @@ void RemoveStructMemberReductionOpportunity::Apply() { // Remove the member from the struct type. struct_type_->RemoveInOperand(member_index_); - - context->InvalidateAnalysesExceptFor(opt::IRContext::kAnalysisNone); } void RemoveStructMemberReductionOpportunity::AdjustAccessedIndices( diff --git a/source/reduce/simple_conditional_branch_to_branch_reduction_opportunity.cpp b/source/reduce/simple_conditional_branch_to_branch_reduction_opportunity.cpp index a2be0c4d..ca17f9eb 100644 --- a/source/reduce/simple_conditional_branch_to_branch_reduction_opportunity.cpp +++ b/source/reduce/simple_conditional_branch_to_branch_reduction_opportunity.cpp @@ -51,8 +51,6 @@ void SimpleConditionalBranchToBranchReductionOpportunity::Apply() { {{SPV_OPERAND_TYPE_ID, {conditional_branch_instruction_->GetSingleWordInOperand( kTrueBranchOperandIndex)}}}); - conditional_branch_instruction_->context()->InvalidateAnalysesExceptFor( - opt::IRContext::kAnalysisNone); } } // namespace reduce diff --git a/source/reduce/structured_construct_to_block_reduction_opportunity.cpp b/source/reduce/structured_construct_to_block_reduction_opportunity.cpp deleted file mode 100644 index ed738411..00000000 --- a/source/reduce/structured_construct_to_block_reduction_opportunity.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) 2021 Alastair F. Donaldson -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/reduce/structured_construct_to_block_reduction_opportunity.h" - -namespace spvtools { -namespace reduce { - -bool StructuredConstructToBlockReductionOpportunity::PreconditionHolds() { - return context_->get_def_use_mgr()->GetDef(construct_header_) != nullptr; -} - -void StructuredConstructToBlockReductionOpportunity::Apply() { - auto header_block = context_->cfg()->block(construct_header_); - auto merge_block = context_->cfg()->block(header_block->MergeBlockId()); - - auto* enclosing_function = header_block->GetParent(); - - // A region of blocks is defined in terms of dominators and post-dominators, - // so we compute these for the enclosing function. - auto* dominators = context_->GetDominatorAnalysis(enclosing_function); - auto* postdominators = context_->GetPostDominatorAnalysis(enclosing_function); - - // For each block in the function, determine whether it is inside the region. - // If it is, delete it. - for (auto block_it = enclosing_function->begin(); - block_it != enclosing_function->end();) { - if (header_block != &*block_it && merge_block != &*block_it && - dominators->Dominates(header_block, &*block_it) && - postdominators->Dominates(merge_block, &*block_it)) { - block_it = block_it.Erase(); - } else { - ++block_it; - } - } - // Having removed some blocks from the module it is necessary to invalidate - // analyses, since the remaining patch-up work depends on various analyses - // which will otherwise reference blocks that have been deleted. - context_->InvalidateAnalysesExceptFor(opt::IRContext::kAnalysisNone); - - // We demote the header of the region to a regular block by deleting its merge - // instruction. - context_->KillInst(header_block->GetMergeInst()); - - // The terminator for the header block is changed to be an unconditional - // branch to the merge block. - header_block->terminator()->SetOpcode(SpvOpBranch); - header_block->terminator()->SetInOperands( - {{SPV_OPERAND_TYPE_ID, {merge_block->id()}}}); - - // This is an intrusive change, so we invalidate all analyses. - context_->InvalidateAnalysesExceptFor(opt::IRContext::kAnalysisNone); -} - -} // namespace reduce -} // namespace spvtools diff --git a/source/reduce/structured_construct_to_block_reduction_opportunity.h b/source/reduce/structured_construct_to_block_reduction_opportunity.h deleted file mode 100644 index f461a2f0..00000000 --- a/source/reduce/structured_construct_to_block_reduction_opportunity.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) 2021 Alastair F. Donaldson -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SOURCE_REDUCE_STRUCTURED_CONSTRUCT_TO_BLOCK_REDUCTION_OPPORTUNITY_H_ -#define SOURCE_REDUCE_STRUCTURED_CONSTRUCT_TO_BLOCK_REDUCTION_OPPORTUNITY_H_ - -#include "source/opt/ir_context.h" -#include "source/reduce/reduction_opportunity.h" - -namespace spvtools { -namespace reduce { - -// An opportunity to replace a skeletal structured control flow construct with a -// single block. -class StructuredConstructToBlockReductionOpportunity - : public ReductionOpportunity { - public: - // Constructs an opportunity from a header block id. - StructuredConstructToBlockReductionOpportunity(opt::IRContext* context, - uint32_t construct_header) - : context_(context), construct_header_(construct_header) {} - - // Returns true if and only if |construct_header_| exists in the module - - // another opportunity may have removed it. - bool PreconditionHolds() override; - - protected: - void Apply() override; - - private: - opt::IRContext* context_; - uint32_t construct_header_; -}; - -} // namespace reduce -} // namespace spvtools - -#endif // SOURCE_REDUCE_STRUCTURED_CONSTRUCT_TO_BLOCK_REDUCTION_OPPORTUNITY_H_ diff --git a/source/reduce/structured_construct_to_block_reduction_opportunity_finder.cpp b/source/reduce/structured_construct_to_block_reduction_opportunity_finder.cpp deleted file mode 100644 index dc20f689..00000000 --- a/source/reduce/structured_construct_to_block_reduction_opportunity_finder.cpp +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) 2021 Alastair F. Donaldson -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/reduce/structured_construct_to_block_reduction_opportunity_finder.h" - -#include - -#include "source/reduce/structured_construct_to_block_reduction_opportunity.h" - -namespace spvtools { -namespace reduce { - -std::vector> -StructuredConstructToBlockReductionOpportunityFinder::GetAvailableOpportunities( - opt::IRContext* context, uint32_t target_function) const { - std::vector> result; - - // Consider every function in the module. - for (auto* function : GetTargetFunctions(context, target_function)) { - // For every header block in the function, there is potentially a region of - // blocks that could be collapsed. - std::unordered_map> - regions; - - // Regions are identified using dominators and postdominators, so we compute - // those for the function. - auto* dominators = context->GetDominatorAnalysis(function); - auto* postdominators = context->GetPostDominatorAnalysis(function); - - // Consider every block in the function. - for (auto& block : *function) { - // If a block has an unreachable predecessor then folding away a region in - // which that block is contained gets complicated, so we ignore regions - // that contain such blocks. We note whether this block suffers from this - // problem. - bool has_unreachable_predecessor = - HasUnreachablePredecessor(block, context); - - // Look through all the regions we have identified so far to see whether - // this block is part of a region, or spoils a region (by having an - // unreachable predecessor). - for (auto entry = regions.begin(); entry != regions.end();) { - // |block| is in this region if it is dominated by the header, - // post-dominated by the merge, and different from the merge. - assert(&block != entry->first && - "The block should not be the region's header because we only " - "make a region when we encounter its header."); - if (entry->first->MergeBlockId() != block.id() && - dominators->Dominates(entry->first, &block) && - postdominators->Dominates( - entry->first->GetMergeInst()->GetSingleWordInOperand(0), - block.id())) { - if (has_unreachable_predecessor) { - // The block would be in this region, but it has an unreachable - // predecessor. This spoils the region, so we remove it. - entry = regions.erase(entry); - continue; - } else { - // Add the block to the region. - entry->second.insert(&block); - } - } - ++entry; - } - if (block.MergeBlockIdIfAny() == 0) { - // The block isn't a header, so it doesn't constitute a new region. - continue; - } - if (!context->IsReachable(block)) { - // The block isn't reachable, so it doesn't constitute a new region. - continue; - } - auto* merge_block = context->cfg()->block( - block.GetMergeInst()->GetSingleWordInOperand(0)); - if (!context->IsReachable(*merge_block)) { - // The block's merge is unreachable, so it doesn't constitute a new - // region. - continue; - } - assert(dominators->Dominates(&block, merge_block) && - "The merge block is reachable, so the header must dominate it"); - if (!postdominators->Dominates(merge_block, &block)) { - // The block is not post-dominated by its merge. This happens for - // instance when there is a break from a conditional, or an early exit. - // This also means that we don't add a region. - continue; - } - // We have a reachable header block with a rechable merge that - // postdominates the header: this means we have a new region. - regions.emplace(&block, std::unordered_set()); - } - - // Now that we have found all the regions and blocks within them, we check - // whether any region defines an id that is used outside the region. If this - // is *not* the case, then we have an opportunity to collapse the region - // down to its header block and merge block. - for (auto& entry : regions) { - if (DefinitionsRestrictedToRegion(*entry.first, entry.second, context)) { - result.emplace_back( - MakeUnique( - context, entry.first->id())); - } - } - } - return result; -} - -bool StructuredConstructToBlockReductionOpportunityFinder:: - DefinitionsRestrictedToRegion( - const opt::BasicBlock& header, - const std::unordered_set& region, - opt::IRContext* context) { - // Consider every block in the region. - for (auto& block : region) { - // Consider every instruction in the block - this includes the label - // instruction - if (!block->WhileEachInst( - [context, &header, ®ion](opt::Instruction* inst) -> bool { - if (inst->result_id() == 0) { - // The instruction does not genreate a result id, thus it cannot - // be referred to outside the region - this is fine. - return true; - } - // Consider every use of the instruction's result id. - if (!context->get_def_use_mgr()->WhileEachUse( - inst->result_id(), - [context, &header, ®ion](opt::Instruction* user, - uint32_t) -> bool { - auto user_block = context->get_instr_block(user); - if (user == header.GetMergeInst() || - user == header.terminator()) { - // We are going to delete the header's merge - // instruction and rewrite its terminator, so it does - // not matter if the user is one of these - // instructions. - return true; - } - if (user_block == nullptr || - region.count(user_block) == 0) { - // The user is either a global instruction, or an - // instruction in a block outside the region. Removing - // the region would invalidate this user. - return false; - } - return true; - })) { - return false; - } - return true; - })) { - return false; - } - } - return true; -} - -bool StructuredConstructToBlockReductionOpportunityFinder:: - HasUnreachablePredecessor(const opt::BasicBlock& block, - opt::IRContext* context) { - for (auto pred : context->cfg()->preds(block.id())) { - if (!context->IsReachable(*context->cfg()->block(pred))) { - return true; - } - } - return false; -} - -std::string StructuredConstructToBlockReductionOpportunityFinder::GetName() - const { - return "StructuredConstructToBlockReductionOpportunityFinder"; -} - -} // namespace reduce -} // namespace spvtools diff --git a/source/reduce/structured_construct_to_block_reduction_opportunity_finder.h b/source/reduce/structured_construct_to_block_reduction_opportunity_finder.h deleted file mode 100644 index 28bbc17c..00000000 --- a/source/reduce/structured_construct_to_block_reduction_opportunity_finder.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 2021 Alastair F. Donaldson -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SOURCE_REDUCE_STRUCTURED_CONSTRUCT_TO_BLOCK_REDUCTION_OPPORTUNITY_FINDER_H -#define SOURCE_REDUCE_STRUCTURED_CONSTRUCT_TO_BLOCK_REDUCTION_OPPORTUNITY_FINDER_H - -#include "source/reduce/reduction_opportunity_finder.h" - -namespace spvtools { -namespace reduce { - -// A finder for opportunities to replace a skeletal structured control flow -// construct - that is, a construct that does not define anything that's used -// outside the construct - into its header block. -class StructuredConstructToBlockReductionOpportunityFinder - : public ReductionOpportunityFinder { - public: - StructuredConstructToBlockReductionOpportunityFinder() = default; - - ~StructuredConstructToBlockReductionOpportunityFinder() override = default; - - std::string GetName() const final; - - std::vector> GetAvailableOpportunities( - opt::IRContext* context, uint32_t target_function) const final; - - private: - // Returns true if and only if all instructions defined in |region| are used - // only inside |region|, with the exception that they may be used by the merge - // or terminator instruction of |header|, which must be the header block for - // the region. - static bool DefinitionsRestrictedToRegion( - const opt::BasicBlock& header, - const std::unordered_set& region, - opt::IRContext* context); - - // Returns true if and only if |block| has at least one predecessor that is - // unreachable in the control flow graph of its function. - static bool HasUnreachablePredecessor(const opt::BasicBlock& block, - opt::IRContext* context); -}; - -} // namespace reduce -} // namespace spvtools - -#endif // SOURCE_REDUCE_STRUCTURED_CONSTRUCT_TO_BLOCK_REDUCTION_OPPORTUNITY_FINDER_H diff --git a/source/reduce/structured_loop_to_selection_reduction_opportunity.cpp b/source/reduce/structured_loop_to_selection_reduction_opportunity.cpp index 850af456..0c004439 100644 --- a/source/reduce/structured_loop_to_selection_reduction_opportunity.cpp +++ b/source/reduce/structured_loop_to_selection_reduction_opportunity.cpp @@ -27,14 +27,16 @@ const uint32_t kMergeNodeIndex = 0; bool StructuredLoopToSelectionReductionOpportunity::PreconditionHolds() { // Is the loop header reachable? - return loop_construct_header_->GetLabel()->context()->IsReachable( - *loop_construct_header_); + return loop_construct_header_->GetLabel() + ->context() + ->GetDominatorAnalysis(enclosing_function_) + ->IsReachable(loop_construct_header_); } void StructuredLoopToSelectionReductionOpportunity::Apply() { // Force computation of dominator analysis, CFG and structured CFG analysis // before we start to mess with edges in the function. - context_->GetDominatorAnalysis(loop_construct_header_->GetParent()); + context_->GetDominatorAnalysis(enclosing_function_); context_->cfg(); context_->GetStructuredCFGAnalysis(); @@ -76,7 +78,8 @@ void StructuredLoopToSelectionReductionOpportunity::RedirectToClosestMergeBlock( } already_seen.insert(pred); - if (!context_->IsReachable(*context_->cfg()->block(pred))) { + if (!context_->GetDominatorAnalysis(enclosing_function_) + ->IsReachable(pred)) { // We do not care about unreachable predecessors (and dominance // information, and thus the notion of structured control flow, makes // little sense for unreachable blocks). @@ -213,7 +216,7 @@ void StructuredLoopToSelectionReductionOpportunity::ChangeLoopToSelection() { void StructuredLoopToSelectionReductionOpportunity::FixNonDominatedIdUses() { // Consider each instruction in the function. - for (auto& block : *loop_construct_header_->GetParent()) { + for (auto& block : *enclosing_function_) { for (auto& def : block) { if (def.opcode() == SpvOpVariable) { // Variables are defined at the start of the function, and can be @@ -240,7 +243,7 @@ void StructuredLoopToSelectionReductionOpportunity::FixNonDominatedIdUses() { case SpvStorageClassFunction: use->SetOperand( index, {FindOrCreateFunctionVariable( - context_, loop_construct_header_->GetParent(), + context_, enclosing_function_, context_->get_type_mgr()->GetId(pointer_type))}); break; default: @@ -273,11 +276,11 @@ bool StructuredLoopToSelectionReductionOpportunity:: if (use->opcode() == SpvOpPhi) { // A use in a phi doesn't need to be dominated by its definition, but the // associated parent block does need to be dominated by the definition. - return context_->GetDominatorAnalysis(loop_construct_header_->GetParent()) + return context_->GetDominatorAnalysis(enclosing_function_) ->Dominates(def_block.id(), use->GetSingleWordOperand(use_index + 1)); } // In non-phi cases, a use needs to be dominated by its definition. - return context_->GetDominatorAnalysis(loop_construct_header_->GetParent()) + return context_->GetDominatorAnalysis(enclosing_function_) ->Dominates(def, use); } diff --git a/source/reduce/structured_loop_to_selection_reduction_opportunity.h b/source/reduce/structured_loop_to_selection_reduction_opportunity.h index 0e3c840a..4c576196 100644 --- a/source/reduce/structured_loop_to_selection_reduction_opportunity.h +++ b/source/reduce/structured_loop_to_selection_reduction_opportunity.h @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef SOURCE_REDUCE_STRUCTURED_LOOP_TO_SELECTION_REDUCTION_OPPORTUNITY_H_ -#define SOURCE_REDUCE_STRUCTURED_LOOP_TO_SELECTION_REDUCTION_OPPORTUNITY_H_ +#ifndef SOURCE_REDUCE_CUT_LOOP_REDUCTION_OPPORTUNITY_H_ +#define SOURCE_REDUCE_CUT_LOOP_REDUCTION_OPPORTUNITY_H_ #include "source/opt/def_use_manager.h" #include "source/opt/dominator_analysis.h" @@ -30,8 +30,11 @@ class StructuredLoopToSelectionReductionOpportunity // Constructs an opportunity from a loop header block and the function that // encloses it. explicit StructuredLoopToSelectionReductionOpportunity( - opt::IRContext* context, opt::BasicBlock* loop_construct_header) - : context_(context), loop_construct_header_(loop_construct_header) {} + opt::IRContext* context, opt::BasicBlock* loop_construct_header, + opt::Function* enclosing_function) + : context_(context), + loop_construct_header_(loop_construct_header), + enclosing_function_(enclosing_function) {} // Returns true if the loop header is reachable. A structured loop might // become unreachable as a result of turning another structured loop into @@ -85,9 +88,10 @@ class StructuredLoopToSelectionReductionOpportunity opt::IRContext* context_; opt::BasicBlock* loop_construct_header_; + opt::Function* enclosing_function_; }; } // namespace reduce } // namespace spvtools -#endif // SOURCE_REDUCE_STRUCTURED_LOOP_TO_SELECTION_REDUCTION_OPPORTUNITY_H_ +#endif // SOURCE_REDUCE_CUT_LOOP_REDUCTION_OPPORTUNITY_H_ diff --git a/source/reduce/structured_loop_to_selection_reduction_opportunity_finder.cpp b/source/reduce/structured_loop_to_selection_reduction_opportunity_finder.cpp index 3fe61280..fdf3ab04 100644 --- a/source/reduce/structured_loop_to_selection_reduction_opportunity_finder.cpp +++ b/source/reduce/structured_loop_to_selection_reduction_opportunity_finder.cpp @@ -86,8 +86,8 @@ StructuredLoopToSelectionReductionOpportunityFinder::GetAvailableOpportunities( // We can turn this structured loop into a selection, so add the // opportunity to do so. result.push_back( - MakeUnique(context, - &block)); + MakeUnique( + context, &block, function)); } } return result; diff --git a/source/spirv_validator_options.h b/source/spirv_validator_options.h index a357c031..ff283cab 100644 --- a/source/spirv_validator_options.h +++ b/source/spirv_validator_options.h @@ -47,7 +47,7 @@ struct spv_validator_options_t { scalar_block_layout(false), workgroup_scalar_block_layout(false), skip_block_layout(false), - allow_localsizeid(false), + allow_localsizeid(false), before_hlsl_legalization(false) {} validator_universal_limits_t universal_limits_; diff --git a/source/util/hash_combine.h b/source/util/hash_combine.h deleted file mode 100644 index 1a2dbc33..00000000 --- a/source/util/hash_combine.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) 2022 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SOURCE_UTIL_HASH_COMBINE_H_ -#define SOURCE_UTIL_HASH_COMBINE_H_ - -#include -#include -#include - -namespace spvtools { -namespace utils { - -// Helpers for incrementally computing hashes. -// For reference, see -// http://open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3876.pdf - -template -inline size_t hash_combine(std::size_t seed, const T& val) { - return seed ^ (std::hash()(val) + 0x9e3779b9 + (seed << 6) + (seed >> 2)); -} - -template -inline size_t hash_combine(std::size_t hash, const std::vector& vals) { - for (const T& val : vals) { - hash = hash_combine(hash, val); - } - return hash; -} - -inline size_t hash_combine(std::size_t hash) { return hash; } - -template -inline size_t hash_combine(std::size_t hash, const T& val, - const Types&... args) { - return hash_combine(hash_combine(hash, val), args...); -} - -} // namespace utils -} // namespace spvtools - -#endif // SOURCE_UTIL_HASH_COMBINE_H_ diff --git a/source/util/pooled_linked_list.h b/source/util/pooled_linked_list.h deleted file mode 100644 index faaa4c44..00000000 --- a/source/util/pooled_linked_list.h +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright (c) 2021 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SOURCE_UTIL_POOLED_LINKED_LIST_H_ -#define SOURCE_UTIL_POOLED_LINKED_LIST_H_ - -#include -#include - -namespace spvtools { -namespace utils { - -// Shared storage of nodes for PooledLinkedList. -template -class PooledLinkedListNodes { - public: - struct Node { - Node(T e, int32_t n = -1) : element(e), next(n) {} - - T element = {}; - int32_t next = -1; - }; - - PooledLinkedListNodes() = default; - PooledLinkedListNodes(const PooledLinkedListNodes&) = delete; - PooledLinkedListNodes& operator=(const PooledLinkedListNodes&) = delete; - - PooledLinkedListNodes(PooledLinkedListNodes&& that) { - *this = std::move(that); - } - - PooledLinkedListNodes& operator=(PooledLinkedListNodes&& that) { - vec_ = std::move(that.vec_); - free_nodes_ = that.free_nodes_; - return *this; - } - - size_t total_nodes() { return vec_.size(); } - size_t free_nodes() { return free_nodes_; } - size_t used_nodes() { return total_nodes() - free_nodes(); } - - private: - template - friend class PooledLinkedList; - - Node& at(int32_t index) { return vec_[index]; } - const Node& at(int32_t index) const { return vec_[index]; } - - int32_t insert(T element) { - int32_t index = int32_t(vec_.size()); - vec_.emplace_back(element); - return index; - } - - std::vector vec_; - size_t free_nodes_ = 0; -}; - -// Implements a linked-list where list nodes come from a shared pool. This is -// meant to be used in scenarios where it is desirable to avoid many small -// allocations. -// -// Instead of pointers, the list uses indices to allow the underlying storage -// to be modified without needing to modify the list. When removing elements -// from the list, nodes are not deleted or recycled: to reclaim unused space, -// perform a sequence of |move_nodes| operations into a temporary pool, which -// then is moved into the old pool. -// -// This does *not* attempt to implement a full stl-compatible interface. -template -class PooledLinkedList { - public: - using NodePool = PooledLinkedListNodes; - using Node = typename NodePool::Node; - - PooledLinkedList() = delete; - PooledLinkedList(NodePool* nodes) : nodes_(nodes) {} - - // Shared iterator implementation (for iterator and const_iterator). - template - class iterator_base { - public: - iterator_base(const iterator_base& i) - : nodes_(i.nodes_), index_(i.index_) {} - - iterator_base& operator++() { - index_ = nodes_->at(index_).next; - return *this; - } - - iterator_base& operator=(const iterator_base& i) { - nodes_ = i.nodes_; - index_ = i.index_; - return *this; - } - - ElementT& operator*() const { return nodes_->at(index_).element; } - ElementT* operator->() const { return &nodes_->at(index_).element; } - - friend inline bool operator==(const iterator_base& lhs, - const iterator_base& rhs) { - return lhs.nodes_ == rhs.nodes_ && lhs.index_ == rhs.index_; - } - friend inline bool operator!=(const iterator_base& lhs, - const iterator_base& rhs) { - return lhs.nodes_ != rhs.nodes_ || lhs.index_ != rhs.index_; - } - - // Define standard iterator types needs so this class can be - // used with . - using iterator_category = std::forward_iterator_tag; - using difference_type = std::ptrdiff_t; - using value_type = ElementT; - using pointer = ElementT*; - using const_pointer = const ElementT*; - using reference = ElementT&; - using const_reference = const ElementT&; - using size_type = size_t; - - private: - friend PooledLinkedList; - - iterator_base(PoolT* pool, int32_t index) : nodes_(pool), index_(index) {} - - PoolT* nodes_; - int32_t index_ = -1; - }; - - using iterator = iterator_base>; - using const_iterator = iterator_base>; - - bool empty() const { return head_ == -1; } - - T& front() { return nodes_->at(head_).element; } - T& back() { return nodes_->at(tail_).element; } - const T& front() const { return nodes_->at(head_).element; } - const T& back() const { return nodes_->at(tail_).element; } - - iterator begin() { return iterator(&nodes_->vec_, head_); } - iterator end() { return iterator(&nodes_->vec_, -1); } - const_iterator begin() const { return const_iterator(&nodes_->vec_, head_); } - const_iterator end() const { return const_iterator(&nodes_->vec_, -1); } - - // Inserts |element| at the back of the list. - void push_back(T element) { - int32_t new_tail = nodes_->insert(element); - if (head_ == -1) { - head_ = new_tail; - tail_ = new_tail; - } else { - nodes_->at(tail_).next = new_tail; - tail_ = new_tail; - } - } - - // Removes the first occurrence of |element| from the list. - // Returns if |element| was removed. - bool remove_first(T element) { - int32_t* prev_next = &head_; - for (int32_t prev_index = -1, index = head_; index != -1; /**/) { - auto& node = nodes_->at(index); - if (node.element == element) { - // Snip from of the list, optionally fixing up tail pointer. - if (tail_ == index) { - assert(node.next == -1); - tail_ = prev_index; - } - *prev_next = node.next; - nodes_->free_nodes_++; - return true; - } else { - prev_next = &node.next; - } - prev_index = index; - index = node.next; - } - return false; - } - - // Returns the PooledLinkedListNodes that owns this list's nodes. - NodePool* pool() { return nodes_; } - - // Moves the nodes in this list into |new_pool|, providing a way to compact - // storage and reclaim unused space. - // - // Upon completing a sequence of |move_nodes| calls, you must ensure you - // retain ownership of the new storage your lists point to. Example usage: - // - // unique_ptr new_pool = ...; - // for (PooledLinkedList& list : lists) { - // list.move_to(new_pool); - // } - // my_pool_ = std::move(new_pool); - void move_nodes(NodePool* new_pool) { - // Be sure to construct the list in the same order, instead of simply - // doing a sequence of push_backs. - int32_t prev_entry = -1; - int32_t nodes_freed = 0; - for (int32_t index = head_; index != -1; nodes_freed++) { - const auto& node = nodes_->at(index); - int32_t this_entry = new_pool->insert(node.element); - index = node.next; - if (prev_entry == -1) { - head_ = this_entry; - } else { - new_pool->at(prev_entry).next = this_entry; - } - prev_entry = this_entry; - } - tail_ = prev_entry; - // Update our old pool's free count, now we're a member of the new pool. - nodes_->free_nodes_ += nodes_freed; - nodes_ = new_pool; - } - - private: - NodePool* nodes_; - int32_t head_ = -1; - int32_t tail_ = -1; -}; - -} // namespace utils -} // namespace spvtools - -#endif // SOURCE_UTIL_POOLED_LINKED_LIST_H_ \ No newline at end of file diff --git a/source/val/construct.cpp b/source/val/construct.cpp index 53008690..733856cb 100644 --- a/source/val/construct.cpp +++ b/source/val/construct.cpp @@ -78,12 +78,7 @@ Construct::ConstructBlockSet Construct::blocks(Function* function) const { ConstructBlockSet construct_blocks; std::unordered_set corresponding_headers; for (auto& other : corresponding_constructs()) { - // The corresponding header can be the same block as this construct's - // header for loops with no loop construct. In those cases, don't add the - // loop header as it prevents finding any blocks in the construct. - if (type() != ConstructType::kContinue || other->entry_block() != header) { - corresponding_headers.insert(other->entry_block()); - } + corresponding_headers.insert(other->entry_block()); } std::vector stack; stack.push_back(const_cast(header)); diff --git a/source/val/validate_adjacency.cpp b/source/val/validate_adjacency.cpp index 13720f0e..64655b0d 100644 --- a/source/val/validate_adjacency.cpp +++ b/source/val/validate_adjacency.cpp @@ -60,10 +60,7 @@ spv_result_t ValidateAdjacency(ValidationState_t& _) { // TODO(https://gitlab.khronos.org/spirv/SPIR-V/issues/533): We need // to discuss the location of DebugScope, DebugNoScope, DebugDeclare, // and DebugValue. - // NOTE: This does not apply to the non-semantic vulkan debug info. - if (!spvExtInstIsDebugInfo(inst.ext_inst_type()) || - inst.ext_inst_type() == - SPV_EXT_INST_TYPE_NONSEMANTIC_VULKAN_DEBUGINFO_100) { + if (!spvExtInstIsDebugInfo(inst.ext_inst_type())) { adjacency_status = PHI_AND_VAR_INVALID; } break; diff --git a/source/val/validate_atomics.cpp b/source/val/validate_atomics.cpp index da023b80..fa53ca1f 100644 --- a/source/val/validate_atomics.cpp +++ b/source/val/validate_atomics.cpp @@ -222,13 +222,6 @@ spv_result_t AtomicsPass(ValidationState_t& _, const Instruction* inst) { if (opcode == SpvOpAtomicFAddEXT) { // result type being float checked already - if ((_.GetBitWidth(result_type) == 16) && - (!_.HasCapability(SpvCapabilityAtomicFloat16AddEXT))) { - return _.diag(SPV_ERROR_INVALID_DATA, inst) - << spvOpcodeString(opcode) - << ": float add atomics require the AtomicFloat32AddEXT " - "capability"; - } if ((_.GetBitWidth(result_type) == 32) && (!_.HasCapability(SpvCapabilityAtomicFloat32AddEXT))) { return _.diag(SPV_ERROR_INVALID_DATA, inst) diff --git a/source/val/validate_builtins.cpp b/source/val/validate_builtins.cpp index a6e624f7..9c737ec0 100644 --- a/source/val/validate_builtins.cpp +++ b/source/val/validate_builtins.cpp @@ -2846,7 +2846,7 @@ spv_result_t BuiltInsValidator::ValidateComputeShaderI32Vec3InputAtReference( << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin) - << " to be used only with GLCompute, MeshNV, or TaskNV execution model. " + << " to be used only with GLCompute execution model. " << GetReferenceDesc(decoration, built_in_inst, referenced_inst, referenced_from_inst, execution_model); } @@ -2928,7 +2928,7 @@ spv_result_t BuiltInsValidator::ValidateComputeI32InputAtReference( << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin) - << " to be used only with GLCompute, MeshNV, or TaskNV execution model. " + << " to be used only with GLCompute execution model. " << GetReferenceDesc(decoration, built_in_inst, referenced_inst, referenced_from_inst, execution_model); } @@ -3070,16 +3070,14 @@ spv_result_t BuiltInsValidator::ValidateWorkgroupSizeAtReference( const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { for (const SpvExecutionModel execution_model : execution_models_) { - if (execution_model != SpvExecutionModelGLCompute && - execution_model != SpvExecutionModelTaskNV && - execution_model != SpvExecutionModelMeshNV) { + if (execution_model != SpvExecutionModelGLCompute) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4425) << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, decoration.params()[0]) - << " to be used only with GLCompute, MeshNV, or TaskNV execution model. " + << " to be used only with GLCompute execution model. " << GetReferenceDesc(decoration, built_in_inst, referenced_inst, referenced_from_inst, execution_model); } diff --git a/source/val/validate_decorations.cpp b/source/val/validate_decorations.cpp index c483635b..f076b04c 100644 --- a/source/val/validate_decorations.cpp +++ b/source/val/validate_decorations.cpp @@ -506,10 +506,12 @@ spv_result_t checkLayout(uint32_t struct_id, const char* storage_class_str, return recursive_status; // Check matrix stride. if (SpvOpTypeMatrix == opcode) { - const auto stride = constraint.matrix_stride; - if (!IsAlignedTo(stride, alignment)) { - return fail(memberIdx) << "is a matrix with stride " << stride - << " not satisfying alignment to " << alignment; + for (auto& decoration : vstate.id_decorations(id)) { + if (SpvDecorationMatrixStride == decoration.dec_type() && + !IsAlignedTo(decoration.params()[0], alignment)) + return fail(memberIdx) + << "is a matrix with stride " << decoration.params()[0] + << " not satisfying alignment to " << alignment; } } @@ -547,23 +549,17 @@ spv_result_t checkLayout(uint32_t struct_id, const char* storage_class_str, // limitation to this check if the array size is a spec constant or is a // runtime array then we will only check a single element. This means // some improper straddles might be missed. - if (SpvOpTypeStruct == element_inst->opcode()) { - std::vector seen(16, false); - for (uint32_t i = 0; i < num_elements; ++i) { - uint32_t next_offset = i * array_stride + offset; - // Stop checking if offsets repeat in terms of 16-byte multiples. - if (seen[next_offset % 16]) { - break; - } - - if (SPV_SUCCESS != - (recursive_status = checkLayout( - typeId, storage_class_str, decoration_str, blockRules, - scalar_block_layout, next_offset, constraints, vstate))) - return recursive_status; - - seen[next_offset % 16] = true; - } + for (uint32_t i = 0; i < num_elements; ++i) { + uint32_t next_offset = i * array_stride + offset; + if (SpvOpTypeStruct == element_inst->opcode() && + SPV_SUCCESS != (recursive_status = checkLayout( + typeId, storage_class_str, decoration_str, + blockRules, scalar_block_layout, + next_offset, constraints, vstate))) + return recursive_status; + // If offsets accumulate up to a 16-byte multiple stop checking since + // it will just repeat. + if (i > 0 && (next_offset % 16 == 0)) break; } // Proceed to the element in case it is an array. diff --git a/source/val/validate_extensions.cpp b/source/val/validate_extensions.cpp index 5ea23e1f..a7167fc1 100644 --- a/source/val/validate_extensions.cpp +++ b/source/val/validate_extensions.cpp @@ -20,9 +20,7 @@ #include "spirv/unified1/NonSemanticClspvReflection.h" -#include "NonSemanticVulkanDebugInfo100.h" #include "OpenCLDebugInfo100.h" -#include "source/common_debug_info.h" #include "source/diagnostic.h" #include "source/enum_string_mapping.h" #include "source/extensions.h" @@ -47,34 +45,6 @@ uint32_t GetSizeTBitWidth(const ValidationState_t& _) { return 0; } -bool IsIntScalar(ValidationState_t& _, uint32_t id, bool must_len32, - bool must_unsigned) { - auto type = _.FindDef(id); - if (!type || type->opcode() != SpvOpTypeInt) { - return false; - } - - if (must_len32 && type->GetOperandAs(1) != 32) { - return false; - } - - return !must_unsigned || type->GetOperandAs(2) == 0; -} - -bool IsUint32Constant(ValidationState_t& _, uint32_t id) { - auto inst = _.FindDef(id); - if (!inst || inst->opcode() != SpvOpConstant) { - return false; - } - - return IsIntScalar(_, inst->type_id(), true, true); -} - -uint32_t GetUint32Constant(ValidationState_t& _, uint32_t id) { - auto inst = _.FindDef(id); - return inst->word(3); -} - // Check that the operand of a debug info instruction |inst| at |word_index| // is a result id of an instruction with |expected_opcode|. spv_result_t ValidateOperandForDebugInfo( @@ -98,22 +68,6 @@ spv_result_t ValidateOperandForDebugInfo( return SPV_SUCCESS; } -// For NonSemantic.Vulkan.DebugInfo.100 check that the operand of a debug info -// instruction |inst| at |word_index| is a result id of a 32-bit integer -// OpConstant instruction. For OpenCL.DebugInfo.100 the parameter is a literal -// word so cannot be validated. -spv_result_t ValidateUint32ConstantOperandForDebugInfo( - ValidationState_t& _, const std::string& operand_name, - const Instruction* inst, uint32_t word_index, - const std::function& ext_inst_name) { - if (!IsUint32Constant(_, inst->word(word_index))) { - return _.diag(SPV_ERROR_INVALID_DATA, inst) - << ext_inst_name() << ": expected operand " << operand_name - << " must be a result id of 32-bit unsigned OpConstant"; - } - return SPV_SUCCESS; -} - #define CHECK_OPERAND(NAME, opcode, index) \ do { \ auto result = ValidateOperandForDebugInfo(_, NAME, opcode, inst, index, \ @@ -121,27 +75,18 @@ spv_result_t ValidateUint32ConstantOperandForDebugInfo( if (result != SPV_SUCCESS) return result; \ } while (0) -#define CHECK_CONST_UINT_OPERAND(NAME, index) \ - if (vulkanDebugInfo) { \ - auto result = ValidateUint32ConstantOperandForDebugInfo( \ - _, NAME, inst, index, ext_inst_name); \ - if (result != SPV_SUCCESS) return result; \ - } - // True if the operand of a debug info instruction |inst| at |word_index| // satisifies |expectation| that is given as a function. Otherwise, // returns false. bool DoesDebugInfoOperandMatchExpectation( const ValidationState_t& _, - const std::function& expectation, + const std::function& expectation, const Instruction* inst, uint32_t word_index) { if (inst->words().size() <= word_index) return false; auto* debug_inst = _.FindDef(inst->word(word_index)); if (debug_inst->opcode() != SpvOpExtInst || - (debug_inst->ext_inst_type() != SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100 && - debug_inst->ext_inst_type() != - SPV_EXT_INST_TYPE_NONSEMANTIC_VULKAN_DEBUGINFO_100) || - !expectation(CommonDebugInfoInstructions(debug_inst->word(4)))) { + debug_inst->ext_inst_type() != SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100 || + !expectation(OpenCLDebugInfo100Instructions(debug_inst->word(4)))) { return false; } return true; @@ -152,18 +97,20 @@ bool DoesDebugInfoOperandMatchExpectation( // is |expected_debug_inst|. spv_result_t ValidateDebugInfoOperand( ValidationState_t& _, const std::string& debug_inst_name, - CommonDebugInfoInstructions expected_debug_inst, const Instruction* inst, + OpenCLDebugInfo100Instructions expected_debug_inst, const Instruction* inst, uint32_t word_index, const std::function& ext_inst_name) { - std::function expectation = - [expected_debug_inst](CommonDebugInfoInstructions dbg_inst) { + std::function expectation = + [expected_debug_inst](OpenCLDebugInfo100Instructions dbg_inst) { return dbg_inst == expected_debug_inst; }; if (DoesDebugInfoOperandMatchExpectation(_, expectation, inst, word_index)) return SPV_SUCCESS; spv_ext_inst_desc desc = nullptr; - if (_.grammar().lookupExtInst(inst->ext_inst_type(), expected_debug_inst, - &desc) != SPV_SUCCESS || + _.grammar().lookupExtInst(SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100, + expected_debug_inst, &desc); + if (_.grammar().lookupExtInst(SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100, + expected_debug_inst, &desc) != SPV_SUCCESS || !desc) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": " @@ -187,8 +134,9 @@ spv_result_t ValidateDebugInfoOperand( spv_result_t ValidateOperandBaseType( ValidationState_t& _, const Instruction* inst, uint32_t word_index, const std::function& ext_inst_name) { - return ValidateDebugInfoOperand(_, "Base Type", CommonDebugInfoDebugTypeBasic, - inst, word_index, ext_inst_name); + return ValidateDebugInfoOperand(_, "Base Type", + OpenCLDebugInfo100DebugTypeBasic, inst, + word_index, ext_inst_name); } // Check that the operand of a debug info instruction |inst| at |word_index| @@ -199,12 +147,12 @@ spv_result_t ValidateOperandLexicalScope( ValidationState_t& _, const std::string& debug_inst_name, const Instruction* inst, uint32_t word_index, const std::function& ext_inst_name) { - std::function expectation = - [](CommonDebugInfoInstructions dbg_inst) { - return dbg_inst == CommonDebugInfoDebugCompilationUnit || - dbg_inst == CommonDebugInfoDebugFunction || - dbg_inst == CommonDebugInfoDebugLexicalBlock || - dbg_inst == CommonDebugInfoDebugTypeComposite; + std::function expectation = + [](OpenCLDebugInfo100Instructions dbg_inst) { + return dbg_inst == OpenCLDebugInfo100DebugCompilationUnit || + dbg_inst == OpenCLDebugInfo100DebugFunction || + dbg_inst == OpenCLDebugInfo100DebugLexicalBlock || + dbg_inst == OpenCLDebugInfo100DebugTypeComposite; }; if (DoesDebugInfoOperandMatchExpectation(_, expectation, inst, word_index)) return SPV_SUCCESS; @@ -223,15 +171,16 @@ spv_result_t ValidateOperandDebugType( const Instruction* inst, uint32_t word_index, const std::function& ext_inst_name, bool allow_template_param) { - std::function expectation = - [&allow_template_param](CommonDebugInfoInstructions dbg_inst) { + std::function expectation = + [&allow_template_param](OpenCLDebugInfo100Instructions dbg_inst) { if (allow_template_param && - (dbg_inst == CommonDebugInfoDebugTypeTemplateParameter || - dbg_inst == CommonDebugInfoDebugTypeTemplateTemplateParameter)) { + (dbg_inst == OpenCLDebugInfo100DebugTypeTemplateParameter || + dbg_inst == + OpenCLDebugInfo100DebugTypeTemplateTemplateParameter)) { return true; } - return CommonDebugInfoDebugTypeBasic <= dbg_inst && - dbg_inst <= CommonDebugInfoDebugTypeTemplate; + return OpenCLDebugInfo100DebugTypeBasic <= dbg_inst && + dbg_inst <= OpenCLDebugInfo100DebugTypeTemplate; }; if (DoesDebugInfoOperandMatchExpectation(_, expectation, inst, word_index)) return SPV_SUCCESS; @@ -242,6 +191,28 @@ spv_result_t ValidateOperandDebugType( << " is not a valid debug type"; } +bool IsUint32Constant(ValidationState_t& _, uint32_t id) { + auto inst = _.FindDef(id); + if (!inst || inst->opcode() != SpvOpConstant) { + return false; + } + + auto type = _.FindDef(inst->type_id()); + if (!type || type->opcode() != SpvOpTypeInt) { + return false; + } + + if (type->GetOperandAs(1) != 32) { + return false; + } + + if (type->GetOperandAs(2) != 0) { + return false; + } + + return true; +} + spv_result_t ValidateClspvReflectionKernel(ValidationState_t& _, const Instruction* inst) { const auto kernel_id = inst->GetOperandAs(4); @@ -696,26 +667,18 @@ bool IsDebugVariableWithIntScalarType(ValidationState_t& _, const Instruction* inst, uint32_t word_index) { auto* dbg_int_scalar_var = _.FindDef(inst->word(word_index)); - if (CommonDebugInfoInstructions(dbg_int_scalar_var->word(4)) == - CommonDebugInfoDebugLocalVariable || - CommonDebugInfoInstructions(dbg_int_scalar_var->word(4)) == - CommonDebugInfoDebugGlobalVariable) { + if (OpenCLDebugInfo100Instructions(dbg_int_scalar_var->word(4)) == + OpenCLDebugInfo100DebugLocalVariable || + OpenCLDebugInfo100Instructions(dbg_int_scalar_var->word(4)) == + OpenCLDebugInfo100DebugGlobalVariable) { auto* dbg_type = _.FindDef(dbg_int_scalar_var->word(6)); - if (CommonDebugInfoInstructions(dbg_type->word(4)) == - CommonDebugInfoDebugTypeBasic) { - const spv_ext_inst_type_t ext_inst_type = - spv_ext_inst_type_t(inst->ext_inst_type()); - const bool vulkanDebugInfo = - ext_inst_type == SPV_EXT_INST_TYPE_NONSEMANTIC_VULKAN_DEBUGINFO_100; - uint32_t encoding = dbg_type->word(7); - if (!vulkanDebugInfo || IsUint32Constant(_, encoding)) { - auto ocl_encoding = OpenCLDebugInfo100DebugBaseTypeAttributeEncoding( - vulkanDebugInfo ? GetUint32Constant(_, encoding) : encoding); - if (ocl_encoding == OpenCLDebugInfo100Signed || - ocl_encoding == OpenCLDebugInfo100Unsigned) { - return true; - } - } + if (OpenCLDebugInfo100Instructions(dbg_type->word(4)) == + OpenCLDebugInfo100DebugTypeBasic && + (OpenCLDebugInfo100DebugBaseTypeAttributeEncoding(dbg_type->word(7)) == + OpenCLDebugInfo100Signed || + OpenCLDebugInfo100DebugBaseTypeAttributeEncoding(dbg_type->word(7)) == + OpenCLDebugInfo100Unsigned)) { + return true; } } return false; @@ -849,7 +812,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { for (uint32_t operand_index = 4; operand_index < num_operands; ++operand_index) { const uint32_t operand_type = _.GetOperandTypeId(inst, operand_index); - if (!operand_type || !_.IsIntScalarOrVectorType(operand_type)) { + if (!_.IsIntScalarOrVectorType(operand_type)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": " << "expected all operands to be int scalars or vectors"; @@ -2705,9 +2668,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { break; } } - } else if (ext_inst_type == SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100 || - ext_inst_type == - SPV_EXT_INST_TYPE_NONSEMANTIC_VULKAN_DEBUGINFO_100) { + } else if (ext_inst_type == SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100) { if (!_.IsVoidType(result_type)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": " @@ -2715,552 +2676,446 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { << "OpTypeVoid"; } - const bool vulkanDebugInfo = - ext_inst_type == SPV_EXT_INST_TYPE_NONSEMANTIC_VULKAN_DEBUGINFO_100; - auto num_words = inst->words().size(); - // Handle any non-common OpenCL insts, then common - if (ext_inst_type != SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100 || - OpenCLDebugInfo100Instructions(ext_inst_index) != - OpenCLDebugInfo100DebugModuleINTEL) { - const CommonDebugInfoInstructions ext_inst_key = - CommonDebugInfoInstructions(ext_inst_index); - switch (ext_inst_key) { - case CommonDebugInfoDebugInfoNone: - case CommonDebugInfoDebugNoScope: - break; - // The binary parser validates the opcode for DebugInfoNone, - // DebugNoScope, DebugOperation. We just check the parameters to - // DebugOperation are properly constants for vulkan debug info. - case CommonDebugInfoDebugOperation: { - CHECK_CONST_UINT_OPERAND("Operation", 5); - for (uint32_t i = 6; i < num_words; ++i) { - CHECK_CONST_UINT_OPERAND("Operand", i); - } - break; - } - case CommonDebugInfoDebugCompilationUnit: { - CHECK_CONST_UINT_OPERAND("Version", 5); - CHECK_CONST_UINT_OPERAND("DWARF Version", 6); - CHECK_DEBUG_OPERAND("Source", CommonDebugInfoDebugSource, 7); - CHECK_CONST_UINT_OPERAND("Language", 8); - break; - } - case CommonDebugInfoDebugSource: { - CHECK_OPERAND("File", SpvOpString, 5); - if (num_words == 7) CHECK_OPERAND("Text", SpvOpString, 6); - break; - } - case CommonDebugInfoDebugTypeBasic: { - CHECK_OPERAND("Name", SpvOpString, 5); - CHECK_OPERAND("Size", SpvOpConstant, 6); - CHECK_CONST_UINT_OPERAND("Encoding", 7); - break; - } - case CommonDebugInfoDebugTypePointer: { - auto validate_base_type = - ValidateOperandBaseType(_, inst, 5, ext_inst_name); - if (validate_base_type != SPV_SUCCESS) return validate_base_type; - CHECK_CONST_UINT_OPERAND("Storage Class", 6); - CHECK_CONST_UINT_OPERAND("Flags", 7); - break; - } - case CommonDebugInfoDebugTypeQualifier: { - auto validate_base_type = - ValidateOperandBaseType(_, inst, 5, ext_inst_name); - if (validate_base_type != SPV_SUCCESS) return validate_base_type; - CHECK_CONST_UINT_OPERAND("Type Qualifier", 6); - break; - } - case CommonDebugInfoDebugTypeVector: { - auto validate_base_type = - ValidateOperandBaseType(_, inst, 5, ext_inst_name); - if (validate_base_type != SPV_SUCCESS) return validate_base_type; + const OpenCLDebugInfo100Instructions ext_inst_key = + OpenCLDebugInfo100Instructions(ext_inst_index); + switch (ext_inst_key) { + case OpenCLDebugInfo100DebugInfoNone: + case OpenCLDebugInfo100DebugNoScope: + case OpenCLDebugInfo100DebugOperation: + // The binary parser validates the opcode for DebugInfoNone, + // DebugNoScope, DebugOperation, and the literal values don't need + // further checks. + break; + case OpenCLDebugInfo100DebugCompilationUnit: { + CHECK_DEBUG_OPERAND("Source", OpenCLDebugInfo100DebugSource, 7); + break; + } + case OpenCLDebugInfo100DebugSource: { + CHECK_OPERAND("File", SpvOpString, 5); + if (num_words == 7) CHECK_OPERAND("Text", SpvOpString, 6); + break; + } + case OpenCLDebugInfo100DebugTypeBasic: { + CHECK_OPERAND("Name", SpvOpString, 5); + CHECK_OPERAND("Size", SpvOpConstant, 6); + // "Encoding" param is already validated by the binary parsing stage. + break; + } + case OpenCLDebugInfo100DebugTypePointer: + case OpenCLDebugInfo100DebugTypeQualifier: { + auto validate_base_type = + ValidateOperandBaseType(_, inst, 5, ext_inst_name); + if (validate_base_type != SPV_SUCCESS) return validate_base_type; + break; + } + case OpenCLDebugInfo100DebugTypeVector: { + auto validate_base_type = + ValidateOperandBaseType(_, inst, 5, ext_inst_name); + if (validate_base_type != SPV_SUCCESS) return validate_base_type; - CHECK_CONST_UINT_OPERAND("Component Count", 6); - uint32_t component_count = inst->word(6); - if (vulkanDebugInfo) { - uint64_t const_val; - if (!_.GetConstantValUint64(component_count, &const_val)) { - return _.diag(SPV_ERROR_INVALID_DATA, inst) - << ext_inst_name() - << ": Component Count must be 32-bit integer OpConstant"; + uint32_t component_count = inst->word(6); + if (!component_count || component_count > 4) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << ext_inst_name() << ": Component Count must be positive " + << "integer less than or equal to 4"; + } + break; + } + case OpenCLDebugInfo100DebugTypeArray: { + auto validate_base_type = ValidateOperandDebugType( + _, "Base Type", inst, 5, ext_inst_name, false); + if (validate_base_type != SPV_SUCCESS) return validate_base_type; + for (uint32_t i = 6; i < num_words; ++i) { + bool invalid = false; + auto* component_count = _.FindDef(inst->word(i)); + if (IsConstIntScalarTypeWith32Or64Bits(_, component_count)) { + // TODO: We need a spec discussion for the bindless array. + if (!component_count->word(3)) { + invalid = true; } - component_count = const_val & 0xffffffff; - } - - if (!component_count || component_count > 4) { - return _.diag(SPV_ERROR_INVALID_DATA, inst) - << ext_inst_name() << ": Component Count must be positive " - << "integer less than or equal to 4"; - } - break; - } - case CommonDebugInfoDebugTypeArray: { - auto validate_base_type = ValidateOperandDebugType( - _, "Base Type", inst, 5, ext_inst_name, false); - if (validate_base_type != SPV_SUCCESS) return validate_base_type; - for (uint32_t i = 6; i < num_words; ++i) { - bool invalid = false; - auto* component_count = _.FindDef(inst->word(i)); - if (IsConstIntScalarTypeWith32Or64Bits(_, component_count)) { - // TODO: We need a spec discussion for the bindless array. - if (!component_count->word(3)) { + } else if (component_count->words().size() > 6 && + (OpenCLDebugInfo100Instructions(component_count->word( + 4)) == OpenCLDebugInfo100DebugLocalVariable || + OpenCLDebugInfo100Instructions(component_count->word( + 4)) == OpenCLDebugInfo100DebugGlobalVariable)) { + auto* component_count_type = _.FindDef(component_count->word(6)); + if (component_count_type->words().size() > 7) { + if (OpenCLDebugInfo100Instructions(component_count_type->word( + 4)) != OpenCLDebugInfo100DebugTypeBasic || + OpenCLDebugInfo100DebugBaseTypeAttributeEncoding( + component_count_type->word(7)) != + OpenCLDebugInfo100Unsigned) { invalid = true; - } - } else if (component_count->words().size() > 6 && - (CommonDebugInfoInstructions(component_count->word(4)) == - CommonDebugInfoDebugLocalVariable || - CommonDebugInfoInstructions(component_count->word(4)) == - CommonDebugInfoDebugGlobalVariable)) { - auto* component_count_type = _.FindDef(component_count->word(6)); - if (component_count_type->words().size() > 7) { - uint32_t encoding = component_count_type->word(7); - if (CommonDebugInfoInstructions(component_count_type->word( - 4)) != CommonDebugInfoDebugTypeBasic || - (vulkanDebugInfo && !IsUint32Constant(_, encoding)) || - OpenCLDebugInfo100DebugBaseTypeAttributeEncoding( - vulkanDebugInfo - ? GetUint32Constant(_, encoding) - : encoding) != OpenCLDebugInfo100Unsigned) { - invalid = true; - } else { - // DebugTypeBasic for DebugLocalVariable/DebugGlobalVariable - // must have Unsigned encoding and 32 or 64 as its size in - // bits. - Instruction* size_in_bits = - _.FindDef(component_count_type->word(6)); - if (!_.IsIntScalarType(size_in_bits->type_id()) || - (size_in_bits->word(3) != 32 && - size_in_bits->word(3) != 64)) { - invalid = true; - } - } } else { - invalid = true; + // DebugTypeBasic for DebugLocalVariable/DebugGlobalVariable + // must have Unsigned encoding and 32 or 64 as its size in bits. + Instruction* size_in_bits = + _.FindDef(component_count_type->word(6)); + if (!_.IsIntScalarType(size_in_bits->type_id()) || + (size_in_bits->word(3) != 32 && + size_in_bits->word(3) != 64)) { + invalid = true; + } } } else { invalid = true; } - if (invalid) { - return _.diag(SPV_ERROR_INVALID_DATA, inst) - << ext_inst_name() << ": Component Count must be " - << "OpConstant with a 32- or 64-bits integer scalar type " - "or " - << "DebugGlobalVariable or DebugLocalVariable with a 32- " - "or " - << "64-bits unsigned integer scalar type"; - } + } else { + invalid = true; } - break; - } - case CommonDebugInfoDebugTypedef: { - CHECK_OPERAND("Name", SpvOpString, 5); - auto validate_base_type = - ValidateOperandBaseType(_, inst, 6, ext_inst_name); - if (validate_base_type != SPV_SUCCESS) return validate_base_type; - CHECK_DEBUG_OPERAND("Source", CommonDebugInfoDebugSource, 7); - CHECK_CONST_UINT_OPERAND("Line", 8); - CHECK_CONST_UINT_OPERAND("Column", 9); - auto validate_parent = - ValidateOperandLexicalScope(_, "Parent", inst, 10, ext_inst_name); - if (validate_parent != SPV_SUCCESS) return validate_parent; - break; - } - case CommonDebugInfoDebugTypeFunction: { - CHECK_CONST_UINT_OPERAND("Flags", 5); - auto* return_type = _.FindDef(inst->word(6)); - // TODO: We need a spec discussion that we have to allow return and - // parameter types of a DebugTypeFunction to have template parameter. - if (return_type->opcode() != SpvOpTypeVoid) { - auto validate_return = ValidateOperandDebugType( - _, "Return Type", inst, 6, ext_inst_name, true); - if (validate_return != SPV_SUCCESS) return validate_return; + if (invalid) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << ext_inst_name() << ": Component Count must be " + << "OpConstant with a 32- or 64-bits integer scalar type or " + << "DebugGlobalVariable or DebugLocalVariable with a 32- or " + << "64-bits unsigned integer scalar type"; } - for (uint32_t word_index = 7; word_index < num_words; ++word_index) { - auto validate_param = ValidateOperandDebugType( - _, "Parameter Types", inst, word_index, ext_inst_name, true); - if (validate_param != SPV_SUCCESS) return validate_param; - } - break; } - case CommonDebugInfoDebugTypeEnum: { - CHECK_OPERAND("Name", SpvOpString, 5); + break; + } + case OpenCLDebugInfo100DebugTypedef: { + CHECK_OPERAND("Name", SpvOpString, 5); + auto validate_base_type = + ValidateOperandBaseType(_, inst, 6, ext_inst_name); + if (validate_base_type != SPV_SUCCESS) return validate_base_type; + CHECK_DEBUG_OPERAND("Source", OpenCLDebugInfo100DebugSource, 7); + auto validate_parent = + ValidateOperandLexicalScope(_, "Parent", inst, 10, ext_inst_name); + if (validate_parent != SPV_SUCCESS) return validate_parent; + break; + } + case OpenCLDebugInfo100DebugTypeFunction: { + auto* return_type = _.FindDef(inst->word(6)); + // TODO: We need a spec discussion that we have to allow return and + // parameter types of a DebugTypeFunction to have template parameter. + if (return_type->opcode() != SpvOpTypeVoid) { + auto validate_return = ValidateOperandDebugType( + _, "Return Type", inst, 6, ext_inst_name, true); + if (validate_return != SPV_SUCCESS) return validate_return; + } + for (uint32_t word_index = 7; word_index < num_words; ++word_index) { + auto validate_param = ValidateOperandDebugType( + _, "Parameter Types", inst, word_index, ext_inst_name, true); + if (validate_param != SPV_SUCCESS) return validate_param; + } + break; + } + case OpenCLDebugInfo100DebugTypeEnum: { + CHECK_OPERAND("Name", SpvOpString, 5); + if (!DoesDebugInfoOperandMatchExpectation( + _, + [](OpenCLDebugInfo100Instructions dbg_inst) { + return dbg_inst == OpenCLDebugInfo100DebugInfoNone; + }, + inst, 6)) { + auto validate_underlying_type = ValidateOperandDebugType( + _, "Underlying Types", inst, 6, ext_inst_name, false); + if (validate_underlying_type != SPV_SUCCESS) + return validate_underlying_type; + } + CHECK_DEBUG_OPERAND("Source", OpenCLDebugInfo100DebugSource, 7); + auto validate_parent = + ValidateOperandLexicalScope(_, "Parent", inst, 10, ext_inst_name); + if (validate_parent != SPV_SUCCESS) return validate_parent; + CHECK_OPERAND("Size", SpvOpConstant, 11); + auto* size = _.FindDef(inst->word(11)); + if (!_.IsIntScalarType(size->type_id()) || !size->word(3)) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << ext_inst_name() << ": expected operand Size is a " + << "positive integer"; + } + for (uint32_t word_index = 13; word_index + 1 < num_words; + word_index += 2) { + CHECK_OPERAND("Value", SpvOpConstant, word_index); + CHECK_OPERAND("Name", SpvOpString, word_index + 1); + } + break; + } + case OpenCLDebugInfo100DebugTypeComposite: { + CHECK_OPERAND("Name", SpvOpString, 5); + CHECK_DEBUG_OPERAND("Source", OpenCLDebugInfo100DebugSource, 7); + auto validate_parent = + ValidateOperandLexicalScope(_, "Parent", inst, 10, ext_inst_name); + if (validate_parent != SPV_SUCCESS) return validate_parent; + CHECK_OPERAND("Linkage Name", SpvOpString, 11); + if (!DoesDebugInfoOperandMatchExpectation( + _, + [](OpenCLDebugInfo100Instructions dbg_inst) { + return dbg_inst == OpenCLDebugInfo100DebugInfoNone; + }, + inst, 12)) { + CHECK_OPERAND("Size", SpvOpConstant, 12); + } + for (uint32_t word_index = 14; word_index < num_words; ++word_index) { if (!DoesDebugInfoOperandMatchExpectation( _, - [](CommonDebugInfoInstructions dbg_inst) { - return dbg_inst == CommonDebugInfoDebugInfoNone; + [](OpenCLDebugInfo100Instructions dbg_inst) { + return dbg_inst == OpenCLDebugInfo100DebugTypeMember || + dbg_inst == OpenCLDebugInfo100DebugFunction || + dbg_inst == OpenCLDebugInfo100DebugTypeInheritance; }, - inst, 6)) { - auto validate_underlying_type = ValidateOperandDebugType( - _, "Underlying Types", inst, 6, ext_inst_name, false); - if (validate_underlying_type != SPV_SUCCESS) - return validate_underlying_type; - } - CHECK_DEBUG_OPERAND("Source", CommonDebugInfoDebugSource, 7); - CHECK_CONST_UINT_OPERAND("Line", 8); - CHECK_CONST_UINT_OPERAND("Column", 9); - auto validate_parent = - ValidateOperandLexicalScope(_, "Parent", inst, 10, ext_inst_name); - if (validate_parent != SPV_SUCCESS) return validate_parent; - CHECK_OPERAND("Size", SpvOpConstant, 11); - auto* size = _.FindDef(inst->word(11)); - if (!_.IsIntScalarType(size->type_id()) || !size->word(3)) { + inst, word_index)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) - << ext_inst_name() << ": expected operand Size is a " - << "positive integer"; + << ext_inst_name() << ": " + << "expected operand Members " + << "must be DebugTypeMember, DebugFunction, or " + "DebugTypeInheritance"; } - CHECK_CONST_UINT_OPERAND("Flags", 12); - for (uint32_t word_index = 13; word_index + 1 < num_words; - word_index += 2) { - CHECK_OPERAND("Value", SpvOpConstant, word_index); - CHECK_OPERAND("Name", SpvOpString, word_index + 1); - } - break; } - case CommonDebugInfoDebugTypeComposite: { - CHECK_OPERAND("Name", SpvOpString, 5); - CHECK_DEBUG_OPERAND("Source", CommonDebugInfoDebugSource, 7); - CHECK_CONST_UINT_OPERAND("Line", 8); - CHECK_CONST_UINT_OPERAND("Column", 9); - auto validate_parent = - ValidateOperandLexicalScope(_, "Parent", inst, 10, ext_inst_name); - if (validate_parent != SPV_SUCCESS) return validate_parent; - CHECK_OPERAND("Linkage Name", SpvOpString, 11); + break; + } + case OpenCLDebugInfo100DebugTypeMember: { + CHECK_OPERAND("Name", SpvOpString, 5); + // TODO: We need a spec discussion that we have to allow member types + // to have template parameter. + auto validate_type = + ValidateOperandDebugType(_, "Type", inst, 6, ext_inst_name, true); + if (validate_type != SPV_SUCCESS) return validate_type; + CHECK_DEBUG_OPERAND("Source", OpenCLDebugInfo100DebugSource, 7); + CHECK_DEBUG_OPERAND("Parent", OpenCLDebugInfo100DebugTypeComposite, 10); + CHECK_OPERAND("Offset", SpvOpConstant, 11); + CHECK_OPERAND("Size", SpvOpConstant, 12); + if (num_words == 15) CHECK_OPERAND("Value", SpvOpConstant, 14); + break; + } + case OpenCLDebugInfo100DebugTypeInheritance: { + CHECK_DEBUG_OPERAND("Child", OpenCLDebugInfo100DebugTypeComposite, 5); + auto* debug_inst = _.FindDef(inst->word(5)); + auto composite_type = + OpenCLDebugInfo100DebugCompositeType(debug_inst->word(6)); + if (composite_type != OpenCLDebugInfo100Class && + composite_type != OpenCLDebugInfo100Structure) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << ext_inst_name() << ": " + << "expected operand Child must be class or struct debug type"; + } + CHECK_DEBUG_OPERAND("Parent", OpenCLDebugInfo100DebugTypeComposite, 6); + debug_inst = _.FindDef(inst->word(6)); + composite_type = + OpenCLDebugInfo100DebugCompositeType(debug_inst->word(6)); + if (composite_type != OpenCLDebugInfo100Class && + composite_type != OpenCLDebugInfo100Structure) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << ext_inst_name() << ": " + << "expected operand Parent must be class or struct debug " + "type"; + } + CHECK_OPERAND("Offset", SpvOpConstant, 7); + CHECK_OPERAND("Size", SpvOpConstant, 8); + break; + } + case OpenCLDebugInfo100DebugFunction: { + CHECK_OPERAND("Name", SpvOpString, 5); + auto validate_type = + ValidateOperandDebugType(_, "Type", inst, 6, ext_inst_name, false); + if (validate_type != SPV_SUCCESS) return validate_type; + CHECK_DEBUG_OPERAND("Source", OpenCLDebugInfo100DebugSource, 7); + auto validate_parent = + ValidateOperandLexicalScope(_, "Parent", inst, 10, ext_inst_name); + if (validate_parent != SPV_SUCCESS) return validate_parent; + CHECK_OPERAND("Linkage Name", SpvOpString, 11); + if (!DoesDebugInfoOperandMatchExpectation( + _, + [](OpenCLDebugInfo100Instructions dbg_inst) { + return dbg_inst == OpenCLDebugInfo100DebugInfoNone; + }, + inst, 14)) { + CHECK_OPERAND("Function", SpvOpFunction, 14); + } + if (num_words == 16) { + CHECK_DEBUG_OPERAND("Declaration", + OpenCLDebugInfo100DebugFunctionDeclaration, 15); + } + break; + } + case OpenCLDebugInfo100DebugFunctionDeclaration: { + CHECK_OPERAND("Name", SpvOpString, 5); + auto validate_type = + ValidateOperandDebugType(_, "Type", inst, 6, ext_inst_name, false); + if (validate_type != SPV_SUCCESS) return validate_type; + CHECK_DEBUG_OPERAND("Source", OpenCLDebugInfo100DebugSource, 7); + auto validate_parent = + ValidateOperandLexicalScope(_, "Parent", inst, 10, ext_inst_name); + if (validate_parent != SPV_SUCCESS) return validate_parent; + CHECK_OPERAND("Linkage Name", SpvOpString, 11); + break; + } + case OpenCLDebugInfo100DebugLexicalBlock: { + CHECK_DEBUG_OPERAND("Source", OpenCLDebugInfo100DebugSource, 5); + auto validate_parent = + ValidateOperandLexicalScope(_, "Parent", inst, 8, ext_inst_name); + if (validate_parent != SPV_SUCCESS) return validate_parent; + if (num_words == 10) CHECK_OPERAND("Name", SpvOpString, 9); + break; + } + case OpenCLDebugInfo100DebugScope: { + auto validate_scope = + ValidateOperandLexicalScope(_, "Scope", inst, 5, ext_inst_name); + if (validate_scope != SPV_SUCCESS) return validate_scope; + if (num_words == 7) { + CHECK_DEBUG_OPERAND("Inlined At", OpenCLDebugInfo100DebugInlinedAt, + 6); + } + break; + } + case OpenCLDebugInfo100DebugLocalVariable: { + CHECK_OPERAND("Name", SpvOpString, 5); + // TODO: We need a spec discussion that we have to allow local variable + // types to have template parameter. + auto validate_type = + ValidateOperandDebugType(_, "Type", inst, 6, ext_inst_name, true); + if (validate_type != SPV_SUCCESS) return validate_type; + CHECK_DEBUG_OPERAND("Source", OpenCLDebugInfo100DebugSource, 7); + auto validate_parent = + ValidateOperandLexicalScope(_, "Parent", inst, 10, ext_inst_name); + if (validate_parent != SPV_SUCCESS) return validate_parent; + break; + } + case OpenCLDebugInfo100DebugDeclare: { + CHECK_DEBUG_OPERAND("Local Variable", + OpenCLDebugInfo100DebugLocalVariable, 5); + auto* operand = _.FindDef(inst->word(6)); + if (operand->opcode() != SpvOpVariable && + operand->opcode() != SpvOpFunctionParameter) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << ext_inst_name() << ": " + << "expected operand Variable must be a result id of " + "OpVariable or OpFunctionParameter"; + } + + CHECK_DEBUG_OPERAND("Expression", OpenCLDebugInfo100DebugExpression, 7); + break; + } + case OpenCLDebugInfo100DebugExpression: { + for (uint32_t word_index = 5; word_index < num_words; ++word_index) { + CHECK_DEBUG_OPERAND("Operation", OpenCLDebugInfo100DebugOperation, + word_index); + } + break; + } + case OpenCLDebugInfo100DebugTypeTemplate: { + if (!DoesDebugInfoOperandMatchExpectation( + _, + [](OpenCLDebugInfo100Instructions dbg_inst) { + return dbg_inst == OpenCLDebugInfo100DebugTypeComposite || + dbg_inst == OpenCLDebugInfo100DebugFunction; + }, + inst, 5)) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << ext_inst_name() << ": " + << "expected operand Target must be DebugTypeComposite " + << "or DebugFunction"; + } + for (uint32_t word_index = 6; word_index < num_words; ++word_index) { if (!DoesDebugInfoOperandMatchExpectation( _, - [](CommonDebugInfoInstructions dbg_inst) { - return dbg_inst == CommonDebugInfoDebugInfoNone; + [](OpenCLDebugInfo100Instructions dbg_inst) { + return dbg_inst == + OpenCLDebugInfo100DebugTypeTemplateParameter || + dbg_inst == + OpenCLDebugInfo100DebugTypeTemplateTemplateParameter; }, - inst, 12)) { - CHECK_OPERAND("Size", SpvOpConstant, 12); - } - CHECK_CONST_UINT_OPERAND("Flags", 13); - for (uint32_t word_index = 14; word_index < num_words; ++word_index) { - if (!DoesDebugInfoOperandMatchExpectation( - _, - [](CommonDebugInfoInstructions dbg_inst) { - return dbg_inst == CommonDebugInfoDebugTypeMember || - dbg_inst == CommonDebugInfoDebugFunction || - dbg_inst == CommonDebugInfoDebugTypeInheritance; - }, - inst, word_index)) { - return _.diag(SPV_ERROR_INVALID_DATA, inst) - << ext_inst_name() << ": " - << "expected operand Members " - << "must be DebugTypeMember, DebugFunction, or " - "DebugTypeInheritance"; - } - } - break; - } - case CommonDebugInfoDebugTypeMember: { - CHECK_OPERAND("Name", SpvOpString, 5); - // TODO: We need a spec discussion that we have to allow member types - // to have template parameter. - auto validate_type = - ValidateOperandDebugType(_, "Type", inst, 6, ext_inst_name, true); - if (validate_type != SPV_SUCCESS) return validate_type; - CHECK_DEBUG_OPERAND("Source", CommonDebugInfoDebugSource, 7); - CHECK_CONST_UINT_OPERAND("Line", 8); - CHECK_CONST_UINT_OPERAND("Column", 9); - // NonSemantic.Vulkan.DebugInfo doesn't have the Parent operand - if (vulkanDebugInfo) { - CHECK_OPERAND("Offset", SpvOpConstant, 10); - CHECK_OPERAND("Size", SpvOpConstant, 11); - CHECK_CONST_UINT_OPERAND("Flags", 12); - if (num_words == 14) CHECK_OPERAND("Value", SpvOpConstant, 13); - } else { - CHECK_DEBUG_OPERAND("Parent", CommonDebugInfoDebugTypeComposite, - 10); - CHECK_OPERAND("Offset", SpvOpConstant, 11); - CHECK_OPERAND("Size", SpvOpConstant, 12); - CHECK_CONST_UINT_OPERAND("Flags", 13); - if (num_words == 15) CHECK_OPERAND("Value", SpvOpConstant, 14); - } - break; - } - case CommonDebugInfoDebugTypeInheritance: { - CHECK_DEBUG_OPERAND("Child", CommonDebugInfoDebugTypeComposite, 5); - auto* debug_inst = _.FindDef(inst->word(5)); - auto composite_type = - OpenCLDebugInfo100DebugCompositeType(debug_inst->word(6)); - if (composite_type != OpenCLDebugInfo100Class && - composite_type != OpenCLDebugInfo100Structure) { + inst, word_index)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": " - << "expected operand Child must be class or struct debug " - "type"; + << "expected operand Parameters must be " + << "DebugTypeTemplateParameter or " + << "DebugTypeTemplateTemplateParameter"; } - CHECK_DEBUG_OPERAND("Parent", CommonDebugInfoDebugTypeComposite, 6); - debug_inst = _.FindDef(inst->word(6)); - composite_type = - OpenCLDebugInfo100DebugCompositeType(debug_inst->word(6)); - if (composite_type != OpenCLDebugInfo100Class && - composite_type != OpenCLDebugInfo100Structure) { - return _.diag(SPV_ERROR_INVALID_DATA, inst) - << ext_inst_name() << ": " - << "expected operand Parent must be class or struct debug " - "type"; - } - CHECK_OPERAND("Offset", SpvOpConstant, 7); - CHECK_OPERAND("Size", SpvOpConstant, 8); - CHECK_CONST_UINT_OPERAND("Flags", 9); - break; } - case CommonDebugInfoDebugFunction: { - CHECK_OPERAND("Name", SpvOpString, 5); - auto validate_type = ValidateOperandDebugType(_, "Type", inst, 6, - ext_inst_name, false); - if (validate_type != SPV_SUCCESS) return validate_type; - CHECK_DEBUG_OPERAND("Source", CommonDebugInfoDebugSource, 7); - CHECK_CONST_UINT_OPERAND("Line", 8); - CHECK_CONST_UINT_OPERAND("Column", 9); - auto validate_parent = - ValidateOperandLexicalScope(_, "Parent", inst, 10, ext_inst_name); - if (validate_parent != SPV_SUCCESS) return validate_parent; - CHECK_OPERAND("Linkage Name", SpvOpString, 11); - CHECK_CONST_UINT_OPERAND("Flags", 12); - CHECK_CONST_UINT_OPERAND("Scope Line", 13); - // NonSemantic.Vulkan.DebugInfo.100 doesn't include a reference to the - // OpFunction - if (vulkanDebugInfo) { - if (num_words == 15) { - CHECK_DEBUG_OPERAND("Declaration", - CommonDebugInfoDebugFunctionDeclaration, 14); - } - } else { - if (!DoesDebugInfoOperandMatchExpectation( - _, - [](CommonDebugInfoInstructions dbg_inst) { - return dbg_inst == CommonDebugInfoDebugInfoNone; - }, - inst, 14)) { - CHECK_OPERAND("Function", SpvOpFunction, 14); - } - if (num_words == 16) { - CHECK_DEBUG_OPERAND("Declaration", - CommonDebugInfoDebugFunctionDeclaration, 15); - } - } - break; + break; + } + case OpenCLDebugInfo100DebugTypeTemplateParameter: { + CHECK_OPERAND("Name", SpvOpString, 5); + auto validate_actual_type = ValidateOperandDebugType( + _, "Actual Type", inst, 6, ext_inst_name, false); + if (validate_actual_type != SPV_SUCCESS) return validate_actual_type; + if (!DoesDebugInfoOperandMatchExpectation( + _, + [](OpenCLDebugInfo100Instructions dbg_inst) { + return dbg_inst == OpenCLDebugInfo100DebugInfoNone; + }, + inst, 7)) { + CHECK_OPERAND("Value", SpvOpConstant, 7); } - case CommonDebugInfoDebugFunctionDeclaration: { - CHECK_OPERAND("Name", SpvOpString, 5); - auto validate_type = ValidateOperandDebugType(_, "Type", inst, 6, - ext_inst_name, false); - if (validate_type != SPV_SUCCESS) return validate_type; - CHECK_DEBUG_OPERAND("Source", CommonDebugInfoDebugSource, 7); - CHECK_CONST_UINT_OPERAND("Line", 8); - CHECK_CONST_UINT_OPERAND("Column", 9); - auto validate_parent = - ValidateOperandLexicalScope(_, "Parent", inst, 10, ext_inst_name); - if (validate_parent != SPV_SUCCESS) return validate_parent; - CHECK_OPERAND("Linkage Name", SpvOpString, 11); - CHECK_CONST_UINT_OPERAND("Flags", 12); - break; - } - case CommonDebugInfoDebugLexicalBlock: { - CHECK_DEBUG_OPERAND("Source", CommonDebugInfoDebugSource, 5); - CHECK_CONST_UINT_OPERAND("Line", 6); - CHECK_CONST_UINT_OPERAND("Column", 7); - auto validate_parent = - ValidateOperandLexicalScope(_, "Parent", inst, 8, ext_inst_name); - if (validate_parent != SPV_SUCCESS) return validate_parent; - if (num_words == 10) CHECK_OPERAND("Name", SpvOpString, 9); - break; - } - case CommonDebugInfoDebugScope: { - auto validate_scope = - ValidateOperandLexicalScope(_, "Scope", inst, 5, ext_inst_name); - if (validate_scope != SPV_SUCCESS) return validate_scope; - if (num_words == 7) { - CHECK_DEBUG_OPERAND("Inlined At", CommonDebugInfoDebugInlinedAt, 6); - } - break; - } - case CommonDebugInfoDebugLocalVariable: { - CHECK_OPERAND("Name", SpvOpString, 5); - // TODO: We need a spec discussion that we have to allow local - // variable types to have template parameter. - auto validate_type = - ValidateOperandDebugType(_, "Type", inst, 6, ext_inst_name, true); - if (validate_type != SPV_SUCCESS) return validate_type; - CHECK_DEBUG_OPERAND("Source", CommonDebugInfoDebugSource, 7); - CHECK_CONST_UINT_OPERAND("Line", 8); - CHECK_CONST_UINT_OPERAND("Column", 9); - auto validate_parent = - ValidateOperandLexicalScope(_, "Parent", inst, 10, ext_inst_name); - if (validate_parent != SPV_SUCCESS) return validate_parent; - CHECK_CONST_UINT_OPERAND("Flags", 11); - if (num_words == 13) { - CHECK_CONST_UINT_OPERAND("ArgNumber", 12); - } - break; - } - case CommonDebugInfoDebugDeclare: { - CHECK_DEBUG_OPERAND("Local Variable", - CommonDebugInfoDebugLocalVariable, 5); - auto* operand = _.FindDef(inst->word(6)); + CHECK_DEBUG_OPERAND("Source", OpenCLDebugInfo100DebugSource, 8); + break; + } + case OpenCLDebugInfo100DebugGlobalVariable: { + CHECK_OPERAND("Name", SpvOpString, 5); + auto validate_type = + ValidateOperandDebugType(_, "Type", inst, 6, ext_inst_name, false); + if (validate_type != SPV_SUCCESS) return validate_type; + CHECK_DEBUG_OPERAND("Source", OpenCLDebugInfo100DebugSource, 7); + auto validate_scope = + ValidateOperandLexicalScope(_, "Scope", inst, 10, ext_inst_name); + if (validate_scope != SPV_SUCCESS) return validate_scope; + CHECK_OPERAND("Linkage Name", SpvOpString, 11); + if (!DoesDebugInfoOperandMatchExpectation( + _, + [](OpenCLDebugInfo100Instructions dbg_inst) { + return dbg_inst == OpenCLDebugInfo100DebugInfoNone; + }, + inst, 12)) { + auto* operand = _.FindDef(inst->word(12)); if (operand->opcode() != SpvOpVariable && - operand->opcode() != SpvOpFunctionParameter) { + operand->opcode() != SpvOpConstant) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": " << "expected operand Variable must be a result id of " - "OpVariable or OpFunctionParameter"; + "OpVariable or OpConstant or DebugInfoNone"; } - - CHECK_DEBUG_OPERAND("Expression", CommonDebugInfoDebugExpression, 7); - - if (vulkanDebugInfo) { - for (uint32_t word_index = 8; word_index < num_words; - ++word_index) { - auto index_inst = _.FindDef(inst->word(word_index)); - auto type_id = index_inst != nullptr ? index_inst->type_id() : 0; - if (type_id == 0 || !IsIntScalar(_, type_id, false, false)) - return _.diag(SPV_ERROR_INVALID_DATA, inst) - << ext_inst_name() << ": " - << "expected index must be scalar integer"; - } - } - break; } - case CommonDebugInfoDebugExpression: { - for (uint32_t word_index = 5; word_index < num_words; ++word_index) { - CHECK_DEBUG_OPERAND("Operation", CommonDebugInfoDebugOperation, - word_index); - } - break; + if (num_words == 15) { + CHECK_DEBUG_OPERAND("Static Member Declaration", + OpenCLDebugInfo100DebugTypeMember, 14); } - case CommonDebugInfoDebugTypeTemplate: { - if (!DoesDebugInfoOperandMatchExpectation( - _, - [](CommonDebugInfoInstructions dbg_inst) { - return dbg_inst == CommonDebugInfoDebugTypeComposite || - dbg_inst == CommonDebugInfoDebugFunction; - }, - inst, 5)) { - return _.diag(SPV_ERROR_INVALID_DATA, inst) - << ext_inst_name() << ": " - << "expected operand Target must be DebugTypeComposite " - << "or DebugFunction"; - } - for (uint32_t word_index = 6; word_index < num_words; ++word_index) { - if (!DoesDebugInfoOperandMatchExpectation( - _, - [](CommonDebugInfoInstructions dbg_inst) { - return dbg_inst == - CommonDebugInfoDebugTypeTemplateParameter || - dbg_inst == - CommonDebugInfoDebugTypeTemplateTemplateParameter; - }, - inst, word_index)) { - return _.diag(SPV_ERROR_INVALID_DATA, inst) - << ext_inst_name() << ": " - << "expected operand Parameters must be " - << "DebugTypeTemplateParameter or " - << "DebugTypeTemplateTemplateParameter"; - } - } - break; - } - case CommonDebugInfoDebugTypeTemplateParameter: { - CHECK_OPERAND("Name", SpvOpString, 5); - auto validate_actual_type = ValidateOperandDebugType( - _, "Actual Type", inst, 6, ext_inst_name, false); - if (validate_actual_type != SPV_SUCCESS) return validate_actual_type; - if (!DoesDebugInfoOperandMatchExpectation( - _, - [](CommonDebugInfoInstructions dbg_inst) { - return dbg_inst == CommonDebugInfoDebugInfoNone; - }, - inst, 7)) { - CHECK_OPERAND("Value", SpvOpConstant, 7); - } - CHECK_DEBUG_OPERAND("Source", CommonDebugInfoDebugSource, 8); - CHECK_CONST_UINT_OPERAND("Line", 9); - CHECK_CONST_UINT_OPERAND("Column", 10); - break; - } - case CommonDebugInfoDebugGlobalVariable: { - CHECK_OPERAND("Name", SpvOpString, 5); - auto validate_type = ValidateOperandDebugType(_, "Type", inst, 6, - ext_inst_name, false); - if (validate_type != SPV_SUCCESS) return validate_type; - CHECK_DEBUG_OPERAND("Source", CommonDebugInfoDebugSource, 7); - CHECK_CONST_UINT_OPERAND("Line", 8); - CHECK_CONST_UINT_OPERAND("Column", 9); - auto validate_scope = - ValidateOperandLexicalScope(_, "Scope", inst, 10, ext_inst_name); - if (validate_scope != SPV_SUCCESS) return validate_scope; - CHECK_OPERAND("Linkage Name", SpvOpString, 11); - if (!DoesDebugInfoOperandMatchExpectation( - _, - [](CommonDebugInfoInstructions dbg_inst) { - return dbg_inst == CommonDebugInfoDebugInfoNone; - }, - inst, 12)) { - auto* operand = _.FindDef(inst->word(12)); - if (operand->opcode() != SpvOpVariable && - operand->opcode() != SpvOpConstant) { - return _.diag(SPV_ERROR_INVALID_DATA, inst) - << ext_inst_name() << ": " - << "expected operand Variable must be a result id of " - "OpVariable or OpConstant or DebugInfoNone"; - } - } - if (num_words == 15) { - CHECK_DEBUG_OPERAND("Static Member Declaration", - CommonDebugInfoDebugTypeMember, 14); - } - break; - } - case CommonDebugInfoDebugInlinedAt: { - CHECK_CONST_UINT_OPERAND("Line", 5); - auto validate_scope = - ValidateOperandLexicalScope(_, "Scope", inst, 6, ext_inst_name); - if (validate_scope != SPV_SUCCESS) return validate_scope; - if (num_words == 8) { - CHECK_DEBUG_OPERAND("Inlined", CommonDebugInfoDebugInlinedAt, 7); - } - break; - } - case CommonDebugInfoDebugValue: { - CHECK_DEBUG_OPERAND("Local Variable", - CommonDebugInfoDebugLocalVariable, 5); - CHECK_DEBUG_OPERAND("Expression", CommonDebugInfoDebugExpression, 7); - - for (uint32_t word_index = 8; word_index < num_words; ++word_index) { - // TODO: The following code simply checks if it is a const int - // scalar or a DebugLocalVariable or DebugGlobalVariable, but we - // have to check it using the same validation for Indexes of - // OpAccessChain. - if (!IsConstWithIntScalarType(_, inst, word_index) && - !IsDebugVariableWithIntScalarType(_, inst, word_index)) { - return _.diag(SPV_ERROR_INVALID_DATA, inst) - << ext_inst_name() << ": expected operand Indexes is " - << "OpConstant, DebugGlobalVariable, or " - << "type is OpConstant with an integer scalar type"; - } - } - break; - } - - // TODO: Add validation rules for remaining cases as well. - case CommonDebugInfoDebugTypePtrToMember: - case CommonDebugInfoDebugTypeTemplateTemplateParameter: - case CommonDebugInfoDebugTypeTemplateParameterPack: - case CommonDebugInfoDebugLexicalBlockDiscriminator: - case CommonDebugInfoDebugInlinedVariable: - case CommonDebugInfoDebugMacroDef: - case CommonDebugInfoDebugMacroUndef: - case CommonDebugInfoDebugImportedEntity: - break; - case CommonDebugInfoInstructionsMax: - assert(0); - break; + break; } + case OpenCLDebugInfo100DebugInlinedAt: { + auto validate_scope = + ValidateOperandLexicalScope(_, "Scope", inst, 6, ext_inst_name); + if (validate_scope != SPV_SUCCESS) return validate_scope; + if (num_words == 8) { + CHECK_DEBUG_OPERAND("Inlined", OpenCLDebugInfo100DebugInlinedAt, 7); + } + break; + } + case OpenCLDebugInfo100DebugValue: { + CHECK_DEBUG_OPERAND("Local Variable", + OpenCLDebugInfo100DebugLocalVariable, 5); + CHECK_DEBUG_OPERAND("Expression", OpenCLDebugInfo100DebugExpression, 7); + + for (uint32_t word_index = 8; word_index < num_words; ++word_index) { + // TODO: The following code simply checks if it is a const int scalar + // or a DebugLocalVariable or DebugGlobalVariable, but we have to + // check it using the same validation for Indexes of OpAccessChain. + if (!IsConstWithIntScalarType(_, inst, word_index) && + !IsDebugVariableWithIntScalarType(_, inst, word_index)) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << ext_inst_name() << ": expected operand Indexes is " + << "OpConstant, DebugGlobalVariable, or " + << "type is OpConstant with an integer scalar type"; + } + } + break; + } + + // TODO: Add validation rules for remaining cases as well. + case OpenCLDebugInfo100DebugTypePtrToMember: + case OpenCLDebugInfo100DebugTypeTemplateTemplateParameter: + case OpenCLDebugInfo100DebugTypeTemplateParameterPack: + case OpenCLDebugInfo100DebugLexicalBlockDiscriminator: + case OpenCLDebugInfo100DebugInlinedVariable: + case OpenCLDebugInfo100DebugMacroDef: + case OpenCLDebugInfo100DebugMacroUndef: + case OpenCLDebugInfo100DebugImportedEntity: + break; + case OpenCLDebugInfo100InstructionsMax: + assert(0); + break; } } else if (ext_inst_type == SPV_EXT_INST_TYPE_NONSEMANTIC_CLSPVREFLECTION) { auto import_inst = _.FindDef(inst->GetOperandAs(2)); diff --git a/source/val/validate_image.cpp b/source/val/validate_image.cpp index e5968d06..bdb2516e 100644 --- a/source/val/validate_image.cpp +++ b/source/val/validate_image.cpp @@ -442,8 +442,7 @@ spv_result_t ValidateImageOperands(ValidationState_t& _, << " components, but given " << offset_size; } - if (!_.options()->before_hlsl_legalization && - spvIsVulkanEnv(_.context()->target_env)) { + if (spvIsVulkanEnv(_.context()->target_env)) { if (opcode != SpvOpImageGather && opcode != SpvOpImageDrefGather && opcode != SpvOpImageSparseGather && opcode != SpvOpImageSparseDrefGather) { @@ -1510,8 +1509,8 @@ spv_result_t ValidateImageRead(ValidationState_t& _, const Instruction* inst) { if (spvIsVulkanEnv(target_env)) { if (_.GetDimension(actual_result_type) != 4) { return _.diag(SPV_ERROR_INVALID_DATA, inst) - << _.VkErrorID(4780) << "Expected " - << GetActualResultTypeStr(opcode) << " to have 4 components"; + << "Expected " << GetActualResultTypeStr(opcode) + << " to have 4 components"; } } // Check OpenCL below, after we get the image info. diff --git a/source/val/validate_interfaces.cpp b/source/val/validate_interfaces.cpp index d3ef5386..d16d48e2 100644 --- a/source/val/validate_interfaces.cpp +++ b/source/val/validate_interfaces.cpp @@ -27,10 +27,6 @@ namespace spvtools { namespace val { namespace { -// Limit the number of checked locations to 4096. Multiplied by 4 to represent -// all the components. This limit is set to be well beyond practical use cases. -const uint32_t kMaxLocations = 4096 * 4; - // Returns true if \c inst is an input or output variable. bool is_interface_variable(const Instruction* inst, bool is_spv_1_4) { if (is_spv_1_4) { @@ -351,11 +347,6 @@ spv_result_t GetLocationsForVariable( uint32_t num_components = NumConsumedComponents(_, sub_type); uint32_t array_location = location + (num_locations * array_idx); uint32_t start = array_location * 4; - if (kMaxLocations <= start) { - // Too many locations, give up. - break; - } - uint32_t end = (array_location + num_locations) * 4; if (num_components != 0) { start += component; @@ -425,11 +416,6 @@ spv_result_t GetLocationsForVariable( } uint32_t start = location * 4; - if (kMaxLocations <= start) { - // Too many locations, give up. - continue; - } - uint32_t end = (location + num_locations) * 4; if (num_components != 0) { start += component; @@ -468,7 +454,6 @@ spv_result_t ValidateLocations(ValidationState_t& _, std::unordered_set input_locations; std::unordered_set output_locations_index0; std::unordered_set output_locations_index1; - std::unordered_set seen; for (uint32_t i = 3; i < entry_point->operands().size(); ++i) { auto interface_id = entry_point->GetOperandAs(i); auto interface_var = _.FindDef(interface_id); @@ -477,11 +462,6 @@ spv_result_t ValidateLocations(ValidationState_t& _, storage_class != SpvStorageClassOutput) { continue; } - if (!seen.insert(interface_id).second) { - // Pre-1.4 an interface variable could be listed multiple times in an - // entry point. Validation for 1.4 or later is done elsewhere. - continue; - } auto locations = (storage_class == SpvStorageClassInput) ? &input_locations diff --git a/source/val/validate_layout.cpp b/source/val/validate_layout.cpp index e6f4fcad..b53f991e 100644 --- a/source/val/validate_layout.cpp +++ b/source/val/validate_layout.cpp @@ -17,7 +17,6 @@ #include #include "DebugInfo.h" -#include "NonSemanticVulkanDebugInfo100.h" #include "OpenCLDebugInfo100.h" #include "source/diagnostic.h" #include "source/opcode.h" @@ -38,7 +37,17 @@ spv_result_t ModuleScopedInstructions(ValidationState_t& _, const Instruction* inst, SpvOp opcode) { switch (opcode) { case SpvOpExtInst: - if (spvExtInstIsDebugInfo(inst->ext_inst_type())) { + if (spvExtInstIsNonSemantic(inst->ext_inst_type())) { + // non-semantic extinst opcodes are allowed beginning in the types + // section, but since they must name a return type they cannot be the + // first instruction in the types section. Therefore check that we are + // already in it. + if (_.current_layout_section() < kLayoutTypes) { + return _.diag(SPV_ERROR_INVALID_LAYOUT, inst) + << "Non-semantic OpExtInst must not appear before types " + << "section"; + } + } else if (spvExtInstIsDebugInfo(inst->ext_inst_type())) { const uint32_t ext_inst_index = inst->word(4); bool local_debug_info = false; if (inst->ext_inst_type() == SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100) { @@ -50,18 +59,6 @@ spv_result_t ModuleScopedInstructions(ValidationState_t& _, ext_inst_key == OpenCLDebugInfo100DebugValue) { local_debug_info = true; } - } else if (inst->ext_inst_type() == - SPV_EXT_INST_TYPE_NONSEMANTIC_VULKAN_DEBUGINFO_100) { - const NonSemanticVulkanDebugInfo100Instructions ext_inst_key = - NonSemanticVulkanDebugInfo100Instructions(ext_inst_index); - if (ext_inst_key == NonSemanticVulkanDebugInfo100DebugScope || - ext_inst_key == NonSemanticVulkanDebugInfo100DebugNoScope || - ext_inst_key == NonSemanticVulkanDebugInfo100DebugDeclare || - ext_inst_key == NonSemanticVulkanDebugInfo100DebugValue || - ext_inst_key == - NonSemanticVulkanDebugInfo100DebugFunctionDefinition) { - local_debug_info = true; - } } else { const DebugInfoInstructions ext_inst_key = DebugInfoInstructions(ext_inst_index); @@ -97,16 +94,6 @@ spv_result_t ModuleScopedInstructions(ValidationState_t& _, << "declarations)"; } } - } else if (spvExtInstIsNonSemantic(inst->ext_inst_type())) { - // non-semantic extinst opcodes are allowed beginning in the types - // section, but since they must name a return type they cannot be the - // first instruction in the types section. Therefore check that we are - // already in it. - if (_.current_layout_section() < kLayoutTypes) { - return _.diag(SPV_ERROR_INVALID_LAYOUT, inst) - << "Non-semantic OpExtInst must not appear before types " - << "section"; - } } else { // otherwise they must be used in a block if (_.current_layout_section() < kLayoutFunctionDefinitions) { @@ -243,7 +230,20 @@ spv_result_t FunctionScopedInstructions(ValidationState_t& _, break; case SpvOpExtInst: - if (spvExtInstIsDebugInfo(inst->ext_inst_type())) { + if (spvExtInstIsNonSemantic(inst->ext_inst_type())) { + // non-semantic extinst opcodes are allowed beginning in the types + // section, but must either be placed outside a function declaration, + // or inside a block. + if (_.current_layout_section() < kLayoutTypes) { + return _.diag(SPV_ERROR_INVALID_LAYOUT, inst) + << "Non-semantic OpExtInst must not appear before types " + << "section"; + } else if (_.in_function_body() && _.in_block() == false) { + return _.diag(SPV_ERROR_INVALID_LAYOUT, inst) + << "Non-semantic OpExtInst within function definition must " + "appear in a block"; + } + } else if (spvExtInstIsDebugInfo(inst->ext_inst_type())) { const uint32_t ext_inst_index = inst->word(4); bool local_debug_info = false; if (inst->ext_inst_type() == SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100) { @@ -255,18 +255,6 @@ spv_result_t FunctionScopedInstructions(ValidationState_t& _, ext_inst_key == OpenCLDebugInfo100DebugValue) { local_debug_info = true; } - } else if (inst->ext_inst_type() == - SPV_EXT_INST_TYPE_NONSEMANTIC_VULKAN_DEBUGINFO_100) { - const NonSemanticVulkanDebugInfo100Instructions ext_inst_key = - NonSemanticVulkanDebugInfo100Instructions(ext_inst_index); - if (ext_inst_key == NonSemanticVulkanDebugInfo100DebugScope || - ext_inst_key == NonSemanticVulkanDebugInfo100DebugNoScope || - ext_inst_key == NonSemanticVulkanDebugInfo100DebugDeclare || - ext_inst_key == NonSemanticVulkanDebugInfo100DebugValue || - ext_inst_key == - NonSemanticVulkanDebugInfo100DebugFunctionDefinition) { - local_debug_info = true; - } } else { const DebugInfoInstructions ext_inst_key = DebugInfoInstructions(ext_inst_index); @@ -302,19 +290,6 @@ spv_result_t FunctionScopedInstructions(ValidationState_t& _, << "declarations)"; } } - } else if (spvExtInstIsNonSemantic(inst->ext_inst_type())) { - // non-semantic extinst opcodes are allowed beginning in the types - // section, but must either be placed outside a function declaration, - // or inside a block. - if (_.current_layout_section() < kLayoutTypes) { - return _.diag(SPV_ERROR_INVALID_LAYOUT, inst) - << "Non-semantic OpExtInst must not appear before types " - << "section"; - } else if (_.in_function_body() && _.in_block() == false) { - return _.diag(SPV_ERROR_INVALID_LAYOUT, inst) - << "Non-semantic OpExtInst within function definition must " - "appear in a block"; - } } else { // otherwise they must be used in a block if (_.in_block() == false) { diff --git a/source/val/validate_memory.cpp b/source/val/validate_memory.cpp index a7b0f82d..a4bc0fab 100644 --- a/source/val/validate_memory.cpp +++ b/source/val/validate_memory.cpp @@ -893,12 +893,6 @@ spv_result_t ValidateLoad(ValidationState_t& _, const Instruction* inst) { << "'s type."; } - if (!_.options()->before_hlsl_legalization && - _.ContainsRuntimeArray(inst->type_id())) { - return _.diag(SPV_ERROR_INVALID_ID, inst) - << "Cannot load a runtime-sized array"; - } - if (auto error = CheckMemoryAccess(_, inst, 3)) return error; if (_.HasCapability(SpvCapabilityShader) && diff --git a/source/val/validate_mode_setting.cpp b/source/val/validate_mode_setting.cpp index 4fb6d9b9..79f82d8d 100644 --- a/source/val/validate_mode_setting.cpp +++ b/source/val/validate_mode_setting.cpp @@ -225,13 +225,6 @@ spv_result_t ValidateEntryPoint(ValidationState_t& _, const Instruction* inst) { } } } - if (i.opcode() == SpvOpExecutionModeId) { - const auto mode = i.GetOperandAs(1); - if (mode == SpvExecutionModeLocalSizeId) { - ok = true; - break; - } - } } if (!ok) { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -436,10 +429,6 @@ spv_result_t ValidateExecutionMode(ValidationState_t& _, break; case SpvExecutionModeLocalSize: case SpvExecutionModeLocalSizeId: - if (mode == SpvExecutionModeLocalSizeId && !_.IsLocalSizeIdAllowed()) - return _.diag(SPV_ERROR_INVALID_DATA, inst) - << "LocalSizeId mode is not allowed by the current environment."; - if (!std::all_of(models->begin(), models->end(), [&_](const SpvExecutionModel& model) { switch (model) { diff --git a/source/val/validation_state.cpp b/source/val/validation_state.cpp index e6a02dc9..db86fd25 100644 --- a/source/val/validation_state.cpp +++ b/source/val/validation_state.cpp @@ -175,9 +175,6 @@ ValidationState_t::ValidationState_t(const spv_const_context ctx, } } - // LocalSizeId is always allowed in non-Vulkan environments. - features_.env_allow_localsizeid = !spvIsVulkanEnv(env); - // Only attempt to count if we have words, otherwise let the other validation // fail and generate an error. if (num_words > 0) { @@ -523,39 +520,17 @@ void ValidationState_t::RegisterDebugInstruction(const Instruction* inst) { void ValidationState_t::RegisterInstruction(Instruction* inst) { if (inst->id()) all_definitions_.insert(std::make_pair(inst->id(), inst)); - // Some validation checks are easier by getting all the consumers + // If the instruction is using an OpTypeSampledImage as an operand, it should + // be recorded. The validator will ensure that all usages of an + // OpTypeSampledImage and its definition are in the same basic block. for (uint16_t i = 0; i < inst->operands().size(); ++i) { const spv_parsed_operand_t& operand = inst->operand(i); - if ((SPV_OPERAND_TYPE_ID == operand.type) || - (SPV_OPERAND_TYPE_TYPE_ID == operand.type)) { + if (SPV_OPERAND_TYPE_ID == operand.type) { const uint32_t operand_word = inst->word(operand.offset); Instruction* operand_inst = FindDef(operand_word); - if (!operand_inst) { - continue; - } - - // If the instruction is using an OpTypeSampledImage as an operand, it - // should be recorded. The validator will ensure that all usages of an - // OpTypeSampledImage and its definition are in the same basic block. - if ((SPV_OPERAND_TYPE_ID == operand.type) && - (SpvOpSampledImage == operand_inst->opcode())) { + if (operand_inst && SpvOpSampledImage == operand_inst->opcode()) { RegisterSampledImageConsumer(operand_word, inst); } - - // In order to track storage classes (not Function) used per execution - // model we can't use RegisterExecutionModelLimitation on instructions - // like OpTypePointer which are going to be in the pre-function section. - // Instead just need to register storage class usage for consumers in a - // function block. - if (inst->function()) { - if (operand_inst->opcode() == SpvOpTypePointer) { - RegisterStorageClassConsumer( - operand_inst->GetOperandAs(1), inst); - } else if (operand_inst->opcode() == SpvOpVariable) { - RegisterStorageClassConsumer( - operand_inst->GetOperandAs(2), inst); - } - } } } } @@ -575,57 +550,6 @@ void ValidationState_t::RegisterSampledImageConsumer(uint32_t sampled_image_id, sampled_image_consumers_[sampled_image_id].push_back(consumer); } -void ValidationState_t::RegisterStorageClassConsumer( - SpvStorageClass storage_class, Instruction* consumer) { - if (spvIsVulkanEnv(context()->target_env)) { - if (storage_class == SpvStorageClassOutput) { - std::string errorVUID = VkErrorID(4644); - function(consumer->function()->id()) - ->RegisterExecutionModelLimitation([errorVUID]( - SpvExecutionModel model, std::string* message) { - if (model == SpvExecutionModelGLCompute || - model == SpvExecutionModelRayGenerationKHR || - model == SpvExecutionModelIntersectionKHR || - model == SpvExecutionModelAnyHitKHR || - model == SpvExecutionModelClosestHitKHR || - model == SpvExecutionModelMissKHR || - model == SpvExecutionModelCallableKHR) { - if (message) { - *message = - errorVUID + - "in Vulkan evironment, Output Storage Class must not be " - "used in GLCompute, RayGenerationKHR, IntersectionKHR, " - "AnyHitKHR, ClosestHitKHR, MissKHR, or CallableKHR " - "execution models"; - } - return false; - } - return true; - }); - } - - if (storage_class == SpvStorageClassWorkgroup) { - std::string errorVUID = VkErrorID(4645); - function(consumer->function()->id()) - ->RegisterExecutionModelLimitation([errorVUID]( - SpvExecutionModel model, std::string* message) { - if (model != SpvExecutionModelGLCompute && - model != SpvExecutionModelTaskNV && - model != SpvExecutionModelMeshNV) { - if (message) { - *message = - errorVUID + - "in Vulkan evironment, Workgroup Storage Class is limited " - "to MeshNV, TaskNV, and GLCompute execution model"; - } - return false; - } - return true; - }); - } - } -} - uint32_t ValidationState_t::getIdBound() const { return id_bound_; } void ValidationState_t::setIdBound(const uint32_t bound) { id_bound_ = bound; } @@ -1265,13 +1189,16 @@ const Instruction* ValidationState_t::TracePointer( return base_ptr; } -bool ValidationState_t::ContainsType( - uint32_t id, const std::function& f, - bool traverse_all_types) const { +bool ValidationState_t::ContainsSizedIntOrFloatType(uint32_t id, SpvOp type, + uint32_t width) const { + if (type != SpvOpTypeInt && type != SpvOpTypeFloat) return false; + const auto inst = FindDef(id); if (!inst) return false; - if (f(inst)) return true; + if (inst->opcode() == type) { + return inst->GetOperandAs(1u) == width; + } switch (inst->opcode()) { case SpvOpTypeArray: @@ -1281,45 +1208,24 @@ bool ValidationState_t::ContainsType( case SpvOpTypeImage: case SpvOpTypeSampledImage: case SpvOpTypeCooperativeMatrixNV: - return ContainsType(inst->GetOperandAs(1u), f, - traverse_all_types); + return ContainsSizedIntOrFloatType(inst->GetOperandAs(1u), type, + width); case SpvOpTypePointer: if (IsForwardPointer(id)) return false; - if (traverse_all_types) { - return ContainsType(inst->GetOperandAs(2u), f, - traverse_all_types); - } - break; + return ContainsSizedIntOrFloatType(inst->GetOperandAs(2u), type, + width); case SpvOpTypeFunction: - case SpvOpTypeStruct: - if (inst->opcode() == SpvOpTypeFunction && !traverse_all_types) { - return false; - } + case SpvOpTypeStruct: { for (uint32_t i = 1; i < inst->operands().size(); ++i) { - if (ContainsType(inst->GetOperandAs(i), f, - traverse_all_types)) { + if (ContainsSizedIntOrFloatType(inst->GetOperandAs(i), type, + width)) return true; - } } - break; - default: - break; - } - - return false; -} - -bool ValidationState_t::ContainsSizedIntOrFloatType(uint32_t id, SpvOp type, - uint32_t width) const { - if (type != SpvOpTypeInt && type != SpvOpTypeFloat) return false; - - const auto f = [type, width](const Instruction* inst) { - if (inst->opcode() == type) { - return inst->GetOperandAs(1u) == width; + return false; } - return false; - }; - return ContainsType(id, f); + default: + return false; + } } bool ValidationState_t::ContainsLimitedUseIntOrFloatType(uint32_t id) const { @@ -1334,13 +1240,6 @@ bool ValidationState_t::ContainsLimitedUseIntOrFloatType(uint32_t id) const { return false; } -bool ValidationState_t::ContainsRuntimeArray(uint32_t id) const { - const auto f = [](const Instruction* inst) { - return inst->opcode() == SpvOpTypeRuntimeArray; - }; - return ContainsType(id, f, /* traverse_all_types = */ false); -} - bool ValidationState_t::IsValidStorageClass( SpvStorageClass storage_class) const { if (spvIsVulkanEnv(context()->target_env)) { @@ -1797,10 +1696,6 @@ std::string ValidationState_t::VkErrorID(uint32_t id, return VUID_WRAP(VUID-StandaloneSpirv-None-04642); case 4643: return VUID_WRAP(VUID-StandaloneSpirv-None-04643); - case 4644: - return VUID_WRAP(VUID-StandaloneSpirv-None-04644); - case 4645: - return VUID_WRAP(VUID-StandaloneSpirv-None-04645); case 4651: return VUID_WRAP(VUID-StandaloneSpirv-OpVariable-04651); case 4652: @@ -1853,8 +1748,6 @@ std::string ValidationState_t::VkErrorID(uint32_t id, return VUID_WRAP(VUID-StandaloneSpirv-OpMemoryBarrier-04732); case 4733: return VUID_WRAP(VUID-StandaloneSpirv-OpMemoryBarrier-04733); - case 4780: - return VUID_WRAP(VUID-StandaloneSpirv-Result-04780); default: return ""; // unknown id } diff --git a/source/val/validation_state.h b/source/val/validation_state.h index 4e35cd2e..85111391 100644 --- a/source/val/validation_state.h +++ b/source/val/validation_state.h @@ -121,9 +121,6 @@ class ValidationState_t { // SPIR-V 1.4 allows Function and Private variables to be NonWritable bool nonwritable_var_in_function_or_private = false; - - // Whether LocalSizeId execution mode is allowed by the environment. - bool env_allow_localsizeid = false; }; ValidationState_t(const spv_const_context context, @@ -468,10 +465,6 @@ class ValidationState_t { void RegisterSampledImageConsumer(uint32_t sampled_image_id, Instruction* consumer); - // Record a function's storage class consumer instruction - void RegisterStorageClassConsumer(SpvStorageClass storage_class, - Instruction* consumer); - /// Returns the set of Global Variables. std::unordered_set& global_vars() { return global_vars_; } @@ -496,12 +489,6 @@ class ValidationState_t { return features_.env_relaxed_block_layout || options()->relax_block_layout; } - // Returns true if allowing localsizeid, either because the environment always - // allows it, or because it is enabled from the command-line. - bool IsLocalSizeIdAllowed() const { - return features_.env_allow_localsizeid || options()->allow_localsizeid; - } - /// Sets the struct nesting depth for a given struct ID void set_struct_nesting_depth(uint32_t id, uint32_t depth) { struct_nesting_depth_[id] = depth; @@ -604,17 +591,6 @@ class ValidationState_t { // 16-bit float that is not generally enabled for use. bool ContainsLimitedUseIntOrFloatType(uint32_t id) const; - // Returns true if |id| is a type that contains a runtime-sized array. - // Does not consider a pointers as contains the array. - bool ContainsRuntimeArray(uint32_t id) const; - - // Generic type traversal. - // Only traverse pointers and functions if |traverse_all_types| is true. - // Recursively tests |f| against the type hierarchy headed by |id|. - bool ContainsType(uint32_t id, - const std::function& f, - bool traverse_all_types = true) const; - // Gets value from OpConstant and OpSpecConstant as uint64. // Returns false on failure (no instruction, wrong instruction, not int). bool GetConstantValUint64(uint32_t id, uint64_t* val) const; diff --git a/source/wasm/README.md b/source/wasm/README.md deleted file mode 100644 index aca0f70c..00000000 --- a/source/wasm/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# SPIRV-Tools - -Wasm (WebAssembly) build of https://github.com/KhronosGroup/SPIRV-Tools - -## Usage - -```js -const spirvTools = require("spirv-tools"); - -const test = async () => { - // Load the library - const spv = await spirvTools(); - - // assemble - const source = ` - OpCapability Linkage - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpSource GLSL 450 - OpDecorate %spec SpecId 1 - %int = OpTypeInt 32 1 - %spec = OpSpecConstant %int 0 - %const = OpConstant %int 42`; - const asResult = spv.as( - source, - spv.SPV_ENV_UNIVERSAL_1_3, - spv.SPV_TEXT_TO_BINARY_OPTION_NONE - ); - console.log(`as returned ${asResult.byteLength} bytes`); - - // re-disassemble - const disResult = spv.dis( - asResult, - spv.SPV_ENV_UNIVERSAL_1_3, - spv.SPV_BINARY_TO_TEXT_OPTION_INDENT | - spv.SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES | - spv.SPV_BINARY_TO_TEXT_OPTION_COLOR - ); - console.log("dis:\n", disResult); -}; - -test(); -``` diff --git a/source/wasm/build.sh b/source/wasm/build.sh deleted file mode 100755 index f02ae525..00000000 --- a/source/wasm/build.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2020 The Khronos Group Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -e - -NUM_CORES=$(nproc) -echo "Detected $NUM_CORES cores for building" - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -VERSION=$(sed -n '0,/^v20/ s/^v\(20[0-9.]*\).*/\1/p' $DIR/../../CHANGES).${GITHUB_RUN_NUMBER:-0} -echo "Version: $VERSION" - -build() { - type=$1 - shift - args=$@ - mkdir -p build/$type - pushd build/$type - echo $args - emcmake cmake \ - -DCMAKE_BUILD_TYPE=Release \ - $args \ - ../.. - emmake make -j $(( $NUM_CORES )) SPIRV-Tools-static - - echo Building js interface - emcc \ - --bind \ - -I../../include \ - -std=c++11 \ - ../../source/wasm/spirv-tools.cpp \ - source/libSPIRV-Tools.a \ - -o spirv-tools.js \ - -s MODULARIZE \ - -Oz - - popd - mkdir -p out/$type - - # copy other js files - cp source/wasm/spirv-tools.d.ts out/$type/ - sed -e 's/\("version"\s*:\s*\).*/\1"'$VERSION'",/' source/wasm/package.json > out/$type/package.json - cp source/wasm/README.md out/$type/ - cp LICENSE out/$type/ - - cp build/$type/spirv-tools.js out/$type/ - gzip -9 -k -f out/$type/spirv-tools.js - if [ -e build/$type/spirv-tools.wasm ] ; then - cp build/$type/spirv-tools.wasm out/$type/ - gzip -9 -k -f out/$type/spirv-tools.wasm - fi -} - -if [ ! -d external/spirv-headers ] ; then - echo "Fetching SPIRV-headers" - git clone https://github.com/KhronosGroup/SPIRV-Headers.git external/spirv-headers -fi - -echo Building ${BASH_REMATCH[1]} -build web\ - -DSPIRV_COLOR_TERMINAL=OFF\ - -DSPIRV_SKIP_TESTS=ON\ - -DSPIRV_SKIP_EXECUTABLES=ON - -wc -c out/*/* diff --git a/source/wasm/package.json b/source/wasm/package.json deleted file mode 100644 index 78273538..00000000 --- a/source/wasm/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "spirv-tools", - "version": "VERSION", - "license": "Apache-2.0", - "main": "spirv-tools", - "types": "spirv-tools.d.ts", - "files": [ - "*.wasm", - "*.js", - "*.d.ts" - ], - "repository": { - "type": "git", - "url": "https://github.com/KhronosGroup/SPIRV-Tools" - }, - "homepage": "https://github.com/KhronosGroup/SPIRV-Tools" -} diff --git a/source/wasm/spirv-tools.cpp b/source/wasm/spirv-tools.cpp deleted file mode 100644 index 33f2f05f..00000000 --- a/source/wasm/spirv-tools.cpp +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) 2020 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "spirv-tools/libspirv.hpp" - -#include -#include -#include - -#include -#include -using namespace emscripten; - -void print_msg_to_stderr (spv_message_level_t, const char*, - const spv_position_t&, const char* m) { - std::cerr << "error: " << m << std::endl; -}; - -std::string dis(std::string const& buffer, uint32_t env, uint32_t options) { - spvtools::SpirvTools core(static_cast(env)); - core.SetMessageConsumer(print_msg_to_stderr); - - std::vector spirv; - const uint32_t* ptr = reinterpret_cast(buffer.data()); - spirv.assign(ptr, ptr + buffer.size() / 4); - std::string disassembly; - if (!core.Disassemble(spirv, &disassembly, options)) return "Error"; - return disassembly; -} - -emscripten::val as(std::string const& source, uint32_t env, uint32_t options) { - spvtools::SpirvTools core(static_cast(env)); - core.SetMessageConsumer(print_msg_to_stderr); - - std::vector spirv; - if (!core.Assemble(source, &spirv, options)) spirv.clear(); - const uint8_t* ptr = reinterpret_cast(spirv.data()); - return emscripten::val(emscripten::typed_memory_view(spirv.size() * 4, - ptr)); -} - -EMSCRIPTEN_BINDINGS(my_module) { - function("dis", &dis); - function("as", &as); - - constant("SPV_ENV_UNIVERSAL_1_0", static_cast(SPV_ENV_UNIVERSAL_1_0)); - constant("SPV_ENV_VULKAN_1_0", static_cast(SPV_ENV_VULKAN_1_0)); - constant("SPV_ENV_UNIVERSAL_1_1", static_cast(SPV_ENV_UNIVERSAL_1_1)); - constant("SPV_ENV_OPENCL_2_1", static_cast(SPV_ENV_OPENCL_2_1)); - constant("SPV_ENV_OPENCL_2_2", static_cast(SPV_ENV_OPENCL_2_2)); - constant("SPV_ENV_OPENGL_4_0", static_cast(SPV_ENV_OPENGL_4_0)); - constant("SPV_ENV_OPENGL_4_1", static_cast(SPV_ENV_OPENGL_4_1)); - constant("SPV_ENV_OPENGL_4_2", static_cast(SPV_ENV_OPENGL_4_2)); - constant("SPV_ENV_OPENGL_4_3", static_cast(SPV_ENV_OPENGL_4_3)); - constant("SPV_ENV_OPENGL_4_5", static_cast(SPV_ENV_OPENGL_4_5)); - constant("SPV_ENV_UNIVERSAL_1_2", static_cast(SPV_ENV_UNIVERSAL_1_2)); - constant("SPV_ENV_OPENCL_1_2", static_cast(SPV_ENV_OPENCL_1_2)); - constant("SPV_ENV_OPENCL_EMBEDDED_1_2", static_cast(SPV_ENV_OPENCL_EMBEDDED_1_2)); - constant("SPV_ENV_OPENCL_2_0", static_cast(SPV_ENV_OPENCL_2_0)); - constant("SPV_ENV_OPENCL_EMBEDDED_2_0", static_cast(SPV_ENV_OPENCL_EMBEDDED_2_0)); - constant("SPV_ENV_OPENCL_EMBEDDED_2_1", static_cast(SPV_ENV_OPENCL_EMBEDDED_2_1)); - constant("SPV_ENV_OPENCL_EMBEDDED_2_2", static_cast(SPV_ENV_OPENCL_EMBEDDED_2_2)); - constant("SPV_ENV_UNIVERSAL_1_3", static_cast(SPV_ENV_UNIVERSAL_1_3)); - constant("SPV_ENV_VULKAN_1_1", static_cast(SPV_ENV_VULKAN_1_1)); - constant("SPV_ENV_WEBGPU_0", static_cast(SPV_ENV_WEBGPU_0)); - constant("SPV_ENV_UNIVERSAL_1_4", static_cast(SPV_ENV_UNIVERSAL_1_4)); - constant("SPV_ENV_VULKAN_1_1_SPIRV_1_4", static_cast(SPV_ENV_VULKAN_1_1_SPIRV_1_4)); - constant("SPV_ENV_UNIVERSAL_1_5", static_cast(SPV_ENV_UNIVERSAL_1_5)); - constant("SPV_ENV_VULKAN_1_2", static_cast(SPV_ENV_VULKAN_1_2)); - constant("SPV_ENV_UNIVERSAL_1_6", - static_cast(SPV_ENV_UNIVERSAL_1_6)); - - constant("SPV_BINARY_TO_TEXT_OPTION_NONE", static_cast(SPV_BINARY_TO_TEXT_OPTION_NONE)); - constant("SPV_BINARY_TO_TEXT_OPTION_PRINT", static_cast(SPV_BINARY_TO_TEXT_OPTION_PRINT)); - constant("SPV_BINARY_TO_TEXT_OPTION_COLOR", static_cast(SPV_BINARY_TO_TEXT_OPTION_COLOR)); - constant("SPV_BINARY_TO_TEXT_OPTION_INDENT", static_cast(SPV_BINARY_TO_TEXT_OPTION_INDENT)); - constant("SPV_BINARY_TO_TEXT_OPTION_SHOW_BYTE_OFFSET", static_cast(SPV_BINARY_TO_TEXT_OPTION_SHOW_BYTE_OFFSET)); - constant("SPV_BINARY_TO_TEXT_OPTION_NO_HEADER", static_cast(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER)); - constant("SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES", static_cast(SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES)); - - constant("SPV_TEXT_TO_BINARY_OPTION_NONE", static_cast(SPV_TEXT_TO_BINARY_OPTION_NONE)); - constant("SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS", static_cast(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS)); -} diff --git a/source/wasm/spirv-tools.d.ts b/source/wasm/spirv-tools.d.ts deleted file mode 100644 index c06bdf18..00000000 --- a/source/wasm/spirv-tools.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 2020 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -declare interface SpirvTools { - as(input: string, env: number, options: number): Uint8Array; - dis(input: Uint8Array, env: number, options: number): string; - - SPV_ENV_UNIVERSAL_1_0: number; - SPV_ENV_VULKAN_1_0: number; - SPV_ENV_UNIVERSAL_1_1: number; - SPV_ENV_OPENCL_2_1: number; - SPV_ENV_OPENCL_2_2: number; - SPV_ENV_OPENGL_4_0: number; - SPV_ENV_OPENGL_4_1: number; - SPV_ENV_OPENGL_4_2: number; - SPV_ENV_OPENGL_4_3: number; - SPV_ENV_OPENGL_4_5: number; - SPV_ENV_UNIVERSAL_1_2: number; - SPV_ENV_OPENCL_1_2: number; - SPV_ENV_OPENCL_EMBEDDED_1_2: number; - SPV_ENV_OPENCL_2_0: number; - SPV_ENV_OPENCL_EMBEDDED_2_0: number; - SPV_ENV_OPENCL_EMBEDDED_2_1: number; - SPV_ENV_OPENCL_EMBEDDED_2_2: number; - SPV_ENV_UNIVERSAL_1_3: number; - SPV_ENV_VULKAN_1_1: number; - SPV_ENV_WEBGPU_0: number; - SPV_ENV_UNIVERSAL_1_4: number; - SPV_ENV_VULKAN_1_1_SPIRV_1_4: number; - SPV_ENV_UNIVERSAL_1_5: number; - SPV_ENV_VULKAN_1_2: number; - SPV_ENV_UNIVERSAL_1_6: number; - - SPV_TEXT_TO_BINARY_OPTION_NONE: number; - SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS: number; - - SPV_BINARY_TO_TEXT_OPTION_NONE: number; - SPV_BINARY_TO_TEXT_OPTION_PRINT: number; - SPV_BINARY_TO_TEXT_OPTION_COLOR: number; - SPV_BINARY_TO_TEXT_OPTION_INDENT: number; - SPV_BINARY_TO_TEXT_OPTION_SHOW_BYTE_OFFSET: number; - SPV_BINARY_TO_TEXT_OPTION_NO_HEADER: number; - SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES: number; -} - -export default function (): Promise; diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e88df04d..8ede58bf 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -186,11 +186,9 @@ endif() add_subdirectory(link) -add_subdirectory(lint) add_subdirectory(opt) add_subdirectory(reduce) add_subdirectory(fuzz) add_subdirectory(tools) add_subdirectory(util) add_subdirectory(val) -add_subdirectory(fuzzers) diff --git a/test/binary_to_text_test.cpp b/test/binary_to_text_test.cpp index df703e5d..9cad9661 100644 --- a/test/binary_to_text_test.cpp +++ b/test/binary_to_text_test.cpp @@ -386,7 +386,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(std::vector{ "OpExecutionModeId %1 SubgroupsPerWorkgroupId %2\n", "OpExecutionModeId %1 LocalSizeId %2 %3 %4\n", - "OpExecutionModeId %1 LocalSizeHintId %2 %3 %4\n", + "OpExecutionModeId %1 LocalSizeHintId %2\n", "OpDecorateId %1 AlignmentId %2\n", "OpDecorateId %1 MaxByteOffsetId %2\n", }))); diff --git a/test/diff/CMakeLists.txt b/test/diff/CMakeLists.txt deleted file mode 100644 index 811805bd..00000000 --- a/test/diff/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (c) 2022 Google LLC. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -include(diff_files/diff_test_files_autogen.cmake) - -add_spvtools_unittest(TARGET lcs - SRCS lcs_test.cpp - LIBS SPIRV-Tools-diff -) - -add_spvtools_unittest(TARGET diff - SRCS diff_test.cpp diff_test_utils.h diff_test_utils.cpp - ${DIFF_TEST_FILES} ${spirv-tools_SOURCE_DIR}/tools/util/cli_consumer.cpp - LIBS SPIRV-Tools-diff -) diff --git a/test/diff/diff_files/.gitignore b/test/diff/diff_files/.gitignore deleted file mode 100644 index 727526ef..00000000 --- a/test/diff/diff_files/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# To aid debugging no-dbg variants, the temporary files used to strip debug information are placed -# in a hidden directory and aren't removed after generation. -.no_dbg/ diff --git a/test/diff/diff_files/OpExtInst_in_dst_only_autogen.cpp b/test/diff/diff_files/OpExtInst_in_dst_only_autogen.cpp deleted file mode 100644 index ce899edd..00000000 --- a/test/diff/diff_files/OpExtInst_in_dst_only_autogen.cpp +++ /dev/null @@ -1,242 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_tests.py -// -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -// Tests a diff where the src shader doesn't have OpExtImport while the -// dst shader does (and uses OpExtInst). This test ensures that when matching, -// the OpExtImport instruction from the correct module is referenced. -constexpr char kSrc[] = R"( OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %9 %11 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %9 "color" - OpName %11 "v" - OpDecorate %9 RelaxedPrecision - OpDecorate %9 Location 0 - OpDecorate %11 RelaxedPrecision - OpDecorate %11 Location 0 - OpDecorate %12 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 4 - %8 = OpTypePointer Output %7 - %9 = OpVariable %8 Output - %10 = OpTypePointer Input %6 - %11 = OpVariable %10 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %12 = OpLoad %6 %11 - %13 = OpCompositeConstruct %7 %12 %12 %12 %12 - OpStore %9 %13 - OpReturn - OpFunctionEnd -)"; -constexpr char kDst[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %9 %11 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %9 "color" - OpName %11 "v" - OpDecorate %9 RelaxedPrecision - OpDecorate %9 Location 0 - OpDecorate %11 RelaxedPrecision - OpDecorate %11 Location 0 - OpDecorate %12 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - OpDecorate %14 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 4 - %8 = OpTypePointer Output %7 - %9 = OpVariable %8 Output - %10 = OpTypePointer Input %6 - %11 = OpVariable %10 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %12 = OpLoad %6 %11 - %13 = OpExtInst %6 %1 Log2 %12 - %14 = OpCompositeConstruct %7 %13 %13 %13 %13 - OpStore %9 %14 - OpReturn - OpFunctionEnd - -)"; - -TEST(DiffTest, OpextinstInDstOnly) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 14 -+; Bound: 16 - ; Schema: 0 - OpCapability Shader -+%14 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %9 %11 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %9 "color" - OpName %11 "v" - OpDecorate %9 RelaxedPrecision - OpDecorate %9 Location 0 - OpDecorate %11 RelaxedPrecision - OpDecorate %11 Location 0 - OpDecorate %12 RelaxedPrecision -+OpDecorate %15 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 4 - %8 = OpTypePointer Output %7 - %9 = OpVariable %8 Output - %10 = OpTypePointer Input %6 - %11 = OpVariable %10 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %12 = OpLoad %6 %11 -+%15 = OpExtInst %6 %14 Log2 %12 --%13 = OpCompositeConstruct %7 %12 %12 %12 %12 -+%13 = OpCompositeConstruct %7 %15 %15 %15 %15 - OpStore %9 %13 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, OpextinstInDstOnlyNoDebug) { - constexpr char kSrcNoDebug[] = R"( OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %9 %11 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpDecorate %9 RelaxedPrecision - OpDecorate %9 Location 0 - OpDecorate %11 RelaxedPrecision - OpDecorate %11 Location 0 - OpDecorate %12 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 4 - %8 = OpTypePointer Output %7 - %9 = OpVariable %8 Output - %10 = OpTypePointer Input %6 - %11 = OpVariable %10 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %12 = OpLoad %6 %11 - %13 = OpCompositeConstruct %7 %12 %12 %12 %12 - OpStore %9 %13 - OpReturn - OpFunctionEnd - -)"; - constexpr char kDstNoDebug[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %9 %11 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpDecorate %9 RelaxedPrecision - OpDecorate %9 Location 0 - OpDecorate %11 RelaxedPrecision - OpDecorate %11 Location 0 - OpDecorate %12 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - OpDecorate %14 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 4 - %8 = OpTypePointer Output %7 - %9 = OpVariable %8 Output - %10 = OpTypePointer Input %6 - %11 = OpVariable %10 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %12 = OpLoad %6 %11 - %13 = OpExtInst %6 %1 Log2 %12 - %14 = OpCompositeConstruct %7 %13 %13 %13 %13 - OpStore %9 %14 - OpReturn - OpFunctionEnd - -)"; - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 14 -+; Bound: 16 - ; Schema: 0 - OpCapability Shader -+%14 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %9 %11 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpDecorate %9 RelaxedPrecision - OpDecorate %9 Location 0 - OpDecorate %11 RelaxedPrecision - OpDecorate %11 Location 0 - OpDecorate %12 RelaxedPrecision -+OpDecorate %15 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 4 - %8 = OpTypePointer Output %7 - %9 = OpVariable %8 Output - %10 = OpTypePointer Input %6 - %11 = OpVariable %10 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %12 = OpLoad %6 %11 -+%15 = OpExtInst %6 %14 Log2 %12 --%13 = OpCompositeConstruct %7 %12 %12 %12 %12 -+%13 = OpCompositeConstruct %7 %15 %15 %15 %15 - OpStore %9 %13 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_files/OpExtInst_in_dst_only_dst.spvasm b/test/diff/diff_files/OpExtInst_in_dst_only_dst.spvasm deleted file mode 100644 index e599d1e9..00000000 --- a/test/diff/diff_files/OpExtInst_in_dst_only_dst.spvasm +++ /dev/null @@ -1,33 +0,0 @@ - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %9 %11 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %9 "color" - OpName %11 "v" - OpDecorate %9 RelaxedPrecision - OpDecorate %9 Location 0 - OpDecorate %11 RelaxedPrecision - OpDecorate %11 Location 0 - OpDecorate %12 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - OpDecorate %14 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 4 - %8 = OpTypePointer Output %7 - %9 = OpVariable %8 Output - %10 = OpTypePointer Input %6 - %11 = OpVariable %10 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %12 = OpLoad %6 %11 - %13 = OpExtInst %6 %1 Log2 %12 - %14 = OpCompositeConstruct %7 %13 %13 %13 %13 - OpStore %9 %14 - OpReturn - OpFunctionEnd - diff --git a/test/diff/diff_files/OpExtInst_in_dst_only_src.spvasm b/test/diff/diff_files/OpExtInst_in_dst_only_src.spvasm deleted file mode 100644 index 9f6fc18c..00000000 --- a/test/diff/diff_files/OpExtInst_in_dst_only_src.spvasm +++ /dev/null @@ -1,33 +0,0 @@ -;; Tests a diff where the src shader doesn't have OpExtImport while the -;; dst shader does (and uses OpExtInst). This test ensures that when matching, -;; the OpExtImport instruction from the correct module is referenced. - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %9 %11 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %9 "color" - OpName %11 "v" - OpDecorate %9 RelaxedPrecision - OpDecorate %9 Location 0 - OpDecorate %11 RelaxedPrecision - OpDecorate %11 Location 0 - OpDecorate %12 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 4 - %8 = OpTypePointer Output %7 - %9 = OpVariable %8 Output - %10 = OpTypePointer Input %6 - %11 = OpVariable %10 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %12 = OpLoad %6 %11 - %13 = OpCompositeConstruct %7 %12 %12 %12 %12 - OpStore %9 %13 - OpReturn - OpFunctionEnd - diff --git a/test/diff/diff_files/OpExtInst_in_src_only_autogen.cpp b/test/diff/diff_files/OpExtInst_in_src_only_autogen.cpp deleted file mode 100644 index 9944c2cf..00000000 --- a/test/diff/diff_files/OpExtInst_in_src_only_autogen.cpp +++ /dev/null @@ -1,242 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_tests.py -// -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -// Tests a diff where the dst shader doesn't have OpExtImport while the -// src shader does (and uses OpExtInst). This test ensures that when matching, -// the OpExtImport instruction from the correct module is referenced. -constexpr char kSrc[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %9 %11 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %9 "color" - OpName %11 "v" - OpDecorate %9 RelaxedPrecision - OpDecorate %9 Location 0 - OpDecorate %11 RelaxedPrecision - OpDecorate %11 Location 0 - OpDecorate %12 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - OpDecorate %14 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 4 - %8 = OpTypePointer Output %7 - %9 = OpVariable %8 Output - %10 = OpTypePointer Input %6 - %11 = OpVariable %10 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %12 = OpLoad %6 %11 - %13 = OpExtInst %6 %1 Log2 %12 - %14 = OpCompositeConstruct %7 %13 %13 %13 %13 - OpStore %9 %14 - OpReturn - OpFunctionEnd -)"; -constexpr char kDst[] = R"( OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %9 %11 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %9 "color" - OpName %11 "v" - OpDecorate %9 RelaxedPrecision - OpDecorate %9 Location 0 - OpDecorate %11 RelaxedPrecision - OpDecorate %11 Location 0 - OpDecorate %12 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 4 - %8 = OpTypePointer Output %7 - %9 = OpVariable %8 Output - %10 = OpTypePointer Input %6 - %11 = OpVariable %10 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %12 = OpLoad %6 %11 - %13 = OpCompositeConstruct %7 %12 %12 %12 %12 - OpStore %9 %13 - OpReturn - OpFunctionEnd - -)"; - -TEST(DiffTest, OpextinstInSrcOnly) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 15 -+; Bound: 16 - ; Schema: 0 - OpCapability Shader --%1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %9 %11 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %9 "color" - OpName %11 "v" - OpDecorate %9 RelaxedPrecision - OpDecorate %9 Location 0 - OpDecorate %11 RelaxedPrecision - OpDecorate %11 Location 0 - OpDecorate %12 RelaxedPrecision --OpDecorate %13 RelaxedPrecision - OpDecorate %14 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 4 - %8 = OpTypePointer Output %7 - %9 = OpVariable %8 Output - %10 = OpTypePointer Input %6 - %11 = OpVariable %10 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %12 = OpLoad %6 %11 --%13 = OpExtInst %6 %1 Log2 %12 --%14 = OpCompositeConstruct %7 %13 %13 %13 %13 -+%14 = OpCompositeConstruct %7 %12 %12 %12 %12 - OpStore %9 %14 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, OpextinstInSrcOnlyNoDebug) { - constexpr char kSrcNoDebug[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %9 %11 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpDecorate %9 RelaxedPrecision - OpDecorate %9 Location 0 - OpDecorate %11 RelaxedPrecision - OpDecorate %11 Location 0 - OpDecorate %12 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - OpDecorate %14 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 4 - %8 = OpTypePointer Output %7 - %9 = OpVariable %8 Output - %10 = OpTypePointer Input %6 - %11 = OpVariable %10 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %12 = OpLoad %6 %11 - %13 = OpExtInst %6 %1 Log2 %12 - %14 = OpCompositeConstruct %7 %13 %13 %13 %13 - OpStore %9 %14 - OpReturn - OpFunctionEnd - -)"; - constexpr char kDstNoDebug[] = R"( OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %9 %11 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpDecorate %9 RelaxedPrecision - OpDecorate %9 Location 0 - OpDecorate %11 RelaxedPrecision - OpDecorate %11 Location 0 - OpDecorate %12 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 4 - %8 = OpTypePointer Output %7 - %9 = OpVariable %8 Output - %10 = OpTypePointer Input %6 - %11 = OpVariable %10 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %12 = OpLoad %6 %11 - %13 = OpCompositeConstruct %7 %12 %12 %12 %12 - OpStore %9 %13 - OpReturn - OpFunctionEnd - -)"; - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 15 -+; Bound: 16 - ; Schema: 0 - OpCapability Shader --%1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %9 %11 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpDecorate %9 RelaxedPrecision - OpDecorate %9 Location 0 - OpDecorate %11 RelaxedPrecision - OpDecorate %11 Location 0 - OpDecorate %12 RelaxedPrecision --OpDecorate %13 RelaxedPrecision - OpDecorate %14 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 4 - %8 = OpTypePointer Output %7 - %9 = OpVariable %8 Output - %10 = OpTypePointer Input %6 - %11 = OpVariable %10 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %12 = OpLoad %6 %11 --%13 = OpExtInst %6 %1 Log2 %12 --%14 = OpCompositeConstruct %7 %13 %13 %13 %13 -+%14 = OpCompositeConstruct %7 %12 %12 %12 %12 - OpStore %9 %14 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_files/OpExtInst_in_src_only_dst.spvasm b/test/diff/diff_files/OpExtInst_in_src_only_dst.spvasm deleted file mode 100644 index 47233051..00000000 --- a/test/diff/diff_files/OpExtInst_in_src_only_dst.spvasm +++ /dev/null @@ -1,30 +0,0 @@ - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %9 %11 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %9 "color" - OpName %11 "v" - OpDecorate %9 RelaxedPrecision - OpDecorate %9 Location 0 - OpDecorate %11 RelaxedPrecision - OpDecorate %11 Location 0 - OpDecorate %12 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 4 - %8 = OpTypePointer Output %7 - %9 = OpVariable %8 Output - %10 = OpTypePointer Input %6 - %11 = OpVariable %10 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %12 = OpLoad %6 %11 - %13 = OpCompositeConstruct %7 %12 %12 %12 %12 - OpStore %9 %13 - OpReturn - OpFunctionEnd - diff --git a/test/diff/diff_files/OpExtInst_in_src_only_src.spvasm b/test/diff/diff_files/OpExtInst_in_src_only_src.spvasm deleted file mode 100644 index efb663a9..00000000 --- a/test/diff/diff_files/OpExtInst_in_src_only_src.spvasm +++ /dev/null @@ -1,36 +0,0 @@ -;; Tests a diff where the dst shader doesn't have OpExtImport while the -;; src shader does (and uses OpExtInst). This test ensures that when matching, -;; the OpExtImport instruction from the correct module is referenced. - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %9 %11 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %9 "color" - OpName %11 "v" - OpDecorate %9 RelaxedPrecision - OpDecorate %9 Location 0 - OpDecorate %11 RelaxedPrecision - OpDecorate %11 Location 0 - OpDecorate %12 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - OpDecorate %14 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 4 - %8 = OpTypePointer Output %7 - %9 = OpVariable %8 Output - %10 = OpTypePointer Input %6 - %11 = OpVariable %10 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %12 = OpLoad %6 %11 - %13 = OpExtInst %6 %1 Log2 %12 - %14 = OpCompositeConstruct %7 %13 %13 %13 %13 - OpStore %9 %14 - OpReturn - OpFunctionEnd - diff --git a/test/diff/diff_files/OpTypeForwardPointer_basic_autogen.cpp b/test/diff/diff_files/OpTypeForwardPointer_basic_autogen.cpp deleted file mode 100644 index af252b11..00000000 --- a/test/diff/diff_files/OpTypeForwardPointer_basic_autogen.cpp +++ /dev/null @@ -1,136 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_tests.py -// -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -// Basic test that OpTypeForwardPointer is matched -constexpr char kSrc[] = R"( OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %structptr "structptr" - OpTypeForwardPointer %structptr UniformConstant - %uint = OpTypeInt 32 0 - %structt1 = OpTypeStruct %structptr %uint - %structt2 = OpTypeStruct %uint %structptr - %structt3 = OpTypeStruct %uint %uint %structptr - %structt4 = OpTypeStruct %uint %uint %uint %structptr - %structptr = OpTypePointer UniformConstant %structt1)"; -constexpr char kDst[] = R"( OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %structptr "structptr" - OpName %structptr2 "structptr2" - OpTypeForwardPointer %structptr UniformConstant - OpTypeForwardPointer %structptr2 Function - %uint = OpTypeInt 32 0 - %structt1 = OpTypeStruct %structptr %uint - %structt2 = OpTypeStruct %uint %structptr - %structt3 = OpTypeStruct %uint %uint %structptr - %structt4 = OpTypeStruct %uint %uint %uint %structptr - %structptr = OpTypePointer UniformConstant %structt1 - %structptr2 = OpTypePointer Function %structt1 -)"; - -TEST(DiffTest, OptypeforwardpointerBasic) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 7 -+; Bound: 8 - ; Schema: 0 - OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %1 "structptr" -+OpName %7 "structptr2" - OpTypeForwardPointer %1 UniformConstant -+OpTypeForwardPointer %7 Function - %2 = OpTypeInt 32 0 - %3 = OpTypeStruct %1 %2 - %4 = OpTypeStruct %2 %1 - %5 = OpTypeStruct %2 %2 %1 - %6 = OpTypeStruct %2 %2 %2 %1 - %1 = OpTypePointer UniformConstant %3 -+%7 = OpTypePointer Function %3 -)"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, OptypeforwardpointerBasicNoDebug) { - constexpr char kSrcNoDebug[] = R"( OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpTypeForwardPointer %structptr UniformConstant - %uint = OpTypeInt 32 0 - %structt1 = OpTypeStruct %structptr %uint - %structt2 = OpTypeStruct %uint %structptr - %structt3 = OpTypeStruct %uint %uint %structptr - %structt4 = OpTypeStruct %uint %uint %uint %structptr - %structptr = OpTypePointer UniformConstant %structt1 -)"; - constexpr char kDstNoDebug[] = R"( OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpTypeForwardPointer %structptr UniformConstant - OpTypeForwardPointer %structptr2 Function - %uint = OpTypeInt 32 0 - %structt1 = OpTypeStruct %structptr %uint - %structt2 = OpTypeStruct %uint %structptr - %structt3 = OpTypeStruct %uint %uint %structptr - %structt4 = OpTypeStruct %uint %uint %uint %structptr - %structptr = OpTypePointer UniformConstant %structt1 - %structptr2 = OpTypePointer Function %structt1 -)"; - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 7 -+; Bound: 8 - ; Schema: 0 - OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpTypeForwardPointer %1 UniformConstant -+OpTypeForwardPointer %7 Function - %2 = OpTypeInt 32 0 - %3 = OpTypeStruct %1 %2 - %4 = OpTypeStruct %2 %1 - %5 = OpTypeStruct %2 %2 %1 - %6 = OpTypeStruct %2 %2 %2 %1 - %1 = OpTypePointer UniformConstant %3 -+%7 = OpTypePointer Function %3 -)"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_files/OpTypeForwardPointer_basic_dst.spvasm b/test/diff/diff_files/OpTypeForwardPointer_basic_dst.spvasm deleted file mode 100644 index 0c6e0cbe..00000000 --- a/test/diff/diff_files/OpTypeForwardPointer_basic_dst.spvasm +++ /dev/null @@ -1,15 +0,0 @@ - OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %structptr "structptr" - OpName %structptr2 "structptr2" - OpTypeForwardPointer %structptr UniformConstant - OpTypeForwardPointer %structptr2 Function - %uint = OpTypeInt 32 0 - %structt1 = OpTypeStruct %structptr %uint - %structt2 = OpTypeStruct %uint %structptr - %structt3 = OpTypeStruct %uint %uint %structptr - %structt4 = OpTypeStruct %uint %uint %uint %structptr - %structptr = OpTypePointer UniformConstant %structt1 - %structptr2 = OpTypePointer Function %structt1 diff --git a/test/diff/diff_files/OpTypeForwardPointer_basic_src.spvasm b/test/diff/diff_files/OpTypeForwardPointer_basic_src.spvasm deleted file mode 100644 index 408ec983..00000000 --- a/test/diff/diff_files/OpTypeForwardPointer_basic_src.spvasm +++ /dev/null @@ -1,13 +0,0 @@ -;; Basic test that OpTypeForwardPointer is matched - OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %structptr "structptr" - OpTypeForwardPointer %structptr UniformConstant - %uint = OpTypeInt 32 0 - %structt1 = OpTypeStruct %structptr %uint - %structt2 = OpTypeStruct %uint %structptr - %structt3 = OpTypeStruct %uint %uint %structptr - %structt4 = OpTypeStruct %uint %uint %uint %structptr - %structptr = OpTypePointer UniformConstant %structt1 diff --git a/test/diff/diff_files/OpTypeForwardPointer_intertwined_autogen.cpp b/test/diff/diff_files/OpTypeForwardPointer_intertwined_autogen.cpp deleted file mode 100644 index f2c9008e..00000000 --- a/test/diff/diff_files/OpTypeForwardPointer_intertwined_autogen.cpp +++ /dev/null @@ -1,138 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_tests.py -// -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -// Tests that two forwarded types whose declarations are intertwined match -// correctly -constexpr char kSrc[] = R"( OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %Aptr "Aptr" - OpName %Bptr "Bptr" - OpTypeForwardPointer %Aptr UniformConstant - OpTypeForwardPointer %Bptr UniformConstant - %uint = OpTypeInt 32 0 - %A = OpTypeStruct %Aptr %uint %Bptr - %B = OpTypeStruct %uint %Aptr %Bptr - %Aptr = OpTypePointer UniformConstant %A - %Bptr = OpTypePointer UniformConstant %B)"; -constexpr char kDst[] = R"( OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %Aptr "Aptr" - OpName %Bptr "Bptr" - OpTypeForwardPointer %Bptr UniformConstant - OpTypeForwardPointer %Aptr UniformConstant - %uint = OpTypeInt 32 0 - %B = OpTypeStruct %uint %Aptr %Bptr %uint - %A = OpTypeStruct %Aptr %uint %Bptr - %Aptr = OpTypePointer UniformConstant %A - %Bptr = OpTypePointer UniformConstant %B -)"; - -TEST(DiffTest, OptypeforwardpointerIntertwined) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 6 -+; Bound: 7 - ; Schema: 0 - OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %1 "Aptr" - OpName %2 "Bptr" - OpTypeForwardPointer %1 UniformConstant - OpTypeForwardPointer %2 UniformConstant - %3 = OpTypeInt 32 0 -+%6 = OpTypeStruct %3 %1 %2 %3 - %4 = OpTypeStruct %1 %3 %2 --%5 = OpTypeStruct %3 %1 %2 - %1 = OpTypePointer UniformConstant %4 --%2 = OpTypePointer UniformConstant %5 -+%2 = OpTypePointer UniformConstant %6 -)"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, OptypeforwardpointerIntertwinedNoDebug) { - constexpr char kSrcNoDebug[] = R"( OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpTypeForwardPointer %Aptr UniformConstant - OpTypeForwardPointer %Bptr UniformConstant - %uint = OpTypeInt 32 0 - %A = OpTypeStruct %Aptr %uint %Bptr - %B = OpTypeStruct %uint %Aptr %Bptr - %Aptr = OpTypePointer UniformConstant %A - %Bptr = OpTypePointer UniformConstant %B -)"; - constexpr char kDstNoDebug[] = R"( OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpTypeForwardPointer %Bptr UniformConstant - OpTypeForwardPointer %Aptr UniformConstant - %uint = OpTypeInt 32 0 - %B = OpTypeStruct %uint %Aptr %Bptr %uint - %A = OpTypeStruct %Aptr %uint %Bptr - %Aptr = OpTypePointer UniformConstant %A - %Bptr = OpTypePointer UniformConstant %B -)"; - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 6 -+; Bound: 10 - ; Schema: 0 - OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL --OpTypeForwardPointer %1 UniformConstant --OpTypeForwardPointer %2 UniformConstant -+OpTypeForwardPointer %6 UniformConstant -+OpTypeForwardPointer %7 UniformConstant - %3 = OpTypeInt 32 0 --%4 = OpTypeStruct %1 %3 %2 --%5 = OpTypeStruct %3 %1 %2 --%1 = OpTypePointer UniformConstant %4 --%2 = OpTypePointer UniformConstant %5 -+%8 = OpTypeStruct %3 %7 %6 %3 -+%9 = OpTypeStruct %7 %3 %6 -+%7 = OpTypePointer UniformConstant %9 -+%6 = OpTypePointer UniformConstant %8 -)"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_files/OpTypeForwardPointer_intertwined_dst.spvasm b/test/diff/diff_files/OpTypeForwardPointer_intertwined_dst.spvasm deleted file mode 100644 index bd735010..00000000 --- a/test/diff/diff_files/OpTypeForwardPointer_intertwined_dst.spvasm +++ /dev/null @@ -1,13 +0,0 @@ - OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %Aptr "Aptr" - OpName %Bptr "Bptr" - OpTypeForwardPointer %Bptr UniformConstant - OpTypeForwardPointer %Aptr UniformConstant - %uint = OpTypeInt 32 0 - %B = OpTypeStruct %uint %Aptr %Bptr %uint - %A = OpTypeStruct %Aptr %uint %Bptr - %Aptr = OpTypePointer UniformConstant %A - %Bptr = OpTypePointer UniformConstant %B diff --git a/test/diff/diff_files/OpTypeForwardPointer_intertwined_src.spvasm b/test/diff/diff_files/OpTypeForwardPointer_intertwined_src.spvasm deleted file mode 100644 index 8fdaf28f..00000000 --- a/test/diff/diff_files/OpTypeForwardPointer_intertwined_src.spvasm +++ /dev/null @@ -1,15 +0,0 @@ -;; Tests that two forwarded types whose declarations are intertwined match -;; correctly - OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %Aptr "Aptr" - OpName %Bptr "Bptr" - OpTypeForwardPointer %Aptr UniformConstant - OpTypeForwardPointer %Bptr UniformConstant - %uint = OpTypeInt 32 0 - %A = OpTypeStruct %Aptr %uint %Bptr - %B = OpTypeStruct %uint %Aptr %Bptr - %Aptr = OpTypePointer UniformConstant %A - %Bptr = OpTypePointer UniformConstant %B diff --git a/test/diff/diff_files/OpTypeForwardPointer_mismatching_class_autogen.cpp b/test/diff/diff_files/OpTypeForwardPointer_mismatching_class_autogen.cpp deleted file mode 100644 index 0a59be32..00000000 --- a/test/diff/diff_files/OpTypeForwardPointer_mismatching_class_autogen.cpp +++ /dev/null @@ -1,116 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_tests.py -// -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -// Tests that two forwarded type pointers with mismatching storage classes -// aren't matched -constexpr char kSrc[] = R"( OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %Aptr "Aptr" - OpTypeForwardPointer %Aptr UniformConstant - %uint = OpTypeInt 32 0 - %A = OpTypeStruct %Aptr %uint - %Aptr = OpTypePointer UniformConstant %A)"; -constexpr char kDst[] = R"( OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %Aptr "Aptr" - OpTypeForwardPointer %Aptr Function - %uint = OpTypeInt 32 0 - %A = OpTypeStruct %Aptr %uint - %Aptr = OpTypePointer Function %A -)"; - -TEST(DiffTest, OptypeforwardpointerMismatchingClass) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 4 -+; Bound: 6 - ; Schema: 0 - OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL --OpName %1 "Aptr" -+OpName %4 "Aptr" --OpTypeForwardPointer %1 UniformConstant -+OpTypeForwardPointer %4 Function - %2 = OpTypeInt 32 0 --%3 = OpTypeStruct %1 %2 --%1 = OpTypePointer UniformConstant %3 -+%5 = OpTypeStruct %4 %2 -+%4 = OpTypePointer Function %5 -)"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, OptypeforwardpointerMismatchingClassNoDebug) { - constexpr char kSrcNoDebug[] = R"( OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpTypeForwardPointer %Aptr UniformConstant - %uint = OpTypeInt 32 0 - %A = OpTypeStruct %Aptr %uint - %Aptr = OpTypePointer UniformConstant %A -)"; - constexpr char kDstNoDebug[] = R"( OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpTypeForwardPointer %Aptr Function - %uint = OpTypeInt 32 0 - %A = OpTypeStruct %Aptr %uint - %Aptr = OpTypePointer Function %A -)"; - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 4 -+; Bound: 6 - ; Schema: 0 - OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL --OpTypeForwardPointer %1 UniformConstant -+OpTypeForwardPointer %4 Function - %2 = OpTypeInt 32 0 --%3 = OpTypeStruct %1 %2 --%1 = OpTypePointer UniformConstant %3 -+%5 = OpTypeStruct %4 %2 -+%4 = OpTypePointer Function %5 -)"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_files/OpTypeForwardPointer_mismatching_class_dst.spvasm b/test/diff/diff_files/OpTypeForwardPointer_mismatching_class_dst.spvasm deleted file mode 100644 index e874a0ca..00000000 --- a/test/diff/diff_files/OpTypeForwardPointer_mismatching_class_dst.spvasm +++ /dev/null @@ -1,9 +0,0 @@ - OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %Aptr "Aptr" - OpTypeForwardPointer %Aptr Function - %uint = OpTypeInt 32 0 - %A = OpTypeStruct %Aptr %uint - %Aptr = OpTypePointer Function %A diff --git a/test/diff/diff_files/OpTypeForwardPointer_mismatching_class_src.spvasm b/test/diff/diff_files/OpTypeForwardPointer_mismatching_class_src.spvasm deleted file mode 100644 index 8a339331..00000000 --- a/test/diff/diff_files/OpTypeForwardPointer_mismatching_class_src.spvasm +++ /dev/null @@ -1,11 +0,0 @@ -;; Tests that two forwarded type pointers with mismatching storage classes -;; aren't matched - OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %Aptr "Aptr" - OpTypeForwardPointer %Aptr UniformConstant - %uint = OpTypeInt 32 0 - %A = OpTypeStruct %Aptr %uint - %Aptr = OpTypePointer UniformConstant %A diff --git a/test/diff/diff_files/OpTypeForwardPointer_mismatching_type_autogen.cpp b/test/diff/diff_files/OpTypeForwardPointer_mismatching_type_autogen.cpp deleted file mode 100644 index 0067cdf6..00000000 --- a/test/diff/diff_files/OpTypeForwardPointer_mismatching_type_autogen.cpp +++ /dev/null @@ -1,111 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_tests.py -// -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -// Tests that two forwarded type pointers with mismatching types aren't matched -constexpr char kSrc[] = R"( OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %Aptr "Aptr" - OpTypeForwardPointer %Aptr UniformConstant - %uint = OpTypeInt 32 0 - %A = OpTypeStruct %Aptr %uint - %Aptr = OpTypePointer UniformConstant %A)"; -constexpr char kDst[] = R"( OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %Aptr "Aptr" - OpTypeForwardPointer %Aptr UniformConstant - %uint = OpTypeInt 32 0 - %Aptr = OpTypePointer UniformConstant %uint -)"; - -TEST(DiffTest, OptypeforwardpointerMismatchingType) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 4 -+; Bound: 5 - ; Schema: 0 - OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL --OpName %1 "Aptr" -+OpName %4 "Aptr" --OpTypeForwardPointer %1 UniformConstant -+OpTypeForwardPointer %4 UniformConstant - %2 = OpTypeInt 32 0 --%3 = OpTypeStruct %1 %2 --%1 = OpTypePointer UniformConstant %3 -+%4 = OpTypePointer UniformConstant %2 -)"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, OptypeforwardpointerMismatchingTypeNoDebug) { - constexpr char kSrcNoDebug[] = R"( OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpTypeForwardPointer %Aptr UniformConstant - %uint = OpTypeInt 32 0 - %A = OpTypeStruct %Aptr %uint - %Aptr = OpTypePointer UniformConstant %A -)"; - constexpr char kDstNoDebug[] = R"( OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpTypeForwardPointer %Aptr UniformConstant - %uint = OpTypeInt 32 0 - %Aptr = OpTypePointer UniformConstant %uint -)"; - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 4 -+; Bound: 5 - ; Schema: 0 - OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL --OpTypeForwardPointer %1 UniformConstant -+OpTypeForwardPointer %4 UniformConstant - %2 = OpTypeInt 32 0 --%3 = OpTypeStruct %1 %2 --%1 = OpTypePointer UniformConstant %3 -+%4 = OpTypePointer UniformConstant %2 -)"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_files/OpTypeForwardPointer_mismatching_type_dst.spvasm b/test/diff/diff_files/OpTypeForwardPointer_mismatching_type_dst.spvasm deleted file mode 100644 index ee3d35c0..00000000 --- a/test/diff/diff_files/OpTypeForwardPointer_mismatching_type_dst.spvasm +++ /dev/null @@ -1,8 +0,0 @@ - OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %Aptr "Aptr" - OpTypeForwardPointer %Aptr UniformConstant - %uint = OpTypeInt 32 0 - %Aptr = OpTypePointer UniformConstant %uint diff --git a/test/diff/diff_files/OpTypeForwardPointer_mismatching_type_src.spvasm b/test/diff/diff_files/OpTypeForwardPointer_mismatching_type_src.spvasm deleted file mode 100644 index a4596a07..00000000 --- a/test/diff/diff_files/OpTypeForwardPointer_mismatching_type_src.spvasm +++ /dev/null @@ -1,10 +0,0 @@ -;; Tests that two forwarded type pointers with mismatching types aren't matched - OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %Aptr "Aptr" - OpTypeForwardPointer %Aptr UniformConstant - %uint = OpTypeInt 32 0 - %A = OpTypeStruct %Aptr %uint - %Aptr = OpTypePointer UniformConstant %A diff --git a/test/diff/diff_files/OpTypeForwardPointer_nested_autogen.cpp b/test/diff/diff_files/OpTypeForwardPointer_nested_autogen.cpp deleted file mode 100644 index d66c28ae..00000000 --- a/test/diff/diff_files/OpTypeForwardPointer_nested_autogen.cpp +++ /dev/null @@ -1,127 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_tests.py -// -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -// Tests that two forwarded declarations match even if the type pointer is used -// in a nested struct declaration, and in multiple places -constexpr char kSrc[] = R"( OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %Aptr "Aptr" - OpTypeForwardPointer %Aptr UniformConstant - %uint = OpTypeInt 32 0 - %C = OpTypeStruct %Aptr %uint %Aptr - %B = OpTypeStruct %C %Aptr %uint - %A = OpTypeStruct %B %C %B - %Aptr = OpTypePointer UniformConstant %A)"; -constexpr char kDst[] = R"( OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %Aptr "Aptr" - OpTypeForwardPointer %Aptr UniformConstant - %uint = OpTypeInt 32 0 - %C = OpTypeStruct %Aptr %uint %Aptr - %B = OpTypeStruct %C %Aptr - %A = OpTypeStruct %B %C %B - %Aptr = OpTypePointer UniformConstant %A -)"; - -TEST(DiffTest, OptypeforwardpointerNested) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 6 -+; Bound: 8 - ; Schema: 0 - OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %1 "Aptr" - OpTypeForwardPointer %1 UniformConstant - %2 = OpTypeInt 32 0 - %3 = OpTypeStruct %1 %2 %1 --%4 = OpTypeStruct %3 %1 %2 --%5 = OpTypeStruct %4 %3 %4 -+%6 = OpTypeStruct %3 %1 -+%7 = OpTypeStruct %6 %3 %6 --%1 = OpTypePointer UniformConstant %5 -+%1 = OpTypePointer UniformConstant %7 -)"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, OptypeforwardpointerNestedNoDebug) { - constexpr char kSrcNoDebug[] = R"( OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpTypeForwardPointer %Aptr UniformConstant - %uint = OpTypeInt 32 0 - %C = OpTypeStruct %Aptr %uint %Aptr - %B = OpTypeStruct %C %Aptr %uint - %A = OpTypeStruct %B %C %B - %Aptr = OpTypePointer UniformConstant %A -)"; - constexpr char kDstNoDebug[] = R"( OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpTypeForwardPointer %Aptr UniformConstant - %uint = OpTypeInt 32 0 - %C = OpTypeStruct %Aptr %uint %Aptr - %B = OpTypeStruct %C %Aptr - %A = OpTypeStruct %B %C %B - %Aptr = OpTypePointer UniformConstant %A -)"; - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 6 -+; Bound: 8 - ; Schema: 0 - OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpTypeForwardPointer %1 UniformConstant - %2 = OpTypeInt 32 0 - %3 = OpTypeStruct %1 %2 %1 --%4 = OpTypeStruct %3 %1 %2 --%5 = OpTypeStruct %4 %3 %4 -+%6 = OpTypeStruct %3 %1 -+%7 = OpTypeStruct %6 %3 %6 --%1 = OpTypePointer UniformConstant %5 -+%1 = OpTypePointer UniformConstant %7 -)"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_files/OpTypeForwardPointer_nested_dst.spvasm b/test/diff/diff_files/OpTypeForwardPointer_nested_dst.spvasm deleted file mode 100644 index e2483556..00000000 --- a/test/diff/diff_files/OpTypeForwardPointer_nested_dst.spvasm +++ /dev/null @@ -1,11 +0,0 @@ - OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %Aptr "Aptr" - OpTypeForwardPointer %Aptr UniformConstant - %uint = OpTypeInt 32 0 - %C = OpTypeStruct %Aptr %uint %Aptr - %B = OpTypeStruct %C %Aptr - %A = OpTypeStruct %B %C %B - %Aptr = OpTypePointer UniformConstant %A diff --git a/test/diff/diff_files/OpTypeForwardPointer_nested_src.spvasm b/test/diff/diff_files/OpTypeForwardPointer_nested_src.spvasm deleted file mode 100644 index 035410e0..00000000 --- a/test/diff/diff_files/OpTypeForwardPointer_nested_src.spvasm +++ /dev/null @@ -1,13 +0,0 @@ -;; Tests that two forwarded declarations match even if the type pointer is used -;; in a nested struct declaration, and in multiple places - OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %Aptr "Aptr" - OpTypeForwardPointer %Aptr UniformConstant - %uint = OpTypeInt 32 0 - %C = OpTypeStruct %Aptr %uint %Aptr - %B = OpTypeStruct %C %Aptr %uint - %A = OpTypeStruct %B %C %B - %Aptr = OpTypePointer UniformConstant %A diff --git a/test/diff/diff_files/OpTypeForwardPointer_onesided_debug_autogen.cpp b/test/diff/diff_files/OpTypeForwardPointer_onesided_debug_autogen.cpp deleted file mode 100644 index df86fef2..00000000 --- a/test/diff/diff_files/OpTypeForwardPointer_onesided_debug_autogen.cpp +++ /dev/null @@ -1,124 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_tests.py -// -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -// Test that OpTypeForwardPointer is matched when one SPIR-V doesn't have debug -// info -constexpr char kSrc[] = R"( OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %structptr "structptr" - OpTypeForwardPointer %structptr UniformConstant - %uint = OpTypeInt 32 0 - %structt1 = OpTypeStruct %structptr %uint - %structt2 = OpTypeStruct %uint %structptr - %structt3 = OpTypeStruct %uint %uint %structptr - %structt4 = OpTypeStruct %uint %uint %uint %structptr - %structptr = OpTypePointer UniformConstant %structt1)"; -constexpr char kDst[] = R"( OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpTypeForwardPointer %structptr UniformConstant - %uint = OpTypeInt 32 0 - %structt1 = OpTypeStruct %structptr %uint - %structt2 = OpTypeStruct %uint %structptr - %structt3 = OpTypeStruct %uint %uint %structptr - %structt4 = OpTypeStruct %uint %uint %uint %structptr - %structptr = OpTypePointer UniformConstant %structt1 -)"; - -TEST(DiffTest, OptypeforwardpointerOnesidedDebug) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 - ; Bound: 7 - ; Schema: 0 - OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL --OpName %1 "structptr" - OpTypeForwardPointer %1 UniformConstant - %2 = OpTypeInt 32 0 - %3 = OpTypeStruct %1 %2 - %4 = OpTypeStruct %2 %1 - %5 = OpTypeStruct %2 %2 %1 - %6 = OpTypeStruct %2 %2 %2 %1 - %1 = OpTypePointer UniformConstant %3 -)"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, OptypeforwardpointerOnesidedDebugNoDebug) { - constexpr char kSrcNoDebug[] = R"( OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpTypeForwardPointer %structptr UniformConstant - %uint = OpTypeInt 32 0 - %structt1 = OpTypeStruct %structptr %uint - %structt2 = OpTypeStruct %uint %structptr - %structt3 = OpTypeStruct %uint %uint %structptr - %structt4 = OpTypeStruct %uint %uint %uint %structptr - %structptr = OpTypePointer UniformConstant %structt1 -)"; - constexpr char kDstNoDebug[] = R"( OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpTypeForwardPointer %structptr UniformConstant - %uint = OpTypeInt 32 0 - %structt1 = OpTypeStruct %structptr %uint - %structt2 = OpTypeStruct %uint %structptr - %structt3 = OpTypeStruct %uint %uint %structptr - %structt4 = OpTypeStruct %uint %uint %uint %structptr - %structptr = OpTypePointer UniformConstant %structt1 -)"; - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 - ; Bound: 7 - ; Schema: 0 - OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpTypeForwardPointer %1 UniformConstant - %2 = OpTypeInt 32 0 - %3 = OpTypeStruct %1 %2 - %4 = OpTypeStruct %2 %1 - %5 = OpTypeStruct %2 %2 %1 - %6 = OpTypeStruct %2 %2 %2 %1 - %1 = OpTypePointer UniformConstant %3 -)"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_files/OpTypeForwardPointer_onesided_debug_dst.spvasm b/test/diff/diff_files/OpTypeForwardPointer_onesided_debug_dst.spvasm deleted file mode 100644 index 7e25710e..00000000 --- a/test/diff/diff_files/OpTypeForwardPointer_onesided_debug_dst.spvasm +++ /dev/null @@ -1,11 +0,0 @@ - OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpTypeForwardPointer %structptr UniformConstant - %uint = OpTypeInt 32 0 - %structt1 = OpTypeStruct %structptr %uint - %structt2 = OpTypeStruct %uint %structptr - %structt3 = OpTypeStruct %uint %uint %structptr - %structt4 = OpTypeStruct %uint %uint %uint %structptr - %structptr = OpTypePointer UniformConstant %structt1 diff --git a/test/diff/diff_files/OpTypeForwardPointer_onesided_debug_src.spvasm b/test/diff/diff_files/OpTypeForwardPointer_onesided_debug_src.spvasm deleted file mode 100644 index e949b272..00000000 --- a/test/diff/diff_files/OpTypeForwardPointer_onesided_debug_src.spvasm +++ /dev/null @@ -1,14 +0,0 @@ -;; Test that OpTypeForwardPointer is matched when one SPIR-V doesn't have debug -;; info - OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %structptr "structptr" - OpTypeForwardPointer %structptr UniformConstant - %uint = OpTypeInt 32 0 - %structt1 = OpTypeStruct %structptr %uint - %structt2 = OpTypeStruct %uint %structptr - %structt3 = OpTypeStruct %uint %uint %structptr - %structt4 = OpTypeStruct %uint %uint %uint %structptr - %structptr = OpTypePointer UniformConstant %structt1 diff --git a/test/diff/diff_files/README.md b/test/diff/diff_files/README.md deleted file mode 100644 index 5dcee25a..00000000 --- a/test/diff/diff_files/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# Diff tests - -This directory contains files used to ensure correctness of the `spirv-diff` implementation. The -`generate_tests.py` script takes `name_src.spvasm` and `name_dst.spvasm` (for each `name`) and -produces unit test files in the form of `name_autogen.cpp`. - -The unit test files test the diff between the src and dst inputs, as well as between debug-stripped -versions of those. Additionally, based on the `{variant}_TESTS` lists defined in -`generate_tests.py`, extra unit tests are added to exercise different options of spirv-diff. - -New tests are added simply by placing a new `name_src.spvasm` and `name_dst.spvasm` pair in this -directory and running `generate_tests.py`. Note that this script needs the path to the spirv-diff -executable that is built. - -The `generate_tests.py` script additionally expects `name_src.spvasm` to include a heading where the -purpose of the test is explained. This heading is parsed as a block of lines starting with `;;` at -the top of the file. diff --git a/test/diff/diff_files/basic_autogen.cpp b/test/diff/diff_files/basic_autogen.cpp deleted file mode 100644 index f3afc701..00000000 --- a/test/diff/diff_files/basic_autogen.cpp +++ /dev/null @@ -1,407 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_tests.py -// -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -// Basic test for spirv-diff -constexpr char kSrc[] = R"(; SPIR-V -; Version: 1.0 -; Generator: Google ANGLE Shader Compiler; 0 -; Bound: 27 -; Schema: 0 -OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %22 "main" %4 %14 %19 - OpSource GLSL 450 - OpName %4 "_ua_position" - OpName %14 "ANGLEXfbPosition" - OpName %17 "gl_PerVertex" - OpMemberName %17 0 "gl_Position" -OpMemberName %17 1 "gl_PointSize" -OpMemberName %17 2 "gl_ClipDistance" - OpMemberName %17 3 "gl_CullDistance" - OpName %19 "" - OpName %22 "main" - OpDecorate %4 Location 0 - OpDecorate %14 Location 0 - OpMemberDecorate %17 1 RelaxedPrecision - OpMemberDecorate %17 0 BuiltIn Position - OpMemberDecorate %17 1 BuiltIn PointSize -OpMemberDecorate %17 2 BuiltIn ClipDistance -OpMemberDecorate %17 3 BuiltIn CullDistance -OpDecorate %17 Block -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%5 = OpTypeInt 32 0 -%6 = OpTypeInt 32 1 -%15 = OpConstant %5 8 -%16 = OpTypeArray %1 %15 -%17 = OpTypeStruct %2 %1 %16 %16 -%20 = OpTypeVoid -%25 = OpConstant %6 0 -%3 = OpTypePointer Input %2 -%13 = OpTypePointer Output %2 -%18 = OpTypePointer Output %17 -%21 = OpTypeFunction %20 -%4 = OpVariable %3 Input -%14 = OpVariable %13 Output -%19 = OpVariable %18 Output -%22 = OpFunction %20 None %21 -%23 = OpLabel -%24 = OpLoad %2 %4 -%26 = OpAccessChain %13 %19 %25 -OpStore %26 %24 -OpReturn -OpFunctionEnd)"; -constexpr char kDst[] = R"(; SPIR-V -; Version: 1.0 -; Generator: Khronos Glslang Reference Front End; 10 -; Bound: 28 -; Schema: 0 -OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %4 "main" %13 %17 %27 -OpSource GLSL 450 -OpName %4 "main" -OpName %11 "gl_PerVertex" -OpMemberName %11 0 "gl_Position" -OpMemberName %11 1 "gl_PointSize" -OpMemberName %11 2 "gl_ClipDistance" -OpMemberName %11 3 "gl_CullDistance" -OpName %13 "" -OpName %17 "_ua_position" -OpName %27 "ANGLEXfbPosition" -OpMemberDecorate %11 0 BuiltIn Position -OpMemberDecorate %11 1 BuiltIn PointSize -OpMemberDecorate %11 2 BuiltIn ClipDistance -OpMemberDecorate %11 3 BuiltIn CullDistance -OpDecorate %11 Block -OpDecorate %17 Location 0 -OpDecorate %27 Location 0 -%2 = OpTypeVoid -%3 = OpTypeFunction %2 -%6 = OpTypeFloat 32 -%7 = OpTypeVector %6 4 -%8 = OpTypeInt 32 0 -%9 = OpConstant %8 1 -%10 = OpTypeArray %6 %9 -%11 = OpTypeStruct %7 %6 %10 %10 -%12 = OpTypePointer Output %11 -%13 = OpVariable %12 Output -%14 = OpTypeInt 32 1 -%15 = OpConstant %14 0 -%16 = OpTypePointer Input %7 -%17 = OpVariable %16 Input -%19 = OpTypePointer Output %7 -%27 = OpVariable %19 Output -%4 = OpFunction %2 None %3 -%5 = OpLabel -%18 = OpLoad %7 %17 -%20 = OpAccessChain %19 %13 %15 -OpStore %20 %18 -OpReturn -OpFunctionEnd -)"; - -TEST(DiffTest, Basic) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 27 -+; Bound: 36 - ; Schema: 0 - OpCapability Shader -+%27 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 --OpEntryPoint Vertex %22 "main" %4 %14 %19 -+OpEntryPoint Vertex %22 "main" %19 %4 %14 - OpSource GLSL 450 - OpName %4 "_ua_position" - OpName %14 "ANGLEXfbPosition" - OpName %17 "gl_PerVertex" - OpMemberName %17 0 "gl_Position" - OpMemberName %17 1 "gl_PointSize" - OpMemberName %17 2 "gl_ClipDistance" - OpMemberName %17 3 "gl_CullDistance" - OpName %19 "" - OpName %22 "main" - OpDecorate %4 Location 0 - OpDecorate %14 Location 0 --OpMemberDecorate %17 1 RelaxedPrecision - OpMemberDecorate %17 0 BuiltIn Position - OpMemberDecorate %17 1 BuiltIn PointSize - OpMemberDecorate %17 2 BuiltIn ClipDistance - OpMemberDecorate %17 3 BuiltIn CullDistance - OpDecorate %17 Block - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 - %5 = OpTypeInt 32 0 - %6 = OpTypeInt 32 1 --%15 = OpConstant %5 8 --%16 = OpTypeArray %1 %15 --%17 = OpTypeStruct %2 %1 %16 %16 -+%17 = OpTypeStruct %2 %1 %29 %29 -+%28 = OpConstant %5 1 -+%29 = OpTypeArray %1 %28 - %20 = OpTypeVoid - %25 = OpConstant %6 0 - %3 = OpTypePointer Input %2 - %13 = OpTypePointer Output %2 - %18 = OpTypePointer Output %17 - %21 = OpTypeFunction %20 - %4 = OpVariable %3 Input - %14 = OpVariable %13 Output - %19 = OpVariable %18 Output - %22 = OpFunction %20 None %21 - %23 = OpLabel - %24 = OpLoad %2 %4 - %26 = OpAccessChain %13 %19 %25 - OpStore %26 %24 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, BasicNoDebug) { - constexpr char kSrcNoDebug[] = R"(; SPIR-V -; Version: 1.0 -; Generator: Google ANGLE Shader Compiler; 0 -; Bound: 27 -; Schema: 0 -OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %22 "main" %4 %14 %19 - OpSource GLSL 450 - OpDecorate %4 Location 0 - OpDecorate %14 Location 0 - OpMemberDecorate %17 1 RelaxedPrecision - OpMemberDecorate %17 0 BuiltIn Position - OpMemberDecorate %17 1 BuiltIn PointSize -OpMemberDecorate %17 2 BuiltIn ClipDistance -OpMemberDecorate %17 3 BuiltIn CullDistance -OpDecorate %17 Block -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%5 = OpTypeInt 32 0 -%6 = OpTypeInt 32 1 -%15 = OpConstant %5 8 -%16 = OpTypeArray %1 %15 -%17 = OpTypeStruct %2 %1 %16 %16 -%20 = OpTypeVoid -%25 = OpConstant %6 0 -%3 = OpTypePointer Input %2 -%13 = OpTypePointer Output %2 -%18 = OpTypePointer Output %17 -%21 = OpTypeFunction %20 -%4 = OpVariable %3 Input -%14 = OpVariable %13 Output -%19 = OpVariable %18 Output -%22 = OpFunction %20 None %21 -%23 = OpLabel -%24 = OpLoad %2 %4 -%26 = OpAccessChain %13 %19 %25 -OpStore %26 %24 -OpReturn -OpFunctionEnd -)"; - constexpr char kDstNoDebug[] = R"(; SPIR-V -; Version: 1.0 -; Generator: Khronos Glslang Reference Front End; 10 -; Bound: 28 -; Schema: 0 -OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %4 "main" %13 %17 %27 -OpSource GLSL 450 -OpMemberDecorate %11 0 BuiltIn Position -OpMemberDecorate %11 1 BuiltIn PointSize -OpMemberDecorate %11 2 BuiltIn ClipDistance -OpMemberDecorate %11 3 BuiltIn CullDistance -OpDecorate %11 Block -OpDecorate %17 Location 0 -OpDecorate %27 Location 0 -%2 = OpTypeVoid -%3 = OpTypeFunction %2 -%6 = OpTypeFloat 32 -%7 = OpTypeVector %6 4 -%8 = OpTypeInt 32 0 -%9 = OpConstant %8 1 -%10 = OpTypeArray %6 %9 -%11 = OpTypeStruct %7 %6 %10 %10 -%12 = OpTypePointer Output %11 -%13 = OpVariable %12 Output -%14 = OpTypeInt 32 1 -%15 = OpConstant %14 0 -%16 = OpTypePointer Input %7 -%17 = OpVariable %16 Input -%19 = OpTypePointer Output %7 -%27 = OpVariable %19 Output -%4 = OpFunction %2 None %3 -%5 = OpLabel -%18 = OpLoad %7 %17 -%20 = OpAccessChain %19 %13 %15 -OpStore %20 %18 -OpReturn -OpFunctionEnd -)"; - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 27 -+; Bound: 36 - ; Schema: 0 - OpCapability Shader -+%27 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 --OpEntryPoint Vertex %22 "main" %4 %14 %19 -+OpEntryPoint Vertex %22 "main" %19 %4 %14 - OpSource GLSL 450 - OpDecorate %4 Location 0 - OpDecorate %14 Location 0 --OpMemberDecorate %17 1 RelaxedPrecision - OpMemberDecorate %17 0 BuiltIn Position - OpMemberDecorate %17 1 BuiltIn PointSize - OpMemberDecorate %17 2 BuiltIn ClipDistance - OpMemberDecorate %17 3 BuiltIn CullDistance - OpDecorate %17 Block - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 - %5 = OpTypeInt 32 0 - %6 = OpTypeInt 32 1 --%15 = OpConstant %5 8 --%16 = OpTypeArray %1 %15 --%17 = OpTypeStruct %2 %1 %16 %16 -+%17 = OpTypeStruct %2 %1 %29 %29 -+%28 = OpConstant %5 1 -+%29 = OpTypeArray %1 %28 - %20 = OpTypeVoid - %25 = OpConstant %6 0 - %3 = OpTypePointer Input %2 - %13 = OpTypePointer Output %2 - %18 = OpTypePointer Output %17 - %21 = OpTypeFunction %20 - %4 = OpVariable %3 Input - %14 = OpVariable %13 Output - %19 = OpVariable %18 Output - %22 = OpFunction %20 None %21 - %23 = OpLabel - %24 = OpLoad %2 %4 - %26 = OpAccessChain %13 %19 %25 - OpStore %26 %24 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -} - -TEST(DiffTest, BasicDumpIds) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 27 -+; Bound: 36 - ; Schema: 0 - OpCapability Shader -+%27 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 --OpEntryPoint Vertex %22 "main" %4 %14 %19 -+OpEntryPoint Vertex %22 "main" %19 %4 %14 - OpSource GLSL 450 - OpName %4 "_ua_position" - OpName %14 "ANGLEXfbPosition" - OpName %17 "gl_PerVertex" - OpMemberName %17 0 "gl_Position" - OpMemberName %17 1 "gl_PointSize" - OpMemberName %17 2 "gl_ClipDistance" - OpMemberName %17 3 "gl_CullDistance" - OpName %19 "" - OpName %22 "main" - OpDecorate %4 Location 0 - OpDecorate %14 Location 0 --OpMemberDecorate %17 1 RelaxedPrecision - OpMemberDecorate %17 0 BuiltIn Position - OpMemberDecorate %17 1 BuiltIn PointSize - OpMemberDecorate %17 2 BuiltIn ClipDistance - OpMemberDecorate %17 3 BuiltIn CullDistance - OpDecorate %17 Block - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 - %5 = OpTypeInt 32 0 - %6 = OpTypeInt 32 1 --%15 = OpConstant %5 8 --%16 = OpTypeArray %1 %15 --%17 = OpTypeStruct %2 %1 %16 %16 -+%17 = OpTypeStruct %2 %1 %29 %29 -+%28 = OpConstant %5 1 -+%29 = OpTypeArray %1 %28 - %20 = OpTypeVoid - %25 = OpConstant %6 0 - %3 = OpTypePointer Input %2 - %13 = OpTypePointer Output %2 - %18 = OpTypePointer Output %17 - %21 = OpTypeFunction %20 - %4 = OpVariable %3 Input - %14 = OpVariable %13 Output - %19 = OpVariable %18 Output - %22 = OpFunction %20 None %21 - %23 = OpLabel - %24 = OpLoad %2 %4 - %26 = OpAccessChain %13 %19 %25 - OpStore %26 %24 - OpReturn - OpFunctionEnd - Src -> Dst - 1 -> 6 [TypeFloat] - 2 -> 7 [TypeVector] - 3 -> 16 [TypePointer] - 4 -> 17 [Variable] - 5 -> 8 [TypeInt] - 6 -> 14 [TypeInt] - 13 -> 19 [TypePointer] - 14 -> 27 [Variable] - 15 -> 34 [Constant] - 16 -> 35 [TypeArray] - 17 -> 11 [TypeStruct] - 18 -> 12 [TypePointer] - 19 -> 13 [Variable] - 20 -> 2 [TypeVoid] - 21 -> 3 [TypeFunction] - 22 -> 4 [Function] - 23 -> 5 [Label] - 24 -> 18 [Load] - 25 -> 15 [Constant] - 26 -> 20 [AccessChain] -)"; - Options options; - options.dump_id_map = true; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_files/basic_dst.spvasm b/test/diff/diff_files/basic_dst.spvasm deleted file mode 100644 index 79cb8887..00000000 --- a/test/diff/diff_files/basic_dst.spvasm +++ /dev/null @@ -1,49 +0,0 @@ -; SPIR-V -; Version: 1.0 -; Generator: Khronos Glslang Reference Front End; 10 -; Bound: 28 -; Schema: 0 -OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %4 "main" %13 %17 %27 -OpSource GLSL 450 -OpName %4 "main" -OpName %11 "gl_PerVertex" -OpMemberName %11 0 "gl_Position" -OpMemberName %11 1 "gl_PointSize" -OpMemberName %11 2 "gl_ClipDistance" -OpMemberName %11 3 "gl_CullDistance" -OpName %13 "" -OpName %17 "_ua_position" -OpName %27 "ANGLEXfbPosition" -OpMemberDecorate %11 0 BuiltIn Position -OpMemberDecorate %11 1 BuiltIn PointSize -OpMemberDecorate %11 2 BuiltIn ClipDistance -OpMemberDecorate %11 3 BuiltIn CullDistance -OpDecorate %11 Block -OpDecorate %17 Location 0 -OpDecorate %27 Location 0 -%2 = OpTypeVoid -%3 = OpTypeFunction %2 -%6 = OpTypeFloat 32 -%7 = OpTypeVector %6 4 -%8 = OpTypeInt 32 0 -%9 = OpConstant %8 1 -%10 = OpTypeArray %6 %9 -%11 = OpTypeStruct %7 %6 %10 %10 -%12 = OpTypePointer Output %11 -%13 = OpVariable %12 Output -%14 = OpTypeInt 32 1 -%15 = OpConstant %14 0 -%16 = OpTypePointer Input %7 -%17 = OpVariable %16 Input -%19 = OpTypePointer Output %7 -%27 = OpVariable %19 Output -%4 = OpFunction %2 None %3 -%5 = OpLabel -%18 = OpLoad %7 %17 -%20 = OpAccessChain %19 %13 %15 -OpStore %20 %18 -OpReturn -OpFunctionEnd diff --git a/test/diff/diff_files/basic_src.spvasm b/test/diff/diff_files/basic_src.spvasm deleted file mode 100644 index c55ec7af..00000000 --- a/test/diff/diff_files/basic_src.spvasm +++ /dev/null @@ -1,50 +0,0 @@ -;; Basic test for spirv-diff -; SPIR-V -; Version: 1.0 -; Generator: Google ANGLE Shader Compiler; 0 -; Bound: 27 -; Schema: 0 -OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %22 "main" %4 %14 %19 - OpSource GLSL 450 - OpName %4 "_ua_position" - OpName %14 "ANGLEXfbPosition" - OpName %17 "gl_PerVertex" - OpMemberName %17 0 "gl_Position" -OpMemberName %17 1 "gl_PointSize" -OpMemberName %17 2 "gl_ClipDistance" - OpMemberName %17 3 "gl_CullDistance" - OpName %19 "" - OpName %22 "main" - OpDecorate %4 Location 0 - OpDecorate %14 Location 0 - OpMemberDecorate %17 1 RelaxedPrecision - OpMemberDecorate %17 0 BuiltIn Position - OpMemberDecorate %17 1 BuiltIn PointSize -OpMemberDecorate %17 2 BuiltIn ClipDistance -OpMemberDecorate %17 3 BuiltIn CullDistance -OpDecorate %17 Block -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%5 = OpTypeInt 32 0 -%6 = OpTypeInt 32 1 -%15 = OpConstant %5 8 -%16 = OpTypeArray %1 %15 -%17 = OpTypeStruct %2 %1 %16 %16 -%20 = OpTypeVoid -%25 = OpConstant %6 0 -%3 = OpTypePointer Input %2 -%13 = OpTypePointer Output %2 -%18 = OpTypePointer Output %17 -%21 = OpTypeFunction %20 -%4 = OpVariable %3 Input -%14 = OpVariable %13 Output -%19 = OpVariable %18 Output -%22 = OpFunction %20 None %21 -%23 = OpLabel -%24 = OpLoad %2 %4 -%26 = OpAccessChain %13 %19 %25 -OpStore %26 %24 -OpReturn -OpFunctionEnd diff --git a/test/diff/diff_files/constant_array_size_autogen.cpp b/test/diff/diff_files/constant_array_size_autogen.cpp deleted file mode 100644 index 16975ff4..00000000 --- a/test/diff/diff_files/constant_array_size_autogen.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_tests.py -// -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -// Tests that identical integer constants are matched when used as array size, -// regardless of int or uint. -constexpr char kSrc[] = R"(; SPIR-V -; Version: 1.0 -; Generator: Google ANGLE Shader Compiler; 0 -; Bound: 27 -; Schema: 0 -OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %22 "main" %4 %19 -OpSource GLSL 450 -OpName %4 "_ua_position" -OpName %17 "gl_PerVertex" -OpMemberName %17 0 "gl_Position" -OpMemberName %17 1 "gl_PointSize" -OpMemberName %17 2 "gl_ClipDistance" -OpMemberName %17 3 "gl_CullDistance" -OpName %19 "" -OpName %22 "main" -OpDecorate %4 Location 0 -OpMemberDecorate %17 1 RelaxedPrecision -OpMemberDecorate %17 0 BuiltIn Position -OpMemberDecorate %17 1 BuiltIn PointSize -OpMemberDecorate %17 2 BuiltIn ClipDistance -OpMemberDecorate %17 3 BuiltIn CullDistance -OpDecorate %17 Block -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%5 = OpTypeInt 32 0 -%8 = OpTypeVector %5 4 -%15 = OpConstant %5 8 -%16 = OpTypeArray %1 %15 -%17 = OpTypeStruct %2 %1 %16 %16 -%20 = OpTypeVoid -%25 = OpConstant %5 0 -%3 = OpTypePointer Input %2 -%13 = OpTypePointer Output %2 -%18 = OpTypePointer Output %17 -%21 = OpTypeFunction %20 -%4 = OpVariable %3 Input -%19 = OpVariable %18 Output -%22 = OpFunction %20 None %21 -%23 = OpLabel -%24 = OpLoad %2 %4 -%26 = OpAccessChain %13 %19 %25 -OpStore %26 %24 -OpReturn -OpFunctionEnd)"; -constexpr char kDst[] = R"(; SPIR-V -; Version: 1.0 -; Generator: Google ANGLE Shader Compiler; 0 -; Bound: 27 -; Schema: 0 -OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %22 "main" %4 %19 -OpSource GLSL 450 -OpName %4 "_ua_position" -OpName %17 "gl_PerVertex" -OpMemberName %17 0 "gl_Position" -OpMemberName %17 1 "gl_PointSize" -OpMemberName %17 2 "gl_ClipDistance" -OpMemberName %17 3 "gl_CullDistance" -OpName %19 "" -OpName %22 "main" -OpDecorate %4 Location 0 -OpMemberDecorate %17 1 RelaxedPrecision -OpMemberDecorate %17 0 BuiltIn Position -OpMemberDecorate %17 1 BuiltIn PointSize -OpMemberDecorate %17 2 BuiltIn ClipDistance -OpMemberDecorate %17 3 BuiltIn CullDistance -OpDecorate %17 Block -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%5 = OpTypeInt 32 0 -%6 = OpTypeInt 32 1 -%8 = OpTypeVector %5 4 -%15 = OpConstant %6 8 -%16 = OpTypeArray %1 %15 -%17 = OpTypeStruct %2 %1 %16 %16 -%20 = OpTypeVoid -%25 = OpConstant %5 0 -%3 = OpTypePointer Input %2 -%13 = OpTypePointer Output %2 -%18 = OpTypePointer Output %17 -%21 = OpTypeFunction %20 -%4 = OpVariable %3 Input -%19 = OpVariable %18 Output -%22 = OpFunction %20 None %21 -%23 = OpLabel -%24 = OpLoad %2 %4 -%26 = OpAccessChain %13 %19 %25 -OpStore %26 %24 -OpReturn -OpFunctionEnd -)"; - -TEST(DiffTest, ConstantArraySize) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 27 -+; Bound: 34 - ; Schema: 0 - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %22 "main" %4 %19 - OpSource GLSL 450 - OpName %4 "_ua_position" - OpName %17 "gl_PerVertex" - OpMemberName %17 0 "gl_Position" - OpMemberName %17 1 "gl_PointSize" - OpMemberName %17 2 "gl_ClipDistance" - OpMemberName %17 3 "gl_CullDistance" - OpName %19 "" - OpName %22 "main" - OpDecorate %4 Location 0 - OpMemberDecorate %17 1 RelaxedPrecision - OpMemberDecorate %17 0 BuiltIn Position - OpMemberDecorate %17 1 BuiltIn PointSize - OpMemberDecorate %17 2 BuiltIn ClipDistance - OpMemberDecorate %17 3 BuiltIn CullDistance - OpDecorate %17 Block - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 - %5 = OpTypeInt 32 0 -+%27 = OpTypeInt 32 1 - %8 = OpTypeVector %5 4 --%15 = OpConstant %5 8 -+%15 = OpConstant %27 8 - %16 = OpTypeArray %1 %15 - %17 = OpTypeStruct %2 %1 %16 %16 - %20 = OpTypeVoid - %25 = OpConstant %5 0 - %3 = OpTypePointer Input %2 - %13 = OpTypePointer Output %2 - %18 = OpTypePointer Output %17 - %21 = OpTypeFunction %20 - %4 = OpVariable %3 Input - %19 = OpVariable %18 Output - %22 = OpFunction %20 None %21 - %23 = OpLabel - %24 = OpLoad %2 %4 - %26 = OpAccessChain %13 %19 %25 - OpStore %26 %24 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, ConstantArraySizeNoDebug) { - constexpr char kSrcNoDebug[] = R"(; SPIR-V -; Version: 1.0 -; Generator: Google ANGLE Shader Compiler; 0 -; Bound: 27 -; Schema: 0 -OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %22 "main" %4 %19 -OpSource GLSL 450 -OpDecorate %4 Location 0 -OpMemberDecorate %17 1 RelaxedPrecision -OpMemberDecorate %17 0 BuiltIn Position -OpMemberDecorate %17 1 BuiltIn PointSize -OpMemberDecorate %17 2 BuiltIn ClipDistance -OpMemberDecorate %17 3 BuiltIn CullDistance -OpDecorate %17 Block -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%5 = OpTypeInt 32 0 -%8 = OpTypeVector %5 4 -%15 = OpConstant %5 8 -%16 = OpTypeArray %1 %15 -%17 = OpTypeStruct %2 %1 %16 %16 -%20 = OpTypeVoid -%25 = OpConstant %5 0 -%3 = OpTypePointer Input %2 -%13 = OpTypePointer Output %2 -%18 = OpTypePointer Output %17 -%21 = OpTypeFunction %20 -%4 = OpVariable %3 Input -%19 = OpVariable %18 Output -%22 = OpFunction %20 None %21 -%23 = OpLabel -%24 = OpLoad %2 %4 -%26 = OpAccessChain %13 %19 %25 -OpStore %26 %24 -OpReturn -OpFunctionEnd -)"; - constexpr char kDstNoDebug[] = R"(; SPIR-V -; Version: 1.0 -; Generator: Google ANGLE Shader Compiler; 0 -; Bound: 27 -; Schema: 0 -OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %22 "main" %4 %19 -OpSource GLSL 450 -OpDecorate %4 Location 0 -OpMemberDecorate %17 1 RelaxedPrecision -OpMemberDecorate %17 0 BuiltIn Position -OpMemberDecorate %17 1 BuiltIn PointSize -OpMemberDecorate %17 2 BuiltIn ClipDistance -OpMemberDecorate %17 3 BuiltIn CullDistance -OpDecorate %17 Block -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%5 = OpTypeInt 32 0 -%6 = OpTypeInt 32 1 -%8 = OpTypeVector %5 4 -%15 = OpConstant %6 8 -%16 = OpTypeArray %1 %15 -%17 = OpTypeStruct %2 %1 %16 %16 -%20 = OpTypeVoid -%25 = OpConstant %5 0 -%3 = OpTypePointer Input %2 -%13 = OpTypePointer Output %2 -%18 = OpTypePointer Output %17 -%21 = OpTypeFunction %20 -%4 = OpVariable %3 Input -%19 = OpVariable %18 Output -%22 = OpFunction %20 None %21 -%23 = OpLabel -%24 = OpLoad %2 %4 -%26 = OpAccessChain %13 %19 %25 -OpStore %26 %24 -OpReturn -OpFunctionEnd -)"; - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 27 -+; Bound: 34 - ; Schema: 0 - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %22 "main" %4 %19 - OpSource GLSL 450 - OpDecorate %4 Location 0 - OpMemberDecorate %17 1 RelaxedPrecision - OpMemberDecorate %17 0 BuiltIn Position - OpMemberDecorate %17 1 BuiltIn PointSize - OpMemberDecorate %17 2 BuiltIn ClipDistance - OpMemberDecorate %17 3 BuiltIn CullDistance - OpDecorate %17 Block - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 - %5 = OpTypeInt 32 0 -+%27 = OpTypeInt 32 1 - %8 = OpTypeVector %5 4 --%15 = OpConstant %5 8 -+%15 = OpConstant %27 8 - %16 = OpTypeArray %1 %15 - %17 = OpTypeStruct %2 %1 %16 %16 - %20 = OpTypeVoid - %25 = OpConstant %5 0 - %3 = OpTypePointer Input %2 - %13 = OpTypePointer Output %2 - %18 = OpTypePointer Output %17 - %21 = OpTypeFunction %20 - %4 = OpVariable %3 Input - %19 = OpVariable %18 Output - %22 = OpFunction %20 None %21 - %23 = OpLabel - %24 = OpLoad %2 %4 - %26 = OpAccessChain %13 %19 %25 - OpStore %26 %24 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_files/constant_array_size_dst.spvasm b/test/diff/diff_files/constant_array_size_dst.spvasm deleted file mode 100644 index a432b612..00000000 --- a/test/diff/diff_files/constant_array_size_dst.spvasm +++ /dev/null @@ -1,47 +0,0 @@ -; SPIR-V -; Version: 1.0 -; Generator: Google ANGLE Shader Compiler; 0 -; Bound: 27 -; Schema: 0 -OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %22 "main" %4 %19 -OpSource GLSL 450 -OpName %4 "_ua_position" -OpName %17 "gl_PerVertex" -OpMemberName %17 0 "gl_Position" -OpMemberName %17 1 "gl_PointSize" -OpMemberName %17 2 "gl_ClipDistance" -OpMemberName %17 3 "gl_CullDistance" -OpName %19 "" -OpName %22 "main" -OpDecorate %4 Location 0 -OpMemberDecorate %17 1 RelaxedPrecision -OpMemberDecorate %17 0 BuiltIn Position -OpMemberDecorate %17 1 BuiltIn PointSize -OpMemberDecorate %17 2 BuiltIn ClipDistance -OpMemberDecorate %17 3 BuiltIn CullDistance -OpDecorate %17 Block -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%5 = OpTypeInt 32 0 -%6 = OpTypeInt 32 1 -%8 = OpTypeVector %5 4 -%15 = OpConstant %6 8 -%16 = OpTypeArray %1 %15 -%17 = OpTypeStruct %2 %1 %16 %16 -%20 = OpTypeVoid -%25 = OpConstant %5 0 -%3 = OpTypePointer Input %2 -%13 = OpTypePointer Output %2 -%18 = OpTypePointer Output %17 -%21 = OpTypeFunction %20 -%4 = OpVariable %3 Input -%19 = OpVariable %18 Output -%22 = OpFunction %20 None %21 -%23 = OpLabel -%24 = OpLoad %2 %4 -%26 = OpAccessChain %13 %19 %25 -OpStore %26 %24 -OpReturn -OpFunctionEnd diff --git a/test/diff/diff_files/constant_array_size_src.spvasm b/test/diff/diff_files/constant_array_size_src.spvasm deleted file mode 100644 index 4e1ba646..00000000 --- a/test/diff/diff_files/constant_array_size_src.spvasm +++ /dev/null @@ -1,48 +0,0 @@ -;; Tests that identical integer constants are matched when used as array size, -;; regardless of int or uint. -; SPIR-V -; Version: 1.0 -; Generator: Google ANGLE Shader Compiler; 0 -; Bound: 27 -; Schema: 0 -OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %22 "main" %4 %19 -OpSource GLSL 450 -OpName %4 "_ua_position" -OpName %17 "gl_PerVertex" -OpMemberName %17 0 "gl_Position" -OpMemberName %17 1 "gl_PointSize" -OpMemberName %17 2 "gl_ClipDistance" -OpMemberName %17 3 "gl_CullDistance" -OpName %19 "" -OpName %22 "main" -OpDecorate %4 Location 0 -OpMemberDecorate %17 1 RelaxedPrecision -OpMemberDecorate %17 0 BuiltIn Position -OpMemberDecorate %17 1 BuiltIn PointSize -OpMemberDecorate %17 2 BuiltIn ClipDistance -OpMemberDecorate %17 3 BuiltIn CullDistance -OpDecorate %17 Block -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%5 = OpTypeInt 32 0 -%8 = OpTypeVector %5 4 -%15 = OpConstant %5 8 -%16 = OpTypeArray %1 %15 -%17 = OpTypeStruct %2 %1 %16 %16 -%20 = OpTypeVoid -%25 = OpConstant %5 0 -%3 = OpTypePointer Input %2 -%13 = OpTypePointer Output %2 -%18 = OpTypePointer Output %17 -%21 = OpTypeFunction %20 -%4 = OpVariable %3 Input -%19 = OpVariable %18 Output -%22 = OpFunction %20 None %21 -%23 = OpLabel -%24 = OpLoad %2 %4 -%26 = OpAccessChain %13 %19 %25 -OpStore %26 %24 -OpReturn -OpFunctionEnd diff --git a/test/diff/diff_files/diff_test_files_autogen.cmake b/test/diff/diff_files/diff_test_files_autogen.cmake deleted file mode 100644 index e6d36452..00000000 --- a/test/diff/diff_files/diff_test_files_autogen.cmake +++ /dev/null @@ -1,45 +0,0 @@ -# GENERATED FILE - DO NOT EDIT. -# Generated by generate_tests.py -# -# Copyright (c) 2022 Google LLC. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -list(APPEND DIFF_TEST_FILES -"diff_files/OpExtInst_in_dst_only_autogen.cpp" -"diff_files/OpExtInst_in_src_only_autogen.cpp" -"diff_files/OpTypeForwardPointer_basic_autogen.cpp" -"diff_files/OpTypeForwardPointer_intertwined_autogen.cpp" -"diff_files/OpTypeForwardPointer_mismatching_class_autogen.cpp" -"diff_files/OpTypeForwardPointer_mismatching_type_autogen.cpp" -"diff_files/OpTypeForwardPointer_nested_autogen.cpp" -"diff_files/OpTypeForwardPointer_onesided_debug_autogen.cpp" -"diff_files/basic_autogen.cpp" -"diff_files/constant_array_size_autogen.cpp" -"diff_files/different_decorations_fragment_autogen.cpp" -"diff_files/different_decorations_vertex_autogen.cpp" -"diff_files/different_function_parameter_count_autogen.cpp" -"diff_files/extra_if_block_autogen.cpp" -"diff_files/index_signedness_autogen.cpp" -"diff_files/int_vs_uint_constants_autogen.cpp" -"diff_files/large_functions_large_diffs_autogen.cpp" -"diff_files/large_functions_small_diffs_autogen.cpp" -"diff_files/multiple_different_entry_points_autogen.cpp" -"diff_files/multiple_same_entry_points_autogen.cpp" -"diff_files/reordered_if_blocks_autogen.cpp" -"diff_files/reordered_switch_blocks_autogen.cpp" -"diff_files/small_functions_small_diffs_autogen.cpp" -"diff_files/spec_constant_array_size_autogen.cpp" -"diff_files/spec_constant_composite_autogen.cpp" -"diff_files/unrelated_shaders_autogen.cpp" -) diff --git a/test/diff/diff_files/different_decorations_fragment_autogen.cpp b/test/diff/diff_files/different_decorations_fragment_autogen.cpp deleted file mode 100644 index 0d34654f..00000000 --- a/test/diff/diff_files/different_decorations_fragment_autogen.cpp +++ /dev/null @@ -1,1626 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_tests.py -// -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -// Test where variable set/binding/location decorations are different between -// src and dst fragment shaders. -constexpr char kSrc[] = R"(OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %63 "main" %4 %22 -OpExecutionMode %63 OriginUpperLeft -OpSource GLSL 450 -OpName %4 "_ue" -OpName %8 "_uf" -OpName %11 "_ug" -OpName %12 "_uA" -OpMemberName %12 0 "_ux" -OpName %14 "_uc" -OpName %15 "_uB" -OpMemberName %15 0 "_ux" -OpName %20 "_ud" -OpName %22 "_ucol" -OpName %26 "ANGLEDepthRangeParams" -OpMemberName %26 0 "near" -OpMemberName %26 1 "far" -OpMemberName %26 2 "diff" -OpMemberName %26 3 "reserved" -OpName %27 "ANGLEUniformBlock" -OpMemberName %27 0 "viewport" -OpMemberName %27 1 "clipDistancesEnabled" -OpMemberName %27 2 "xfbActiveUnpaused" -OpMemberName %27 3 "xfbVerticesPerInstance" -OpMemberName %27 4 "numSamples" -OpMemberName %27 5 "xfbBufferOffsets" -OpMemberName %27 6 "acbBufferOffsets" -OpMemberName %27 7 "depthRange" -OpName %29 "ANGLEUniforms" -OpName %33 "_uc" -OpName %32 "_uh" -OpName %49 "_ux" -OpName %50 "_uy" -OpName %48 "_ui" -OpName %63 "main" -OpName %65 "param" -OpName %68 "param" -OpName %73 "param" -OpDecorate %4 Location 0 -OpDecorate %8 RelaxedPrecision -OpDecorate %8 DescriptorSet 0 -OpDecorate %8 Binding 0 -OpDecorate %11 DescriptorSet 0 -OpDecorate %11 Binding 1 -OpMemberDecorate %12 0 Offset 0 -OpMemberDecorate %12 0 RelaxedPrecision -OpDecorate %12 Block -OpDecorate %14 DescriptorSet 0 -OpDecorate %14 Binding 2 -OpMemberDecorate %15 0 Offset 0 -OpMemberDecorate %15 0 RelaxedPrecision -OpDecorate %15 BufferBlock -OpDecorate %20 DescriptorSet 0 -OpDecorate %20 Binding 3 -OpDecorate %22 RelaxedPrecision -OpDecorate %22 Location 0 -OpMemberDecorate %26 0 Offset 0 -OpMemberDecorate %26 1 Offset 4 -OpMemberDecorate %26 2 Offset 8 -OpMemberDecorate %26 3 Offset 12 -OpMemberDecorate %27 0 Offset 0 -OpMemberDecorate %27 1 Offset 16 -OpMemberDecorate %27 2 Offset 20 -OpMemberDecorate %27 3 Offset 24 -OpMemberDecorate %27 4 Offset 28 -OpMemberDecorate %27 5 Offset 32 -OpMemberDecorate %27 6 Offset 48 -OpMemberDecorate %27 7 Offset 64 -OpMemberDecorate %27 2 RelaxedPrecision -OpMemberDecorate %27 4 RelaxedPrecision -OpDecorate %27 Block -OpDecorate %29 DescriptorSet 0 -OpDecorate %29 Binding 4 -OpDecorate %32 RelaxedPrecision -OpDecorate %33 RelaxedPrecision -OpDecorate %36 RelaxedPrecision -OpDecorate %37 RelaxedPrecision -OpDecorate %38 RelaxedPrecision -OpDecorate %39 RelaxedPrecision -OpDecorate %41 RelaxedPrecision -OpDecorate %42 RelaxedPrecision -OpDecorate %43 RelaxedPrecision -OpDecorate %48 RelaxedPrecision -OpDecorate %49 RelaxedPrecision -OpDecorate %50 RelaxedPrecision -OpDecorate %52 RelaxedPrecision -OpDecorate %53 RelaxedPrecision -OpDecorate %54 RelaxedPrecision -OpDecorate %55 RelaxedPrecision -OpDecorate %56 RelaxedPrecision -OpDecorate %57 RelaxedPrecision -OpDecorate %58 RelaxedPrecision -OpDecorate %59 RelaxedPrecision -OpDecorate %60 RelaxedPrecision -OpDecorate %67 RelaxedPrecision -OpDecorate %68 RelaxedPrecision -OpDecorate %72 RelaxedPrecision -OpDecorate %73 RelaxedPrecision -OpDecorate %75 RelaxedPrecision -OpDecorate %76 RelaxedPrecision -OpDecorate %77 RelaxedPrecision -OpDecorate %80 RelaxedPrecision -OpDecorate %81 RelaxedPrecision -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%5 = OpTypeImage %1 2D 0 0 0 1 Unknown -%6 = OpTypeSampledImage %5 -%9 = OpTypeImage %1 2D 0 0 0 2 Rgba8 -%12 = OpTypeStruct %2 -%15 = OpTypeStruct %2 -%16 = OpTypeInt 32 0 -%17 = OpConstant %16 2 -%18 = OpTypeArray %15 %17 -%23 = OpTypeInt 32 1 -%24 = OpTypeVector %23 4 -%25 = OpTypeVector %16 4 -%26 = OpTypeStruct %1 %1 %1 %1 -%27 = OpTypeStruct %2 %16 %16 %23 %23 %24 %25 %26 -%35 = OpTypeVector %1 2 -%40 = OpTypeVector %23 2 -%61 = OpTypeVoid -%69 = OpConstant %16 0 -%78 = OpConstant %16 1 -%3 = OpTypePointer Input %2 -%7 = OpTypePointer UniformConstant %6 -%10 = OpTypePointer UniformConstant %9 -%13 = OpTypePointer Uniform %12 -%19 = OpTypePointer Uniform %18 -%21 = OpTypePointer Output %2 -%28 = OpTypePointer Uniform %27 -%30 = OpTypePointer Function %2 -%70 = OpTypePointer Uniform %2 -%31 = OpTypeFunction %2 %30 -%47 = OpTypeFunction %2 %30 %30 -%62 = OpTypeFunction %61 -%4 = OpVariable %3 Input -%8 = OpVariable %7 UniformConstant -%11 = OpVariable %10 UniformConstant -%14 = OpVariable %13 Uniform -%20 = OpVariable %19 Uniform -%22 = OpVariable %21 Output -%29 = OpVariable %28 Uniform -%32 = OpFunction %2 None %31 -%33 = OpFunctionParameter %30 -%34 = OpLabel -%36 = OpLoad %6 %8 -%37 = OpLoad %2 %33 -%38 = OpVectorShuffle %35 %37 %37 0 1 -%39 = OpImageSampleImplicitLod %2 %36 %38 -%41 = OpLoad %2 %33 -%42 = OpVectorShuffle %35 %41 %41 2 3 -%43 = OpConvertFToS %40 %42 -%44 = OpLoad %9 %11 -%45 = OpImageRead %2 %44 %43 -%46 = OpFAdd %2 %39 %45 -OpReturnValue %46 -OpFunctionEnd -%48 = OpFunction %2 None %47 -%49 = OpFunctionParameter %30 -%50 = OpFunctionParameter %30 -%51 = OpLabel -%52 = OpLoad %2 %49 -%53 = OpVectorShuffle %35 %52 %52 0 1 -%54 = OpLoad %2 %50 -%55 = OpVectorShuffle %35 %54 %54 2 3 -%56 = OpCompositeExtract %1 %53 0 -%57 = OpCompositeExtract %1 %53 1 -%58 = OpCompositeExtract %1 %55 0 -%59 = OpCompositeExtract %1 %55 1 -%60 = OpCompositeConstruct %2 %56 %57 %58 %59 -OpReturnValue %60 -OpFunctionEnd -%63 = OpFunction %61 None %62 -%64 = OpLabel -%65 = OpVariable %30 Function -%68 = OpVariable %30 Function -%73 = OpVariable %30 Function -%66 = OpLoad %2 %4 -OpStore %65 %66 -%67 = OpFunctionCall %2 %32 %65 -%71 = OpAccessChain %70 %14 %69 -%72 = OpLoad %2 %71 -OpStore %68 %72 -%74 = OpAccessChain %70 %20 %69 %69 -%75 = OpLoad %2 %74 -OpStore %73 %75 -%76 = OpFunctionCall %2 %48 %68 %73 -%77 = OpFAdd %2 %67 %76 -%79 = OpAccessChain %70 %20 %78 %69 -%80 = OpLoad %2 %79 -%81 = OpFAdd %2 %77 %80 -OpStore %22 %81 -OpReturn -OpFunctionEnd -)"; -constexpr char kDst[] = R"(OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %63 "main" %4 %22 -OpExecutionMode %63 OriginUpperLeft -OpSource GLSL 450 -OpName %4 "_ue" -OpName %8 "_uf" -OpName %11 "_ug" -OpName %12 "_uA" -OpMemberName %12 0 "_ux" -OpName %14 "_uc" -OpName %15 "_uB" -OpMemberName %15 0 "_ux" -OpName %20 "_ud" -OpName %22 "_ucol" -OpName %26 "ANGLEDepthRangeParams" -OpMemberName %26 0 "near" -OpMemberName %26 1 "far" -OpMemberName %26 2 "diff" -OpMemberName %26 3 "reserved" -OpName %27 "ANGLEUniformBlock" -OpMemberName %27 0 "viewport" -OpMemberName %27 1 "clipDistancesEnabled" -OpMemberName %27 2 "xfbActiveUnpaused" -OpMemberName %27 3 "xfbVerticesPerInstance" -OpMemberName %27 4 "numSamples" -OpMemberName %27 5 "xfbBufferOffsets" -OpMemberName %27 6 "acbBufferOffsets" -OpMemberName %27 7 "depthRange" -OpName %29 "ANGLEUniforms" -OpName %33 "_uc" -OpName %32 "_uh" -OpName %49 "_ux" -OpName %50 "_uy" -OpName %48 "_ui" -OpName %63 "main" -OpName %65 "param" -OpName %68 "param" -OpName %73 "param" -OpDecorate %4 Location 1 -OpDecorate %8 RelaxedPrecision -OpDecorate %8 DescriptorSet 2 -OpDecorate %8 Binding 0 -OpDecorate %11 DescriptorSet 3 -OpDecorate %11 Binding 0 -OpMemberDecorate %12 0 Offset 0 -OpMemberDecorate %12 0 RelaxedPrecision -OpDecorate %12 Block -OpDecorate %14 DescriptorSet 3 -OpDecorate %14 Binding 1 -OpMemberDecorate %15 0 Offset 0 -OpMemberDecorate %15 0 RelaxedPrecision -OpDecorate %15 BufferBlock -OpDecorate %20 DescriptorSet 3 -OpDecorate %20 Binding 2 -OpDecorate %22 RelaxedPrecision -OpDecorate %22 Location 1 -OpMemberDecorate %26 0 Offset 0 -OpMemberDecorate %26 1 Offset 4 -OpMemberDecorate %26 2 Offset 8 -OpMemberDecorate %26 3 Offset 12 -OpMemberDecorate %27 0 Offset 0 -OpMemberDecorate %27 1 Offset 16 -OpMemberDecorate %27 2 Offset 20 -OpMemberDecorate %27 3 Offset 24 -OpMemberDecorate %27 4 Offset 28 -OpMemberDecorate %27 5 Offset 32 -OpMemberDecorate %27 6 Offset 48 -OpMemberDecorate %27 7 Offset 64 -OpMemberDecorate %27 2 RelaxedPrecision -OpMemberDecorate %27 4 RelaxedPrecision -OpDecorate %27 Block -OpDecorate %29 DescriptorSet 0 -OpDecorate %29 Binding 0 -OpDecorate %32 RelaxedPrecision -OpDecorate %33 RelaxedPrecision -OpDecorate %36 RelaxedPrecision -OpDecorate %37 RelaxedPrecision -OpDecorate %38 RelaxedPrecision -OpDecorate %39 RelaxedPrecision -OpDecorate %41 RelaxedPrecision -OpDecorate %42 RelaxedPrecision -OpDecorate %43 RelaxedPrecision -OpDecorate %48 RelaxedPrecision -OpDecorate %49 RelaxedPrecision -OpDecorate %50 RelaxedPrecision -OpDecorate %52 RelaxedPrecision -OpDecorate %53 RelaxedPrecision -OpDecorate %54 RelaxedPrecision -OpDecorate %55 RelaxedPrecision -OpDecorate %56 RelaxedPrecision -OpDecorate %57 RelaxedPrecision -OpDecorate %58 RelaxedPrecision -OpDecorate %59 RelaxedPrecision -OpDecorate %60 RelaxedPrecision -OpDecorate %67 RelaxedPrecision -OpDecorate %68 RelaxedPrecision -OpDecorate %72 RelaxedPrecision -OpDecorate %73 RelaxedPrecision -OpDecorate %75 RelaxedPrecision -OpDecorate %76 RelaxedPrecision -OpDecorate %77 RelaxedPrecision -OpDecorate %80 RelaxedPrecision -OpDecorate %81 RelaxedPrecision -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%5 = OpTypeImage %1 2D 0 0 0 1 Unknown -%6 = OpTypeSampledImage %5 -%9 = OpTypeImage %1 2D 0 0 0 2 Rgba8 -%12 = OpTypeStruct %2 -%15 = OpTypeStruct %2 -%16 = OpTypeInt 32 0 -%17 = OpConstant %16 2 -%18 = OpTypeArray %15 %17 -%23 = OpTypeInt 32 1 -%24 = OpTypeVector %23 4 -%25 = OpTypeVector %16 4 -%26 = OpTypeStruct %1 %1 %1 %1 -%27 = OpTypeStruct %2 %16 %16 %23 %23 %24 %25 %26 -%35 = OpTypeVector %1 2 -%40 = OpTypeVector %23 2 -%61 = OpTypeVoid -%69 = OpConstant %16 0 -%78 = OpConstant %16 1 -%82 = OpTypePointer Private %2 -%3 = OpTypePointer Input %2 -%7 = OpTypePointer UniformConstant %6 -%10 = OpTypePointer UniformConstant %9 -%13 = OpTypePointer Uniform %12 -%19 = OpTypePointer Uniform %18 -%83 = OpTypePointer Private %2 -%21 = OpTypePointer Output %2 -%28 = OpTypePointer Uniform %27 -%30 = OpTypePointer Function %2 -%70 = OpTypePointer Uniform %2 -%31 = OpTypeFunction %2 %30 -%47 = OpTypeFunction %2 %30 %30 -%62 = OpTypeFunction %61 -%4 = OpVariable %3 Input -%8 = OpVariable %7 UniformConstant -%11 = OpVariable %10 UniformConstant -%14 = OpVariable %13 Uniform -%20 = OpVariable %19 Uniform -%22 = OpVariable %21 Output -%29 = OpVariable %28 Uniform -%84 = OpConstant %23 0 -%85 = OpConstant %1 0.5 -%32 = OpFunction %2 None %31 -%33 = OpFunctionParameter %30 -%34 = OpLabel -%36 = OpLoad %6 %8 -%37 = OpLoad %2 %33 -%38 = OpVectorShuffle %35 %37 %37 0 1 -%39 = OpImageSampleImplicitLod %2 %36 %38 -%41 = OpLoad %2 %33 -%42 = OpVectorShuffle %35 %41 %41 2 3 -%43 = OpConvertFToS %40 %42 -%44 = OpLoad %9 %11 -%45 = OpImageRead %2 %44 %43 -%46 = OpFAdd %2 %39 %45 -OpReturnValue %46 -OpFunctionEnd -%48 = OpFunction %2 None %47 -%49 = OpFunctionParameter %30 -%50 = OpFunctionParameter %30 -%51 = OpLabel -%52 = OpLoad %2 %49 -%53 = OpVectorShuffle %35 %52 %52 0 1 -%54 = OpLoad %2 %50 -%55 = OpVectorShuffle %35 %54 %54 2 3 -%56 = OpCompositeExtract %1 %53 0 -%57 = OpCompositeExtract %1 %53 1 -%58 = OpCompositeExtract %1 %55 0 -%59 = OpCompositeExtract %1 %55 1 -%60 = OpCompositeConstruct %2 %56 %57 %58 %59 -OpReturnValue %60 -OpFunctionEnd -%63 = OpFunction %61 None %62 -%64 = OpLabel -%65 = OpVariable %30 Function -%68 = OpVariable %30 Function -%73 = OpVariable %30 Function -%66 = OpLoad %2 %4 -OpStore %65 %66 -%67 = OpFunctionCall %2 %32 %65 -%71 = OpAccessChain %70 %14 %69 -%72 = OpLoad %2 %71 -OpStore %68 %72 -%74 = OpAccessChain %70 %20 %69 %69 -%75 = OpLoad %2 %74 -OpStore %73 %75 -%76 = OpFunctionCall %2 %48 %68 %73 -%77 = OpFAdd %2 %67 %76 -%79 = OpAccessChain %70 %20 %78 %69 -%80 = OpLoad %2 %79 -%81 = OpFAdd %2 %77 %80 -OpStore %22 %81 -OpReturn -OpFunctionEnd -)"; - -TEST(DiffTest, DifferentDecorationsFragment) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 82 -+; Bound: 86 - ; Schema: 0 - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %63 "main" %4 %22 - OpExecutionMode %63 OriginUpperLeft - OpSource GLSL 450 - OpName %4 "_ue" - OpName %8 "_uf" - OpName %11 "_ug" - OpName %12 "_uA" - OpMemberName %12 0 "_ux" - OpName %14 "_uc" - OpName %15 "_uB" - OpMemberName %15 0 "_ux" - OpName %20 "_ud" - OpName %22 "_ucol" - OpName %26 "ANGLEDepthRangeParams" - OpMemberName %26 0 "near" - OpMemberName %26 1 "far" - OpMemberName %26 2 "diff" - OpMemberName %26 3 "reserved" - OpName %27 "ANGLEUniformBlock" - OpMemberName %27 0 "viewport" - OpMemberName %27 1 "clipDistancesEnabled" - OpMemberName %27 2 "xfbActiveUnpaused" - OpMemberName %27 3 "xfbVerticesPerInstance" - OpMemberName %27 4 "numSamples" - OpMemberName %27 5 "xfbBufferOffsets" - OpMemberName %27 6 "acbBufferOffsets" - OpMemberName %27 7 "depthRange" - OpName %29 "ANGLEUniforms" - OpName %33 "_uc" - OpName %32 "_uh" - OpName %49 "_ux" - OpName %50 "_uy" - OpName %48 "_ui" - OpName %63 "main" - OpName %65 "param" - OpName %68 "param" - OpName %73 "param" --OpDecorate %4 Location 0 -+OpDecorate %4 Location 1 - OpDecorate %8 RelaxedPrecision --OpDecorate %8 DescriptorSet 0 -+OpDecorate %8 DescriptorSet 2 - OpDecorate %8 Binding 0 --OpDecorate %11 DescriptorSet 0 -+OpDecorate %11 DescriptorSet 3 --OpDecorate %11 Binding 1 -+OpDecorate %11 Binding 0 - OpMemberDecorate %12 0 Offset 0 - OpMemberDecorate %12 0 RelaxedPrecision - OpDecorate %12 Block --OpDecorate %14 DescriptorSet 0 -+OpDecorate %14 DescriptorSet 3 --OpDecorate %14 Binding 2 -+OpDecorate %14 Binding 1 - OpMemberDecorate %15 0 Offset 0 - OpMemberDecorate %15 0 RelaxedPrecision - OpDecorate %15 BufferBlock --OpDecorate %20 DescriptorSet 0 -+OpDecorate %20 DescriptorSet 3 --OpDecorate %20 Binding 3 -+OpDecorate %20 Binding 2 - OpDecorate %22 RelaxedPrecision --OpDecorate %22 Location 0 -+OpDecorate %22 Location 1 - OpMemberDecorate %26 0 Offset 0 - OpMemberDecorate %26 1 Offset 4 - OpMemberDecorate %26 2 Offset 8 - OpMemberDecorate %26 3 Offset 12 - OpMemberDecorate %27 0 Offset 0 - OpMemberDecorate %27 1 Offset 16 - OpMemberDecorate %27 2 Offset 20 - OpMemberDecorate %27 3 Offset 24 - OpMemberDecorate %27 4 Offset 28 - OpMemberDecorate %27 5 Offset 32 - OpMemberDecorate %27 6 Offset 48 - OpMemberDecorate %27 7 Offset 64 - OpMemberDecorate %27 2 RelaxedPrecision - OpMemberDecorate %27 4 RelaxedPrecision - OpDecorate %27 Block - OpDecorate %29 DescriptorSet 0 --OpDecorate %29 Binding 4 -+OpDecorate %29 Binding 0 - OpDecorate %32 RelaxedPrecision - OpDecorate %33 RelaxedPrecision - OpDecorate %36 RelaxedPrecision - OpDecorate %37 RelaxedPrecision - OpDecorate %38 RelaxedPrecision - OpDecorate %39 RelaxedPrecision - OpDecorate %41 RelaxedPrecision - OpDecorate %42 RelaxedPrecision - OpDecorate %43 RelaxedPrecision - OpDecorate %48 RelaxedPrecision - OpDecorate %49 RelaxedPrecision - OpDecorate %50 RelaxedPrecision - OpDecorate %52 RelaxedPrecision - OpDecorate %53 RelaxedPrecision - OpDecorate %54 RelaxedPrecision - OpDecorate %55 RelaxedPrecision - OpDecorate %56 RelaxedPrecision - OpDecorate %57 RelaxedPrecision - OpDecorate %58 RelaxedPrecision - OpDecorate %59 RelaxedPrecision - OpDecorate %60 RelaxedPrecision - OpDecorate %67 RelaxedPrecision - OpDecorate %68 RelaxedPrecision - OpDecorate %72 RelaxedPrecision - OpDecorate %73 RelaxedPrecision - OpDecorate %75 RelaxedPrecision - OpDecorate %76 RelaxedPrecision - OpDecorate %77 RelaxedPrecision - OpDecorate %80 RelaxedPrecision - OpDecorate %81 RelaxedPrecision - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 - %5 = OpTypeImage %1 2D 0 0 0 1 Unknown - %6 = OpTypeSampledImage %5 - %9 = OpTypeImage %1 2D 0 0 0 2 Rgba8 - %12 = OpTypeStruct %2 - %15 = OpTypeStruct %2 - %16 = OpTypeInt 32 0 - %17 = OpConstant %16 2 - %18 = OpTypeArray %15 %17 - %23 = OpTypeInt 32 1 - %24 = OpTypeVector %23 4 - %25 = OpTypeVector %16 4 - %26 = OpTypeStruct %1 %1 %1 %1 - %27 = OpTypeStruct %2 %16 %16 %23 %23 %24 %25 %26 - %35 = OpTypeVector %1 2 - %40 = OpTypeVector %23 2 - %61 = OpTypeVoid - %69 = OpConstant %16 0 - %78 = OpConstant %16 1 -+%82 = OpTypePointer Private %2 - %3 = OpTypePointer Input %2 - %7 = OpTypePointer UniformConstant %6 - %10 = OpTypePointer UniformConstant %9 - %13 = OpTypePointer Uniform %12 - %19 = OpTypePointer Uniform %18 -+%83 = OpTypePointer Private %2 - %21 = OpTypePointer Output %2 - %28 = OpTypePointer Uniform %27 - %30 = OpTypePointer Function %2 - %70 = OpTypePointer Uniform %2 - %31 = OpTypeFunction %2 %30 - %47 = OpTypeFunction %2 %30 %30 - %62 = OpTypeFunction %61 - %4 = OpVariable %3 Input - %8 = OpVariable %7 UniformConstant - %11 = OpVariable %10 UniformConstant - %14 = OpVariable %13 Uniform - %20 = OpVariable %19 Uniform - %22 = OpVariable %21 Output - %29 = OpVariable %28 Uniform -+%84 = OpConstant %23 0 -+%85 = OpConstant %1 0.5 - %32 = OpFunction %2 None %31 - %33 = OpFunctionParameter %30 - %34 = OpLabel - %36 = OpLoad %6 %8 - %37 = OpLoad %2 %33 - %38 = OpVectorShuffle %35 %37 %37 0 1 - %39 = OpImageSampleImplicitLod %2 %36 %38 - %41 = OpLoad %2 %33 - %42 = OpVectorShuffle %35 %41 %41 2 3 - %43 = OpConvertFToS %40 %42 - %44 = OpLoad %9 %11 - %45 = OpImageRead %2 %44 %43 - %46 = OpFAdd %2 %39 %45 - OpReturnValue %46 - OpFunctionEnd - %48 = OpFunction %2 None %47 - %49 = OpFunctionParameter %30 - %50 = OpFunctionParameter %30 - %51 = OpLabel - %52 = OpLoad %2 %49 - %53 = OpVectorShuffle %35 %52 %52 0 1 - %54 = OpLoad %2 %50 - %55 = OpVectorShuffle %35 %54 %54 2 3 - %56 = OpCompositeExtract %1 %53 0 - %57 = OpCompositeExtract %1 %53 1 - %58 = OpCompositeExtract %1 %55 0 - %59 = OpCompositeExtract %1 %55 1 - %60 = OpCompositeConstruct %2 %56 %57 %58 %59 - OpReturnValue %60 - OpFunctionEnd - %63 = OpFunction %61 None %62 - %64 = OpLabel - %65 = OpVariable %30 Function - %68 = OpVariable %30 Function - %73 = OpVariable %30 Function - %66 = OpLoad %2 %4 - OpStore %65 %66 - %67 = OpFunctionCall %2 %32 %65 - %71 = OpAccessChain %70 %14 %69 - %72 = OpLoad %2 %71 - OpStore %68 %72 - %74 = OpAccessChain %70 %20 %69 %69 - %75 = OpLoad %2 %74 - OpStore %73 %75 - %76 = OpFunctionCall %2 %48 %68 %73 - %77 = OpFAdd %2 %67 %76 - %79 = OpAccessChain %70 %20 %78 %69 - %80 = OpLoad %2 %79 - %81 = OpFAdd %2 %77 %80 - OpStore %22 %81 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, DifferentDecorationsFragmentNoDebug) { - constexpr char kSrcNoDebug[] = R"(OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %63 "main" %4 %22 -OpExecutionMode %63 OriginUpperLeft -OpSource GLSL 450 -OpDecorate %4 Location 0 -OpDecorate %8 RelaxedPrecision -OpDecorate %8 DescriptorSet 0 -OpDecorate %8 Binding 0 -OpDecorate %11 DescriptorSet 0 -OpDecorate %11 Binding 1 -OpMemberDecorate %12 0 Offset 0 -OpMemberDecorate %12 0 RelaxedPrecision -OpDecorate %12 Block -OpDecorate %14 DescriptorSet 0 -OpDecorate %14 Binding 2 -OpMemberDecorate %15 0 Offset 0 -OpMemberDecorate %15 0 RelaxedPrecision -OpDecorate %15 BufferBlock -OpDecorate %20 DescriptorSet 0 -OpDecorate %20 Binding 3 -OpDecorate %22 RelaxedPrecision -OpDecorate %22 Location 0 -OpMemberDecorate %26 0 Offset 0 -OpMemberDecorate %26 1 Offset 4 -OpMemberDecorate %26 2 Offset 8 -OpMemberDecorate %26 3 Offset 12 -OpMemberDecorate %27 0 Offset 0 -OpMemberDecorate %27 1 Offset 16 -OpMemberDecorate %27 2 Offset 20 -OpMemberDecorate %27 3 Offset 24 -OpMemberDecorate %27 4 Offset 28 -OpMemberDecorate %27 5 Offset 32 -OpMemberDecorate %27 6 Offset 48 -OpMemberDecorate %27 7 Offset 64 -OpMemberDecorate %27 2 RelaxedPrecision -OpMemberDecorate %27 4 RelaxedPrecision -OpDecorate %27 Block -OpDecorate %29 DescriptorSet 0 -OpDecorate %29 Binding 4 -OpDecorate %32 RelaxedPrecision -OpDecorate %33 RelaxedPrecision -OpDecorate %36 RelaxedPrecision -OpDecorate %37 RelaxedPrecision -OpDecorate %38 RelaxedPrecision -OpDecorate %39 RelaxedPrecision -OpDecorate %41 RelaxedPrecision -OpDecorate %42 RelaxedPrecision -OpDecorate %43 RelaxedPrecision -OpDecorate %48 RelaxedPrecision -OpDecorate %49 RelaxedPrecision -OpDecorate %50 RelaxedPrecision -OpDecorate %52 RelaxedPrecision -OpDecorate %53 RelaxedPrecision -OpDecorate %54 RelaxedPrecision -OpDecorate %55 RelaxedPrecision -OpDecorate %56 RelaxedPrecision -OpDecorate %57 RelaxedPrecision -OpDecorate %58 RelaxedPrecision -OpDecorate %59 RelaxedPrecision -OpDecorate %60 RelaxedPrecision -OpDecorate %67 RelaxedPrecision -OpDecorate %68 RelaxedPrecision -OpDecorate %72 RelaxedPrecision -OpDecorate %73 RelaxedPrecision -OpDecorate %75 RelaxedPrecision -OpDecorate %76 RelaxedPrecision -OpDecorate %77 RelaxedPrecision -OpDecorate %80 RelaxedPrecision -OpDecorate %81 RelaxedPrecision -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%5 = OpTypeImage %1 2D 0 0 0 1 Unknown -%6 = OpTypeSampledImage %5 -%9 = OpTypeImage %1 2D 0 0 0 2 Rgba8 -%12 = OpTypeStruct %2 -%15 = OpTypeStruct %2 -%16 = OpTypeInt 32 0 -%17 = OpConstant %16 2 -%18 = OpTypeArray %15 %17 -%23 = OpTypeInt 32 1 -%24 = OpTypeVector %23 4 -%25 = OpTypeVector %16 4 -%26 = OpTypeStruct %1 %1 %1 %1 -%27 = OpTypeStruct %2 %16 %16 %23 %23 %24 %25 %26 -%35 = OpTypeVector %1 2 -%40 = OpTypeVector %23 2 -%61 = OpTypeVoid -%69 = OpConstant %16 0 -%78 = OpConstant %16 1 -%3 = OpTypePointer Input %2 -%7 = OpTypePointer UniformConstant %6 -%10 = OpTypePointer UniformConstant %9 -%13 = OpTypePointer Uniform %12 -%19 = OpTypePointer Uniform %18 -%21 = OpTypePointer Output %2 -%28 = OpTypePointer Uniform %27 -%30 = OpTypePointer Function %2 -%70 = OpTypePointer Uniform %2 -%31 = OpTypeFunction %2 %30 -%47 = OpTypeFunction %2 %30 %30 -%62 = OpTypeFunction %61 -%4 = OpVariable %3 Input -%8 = OpVariable %7 UniformConstant -%11 = OpVariable %10 UniformConstant -%14 = OpVariable %13 Uniform -%20 = OpVariable %19 Uniform -%22 = OpVariable %21 Output -%29 = OpVariable %28 Uniform -%32 = OpFunction %2 None %31 -%33 = OpFunctionParameter %30 -%34 = OpLabel -%36 = OpLoad %6 %8 -%37 = OpLoad %2 %33 -%38 = OpVectorShuffle %35 %37 %37 0 1 -%39 = OpImageSampleImplicitLod %2 %36 %38 -%41 = OpLoad %2 %33 -%42 = OpVectorShuffle %35 %41 %41 2 3 -%43 = OpConvertFToS %40 %42 -%44 = OpLoad %9 %11 -%45 = OpImageRead %2 %44 %43 -%46 = OpFAdd %2 %39 %45 -OpReturnValue %46 -OpFunctionEnd -%48 = OpFunction %2 None %47 -%49 = OpFunctionParameter %30 -%50 = OpFunctionParameter %30 -%51 = OpLabel -%52 = OpLoad %2 %49 -%53 = OpVectorShuffle %35 %52 %52 0 1 -%54 = OpLoad %2 %50 -%55 = OpVectorShuffle %35 %54 %54 2 3 -%56 = OpCompositeExtract %1 %53 0 -%57 = OpCompositeExtract %1 %53 1 -%58 = OpCompositeExtract %1 %55 0 -%59 = OpCompositeExtract %1 %55 1 -%60 = OpCompositeConstruct %2 %56 %57 %58 %59 -OpReturnValue %60 -OpFunctionEnd -%63 = OpFunction %61 None %62 -%64 = OpLabel -%65 = OpVariable %30 Function -%68 = OpVariable %30 Function -%73 = OpVariable %30 Function -%66 = OpLoad %2 %4 -OpStore %65 %66 -%67 = OpFunctionCall %2 %32 %65 -%71 = OpAccessChain %70 %14 %69 -%72 = OpLoad %2 %71 -OpStore %68 %72 -%74 = OpAccessChain %70 %20 %69 %69 -%75 = OpLoad %2 %74 -OpStore %73 %75 -%76 = OpFunctionCall %2 %48 %68 %73 -%77 = OpFAdd %2 %67 %76 -%79 = OpAccessChain %70 %20 %78 %69 -%80 = OpLoad %2 %79 -%81 = OpFAdd %2 %77 %80 -OpStore %22 %81 -OpReturn -OpFunctionEnd - -)"; - constexpr char kDstNoDebug[] = R"(OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %63 "main" %4 %22 -OpExecutionMode %63 OriginUpperLeft -OpSource GLSL 450 -OpDecorate %4 Location 1 -OpDecorate %8 RelaxedPrecision -OpDecorate %8 DescriptorSet 2 -OpDecorate %8 Binding 0 -OpDecorate %11 DescriptorSet 3 -OpDecorate %11 Binding 0 -OpMemberDecorate %12 0 Offset 0 -OpMemberDecorate %12 0 RelaxedPrecision -OpDecorate %12 Block -OpDecorate %14 DescriptorSet 3 -OpDecorate %14 Binding 1 -OpMemberDecorate %15 0 Offset 0 -OpMemberDecorate %15 0 RelaxedPrecision -OpDecorate %15 BufferBlock -OpDecorate %20 DescriptorSet 3 -OpDecorate %20 Binding 2 -OpDecorate %22 RelaxedPrecision -OpDecorate %22 Location 1 -OpMemberDecorate %26 0 Offset 0 -OpMemberDecorate %26 1 Offset 4 -OpMemberDecorate %26 2 Offset 8 -OpMemberDecorate %26 3 Offset 12 -OpMemberDecorate %27 0 Offset 0 -OpMemberDecorate %27 1 Offset 16 -OpMemberDecorate %27 2 Offset 20 -OpMemberDecorate %27 3 Offset 24 -OpMemberDecorate %27 4 Offset 28 -OpMemberDecorate %27 5 Offset 32 -OpMemberDecorate %27 6 Offset 48 -OpMemberDecorate %27 7 Offset 64 -OpMemberDecorate %27 2 RelaxedPrecision -OpMemberDecorate %27 4 RelaxedPrecision -OpDecorate %27 Block -OpDecorate %29 DescriptorSet 0 -OpDecorate %29 Binding 0 -OpDecorate %32 RelaxedPrecision -OpDecorate %33 RelaxedPrecision -OpDecorate %36 RelaxedPrecision -OpDecorate %37 RelaxedPrecision -OpDecorate %38 RelaxedPrecision -OpDecorate %39 RelaxedPrecision -OpDecorate %41 RelaxedPrecision -OpDecorate %42 RelaxedPrecision -OpDecorate %43 RelaxedPrecision -OpDecorate %48 RelaxedPrecision -OpDecorate %49 RelaxedPrecision -OpDecorate %50 RelaxedPrecision -OpDecorate %52 RelaxedPrecision -OpDecorate %53 RelaxedPrecision -OpDecorate %54 RelaxedPrecision -OpDecorate %55 RelaxedPrecision -OpDecorate %56 RelaxedPrecision -OpDecorate %57 RelaxedPrecision -OpDecorate %58 RelaxedPrecision -OpDecorate %59 RelaxedPrecision -OpDecorate %60 RelaxedPrecision -OpDecorate %67 RelaxedPrecision -OpDecorate %68 RelaxedPrecision -OpDecorate %72 RelaxedPrecision -OpDecorate %73 RelaxedPrecision -OpDecorate %75 RelaxedPrecision -OpDecorate %76 RelaxedPrecision -OpDecorate %77 RelaxedPrecision -OpDecorate %80 RelaxedPrecision -OpDecorate %81 RelaxedPrecision -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%5 = OpTypeImage %1 2D 0 0 0 1 Unknown -%6 = OpTypeSampledImage %5 -%9 = OpTypeImage %1 2D 0 0 0 2 Rgba8 -%12 = OpTypeStruct %2 -%15 = OpTypeStruct %2 -%16 = OpTypeInt 32 0 -%17 = OpConstant %16 2 -%18 = OpTypeArray %15 %17 -%23 = OpTypeInt 32 1 -%24 = OpTypeVector %23 4 -%25 = OpTypeVector %16 4 -%26 = OpTypeStruct %1 %1 %1 %1 -%27 = OpTypeStruct %2 %16 %16 %23 %23 %24 %25 %26 -%35 = OpTypeVector %1 2 -%40 = OpTypeVector %23 2 -%61 = OpTypeVoid -%69 = OpConstant %16 0 -%78 = OpConstant %16 1 -%82 = OpTypePointer Private %2 -%3 = OpTypePointer Input %2 -%7 = OpTypePointer UniformConstant %6 -%10 = OpTypePointer UniformConstant %9 -%13 = OpTypePointer Uniform %12 -%19 = OpTypePointer Uniform %18 -%83 = OpTypePointer Private %2 -%21 = OpTypePointer Output %2 -%28 = OpTypePointer Uniform %27 -%30 = OpTypePointer Function %2 -%70 = OpTypePointer Uniform %2 -%31 = OpTypeFunction %2 %30 -%47 = OpTypeFunction %2 %30 %30 -%62 = OpTypeFunction %61 -%4 = OpVariable %3 Input -%8 = OpVariable %7 UniformConstant -%11 = OpVariable %10 UniformConstant -%14 = OpVariable %13 Uniform -%20 = OpVariable %19 Uniform -%22 = OpVariable %21 Output -%29 = OpVariable %28 Uniform -%84 = OpConstant %23 0 -%85 = OpConstant %1 0.5 -%32 = OpFunction %2 None %31 -%33 = OpFunctionParameter %30 -%34 = OpLabel -%36 = OpLoad %6 %8 -%37 = OpLoad %2 %33 -%38 = OpVectorShuffle %35 %37 %37 0 1 -%39 = OpImageSampleImplicitLod %2 %36 %38 -%41 = OpLoad %2 %33 -%42 = OpVectorShuffle %35 %41 %41 2 3 -%43 = OpConvertFToS %40 %42 -%44 = OpLoad %9 %11 -%45 = OpImageRead %2 %44 %43 -%46 = OpFAdd %2 %39 %45 -OpReturnValue %46 -OpFunctionEnd -%48 = OpFunction %2 None %47 -%49 = OpFunctionParameter %30 -%50 = OpFunctionParameter %30 -%51 = OpLabel -%52 = OpLoad %2 %49 -%53 = OpVectorShuffle %35 %52 %52 0 1 -%54 = OpLoad %2 %50 -%55 = OpVectorShuffle %35 %54 %54 2 3 -%56 = OpCompositeExtract %1 %53 0 -%57 = OpCompositeExtract %1 %53 1 -%58 = OpCompositeExtract %1 %55 0 -%59 = OpCompositeExtract %1 %55 1 -%60 = OpCompositeConstruct %2 %56 %57 %58 %59 -OpReturnValue %60 -OpFunctionEnd -%63 = OpFunction %61 None %62 -%64 = OpLabel -%65 = OpVariable %30 Function -%68 = OpVariable %30 Function -%73 = OpVariable %30 Function -%66 = OpLoad %2 %4 -OpStore %65 %66 -%67 = OpFunctionCall %2 %32 %65 -%71 = OpAccessChain %70 %14 %69 -%72 = OpLoad %2 %71 -OpStore %68 %72 -%74 = OpAccessChain %70 %20 %69 %69 -%75 = OpLoad %2 %74 -OpStore %73 %75 -%76 = OpFunctionCall %2 %48 %68 %73 -%77 = OpFAdd %2 %67 %76 -%79 = OpAccessChain %70 %20 %78 %69 -%80 = OpLoad %2 %79 -%81 = OpFAdd %2 %77 %80 -OpStore %22 %81 -OpReturn -OpFunctionEnd -)"; - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 82 -+; Bound: 92 - ; Schema: 0 - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %63 "main" %4 %22 - OpExecutionMode %63 OriginUpperLeft - OpSource GLSL 450 --OpDecorate %4 Location 0 -+OpDecorate %4 Location 1 - OpDecorate %8 RelaxedPrecision --OpDecorate %8 DescriptorSet 0 -+OpDecorate %8 DescriptorSet 2 - OpDecorate %8 Binding 0 --OpDecorate %11 DescriptorSet 0 -+OpDecorate %11 DescriptorSet 3 --OpDecorate %11 Binding 1 -+OpDecorate %11 Binding 0 - OpMemberDecorate %12 0 Offset 0 - OpMemberDecorate %12 0 RelaxedPrecision - OpDecorate %12 Block -+OpDecorate %82 DescriptorSet 3 -+OpDecorate %82 Binding 1 --OpDecorate %14 DescriptorSet 0 -+OpDecorate %14 DescriptorSet 3 - OpDecorate %14 Binding 2 - OpMemberDecorate %15 0 Offset 0 - OpMemberDecorate %15 0 RelaxedPrecision - OpDecorate %15 BufferBlock --OpDecorate %20 DescriptorSet 0 --OpDecorate %20 Binding 3 - OpDecorate %22 RelaxedPrecision --OpDecorate %22 Location 0 -+OpDecorate %22 Location 1 - OpMemberDecorate %26 0 Offset 0 - OpMemberDecorate %26 1 Offset 4 - OpMemberDecorate %26 2 Offset 8 - OpMemberDecorate %26 3 Offset 12 - OpMemberDecorate %27 0 Offset 0 - OpMemberDecorate %27 1 Offset 16 - OpMemberDecorate %27 2 Offset 20 - OpMemberDecorate %27 3 Offset 24 - OpMemberDecorate %27 4 Offset 28 - OpMemberDecorate %27 5 Offset 32 - OpMemberDecorate %27 6 Offset 48 - OpMemberDecorate %27 7 Offset 64 - OpMemberDecorate %27 2 RelaxedPrecision - OpMemberDecorate %27 4 RelaxedPrecision - OpDecorate %27 Block --OpDecorate %29 DescriptorSet 0 --OpDecorate %29 Binding 4 -+OpDecorate %83 DescriptorSet 0 -+OpDecorate %83 Binding 0 - OpDecorate %32 RelaxedPrecision --OpDecorate %33 RelaxedPrecision -+OpDecorate %84 RelaxedPrecision - OpDecorate %36 RelaxedPrecision - OpDecorate %37 RelaxedPrecision - OpDecorate %38 RelaxedPrecision - OpDecorate %39 RelaxedPrecision - OpDecorate %41 RelaxedPrecision - OpDecorate %42 RelaxedPrecision - OpDecorate %43 RelaxedPrecision - OpDecorate %48 RelaxedPrecision --OpDecorate %49 RelaxedPrecision --OpDecorate %50 RelaxedPrecision -+OpDecorate %85 RelaxedPrecision -+OpDecorate %86 RelaxedPrecision - OpDecorate %52 RelaxedPrecision - OpDecorate %53 RelaxedPrecision - OpDecorate %54 RelaxedPrecision - OpDecorate %55 RelaxedPrecision - OpDecorate %56 RelaxedPrecision - OpDecorate %57 RelaxedPrecision - OpDecorate %58 RelaxedPrecision - OpDecorate %59 RelaxedPrecision - OpDecorate %60 RelaxedPrecision - OpDecorate %67 RelaxedPrecision - OpDecorate %68 RelaxedPrecision - OpDecorate %72 RelaxedPrecision - OpDecorate %73 RelaxedPrecision - OpDecorate %75 RelaxedPrecision - OpDecorate %76 RelaxedPrecision - OpDecorate %77 RelaxedPrecision - OpDecorate %80 RelaxedPrecision - OpDecorate %81 RelaxedPrecision - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 - %5 = OpTypeImage %1 2D 0 0 0 1 Unknown - %6 = OpTypeSampledImage %5 - %9 = OpTypeImage %1 2D 0 0 0 2 Rgba8 - %12 = OpTypeStruct %2 - %15 = OpTypeStruct %2 - %16 = OpTypeInt 32 0 - %17 = OpConstant %16 2 - %18 = OpTypeArray %15 %17 - %23 = OpTypeInt 32 1 - %24 = OpTypeVector %23 4 - %25 = OpTypeVector %16 4 - %26 = OpTypeStruct %1 %1 %1 %1 - %27 = OpTypeStruct %2 %16 %16 %23 %23 %24 %25 %26 - %35 = OpTypeVector %1 2 - %40 = OpTypeVector %23 2 - %61 = OpTypeVoid - %69 = OpConstant %16 0 - %78 = OpConstant %16 1 -+%88 = OpTypePointer Private %2 - %3 = OpTypePointer Input %2 - %7 = OpTypePointer UniformConstant %6 - %10 = OpTypePointer UniformConstant %9 - %13 = OpTypePointer Uniform %12 - %19 = OpTypePointer Uniform %18 -+%89 = OpTypePointer Private %2 - %21 = OpTypePointer Output %2 - %28 = OpTypePointer Uniform %27 - %30 = OpTypePointer Function %2 - %70 = OpTypePointer Uniform %2 - %31 = OpTypeFunction %2 %30 - %47 = OpTypeFunction %2 %30 %30 - %62 = OpTypeFunction %61 - %4 = OpVariable %3 Input - %8 = OpVariable %7 UniformConstant - %11 = OpVariable %10 UniformConstant -+%82 = OpVariable %13 Uniform --%14 = OpVariable %13 Uniform -+%14 = OpVariable %19 Uniform --%20 = OpVariable %19 Uniform - %22 = OpVariable %21 Output --%29 = OpVariable %28 Uniform -+%83 = OpVariable %28 Uniform -+%90 = OpConstant %23 0 -+%91 = OpConstant %1 0.5 - %32 = OpFunction %2 None %31 --%33 = OpFunctionParameter %30 -+%84 = OpFunctionParameter %30 - %34 = OpLabel - %36 = OpLoad %6 %8 --%37 = OpLoad %2 %33 -+%37 = OpLoad %2 %84 - %38 = OpVectorShuffle %35 %37 %37 0 1 - %39 = OpImageSampleImplicitLod %2 %36 %38 --%41 = OpLoad %2 %33 -+%41 = OpLoad %2 %84 - %42 = OpVectorShuffle %35 %41 %41 2 3 - %43 = OpConvertFToS %40 %42 - %44 = OpLoad %9 %11 - %45 = OpImageRead %2 %44 %43 - %46 = OpFAdd %2 %39 %45 - OpReturnValue %46 - OpFunctionEnd - %48 = OpFunction %2 None %47 --%49 = OpFunctionParameter %30 --%50 = OpFunctionParameter %30 -+%85 = OpFunctionParameter %30 -+%86 = OpFunctionParameter %30 - %51 = OpLabel --%52 = OpLoad %2 %49 -+%52 = OpLoad %2 %85 - %53 = OpVectorShuffle %35 %52 %52 0 1 --%54 = OpLoad %2 %50 -+%54 = OpLoad %2 %86 - %55 = OpVectorShuffle %35 %54 %54 2 3 - %56 = OpCompositeExtract %1 %53 0 - %57 = OpCompositeExtract %1 %53 1 - %58 = OpCompositeExtract %1 %55 0 - %59 = OpCompositeExtract %1 %55 1 - %60 = OpCompositeConstruct %2 %56 %57 %58 %59 - OpReturnValue %60 - OpFunctionEnd - %63 = OpFunction %61 None %62 - %64 = OpLabel - %65 = OpVariable %30 Function - %68 = OpVariable %30 Function - %73 = OpVariable %30 Function - %66 = OpLoad %2 %4 - OpStore %65 %66 - %67 = OpFunctionCall %2 %32 %65 --%71 = OpAccessChain %70 %14 %69 -+%87 = OpAccessChain %70 %82 %69 --%72 = OpLoad %2 %71 -+%72 = OpLoad %2 %87 - OpStore %68 %72 --%74 = OpAccessChain %70 %20 %69 %69 -+%74 = OpAccessChain %70 %14 %69 %69 - %75 = OpLoad %2 %74 - OpStore %73 %75 - %76 = OpFunctionCall %2 %48 %68 %73 - %77 = OpFAdd %2 %67 %76 --%79 = OpAccessChain %70 %20 %78 %69 -+%79 = OpAccessChain %70 %14 %78 %69 - %80 = OpLoad %2 %79 - %81 = OpFAdd %2 %77 %80 - OpStore %22 %81 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -} - -TEST(DiffTest, DifferentDecorationsFragmentIgnoreLocation) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 82 -+; Bound: 86 - ; Schema: 0 - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %63 "main" %4 %22 - OpExecutionMode %63 OriginUpperLeft - OpSource GLSL 450 - OpName %4 "_ue" - OpName %8 "_uf" - OpName %11 "_ug" - OpName %12 "_uA" - OpMemberName %12 0 "_ux" - OpName %14 "_uc" - OpName %15 "_uB" - OpMemberName %15 0 "_ux" - OpName %20 "_ud" - OpName %22 "_ucol" - OpName %26 "ANGLEDepthRangeParams" - OpMemberName %26 0 "near" - OpMemberName %26 1 "far" - OpMemberName %26 2 "diff" - OpMemberName %26 3 "reserved" - OpName %27 "ANGLEUniformBlock" - OpMemberName %27 0 "viewport" - OpMemberName %27 1 "clipDistancesEnabled" - OpMemberName %27 2 "xfbActiveUnpaused" - OpMemberName %27 3 "xfbVerticesPerInstance" - OpMemberName %27 4 "numSamples" - OpMemberName %27 5 "xfbBufferOffsets" - OpMemberName %27 6 "acbBufferOffsets" - OpMemberName %27 7 "depthRange" - OpName %29 "ANGLEUniforms" - OpName %33 "_uc" - OpName %32 "_uh" - OpName %49 "_ux" - OpName %50 "_uy" - OpName %48 "_ui" - OpName %63 "main" - OpName %65 "param" - OpName %68 "param" - OpName %73 "param" --OpDecorate %4 Location 0 -+OpDecorate %4 Location 1 - OpDecorate %8 RelaxedPrecision --OpDecorate %8 DescriptorSet 0 -+OpDecorate %8 DescriptorSet 2 - OpDecorate %8 Binding 0 --OpDecorate %11 DescriptorSet 0 -+OpDecorate %11 DescriptorSet 3 --OpDecorate %11 Binding 1 -+OpDecorate %11 Binding 0 - OpMemberDecorate %12 0 Offset 0 - OpMemberDecorate %12 0 RelaxedPrecision - OpDecorate %12 Block --OpDecorate %14 DescriptorSet 0 -+OpDecorate %14 DescriptorSet 3 --OpDecorate %14 Binding 2 -+OpDecorate %14 Binding 1 - OpMemberDecorate %15 0 Offset 0 - OpMemberDecorate %15 0 RelaxedPrecision - OpDecorate %15 BufferBlock --OpDecorate %20 DescriptorSet 0 -+OpDecorate %20 DescriptorSet 3 --OpDecorate %20 Binding 3 -+OpDecorate %20 Binding 2 - OpDecorate %22 RelaxedPrecision --OpDecorate %22 Location 0 -+OpDecorate %22 Location 1 - OpMemberDecorate %26 0 Offset 0 - OpMemberDecorate %26 1 Offset 4 - OpMemberDecorate %26 2 Offset 8 - OpMemberDecorate %26 3 Offset 12 - OpMemberDecorate %27 0 Offset 0 - OpMemberDecorate %27 1 Offset 16 - OpMemberDecorate %27 2 Offset 20 - OpMemberDecorate %27 3 Offset 24 - OpMemberDecorate %27 4 Offset 28 - OpMemberDecorate %27 5 Offset 32 - OpMemberDecorate %27 6 Offset 48 - OpMemberDecorate %27 7 Offset 64 - OpMemberDecorate %27 2 RelaxedPrecision - OpMemberDecorate %27 4 RelaxedPrecision - OpDecorate %27 Block - OpDecorate %29 DescriptorSet 0 --OpDecorate %29 Binding 4 -+OpDecorate %29 Binding 0 - OpDecorate %32 RelaxedPrecision - OpDecorate %33 RelaxedPrecision - OpDecorate %36 RelaxedPrecision - OpDecorate %37 RelaxedPrecision - OpDecorate %38 RelaxedPrecision - OpDecorate %39 RelaxedPrecision - OpDecorate %41 RelaxedPrecision - OpDecorate %42 RelaxedPrecision - OpDecorate %43 RelaxedPrecision - OpDecorate %48 RelaxedPrecision - OpDecorate %49 RelaxedPrecision - OpDecorate %50 RelaxedPrecision - OpDecorate %52 RelaxedPrecision - OpDecorate %53 RelaxedPrecision - OpDecorate %54 RelaxedPrecision - OpDecorate %55 RelaxedPrecision - OpDecorate %56 RelaxedPrecision - OpDecorate %57 RelaxedPrecision - OpDecorate %58 RelaxedPrecision - OpDecorate %59 RelaxedPrecision - OpDecorate %60 RelaxedPrecision - OpDecorate %67 RelaxedPrecision - OpDecorate %68 RelaxedPrecision - OpDecorate %72 RelaxedPrecision - OpDecorate %73 RelaxedPrecision - OpDecorate %75 RelaxedPrecision - OpDecorate %76 RelaxedPrecision - OpDecorate %77 RelaxedPrecision - OpDecorate %80 RelaxedPrecision - OpDecorate %81 RelaxedPrecision - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 - %5 = OpTypeImage %1 2D 0 0 0 1 Unknown - %6 = OpTypeSampledImage %5 - %9 = OpTypeImage %1 2D 0 0 0 2 Rgba8 - %12 = OpTypeStruct %2 - %15 = OpTypeStruct %2 - %16 = OpTypeInt 32 0 - %17 = OpConstant %16 2 - %18 = OpTypeArray %15 %17 - %23 = OpTypeInt 32 1 - %24 = OpTypeVector %23 4 - %25 = OpTypeVector %16 4 - %26 = OpTypeStruct %1 %1 %1 %1 - %27 = OpTypeStruct %2 %16 %16 %23 %23 %24 %25 %26 - %35 = OpTypeVector %1 2 - %40 = OpTypeVector %23 2 - %61 = OpTypeVoid - %69 = OpConstant %16 0 - %78 = OpConstant %16 1 -+%82 = OpTypePointer Private %2 - %3 = OpTypePointer Input %2 - %7 = OpTypePointer UniformConstant %6 - %10 = OpTypePointer UniformConstant %9 - %13 = OpTypePointer Uniform %12 - %19 = OpTypePointer Uniform %18 -+%83 = OpTypePointer Private %2 - %21 = OpTypePointer Output %2 - %28 = OpTypePointer Uniform %27 - %30 = OpTypePointer Function %2 - %70 = OpTypePointer Uniform %2 - %31 = OpTypeFunction %2 %30 - %47 = OpTypeFunction %2 %30 %30 - %62 = OpTypeFunction %61 - %4 = OpVariable %3 Input - %8 = OpVariable %7 UniformConstant - %11 = OpVariable %10 UniformConstant - %14 = OpVariable %13 Uniform - %20 = OpVariable %19 Uniform - %22 = OpVariable %21 Output - %29 = OpVariable %28 Uniform -+%84 = OpConstant %23 0 -+%85 = OpConstant %1 0.5 - %32 = OpFunction %2 None %31 - %33 = OpFunctionParameter %30 - %34 = OpLabel - %36 = OpLoad %6 %8 - %37 = OpLoad %2 %33 - %38 = OpVectorShuffle %35 %37 %37 0 1 - %39 = OpImageSampleImplicitLod %2 %36 %38 - %41 = OpLoad %2 %33 - %42 = OpVectorShuffle %35 %41 %41 2 3 - %43 = OpConvertFToS %40 %42 - %44 = OpLoad %9 %11 - %45 = OpImageRead %2 %44 %43 - %46 = OpFAdd %2 %39 %45 - OpReturnValue %46 - OpFunctionEnd - %48 = OpFunction %2 None %47 - %49 = OpFunctionParameter %30 - %50 = OpFunctionParameter %30 - %51 = OpLabel - %52 = OpLoad %2 %49 - %53 = OpVectorShuffle %35 %52 %52 0 1 - %54 = OpLoad %2 %50 - %55 = OpVectorShuffle %35 %54 %54 2 3 - %56 = OpCompositeExtract %1 %53 0 - %57 = OpCompositeExtract %1 %53 1 - %58 = OpCompositeExtract %1 %55 0 - %59 = OpCompositeExtract %1 %55 1 - %60 = OpCompositeConstruct %2 %56 %57 %58 %59 - OpReturnValue %60 - OpFunctionEnd - %63 = OpFunction %61 None %62 - %64 = OpLabel - %65 = OpVariable %30 Function - %68 = OpVariable %30 Function - %73 = OpVariable %30 Function - %66 = OpLoad %2 %4 - OpStore %65 %66 - %67 = OpFunctionCall %2 %32 %65 - %71 = OpAccessChain %70 %14 %69 - %72 = OpLoad %2 %71 - OpStore %68 %72 - %74 = OpAccessChain %70 %20 %69 %69 - %75 = OpLoad %2 %74 - OpStore %73 %75 - %76 = OpFunctionCall %2 %48 %68 %73 - %77 = OpFAdd %2 %67 %76 - %79 = OpAccessChain %70 %20 %78 %69 - %80 = OpLoad %2 %79 - %81 = OpFAdd %2 %77 %80 - OpStore %22 %81 - OpReturn - OpFunctionEnd -)"; - Options options; - options.ignore_location = true; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, DifferentDecorationsFragmentIgnoreSetBindingLocation) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 82 -+; Bound: 86 - ; Schema: 0 - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %63 "main" %4 %22 - OpExecutionMode %63 OriginUpperLeft - OpSource GLSL 450 - OpName %4 "_ue" - OpName %8 "_uf" - OpName %11 "_ug" - OpName %12 "_uA" - OpMemberName %12 0 "_ux" - OpName %14 "_uc" - OpName %15 "_uB" - OpMemberName %15 0 "_ux" - OpName %20 "_ud" - OpName %22 "_ucol" - OpName %26 "ANGLEDepthRangeParams" - OpMemberName %26 0 "near" - OpMemberName %26 1 "far" - OpMemberName %26 2 "diff" - OpMemberName %26 3 "reserved" - OpName %27 "ANGLEUniformBlock" - OpMemberName %27 0 "viewport" - OpMemberName %27 1 "clipDistancesEnabled" - OpMemberName %27 2 "xfbActiveUnpaused" - OpMemberName %27 3 "xfbVerticesPerInstance" - OpMemberName %27 4 "numSamples" - OpMemberName %27 5 "xfbBufferOffsets" - OpMemberName %27 6 "acbBufferOffsets" - OpMemberName %27 7 "depthRange" - OpName %29 "ANGLEUniforms" - OpName %33 "_uc" - OpName %32 "_uh" - OpName %49 "_ux" - OpName %50 "_uy" - OpName %48 "_ui" - OpName %63 "main" - OpName %65 "param" - OpName %68 "param" - OpName %73 "param" --OpDecorate %4 Location 0 -+OpDecorate %4 Location 1 - OpDecorate %8 RelaxedPrecision --OpDecorate %8 DescriptorSet 0 -+OpDecorate %8 DescriptorSet 2 - OpDecorate %8 Binding 0 --OpDecorate %11 DescriptorSet 0 -+OpDecorate %11 DescriptorSet 3 --OpDecorate %11 Binding 1 -+OpDecorate %11 Binding 0 - OpMemberDecorate %12 0 Offset 0 - OpMemberDecorate %12 0 RelaxedPrecision - OpDecorate %12 Block --OpDecorate %14 DescriptorSet 0 -+OpDecorate %14 DescriptorSet 3 --OpDecorate %14 Binding 2 -+OpDecorate %14 Binding 1 - OpMemberDecorate %15 0 Offset 0 - OpMemberDecorate %15 0 RelaxedPrecision - OpDecorate %15 BufferBlock --OpDecorate %20 DescriptorSet 0 -+OpDecorate %20 DescriptorSet 3 --OpDecorate %20 Binding 3 -+OpDecorate %20 Binding 2 - OpDecorate %22 RelaxedPrecision --OpDecorate %22 Location 0 -+OpDecorate %22 Location 1 - OpMemberDecorate %26 0 Offset 0 - OpMemberDecorate %26 1 Offset 4 - OpMemberDecorate %26 2 Offset 8 - OpMemberDecorate %26 3 Offset 12 - OpMemberDecorate %27 0 Offset 0 - OpMemberDecorate %27 1 Offset 16 - OpMemberDecorate %27 2 Offset 20 - OpMemberDecorate %27 3 Offset 24 - OpMemberDecorate %27 4 Offset 28 - OpMemberDecorate %27 5 Offset 32 - OpMemberDecorate %27 6 Offset 48 - OpMemberDecorate %27 7 Offset 64 - OpMemberDecorate %27 2 RelaxedPrecision - OpMemberDecorate %27 4 RelaxedPrecision - OpDecorate %27 Block - OpDecorate %29 DescriptorSet 0 --OpDecorate %29 Binding 4 -+OpDecorate %29 Binding 0 - OpDecorate %32 RelaxedPrecision - OpDecorate %33 RelaxedPrecision - OpDecorate %36 RelaxedPrecision - OpDecorate %37 RelaxedPrecision - OpDecorate %38 RelaxedPrecision - OpDecorate %39 RelaxedPrecision - OpDecorate %41 RelaxedPrecision - OpDecorate %42 RelaxedPrecision - OpDecorate %43 RelaxedPrecision - OpDecorate %48 RelaxedPrecision - OpDecorate %49 RelaxedPrecision - OpDecorate %50 RelaxedPrecision - OpDecorate %52 RelaxedPrecision - OpDecorate %53 RelaxedPrecision - OpDecorate %54 RelaxedPrecision - OpDecorate %55 RelaxedPrecision - OpDecorate %56 RelaxedPrecision - OpDecorate %57 RelaxedPrecision - OpDecorate %58 RelaxedPrecision - OpDecorate %59 RelaxedPrecision - OpDecorate %60 RelaxedPrecision - OpDecorate %67 RelaxedPrecision - OpDecorate %68 RelaxedPrecision - OpDecorate %72 RelaxedPrecision - OpDecorate %73 RelaxedPrecision - OpDecorate %75 RelaxedPrecision - OpDecorate %76 RelaxedPrecision - OpDecorate %77 RelaxedPrecision - OpDecorate %80 RelaxedPrecision - OpDecorate %81 RelaxedPrecision - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 - %5 = OpTypeImage %1 2D 0 0 0 1 Unknown - %6 = OpTypeSampledImage %5 - %9 = OpTypeImage %1 2D 0 0 0 2 Rgba8 - %12 = OpTypeStruct %2 - %15 = OpTypeStruct %2 - %16 = OpTypeInt 32 0 - %17 = OpConstant %16 2 - %18 = OpTypeArray %15 %17 - %23 = OpTypeInt 32 1 - %24 = OpTypeVector %23 4 - %25 = OpTypeVector %16 4 - %26 = OpTypeStruct %1 %1 %1 %1 - %27 = OpTypeStruct %2 %16 %16 %23 %23 %24 %25 %26 - %35 = OpTypeVector %1 2 - %40 = OpTypeVector %23 2 - %61 = OpTypeVoid - %69 = OpConstant %16 0 - %78 = OpConstant %16 1 -+%82 = OpTypePointer Private %2 - %3 = OpTypePointer Input %2 - %7 = OpTypePointer UniformConstant %6 - %10 = OpTypePointer UniformConstant %9 - %13 = OpTypePointer Uniform %12 - %19 = OpTypePointer Uniform %18 -+%83 = OpTypePointer Private %2 - %21 = OpTypePointer Output %2 - %28 = OpTypePointer Uniform %27 - %30 = OpTypePointer Function %2 - %70 = OpTypePointer Uniform %2 - %31 = OpTypeFunction %2 %30 - %47 = OpTypeFunction %2 %30 %30 - %62 = OpTypeFunction %61 - %4 = OpVariable %3 Input - %8 = OpVariable %7 UniformConstant - %11 = OpVariable %10 UniformConstant - %14 = OpVariable %13 Uniform - %20 = OpVariable %19 Uniform - %22 = OpVariable %21 Output - %29 = OpVariable %28 Uniform -+%84 = OpConstant %23 0 -+%85 = OpConstant %1 0.5 - %32 = OpFunction %2 None %31 - %33 = OpFunctionParameter %30 - %34 = OpLabel - %36 = OpLoad %6 %8 - %37 = OpLoad %2 %33 - %38 = OpVectorShuffle %35 %37 %37 0 1 - %39 = OpImageSampleImplicitLod %2 %36 %38 - %41 = OpLoad %2 %33 - %42 = OpVectorShuffle %35 %41 %41 2 3 - %43 = OpConvertFToS %40 %42 - %44 = OpLoad %9 %11 - %45 = OpImageRead %2 %44 %43 - %46 = OpFAdd %2 %39 %45 - OpReturnValue %46 - OpFunctionEnd - %48 = OpFunction %2 None %47 - %49 = OpFunctionParameter %30 - %50 = OpFunctionParameter %30 - %51 = OpLabel - %52 = OpLoad %2 %49 - %53 = OpVectorShuffle %35 %52 %52 0 1 - %54 = OpLoad %2 %50 - %55 = OpVectorShuffle %35 %54 %54 2 3 - %56 = OpCompositeExtract %1 %53 0 - %57 = OpCompositeExtract %1 %53 1 - %58 = OpCompositeExtract %1 %55 0 - %59 = OpCompositeExtract %1 %55 1 - %60 = OpCompositeConstruct %2 %56 %57 %58 %59 - OpReturnValue %60 - OpFunctionEnd - %63 = OpFunction %61 None %62 - %64 = OpLabel - %65 = OpVariable %30 Function - %68 = OpVariable %30 Function - %73 = OpVariable %30 Function - %66 = OpLoad %2 %4 - OpStore %65 %66 - %67 = OpFunctionCall %2 %32 %65 - %71 = OpAccessChain %70 %14 %69 - %72 = OpLoad %2 %71 - OpStore %68 %72 - %74 = OpAccessChain %70 %20 %69 %69 - %75 = OpLoad %2 %74 - OpStore %73 %75 - %76 = OpFunctionCall %2 %48 %68 %73 - %77 = OpFAdd %2 %67 %76 - %79 = OpAccessChain %70 %20 %78 %69 - %80 = OpLoad %2 %79 - %81 = OpFAdd %2 %77 %80 - OpStore %22 %81 - OpReturn - OpFunctionEnd -)"; - Options options; - options.ignore_set_binding = true; - options.ignore_location = true; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_files/different_decorations_fragment_dst.spvasm b/test/diff/diff_files/different_decorations_fragment_dst.spvasm deleted file mode 100644 index b5d1c9f7..00000000 --- a/test/diff/diff_files/different_decorations_fragment_dst.spvasm +++ /dev/null @@ -1,199 +0,0 @@ -OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %63 "main" %4 %22 -OpExecutionMode %63 OriginUpperLeft -OpSource GLSL 450 -OpName %4 "_ue" -OpName %8 "_uf" -OpName %11 "_ug" -OpName %12 "_uA" -OpMemberName %12 0 "_ux" -OpName %14 "_uc" -OpName %15 "_uB" -OpMemberName %15 0 "_ux" -OpName %20 "_ud" -OpName %22 "_ucol" -OpName %26 "ANGLEDepthRangeParams" -OpMemberName %26 0 "near" -OpMemberName %26 1 "far" -OpMemberName %26 2 "diff" -OpMemberName %26 3 "reserved" -OpName %27 "ANGLEUniformBlock" -OpMemberName %27 0 "viewport" -OpMemberName %27 1 "clipDistancesEnabled" -OpMemberName %27 2 "xfbActiveUnpaused" -OpMemberName %27 3 "xfbVerticesPerInstance" -OpMemberName %27 4 "numSamples" -OpMemberName %27 5 "xfbBufferOffsets" -OpMemberName %27 6 "acbBufferOffsets" -OpMemberName %27 7 "depthRange" -OpName %29 "ANGLEUniforms" -OpName %33 "_uc" -OpName %32 "_uh" -OpName %49 "_ux" -OpName %50 "_uy" -OpName %48 "_ui" -OpName %63 "main" -OpName %65 "param" -OpName %68 "param" -OpName %73 "param" -OpDecorate %4 Location 1 -OpDecorate %8 RelaxedPrecision -OpDecorate %8 DescriptorSet 2 -OpDecorate %8 Binding 0 -OpDecorate %11 DescriptorSet 3 -OpDecorate %11 Binding 0 -OpMemberDecorate %12 0 Offset 0 -OpMemberDecorate %12 0 RelaxedPrecision -OpDecorate %12 Block -OpDecorate %14 DescriptorSet 3 -OpDecorate %14 Binding 1 -OpMemberDecorate %15 0 Offset 0 -OpMemberDecorate %15 0 RelaxedPrecision -OpDecorate %15 BufferBlock -OpDecorate %20 DescriptorSet 3 -OpDecorate %20 Binding 2 -OpDecorate %22 RelaxedPrecision -OpDecorate %22 Location 1 -OpMemberDecorate %26 0 Offset 0 -OpMemberDecorate %26 1 Offset 4 -OpMemberDecorate %26 2 Offset 8 -OpMemberDecorate %26 3 Offset 12 -OpMemberDecorate %27 0 Offset 0 -OpMemberDecorate %27 1 Offset 16 -OpMemberDecorate %27 2 Offset 20 -OpMemberDecorate %27 3 Offset 24 -OpMemberDecorate %27 4 Offset 28 -OpMemberDecorate %27 5 Offset 32 -OpMemberDecorate %27 6 Offset 48 -OpMemberDecorate %27 7 Offset 64 -OpMemberDecorate %27 2 RelaxedPrecision -OpMemberDecorate %27 4 RelaxedPrecision -OpDecorate %27 Block -OpDecorate %29 DescriptorSet 0 -OpDecorate %29 Binding 0 -OpDecorate %32 RelaxedPrecision -OpDecorate %33 RelaxedPrecision -OpDecorate %36 RelaxedPrecision -OpDecorate %37 RelaxedPrecision -OpDecorate %38 RelaxedPrecision -OpDecorate %39 RelaxedPrecision -OpDecorate %41 RelaxedPrecision -OpDecorate %42 RelaxedPrecision -OpDecorate %43 RelaxedPrecision -OpDecorate %48 RelaxedPrecision -OpDecorate %49 RelaxedPrecision -OpDecorate %50 RelaxedPrecision -OpDecorate %52 RelaxedPrecision -OpDecorate %53 RelaxedPrecision -OpDecorate %54 RelaxedPrecision -OpDecorate %55 RelaxedPrecision -OpDecorate %56 RelaxedPrecision -OpDecorate %57 RelaxedPrecision -OpDecorate %58 RelaxedPrecision -OpDecorate %59 RelaxedPrecision -OpDecorate %60 RelaxedPrecision -OpDecorate %67 RelaxedPrecision -OpDecorate %68 RelaxedPrecision -OpDecorate %72 RelaxedPrecision -OpDecorate %73 RelaxedPrecision -OpDecorate %75 RelaxedPrecision -OpDecorate %76 RelaxedPrecision -OpDecorate %77 RelaxedPrecision -OpDecorate %80 RelaxedPrecision -OpDecorate %81 RelaxedPrecision -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%5 = OpTypeImage %1 2D 0 0 0 1 Unknown -%6 = OpTypeSampledImage %5 -%9 = OpTypeImage %1 2D 0 0 0 2 Rgba8 -%12 = OpTypeStruct %2 -%15 = OpTypeStruct %2 -%16 = OpTypeInt 32 0 -%17 = OpConstant %16 2 -%18 = OpTypeArray %15 %17 -%23 = OpTypeInt 32 1 -%24 = OpTypeVector %23 4 -%25 = OpTypeVector %16 4 -%26 = OpTypeStruct %1 %1 %1 %1 -%27 = OpTypeStruct %2 %16 %16 %23 %23 %24 %25 %26 -%35 = OpTypeVector %1 2 -%40 = OpTypeVector %23 2 -%61 = OpTypeVoid -%69 = OpConstant %16 0 -%78 = OpConstant %16 1 -%82 = OpTypePointer Private %2 -%3 = OpTypePointer Input %2 -%7 = OpTypePointer UniformConstant %6 -%10 = OpTypePointer UniformConstant %9 -%13 = OpTypePointer Uniform %12 -%19 = OpTypePointer Uniform %18 -%83 = OpTypePointer Private %2 -%21 = OpTypePointer Output %2 -%28 = OpTypePointer Uniform %27 -%30 = OpTypePointer Function %2 -%70 = OpTypePointer Uniform %2 -%31 = OpTypeFunction %2 %30 -%47 = OpTypeFunction %2 %30 %30 -%62 = OpTypeFunction %61 -%4 = OpVariable %3 Input -%8 = OpVariable %7 UniformConstant -%11 = OpVariable %10 UniformConstant -%14 = OpVariable %13 Uniform -%20 = OpVariable %19 Uniform -%22 = OpVariable %21 Output -%29 = OpVariable %28 Uniform -%84 = OpConstant %23 0 -%85 = OpConstant %1 0.5 -%32 = OpFunction %2 None %31 -%33 = OpFunctionParameter %30 -%34 = OpLabel -%36 = OpLoad %6 %8 -%37 = OpLoad %2 %33 -%38 = OpVectorShuffle %35 %37 %37 0 1 -%39 = OpImageSampleImplicitLod %2 %36 %38 -%41 = OpLoad %2 %33 -%42 = OpVectorShuffle %35 %41 %41 2 3 -%43 = OpConvertFToS %40 %42 -%44 = OpLoad %9 %11 -%45 = OpImageRead %2 %44 %43 -%46 = OpFAdd %2 %39 %45 -OpReturnValue %46 -OpFunctionEnd -%48 = OpFunction %2 None %47 -%49 = OpFunctionParameter %30 -%50 = OpFunctionParameter %30 -%51 = OpLabel -%52 = OpLoad %2 %49 -%53 = OpVectorShuffle %35 %52 %52 0 1 -%54 = OpLoad %2 %50 -%55 = OpVectorShuffle %35 %54 %54 2 3 -%56 = OpCompositeExtract %1 %53 0 -%57 = OpCompositeExtract %1 %53 1 -%58 = OpCompositeExtract %1 %55 0 -%59 = OpCompositeExtract %1 %55 1 -%60 = OpCompositeConstruct %2 %56 %57 %58 %59 -OpReturnValue %60 -OpFunctionEnd -%63 = OpFunction %61 None %62 -%64 = OpLabel -%65 = OpVariable %30 Function -%68 = OpVariable %30 Function -%73 = OpVariable %30 Function -%66 = OpLoad %2 %4 -OpStore %65 %66 -%67 = OpFunctionCall %2 %32 %65 -%71 = OpAccessChain %70 %14 %69 -%72 = OpLoad %2 %71 -OpStore %68 %72 -%74 = OpAccessChain %70 %20 %69 %69 -%75 = OpLoad %2 %74 -OpStore %73 %75 -%76 = OpFunctionCall %2 %48 %68 %73 -%77 = OpFAdd %2 %67 %76 -%79 = OpAccessChain %70 %20 %78 %69 -%80 = OpLoad %2 %79 -%81 = OpFAdd %2 %77 %80 -OpStore %22 %81 -OpReturn -OpFunctionEnd diff --git a/test/diff/diff_files/different_decorations_fragment_src.spvasm b/test/diff/diff_files/different_decorations_fragment_src.spvasm deleted file mode 100644 index 2c8cd644..00000000 --- a/test/diff/diff_files/different_decorations_fragment_src.spvasm +++ /dev/null @@ -1,198 +0,0 @@ -;; Test where variable set/binding/location decorations are different between -;; src and dst fragment shaders. -OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %63 "main" %4 %22 -OpExecutionMode %63 OriginUpperLeft -OpSource GLSL 450 -OpName %4 "_ue" -OpName %8 "_uf" -OpName %11 "_ug" -OpName %12 "_uA" -OpMemberName %12 0 "_ux" -OpName %14 "_uc" -OpName %15 "_uB" -OpMemberName %15 0 "_ux" -OpName %20 "_ud" -OpName %22 "_ucol" -OpName %26 "ANGLEDepthRangeParams" -OpMemberName %26 0 "near" -OpMemberName %26 1 "far" -OpMemberName %26 2 "diff" -OpMemberName %26 3 "reserved" -OpName %27 "ANGLEUniformBlock" -OpMemberName %27 0 "viewport" -OpMemberName %27 1 "clipDistancesEnabled" -OpMemberName %27 2 "xfbActiveUnpaused" -OpMemberName %27 3 "xfbVerticesPerInstance" -OpMemberName %27 4 "numSamples" -OpMemberName %27 5 "xfbBufferOffsets" -OpMemberName %27 6 "acbBufferOffsets" -OpMemberName %27 7 "depthRange" -OpName %29 "ANGLEUniforms" -OpName %33 "_uc" -OpName %32 "_uh" -OpName %49 "_ux" -OpName %50 "_uy" -OpName %48 "_ui" -OpName %63 "main" -OpName %65 "param" -OpName %68 "param" -OpName %73 "param" -OpDecorate %4 Location 0 -OpDecorate %8 RelaxedPrecision -OpDecorate %8 DescriptorSet 0 -OpDecorate %8 Binding 0 -OpDecorate %11 DescriptorSet 0 -OpDecorate %11 Binding 1 -OpMemberDecorate %12 0 Offset 0 -OpMemberDecorate %12 0 RelaxedPrecision -OpDecorate %12 Block -OpDecorate %14 DescriptorSet 0 -OpDecorate %14 Binding 2 -OpMemberDecorate %15 0 Offset 0 -OpMemberDecorate %15 0 RelaxedPrecision -OpDecorate %15 BufferBlock -OpDecorate %20 DescriptorSet 0 -OpDecorate %20 Binding 3 -OpDecorate %22 RelaxedPrecision -OpDecorate %22 Location 0 -OpMemberDecorate %26 0 Offset 0 -OpMemberDecorate %26 1 Offset 4 -OpMemberDecorate %26 2 Offset 8 -OpMemberDecorate %26 3 Offset 12 -OpMemberDecorate %27 0 Offset 0 -OpMemberDecorate %27 1 Offset 16 -OpMemberDecorate %27 2 Offset 20 -OpMemberDecorate %27 3 Offset 24 -OpMemberDecorate %27 4 Offset 28 -OpMemberDecorate %27 5 Offset 32 -OpMemberDecorate %27 6 Offset 48 -OpMemberDecorate %27 7 Offset 64 -OpMemberDecorate %27 2 RelaxedPrecision -OpMemberDecorate %27 4 RelaxedPrecision -OpDecorate %27 Block -OpDecorate %29 DescriptorSet 0 -OpDecorate %29 Binding 4 -OpDecorate %32 RelaxedPrecision -OpDecorate %33 RelaxedPrecision -OpDecorate %36 RelaxedPrecision -OpDecorate %37 RelaxedPrecision -OpDecorate %38 RelaxedPrecision -OpDecorate %39 RelaxedPrecision -OpDecorate %41 RelaxedPrecision -OpDecorate %42 RelaxedPrecision -OpDecorate %43 RelaxedPrecision -OpDecorate %48 RelaxedPrecision -OpDecorate %49 RelaxedPrecision -OpDecorate %50 RelaxedPrecision -OpDecorate %52 RelaxedPrecision -OpDecorate %53 RelaxedPrecision -OpDecorate %54 RelaxedPrecision -OpDecorate %55 RelaxedPrecision -OpDecorate %56 RelaxedPrecision -OpDecorate %57 RelaxedPrecision -OpDecorate %58 RelaxedPrecision -OpDecorate %59 RelaxedPrecision -OpDecorate %60 RelaxedPrecision -OpDecorate %67 RelaxedPrecision -OpDecorate %68 RelaxedPrecision -OpDecorate %72 RelaxedPrecision -OpDecorate %73 RelaxedPrecision -OpDecorate %75 RelaxedPrecision -OpDecorate %76 RelaxedPrecision -OpDecorate %77 RelaxedPrecision -OpDecorate %80 RelaxedPrecision -OpDecorate %81 RelaxedPrecision -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%5 = OpTypeImage %1 2D 0 0 0 1 Unknown -%6 = OpTypeSampledImage %5 -%9 = OpTypeImage %1 2D 0 0 0 2 Rgba8 -%12 = OpTypeStruct %2 -%15 = OpTypeStruct %2 -%16 = OpTypeInt 32 0 -%17 = OpConstant %16 2 -%18 = OpTypeArray %15 %17 -%23 = OpTypeInt 32 1 -%24 = OpTypeVector %23 4 -%25 = OpTypeVector %16 4 -%26 = OpTypeStruct %1 %1 %1 %1 -%27 = OpTypeStruct %2 %16 %16 %23 %23 %24 %25 %26 -%35 = OpTypeVector %1 2 -%40 = OpTypeVector %23 2 -%61 = OpTypeVoid -%69 = OpConstant %16 0 -%78 = OpConstant %16 1 -%3 = OpTypePointer Input %2 -%7 = OpTypePointer UniformConstant %6 -%10 = OpTypePointer UniformConstant %9 -%13 = OpTypePointer Uniform %12 -%19 = OpTypePointer Uniform %18 -%21 = OpTypePointer Output %2 -%28 = OpTypePointer Uniform %27 -%30 = OpTypePointer Function %2 -%70 = OpTypePointer Uniform %2 -%31 = OpTypeFunction %2 %30 -%47 = OpTypeFunction %2 %30 %30 -%62 = OpTypeFunction %61 -%4 = OpVariable %3 Input -%8 = OpVariable %7 UniformConstant -%11 = OpVariable %10 UniformConstant -%14 = OpVariable %13 Uniform -%20 = OpVariable %19 Uniform -%22 = OpVariable %21 Output -%29 = OpVariable %28 Uniform -%32 = OpFunction %2 None %31 -%33 = OpFunctionParameter %30 -%34 = OpLabel -%36 = OpLoad %6 %8 -%37 = OpLoad %2 %33 -%38 = OpVectorShuffle %35 %37 %37 0 1 -%39 = OpImageSampleImplicitLod %2 %36 %38 -%41 = OpLoad %2 %33 -%42 = OpVectorShuffle %35 %41 %41 2 3 -%43 = OpConvertFToS %40 %42 -%44 = OpLoad %9 %11 -%45 = OpImageRead %2 %44 %43 -%46 = OpFAdd %2 %39 %45 -OpReturnValue %46 -OpFunctionEnd -%48 = OpFunction %2 None %47 -%49 = OpFunctionParameter %30 -%50 = OpFunctionParameter %30 -%51 = OpLabel -%52 = OpLoad %2 %49 -%53 = OpVectorShuffle %35 %52 %52 0 1 -%54 = OpLoad %2 %50 -%55 = OpVectorShuffle %35 %54 %54 2 3 -%56 = OpCompositeExtract %1 %53 0 -%57 = OpCompositeExtract %1 %53 1 -%58 = OpCompositeExtract %1 %55 0 -%59 = OpCompositeExtract %1 %55 1 -%60 = OpCompositeConstruct %2 %56 %57 %58 %59 -OpReturnValue %60 -OpFunctionEnd -%63 = OpFunction %61 None %62 -%64 = OpLabel -%65 = OpVariable %30 Function -%68 = OpVariable %30 Function -%73 = OpVariable %30 Function -%66 = OpLoad %2 %4 -OpStore %65 %66 -%67 = OpFunctionCall %2 %32 %65 -%71 = OpAccessChain %70 %14 %69 -%72 = OpLoad %2 %71 -OpStore %68 %72 -%74 = OpAccessChain %70 %20 %69 %69 -%75 = OpLoad %2 %74 -OpStore %73 %75 -%76 = OpFunctionCall %2 %48 %68 %73 -%77 = OpFAdd %2 %67 %76 -%79 = OpAccessChain %70 %20 %78 %69 -%80 = OpLoad %2 %79 -%81 = OpFAdd %2 %77 %80 -OpStore %22 %81 -OpReturn -OpFunctionEnd - diff --git a/test/diff/diff_files/different_decorations_vertex_autogen.cpp b/test/diff/diff_files/different_decorations_vertex_autogen.cpp deleted file mode 100644 index f65ee5a1..00000000 --- a/test/diff/diff_files/different_decorations_vertex_autogen.cpp +++ /dev/null @@ -1,1322 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_tests.py -// -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -// Test where variable set/binding/location decorations are different between -// src and dst vertex shaders. -constexpr char kSrc[] = R"(OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %40 "main" %4 %5 %6 %8 %20 %25 -OpSource GLSL 450 -OpName %4 "_ub" -OpName %5 "_uc" -OpName %6 "_ud" -OpName %8 "_ue" -OpName %9 "defaultUniformsVS" -OpMemberName %9 0 "_ua" -OpName %11 "" -OpName %16 "ANGLEDepthRangeParams" -OpMemberName %16 0 "near" -OpMemberName %16 1 "far" -OpMemberName %16 2 "diff" -OpMemberName %16 3 "reserved" -OpName %17 "ANGLEUniformBlock" -OpMemberName %17 0 "viewport" -OpMemberName %17 1 "clipDistancesEnabled" -OpMemberName %17 2 "xfbActiveUnpaused" -OpMemberName %17 3 "xfbVerticesPerInstance" -OpMemberName %17 4 "numSamples" -OpMemberName %17 5 "xfbBufferOffsets" -OpMemberName %17 6 "acbBufferOffsets" -OpMemberName %17 7 "depthRange" -OpName %19 "ANGLEUniforms" -OpName %20 "ANGLEXfbPosition" -OpName %23 "gl_PerVertex" -OpMemberName %23 0 "gl_Position" -OpMemberName %23 1 "gl_PointSize" -OpMemberName %23 2 "gl_ClipDistance" -OpMemberName %23 3 "gl_CullDistance" -OpName %25 "" -OpName %29 "_ua" -OpName %28 "_uf" -OpName %33 "_uf" -OpName %32 "_ug" -OpName %40 "main" -OpName %42 "param" -OpName %50 "param" -OpName %53 "param" -OpDecorate %4 Location 0 -OpDecorate %5 Location 1 -OpDecorate %6 Location 2 -OpDecorate %8 Location 0 -OpMemberDecorate %9 0 Offset 0 -OpDecorate %9 Block -OpDecorate %11 DescriptorSet 0 -OpDecorate %11 Binding 0 -OpMemberDecorate %16 0 Offset 0 -OpMemberDecorate %16 1 Offset 4 -OpMemberDecorate %16 2 Offset 8 -OpMemberDecorate %16 3 Offset 12 -OpMemberDecorate %17 0 Offset 0 -OpMemberDecorate %17 1 Offset 16 -OpMemberDecorate %17 2 Offset 20 -OpMemberDecorate %17 3 Offset 24 -OpMemberDecorate %17 4 Offset 28 -OpMemberDecorate %17 5 Offset 32 -OpMemberDecorate %17 6 Offset 48 -OpMemberDecorate %17 7 Offset 64 -OpMemberDecorate %17 2 RelaxedPrecision -OpMemberDecorate %17 4 RelaxedPrecision -OpDecorate %17 Block -OpDecorate %19 DescriptorSet 0 -OpDecorate %19 Binding 1 -OpDecorate %20 Location 1 -OpMemberDecorate %23 0 BuiltIn Position -OpMemberDecorate %23 1 BuiltIn PointSize -OpMemberDecorate %23 2 BuiltIn ClipDistance -OpMemberDecorate %23 3 BuiltIn CullDistance -OpDecorate %23 Block -OpDecorate %28 RelaxedPrecision -OpDecorate %29 RelaxedPrecision -OpDecorate %31 RelaxedPrecision -OpDecorate %32 RelaxedPrecision -OpDecorate %33 RelaxedPrecision -OpDecorate %35 RelaxedPrecision -OpDecorate %36 RelaxedPrecision -OpDecorate %37 RelaxedPrecision -OpDecorate %44 RelaxedPrecision -OpDecorate %52 RelaxedPrecision -OpDecorate %55 RelaxedPrecision -OpDecorate %56 RelaxedPrecision -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%9 = OpTypeStruct %2 -%12 = OpTypeInt 32 0 -%13 = OpTypeInt 32 1 -%14 = OpTypeVector %13 4 -%15 = OpTypeVector %12 4 -%16 = OpTypeStruct %1 %1 %1 %1 -%17 = OpTypeStruct %2 %12 %12 %13 %13 %14 %15 %16 -%21 = OpConstant %12 8 -%22 = OpTypeArray %1 %21 -%23 = OpTypeStruct %2 %1 %22 %22 -%38 = OpTypeVoid -%45 = OpConstant %12 0 -%3 = OpTypePointer Input %2 -%7 = OpTypePointer Output %2 -%10 = OpTypePointer Uniform %9 -%18 = OpTypePointer Uniform %17 -%24 = OpTypePointer Output %23 -%26 = OpTypePointer Function %2 -%46 = OpTypePointer Uniform %2 -%27 = OpTypeFunction %2 %26 -%39 = OpTypeFunction %38 -%4 = OpVariable %3 Input -%5 = OpVariable %3 Input -%6 = OpVariable %3 Input -%8 = OpVariable %7 Output -%11 = OpVariable %10 Uniform -%19 = OpVariable %18 Uniform -%20 = OpVariable %7 Output -%25 = OpVariable %24 Output -%28 = OpFunction %2 None %27 -%29 = OpFunctionParameter %26 -%30 = OpLabel -%31 = OpLoad %2 %29 -OpReturnValue %31 -OpFunctionEnd -%32 = OpFunction %2 None %27 -%33 = OpFunctionParameter %26 -%34 = OpLabel -%35 = OpLoad %2 %33 -%36 = OpLoad %2 %33 -%37 = OpFAdd %2 %35 %36 -OpReturnValue %37 -OpFunctionEnd -%40 = OpFunction %38 None %39 -%41 = OpLabel -%42 = OpVariable %26 Function -%50 = OpVariable %26 Function -%53 = OpVariable %26 Function -%43 = OpLoad %2 %4 -OpStore %42 %43 -%44 = OpFunctionCall %2 %28 %42 -%47 = OpAccessChain %46 %11 %45 -%48 = OpLoad %2 %47 -%49 = OpFAdd %2 %44 %48 -OpStore %8 %49 -%51 = OpLoad %2 %5 -OpStore %50 %51 -%52 = OpFunctionCall %2 %32 %50 -%54 = OpLoad %2 %6 -OpStore %53 %54 -%55 = OpFunctionCall %2 %28 %53 -%56 = OpFAdd %2 %52 %55 -%57 = OpAccessChain %7 %25 %45 -OpStore %57 %56 -OpReturn -OpFunctionEnd -)"; -constexpr char kDst[] = R"(OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %40 "main" %4 %5 %6 %8 %25 -OpSource GLSL 450 -OpName %4 "_ub" -OpName %5 "_uc" -OpName %6 "_ud" -OpName %8 "_ue" -OpName %9 "defaultUniformsVS" -OpMemberName %9 0 "_ua" -OpName %11 "" -OpName %16 "ANGLEDepthRangeParams" -OpMemberName %16 0 "near" -OpMemberName %16 1 "far" -OpMemberName %16 2 "diff" -OpMemberName %16 3 "reserved" -OpName %17 "ANGLEUniformBlock" -OpMemberName %17 0 "viewport" -OpMemberName %17 1 "clipDistancesEnabled" -OpMemberName %17 2 "xfbActiveUnpaused" -OpMemberName %17 3 "xfbVerticesPerInstance" -OpMemberName %17 4 "numSamples" -OpMemberName %17 5 "xfbBufferOffsets" -OpMemberName %17 6 "acbBufferOffsets" -OpMemberName %17 7 "depthRange" -OpName %19 "ANGLEUniforms" -OpName %23 "gl_PerVertex" -OpMemberName %23 0 "gl_Position" -OpName %25 "" -OpName %29 "_ua" -OpName %28 "_uf" -OpName %33 "_uf" -OpName %32 "_ug" -OpName %40 "main" -OpName %42 "param" -OpName %50 "param" -OpName %53 "param" -OpDecorate %4 Location 1 -OpDecorate %5 Location 2 -OpDecorate %6 Location 0 -OpDecorate %8 Location 1 -OpMemberDecorate %9 0 Offset 0 -OpDecorate %9 Block -OpDecorate %11 DescriptorSet 0 -OpDecorate %11 Binding 1 -OpMemberDecorate %16 0 Offset 0 -OpMemberDecorate %16 1 Offset 4 -OpMemberDecorate %16 2 Offset 8 -OpMemberDecorate %16 3 Offset 12 -OpMemberDecorate %17 0 Offset 0 -OpMemberDecorate %17 1 Offset 16 -OpMemberDecorate %17 2 Offset 20 -OpMemberDecorate %17 3 Offset 24 -OpMemberDecorate %17 4 Offset 28 -OpMemberDecorate %17 5 Offset 32 -OpMemberDecorate %17 6 Offset 48 -OpMemberDecorate %17 7 Offset 64 -OpMemberDecorate %17 2 RelaxedPrecision -OpMemberDecorate %17 4 RelaxedPrecision -OpDecorate %17 Block -OpDecorate %19 DescriptorSet 2 -OpDecorate %19 Binding 0 -OpMemberDecorate %23 0 BuiltIn Position -OpDecorate %23 Block -OpDecorate %28 RelaxedPrecision -OpDecorate %29 RelaxedPrecision -OpDecorate %31 RelaxedPrecision -OpDecorate %32 RelaxedPrecision -OpDecorate %33 RelaxedPrecision -OpDecorate %35 RelaxedPrecision -OpDecorate %36 RelaxedPrecision -OpDecorate %37 RelaxedPrecision -OpDecorate %44 RelaxedPrecision -OpDecorate %52 RelaxedPrecision -OpDecorate %55 RelaxedPrecision -OpDecorate %56 RelaxedPrecision -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%9 = OpTypeStruct %2 -%12 = OpTypeInt 32 0 -%13 = OpTypeInt 32 1 -%14 = OpTypeVector %13 4 -%15 = OpTypeVector %12 4 -%16 = OpTypeStruct %1 %1 %1 %1 -%17 = OpTypeStruct %2 %12 %12 %13 %13 %14 %15 %16 -%21 = OpConstant %12 8 -%22 = OpTypeArray %1 %21 -%23 = OpTypeStruct %2 -%38 = OpTypeVoid -%45 = OpConstant %12 0 -%58 = OpTypePointer Private %2 -%3 = OpTypePointer Input %2 -%59 = OpTypePointer Private %2 -%7 = OpTypePointer Output %2 -%10 = OpTypePointer Uniform %9 -%18 = OpTypePointer Uniform %17 -%24 = OpTypePointer Output %23 -%26 = OpTypePointer Function %2 -%46 = OpTypePointer Uniform %2 -%27 = OpTypeFunction %2 %26 -%39 = OpTypeFunction %38 -%4 = OpVariable %3 Input -%5 = OpVariable %3 Input -%6 = OpVariable %3 Input -%8 = OpVariable %7 Output -%11 = OpVariable %10 Uniform -%19 = OpVariable %18 Uniform -%20 = OpVariable %59 Private -%25 = OpVariable %24 Output -%60 = OpConstant %13 0 -%61 = OpConstant %1 0.5 -%28 = OpFunction %2 None %27 -%29 = OpFunctionParameter %26 -%30 = OpLabel -%31 = OpLoad %2 %29 -OpReturnValue %31 -OpFunctionEnd -%32 = OpFunction %2 None %27 -%33 = OpFunctionParameter %26 -%34 = OpLabel -%35 = OpLoad %2 %33 -%36 = OpLoad %2 %33 -%37 = OpFAdd %2 %35 %36 -OpReturnValue %37 -OpFunctionEnd -%40 = OpFunction %38 None %39 -%41 = OpLabel -%42 = OpVariable %26 Function -%50 = OpVariable %26 Function -%53 = OpVariable %26 Function -%43 = OpLoad %2 %4 -OpStore %42 %43 -%44 = OpFunctionCall %2 %28 %42 -%47 = OpAccessChain %46 %11 %45 -%48 = OpLoad %2 %47 -%49 = OpFAdd %2 %44 %48 -OpStore %8 %49 -%51 = OpLoad %2 %5 -OpStore %50 %51 -%52 = OpFunctionCall %2 %32 %50 -%54 = OpLoad %2 %6 -OpStore %53 %54 -%55 = OpFunctionCall %2 %28 %53 -%56 = OpFAdd %2 %52 %55 -%57 = OpAccessChain %7 %25 %45 -OpStore %57 %56 -%62 = OpAccessChain %7 %25 %60 -%63 = OpLoad %2 %62 -%64 = OpCompositeExtract %1 %63 0 -%65 = OpCompositeExtract %1 %63 1 -%66 = OpCompositeExtract %1 %63 2 -%67 = OpCompositeExtract %1 %63 3 -%69 = OpFNegate %1 %64 -%70 = OpFAdd %1 %66 %67 -%71 = OpFMul %1 %70 %61 -%68 = OpCompositeConstruct %2 %65 %69 %71 %67 -OpStore %62 %68 -OpReturn -OpFunctionEnd -)"; - -TEST(DiffTest, DifferentDecorationsVertex) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 58 -+; Bound: 73 - ; Schema: 0 - OpCapability Shader - OpMemoryModel Logical GLSL450 --OpEntryPoint Vertex %40 "main" %4 %5 %6 %8 %20 %25 -+OpEntryPoint Vertex %40 "main" %4 %5 %6 %8 %25 - OpSource GLSL 450 - OpName %4 "_ub" - OpName %5 "_uc" - OpName %6 "_ud" - OpName %8 "_ue" - OpName %9 "defaultUniformsVS" - OpMemberName %9 0 "_ua" - OpName %11 "" - OpName %16 "ANGLEDepthRangeParams" - OpMemberName %16 0 "near" - OpMemberName %16 1 "far" - OpMemberName %16 2 "diff" - OpMemberName %16 3 "reserved" - OpName %17 "ANGLEUniformBlock" - OpMemberName %17 0 "viewport" - OpMemberName %17 1 "clipDistancesEnabled" - OpMemberName %17 2 "xfbActiveUnpaused" - OpMemberName %17 3 "xfbVerticesPerInstance" - OpMemberName %17 4 "numSamples" - OpMemberName %17 5 "xfbBufferOffsets" - OpMemberName %17 6 "acbBufferOffsets" - OpMemberName %17 7 "depthRange" - OpName %19 "ANGLEUniforms" --OpName %20 "ANGLEXfbPosition" - OpName %23 "gl_PerVertex" - OpMemberName %23 0 "gl_Position" --OpMemberName %23 1 "gl_PointSize" --OpMemberName %23 2 "gl_ClipDistance" --OpMemberName %23 3 "gl_CullDistance" - OpName %25 "" - OpName %29 "_ua" - OpName %28 "_uf" - OpName %33 "_uf" - OpName %32 "_ug" - OpName %40 "main" - OpName %42 "param" - OpName %50 "param" - OpName %53 "param" --OpDecorate %4 Location 0 -+OpDecorate %4 Location 1 --OpDecorate %5 Location 1 -+OpDecorate %5 Location 2 --OpDecorate %6 Location 2 -+OpDecorate %6 Location 0 --OpDecorate %8 Location 0 -+OpDecorate %8 Location 1 - OpMemberDecorate %9 0 Offset 0 - OpDecorate %9 Block - OpDecorate %11 DescriptorSet 0 --OpDecorate %11 Binding 0 -+OpDecorate %11 Binding 1 - OpMemberDecorate %16 0 Offset 0 - OpMemberDecorate %16 1 Offset 4 - OpMemberDecorate %16 2 Offset 8 - OpMemberDecorate %16 3 Offset 12 - OpMemberDecorate %17 0 Offset 0 - OpMemberDecorate %17 1 Offset 16 - OpMemberDecorate %17 2 Offset 20 - OpMemberDecorate %17 3 Offset 24 - OpMemberDecorate %17 4 Offset 28 - OpMemberDecorate %17 5 Offset 32 - OpMemberDecorate %17 6 Offset 48 - OpMemberDecorate %17 7 Offset 64 - OpMemberDecorate %17 2 RelaxedPrecision - OpMemberDecorate %17 4 RelaxedPrecision - OpDecorate %17 Block --OpDecorate %19 DescriptorSet 0 -+OpDecorate %19 DescriptorSet 2 --OpDecorate %19 Binding 1 -+OpDecorate %19 Binding 0 --OpDecorate %20 Location 1 - OpMemberDecorate %23 0 BuiltIn Position --OpMemberDecorate %23 1 BuiltIn PointSize --OpMemberDecorate %23 2 BuiltIn ClipDistance --OpMemberDecorate %23 3 BuiltIn CullDistance - OpDecorate %23 Block - OpDecorate %28 RelaxedPrecision - OpDecorate %29 RelaxedPrecision - OpDecorate %31 RelaxedPrecision - OpDecorate %32 RelaxedPrecision - OpDecorate %33 RelaxedPrecision - OpDecorate %35 RelaxedPrecision - OpDecorate %36 RelaxedPrecision - OpDecorate %37 RelaxedPrecision - OpDecorate %44 RelaxedPrecision - OpDecorate %52 RelaxedPrecision - OpDecorate %55 RelaxedPrecision - OpDecorate %56 RelaxedPrecision - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 - %9 = OpTypeStruct %2 - %12 = OpTypeInt 32 0 - %13 = OpTypeInt 32 1 - %14 = OpTypeVector %13 4 - %15 = OpTypeVector %12 4 - %16 = OpTypeStruct %1 %1 %1 %1 - %17 = OpTypeStruct %2 %12 %12 %13 %13 %14 %15 %16 - %21 = OpConstant %12 8 - %22 = OpTypeArray %1 %21 --%23 = OpTypeStruct %2 %1 %22 %22 -+%23 = OpTypeStruct %2 - %38 = OpTypeVoid - %45 = OpConstant %12 0 -+%59 = OpTypePointer Private %2 - %3 = OpTypePointer Input %2 -+%60 = OpTypePointer Private %2 - %7 = OpTypePointer Output %2 - %10 = OpTypePointer Uniform %9 - %18 = OpTypePointer Uniform %17 - %24 = OpTypePointer Output %23 - %26 = OpTypePointer Function %2 - %46 = OpTypePointer Uniform %2 - %27 = OpTypeFunction %2 %26 - %39 = OpTypeFunction %38 - %4 = OpVariable %3 Input - %5 = OpVariable %3 Input - %6 = OpVariable %3 Input - %8 = OpVariable %7 Output - %11 = OpVariable %10 Uniform - %19 = OpVariable %18 Uniform --%20 = OpVariable %7 Output -+%58 = OpVariable %60 Private - %25 = OpVariable %24 Output -+%61 = OpConstant %13 0 -+%62 = OpConstant %1 0.5 - %28 = OpFunction %2 None %27 - %29 = OpFunctionParameter %26 - %30 = OpLabel - %31 = OpLoad %2 %29 - OpReturnValue %31 - OpFunctionEnd - %32 = OpFunction %2 None %27 - %33 = OpFunctionParameter %26 - %34 = OpLabel - %35 = OpLoad %2 %33 - %36 = OpLoad %2 %33 - %37 = OpFAdd %2 %35 %36 - OpReturnValue %37 - OpFunctionEnd - %40 = OpFunction %38 None %39 - %41 = OpLabel - %42 = OpVariable %26 Function - %50 = OpVariable %26 Function - %53 = OpVariable %26 Function - %43 = OpLoad %2 %4 - OpStore %42 %43 - %44 = OpFunctionCall %2 %28 %42 - %47 = OpAccessChain %46 %11 %45 - %48 = OpLoad %2 %47 - %49 = OpFAdd %2 %44 %48 - OpStore %8 %49 - %51 = OpLoad %2 %5 - OpStore %50 %51 - %52 = OpFunctionCall %2 %32 %50 - %54 = OpLoad %2 %6 - OpStore %53 %54 - %55 = OpFunctionCall %2 %28 %53 - %56 = OpFAdd %2 %52 %55 - %57 = OpAccessChain %7 %25 %45 - OpStore %57 %56 -+%63 = OpAccessChain %7 %25 %61 -+%64 = OpLoad %2 %63 -+%65 = OpCompositeExtract %1 %64 0 -+%66 = OpCompositeExtract %1 %64 1 -+%67 = OpCompositeExtract %1 %64 2 -+%68 = OpCompositeExtract %1 %64 3 -+%70 = OpFNegate %1 %65 -+%71 = OpFAdd %1 %67 %68 -+%72 = OpFMul %1 %71 %62 -+%69 = OpCompositeConstruct %2 %66 %70 %72 %68 -+OpStore %63 %69 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, DifferentDecorationsVertexNoDebug) { - constexpr char kSrcNoDebug[] = R"(OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %40 "main" %4 %5 %6 %8 %20 %25 -OpSource GLSL 450 -OpDecorate %4 Location 0 -OpDecorate %5 Location 1 -OpDecorate %6 Location 2 -OpDecorate %8 Location 0 -OpMemberDecorate %9 0 Offset 0 -OpDecorate %9 Block -OpDecorate %11 DescriptorSet 0 -OpDecorate %11 Binding 0 -OpMemberDecorate %16 0 Offset 0 -OpMemberDecorate %16 1 Offset 4 -OpMemberDecorate %16 2 Offset 8 -OpMemberDecorate %16 3 Offset 12 -OpMemberDecorate %17 0 Offset 0 -OpMemberDecorate %17 1 Offset 16 -OpMemberDecorate %17 2 Offset 20 -OpMemberDecorate %17 3 Offset 24 -OpMemberDecorate %17 4 Offset 28 -OpMemberDecorate %17 5 Offset 32 -OpMemberDecorate %17 6 Offset 48 -OpMemberDecorate %17 7 Offset 64 -OpMemberDecorate %17 2 RelaxedPrecision -OpMemberDecorate %17 4 RelaxedPrecision -OpDecorate %17 Block -OpDecorate %19 DescriptorSet 0 -OpDecorate %19 Binding 1 -OpDecorate %20 Location 1 -OpMemberDecorate %23 0 BuiltIn Position -OpMemberDecorate %23 1 BuiltIn PointSize -OpMemberDecorate %23 2 BuiltIn ClipDistance -OpMemberDecorate %23 3 BuiltIn CullDistance -OpDecorate %23 Block -OpDecorate %28 RelaxedPrecision -OpDecorate %29 RelaxedPrecision -OpDecorate %31 RelaxedPrecision -OpDecorate %32 RelaxedPrecision -OpDecorate %33 RelaxedPrecision -OpDecorate %35 RelaxedPrecision -OpDecorate %36 RelaxedPrecision -OpDecorate %37 RelaxedPrecision -OpDecorate %44 RelaxedPrecision -OpDecorate %52 RelaxedPrecision -OpDecorate %55 RelaxedPrecision -OpDecorate %56 RelaxedPrecision -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%9 = OpTypeStruct %2 -%12 = OpTypeInt 32 0 -%13 = OpTypeInt 32 1 -%14 = OpTypeVector %13 4 -%15 = OpTypeVector %12 4 -%16 = OpTypeStruct %1 %1 %1 %1 -%17 = OpTypeStruct %2 %12 %12 %13 %13 %14 %15 %16 -%21 = OpConstant %12 8 -%22 = OpTypeArray %1 %21 -%23 = OpTypeStruct %2 %1 %22 %22 -%38 = OpTypeVoid -%45 = OpConstant %12 0 -%3 = OpTypePointer Input %2 -%7 = OpTypePointer Output %2 -%10 = OpTypePointer Uniform %9 -%18 = OpTypePointer Uniform %17 -%24 = OpTypePointer Output %23 -%26 = OpTypePointer Function %2 -%46 = OpTypePointer Uniform %2 -%27 = OpTypeFunction %2 %26 -%39 = OpTypeFunction %38 -%4 = OpVariable %3 Input -%5 = OpVariable %3 Input -%6 = OpVariable %3 Input -%8 = OpVariable %7 Output -%11 = OpVariable %10 Uniform -%19 = OpVariable %18 Uniform -%20 = OpVariable %7 Output -%25 = OpVariable %24 Output -%28 = OpFunction %2 None %27 -%29 = OpFunctionParameter %26 -%30 = OpLabel -%31 = OpLoad %2 %29 -OpReturnValue %31 -OpFunctionEnd -%32 = OpFunction %2 None %27 -%33 = OpFunctionParameter %26 -%34 = OpLabel -%35 = OpLoad %2 %33 -%36 = OpLoad %2 %33 -%37 = OpFAdd %2 %35 %36 -OpReturnValue %37 -OpFunctionEnd -%40 = OpFunction %38 None %39 -%41 = OpLabel -%42 = OpVariable %26 Function -%50 = OpVariable %26 Function -%53 = OpVariable %26 Function -%43 = OpLoad %2 %4 -OpStore %42 %43 -%44 = OpFunctionCall %2 %28 %42 -%47 = OpAccessChain %46 %11 %45 -%48 = OpLoad %2 %47 -%49 = OpFAdd %2 %44 %48 -OpStore %8 %49 -%51 = OpLoad %2 %5 -OpStore %50 %51 -%52 = OpFunctionCall %2 %32 %50 -%54 = OpLoad %2 %6 -OpStore %53 %54 -%55 = OpFunctionCall %2 %28 %53 -%56 = OpFAdd %2 %52 %55 -%57 = OpAccessChain %7 %25 %45 -OpStore %57 %56 -OpReturn -OpFunctionEnd - -)"; - constexpr char kDstNoDebug[] = R"(OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %40 "main" %4 %5 %6 %8 %25 -OpSource GLSL 450 -OpDecorate %4 Location 1 -OpDecorate %5 Location 2 -OpDecorate %6 Location 0 -OpDecorate %8 Location 1 -OpMemberDecorate %9 0 Offset 0 -OpDecorate %9 Block -OpDecorate %11 DescriptorSet 0 -OpDecorate %11 Binding 1 -OpMemberDecorate %16 0 Offset 0 -OpMemberDecorate %16 1 Offset 4 -OpMemberDecorate %16 2 Offset 8 -OpMemberDecorate %16 3 Offset 12 -OpMemberDecorate %17 0 Offset 0 -OpMemberDecorate %17 1 Offset 16 -OpMemberDecorate %17 2 Offset 20 -OpMemberDecorate %17 3 Offset 24 -OpMemberDecorate %17 4 Offset 28 -OpMemberDecorate %17 5 Offset 32 -OpMemberDecorate %17 6 Offset 48 -OpMemberDecorate %17 7 Offset 64 -OpMemberDecorate %17 2 RelaxedPrecision -OpMemberDecorate %17 4 RelaxedPrecision -OpDecorate %17 Block -OpDecorate %19 DescriptorSet 2 -OpDecorate %19 Binding 0 -OpMemberDecorate %23 0 BuiltIn Position -OpDecorate %23 Block -OpDecorate %28 RelaxedPrecision -OpDecorate %29 RelaxedPrecision -OpDecorate %31 RelaxedPrecision -OpDecorate %32 RelaxedPrecision -OpDecorate %33 RelaxedPrecision -OpDecorate %35 RelaxedPrecision -OpDecorate %36 RelaxedPrecision -OpDecorate %37 RelaxedPrecision -OpDecorate %44 RelaxedPrecision -OpDecorate %52 RelaxedPrecision -OpDecorate %55 RelaxedPrecision -OpDecorate %56 RelaxedPrecision -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%9 = OpTypeStruct %2 -%12 = OpTypeInt 32 0 -%13 = OpTypeInt 32 1 -%14 = OpTypeVector %13 4 -%15 = OpTypeVector %12 4 -%16 = OpTypeStruct %1 %1 %1 %1 -%17 = OpTypeStruct %2 %12 %12 %13 %13 %14 %15 %16 -%21 = OpConstant %12 8 -%22 = OpTypeArray %1 %21 -%23 = OpTypeStruct %2 -%38 = OpTypeVoid -%45 = OpConstant %12 0 -%58 = OpTypePointer Private %2 -%3 = OpTypePointer Input %2 -%59 = OpTypePointer Private %2 -%7 = OpTypePointer Output %2 -%10 = OpTypePointer Uniform %9 -%18 = OpTypePointer Uniform %17 -%24 = OpTypePointer Output %23 -%26 = OpTypePointer Function %2 -%46 = OpTypePointer Uniform %2 -%27 = OpTypeFunction %2 %26 -%39 = OpTypeFunction %38 -%4 = OpVariable %3 Input -%5 = OpVariable %3 Input -%6 = OpVariable %3 Input -%8 = OpVariable %7 Output -%11 = OpVariable %10 Uniform -%19 = OpVariable %18 Uniform -%20 = OpVariable %59 Private -%25 = OpVariable %24 Output -%60 = OpConstant %13 0 -%61 = OpConstant %1 0.5 -%28 = OpFunction %2 None %27 -%29 = OpFunctionParameter %26 -%30 = OpLabel -%31 = OpLoad %2 %29 -OpReturnValue %31 -OpFunctionEnd -%32 = OpFunction %2 None %27 -%33 = OpFunctionParameter %26 -%34 = OpLabel -%35 = OpLoad %2 %33 -%36 = OpLoad %2 %33 -%37 = OpFAdd %2 %35 %36 -OpReturnValue %37 -OpFunctionEnd -%40 = OpFunction %38 None %39 -%41 = OpLabel -%42 = OpVariable %26 Function -%50 = OpVariable %26 Function -%53 = OpVariable %26 Function -%43 = OpLoad %2 %4 -OpStore %42 %43 -%44 = OpFunctionCall %2 %28 %42 -%47 = OpAccessChain %46 %11 %45 -%48 = OpLoad %2 %47 -%49 = OpFAdd %2 %44 %48 -OpStore %8 %49 -%51 = OpLoad %2 %5 -OpStore %50 %51 -%52 = OpFunctionCall %2 %32 %50 -%54 = OpLoad %2 %6 -OpStore %53 %54 -%55 = OpFunctionCall %2 %28 %53 -%56 = OpFAdd %2 %52 %55 -%57 = OpAccessChain %7 %25 %45 -OpStore %57 %56 -%62 = OpAccessChain %7 %25 %60 -%63 = OpLoad %2 %62 -%64 = OpCompositeExtract %1 %63 0 -%65 = OpCompositeExtract %1 %63 1 -%66 = OpCompositeExtract %1 %63 2 -%67 = OpCompositeExtract %1 %63 3 -%69 = OpFNegate %1 %64 -%70 = OpFAdd %1 %66 %67 -%71 = OpFMul %1 %70 %61 -%68 = OpCompositeConstruct %2 %65 %69 %71 %67 -OpStore %62 %68 -OpReturn -OpFunctionEnd -)"; - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 58 -+; Bound: 79 - ; Schema: 0 - OpCapability Shader - OpMemoryModel Logical GLSL450 --OpEntryPoint Vertex %40 "main" %4 %5 %6 %8 %20 %25 -+OpEntryPoint Vertex %40 "main" %5 %6 %4 %20 %25 - OpSource GLSL 450 - OpDecorate %4 Location 0 - OpDecorate %5 Location 1 - OpDecorate %6 Location 2 --OpDecorate %8 Location 0 - OpMemberDecorate %9 0 Offset 0 - OpDecorate %9 Block --OpDecorate %11 DescriptorSet 0 -+OpDecorate %11 DescriptorSet 2 - OpDecorate %11 Binding 0 - OpMemberDecorate %16 0 Offset 0 - OpMemberDecorate %16 1 Offset 4 - OpMemberDecorate %16 2 Offset 8 - OpMemberDecorate %16 3 Offset 12 - OpMemberDecorate %17 0 Offset 0 - OpMemberDecorate %17 1 Offset 16 - OpMemberDecorate %17 2 Offset 20 - OpMemberDecorate %17 3 Offset 24 - OpMemberDecorate %17 4 Offset 28 - OpMemberDecorate %17 5 Offset 32 - OpMemberDecorate %17 6 Offset 48 - OpMemberDecorate %17 7 Offset 64 - OpMemberDecorate %17 2 RelaxedPrecision - OpMemberDecorate %17 4 RelaxedPrecision - OpDecorate %17 Block - OpDecorate %19 DescriptorSet 0 - OpDecorate %19 Binding 1 - OpDecorate %20 Location 1 - OpMemberDecorate %23 0 BuiltIn Position --OpMemberDecorate %23 1 BuiltIn PointSize --OpMemberDecorate %23 2 BuiltIn ClipDistance --OpMemberDecorate %23 3 BuiltIn CullDistance - OpDecorate %23 Block - OpDecorate %28 RelaxedPrecision --OpDecorate %29 RelaxedPrecision -+OpDecorate %59 RelaxedPrecision - OpDecorate %31 RelaxedPrecision - OpDecorate %32 RelaxedPrecision --OpDecorate %33 RelaxedPrecision -+OpDecorate %60 RelaxedPrecision - OpDecorate %35 RelaxedPrecision - OpDecorate %36 RelaxedPrecision - OpDecorate %37 RelaxedPrecision - OpDecorate %44 RelaxedPrecision - OpDecorate %52 RelaxedPrecision - OpDecorate %55 RelaxedPrecision - OpDecorate %56 RelaxedPrecision - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 - %9 = OpTypeStruct %2 - %12 = OpTypeInt 32 0 - %13 = OpTypeInt 32 1 - %14 = OpTypeVector %13 4 - %15 = OpTypeVector %12 4 - %16 = OpTypeStruct %1 %1 %1 %1 - %17 = OpTypeStruct %2 %12 %12 %13 %13 %14 %15 %16 - %21 = OpConstant %12 8 - %22 = OpTypeArray %1 %21 --%23 = OpTypeStruct %2 %1 %22 %22 -+%23 = OpTypeStruct %2 - %38 = OpTypeVoid - %45 = OpConstant %12 0 -+%65 = OpTypePointer Private %2 - %3 = OpTypePointer Input %2 -+%66 = OpTypePointer Private %2 - %7 = OpTypePointer Output %2 - %10 = OpTypePointer Uniform %9 - %18 = OpTypePointer Uniform %17 - %24 = OpTypePointer Output %23 - %26 = OpTypePointer Function %2 - %46 = OpTypePointer Uniform %2 - %27 = OpTypeFunction %2 %26 - %39 = OpTypeFunction %38 - %4 = OpVariable %3 Input - %5 = OpVariable %3 Input - %6 = OpVariable %3 Input --%8 = OpVariable %7 Output --%11 = OpVariable %10 Uniform -+%11 = OpVariable %18 Uniform --%19 = OpVariable %18 Uniform -+%19 = OpVariable %10 Uniform - %20 = OpVariable %7 Output -+%58 = OpVariable %66 Private - %25 = OpVariable %24 Output -+%67 = OpConstant %13 0 -+%68 = OpConstant %1 0.5 - %28 = OpFunction %2 None %27 --%29 = OpFunctionParameter %26 -+%59 = OpFunctionParameter %26 - %30 = OpLabel --%31 = OpLoad %2 %29 -+%31 = OpLoad %2 %59 - OpReturnValue %31 - OpFunctionEnd - %32 = OpFunction %2 None %27 --%33 = OpFunctionParameter %26 -+%60 = OpFunctionParameter %26 - %34 = OpLabel --%35 = OpLoad %2 %33 -+%35 = OpLoad %2 %60 --%36 = OpLoad %2 %33 -+%36 = OpLoad %2 %60 - %37 = OpFAdd %2 %35 %36 - OpReturnValue %37 - OpFunctionEnd - %40 = OpFunction %38 None %39 - %41 = OpLabel - %42 = OpVariable %26 Function - %50 = OpVariable %26 Function - %53 = OpVariable %26 Function --%43 = OpLoad %2 %4 -+%61 = OpLoad %2 %5 --OpStore %42 %43 -+OpStore %42 %61 - %44 = OpFunctionCall %2 %28 %42 --%47 = OpAccessChain %46 %11 %45 -+%62 = OpAccessChain %46 %19 %45 --%48 = OpLoad %2 %47 -+%48 = OpLoad %2 %62 - %49 = OpFAdd %2 %44 %48 --OpStore %8 %49 -+OpStore %20 %49 --%51 = OpLoad %2 %5 -+%63 = OpLoad %2 %6 --OpStore %50 %51 -+OpStore %50 %63 - %52 = OpFunctionCall %2 %32 %50 --%54 = OpLoad %2 %6 -+%64 = OpLoad %2 %4 --OpStore %53 %54 -+OpStore %53 %64 - %55 = OpFunctionCall %2 %28 %53 - %56 = OpFAdd %2 %52 %55 - %57 = OpAccessChain %7 %25 %45 - OpStore %57 %56 -+%69 = OpAccessChain %7 %25 %67 -+%70 = OpLoad %2 %69 -+%71 = OpCompositeExtract %1 %70 0 -+%72 = OpCompositeExtract %1 %70 1 -+%73 = OpCompositeExtract %1 %70 2 -+%74 = OpCompositeExtract %1 %70 3 -+%76 = OpFNegate %1 %71 -+%77 = OpFAdd %1 %73 %74 -+%78 = OpFMul %1 %77 %68 -+%75 = OpCompositeConstruct %2 %72 %76 %78 %74 -+OpStore %69 %75 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -} - -TEST(DiffTest, DifferentDecorationsVertexIgnoreSetBinding) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 58 -+; Bound: 73 - ; Schema: 0 - OpCapability Shader - OpMemoryModel Logical GLSL450 --OpEntryPoint Vertex %40 "main" %4 %5 %6 %8 %20 %25 -+OpEntryPoint Vertex %40 "main" %4 %5 %6 %8 %25 - OpSource GLSL 450 - OpName %4 "_ub" - OpName %5 "_uc" - OpName %6 "_ud" - OpName %8 "_ue" - OpName %9 "defaultUniformsVS" - OpMemberName %9 0 "_ua" - OpName %11 "" - OpName %16 "ANGLEDepthRangeParams" - OpMemberName %16 0 "near" - OpMemberName %16 1 "far" - OpMemberName %16 2 "diff" - OpMemberName %16 3 "reserved" - OpName %17 "ANGLEUniformBlock" - OpMemberName %17 0 "viewport" - OpMemberName %17 1 "clipDistancesEnabled" - OpMemberName %17 2 "xfbActiveUnpaused" - OpMemberName %17 3 "xfbVerticesPerInstance" - OpMemberName %17 4 "numSamples" - OpMemberName %17 5 "xfbBufferOffsets" - OpMemberName %17 6 "acbBufferOffsets" - OpMemberName %17 7 "depthRange" - OpName %19 "ANGLEUniforms" --OpName %20 "ANGLEXfbPosition" - OpName %23 "gl_PerVertex" - OpMemberName %23 0 "gl_Position" --OpMemberName %23 1 "gl_PointSize" --OpMemberName %23 2 "gl_ClipDistance" --OpMemberName %23 3 "gl_CullDistance" - OpName %25 "" - OpName %29 "_ua" - OpName %28 "_uf" - OpName %33 "_uf" - OpName %32 "_ug" - OpName %40 "main" - OpName %42 "param" - OpName %50 "param" - OpName %53 "param" --OpDecorate %4 Location 0 -+OpDecorate %4 Location 1 --OpDecorate %5 Location 1 -+OpDecorate %5 Location 2 --OpDecorate %6 Location 2 -+OpDecorate %6 Location 0 --OpDecorate %8 Location 0 -+OpDecorate %8 Location 1 - OpMemberDecorate %9 0 Offset 0 - OpDecorate %9 Block - OpDecorate %11 DescriptorSet 0 --OpDecorate %11 Binding 0 -+OpDecorate %11 Binding 1 - OpMemberDecorate %16 0 Offset 0 - OpMemberDecorate %16 1 Offset 4 - OpMemberDecorate %16 2 Offset 8 - OpMemberDecorate %16 3 Offset 12 - OpMemberDecorate %17 0 Offset 0 - OpMemberDecorate %17 1 Offset 16 - OpMemberDecorate %17 2 Offset 20 - OpMemberDecorate %17 3 Offset 24 - OpMemberDecorate %17 4 Offset 28 - OpMemberDecorate %17 5 Offset 32 - OpMemberDecorate %17 6 Offset 48 - OpMemberDecorate %17 7 Offset 64 - OpMemberDecorate %17 2 RelaxedPrecision - OpMemberDecorate %17 4 RelaxedPrecision - OpDecorate %17 Block --OpDecorate %19 DescriptorSet 0 -+OpDecorate %19 DescriptorSet 2 --OpDecorate %19 Binding 1 -+OpDecorate %19 Binding 0 --OpDecorate %20 Location 1 - OpMemberDecorate %23 0 BuiltIn Position --OpMemberDecorate %23 1 BuiltIn PointSize --OpMemberDecorate %23 2 BuiltIn ClipDistance --OpMemberDecorate %23 3 BuiltIn CullDistance - OpDecorate %23 Block - OpDecorate %28 RelaxedPrecision - OpDecorate %29 RelaxedPrecision - OpDecorate %31 RelaxedPrecision - OpDecorate %32 RelaxedPrecision - OpDecorate %33 RelaxedPrecision - OpDecorate %35 RelaxedPrecision - OpDecorate %36 RelaxedPrecision - OpDecorate %37 RelaxedPrecision - OpDecorate %44 RelaxedPrecision - OpDecorate %52 RelaxedPrecision - OpDecorate %55 RelaxedPrecision - OpDecorate %56 RelaxedPrecision - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 - %9 = OpTypeStruct %2 - %12 = OpTypeInt 32 0 - %13 = OpTypeInt 32 1 - %14 = OpTypeVector %13 4 - %15 = OpTypeVector %12 4 - %16 = OpTypeStruct %1 %1 %1 %1 - %17 = OpTypeStruct %2 %12 %12 %13 %13 %14 %15 %16 - %21 = OpConstant %12 8 - %22 = OpTypeArray %1 %21 --%23 = OpTypeStruct %2 %1 %22 %22 -+%23 = OpTypeStruct %2 - %38 = OpTypeVoid - %45 = OpConstant %12 0 -+%59 = OpTypePointer Private %2 - %3 = OpTypePointer Input %2 -+%60 = OpTypePointer Private %2 - %7 = OpTypePointer Output %2 - %10 = OpTypePointer Uniform %9 - %18 = OpTypePointer Uniform %17 - %24 = OpTypePointer Output %23 - %26 = OpTypePointer Function %2 - %46 = OpTypePointer Uniform %2 - %27 = OpTypeFunction %2 %26 - %39 = OpTypeFunction %38 - %4 = OpVariable %3 Input - %5 = OpVariable %3 Input - %6 = OpVariable %3 Input - %8 = OpVariable %7 Output - %11 = OpVariable %10 Uniform - %19 = OpVariable %18 Uniform --%20 = OpVariable %7 Output -+%58 = OpVariable %60 Private - %25 = OpVariable %24 Output -+%61 = OpConstant %13 0 -+%62 = OpConstant %1 0.5 - %28 = OpFunction %2 None %27 - %29 = OpFunctionParameter %26 - %30 = OpLabel - %31 = OpLoad %2 %29 - OpReturnValue %31 - OpFunctionEnd - %32 = OpFunction %2 None %27 - %33 = OpFunctionParameter %26 - %34 = OpLabel - %35 = OpLoad %2 %33 - %36 = OpLoad %2 %33 - %37 = OpFAdd %2 %35 %36 - OpReturnValue %37 - OpFunctionEnd - %40 = OpFunction %38 None %39 - %41 = OpLabel - %42 = OpVariable %26 Function - %50 = OpVariable %26 Function - %53 = OpVariable %26 Function - %43 = OpLoad %2 %4 - OpStore %42 %43 - %44 = OpFunctionCall %2 %28 %42 - %47 = OpAccessChain %46 %11 %45 - %48 = OpLoad %2 %47 - %49 = OpFAdd %2 %44 %48 - OpStore %8 %49 - %51 = OpLoad %2 %5 - OpStore %50 %51 - %52 = OpFunctionCall %2 %32 %50 - %54 = OpLoad %2 %6 - OpStore %53 %54 - %55 = OpFunctionCall %2 %28 %53 - %56 = OpFAdd %2 %52 %55 - %57 = OpAccessChain %7 %25 %45 - OpStore %57 %56 -+%63 = OpAccessChain %7 %25 %61 -+%64 = OpLoad %2 %63 -+%65 = OpCompositeExtract %1 %64 0 -+%66 = OpCompositeExtract %1 %64 1 -+%67 = OpCompositeExtract %1 %64 2 -+%68 = OpCompositeExtract %1 %64 3 -+%70 = OpFNegate %1 %65 -+%71 = OpFAdd %1 %67 %68 -+%72 = OpFMul %1 %71 %62 -+%69 = OpCompositeConstruct %2 %66 %70 %72 %68 -+OpStore %63 %69 - OpReturn - OpFunctionEnd -)"; - Options options; - options.ignore_set_binding = true; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, DifferentDecorationsVertexIgnoreSetBindingLocation) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 58 -+; Bound: 73 - ; Schema: 0 - OpCapability Shader - OpMemoryModel Logical GLSL450 --OpEntryPoint Vertex %40 "main" %4 %5 %6 %8 %20 %25 -+OpEntryPoint Vertex %40 "main" %4 %5 %6 %8 %25 - OpSource GLSL 450 - OpName %4 "_ub" - OpName %5 "_uc" - OpName %6 "_ud" - OpName %8 "_ue" - OpName %9 "defaultUniformsVS" - OpMemberName %9 0 "_ua" - OpName %11 "" - OpName %16 "ANGLEDepthRangeParams" - OpMemberName %16 0 "near" - OpMemberName %16 1 "far" - OpMemberName %16 2 "diff" - OpMemberName %16 3 "reserved" - OpName %17 "ANGLEUniformBlock" - OpMemberName %17 0 "viewport" - OpMemberName %17 1 "clipDistancesEnabled" - OpMemberName %17 2 "xfbActiveUnpaused" - OpMemberName %17 3 "xfbVerticesPerInstance" - OpMemberName %17 4 "numSamples" - OpMemberName %17 5 "xfbBufferOffsets" - OpMemberName %17 6 "acbBufferOffsets" - OpMemberName %17 7 "depthRange" - OpName %19 "ANGLEUniforms" --OpName %20 "ANGLEXfbPosition" - OpName %23 "gl_PerVertex" - OpMemberName %23 0 "gl_Position" --OpMemberName %23 1 "gl_PointSize" --OpMemberName %23 2 "gl_ClipDistance" --OpMemberName %23 3 "gl_CullDistance" - OpName %25 "" - OpName %29 "_ua" - OpName %28 "_uf" - OpName %33 "_uf" - OpName %32 "_ug" - OpName %40 "main" - OpName %42 "param" - OpName %50 "param" - OpName %53 "param" --OpDecorate %4 Location 0 -+OpDecorate %4 Location 1 --OpDecorate %5 Location 1 -+OpDecorate %5 Location 2 --OpDecorate %6 Location 2 -+OpDecorate %6 Location 0 --OpDecorate %8 Location 0 -+OpDecorate %8 Location 1 - OpMemberDecorate %9 0 Offset 0 - OpDecorate %9 Block - OpDecorate %11 DescriptorSet 0 --OpDecorate %11 Binding 0 -+OpDecorate %11 Binding 1 - OpMemberDecorate %16 0 Offset 0 - OpMemberDecorate %16 1 Offset 4 - OpMemberDecorate %16 2 Offset 8 - OpMemberDecorate %16 3 Offset 12 - OpMemberDecorate %17 0 Offset 0 - OpMemberDecorate %17 1 Offset 16 - OpMemberDecorate %17 2 Offset 20 - OpMemberDecorate %17 3 Offset 24 - OpMemberDecorate %17 4 Offset 28 - OpMemberDecorate %17 5 Offset 32 - OpMemberDecorate %17 6 Offset 48 - OpMemberDecorate %17 7 Offset 64 - OpMemberDecorate %17 2 RelaxedPrecision - OpMemberDecorate %17 4 RelaxedPrecision - OpDecorate %17 Block --OpDecorate %19 DescriptorSet 0 -+OpDecorate %19 DescriptorSet 2 --OpDecorate %19 Binding 1 -+OpDecorate %19 Binding 0 --OpDecorate %20 Location 1 - OpMemberDecorate %23 0 BuiltIn Position --OpMemberDecorate %23 1 BuiltIn PointSize --OpMemberDecorate %23 2 BuiltIn ClipDistance --OpMemberDecorate %23 3 BuiltIn CullDistance - OpDecorate %23 Block - OpDecorate %28 RelaxedPrecision - OpDecorate %29 RelaxedPrecision - OpDecorate %31 RelaxedPrecision - OpDecorate %32 RelaxedPrecision - OpDecorate %33 RelaxedPrecision - OpDecorate %35 RelaxedPrecision - OpDecorate %36 RelaxedPrecision - OpDecorate %37 RelaxedPrecision - OpDecorate %44 RelaxedPrecision - OpDecorate %52 RelaxedPrecision - OpDecorate %55 RelaxedPrecision - OpDecorate %56 RelaxedPrecision - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 - %9 = OpTypeStruct %2 - %12 = OpTypeInt 32 0 - %13 = OpTypeInt 32 1 - %14 = OpTypeVector %13 4 - %15 = OpTypeVector %12 4 - %16 = OpTypeStruct %1 %1 %1 %1 - %17 = OpTypeStruct %2 %12 %12 %13 %13 %14 %15 %16 - %21 = OpConstant %12 8 - %22 = OpTypeArray %1 %21 --%23 = OpTypeStruct %2 %1 %22 %22 -+%23 = OpTypeStruct %2 - %38 = OpTypeVoid - %45 = OpConstant %12 0 -+%59 = OpTypePointer Private %2 - %3 = OpTypePointer Input %2 -+%60 = OpTypePointer Private %2 - %7 = OpTypePointer Output %2 - %10 = OpTypePointer Uniform %9 - %18 = OpTypePointer Uniform %17 - %24 = OpTypePointer Output %23 - %26 = OpTypePointer Function %2 - %46 = OpTypePointer Uniform %2 - %27 = OpTypeFunction %2 %26 - %39 = OpTypeFunction %38 - %4 = OpVariable %3 Input - %5 = OpVariable %3 Input - %6 = OpVariable %3 Input - %8 = OpVariable %7 Output - %11 = OpVariable %10 Uniform - %19 = OpVariable %18 Uniform --%20 = OpVariable %7 Output -+%58 = OpVariable %60 Private - %25 = OpVariable %24 Output -+%61 = OpConstant %13 0 -+%62 = OpConstant %1 0.5 - %28 = OpFunction %2 None %27 - %29 = OpFunctionParameter %26 - %30 = OpLabel - %31 = OpLoad %2 %29 - OpReturnValue %31 - OpFunctionEnd - %32 = OpFunction %2 None %27 - %33 = OpFunctionParameter %26 - %34 = OpLabel - %35 = OpLoad %2 %33 - %36 = OpLoad %2 %33 - %37 = OpFAdd %2 %35 %36 - OpReturnValue %37 - OpFunctionEnd - %40 = OpFunction %38 None %39 - %41 = OpLabel - %42 = OpVariable %26 Function - %50 = OpVariable %26 Function - %53 = OpVariable %26 Function - %43 = OpLoad %2 %4 - OpStore %42 %43 - %44 = OpFunctionCall %2 %28 %42 - %47 = OpAccessChain %46 %11 %45 - %48 = OpLoad %2 %47 - %49 = OpFAdd %2 %44 %48 - OpStore %8 %49 - %51 = OpLoad %2 %5 - OpStore %50 %51 - %52 = OpFunctionCall %2 %32 %50 - %54 = OpLoad %2 %6 - OpStore %53 %54 - %55 = OpFunctionCall %2 %28 %53 - %56 = OpFAdd %2 %52 %55 - %57 = OpAccessChain %7 %25 %45 - OpStore %57 %56 -+%63 = OpAccessChain %7 %25 %61 -+%64 = OpLoad %2 %63 -+%65 = OpCompositeExtract %1 %64 0 -+%66 = OpCompositeExtract %1 %64 1 -+%67 = OpCompositeExtract %1 %64 2 -+%68 = OpCompositeExtract %1 %64 3 -+%70 = OpFNegate %1 %65 -+%71 = OpFAdd %1 %67 %68 -+%72 = OpFMul %1 %71 %62 -+%69 = OpCompositeConstruct %2 %66 %70 %72 %68 -+OpStore %63 %69 - OpReturn - OpFunctionEnd -)"; - Options options; - options.ignore_set_binding = true; - options.ignore_location = true; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_files/different_decorations_vertex_dst.spvasm b/test/diff/diff_files/different_decorations_vertex_dst.spvasm deleted file mode 100644 index 33c6a9c1..00000000 --- a/test/diff/diff_files/different_decorations_vertex_dst.spvasm +++ /dev/null @@ -1,159 +0,0 @@ -OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %40 "main" %4 %5 %6 %8 %25 -OpSource GLSL 450 -OpName %4 "_ub" -OpName %5 "_uc" -OpName %6 "_ud" -OpName %8 "_ue" -OpName %9 "defaultUniformsVS" -OpMemberName %9 0 "_ua" -OpName %11 "" -OpName %16 "ANGLEDepthRangeParams" -OpMemberName %16 0 "near" -OpMemberName %16 1 "far" -OpMemberName %16 2 "diff" -OpMemberName %16 3 "reserved" -OpName %17 "ANGLEUniformBlock" -OpMemberName %17 0 "viewport" -OpMemberName %17 1 "clipDistancesEnabled" -OpMemberName %17 2 "xfbActiveUnpaused" -OpMemberName %17 3 "xfbVerticesPerInstance" -OpMemberName %17 4 "numSamples" -OpMemberName %17 5 "xfbBufferOffsets" -OpMemberName %17 6 "acbBufferOffsets" -OpMemberName %17 7 "depthRange" -OpName %19 "ANGLEUniforms" -OpName %23 "gl_PerVertex" -OpMemberName %23 0 "gl_Position" -OpName %25 "" -OpName %29 "_ua" -OpName %28 "_uf" -OpName %33 "_uf" -OpName %32 "_ug" -OpName %40 "main" -OpName %42 "param" -OpName %50 "param" -OpName %53 "param" -OpDecorate %4 Location 1 -OpDecorate %5 Location 2 -OpDecorate %6 Location 0 -OpDecorate %8 Location 1 -OpMemberDecorate %9 0 Offset 0 -OpDecorate %9 Block -OpDecorate %11 DescriptorSet 0 -OpDecorate %11 Binding 1 -OpMemberDecorate %16 0 Offset 0 -OpMemberDecorate %16 1 Offset 4 -OpMemberDecorate %16 2 Offset 8 -OpMemberDecorate %16 3 Offset 12 -OpMemberDecorate %17 0 Offset 0 -OpMemberDecorate %17 1 Offset 16 -OpMemberDecorate %17 2 Offset 20 -OpMemberDecorate %17 3 Offset 24 -OpMemberDecorate %17 4 Offset 28 -OpMemberDecorate %17 5 Offset 32 -OpMemberDecorate %17 6 Offset 48 -OpMemberDecorate %17 7 Offset 64 -OpMemberDecorate %17 2 RelaxedPrecision -OpMemberDecorate %17 4 RelaxedPrecision -OpDecorate %17 Block -OpDecorate %19 DescriptorSet 2 -OpDecorate %19 Binding 0 -OpMemberDecorate %23 0 BuiltIn Position -OpDecorate %23 Block -OpDecorate %28 RelaxedPrecision -OpDecorate %29 RelaxedPrecision -OpDecorate %31 RelaxedPrecision -OpDecorate %32 RelaxedPrecision -OpDecorate %33 RelaxedPrecision -OpDecorate %35 RelaxedPrecision -OpDecorate %36 RelaxedPrecision -OpDecorate %37 RelaxedPrecision -OpDecorate %44 RelaxedPrecision -OpDecorate %52 RelaxedPrecision -OpDecorate %55 RelaxedPrecision -OpDecorate %56 RelaxedPrecision -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%9 = OpTypeStruct %2 -%12 = OpTypeInt 32 0 -%13 = OpTypeInt 32 1 -%14 = OpTypeVector %13 4 -%15 = OpTypeVector %12 4 -%16 = OpTypeStruct %1 %1 %1 %1 -%17 = OpTypeStruct %2 %12 %12 %13 %13 %14 %15 %16 -%21 = OpConstant %12 8 -%22 = OpTypeArray %1 %21 -%23 = OpTypeStruct %2 -%38 = OpTypeVoid -%45 = OpConstant %12 0 -%58 = OpTypePointer Private %2 -%3 = OpTypePointer Input %2 -%59 = OpTypePointer Private %2 -%7 = OpTypePointer Output %2 -%10 = OpTypePointer Uniform %9 -%18 = OpTypePointer Uniform %17 -%24 = OpTypePointer Output %23 -%26 = OpTypePointer Function %2 -%46 = OpTypePointer Uniform %2 -%27 = OpTypeFunction %2 %26 -%39 = OpTypeFunction %38 -%4 = OpVariable %3 Input -%5 = OpVariable %3 Input -%6 = OpVariable %3 Input -%8 = OpVariable %7 Output -%11 = OpVariable %10 Uniform -%19 = OpVariable %18 Uniform -%20 = OpVariable %59 Private -%25 = OpVariable %24 Output -%60 = OpConstant %13 0 -%61 = OpConstant %1 0.5 -%28 = OpFunction %2 None %27 -%29 = OpFunctionParameter %26 -%30 = OpLabel -%31 = OpLoad %2 %29 -OpReturnValue %31 -OpFunctionEnd -%32 = OpFunction %2 None %27 -%33 = OpFunctionParameter %26 -%34 = OpLabel -%35 = OpLoad %2 %33 -%36 = OpLoad %2 %33 -%37 = OpFAdd %2 %35 %36 -OpReturnValue %37 -OpFunctionEnd -%40 = OpFunction %38 None %39 -%41 = OpLabel -%42 = OpVariable %26 Function -%50 = OpVariable %26 Function -%53 = OpVariable %26 Function -%43 = OpLoad %2 %4 -OpStore %42 %43 -%44 = OpFunctionCall %2 %28 %42 -%47 = OpAccessChain %46 %11 %45 -%48 = OpLoad %2 %47 -%49 = OpFAdd %2 %44 %48 -OpStore %8 %49 -%51 = OpLoad %2 %5 -OpStore %50 %51 -%52 = OpFunctionCall %2 %32 %50 -%54 = OpLoad %2 %6 -OpStore %53 %54 -%55 = OpFunctionCall %2 %28 %53 -%56 = OpFAdd %2 %52 %55 -%57 = OpAccessChain %7 %25 %45 -OpStore %57 %56 -%62 = OpAccessChain %7 %25 %60 -%63 = OpLoad %2 %62 -%64 = OpCompositeExtract %1 %63 0 -%65 = OpCompositeExtract %1 %63 1 -%66 = OpCompositeExtract %1 %63 2 -%67 = OpCompositeExtract %1 %63 3 -%69 = OpFNegate %1 %64 -%70 = OpFAdd %1 %66 %67 -%71 = OpFMul %1 %70 %61 -%68 = OpCompositeConstruct %2 %65 %69 %71 %67 -OpStore %62 %68 -OpReturn -OpFunctionEnd diff --git a/test/diff/diff_files/different_decorations_vertex_src.spvasm b/test/diff/diff_files/different_decorations_vertex_src.spvasm deleted file mode 100644 index ce1680cb..00000000 --- a/test/diff/diff_files/different_decorations_vertex_src.spvasm +++ /dev/null @@ -1,155 +0,0 @@ -;; Test where variable set/binding/location decorations are different between -;; src and dst vertex shaders. -OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %40 "main" %4 %5 %6 %8 %20 %25 -OpSource GLSL 450 -OpName %4 "_ub" -OpName %5 "_uc" -OpName %6 "_ud" -OpName %8 "_ue" -OpName %9 "defaultUniformsVS" -OpMemberName %9 0 "_ua" -OpName %11 "" -OpName %16 "ANGLEDepthRangeParams" -OpMemberName %16 0 "near" -OpMemberName %16 1 "far" -OpMemberName %16 2 "diff" -OpMemberName %16 3 "reserved" -OpName %17 "ANGLEUniformBlock" -OpMemberName %17 0 "viewport" -OpMemberName %17 1 "clipDistancesEnabled" -OpMemberName %17 2 "xfbActiveUnpaused" -OpMemberName %17 3 "xfbVerticesPerInstance" -OpMemberName %17 4 "numSamples" -OpMemberName %17 5 "xfbBufferOffsets" -OpMemberName %17 6 "acbBufferOffsets" -OpMemberName %17 7 "depthRange" -OpName %19 "ANGLEUniforms" -OpName %20 "ANGLEXfbPosition" -OpName %23 "gl_PerVertex" -OpMemberName %23 0 "gl_Position" -OpMemberName %23 1 "gl_PointSize" -OpMemberName %23 2 "gl_ClipDistance" -OpMemberName %23 3 "gl_CullDistance" -OpName %25 "" -OpName %29 "_ua" -OpName %28 "_uf" -OpName %33 "_uf" -OpName %32 "_ug" -OpName %40 "main" -OpName %42 "param" -OpName %50 "param" -OpName %53 "param" -OpDecorate %4 Location 0 -OpDecorate %5 Location 1 -OpDecorate %6 Location 2 -OpDecorate %8 Location 0 -OpMemberDecorate %9 0 Offset 0 -OpDecorate %9 Block -OpDecorate %11 DescriptorSet 0 -OpDecorate %11 Binding 0 -OpMemberDecorate %16 0 Offset 0 -OpMemberDecorate %16 1 Offset 4 -OpMemberDecorate %16 2 Offset 8 -OpMemberDecorate %16 3 Offset 12 -OpMemberDecorate %17 0 Offset 0 -OpMemberDecorate %17 1 Offset 16 -OpMemberDecorate %17 2 Offset 20 -OpMemberDecorate %17 3 Offset 24 -OpMemberDecorate %17 4 Offset 28 -OpMemberDecorate %17 5 Offset 32 -OpMemberDecorate %17 6 Offset 48 -OpMemberDecorate %17 7 Offset 64 -OpMemberDecorate %17 2 RelaxedPrecision -OpMemberDecorate %17 4 RelaxedPrecision -OpDecorate %17 Block -OpDecorate %19 DescriptorSet 0 -OpDecorate %19 Binding 1 -OpDecorate %20 Location 1 -OpMemberDecorate %23 0 BuiltIn Position -OpMemberDecorate %23 1 BuiltIn PointSize -OpMemberDecorate %23 2 BuiltIn ClipDistance -OpMemberDecorate %23 3 BuiltIn CullDistance -OpDecorate %23 Block -OpDecorate %28 RelaxedPrecision -OpDecorate %29 RelaxedPrecision -OpDecorate %31 RelaxedPrecision -OpDecorate %32 RelaxedPrecision -OpDecorate %33 RelaxedPrecision -OpDecorate %35 RelaxedPrecision -OpDecorate %36 RelaxedPrecision -OpDecorate %37 RelaxedPrecision -OpDecorate %44 RelaxedPrecision -OpDecorate %52 RelaxedPrecision -OpDecorate %55 RelaxedPrecision -OpDecorate %56 RelaxedPrecision -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%9 = OpTypeStruct %2 -%12 = OpTypeInt 32 0 -%13 = OpTypeInt 32 1 -%14 = OpTypeVector %13 4 -%15 = OpTypeVector %12 4 -%16 = OpTypeStruct %1 %1 %1 %1 -%17 = OpTypeStruct %2 %12 %12 %13 %13 %14 %15 %16 -%21 = OpConstant %12 8 -%22 = OpTypeArray %1 %21 -%23 = OpTypeStruct %2 %1 %22 %22 -%38 = OpTypeVoid -%45 = OpConstant %12 0 -%3 = OpTypePointer Input %2 -%7 = OpTypePointer Output %2 -%10 = OpTypePointer Uniform %9 -%18 = OpTypePointer Uniform %17 -%24 = OpTypePointer Output %23 -%26 = OpTypePointer Function %2 -%46 = OpTypePointer Uniform %2 -%27 = OpTypeFunction %2 %26 -%39 = OpTypeFunction %38 -%4 = OpVariable %3 Input -%5 = OpVariable %3 Input -%6 = OpVariable %3 Input -%8 = OpVariable %7 Output -%11 = OpVariable %10 Uniform -%19 = OpVariable %18 Uniform -%20 = OpVariable %7 Output -%25 = OpVariable %24 Output -%28 = OpFunction %2 None %27 -%29 = OpFunctionParameter %26 -%30 = OpLabel -%31 = OpLoad %2 %29 -OpReturnValue %31 -OpFunctionEnd -%32 = OpFunction %2 None %27 -%33 = OpFunctionParameter %26 -%34 = OpLabel -%35 = OpLoad %2 %33 -%36 = OpLoad %2 %33 -%37 = OpFAdd %2 %35 %36 -OpReturnValue %37 -OpFunctionEnd -%40 = OpFunction %38 None %39 -%41 = OpLabel -%42 = OpVariable %26 Function -%50 = OpVariable %26 Function -%53 = OpVariable %26 Function -%43 = OpLoad %2 %4 -OpStore %42 %43 -%44 = OpFunctionCall %2 %28 %42 -%47 = OpAccessChain %46 %11 %45 -%48 = OpLoad %2 %47 -%49 = OpFAdd %2 %44 %48 -OpStore %8 %49 -%51 = OpLoad %2 %5 -OpStore %50 %51 -%52 = OpFunctionCall %2 %32 %50 -%54 = OpLoad %2 %6 -OpStore %53 %54 -%55 = OpFunctionCall %2 %28 %53 -%56 = OpFAdd %2 %52 %55 -%57 = OpAccessChain %7 %25 %45 -OpStore %57 %56 -OpReturn -OpFunctionEnd - diff --git a/test/diff/diff_files/different_function_parameter_count_autogen.cpp b/test/diff/diff_files/different_function_parameter_count_autogen.cpp deleted file mode 100644 index 3a077fb0..00000000 --- a/test/diff/diff_files/different_function_parameter_count_autogen.cpp +++ /dev/null @@ -1,339 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_tests.py -// -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -// Test where src and dst have a function with different parameter count. -constexpr char kSrc[] = R"(; SPIR-V -; Version: 1.0 -; Generator: Khronos Glslang Reference Front End; 10 -; Bound: 25 -; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %20 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 320 - OpName %4 "main" - OpName %11 "f(vf2;" - OpName %10 "v" - OpName %20 "o" - OpName %23 "param" - OpDecorate %20 RelaxedPrecision - OpDecorate %20 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 2 - %8 = OpTypePointer Function %7 - %9 = OpTypeFunction %7 %8 - %14 = OpConstant %6 0.5 - %15 = OpConstantComposite %7 %14 %14 - %19 = OpTypePointer Output %7 - %20 = OpVariable %19 Output - %21 = OpConstant %6 0 - %22 = OpConstantComposite %7 %21 %21 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %23 = OpVariable %8 Function - OpStore %23 %22 - %24 = OpFunctionCall %7 %11 %23 - OpStore %20 %24 - OpReturn - OpFunctionEnd - %11 = OpFunction %7 None %9 - %10 = OpFunctionParameter %8 - %12 = OpLabel - %13 = OpLoad %7 %10 - %16 = OpFAdd %7 %13 %15 - OpReturnValue %16 - OpFunctionEnd)"; -constexpr char kDst[] = R"(; SPIR-V -; Version: 1.0 -; Generator: Khronos Glslang Reference Front End; 10 -; Bound: 28 -; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %20 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 320 - OpName %4 "main" - OpName %12 "f(vf2;vf2;" - OpName %10 "v" - OpName %11 "v2" - OpName %20 "o" - OpName %25 "param" - OpName %26 "param" - OpDecorate %20 RelaxedPrecision - OpDecorate %20 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 2 - %8 = OpTypePointer Function %7 - %9 = OpTypeFunction %7 %8 %8 - %19 = OpTypePointer Output %7 - %20 = OpVariable %19 Output - %21 = OpConstant %6 0 - %22 = OpConstantComposite %7 %21 %21 - %23 = OpConstant %6 0.5 - %24 = OpConstantComposite %7 %23 %23 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %25 = OpVariable %8 Function - %26 = OpVariable %8 Function - OpStore %25 %22 - OpStore %26 %24 - %27 = OpFunctionCall %7 %12 %25 %26 - OpStore %20 %27 - OpReturn - OpFunctionEnd - %12 = OpFunction %7 None %9 - %10 = OpFunctionParameter %8 - %11 = OpFunctionParameter %8 - %13 = OpLabel - %14 = OpLoad %7 %10 - %15 = OpLoad %7 %11 - %16 = OpFAdd %7 %14 %15 - OpReturnValue %16 - OpFunctionEnd - -)"; - -TEST(DiffTest, DifferentFunctionParameterCount) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 25 -+; Bound: 33 - ; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %20 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 320 - OpName %4 "main" --OpName %11 "f(vf2;" -+OpName %11 "f(vf2;vf2;" - OpName %10 "v" -+OpName %26 "v2" - OpName %20 "o" - OpName %23 "param" -+OpName %31 "param" - OpDecorate %20 RelaxedPrecision - OpDecorate %20 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 2 - %8 = OpTypePointer Function %7 --%9 = OpTypeFunction %7 %8 -+%25 = OpTypeFunction %7 %8 %8 - %14 = OpConstant %6 0.5 - %15 = OpConstantComposite %7 %14 %14 - %19 = OpTypePointer Output %7 - %20 = OpVariable %19 Output - %21 = OpConstant %6 0 - %22 = OpConstantComposite %7 %21 %21 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %23 = OpVariable %8 Function -+%31 = OpVariable %8 Function - OpStore %23 %22 --%24 = OpFunctionCall %7 %11 %23 -+OpStore %31 %15 -+%32 = OpFunctionCall %7 %11 %23 %31 --OpStore %20 %24 -+OpStore %20 %32 - OpReturn - OpFunctionEnd --%11 = OpFunction %7 None %9 -+%11 = OpFunction %7 None %25 - %10 = OpFunctionParameter %8 -+%26 = OpFunctionParameter %8 - %12 = OpLabel - %13 = OpLoad %7 %10 --%16 = OpFAdd %7 %13 %15 -+%27 = OpLoad %7 %26 -+%28 = OpFAdd %7 %13 %27 --OpReturnValue %16 -+OpReturnValue %28 - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, DifferentFunctionParameterCountNoDebug) { - constexpr char kSrcNoDebug[] = R"(; SPIR-V -; Version: 1.0 -; Generator: Khronos Glslang Reference Front End; 10 -; Bound: 25 -; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %20 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 320 - OpDecorate %20 RelaxedPrecision - OpDecorate %20 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 2 - %8 = OpTypePointer Function %7 - %9 = OpTypeFunction %7 %8 - %14 = OpConstant %6 0.5 - %15 = OpConstantComposite %7 %14 %14 - %19 = OpTypePointer Output %7 - %20 = OpVariable %19 Output - %21 = OpConstant %6 0 - %22 = OpConstantComposite %7 %21 %21 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %23 = OpVariable %8 Function - OpStore %23 %22 - %24 = OpFunctionCall %7 %11 %23 - OpStore %20 %24 - OpReturn - OpFunctionEnd - %11 = OpFunction %7 None %9 - %10 = OpFunctionParameter %8 - %12 = OpLabel - %13 = OpLoad %7 %10 - %16 = OpFAdd %7 %13 %15 - OpReturnValue %16 - OpFunctionEnd -)"; - constexpr char kDstNoDebug[] = R"(; SPIR-V -; Version: 1.0 -; Generator: Khronos Glslang Reference Front End; 10 -; Bound: 28 -; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %20 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 320 - OpDecorate %20 RelaxedPrecision - OpDecorate %20 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 2 - %8 = OpTypePointer Function %7 - %9 = OpTypeFunction %7 %8 %8 - %19 = OpTypePointer Output %7 - %20 = OpVariable %19 Output - %21 = OpConstant %6 0 - %22 = OpConstantComposite %7 %21 %21 - %23 = OpConstant %6 0.5 - %24 = OpConstantComposite %7 %23 %23 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %25 = OpVariable %8 Function - %26 = OpVariable %8 Function - OpStore %25 %22 - OpStore %26 %24 - %27 = OpFunctionCall %7 %12 %25 %26 - OpStore %20 %27 - OpReturn - OpFunctionEnd - %12 = OpFunction %7 None %9 - %10 = OpFunctionParameter %8 - %11 = OpFunctionParameter %8 - %13 = OpLabel - %14 = OpLoad %7 %10 - %15 = OpLoad %7 %11 - %16 = OpFAdd %7 %14 %15 - OpReturnValue %16 - OpFunctionEnd - -)"; - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 25 -+; Bound: 34 - ; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %20 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 320 - OpDecorate %20 RelaxedPrecision - OpDecorate %20 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 2 - %8 = OpTypePointer Function %7 --%9 = OpTypeFunction %7 %8 -+%25 = OpTypeFunction %7 %8 %8 - %14 = OpConstant %6 0.5 - %15 = OpConstantComposite %7 %14 %14 - %19 = OpTypePointer Output %7 - %20 = OpVariable %19 Output - %21 = OpConstant %6 0 - %22 = OpConstantComposite %7 %21 %21 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %23 = OpVariable %8 Function -+%32 = OpVariable %8 Function - OpStore %23 %22 --%24 = OpFunctionCall %7 %11 %23 -+OpStore %32 %15 -+%33 = OpFunctionCall %7 %11 %23 %32 --OpStore %20 %24 -+OpStore %20 %33 - OpReturn - OpFunctionEnd --%11 = OpFunction %7 None %9 -+%11 = OpFunction %7 None %25 --%10 = OpFunctionParameter %8 -+%26 = OpFunctionParameter %8 -+%27 = OpFunctionParameter %8 - %12 = OpLabel --%13 = OpLoad %7 %10 -+%13 = OpLoad %7 %26 --%16 = OpFAdd %7 %13 %15 -+%28 = OpLoad %7 %27 -+%29 = OpFAdd %7 %13 %28 --OpReturnValue %16 -+OpReturnValue %29 - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_files/different_function_parameter_count_dst.spvasm b/test/diff/diff_files/different_function_parameter_count_dst.spvasm deleted file mode 100644 index 92442601..00000000 --- a/test/diff/diff_files/different_function_parameter_count_dst.spvasm +++ /dev/null @@ -1,52 +0,0 @@ -; SPIR-V -; Version: 1.0 -; Generator: Khronos Glslang Reference Front End; 10 -; Bound: 28 -; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %20 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 320 - OpName %4 "main" - OpName %12 "f(vf2;vf2;" - OpName %10 "v" - OpName %11 "v2" - OpName %20 "o" - OpName %25 "param" - OpName %26 "param" - OpDecorate %20 RelaxedPrecision - OpDecorate %20 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 2 - %8 = OpTypePointer Function %7 - %9 = OpTypeFunction %7 %8 %8 - %19 = OpTypePointer Output %7 - %20 = OpVariable %19 Output - %21 = OpConstant %6 0 - %22 = OpConstantComposite %7 %21 %21 - %23 = OpConstant %6 0.5 - %24 = OpConstantComposite %7 %23 %23 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %25 = OpVariable %8 Function - %26 = OpVariable %8 Function - OpStore %25 %22 - OpStore %26 %24 - %27 = OpFunctionCall %7 %12 %25 %26 - OpStore %20 %27 - OpReturn - OpFunctionEnd - %12 = OpFunction %7 None %9 - %10 = OpFunctionParameter %8 - %11 = OpFunctionParameter %8 - %13 = OpLabel - %14 = OpLoad %7 %10 - %15 = OpLoad %7 %11 - %16 = OpFAdd %7 %14 %15 - OpReturnValue %16 - OpFunctionEnd - diff --git a/test/diff/diff_files/different_function_parameter_count_src.spvasm b/test/diff/diff_files/different_function_parameter_count_src.spvasm deleted file mode 100644 index 6ee2408a..00000000 --- a/test/diff/diff_files/different_function_parameter_count_src.spvasm +++ /dev/null @@ -1,46 +0,0 @@ -;; Test where src and dst have a function with different parameter count. -; SPIR-V -; Version: 1.0 -; Generator: Khronos Glslang Reference Front End; 10 -; Bound: 25 -; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %20 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 320 - OpName %4 "main" - OpName %11 "f(vf2;" - OpName %10 "v" - OpName %20 "o" - OpName %23 "param" - OpDecorate %20 RelaxedPrecision - OpDecorate %20 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 2 - %8 = OpTypePointer Function %7 - %9 = OpTypeFunction %7 %8 - %14 = OpConstant %6 0.5 - %15 = OpConstantComposite %7 %14 %14 - %19 = OpTypePointer Output %7 - %20 = OpVariable %19 Output - %21 = OpConstant %6 0 - %22 = OpConstantComposite %7 %21 %21 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %23 = OpVariable %8 Function - OpStore %23 %22 - %24 = OpFunctionCall %7 %11 %23 - OpStore %20 %24 - OpReturn - OpFunctionEnd - %11 = OpFunction %7 None %9 - %10 = OpFunctionParameter %8 - %12 = OpLabel - %13 = OpLoad %7 %10 - %16 = OpFAdd %7 %13 %15 - OpReturnValue %16 - OpFunctionEnd diff --git a/test/diff/diff_files/extra_if_block_autogen.cpp b/test/diff/diff_files/extra_if_block_autogen.cpp deleted file mode 100644 index 4f913198..00000000 --- a/test/diff/diff_files/extra_if_block_autogen.cpp +++ /dev/null @@ -1,867 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_tests.py -// -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -// Test where src has an extra if block in one function, and dst has an extra -// if block in another function. -constexpr char kSrc[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %63 %68 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %8 "f1(" - OpName %10 "f2(" - OpName %13 "v" - OpName %16 "Buffer" - OpMemberName %16 0 "flag1" - OpMemberName %16 1 "flag2" - OpName %18 "" - OpName %45 "v" - OpName %63 "color" - OpName %68 "v" - OpDecorate %8 RelaxedPrecision - OpDecorate %10 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - OpMemberDecorate %16 0 RelaxedPrecision - OpMemberDecorate %16 0 Offset 0 - OpMemberDecorate %16 1 RelaxedPrecision - OpMemberDecorate %16 1 Offset 4 - OpDecorate %16 Block - OpDecorate %18 DescriptorSet 0 - OpDecorate %18 Binding 0 - OpDecorate %23 RelaxedPrecision - OpDecorate %30 RelaxedPrecision - OpDecorate %31 RelaxedPrecision - OpDecorate %34 RelaxedPrecision - OpDecorate %35 RelaxedPrecision - OpDecorate %36 RelaxedPrecision - OpDecorate %37 RelaxedPrecision - OpDecorate %38 RelaxedPrecision - OpDecorate %39 RelaxedPrecision - OpDecorate %40 RelaxedPrecision - OpDecorate %41 RelaxedPrecision - OpDecorate %42 RelaxedPrecision - OpDecorate %45 RelaxedPrecision - OpDecorate %47 RelaxedPrecision - OpDecorate %48 RelaxedPrecision - OpDecorate %50 RelaxedPrecision - OpDecorate %51 RelaxedPrecision - OpDecorate %54 RelaxedPrecision - OpDecorate %55 RelaxedPrecision - OpDecorate %56 RelaxedPrecision - OpDecorate %57 RelaxedPrecision - OpDecorate %58 RelaxedPrecision - OpDecorate %63 RelaxedPrecision - OpDecorate %63 Location 0 - OpDecorate %64 RelaxedPrecision - OpDecorate %65 RelaxedPrecision - OpDecorate %66 RelaxedPrecision - OpDecorate %68 RelaxedPrecision - OpDecorate %68 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeFunction %6 - %12 = OpTypePointer Function %6 - %14 = OpConstant %6 0 - %15 = OpTypeInt 32 0 - %16 = OpTypeStruct %15 %15 - %17 = OpTypePointer Uniform %16 - %18 = OpVariable %17 Uniform - %19 = OpTypeInt 32 1 - %20 = OpConstant %19 0 - %21 = OpTypePointer Uniform %15 - %24 = OpConstant %15 0 - %25 = OpTypeBool - %29 = OpConstant %6 1 - %32 = OpConstant %19 1 - %49 = OpConstant %6 10 - %52 = OpConstant %6 0.5 - %53 = OpConstant %6 0.699999988 - %61 = OpTypeVector %6 4 - %62 = OpTypePointer Output %61 - %63 = OpVariable %62 Output - %67 = OpTypePointer Input %6 - %68 = OpVariable %67 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %64 = OpFunctionCall %6 %8 - %65 = OpFunctionCall %6 %10 - %66 = OpCompositeConstruct %61 %64 %65 %14 %29 - OpStore %63 %66 - OpReturn - OpFunctionEnd - %8 = OpFunction %6 None %7 - %9 = OpLabel - %13 = OpVariable %12 Function - OpStore %13 %14 - %22 = OpAccessChain %21 %18 %20 - %23 = OpLoad %15 %22 - %26 = OpINotEqual %25 %23 %24 - OpSelectionMerge %28 None - OpBranchConditional %26 %27 %28 - %27 = OpLabel - %30 = OpLoad %6 %13 - %31 = OpFAdd %6 %30 %29 - OpStore %13 %31 - OpBranch %28 - %28 = OpLabel - %33 = OpAccessChain %21 %18 %32 - %34 = OpLoad %15 %33 - %35 = OpConvertUToF %6 %34 - %36 = OpExtInst %6 %1 Log2 %35 - %37 = OpLoad %6 %13 - %38 = OpFAdd %6 %37 %36 - OpStore %13 %38 - %39 = OpLoad %6 %13 - %40 = OpLoad %6 %13 - %41 = OpExtInst %6 %1 Sqrt %40 - %42 = OpFSub %6 %39 %41 - OpReturnValue %42 - OpFunctionEnd - %10 = OpFunction %6 None %7 - %11 = OpLabel - %45 = OpVariable %12 Function - %46 = OpAccessChain %21 %18 %20 - %47 = OpLoad %15 %46 - %48 = OpConvertUToF %6 %47 - %50 = OpFDiv %6 %48 %49 - OpStore %45 %50 - %51 = OpLoad %6 %45 - %54 = OpExtInst %6 %1 FClamp %51 %52 %53 - %55 = OpLoad %6 %45 - %56 = OpFMul %6 %55 %54 - OpStore %45 %56 - %57 = OpLoad %6 %45 - %58 = OpExtInst %6 %1 Exp %57 - OpReturnValue %58 - OpFunctionEnd -)"; -constexpr char kDst[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %63 %69 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %8 "f1(" - OpName %10 "f2(" - OpName %13 "v" - OpName %16 "Buffer" - OpMemberName %16 0 "flag1" - OpMemberName %16 1 "flag2" - OpName %18 "" - OpName %34 "v" - OpName %63 "color" - OpName %69 "v" - OpDecorate %8 RelaxedPrecision - OpDecorate %10 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - OpMemberDecorate %16 0 RelaxedPrecision - OpMemberDecorate %16 0 Offset 0 - OpMemberDecorate %16 1 RelaxedPrecision - OpMemberDecorate %16 1 Offset 4 - OpDecorate %16 Block - OpDecorate %18 DescriptorSet 0 - OpDecorate %18 Binding 0 - OpDecorate %23 RelaxedPrecision - OpDecorate %24 RelaxedPrecision - OpDecorate %25 RelaxedPrecision - OpDecorate %26 RelaxedPrecision - OpDecorate %27 RelaxedPrecision - OpDecorate %28 RelaxedPrecision - OpDecorate %29 RelaxedPrecision - OpDecorate %30 RelaxedPrecision - OpDecorate %31 RelaxedPrecision - OpDecorate %34 RelaxedPrecision - OpDecorate %37 RelaxedPrecision - OpDecorate %38 RelaxedPrecision - OpDecorate %40 RelaxedPrecision - OpDecorate %41 RelaxedPrecision - OpDecorate %44 RelaxedPrecision - OpDecorate %45 RelaxedPrecision - OpDecorate %46 RelaxedPrecision - OpDecorate %48 RelaxedPrecision - OpDecorate %55 RelaxedPrecision - OpDecorate %56 RelaxedPrecision - OpDecorate %57 RelaxedPrecision - OpDecorate %58 RelaxedPrecision - OpDecorate %63 RelaxedPrecision - OpDecorate %63 Location 0 - OpDecorate %64 RelaxedPrecision - OpDecorate %65 RelaxedPrecision - OpDecorate %67 RelaxedPrecision - OpDecorate %69 RelaxedPrecision - OpDecorate %69 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeFunction %6 - %12 = OpTypePointer Function %6 - %14 = OpConstant %6 0 - %15 = OpTypeInt 32 0 - %16 = OpTypeStruct %15 %15 - %17 = OpTypePointer Uniform %16 - %18 = OpVariable %17 Uniform - %19 = OpTypeInt 32 1 - %20 = OpConstant %19 1 - %21 = OpTypePointer Uniform %15 - %35 = OpConstant %19 0 - %39 = OpConstant %6 10 - %42 = OpConstant %6 0.5 - %43 = OpConstant %6 0.699999988 - %49 = OpConstant %15 0 - %50 = OpTypeBool - %54 = OpConstant %6 0.100000001 - %61 = OpTypeVector %6 4 - %62 = OpTypePointer Output %61 - %63 = OpVariable %62 Output - %66 = OpConstant %6 1 - %68 = OpTypePointer Input %6 - %69 = OpVariable %68 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %64 = OpFunctionCall %6 %8 - %65 = OpFunctionCall %6 %10 - %67 = OpCompositeConstruct %61 %64 %65 %14 %66 - OpStore %63 %67 - OpReturn - OpFunctionEnd - %8 = OpFunction %6 None %7 - %9 = OpLabel - %13 = OpVariable %12 Function - OpStore %13 %14 - %22 = OpAccessChain %21 %18 %20 - %23 = OpLoad %15 %22 - %24 = OpConvertUToF %6 %23 - %25 = OpExtInst %6 %1 Log2 %24 - %26 = OpLoad %6 %13 - %27 = OpFAdd %6 %26 %25 - OpStore %13 %27 - %28 = OpLoad %6 %13 - %29 = OpLoad %6 %13 - %30 = OpExtInst %6 %1 Sqrt %29 - %31 = OpFSub %6 %28 %30 - OpReturnValue %31 - OpFunctionEnd - %10 = OpFunction %6 None %7 - %11 = OpLabel - %34 = OpVariable %12 Function - %36 = OpAccessChain %21 %18 %35 - %37 = OpLoad %15 %36 - %38 = OpConvertUToF %6 %37 - %40 = OpFDiv %6 %38 %39 - OpStore %34 %40 - %41 = OpLoad %6 %34 - %44 = OpExtInst %6 %1 FClamp %41 %42 %43 - %45 = OpLoad %6 %34 - %46 = OpFMul %6 %45 %44 - OpStore %34 %46 - %47 = OpAccessChain %21 %18 %20 - %48 = OpLoad %15 %47 - %51 = OpINotEqual %50 %48 %49 - OpSelectionMerge %53 None - OpBranchConditional %51 %52 %53 - %52 = OpLabel - %55 = OpLoad %6 %34 - %56 = OpFSub %6 %55 %54 - OpStore %34 %56 - OpBranch %53 - %53 = OpLabel - %57 = OpLoad %6 %34 - %58 = OpExtInst %6 %1 Exp %57 - OpReturnValue %58 - OpFunctionEnd - -)"; - -TEST(DiffTest, ExtraIfBlock) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 69 -+; Bound: 81 - ; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %63 %68 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %8 "f1(" - OpName %10 "f2(" - OpName %13 "v" - OpName %16 "Buffer" - OpMemberName %16 0 "flag1" - OpMemberName %16 1 "flag2" - OpName %18 "" - OpName %45 "v" - OpName %63 "color" - OpName %68 "v" - OpDecorate %8 RelaxedPrecision - OpDecorate %10 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - OpMemberDecorate %16 0 RelaxedPrecision - OpMemberDecorate %16 0 Offset 0 - OpMemberDecorate %16 1 RelaxedPrecision - OpMemberDecorate %16 1 Offset 4 - OpDecorate %16 Block - OpDecorate %18 DescriptorSet 0 - OpDecorate %18 Binding 0 --OpDecorate %23 RelaxedPrecision --OpDecorate %30 RelaxedPrecision --OpDecorate %31 RelaxedPrecision - OpDecorate %34 RelaxedPrecision - OpDecorate %35 RelaxedPrecision - OpDecorate %36 RelaxedPrecision - OpDecorate %37 RelaxedPrecision - OpDecorate %38 RelaxedPrecision - OpDecorate %39 RelaxedPrecision - OpDecorate %40 RelaxedPrecision - OpDecorate %41 RelaxedPrecision - OpDecorate %42 RelaxedPrecision - OpDecorate %45 RelaxedPrecision - OpDecorate %47 RelaxedPrecision - OpDecorate %48 RelaxedPrecision - OpDecorate %50 RelaxedPrecision - OpDecorate %51 RelaxedPrecision - OpDecorate %54 RelaxedPrecision - OpDecorate %55 RelaxedPrecision - OpDecorate %56 RelaxedPrecision -+OpDecorate %72 RelaxedPrecision - OpDecorate %57 RelaxedPrecision -+OpDecorate %77 RelaxedPrecision -+OpDecorate %78 RelaxedPrecision - OpDecorate %58 RelaxedPrecision - OpDecorate %63 RelaxedPrecision - OpDecorate %63 Location 0 - OpDecorate %64 RelaxedPrecision - OpDecorate %65 RelaxedPrecision - OpDecorate %66 RelaxedPrecision - OpDecorate %68 RelaxedPrecision - OpDecorate %68 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeFunction %6 - %12 = OpTypePointer Function %6 - %14 = OpConstant %6 0 - %15 = OpTypeInt 32 0 - %16 = OpTypeStruct %15 %15 - %17 = OpTypePointer Uniform %16 - %18 = OpVariable %17 Uniform - %19 = OpTypeInt 32 1 - %20 = OpConstant %19 0 - %21 = OpTypePointer Uniform %15 - %24 = OpConstant %15 0 - %25 = OpTypeBool - %29 = OpConstant %6 1 - %32 = OpConstant %19 1 - %49 = OpConstant %6 10 - %52 = OpConstant %6 0.5 -+%76 = OpConstant %6 0.100000001 - %53 = OpConstant %6 0.699999988 - %61 = OpTypeVector %6 4 - %62 = OpTypePointer Output %61 - %63 = OpVariable %62 Output - %67 = OpTypePointer Input %6 - %68 = OpVariable %67 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %64 = OpFunctionCall %6 %8 - %65 = OpFunctionCall %6 %10 - %66 = OpCompositeConstruct %61 %64 %65 %14 %29 - OpStore %63 %66 - OpReturn - OpFunctionEnd - %8 = OpFunction %6 None %7 - %9 = OpLabel - %13 = OpVariable %12 Function - OpStore %13 %14 --%22 = OpAccessChain %21 %18 %20 --%23 = OpLoad %15 %22 --%26 = OpINotEqual %25 %23 %24 --OpSelectionMerge %28 None --OpBranchConditional %26 %27 %28 --%27 = OpLabel --%30 = OpLoad %6 %13 --%31 = OpFAdd %6 %30 %29 --OpStore %13 %31 --OpBranch %28 --%28 = OpLabel - %33 = OpAccessChain %21 %18 %32 - %34 = OpLoad %15 %33 - %35 = OpConvertUToF %6 %34 - %36 = OpExtInst %6 %1 Log2 %35 - %37 = OpLoad %6 %13 - %38 = OpFAdd %6 %37 %36 - OpStore %13 %38 - %39 = OpLoad %6 %13 - %40 = OpLoad %6 %13 - %41 = OpExtInst %6 %1 Sqrt %40 - %42 = OpFSub %6 %39 %41 - OpReturnValue %42 - OpFunctionEnd - %10 = OpFunction %6 None %7 - %11 = OpLabel - %45 = OpVariable %12 Function - %46 = OpAccessChain %21 %18 %20 - %47 = OpLoad %15 %46 - %48 = OpConvertUToF %6 %47 - %50 = OpFDiv %6 %48 %49 - OpStore %45 %50 - %51 = OpLoad %6 %45 - %54 = OpExtInst %6 %1 FClamp %51 %52 %53 - %55 = OpLoad %6 %45 - %56 = OpFMul %6 %55 %54 - OpStore %45 %56 -+%71 = OpAccessChain %21 %18 %32 -+%72 = OpLoad %15 %71 -+%73 = OpINotEqual %25 %72 %24 -+OpSelectionMerge %75 None -+OpBranchConditional %73 %74 %75 -+%74 = OpLabel - %57 = OpLoad %6 %45 -+%77 = OpFSub %6 %57 %76 -+OpStore %45 %77 -+OpBranch %75 -+%75 = OpLabel -+%78 = OpLoad %6 %45 --%58 = OpExtInst %6 %1 Exp %57 -+%58 = OpExtInst %6 %1 Exp %78 - OpReturnValue %58 - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, ExtraIfBlockNoDebug) { - constexpr char kSrcNoDebug[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %63 %68 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpDecorate %8 RelaxedPrecision - OpDecorate %10 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - OpMemberDecorate %16 0 RelaxedPrecision - OpMemberDecorate %16 0 Offset 0 - OpMemberDecorate %16 1 RelaxedPrecision - OpMemberDecorate %16 1 Offset 4 - OpDecorate %16 Block - OpDecorate %18 DescriptorSet 0 - OpDecorate %18 Binding 0 - OpDecorate %23 RelaxedPrecision - OpDecorate %30 RelaxedPrecision - OpDecorate %31 RelaxedPrecision - OpDecorate %34 RelaxedPrecision - OpDecorate %35 RelaxedPrecision - OpDecorate %36 RelaxedPrecision - OpDecorate %37 RelaxedPrecision - OpDecorate %38 RelaxedPrecision - OpDecorate %39 RelaxedPrecision - OpDecorate %40 RelaxedPrecision - OpDecorate %41 RelaxedPrecision - OpDecorate %42 RelaxedPrecision - OpDecorate %45 RelaxedPrecision - OpDecorate %47 RelaxedPrecision - OpDecorate %48 RelaxedPrecision - OpDecorate %50 RelaxedPrecision - OpDecorate %51 RelaxedPrecision - OpDecorate %54 RelaxedPrecision - OpDecorate %55 RelaxedPrecision - OpDecorate %56 RelaxedPrecision - OpDecorate %57 RelaxedPrecision - OpDecorate %58 RelaxedPrecision - OpDecorate %63 RelaxedPrecision - OpDecorate %63 Location 0 - OpDecorate %64 RelaxedPrecision - OpDecorate %65 RelaxedPrecision - OpDecorate %66 RelaxedPrecision - OpDecorate %68 RelaxedPrecision - OpDecorate %68 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeFunction %6 - %12 = OpTypePointer Function %6 - %14 = OpConstant %6 0 - %15 = OpTypeInt 32 0 - %16 = OpTypeStruct %15 %15 - %17 = OpTypePointer Uniform %16 - %18 = OpVariable %17 Uniform - %19 = OpTypeInt 32 1 - %20 = OpConstant %19 0 - %21 = OpTypePointer Uniform %15 - %24 = OpConstant %15 0 - %25 = OpTypeBool - %29 = OpConstant %6 1 - %32 = OpConstant %19 1 - %49 = OpConstant %6 10 - %52 = OpConstant %6 0.5 - %53 = OpConstant %6 0.699999988 - %61 = OpTypeVector %6 4 - %62 = OpTypePointer Output %61 - %63 = OpVariable %62 Output - %67 = OpTypePointer Input %6 - %68 = OpVariable %67 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %64 = OpFunctionCall %6 %8 - %65 = OpFunctionCall %6 %10 - %66 = OpCompositeConstruct %61 %64 %65 %14 %29 - OpStore %63 %66 - OpReturn - OpFunctionEnd - %8 = OpFunction %6 None %7 - %9 = OpLabel - %13 = OpVariable %12 Function - OpStore %13 %14 - %22 = OpAccessChain %21 %18 %20 - %23 = OpLoad %15 %22 - %26 = OpINotEqual %25 %23 %24 - OpSelectionMerge %28 None - OpBranchConditional %26 %27 %28 - %27 = OpLabel - %30 = OpLoad %6 %13 - %31 = OpFAdd %6 %30 %29 - OpStore %13 %31 - OpBranch %28 - %28 = OpLabel - %33 = OpAccessChain %21 %18 %32 - %34 = OpLoad %15 %33 - %35 = OpConvertUToF %6 %34 - %36 = OpExtInst %6 %1 Log2 %35 - %37 = OpLoad %6 %13 - %38 = OpFAdd %6 %37 %36 - OpStore %13 %38 - %39 = OpLoad %6 %13 - %40 = OpLoad %6 %13 - %41 = OpExtInst %6 %1 Sqrt %40 - %42 = OpFSub %6 %39 %41 - OpReturnValue %42 - OpFunctionEnd - %10 = OpFunction %6 None %7 - %11 = OpLabel - %45 = OpVariable %12 Function - %46 = OpAccessChain %21 %18 %20 - %47 = OpLoad %15 %46 - %48 = OpConvertUToF %6 %47 - %50 = OpFDiv %6 %48 %49 - OpStore %45 %50 - %51 = OpLoad %6 %45 - %54 = OpExtInst %6 %1 FClamp %51 %52 %53 - %55 = OpLoad %6 %45 - %56 = OpFMul %6 %55 %54 - OpStore %45 %56 - %57 = OpLoad %6 %45 - %58 = OpExtInst %6 %1 Exp %57 - OpReturnValue %58 - OpFunctionEnd - -)"; - constexpr char kDstNoDebug[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %63 %69 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpDecorate %8 RelaxedPrecision - OpDecorate %10 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - OpMemberDecorate %16 0 RelaxedPrecision - OpMemberDecorate %16 0 Offset 0 - OpMemberDecorate %16 1 RelaxedPrecision - OpMemberDecorate %16 1 Offset 4 - OpDecorate %16 Block - OpDecorate %18 DescriptorSet 0 - OpDecorate %18 Binding 0 - OpDecorate %23 RelaxedPrecision - OpDecorate %24 RelaxedPrecision - OpDecorate %25 RelaxedPrecision - OpDecorate %26 RelaxedPrecision - OpDecorate %27 RelaxedPrecision - OpDecorate %28 RelaxedPrecision - OpDecorate %29 RelaxedPrecision - OpDecorate %30 RelaxedPrecision - OpDecorate %31 RelaxedPrecision - OpDecorate %34 RelaxedPrecision - OpDecorate %37 RelaxedPrecision - OpDecorate %38 RelaxedPrecision - OpDecorate %40 RelaxedPrecision - OpDecorate %41 RelaxedPrecision - OpDecorate %44 RelaxedPrecision - OpDecorate %45 RelaxedPrecision - OpDecorate %46 RelaxedPrecision - OpDecorate %48 RelaxedPrecision - OpDecorate %55 RelaxedPrecision - OpDecorate %56 RelaxedPrecision - OpDecorate %57 RelaxedPrecision - OpDecorate %58 RelaxedPrecision - OpDecorate %63 RelaxedPrecision - OpDecorate %63 Location 0 - OpDecorate %64 RelaxedPrecision - OpDecorate %65 RelaxedPrecision - OpDecorate %67 RelaxedPrecision - OpDecorate %69 RelaxedPrecision - OpDecorate %69 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeFunction %6 - %12 = OpTypePointer Function %6 - %14 = OpConstant %6 0 - %15 = OpTypeInt 32 0 - %16 = OpTypeStruct %15 %15 - %17 = OpTypePointer Uniform %16 - %18 = OpVariable %17 Uniform - %19 = OpTypeInt 32 1 - %20 = OpConstant %19 1 - %21 = OpTypePointer Uniform %15 - %35 = OpConstant %19 0 - %39 = OpConstant %6 10 - %42 = OpConstant %6 0.5 - %43 = OpConstant %6 0.699999988 - %49 = OpConstant %15 0 - %50 = OpTypeBool - %54 = OpConstant %6 0.100000001 - %61 = OpTypeVector %6 4 - %62 = OpTypePointer Output %61 - %63 = OpVariable %62 Output - %66 = OpConstant %6 1 - %68 = OpTypePointer Input %6 - %69 = OpVariable %68 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %64 = OpFunctionCall %6 %8 - %65 = OpFunctionCall %6 %10 - %67 = OpCompositeConstruct %61 %64 %65 %14 %66 - OpStore %63 %67 - OpReturn - OpFunctionEnd - %8 = OpFunction %6 None %7 - %9 = OpLabel - %13 = OpVariable %12 Function - OpStore %13 %14 - %22 = OpAccessChain %21 %18 %20 - %23 = OpLoad %15 %22 - %24 = OpConvertUToF %6 %23 - %25 = OpExtInst %6 %1 Log2 %24 - %26 = OpLoad %6 %13 - %27 = OpFAdd %6 %26 %25 - OpStore %13 %27 - %28 = OpLoad %6 %13 - %29 = OpLoad %6 %13 - %30 = OpExtInst %6 %1 Sqrt %29 - %31 = OpFSub %6 %28 %30 - OpReturnValue %31 - OpFunctionEnd - %10 = OpFunction %6 None %7 - %11 = OpLabel - %34 = OpVariable %12 Function - %36 = OpAccessChain %21 %18 %35 - %37 = OpLoad %15 %36 - %38 = OpConvertUToF %6 %37 - %40 = OpFDiv %6 %38 %39 - OpStore %34 %40 - %41 = OpLoad %6 %34 - %44 = OpExtInst %6 %1 FClamp %41 %42 %43 - %45 = OpLoad %6 %34 - %46 = OpFMul %6 %45 %44 - OpStore %34 %46 - %47 = OpAccessChain %21 %18 %20 - %48 = OpLoad %15 %47 - %51 = OpINotEqual %50 %48 %49 - OpSelectionMerge %53 None - OpBranchConditional %51 %52 %53 - %52 = OpLabel - %55 = OpLoad %6 %34 - %56 = OpFSub %6 %55 %54 - OpStore %34 %56 - OpBranch %53 - %53 = OpLabel - %57 = OpLoad %6 %34 - %58 = OpExtInst %6 %1 Exp %57 - OpReturnValue %58 - OpFunctionEnd - -)"; - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 69 -+; Bound: 81 - ; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %63 %68 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpDecorate %8 RelaxedPrecision - OpDecorate %10 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - OpMemberDecorate %16 0 RelaxedPrecision - OpMemberDecorate %16 0 Offset 0 - OpMemberDecorate %16 1 RelaxedPrecision - OpMemberDecorate %16 1 Offset 4 - OpDecorate %16 Block - OpDecorate %18 DescriptorSet 0 - OpDecorate %18 Binding 0 --OpDecorate %23 RelaxedPrecision --OpDecorate %30 RelaxedPrecision --OpDecorate %31 RelaxedPrecision - OpDecorate %34 RelaxedPrecision - OpDecorate %35 RelaxedPrecision - OpDecorate %36 RelaxedPrecision - OpDecorate %37 RelaxedPrecision - OpDecorate %38 RelaxedPrecision - OpDecorate %39 RelaxedPrecision - OpDecorate %40 RelaxedPrecision - OpDecorate %41 RelaxedPrecision - OpDecorate %42 RelaxedPrecision - OpDecorate %45 RelaxedPrecision - OpDecorate %47 RelaxedPrecision - OpDecorate %48 RelaxedPrecision - OpDecorate %50 RelaxedPrecision - OpDecorate %51 RelaxedPrecision - OpDecorate %54 RelaxedPrecision - OpDecorate %55 RelaxedPrecision - OpDecorate %56 RelaxedPrecision -+OpDecorate %72 RelaxedPrecision - OpDecorate %57 RelaxedPrecision -+OpDecorate %77 RelaxedPrecision -+OpDecorate %78 RelaxedPrecision - OpDecorate %58 RelaxedPrecision - OpDecorate %63 RelaxedPrecision - OpDecorate %63 Location 0 - OpDecorate %64 RelaxedPrecision - OpDecorate %65 RelaxedPrecision - OpDecorate %66 RelaxedPrecision - OpDecorate %68 RelaxedPrecision - OpDecorate %68 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeFunction %6 - %12 = OpTypePointer Function %6 - %14 = OpConstant %6 0 - %15 = OpTypeInt 32 0 - %16 = OpTypeStruct %15 %15 - %17 = OpTypePointer Uniform %16 - %18 = OpVariable %17 Uniform - %19 = OpTypeInt 32 1 - %20 = OpConstant %19 0 - %21 = OpTypePointer Uniform %15 - %24 = OpConstant %15 0 - %25 = OpTypeBool - %29 = OpConstant %6 1 - %32 = OpConstant %19 1 - %49 = OpConstant %6 10 - %52 = OpConstant %6 0.5 -+%76 = OpConstant %6 0.100000001 - %53 = OpConstant %6 0.699999988 - %61 = OpTypeVector %6 4 - %62 = OpTypePointer Output %61 - %63 = OpVariable %62 Output - %67 = OpTypePointer Input %6 - %68 = OpVariable %67 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %64 = OpFunctionCall %6 %8 - %65 = OpFunctionCall %6 %10 - %66 = OpCompositeConstruct %61 %64 %65 %14 %29 - OpStore %63 %66 - OpReturn - OpFunctionEnd - %8 = OpFunction %6 None %7 - %9 = OpLabel - %13 = OpVariable %12 Function - OpStore %13 %14 --%22 = OpAccessChain %21 %18 %20 --%23 = OpLoad %15 %22 --%26 = OpINotEqual %25 %23 %24 --OpSelectionMerge %28 None --OpBranchConditional %26 %27 %28 --%27 = OpLabel --%30 = OpLoad %6 %13 --%31 = OpFAdd %6 %30 %29 --OpStore %13 %31 --OpBranch %28 --%28 = OpLabel - %33 = OpAccessChain %21 %18 %32 - %34 = OpLoad %15 %33 - %35 = OpConvertUToF %6 %34 - %36 = OpExtInst %6 %1 Log2 %35 - %37 = OpLoad %6 %13 - %38 = OpFAdd %6 %37 %36 - OpStore %13 %38 - %39 = OpLoad %6 %13 - %40 = OpLoad %6 %13 - %41 = OpExtInst %6 %1 Sqrt %40 - %42 = OpFSub %6 %39 %41 - OpReturnValue %42 - OpFunctionEnd - %10 = OpFunction %6 None %7 - %11 = OpLabel - %45 = OpVariable %12 Function - %46 = OpAccessChain %21 %18 %20 - %47 = OpLoad %15 %46 - %48 = OpConvertUToF %6 %47 - %50 = OpFDiv %6 %48 %49 - OpStore %45 %50 - %51 = OpLoad %6 %45 - %54 = OpExtInst %6 %1 FClamp %51 %52 %53 - %55 = OpLoad %6 %45 - %56 = OpFMul %6 %55 %54 - OpStore %45 %56 -+%71 = OpAccessChain %21 %18 %32 -+%72 = OpLoad %15 %71 -+%73 = OpINotEqual %25 %72 %24 -+OpSelectionMerge %75 None -+OpBranchConditional %73 %74 %75 -+%74 = OpLabel - %57 = OpLoad %6 %45 -+%77 = OpFSub %6 %57 %76 -+OpStore %45 %77 -+OpBranch %75 -+%75 = OpLabel -+%78 = OpLoad %6 %45 --%58 = OpExtInst %6 %1 Exp %57 -+%58 = OpExtInst %6 %1 Exp %78 - OpReturnValue %58 - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_files/extra_if_block_dst.spvasm b/test/diff/diff_files/extra_if_block_dst.spvasm deleted file mode 100644 index 79bda830..00000000 --- a/test/diff/diff_files/extra_if_block_dst.spvasm +++ /dev/null @@ -1,136 +0,0 @@ - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %63 %69 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %8 "f1(" - OpName %10 "f2(" - OpName %13 "v" - OpName %16 "Buffer" - OpMemberName %16 0 "flag1" - OpMemberName %16 1 "flag2" - OpName %18 "" - OpName %34 "v" - OpName %63 "color" - OpName %69 "v" - OpDecorate %8 RelaxedPrecision - OpDecorate %10 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - OpMemberDecorate %16 0 RelaxedPrecision - OpMemberDecorate %16 0 Offset 0 - OpMemberDecorate %16 1 RelaxedPrecision - OpMemberDecorate %16 1 Offset 4 - OpDecorate %16 Block - OpDecorate %18 DescriptorSet 0 - OpDecorate %18 Binding 0 - OpDecorate %23 RelaxedPrecision - OpDecorate %24 RelaxedPrecision - OpDecorate %25 RelaxedPrecision - OpDecorate %26 RelaxedPrecision - OpDecorate %27 RelaxedPrecision - OpDecorate %28 RelaxedPrecision - OpDecorate %29 RelaxedPrecision - OpDecorate %30 RelaxedPrecision - OpDecorate %31 RelaxedPrecision - OpDecorate %34 RelaxedPrecision - OpDecorate %37 RelaxedPrecision - OpDecorate %38 RelaxedPrecision - OpDecorate %40 RelaxedPrecision - OpDecorate %41 RelaxedPrecision - OpDecorate %44 RelaxedPrecision - OpDecorate %45 RelaxedPrecision - OpDecorate %46 RelaxedPrecision - OpDecorate %48 RelaxedPrecision - OpDecorate %55 RelaxedPrecision - OpDecorate %56 RelaxedPrecision - OpDecorate %57 RelaxedPrecision - OpDecorate %58 RelaxedPrecision - OpDecorate %63 RelaxedPrecision - OpDecorate %63 Location 0 - OpDecorate %64 RelaxedPrecision - OpDecorate %65 RelaxedPrecision - OpDecorate %67 RelaxedPrecision - OpDecorate %69 RelaxedPrecision - OpDecorate %69 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeFunction %6 - %12 = OpTypePointer Function %6 - %14 = OpConstant %6 0 - %15 = OpTypeInt 32 0 - %16 = OpTypeStruct %15 %15 - %17 = OpTypePointer Uniform %16 - %18 = OpVariable %17 Uniform - %19 = OpTypeInt 32 1 - %20 = OpConstant %19 1 - %21 = OpTypePointer Uniform %15 - %35 = OpConstant %19 0 - %39 = OpConstant %6 10 - %42 = OpConstant %6 0.5 - %43 = OpConstant %6 0.699999988 - %49 = OpConstant %15 0 - %50 = OpTypeBool - %54 = OpConstant %6 0.100000001 - %61 = OpTypeVector %6 4 - %62 = OpTypePointer Output %61 - %63 = OpVariable %62 Output - %66 = OpConstant %6 1 - %68 = OpTypePointer Input %6 - %69 = OpVariable %68 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %64 = OpFunctionCall %6 %8 - %65 = OpFunctionCall %6 %10 - %67 = OpCompositeConstruct %61 %64 %65 %14 %66 - OpStore %63 %67 - OpReturn - OpFunctionEnd - %8 = OpFunction %6 None %7 - %9 = OpLabel - %13 = OpVariable %12 Function - OpStore %13 %14 - %22 = OpAccessChain %21 %18 %20 - %23 = OpLoad %15 %22 - %24 = OpConvertUToF %6 %23 - %25 = OpExtInst %6 %1 Log2 %24 - %26 = OpLoad %6 %13 - %27 = OpFAdd %6 %26 %25 - OpStore %13 %27 - %28 = OpLoad %6 %13 - %29 = OpLoad %6 %13 - %30 = OpExtInst %6 %1 Sqrt %29 - %31 = OpFSub %6 %28 %30 - OpReturnValue %31 - OpFunctionEnd - %10 = OpFunction %6 None %7 - %11 = OpLabel - %34 = OpVariable %12 Function - %36 = OpAccessChain %21 %18 %35 - %37 = OpLoad %15 %36 - %38 = OpConvertUToF %6 %37 - %40 = OpFDiv %6 %38 %39 - OpStore %34 %40 - %41 = OpLoad %6 %34 - %44 = OpExtInst %6 %1 FClamp %41 %42 %43 - %45 = OpLoad %6 %34 - %46 = OpFMul %6 %45 %44 - OpStore %34 %46 - %47 = OpAccessChain %21 %18 %20 - %48 = OpLoad %15 %47 - %51 = OpINotEqual %50 %48 %49 - OpSelectionMerge %53 None - OpBranchConditional %51 %52 %53 - %52 = OpLabel - %55 = OpLoad %6 %34 - %56 = OpFSub %6 %55 %54 - OpStore %34 %56 - OpBranch %53 - %53 = OpLabel - %57 = OpLoad %6 %34 - %58 = OpExtInst %6 %1 Exp %57 - OpReturnValue %58 - OpFunctionEnd - diff --git a/test/diff/diff_files/extra_if_block_src.spvasm b/test/diff/diff_files/extra_if_block_src.spvasm deleted file mode 100644 index 1b43ccb1..00000000 --- a/test/diff/diff_files/extra_if_block_src.spvasm +++ /dev/null @@ -1,137 +0,0 @@ -;; Test where src has an extra if block in one function, and dst has an extra -;; if block in another function. - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %63 %68 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %8 "f1(" - OpName %10 "f2(" - OpName %13 "v" - OpName %16 "Buffer" - OpMemberName %16 0 "flag1" - OpMemberName %16 1 "flag2" - OpName %18 "" - OpName %45 "v" - OpName %63 "color" - OpName %68 "v" - OpDecorate %8 RelaxedPrecision - OpDecorate %10 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - OpMemberDecorate %16 0 RelaxedPrecision - OpMemberDecorate %16 0 Offset 0 - OpMemberDecorate %16 1 RelaxedPrecision - OpMemberDecorate %16 1 Offset 4 - OpDecorate %16 Block - OpDecorate %18 DescriptorSet 0 - OpDecorate %18 Binding 0 - OpDecorate %23 RelaxedPrecision - OpDecorate %30 RelaxedPrecision - OpDecorate %31 RelaxedPrecision - OpDecorate %34 RelaxedPrecision - OpDecorate %35 RelaxedPrecision - OpDecorate %36 RelaxedPrecision - OpDecorate %37 RelaxedPrecision - OpDecorate %38 RelaxedPrecision - OpDecorate %39 RelaxedPrecision - OpDecorate %40 RelaxedPrecision - OpDecorate %41 RelaxedPrecision - OpDecorate %42 RelaxedPrecision - OpDecorate %45 RelaxedPrecision - OpDecorate %47 RelaxedPrecision - OpDecorate %48 RelaxedPrecision - OpDecorate %50 RelaxedPrecision - OpDecorate %51 RelaxedPrecision - OpDecorate %54 RelaxedPrecision - OpDecorate %55 RelaxedPrecision - OpDecorate %56 RelaxedPrecision - OpDecorate %57 RelaxedPrecision - OpDecorate %58 RelaxedPrecision - OpDecorate %63 RelaxedPrecision - OpDecorate %63 Location 0 - OpDecorate %64 RelaxedPrecision - OpDecorate %65 RelaxedPrecision - OpDecorate %66 RelaxedPrecision - OpDecorate %68 RelaxedPrecision - OpDecorate %68 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeFunction %6 - %12 = OpTypePointer Function %6 - %14 = OpConstant %6 0 - %15 = OpTypeInt 32 0 - %16 = OpTypeStruct %15 %15 - %17 = OpTypePointer Uniform %16 - %18 = OpVariable %17 Uniform - %19 = OpTypeInt 32 1 - %20 = OpConstant %19 0 - %21 = OpTypePointer Uniform %15 - %24 = OpConstant %15 0 - %25 = OpTypeBool - %29 = OpConstant %6 1 - %32 = OpConstant %19 1 - %49 = OpConstant %6 10 - %52 = OpConstant %6 0.5 - %53 = OpConstant %6 0.699999988 - %61 = OpTypeVector %6 4 - %62 = OpTypePointer Output %61 - %63 = OpVariable %62 Output - %67 = OpTypePointer Input %6 - %68 = OpVariable %67 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %64 = OpFunctionCall %6 %8 - %65 = OpFunctionCall %6 %10 - %66 = OpCompositeConstruct %61 %64 %65 %14 %29 - OpStore %63 %66 - OpReturn - OpFunctionEnd - %8 = OpFunction %6 None %7 - %9 = OpLabel - %13 = OpVariable %12 Function - OpStore %13 %14 - %22 = OpAccessChain %21 %18 %20 - %23 = OpLoad %15 %22 - %26 = OpINotEqual %25 %23 %24 - OpSelectionMerge %28 None - OpBranchConditional %26 %27 %28 - %27 = OpLabel - %30 = OpLoad %6 %13 - %31 = OpFAdd %6 %30 %29 - OpStore %13 %31 - OpBranch %28 - %28 = OpLabel - %33 = OpAccessChain %21 %18 %32 - %34 = OpLoad %15 %33 - %35 = OpConvertUToF %6 %34 - %36 = OpExtInst %6 %1 Log2 %35 - %37 = OpLoad %6 %13 - %38 = OpFAdd %6 %37 %36 - OpStore %13 %38 - %39 = OpLoad %6 %13 - %40 = OpLoad %6 %13 - %41 = OpExtInst %6 %1 Sqrt %40 - %42 = OpFSub %6 %39 %41 - OpReturnValue %42 - OpFunctionEnd - %10 = OpFunction %6 None %7 - %11 = OpLabel - %45 = OpVariable %12 Function - %46 = OpAccessChain %21 %18 %20 - %47 = OpLoad %15 %46 - %48 = OpConvertUToF %6 %47 - %50 = OpFDiv %6 %48 %49 - OpStore %45 %50 - %51 = OpLoad %6 %45 - %54 = OpExtInst %6 %1 FClamp %51 %52 %53 - %55 = OpLoad %6 %45 - %56 = OpFMul %6 %55 %54 - OpStore %45 %56 - %57 = OpLoad %6 %45 - %58 = OpExtInst %6 %1 Exp %57 - OpReturnValue %58 - OpFunctionEnd - diff --git a/test/diff/diff_files/generate_tests.py b/test/diff/diff_files/generate_tests.py deleted file mode 100755 index cc3175d3..00000000 --- a/test/diff/diff_files/generate_tests.py +++ /dev/null @@ -1,304 +0,0 @@ -#! /usr/bin/python3 -# -# Copyright (c) 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import glob -import os -import subprocess -import sys - -# A handful of relevant tests are hand-picked to generate extra unit tests with -# specific options of spirv-diff. -IGNORE_SET_BINDING_TESTS = ['different_decorations_vertex'] -IGNORE_LOCATION_TESTS = ['different_decorations_fragment'] -IGNORE_DECORATIONS_TESTS = ['different_decorations_vertex', 'different_decorations_fragment'] -DUMP_IDS_TESTS = ['basic', 'int_vs_uint_constants', 'multiple_same_entry_points', 'small_functions_small_diffs'] - -LICENSE = u"""Copyright (c) 2022 Google LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -TEMPLATE_TEST_FILE = u"""// GENERATED FILE - DO NOT EDIT. -// Generated by {script_name} -// -{license} - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools {{ -namespace diff {{ -namespace {{ - -{test_comment} -constexpr char kSrc[] = R"({src_spirv})"; -constexpr char kDst[] = R"({dst_spirv})"; - -TEST(DiffTest, {test_name}) {{ - constexpr char kDiff[] = R"({diff_spirv})"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -}} - -TEST(DiffTest, {test_name}NoDebug) {{ - constexpr char kSrcNoDebug[] = R"({src_spirv_no_debug})"; - constexpr char kDstNoDebug[] = R"({dst_spirv_no_debug})"; - constexpr char kDiff[] = R"({diff_spirv_no_debug})"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -}} -{extra_tests} -}} // namespace -}} // namespace diff -}} // namespace spvtools -""" - -TEMPLATE_TEST_FUNC = u""" -TEST(DiffTest, {test_name}{test_tag}) {{ - constexpr char kDiff[] = R"({diff_spirv})"; - Options options; - {test_options} - DoStringDiffTest(kSrc, kDst, kDiff, options); -}} -""" - -TEMPLATE_TEST_FILES_CMAKE = u"""# GENERATED FILE - DO NOT EDIT. -# Generated by {script_name} -# -{license} - -list(APPEND DIFF_TEST_FILES -{test_files} -) -""" - -VARIANT_NONE = 0 -VARIANT_IGNORE_SET_BINDING = 1 -VARIANT_IGNORE_LOCATION = 2 -VARIANT_IGNORE_DECORATIONS = 3 -VARIANT_DUMP_IDS = 4 - -def print_usage(): - print("Usage: {} ".format(sys.argv[0])) - -def remove_debug_info(in_path): - tmp_dir = '.no_dbg' - - if not os.path.exists(tmp_dir): - os.makedirs(tmp_dir) - - (in_basename, in_ext) = os.path.splitext(in_path) - out_name = in_basename + '_no_dbg' + in_ext - out_path = os.path.join(tmp_dir, out_name) - - with open(in_path, 'r') as fin: - with open(out_path, 'w') as fout: - for line in fin: - ops = line.strip().split() - op = ops[0] if len(ops) > 0 else '' - if (op != ';;' and op != 'OpName' and op != 'OpMemberName' and op != 'OpString' and - op != 'OpLine' and op != 'OpNoLine' and op != 'OpModuleProcessed'): - fout.write(line) - - return out_path - -def make_src_file(test_name): - return '{}_src.spvasm'.format(test_name) - -def make_dst_file(test_name): - return '{}_dst.spvasm'.format(test_name) - -def make_cpp_file(test_name): - return '{}_autogen.cpp'.format(test_name) - -def make_camel_case(test_name): - return test_name.replace('_', ' ').title().replace(' ', '') - -def make_comment(text, comment_prefix): - return '\n'.join([comment_prefix + (' ' if line.strip() else '') + line for line in text.splitlines()]) - -def read_file(file_name): - with open(file_name, 'r') as f: - content = f.read() - - # Use unix line endings. - content = content.replace('\r\n', '\n') - - return content - -def parse_test_comment(src_spirv_file_name, src_spirv): - src_spirv_lines = src_spirv.splitlines() - comment_line_count = 0 - while comment_line_count < len(src_spirv_lines): - if not src_spirv_lines[comment_line_count].strip().startswith(';;'): - break - comment_line_count += 1 - - if comment_line_count == 0: - print("Expected comment on test file '{}'. See README.md next to this file.".format(src_spirv_file_name)) - sys.exit(1) - - comment_block = src_spirv_lines[:comment_line_count] - spirv_block = src_spirv_lines[comment_line_count:] - - comment_block = ['// ' + line.replace(';;', '').strip() for line in comment_block] - - return '\n'.join(spirv_block), '\n'.join(comment_block) - -def run_diff_tool(diff_tool, src_file, dst_file, variant): - args = [diff_tool] - - if variant == VARIANT_IGNORE_SET_BINDING or variant == VARIANT_IGNORE_DECORATIONS: - args.append('--ignore-set-binding') - - if variant == VARIANT_IGNORE_LOCATION or variant == VARIANT_IGNORE_DECORATIONS: - args.append('--ignore-location') - - if variant == VARIANT_DUMP_IDS: - args.append('--with-id-map') - - args.append('--no-color') - args.append('--no-indent') - - args.append(src_file) - args.append(dst_file) - - success = True - print(' '.join(args)) - process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) - out, err = process.communicate() - - if process.returncode != 0: - print(err) - sys.exit(process.returncode) - - # Use unix line endings. - out = out.replace('\r\n', '\n') - - return out - -def generate_extra_test(diff_tool, src_file, dst_file, variant, test_name_camel_case, test_tag, test_options): - diff = run_diff_tool(diff_tool, src_file, dst_file, variant) - return TEMPLATE_TEST_FUNC.format( - test_name = test_name_camel_case, - test_tag = test_tag, - test_options = test_options, - diff_spirv = diff) - -def generate_test(diff_tool, test_name): - src_file = make_src_file(test_name) - dst_file = make_dst_file(test_name) - src_file_no_debug = remove_debug_info(src_file) - dst_file_no_debug = remove_debug_info(dst_file) - - src_spirv = read_file(src_file) - dst_spirv = read_file(dst_file) - src_spirv_no_debug = read_file(src_file_no_debug) - dst_spirv_no_debug = read_file(dst_file_no_debug) - - test_name_camel_case = make_camel_case(test_name) - - diff_spirv = run_diff_tool(diff_tool, src_file, dst_file, VARIANT_NONE) - diff_spirv_no_debug = run_diff_tool(diff_tool, src_file_no_debug, dst_file_no_debug, VARIANT_NONE) - - extra_tests = [] - - if test_name in IGNORE_SET_BINDING_TESTS: - extra_tests.append(generate_extra_test(diff_tool, src_file, dst_file, VARIANT_IGNORE_SET_BINDING, - test_name_camel_case, 'IgnoreSetBinding', 'options.ignore_set_binding = true;')) - - if test_name in IGNORE_LOCATION_TESTS: - extra_tests.append(generate_extra_test(diff_tool, src_file, dst_file, VARIANT_IGNORE_LOCATION, - test_name_camel_case, 'IgnoreLocation', 'options.ignore_location = true;')) - - if test_name in IGNORE_DECORATIONS_TESTS: - extra_tests.append(generate_extra_test(diff_tool, src_file, dst_file, VARIANT_IGNORE_DECORATIONS, - test_name_camel_case, 'IgnoreSetBindingLocation', - '\n '.join(['options.ignore_set_binding = true;', 'options.ignore_location = true;']))) - - if test_name in DUMP_IDS_TESTS: - extra_tests.append(generate_extra_test(diff_tool, src_file, dst_file, VARIANT_DUMP_IDS, - test_name_camel_case, 'DumpIds', 'options.dump_id_map = true;')) - - src_spirv, test_comment = parse_test_comment(src_file, src_spirv) - - test_file = TEMPLATE_TEST_FILE.format( - script_name = os.path.basename(__file__), - license = make_comment(LICENSE, '//'), - test_comment = test_comment, - test_name = test_name_camel_case, - src_spirv = src_spirv, - dst_spirv = dst_spirv, - diff_spirv = diff_spirv, - src_spirv_no_debug = src_spirv_no_debug, - dst_spirv_no_debug = dst_spirv_no_debug, - diff_spirv_no_debug = diff_spirv_no_debug, - extra_tests = ''.join(extra_tests)) - - test_file_name = make_cpp_file(test_name) - with open(test_file_name, 'wb') as fout: - fout.write(str.encode(test_file)) - - return test_file_name - -def generate_tests(diff_tool, test_names): - return [generate_test(diff_tool, test_name) for test_name in test_names] - -def generate_cmake(test_files): - cmake = TEMPLATE_TEST_FILES_CMAKE.format( - script_name = os.path.basename(__file__), - license = make_comment(LICENSE, '#'), - test_files = '\n'.join(['"diff_files/{}"'.format(f) for f in test_files])) - - with open('diff_test_files_autogen.cmake', 'wb') as fout: - fout.write(str.encode(cmake)) - -def main(): - - if len(sys.argv) != 2: - print_usage() - return 1 - - diff_tool = sys.argv[1] - if not os.path.exists(diff_tool): - print("No such file: {}".format(diff_tool)) - print_usage() - return 1 - - diff_tool = os.path.realpath(diff_tool) - os.chdir(os.path.dirname(__file__)) - - test_names = sorted([f[:-11] for f in glob.glob("*_src.spvasm")]) - - test_files = generate_tests(diff_tool, test_names) - - generate_cmake(test_files) - - return 0 - -if __name__ == '__main__': - sys.exit(main()) diff --git a/test/diff/diff_files/index_signedness_autogen.cpp b/test/diff/diff_files/index_signedness_autogen.cpp deleted file mode 100644 index ab650be1..00000000 --- a/test/diff/diff_files/index_signedness_autogen.cpp +++ /dev/null @@ -1,733 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_tests.py -// -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -// Test where signedness of indices are different between src and dst. -constexpr char kSrc[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "main" - OpName %13 "BufferOut" - OpMemberName %13 0 "o1" - OpMemberName %13 1 "o2" - OpMemberName %13 2 "o3" - OpName %15 "" - OpName %22 "BufferIn" - OpMemberName %22 0 "i1" - OpMemberName %22 1 "i2" - OpName %24 "" - OpDecorate %8 ArrayStride 4 - OpDecorate %9 ArrayStride 4 - OpDecorate %11 ArrayStride 4 - OpDecorate %12 ArrayStride 8 - OpMemberDecorate %13 0 Offset 0 - OpMemberDecorate %13 1 Offset 12 - OpMemberDecorate %13 2 Offset 24 - OpDecorate %13 BufferBlock - OpDecorate %15 DescriptorSet 0 - OpDecorate %15 Binding 1 - OpDecorate %18 ArrayStride 16 - OpDecorate %19 ArrayStride 48 - OpDecorate %21 ArrayStride 16 - OpMemberDecorate %22 0 Offset 0 - OpMemberDecorate %22 1 Offset 96 - OpDecorate %22 Block - OpDecorate %24 DescriptorSet 0 - OpDecorate %24 Binding 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 0 - %7 = OpConstant %6 3 - %8 = OpTypeArray %6 %7 - %9 = OpTypeArray %6 %7 - %10 = OpConstant %6 2 - %11 = OpTypeArray %6 %10 - %12 = OpTypeArray %11 %10 - %13 = OpTypeStruct %8 %9 %12 - %14 = OpTypePointer Uniform %13 - %15 = OpVariable %14 Uniform - %16 = OpTypeInt 32 1 - %17 = OpConstant %16 0 - %18 = OpTypeArray %6 %7 - %19 = OpTypeArray %18 %10 - %20 = OpConstant %6 4 - %21 = OpTypeArray %6 %20 - %22 = OpTypeStruct %19 %21 - %23 = OpTypePointer Uniform %22 - %24 = OpVariable %23 Uniform - %25 = OpTypePointer Uniform %6 - %28 = OpConstant %6 1 - %31 = OpConstant %16 1 - %34 = OpConstant %6 0 - %37 = OpConstant %16 2 - %61 = OpConstant %16 3 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %26 = OpAccessChain %25 %24 %17 %17 %17 - %27 = OpLoad %6 %26 - %29 = OpIAdd %6 %27 %28 - %30 = OpAccessChain %25 %15 %17 %17 - OpStore %30 %29 - %32 = OpAccessChain %25 %24 %17 %31 %17 - %33 = OpLoad %6 %32 - %35 = OpIAdd %6 %33 %34 - %36 = OpAccessChain %25 %15 %17 %31 - OpStore %36 %35 - %38 = OpAccessChain %25 %24 %17 %31 %31 - %39 = OpLoad %6 %38 - %40 = OpIAdd %6 %39 %10 - %41 = OpAccessChain %25 %15 %17 %37 - OpStore %41 %40 - %42 = OpAccessChain %25 %24 %17 %17 %37 - %43 = OpLoad %6 %42 - %44 = OpAccessChain %25 %15 %31 %17 - OpStore %44 %43 - %45 = OpAccessChain %25 %24 %17 %17 %31 - %46 = OpLoad %6 %45 - %47 = OpIMul %6 %46 %7 - %48 = OpAccessChain %25 %15 %31 %31 - OpStore %48 %47 - %49 = OpAccessChain %25 %24 %17 %31 %37 - %50 = OpLoad %6 %49 - %51 = OpAccessChain %25 %15 %31 %37 - OpStore %51 %50 - %52 = OpAccessChain %25 %24 %31 %17 - %53 = OpLoad %6 %52 - %54 = OpAccessChain %25 %15 %37 %17 %17 - OpStore %54 %53 - %55 = OpAccessChain %25 %24 %31 %31 - %56 = OpLoad %6 %55 - %57 = OpAccessChain %25 %15 %37 %17 %31 - OpStore %57 %56 - %58 = OpAccessChain %25 %24 %31 %37 - %59 = OpLoad %6 %58 - %60 = OpAccessChain %25 %15 %37 %31 %17 - OpStore %60 %59 - %62 = OpAccessChain %25 %24 %31 %61 - %63 = OpLoad %6 %62 - %64 = OpAccessChain %25 %15 %37 %31 %31 - OpStore %64 %63 - OpReturn - OpFunctionEnd -)"; -constexpr char kDst[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "main" - OpName %13 "BufferOut" - OpMemberName %13 0 "o1" - OpMemberName %13 1 "o2" - OpMemberName %13 2 "o3" - OpName %15 "" - OpName %22 "BufferIn" - OpMemberName %22 0 "i1" - OpMemberName %22 1 "i2" - OpName %24 "" - OpDecorate %8 ArrayStride 4 - OpDecorate %9 ArrayStride 4 - OpDecorate %11 ArrayStride 4 - OpDecorate %12 ArrayStride 8 - OpMemberDecorate %13 0 Offset 0 - OpMemberDecorate %13 1 Offset 12 - OpMemberDecorate %13 2 Offset 24 - OpDecorate %13 BufferBlock - OpDecorate %15 DescriptorSet 0 - OpDecorate %15 Binding 1 - OpDecorate %18 ArrayStride 16 - OpDecorate %19 ArrayStride 48 - OpDecorate %21 ArrayStride 16 - OpMemberDecorate %22 0 Offset 0 - OpMemberDecorate %22 1 Offset 96 - OpDecorate %22 Block - OpDecorate %24 DescriptorSet 0 - OpDecorate %24 Binding 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 0 - %16 = OpTypeInt 32 1 - %7 = OpConstant %16 3 - %8 = OpTypeArray %6 %7 - %9 = OpTypeArray %6 %7 - %10 = OpConstant %16 2 - %11 = OpTypeArray %6 %10 - %12 = OpTypeArray %11 %10 - %13 = OpTypeStruct %8 %9 %12 - %14 = OpTypePointer Uniform %13 - %15 = OpVariable %14 Uniform - %18 = OpTypeArray %6 %7 - %19 = OpTypeArray %18 %10 - %20 = OpConstant %16 4 - %21 = OpTypeArray %6 %20 - %22 = OpTypeStruct %19 %21 - %23 = OpTypePointer Uniform %22 - %24 = OpVariable %23 Uniform - %25 = OpTypePointer Uniform %6 - %17 = OpConstant %16 0 - %28 = OpConstant %16 1 - %31 = OpConstant %6 1 - %34 = OpConstant %6 0 - %37 = OpConstant %6 2 - %61 = OpConstant %6 3 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %26 = OpAccessChain %25 %24 %17 %17 %17 - %27 = OpLoad %6 %26 - %29 = OpIAdd %6 %27 %28 - %30 = OpAccessChain %25 %15 %17 %17 - OpStore %30 %29 - %32 = OpAccessChain %25 %24 %17 %31 %17 - %33 = OpLoad %6 %32 - %35 = OpIAdd %6 %33 %34 - %36 = OpAccessChain %25 %15 %17 %31 - OpStore %36 %35 - %38 = OpAccessChain %25 %24 %17 %31 %31 - %39 = OpLoad %6 %38 - %40 = OpIAdd %6 %39 %37 - %41 = OpAccessChain %25 %15 %17 %10 - OpStore %41 %40 - %42 = OpAccessChain %25 %24 %17 %17 %10 - %43 = OpLoad %6 %42 - %44 = OpAccessChain %25 %15 %31 %17 - OpStore %44 %43 - %45 = OpAccessChain %25 %24 %17 %17 %31 - %46 = OpLoad %6 %45 - %47 = OpIMul %6 %46 %7 - %48 = OpAccessChain %25 %15 %31 %31 - OpStore %48 %47 - %49 = OpAccessChain %25 %24 %17 %31 %10 - %50 = OpLoad %6 %49 - %51 = OpAccessChain %25 %15 %31 %10 - OpStore %51 %50 - %52 = OpAccessChain %25 %24 %31 %17 - %53 = OpLoad %6 %52 - %54 = OpAccessChain %25 %15 %37 %17 %17 - OpStore %54 %53 - %55 = OpAccessChain %25 %24 %31 %31 - %56 = OpLoad %6 %55 - %57 = OpAccessChain %25 %15 %37 %17 %31 - OpStore %57 %56 - %58 = OpAccessChain %25 %24 %31 %37 - %59 = OpLoad %6 %58 - %60 = OpAccessChain %25 %15 %37 %31 %17 - OpStore %60 %59 - %62 = OpAccessChain %25 %24 %31 %61 - %63 = OpLoad %6 %62 - %64 = OpAccessChain %25 %15 %37 %31 %31 - OpStore %64 %63 - OpReturn - OpFunctionEnd - -)"; - -TEST(DiffTest, IndexSignedness) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 - ; Bound: 65 - ; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "main" - OpName %13 "BufferOut" - OpMemberName %13 0 "o1" - OpMemberName %13 1 "o2" - OpMemberName %13 2 "o3" - OpName %15 "" - OpName %22 "BufferIn" - OpMemberName %22 0 "i1" - OpMemberName %22 1 "i2" - OpName %24 "" - OpDecorate %8 ArrayStride 4 - OpDecorate %9 ArrayStride 4 - OpDecorate %11 ArrayStride 4 - OpDecorate %12 ArrayStride 8 - OpMemberDecorate %13 0 Offset 0 - OpMemberDecorate %13 1 Offset 12 - OpMemberDecorate %13 2 Offset 24 - OpDecorate %13 BufferBlock - OpDecorate %15 DescriptorSet 0 - OpDecorate %15 Binding 1 - OpDecorate %18 ArrayStride 16 - OpDecorate %19 ArrayStride 48 - OpDecorate %21 ArrayStride 16 - OpMemberDecorate %22 0 Offset 0 - OpMemberDecorate %22 1 Offset 96 - OpDecorate %22 Block - OpDecorate %24 DescriptorSet 0 - OpDecorate %24 Binding 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 0 - %7 = OpConstant %6 3 --%8 = OpTypeArray %6 %7 -+%8 = OpTypeArray %6 %61 --%9 = OpTypeArray %6 %7 -+%9 = OpTypeArray %6 %61 - %10 = OpConstant %6 2 --%11 = OpTypeArray %6 %10 -+%11 = OpTypeArray %6 %37 --%12 = OpTypeArray %11 %10 -+%12 = OpTypeArray %11 %37 - %13 = OpTypeStruct %8 %9 %12 - %14 = OpTypePointer Uniform %13 - %15 = OpVariable %14 Uniform - %16 = OpTypeInt 32 1 - %17 = OpConstant %16 0 --%18 = OpTypeArray %6 %7 -+%18 = OpTypeArray %6 %61 --%19 = OpTypeArray %18 %10 -+%19 = OpTypeArray %18 %37 --%20 = OpConstant %6 4 -+%20 = OpConstant %16 4 - %21 = OpTypeArray %6 %20 - %22 = OpTypeStruct %19 %21 - %23 = OpTypePointer Uniform %22 - %24 = OpVariable %23 Uniform - %25 = OpTypePointer Uniform %6 - %28 = OpConstant %6 1 - %31 = OpConstant %16 1 - %34 = OpConstant %6 0 - %37 = OpConstant %16 2 - %61 = OpConstant %16 3 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %26 = OpAccessChain %25 %24 %17 %17 %17 - %27 = OpLoad %6 %26 --%29 = OpIAdd %6 %27 %28 -+%29 = OpIAdd %6 %27 %31 - %30 = OpAccessChain %25 %15 %17 %17 - OpStore %30 %29 --%32 = OpAccessChain %25 %24 %17 %31 %17 -+%32 = OpAccessChain %25 %24 %17 %28 %17 - %33 = OpLoad %6 %32 - %35 = OpIAdd %6 %33 %34 --%36 = OpAccessChain %25 %15 %17 %31 -+%36 = OpAccessChain %25 %15 %17 %28 - OpStore %36 %35 --%38 = OpAccessChain %25 %24 %17 %31 %31 -+%38 = OpAccessChain %25 %24 %17 %28 %28 - %39 = OpLoad %6 %38 - %40 = OpIAdd %6 %39 %10 - %41 = OpAccessChain %25 %15 %17 %37 - OpStore %41 %40 - %42 = OpAccessChain %25 %24 %17 %17 %37 - %43 = OpLoad %6 %42 --%44 = OpAccessChain %25 %15 %31 %17 -+%44 = OpAccessChain %25 %15 %28 %17 - OpStore %44 %43 --%45 = OpAccessChain %25 %24 %17 %17 %31 -+%45 = OpAccessChain %25 %24 %17 %17 %28 - %46 = OpLoad %6 %45 --%47 = OpIMul %6 %46 %7 -+%47 = OpIMul %6 %46 %61 --%48 = OpAccessChain %25 %15 %31 %31 -+%48 = OpAccessChain %25 %15 %28 %28 - OpStore %48 %47 --%49 = OpAccessChain %25 %24 %17 %31 %37 -+%49 = OpAccessChain %25 %24 %17 %28 %37 - %50 = OpLoad %6 %49 --%51 = OpAccessChain %25 %15 %31 %37 -+%51 = OpAccessChain %25 %15 %28 %37 - OpStore %51 %50 --%52 = OpAccessChain %25 %24 %31 %17 -+%52 = OpAccessChain %25 %24 %28 %17 - %53 = OpLoad %6 %52 --%54 = OpAccessChain %25 %15 %37 %17 %17 -+%54 = OpAccessChain %25 %15 %10 %17 %17 - OpStore %54 %53 --%55 = OpAccessChain %25 %24 %31 %31 -+%55 = OpAccessChain %25 %24 %28 %28 - %56 = OpLoad %6 %55 --%57 = OpAccessChain %25 %15 %37 %17 %31 -+%57 = OpAccessChain %25 %15 %10 %17 %28 - OpStore %57 %56 --%58 = OpAccessChain %25 %24 %31 %37 -+%58 = OpAccessChain %25 %24 %28 %10 - %59 = OpLoad %6 %58 --%60 = OpAccessChain %25 %15 %37 %31 %17 -+%60 = OpAccessChain %25 %15 %10 %28 %17 - OpStore %60 %59 --%62 = OpAccessChain %25 %24 %31 %61 -+%62 = OpAccessChain %25 %24 %28 %7 - %63 = OpLoad %6 %62 --%64 = OpAccessChain %25 %15 %37 %31 %31 -+%64 = OpAccessChain %25 %15 %10 %28 %28 - OpStore %64 %63 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, IndexSignednessNoDebug) { - constexpr char kSrcNoDebug[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpDecorate %8 ArrayStride 4 - OpDecorate %9 ArrayStride 4 - OpDecorate %11 ArrayStride 4 - OpDecorate %12 ArrayStride 8 - OpMemberDecorate %13 0 Offset 0 - OpMemberDecorate %13 1 Offset 12 - OpMemberDecorate %13 2 Offset 24 - OpDecorate %13 BufferBlock - OpDecorate %15 DescriptorSet 0 - OpDecorate %15 Binding 1 - OpDecorate %18 ArrayStride 16 - OpDecorate %19 ArrayStride 48 - OpDecorate %21 ArrayStride 16 - OpMemberDecorate %22 0 Offset 0 - OpMemberDecorate %22 1 Offset 96 - OpDecorate %22 Block - OpDecorate %24 DescriptorSet 0 - OpDecorate %24 Binding 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 0 - %7 = OpConstant %6 3 - %8 = OpTypeArray %6 %7 - %9 = OpTypeArray %6 %7 - %10 = OpConstant %6 2 - %11 = OpTypeArray %6 %10 - %12 = OpTypeArray %11 %10 - %13 = OpTypeStruct %8 %9 %12 - %14 = OpTypePointer Uniform %13 - %15 = OpVariable %14 Uniform - %16 = OpTypeInt 32 1 - %17 = OpConstant %16 0 - %18 = OpTypeArray %6 %7 - %19 = OpTypeArray %18 %10 - %20 = OpConstant %6 4 - %21 = OpTypeArray %6 %20 - %22 = OpTypeStruct %19 %21 - %23 = OpTypePointer Uniform %22 - %24 = OpVariable %23 Uniform - %25 = OpTypePointer Uniform %6 - %28 = OpConstant %6 1 - %31 = OpConstant %16 1 - %34 = OpConstant %6 0 - %37 = OpConstant %16 2 - %61 = OpConstant %16 3 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %26 = OpAccessChain %25 %24 %17 %17 %17 - %27 = OpLoad %6 %26 - %29 = OpIAdd %6 %27 %28 - %30 = OpAccessChain %25 %15 %17 %17 - OpStore %30 %29 - %32 = OpAccessChain %25 %24 %17 %31 %17 - %33 = OpLoad %6 %32 - %35 = OpIAdd %6 %33 %34 - %36 = OpAccessChain %25 %15 %17 %31 - OpStore %36 %35 - %38 = OpAccessChain %25 %24 %17 %31 %31 - %39 = OpLoad %6 %38 - %40 = OpIAdd %6 %39 %10 - %41 = OpAccessChain %25 %15 %17 %37 - OpStore %41 %40 - %42 = OpAccessChain %25 %24 %17 %17 %37 - %43 = OpLoad %6 %42 - %44 = OpAccessChain %25 %15 %31 %17 - OpStore %44 %43 - %45 = OpAccessChain %25 %24 %17 %17 %31 - %46 = OpLoad %6 %45 - %47 = OpIMul %6 %46 %7 - %48 = OpAccessChain %25 %15 %31 %31 - OpStore %48 %47 - %49 = OpAccessChain %25 %24 %17 %31 %37 - %50 = OpLoad %6 %49 - %51 = OpAccessChain %25 %15 %31 %37 - OpStore %51 %50 - %52 = OpAccessChain %25 %24 %31 %17 - %53 = OpLoad %6 %52 - %54 = OpAccessChain %25 %15 %37 %17 %17 - OpStore %54 %53 - %55 = OpAccessChain %25 %24 %31 %31 - %56 = OpLoad %6 %55 - %57 = OpAccessChain %25 %15 %37 %17 %31 - OpStore %57 %56 - %58 = OpAccessChain %25 %24 %31 %37 - %59 = OpLoad %6 %58 - %60 = OpAccessChain %25 %15 %37 %31 %17 - OpStore %60 %59 - %62 = OpAccessChain %25 %24 %31 %61 - %63 = OpLoad %6 %62 - %64 = OpAccessChain %25 %15 %37 %31 %31 - OpStore %64 %63 - OpReturn - OpFunctionEnd - -)"; - constexpr char kDstNoDebug[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpDecorate %8 ArrayStride 4 - OpDecorate %9 ArrayStride 4 - OpDecorate %11 ArrayStride 4 - OpDecorate %12 ArrayStride 8 - OpMemberDecorate %13 0 Offset 0 - OpMemberDecorate %13 1 Offset 12 - OpMemberDecorate %13 2 Offset 24 - OpDecorate %13 BufferBlock - OpDecorate %15 DescriptorSet 0 - OpDecorate %15 Binding 1 - OpDecorate %18 ArrayStride 16 - OpDecorate %19 ArrayStride 48 - OpDecorate %21 ArrayStride 16 - OpMemberDecorate %22 0 Offset 0 - OpMemberDecorate %22 1 Offset 96 - OpDecorate %22 Block - OpDecorate %24 DescriptorSet 0 - OpDecorate %24 Binding 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 0 - %16 = OpTypeInt 32 1 - %7 = OpConstant %16 3 - %8 = OpTypeArray %6 %7 - %9 = OpTypeArray %6 %7 - %10 = OpConstant %16 2 - %11 = OpTypeArray %6 %10 - %12 = OpTypeArray %11 %10 - %13 = OpTypeStruct %8 %9 %12 - %14 = OpTypePointer Uniform %13 - %15 = OpVariable %14 Uniform - %18 = OpTypeArray %6 %7 - %19 = OpTypeArray %18 %10 - %20 = OpConstant %16 4 - %21 = OpTypeArray %6 %20 - %22 = OpTypeStruct %19 %21 - %23 = OpTypePointer Uniform %22 - %24 = OpVariable %23 Uniform - %25 = OpTypePointer Uniform %6 - %17 = OpConstant %16 0 - %28 = OpConstant %16 1 - %31 = OpConstant %6 1 - %34 = OpConstant %6 0 - %37 = OpConstant %6 2 - %61 = OpConstant %6 3 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %26 = OpAccessChain %25 %24 %17 %17 %17 - %27 = OpLoad %6 %26 - %29 = OpIAdd %6 %27 %28 - %30 = OpAccessChain %25 %15 %17 %17 - OpStore %30 %29 - %32 = OpAccessChain %25 %24 %17 %31 %17 - %33 = OpLoad %6 %32 - %35 = OpIAdd %6 %33 %34 - %36 = OpAccessChain %25 %15 %17 %31 - OpStore %36 %35 - %38 = OpAccessChain %25 %24 %17 %31 %31 - %39 = OpLoad %6 %38 - %40 = OpIAdd %6 %39 %37 - %41 = OpAccessChain %25 %15 %17 %10 - OpStore %41 %40 - %42 = OpAccessChain %25 %24 %17 %17 %10 - %43 = OpLoad %6 %42 - %44 = OpAccessChain %25 %15 %31 %17 - OpStore %44 %43 - %45 = OpAccessChain %25 %24 %17 %17 %31 - %46 = OpLoad %6 %45 - %47 = OpIMul %6 %46 %7 - %48 = OpAccessChain %25 %15 %31 %31 - OpStore %48 %47 - %49 = OpAccessChain %25 %24 %17 %31 %10 - %50 = OpLoad %6 %49 - %51 = OpAccessChain %25 %15 %31 %10 - OpStore %51 %50 - %52 = OpAccessChain %25 %24 %31 %17 - %53 = OpLoad %6 %52 - %54 = OpAccessChain %25 %15 %37 %17 %17 - OpStore %54 %53 - %55 = OpAccessChain %25 %24 %31 %31 - %56 = OpLoad %6 %55 - %57 = OpAccessChain %25 %15 %37 %17 %31 - OpStore %57 %56 - %58 = OpAccessChain %25 %24 %31 %37 - %59 = OpLoad %6 %58 - %60 = OpAccessChain %25 %15 %37 %31 %17 - OpStore %60 %59 - %62 = OpAccessChain %25 %24 %31 %61 - %63 = OpLoad %6 %62 - %64 = OpAccessChain %25 %15 %37 %31 %31 - OpStore %64 %63 - OpReturn - OpFunctionEnd - -)"; - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 - ; Bound: 65 - ; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpDecorate %8 ArrayStride 4 - OpDecorate %9 ArrayStride 4 - OpDecorate %11 ArrayStride 4 - OpDecorate %12 ArrayStride 8 - OpMemberDecorate %13 0 Offset 0 - OpMemberDecorate %13 1 Offset 12 - OpMemberDecorate %13 2 Offset 24 - OpDecorate %13 BufferBlock - OpDecorate %15 DescriptorSet 0 - OpDecorate %15 Binding 1 - OpDecorate %18 ArrayStride 16 - OpDecorate %19 ArrayStride 48 - OpDecorate %21 ArrayStride 16 - OpMemberDecorate %22 0 Offset 0 - OpMemberDecorate %22 1 Offset 96 - OpDecorate %22 Block - OpDecorate %24 DescriptorSet 0 - OpDecorate %24 Binding 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 0 - %7 = OpConstant %6 3 --%8 = OpTypeArray %6 %7 -+%8 = OpTypeArray %6 %61 --%9 = OpTypeArray %6 %7 -+%9 = OpTypeArray %6 %61 - %10 = OpConstant %6 2 --%11 = OpTypeArray %6 %10 -+%11 = OpTypeArray %6 %37 --%12 = OpTypeArray %11 %10 -+%12 = OpTypeArray %11 %37 - %13 = OpTypeStruct %8 %9 %12 - %14 = OpTypePointer Uniform %13 - %15 = OpVariable %14 Uniform - %16 = OpTypeInt 32 1 - %17 = OpConstant %16 0 --%18 = OpTypeArray %6 %7 -+%18 = OpTypeArray %6 %61 --%19 = OpTypeArray %18 %10 -+%19 = OpTypeArray %18 %37 --%20 = OpConstant %6 4 -+%20 = OpConstant %16 4 - %21 = OpTypeArray %6 %20 - %22 = OpTypeStruct %19 %21 - %23 = OpTypePointer Uniform %22 - %24 = OpVariable %23 Uniform - %25 = OpTypePointer Uniform %6 - %28 = OpConstant %6 1 - %31 = OpConstant %16 1 - %34 = OpConstant %6 0 - %37 = OpConstant %16 2 - %61 = OpConstant %16 3 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %26 = OpAccessChain %25 %24 %17 %17 %17 - %27 = OpLoad %6 %26 --%29 = OpIAdd %6 %27 %28 -+%29 = OpIAdd %6 %27 %31 - %30 = OpAccessChain %25 %15 %17 %17 - OpStore %30 %29 --%32 = OpAccessChain %25 %24 %17 %31 %17 -+%32 = OpAccessChain %25 %24 %17 %28 %17 - %33 = OpLoad %6 %32 - %35 = OpIAdd %6 %33 %34 --%36 = OpAccessChain %25 %15 %17 %31 -+%36 = OpAccessChain %25 %15 %17 %28 - OpStore %36 %35 --%38 = OpAccessChain %25 %24 %17 %31 %31 -+%38 = OpAccessChain %25 %24 %17 %28 %28 - %39 = OpLoad %6 %38 - %40 = OpIAdd %6 %39 %10 - %41 = OpAccessChain %25 %15 %17 %37 - OpStore %41 %40 - %42 = OpAccessChain %25 %24 %17 %17 %37 - %43 = OpLoad %6 %42 --%44 = OpAccessChain %25 %15 %31 %17 -+%44 = OpAccessChain %25 %15 %28 %17 - OpStore %44 %43 --%45 = OpAccessChain %25 %24 %17 %17 %31 -+%45 = OpAccessChain %25 %24 %17 %17 %28 - %46 = OpLoad %6 %45 --%47 = OpIMul %6 %46 %7 -+%47 = OpIMul %6 %46 %61 --%48 = OpAccessChain %25 %15 %31 %31 -+%48 = OpAccessChain %25 %15 %28 %28 - OpStore %48 %47 --%49 = OpAccessChain %25 %24 %17 %31 %37 -+%49 = OpAccessChain %25 %24 %17 %28 %37 - %50 = OpLoad %6 %49 --%51 = OpAccessChain %25 %15 %31 %37 -+%51 = OpAccessChain %25 %15 %28 %37 - OpStore %51 %50 --%52 = OpAccessChain %25 %24 %31 %17 -+%52 = OpAccessChain %25 %24 %28 %17 - %53 = OpLoad %6 %52 --%54 = OpAccessChain %25 %15 %37 %17 %17 -+%54 = OpAccessChain %25 %15 %10 %17 %17 - OpStore %54 %53 --%55 = OpAccessChain %25 %24 %31 %31 -+%55 = OpAccessChain %25 %24 %28 %28 - %56 = OpLoad %6 %55 --%57 = OpAccessChain %25 %15 %37 %17 %31 -+%57 = OpAccessChain %25 %15 %10 %17 %28 - OpStore %57 %56 --%58 = OpAccessChain %25 %24 %31 %37 -+%58 = OpAccessChain %25 %24 %28 %10 - %59 = OpLoad %6 %58 --%60 = OpAccessChain %25 %15 %37 %31 %17 -+%60 = OpAccessChain %25 %15 %10 %28 %17 - OpStore %60 %59 --%62 = OpAccessChain %25 %24 %31 %61 -+%62 = OpAccessChain %25 %24 %28 %7 - %63 = OpLoad %6 %62 --%64 = OpAccessChain %25 %15 %37 %31 %31 -+%64 = OpAccessChain %25 %15 %10 %28 %28 - OpStore %64 %63 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_files/index_signedness_dst.spvasm b/test/diff/diff_files/index_signedness_dst.spvasm deleted file mode 100644 index 08c1939b..00000000 --- a/test/diff/diff_files/index_signedness_dst.spvasm +++ /dev/null @@ -1,110 +0,0 @@ - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "main" - OpName %13 "BufferOut" - OpMemberName %13 0 "o1" - OpMemberName %13 1 "o2" - OpMemberName %13 2 "o3" - OpName %15 "" - OpName %22 "BufferIn" - OpMemberName %22 0 "i1" - OpMemberName %22 1 "i2" - OpName %24 "" - OpDecorate %8 ArrayStride 4 - OpDecorate %9 ArrayStride 4 - OpDecorate %11 ArrayStride 4 - OpDecorate %12 ArrayStride 8 - OpMemberDecorate %13 0 Offset 0 - OpMemberDecorate %13 1 Offset 12 - OpMemberDecorate %13 2 Offset 24 - OpDecorate %13 BufferBlock - OpDecorate %15 DescriptorSet 0 - OpDecorate %15 Binding 1 - OpDecorate %18 ArrayStride 16 - OpDecorate %19 ArrayStride 48 - OpDecorate %21 ArrayStride 16 - OpMemberDecorate %22 0 Offset 0 - OpMemberDecorate %22 1 Offset 96 - OpDecorate %22 Block - OpDecorate %24 DescriptorSet 0 - OpDecorate %24 Binding 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 0 - %16 = OpTypeInt 32 1 - %7 = OpConstant %16 3 - %8 = OpTypeArray %6 %7 - %9 = OpTypeArray %6 %7 - %10 = OpConstant %16 2 - %11 = OpTypeArray %6 %10 - %12 = OpTypeArray %11 %10 - %13 = OpTypeStruct %8 %9 %12 - %14 = OpTypePointer Uniform %13 - %15 = OpVariable %14 Uniform - %18 = OpTypeArray %6 %7 - %19 = OpTypeArray %18 %10 - %20 = OpConstant %16 4 - %21 = OpTypeArray %6 %20 - %22 = OpTypeStruct %19 %21 - %23 = OpTypePointer Uniform %22 - %24 = OpVariable %23 Uniform - %25 = OpTypePointer Uniform %6 - %17 = OpConstant %16 0 - %28 = OpConstant %16 1 - %31 = OpConstant %6 1 - %34 = OpConstant %6 0 - %37 = OpConstant %6 2 - %61 = OpConstant %6 3 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %26 = OpAccessChain %25 %24 %17 %17 %17 - %27 = OpLoad %6 %26 - %29 = OpIAdd %6 %27 %28 - %30 = OpAccessChain %25 %15 %17 %17 - OpStore %30 %29 - %32 = OpAccessChain %25 %24 %17 %31 %17 - %33 = OpLoad %6 %32 - %35 = OpIAdd %6 %33 %34 - %36 = OpAccessChain %25 %15 %17 %31 - OpStore %36 %35 - %38 = OpAccessChain %25 %24 %17 %31 %31 - %39 = OpLoad %6 %38 - %40 = OpIAdd %6 %39 %37 - %41 = OpAccessChain %25 %15 %17 %10 - OpStore %41 %40 - %42 = OpAccessChain %25 %24 %17 %17 %10 - %43 = OpLoad %6 %42 - %44 = OpAccessChain %25 %15 %31 %17 - OpStore %44 %43 - %45 = OpAccessChain %25 %24 %17 %17 %31 - %46 = OpLoad %6 %45 - %47 = OpIMul %6 %46 %7 - %48 = OpAccessChain %25 %15 %31 %31 - OpStore %48 %47 - %49 = OpAccessChain %25 %24 %17 %31 %10 - %50 = OpLoad %6 %49 - %51 = OpAccessChain %25 %15 %31 %10 - OpStore %51 %50 - %52 = OpAccessChain %25 %24 %31 %17 - %53 = OpLoad %6 %52 - %54 = OpAccessChain %25 %15 %37 %17 %17 - OpStore %54 %53 - %55 = OpAccessChain %25 %24 %31 %31 - %56 = OpLoad %6 %55 - %57 = OpAccessChain %25 %15 %37 %17 %31 - OpStore %57 %56 - %58 = OpAccessChain %25 %24 %31 %37 - %59 = OpLoad %6 %58 - %60 = OpAccessChain %25 %15 %37 %31 %17 - OpStore %60 %59 - %62 = OpAccessChain %25 %24 %31 %61 - %63 = OpLoad %6 %62 - %64 = OpAccessChain %25 %15 %37 %31 %31 - OpStore %64 %63 - OpReturn - OpFunctionEnd - diff --git a/test/diff/diff_files/index_signedness_src.spvasm b/test/diff/diff_files/index_signedness_src.spvasm deleted file mode 100644 index 06dfd18b..00000000 --- a/test/diff/diff_files/index_signedness_src.spvasm +++ /dev/null @@ -1,111 +0,0 @@ -;; Test where signedness of indices are different between src and dst. - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "main" - OpName %13 "BufferOut" - OpMemberName %13 0 "o1" - OpMemberName %13 1 "o2" - OpMemberName %13 2 "o3" - OpName %15 "" - OpName %22 "BufferIn" - OpMemberName %22 0 "i1" - OpMemberName %22 1 "i2" - OpName %24 "" - OpDecorate %8 ArrayStride 4 - OpDecorate %9 ArrayStride 4 - OpDecorate %11 ArrayStride 4 - OpDecorate %12 ArrayStride 8 - OpMemberDecorate %13 0 Offset 0 - OpMemberDecorate %13 1 Offset 12 - OpMemberDecorate %13 2 Offset 24 - OpDecorate %13 BufferBlock - OpDecorate %15 DescriptorSet 0 - OpDecorate %15 Binding 1 - OpDecorate %18 ArrayStride 16 - OpDecorate %19 ArrayStride 48 - OpDecorate %21 ArrayStride 16 - OpMemberDecorate %22 0 Offset 0 - OpMemberDecorate %22 1 Offset 96 - OpDecorate %22 Block - OpDecorate %24 DescriptorSet 0 - OpDecorate %24 Binding 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 0 - %7 = OpConstant %6 3 - %8 = OpTypeArray %6 %7 - %9 = OpTypeArray %6 %7 - %10 = OpConstant %6 2 - %11 = OpTypeArray %6 %10 - %12 = OpTypeArray %11 %10 - %13 = OpTypeStruct %8 %9 %12 - %14 = OpTypePointer Uniform %13 - %15 = OpVariable %14 Uniform - %16 = OpTypeInt 32 1 - %17 = OpConstant %16 0 - %18 = OpTypeArray %6 %7 - %19 = OpTypeArray %18 %10 - %20 = OpConstant %6 4 - %21 = OpTypeArray %6 %20 - %22 = OpTypeStruct %19 %21 - %23 = OpTypePointer Uniform %22 - %24 = OpVariable %23 Uniform - %25 = OpTypePointer Uniform %6 - %28 = OpConstant %6 1 - %31 = OpConstant %16 1 - %34 = OpConstant %6 0 - %37 = OpConstant %16 2 - %61 = OpConstant %16 3 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %26 = OpAccessChain %25 %24 %17 %17 %17 - %27 = OpLoad %6 %26 - %29 = OpIAdd %6 %27 %28 - %30 = OpAccessChain %25 %15 %17 %17 - OpStore %30 %29 - %32 = OpAccessChain %25 %24 %17 %31 %17 - %33 = OpLoad %6 %32 - %35 = OpIAdd %6 %33 %34 - %36 = OpAccessChain %25 %15 %17 %31 - OpStore %36 %35 - %38 = OpAccessChain %25 %24 %17 %31 %31 - %39 = OpLoad %6 %38 - %40 = OpIAdd %6 %39 %10 - %41 = OpAccessChain %25 %15 %17 %37 - OpStore %41 %40 - %42 = OpAccessChain %25 %24 %17 %17 %37 - %43 = OpLoad %6 %42 - %44 = OpAccessChain %25 %15 %31 %17 - OpStore %44 %43 - %45 = OpAccessChain %25 %24 %17 %17 %31 - %46 = OpLoad %6 %45 - %47 = OpIMul %6 %46 %7 - %48 = OpAccessChain %25 %15 %31 %31 - OpStore %48 %47 - %49 = OpAccessChain %25 %24 %17 %31 %37 - %50 = OpLoad %6 %49 - %51 = OpAccessChain %25 %15 %31 %37 - OpStore %51 %50 - %52 = OpAccessChain %25 %24 %31 %17 - %53 = OpLoad %6 %52 - %54 = OpAccessChain %25 %15 %37 %17 %17 - OpStore %54 %53 - %55 = OpAccessChain %25 %24 %31 %31 - %56 = OpLoad %6 %55 - %57 = OpAccessChain %25 %15 %37 %17 %31 - OpStore %57 %56 - %58 = OpAccessChain %25 %24 %31 %37 - %59 = OpLoad %6 %58 - %60 = OpAccessChain %25 %15 %37 %31 %17 - OpStore %60 %59 - %62 = OpAccessChain %25 %24 %31 %61 - %63 = OpLoad %6 %62 - %64 = OpAccessChain %25 %15 %37 %31 %31 - OpStore %64 %63 - OpReturn - OpFunctionEnd - diff --git a/test/diff/diff_files/int_vs_uint_constants_autogen.cpp b/test/diff/diff_files/int_vs_uint_constants_autogen.cpp deleted file mode 100644 index 187722e8..00000000 --- a/test/diff/diff_files/int_vs_uint_constants_autogen.cpp +++ /dev/null @@ -1,396 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_tests.py -// -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -// Tests that identical integer constants are matched, regardless of int or -// uint. This helps compare output from different generators that default to -// int or uint for constants such as those passed to OpAccessChain. -constexpr char kSrc[] = R"(; SPIR-V -; Version: 1.0 -; Generator: Google ANGLE Shader Compiler; 0 -; Bound: 27 -; Schema: 0 -OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %22 "main" %4 %19 -OpSource GLSL 450 -OpName %4 "_ua_position" -OpName %17 "gl_PerVertex" -OpMemberName %17 0 "gl_Position" -OpMemberName %17 1 "gl_PointSize" -OpMemberName %17 2 "gl_ClipDistance" -OpMemberName %17 3 "gl_CullDistance" -OpName %19 "" -OpName %22 "main" -OpDecorate %4 Location 0 -OpMemberDecorate %17 1 RelaxedPrecision -OpMemberDecorate %17 0 BuiltIn Position -OpMemberDecorate %17 1 BuiltIn PointSize -OpMemberDecorate %17 2 BuiltIn ClipDistance -OpMemberDecorate %17 3 BuiltIn CullDistance -OpDecorate %17 Block -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%5 = OpTypeInt 32 0 -%8 = OpTypeVector %5 4 -%15 = OpConstant %5 8 -%16 = OpTypeArray %1 %15 -%17 = OpTypeStruct %2 %1 %16 %16 -%20 = OpTypeVoid -%25 = OpConstant %5 0 -%3 = OpTypePointer Input %2 -%13 = OpTypePointer Output %2 -%18 = OpTypePointer Output %17 -%21 = OpTypeFunction %20 -%4 = OpVariable %3 Input -%19 = OpVariable %18 Output -%22 = OpFunction %20 None %21 -%23 = OpLabel -%24 = OpLoad %2 %4 -%26 = OpAccessChain %13 %19 %25 -OpStore %26 %24 -OpReturn -OpFunctionEnd)"; -constexpr char kDst[] = R"(; SPIR-V -; Version: 1.0 -; Generator: Khronos Glslang Reference Front End; 10 -; Bound: 28 -; Schema: 0 -OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %4 "main" %13 %17 -OpSource GLSL 450 -OpName %4 "main" -OpName %11 "gl_PerVertex" -OpMemberName %11 0 "gl_Position" -OpMemberName %11 1 "gl_PointSize" -OpMemberName %11 2 "gl_ClipDistance" -OpMemberName %11 3 "gl_CullDistance" -OpName %13 "" -OpName %17 "_ua_position" -OpMemberDecorate %11 0 BuiltIn Position -OpMemberDecorate %11 1 BuiltIn PointSize -OpMemberDecorate %11 2 BuiltIn ClipDistance -OpMemberDecorate %11 3 BuiltIn CullDistance -OpDecorate %11 Block -OpDecorate %17 Location 0 -%2 = OpTypeVoid -%3 = OpTypeFunction %2 -%6 = OpTypeFloat 32 -%7 = OpTypeVector %6 4 -%8 = OpTypeInt 32 0 -%9 = OpConstant %8 1 -%10 = OpTypeArray %6 %9 -%11 = OpTypeStruct %7 %6 %10 %10 -%12 = OpTypePointer Output %11 -%13 = OpVariable %12 Output -%14 = OpTypeInt 32 1 -%15 = OpConstant %14 0 -%16 = OpTypePointer Input %7 -%17 = OpVariable %16 Input -%19 = OpTypePointer Output %7 -%4 = OpFunction %2 None %3 -%5 = OpLabel -%18 = OpLoad %7 %17 -%20 = OpAccessChain %19 %13 %15 -OpStore %20 %18 -OpReturn -OpFunctionEnd -)"; - -TEST(DiffTest, IntVsUintConstants) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 27 -+; Bound: 31 - ; Schema: 0 - OpCapability Shader -+%27 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 --OpEntryPoint Vertex %22 "main" %4 %19 -+OpEntryPoint Vertex %22 "main" %19 %4 - OpSource GLSL 450 - OpName %4 "_ua_position" - OpName %17 "gl_PerVertex" - OpMemberName %17 0 "gl_Position" - OpMemberName %17 1 "gl_PointSize" - OpMemberName %17 2 "gl_ClipDistance" - OpMemberName %17 3 "gl_CullDistance" - OpName %19 "" - OpName %22 "main" - OpDecorate %4 Location 0 --OpMemberDecorate %17 1 RelaxedPrecision - OpMemberDecorate %17 0 BuiltIn Position - OpMemberDecorate %17 1 BuiltIn PointSize - OpMemberDecorate %17 2 BuiltIn ClipDistance - OpMemberDecorate %17 3 BuiltIn CullDistance - OpDecorate %17 Block - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 - %5 = OpTypeInt 32 0 --%8 = OpTypeVector %5 4 --%15 = OpConstant %5 8 --%16 = OpTypeArray %1 %15 --%17 = OpTypeStruct %2 %1 %16 %16 -+%17 = OpTypeStruct %2 %1 %29 %29 - %20 = OpTypeVoid -+%28 = OpConstant %5 1 -+%29 = OpTypeArray %1 %28 --%25 = OpConstant %5 0 -+%25 = OpConstant %30 0 - %3 = OpTypePointer Input %2 - %13 = OpTypePointer Output %2 -+%30 = OpTypeInt 32 1 - %18 = OpTypePointer Output %17 - %21 = OpTypeFunction %20 - %4 = OpVariable %3 Input - %19 = OpVariable %18 Output - %22 = OpFunction %20 None %21 - %23 = OpLabel - %24 = OpLoad %2 %4 - %26 = OpAccessChain %13 %19 %25 - OpStore %26 %24 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, IntVsUintConstantsNoDebug) { - constexpr char kSrcNoDebug[] = R"(; SPIR-V -; Version: 1.0 -; Generator: Google ANGLE Shader Compiler; 0 -; Bound: 27 -; Schema: 0 -OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %22 "main" %4 %19 -OpSource GLSL 450 -OpDecorate %4 Location 0 -OpMemberDecorate %17 1 RelaxedPrecision -OpMemberDecorate %17 0 BuiltIn Position -OpMemberDecorate %17 1 BuiltIn PointSize -OpMemberDecorate %17 2 BuiltIn ClipDistance -OpMemberDecorate %17 3 BuiltIn CullDistance -OpDecorate %17 Block -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%5 = OpTypeInt 32 0 -%8 = OpTypeVector %5 4 -%15 = OpConstant %5 8 -%16 = OpTypeArray %1 %15 -%17 = OpTypeStruct %2 %1 %16 %16 -%20 = OpTypeVoid -%25 = OpConstant %5 0 -%3 = OpTypePointer Input %2 -%13 = OpTypePointer Output %2 -%18 = OpTypePointer Output %17 -%21 = OpTypeFunction %20 -%4 = OpVariable %3 Input -%19 = OpVariable %18 Output -%22 = OpFunction %20 None %21 -%23 = OpLabel -%24 = OpLoad %2 %4 -%26 = OpAccessChain %13 %19 %25 -OpStore %26 %24 -OpReturn -OpFunctionEnd -)"; - constexpr char kDstNoDebug[] = R"(; SPIR-V -; Version: 1.0 -; Generator: Khronos Glslang Reference Front End; 10 -; Bound: 28 -; Schema: 0 -OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %4 "main" %13 %17 -OpSource GLSL 450 -OpMemberDecorate %11 0 BuiltIn Position -OpMemberDecorate %11 1 BuiltIn PointSize -OpMemberDecorate %11 2 BuiltIn ClipDistance -OpMemberDecorate %11 3 BuiltIn CullDistance -OpDecorate %11 Block -OpDecorate %17 Location 0 -%2 = OpTypeVoid -%3 = OpTypeFunction %2 -%6 = OpTypeFloat 32 -%7 = OpTypeVector %6 4 -%8 = OpTypeInt 32 0 -%9 = OpConstant %8 1 -%10 = OpTypeArray %6 %9 -%11 = OpTypeStruct %7 %6 %10 %10 -%12 = OpTypePointer Output %11 -%13 = OpVariable %12 Output -%14 = OpTypeInt 32 1 -%15 = OpConstant %14 0 -%16 = OpTypePointer Input %7 -%17 = OpVariable %16 Input -%19 = OpTypePointer Output %7 -%4 = OpFunction %2 None %3 -%5 = OpLabel -%18 = OpLoad %7 %17 -%20 = OpAccessChain %19 %13 %15 -OpStore %20 %18 -OpReturn -OpFunctionEnd -)"; - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 27 -+; Bound: 31 - ; Schema: 0 - OpCapability Shader -+%27 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 --OpEntryPoint Vertex %22 "main" %4 %19 -+OpEntryPoint Vertex %22 "main" %19 %4 - OpSource GLSL 450 - OpDecorate %4 Location 0 --OpMemberDecorate %17 1 RelaxedPrecision - OpMemberDecorate %17 0 BuiltIn Position - OpMemberDecorate %17 1 BuiltIn PointSize - OpMemberDecorate %17 2 BuiltIn ClipDistance - OpMemberDecorate %17 3 BuiltIn CullDistance - OpDecorate %17 Block - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 - %5 = OpTypeInt 32 0 --%8 = OpTypeVector %5 4 --%15 = OpConstant %5 8 --%16 = OpTypeArray %1 %15 --%17 = OpTypeStruct %2 %1 %16 %16 -+%17 = OpTypeStruct %2 %1 %29 %29 - %20 = OpTypeVoid -+%28 = OpConstant %5 1 -+%29 = OpTypeArray %1 %28 --%25 = OpConstant %5 0 -+%25 = OpConstant %30 0 - %3 = OpTypePointer Input %2 - %13 = OpTypePointer Output %2 -+%30 = OpTypeInt 32 1 - %18 = OpTypePointer Output %17 - %21 = OpTypeFunction %20 - %4 = OpVariable %3 Input - %19 = OpVariable %18 Output - %22 = OpFunction %20 None %21 - %23 = OpLabel - %24 = OpLoad %2 %4 - %26 = OpAccessChain %13 %19 %25 - OpStore %26 %24 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -} - -TEST(DiffTest, IntVsUintConstantsDumpIds) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 27 -+; Bound: 31 - ; Schema: 0 - OpCapability Shader -+%27 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 --OpEntryPoint Vertex %22 "main" %4 %19 -+OpEntryPoint Vertex %22 "main" %19 %4 - OpSource GLSL 450 - OpName %4 "_ua_position" - OpName %17 "gl_PerVertex" - OpMemberName %17 0 "gl_Position" - OpMemberName %17 1 "gl_PointSize" - OpMemberName %17 2 "gl_ClipDistance" - OpMemberName %17 3 "gl_CullDistance" - OpName %19 "" - OpName %22 "main" - OpDecorate %4 Location 0 --OpMemberDecorate %17 1 RelaxedPrecision - OpMemberDecorate %17 0 BuiltIn Position - OpMemberDecorate %17 1 BuiltIn PointSize - OpMemberDecorate %17 2 BuiltIn ClipDistance - OpMemberDecorate %17 3 BuiltIn CullDistance - OpDecorate %17 Block - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 - %5 = OpTypeInt 32 0 --%8 = OpTypeVector %5 4 --%15 = OpConstant %5 8 --%16 = OpTypeArray %1 %15 --%17 = OpTypeStruct %2 %1 %16 %16 -+%17 = OpTypeStruct %2 %1 %29 %29 - %20 = OpTypeVoid -+%28 = OpConstant %5 1 -+%29 = OpTypeArray %1 %28 --%25 = OpConstant %5 0 -+%25 = OpConstant %30 0 - %3 = OpTypePointer Input %2 - %13 = OpTypePointer Output %2 -+%30 = OpTypeInt 32 1 - %18 = OpTypePointer Output %17 - %21 = OpTypeFunction %20 - %4 = OpVariable %3 Input - %19 = OpVariable %18 Output - %22 = OpFunction %20 None %21 - %23 = OpLabel - %24 = OpLoad %2 %4 - %26 = OpAccessChain %13 %19 %25 - OpStore %26 %24 - OpReturn - OpFunctionEnd - Src -> Dst - 1 -> 6 [TypeFloat] - 2 -> 7 [TypeVector] - 3 -> 16 [TypePointer] - 4 -> 17 [Variable] - 5 -> 8 [TypeInt] - 8 -> 23 [TypeVector] - 13 -> 19 [TypePointer] - 15 -> 29 [Constant] - 16 -> 30 [TypeArray] - 17 -> 11 [TypeStruct] - 18 -> 12 [TypePointer] - 19 -> 13 [Variable] - 20 -> 2 [TypeVoid] - 21 -> 3 [TypeFunction] - 22 -> 4 [Function] - 23 -> 5 [Label] - 24 -> 18 [Load] - 25 -> 15 [Constant] - 26 -> 20 [AccessChain] -)"; - Options options; - options.dump_id_map = true; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_files/int_vs_uint_constants_dst.spvasm b/test/diff/diff_files/int_vs_uint_constants_dst.spvasm deleted file mode 100644 index da2618b2..00000000 --- a/test/diff/diff_files/int_vs_uint_constants_dst.spvasm +++ /dev/null @@ -1,46 +0,0 @@ -; SPIR-V -; Version: 1.0 -; Generator: Khronos Glslang Reference Front End; 10 -; Bound: 28 -; Schema: 0 -OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %4 "main" %13 %17 -OpSource GLSL 450 -OpName %4 "main" -OpName %11 "gl_PerVertex" -OpMemberName %11 0 "gl_Position" -OpMemberName %11 1 "gl_PointSize" -OpMemberName %11 2 "gl_ClipDistance" -OpMemberName %11 3 "gl_CullDistance" -OpName %13 "" -OpName %17 "_ua_position" -OpMemberDecorate %11 0 BuiltIn Position -OpMemberDecorate %11 1 BuiltIn PointSize -OpMemberDecorate %11 2 BuiltIn ClipDistance -OpMemberDecorate %11 3 BuiltIn CullDistance -OpDecorate %11 Block -OpDecorate %17 Location 0 -%2 = OpTypeVoid -%3 = OpTypeFunction %2 -%6 = OpTypeFloat 32 -%7 = OpTypeVector %6 4 -%8 = OpTypeInt 32 0 -%9 = OpConstant %8 1 -%10 = OpTypeArray %6 %9 -%11 = OpTypeStruct %7 %6 %10 %10 -%12 = OpTypePointer Output %11 -%13 = OpVariable %12 Output -%14 = OpTypeInt 32 1 -%15 = OpConstant %14 0 -%16 = OpTypePointer Input %7 -%17 = OpVariable %16 Input -%19 = OpTypePointer Output %7 -%4 = OpFunction %2 None %3 -%5 = OpLabel -%18 = OpLoad %7 %17 -%20 = OpAccessChain %19 %13 %15 -OpStore %20 %18 -OpReturn -OpFunctionEnd diff --git a/test/diff/diff_files/int_vs_uint_constants_src.spvasm b/test/diff/diff_files/int_vs_uint_constants_src.spvasm deleted file mode 100644 index 214b49bd..00000000 --- a/test/diff/diff_files/int_vs_uint_constants_src.spvasm +++ /dev/null @@ -1,49 +0,0 @@ -;; Tests that identical integer constants are matched, regardless of int or -;; uint. This helps compare output from different generators that default to -;; int or uint for constants such as those passed to OpAccessChain. -; SPIR-V -; Version: 1.0 -; Generator: Google ANGLE Shader Compiler; 0 -; Bound: 27 -; Schema: 0 -OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %22 "main" %4 %19 -OpSource GLSL 450 -OpName %4 "_ua_position" -OpName %17 "gl_PerVertex" -OpMemberName %17 0 "gl_Position" -OpMemberName %17 1 "gl_PointSize" -OpMemberName %17 2 "gl_ClipDistance" -OpMemberName %17 3 "gl_CullDistance" -OpName %19 "" -OpName %22 "main" -OpDecorate %4 Location 0 -OpMemberDecorate %17 1 RelaxedPrecision -OpMemberDecorate %17 0 BuiltIn Position -OpMemberDecorate %17 1 BuiltIn PointSize -OpMemberDecorate %17 2 BuiltIn ClipDistance -OpMemberDecorate %17 3 BuiltIn CullDistance -OpDecorate %17 Block -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%5 = OpTypeInt 32 0 -%8 = OpTypeVector %5 4 -%15 = OpConstant %5 8 -%16 = OpTypeArray %1 %15 -%17 = OpTypeStruct %2 %1 %16 %16 -%20 = OpTypeVoid -%25 = OpConstant %5 0 -%3 = OpTypePointer Input %2 -%13 = OpTypePointer Output %2 -%18 = OpTypePointer Output %17 -%21 = OpTypeFunction %20 -%4 = OpVariable %3 Input -%19 = OpVariable %18 Output -%22 = OpFunction %20 None %21 -%23 = OpLabel -%24 = OpLoad %2 %4 -%26 = OpAccessChain %13 %19 %25 -OpStore %26 %24 -OpReturn -OpFunctionEnd diff --git a/test/diff/diff_files/large_functions_large_diffs_autogen.cpp b/test/diff/diff_files/large_functions_large_diffs_autogen.cpp deleted file mode 100644 index 12cb6219..00000000 --- a/test/diff/diff_files/large_functions_large_diffs_autogen.cpp +++ /dev/null @@ -1,1534 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_tests.py -// -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -// Test where src and dst have a few large functions with large differences. -constexpr char kSrc[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" %15 - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "main" - OpName %6 "f1(" - OpName %8 "f2(" - OpName %12 "x" - OpName %15 "gl_LocalInvocationID" - OpName %20 "y" - OpName %27 "image" - OpName %44 "sum" - OpName %46 "i" - OpName %56 "j" - OpName %80 "BufferOut" - OpMemberName %80 0 "o_uv4" - OpMemberName %80 1 "o_v3" - OpMemberName %80 2 "o_i" - OpName %82 "" - OpName %88 "BufferIn" - OpMemberName %88 0 "i_u" - OpMemberName %88 1 "i_v4" - OpMemberName %88 2 "i_f" - OpName %90 "" - OpName %101 "i" - OpName %128 "image2" - OpDecorate %15 BuiltIn LocalInvocationId - OpDecorate %27 DescriptorSet 0 - OpDecorate %27 Binding 2 - OpMemberDecorate %80 0 Offset 0 - OpMemberDecorate %80 1 Offset 16 - OpMemberDecorate %80 2 Offset 28 - OpDecorate %80 BufferBlock - OpDecorate %82 DescriptorSet 0 - OpDecorate %82 Binding 1 - OpMemberDecorate %88 0 Offset 0 - OpMemberDecorate %88 1 RowMajor - OpMemberDecorate %88 1 Offset 16 - OpMemberDecorate %88 1 MatrixStride 16 - OpMemberDecorate %88 2 Offset 80 - OpDecorate %88 Block - OpDecorate %90 DescriptorSet 0 - OpDecorate %90 Binding 0 - OpDecorate %128 DescriptorSet 0 - OpDecorate %128 Binding 3 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %10 = OpTypeInt 32 0 - %11 = OpTypePointer Function %10 - %13 = OpTypeVector %10 3 - %14 = OpTypePointer Input %13 - %15 = OpVariable %14 Input - %16 = OpConstant %10 0 - %17 = OpTypePointer Input %10 - %21 = OpConstant %10 1 - %24 = OpTypeInt 32 1 - %25 = OpTypeImage %24 2D 0 0 0 2 R32i - %26 = OpTypePointer UniformConstant %25 - %27 = OpVariable %26 UniformConstant - %29 = OpTypeVector %10 2 - %32 = OpTypeVector %24 2 - %38 = OpTypeVector %24 4 - %40 = OpConstant %10 2 - %41 = OpConstant %10 3400 - %42 = OpConstant %10 264 - %43 = OpTypePointer Function %24 - %45 = OpConstant %24 0 - %53 = OpConstant %24 2 - %54 = OpTypeBool - %73 = OpConstant %24 1 - %77 = OpTypeVector %10 4 - %78 = OpTypeFloat 32 - %79 = OpTypeVector %78 3 - %80 = OpTypeStruct %77 %79 %24 - %81 = OpTypePointer Uniform %80 - %82 = OpVariable %81 Uniform - %84 = OpTypePointer Uniform %24 - %86 = OpTypeVector %78 4 - %87 = OpTypeMatrix %86 4 - %88 = OpTypeStruct %10 %87 %78 - %89 = OpTypePointer Uniform %88 - %90 = OpVariable %89 Uniform - %91 = OpTypePointer Uniform %87 - %94 = OpTypePointer Uniform %77 - %108 = OpConstant %24 3 - %110 = OpTypePointer Uniform %79 - %113 = OpTypePointer Uniform %78 - %128 = OpVariable %26 UniformConstant - %130 = OpConstantComposite %32 %45 %45 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %136 = OpFunctionCall %2 %6 - %137 = OpFunctionCall %2 %8 - OpReturn - OpFunctionEnd - %6 = OpFunction %2 None %3 - %7 = OpLabel - %12 = OpVariable %11 Function - %20 = OpVariable %11 Function - %44 = OpVariable %43 Function - %46 = OpVariable %43 Function - %56 = OpVariable %43 Function - %18 = OpAccessChain %17 %15 %16 - %19 = OpLoad %10 %18 - OpStore %12 %19 - %22 = OpAccessChain %17 %15 %21 - %23 = OpLoad %10 %22 - OpStore %20 %23 - %28 = OpLoad %25 %27 - %30 = OpLoad %13 %15 - %31 = OpVectorShuffle %29 %30 %30 0 1 - %33 = OpBitcast %32 %31 - %34 = OpLoad %10 %12 - %35 = OpLoad %10 %20 - %36 = OpIAdd %10 %34 %35 - %37 = OpBitcast %24 %36 - %39 = OpCompositeConstruct %38 %37 %37 %37 %37 - OpImageWrite %28 %33 %39 - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - OpStore %44 %45 - OpStore %46 %45 - OpBranch %47 - %47 = OpLabel - OpLoopMerge %49 %50 None - OpBranch %51 - %51 = OpLabel - %52 = OpLoad %24 %46 - %55 = OpSLessThan %54 %52 %53 - OpBranchConditional %55 %48 %49 - %48 = OpLabel - OpStore %56 %45 - OpBranch %57 - %57 = OpLabel - OpLoopMerge %59 %60 None - OpBranch %61 - %61 = OpLabel - %62 = OpLoad %24 %56 - %63 = OpSLessThan %54 %62 %53 - OpBranchConditional %63 %58 %59 - %58 = OpLabel - %64 = OpLoad %25 %27 - %65 = OpLoad %24 %46 - %66 = OpLoad %24 %56 - %67 = OpCompositeConstruct %32 %65 %66 - %68 = OpImageRead %38 %64 %67 - %69 = OpCompositeExtract %24 %68 0 - %70 = OpLoad %24 %44 - %71 = OpIMul %24 %70 %69 - OpStore %44 %71 - OpBranch %60 - %60 = OpLabel - %72 = OpLoad %24 %56 - %74 = OpIAdd %24 %72 %73 - OpStore %56 %74 - OpBranch %57 - %59 = OpLabel - OpBranch %50 - %50 = OpLabel - %75 = OpLoad %24 %46 - %76 = OpIAdd %24 %75 %73 - OpStore %46 %76 - OpBranch %47 - %49 = OpLabel - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - %83 = OpLoad %24 %44 - %85 = OpAccessChain %84 %82 %53 - OpStore %85 %83 - OpReturn - OpFunctionEnd - %8 = OpFunction %2 None %3 - %9 = OpLabel - %101 = OpVariable %43 Function - %92 = OpAccessChain %91 %90 %73 - %93 = OpLoad %87 %92 - %95 = OpAccessChain %94 %82 %45 - %96 = OpLoad %77 %95 - %97 = OpConvertUToF %86 %96 - %98 = OpMatrixTimesVector %86 %93 %97 - %99 = OpConvertFToU %77 %98 - %100 = OpAccessChain %94 %82 %45 - OpStore %100 %99 - OpStore %101 %45 - OpBranch %102 - %102 = OpLabel - OpLoopMerge %104 %105 None - OpBranch %106 - %106 = OpLabel - %107 = OpLoad %24 %101 - %109 = OpSLessThan %54 %107 %108 - OpBranchConditional %109 %103 %104 - %103 = OpLabel - %111 = OpAccessChain %110 %82 %73 - %112 = OpLoad %79 %111 - %114 = OpAccessChain %113 %90 %53 - %115 = OpLoad %78 %114 - %116 = OpVectorTimesScalar %79 %112 %115 - %117 = OpConvertFToU %13 %116 - %118 = OpCompositeExtract %10 %117 0 - %119 = OpCompositeExtract %10 %117 1 - %120 = OpCompositeExtract %10 %117 2 - %121 = OpCompositeConstruct %77 %118 %119 %120 %16 - %122 = OpAccessChain %94 %82 %45 - %123 = OpLoad %77 %122 - %124 = OpIAdd %77 %123 %121 - %125 = OpAccessChain %94 %82 %45 - OpStore %125 %124 - OpBranch %105 - %105 = OpLabel - %126 = OpLoad %24 %101 - %127 = OpIAdd %24 %126 %73 - OpStore %101 %127 - OpBranch %102 - %104 = OpLabel - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - %129 = OpLoad %25 %128 - %131 = OpImageRead %38 %129 %130 - %132 = OpCompositeExtract %24 %131 0 - %133 = OpConvertSToF %78 %132 - %134 = OpCompositeConstruct %79 %133 %133 %133 - %135 = OpAccessChain %110 %82 %73 - OpStore %135 %134 - OpReturn - OpFunctionEnd -)"; -constexpr char kDst[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" %15 %110 - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "main" - OpName %6 "f1(" - OpName %8 "f2(" - OpName %12 "x" - OpName %15 "gl_GlobalInvocationID" - OpName %20 "z" - OpName %26 "i" - OpName %40 "BufferOut" - OpMemberName %40 0 "o_uv4" - OpMemberName %40 1 "o_v3" - OpMemberName %40 2 "o_i" - OpName %42 "" - OpName %63 "image2" - OpName %79 "image" - OpName %89 "i" - OpName %110 "gl_LocalInvocationID" - OpName %127 "BufferIn" - OpMemberName %127 0 "i_u" - OpMemberName %127 1 "i_v4" - OpMemberName %127 2 "i_f" - OpName %129 "" - OpDecorate %15 BuiltIn GlobalInvocationId - OpMemberDecorate %40 0 Offset 0 - OpMemberDecorate %40 1 Offset 16 - OpMemberDecorate %40 2 Offset 28 - OpDecorate %40 BufferBlock - OpDecorate %42 DescriptorSet 0 - OpDecorate %42 Binding 1 - OpDecorate %63 DescriptorSet 0 - OpDecorate %63 Binding 3 - OpDecorate %79 DescriptorSet 0 - OpDecorate %79 Binding 2 - OpDecorate %110 BuiltIn LocalInvocationId - OpMemberDecorate %127 0 Offset 0 - OpMemberDecorate %127 1 RowMajor - OpMemberDecorate %127 1 Offset 16 - OpMemberDecorate %127 1 MatrixStride 16 - OpMemberDecorate %127 2 Offset 80 - OpDecorate %127 Block - OpDecorate %129 DescriptorSet 0 - OpDecorate %129 Binding 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %10 = OpTypeInt 32 0 - %11 = OpTypePointer Function %10 - %13 = OpTypeVector %10 3 - %14 = OpTypePointer Input %13 - %15 = OpVariable %14 Input - %16 = OpConstant %10 0 - %17 = OpTypePointer Input %10 - %21 = OpConstant %10 1 - %24 = OpTypeInt 32 1 - %25 = OpTypePointer Function %24 - %27 = OpConstant %24 0 - %34 = OpConstant %24 2 - %35 = OpTypeBool - %37 = OpTypeVector %10 4 - %38 = OpTypeFloat 32 - %39 = OpTypeVector %38 3 - %40 = OpTypeStruct %37 %39 %24 - %41 = OpTypePointer Uniform %40 - %42 = OpVariable %41 Uniform - %46 = OpTypeVector %10 2 - %48 = OpTypePointer Uniform %37 - %53 = OpTypePointer Uniform %10 - %59 = OpConstant %24 1 - %61 = OpTypeImage %24 2D 0 0 0 2 R32i - %62 = OpTypePointer UniformConstant %61 - %63 = OpVariable %62 UniformConstant - %69 = OpTypeVector %24 2 - %71 = OpTypeVector %24 4 - %74 = OpTypePointer Uniform %24 - %76 = OpConstant %10 2 - %77 = OpConstant %10 3400 - %78 = OpConstant %10 264 - %79 = OpVariable %62 UniformConstant - %96 = OpConstant %24 3 - %103 = OpConstantComposite %69 %27 %27 - %107 = OpTypePointer Uniform %38 - %110 = OpVariable %14 Input - %113 = OpTypeVector %38 2 - %125 = OpTypeVector %38 4 - %126 = OpTypeMatrix %125 4 - %127 = OpTypeStruct %10 %126 %38 - %128 = OpTypePointer Uniform %127 - %129 = OpVariable %128 Uniform - %4 = OpFunction %2 None %3 - %5 = OpLabel - %123 = OpFunctionCall %2 %8 - %124 = OpFunctionCall %2 %6 - OpReturn - OpFunctionEnd - %6 = OpFunction %2 None %3 - %7 = OpLabel - %12 = OpVariable %11 Function - %20 = OpVariable %11 Function - %26 = OpVariable %25 Function - %18 = OpAccessChain %17 %15 %16 - %19 = OpLoad %10 %18 - OpStore %12 %19 - %22 = OpAccessChain %17 %15 %21 - %23 = OpLoad %10 %22 - OpStore %20 %23 - OpStore %26 %27 - OpBranch %28 - %28 = OpLabel - OpLoopMerge %30 %31 None - OpBranch %32 - %32 = OpLabel - %33 = OpLoad %24 %26 - %36 = OpSLessThan %35 %33 %34 - OpBranchConditional %36 %29 %30 - %29 = OpLabel - %43 = OpLoad %10 %12 - %44 = OpLoad %10 %20 - %45 = OpIAdd %10 %43 %44 - %47 = OpCompositeConstruct %46 %45 %45 - %49 = OpAccessChain %48 %42 %27 - %50 = OpLoad %37 %49 - %51 = OpVectorShuffle %46 %50 %50 0 1 - %52 = OpIAdd %46 %51 %47 - %54 = OpAccessChain %53 %42 %27 %16 - %55 = OpCompositeExtract %10 %52 0 - OpStore %54 %55 - %56 = OpAccessChain %53 %42 %27 %21 - %57 = OpCompositeExtract %10 %52 1 - OpStore %56 %57 - OpBranch %31 - %31 = OpLabel - %58 = OpLoad %24 %26 - %60 = OpIAdd %24 %58 %59 - OpStore %26 %60 - OpBranch %28 - %30 = OpLabel - %64 = OpLoad %61 %63 - %65 = OpLoad %10 %12 - %66 = OpBitcast %24 %65 - %67 = OpLoad %10 %20 - %68 = OpBitcast %24 %67 - %70 = OpCompositeConstruct %69 %66 %68 - %72 = OpImageRead %71 %64 %70 - %73 = OpCompositeExtract %24 %72 1 - %75 = OpAccessChain %74 %42 %34 - OpStore %75 %73 - OpMemoryBarrier %76 %77 - OpControlBarrier %76 %76 %78 - %80 = OpLoad %61 %79 - %81 = OpLoad %10 %20 - %82 = OpBitcast %24 %81 - %83 = OpLoad %10 %12 - %84 = OpBitcast %24 %83 - %85 = OpCompositeConstruct %69 %82 %84 - %86 = OpAccessChain %74 %42 %34 - %87 = OpLoad %24 %86 - %88 = OpCompositeConstruct %71 %87 %27 %27 %27 - OpImageWrite %80 %85 %88 - OpReturn - OpFunctionEnd - %8 = OpFunction %2 None %3 - %9 = OpLabel - %89 = OpVariable %25 Function - OpStore %89 %27 - OpBranch %90 - %90 = OpLabel - OpLoopMerge %92 %93 None - OpBranch %94 - %94 = OpLabel - %95 = OpLoad %24 %89 - %97 = OpSLessThan %35 %95 %96 - OpBranchConditional %97 %91 %92 - %91 = OpLabel - %98 = OpLoad %24 %89 - %99 = OpIEqual %35 %98 %27 - OpSelectionMerge %101 None - OpBranchConditional %99 %100 %109 - %100 = OpLabel - %102 = OpLoad %61 %63 - %104 = OpImageRead %71 %102 %103 - %105 = OpCompositeExtract %24 %104 0 - %106 = OpConvertSToF %38 %105 - %108 = OpAccessChain %107 %42 %59 %16 - OpStore %108 %106 - OpBranch %101 - %109 = OpLabel - %111 = OpLoad %13 %110 - %112 = OpConvertUToF %39 %111 - %114 = OpCompositeExtract %38 %112 0 - %115 = OpCompositeExtract %38 %112 1 - %116 = OpCompositeConstruct %113 %114 %115 - %117 = OpAccessChain %107 %42 %59 %21 - %118 = OpCompositeExtract %38 %116 0 - OpStore %117 %118 - %119 = OpAccessChain %107 %42 %59 %76 - %120 = OpCompositeExtract %38 %116 1 - OpStore %119 %120 - OpBranch %101 - %101 = OpLabel - OpBranch %93 - %93 = OpLabel - %121 = OpLoad %24 %89 - %122 = OpIAdd %24 %121 %59 - OpStore %89 %122 - OpBranch %90 - %92 = OpLabel - OpReturn - OpFunctionEnd - -)"; - -TEST(DiffTest, LargeFunctionsLargeDiffs) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 138 -+; Bound: 190 - ; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 --OpEntryPoint GLCompute %4 "main" %15 -+OpEntryPoint GLCompute %4 "main" %138 %15 - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "main" - OpName %6 "f1(" - OpName %8 "f2(" - OpName %12 "x" -+OpName %138 "gl_GlobalInvocationID" - OpName %15 "gl_LocalInvocationID" --OpName %20 "y" -+OpName %20 "z" - OpName %27 "image" --OpName %44 "sum" -+OpName %44 "i" --OpName %46 "i" --OpName %56 "j" - OpName %80 "BufferOut" - OpMemberName %80 0 "o_uv4" - OpMemberName %80 1 "o_v3" - OpMemberName %80 2 "o_i" - OpName %82 "" - OpName %88 "BufferIn" - OpMemberName %88 0 "i_u" - OpMemberName %88 1 "i_v4" - OpMemberName %88 2 "i_f" - OpName %90 "" - OpName %101 "i" - OpName %128 "image2" -+OpDecorate %138 BuiltIn GlobalInvocationId - OpDecorate %15 BuiltIn LocalInvocationId - OpDecorate %27 DescriptorSet 0 - OpDecorate %27 Binding 2 - OpMemberDecorate %80 0 Offset 0 - OpMemberDecorate %80 1 Offset 16 - OpMemberDecorate %80 2 Offset 28 - OpDecorate %80 BufferBlock - OpDecorate %82 DescriptorSet 0 - OpDecorate %82 Binding 1 - OpMemberDecorate %88 0 Offset 0 - OpMemberDecorate %88 1 RowMajor - OpMemberDecorate %88 1 Offset 16 - OpMemberDecorate %88 1 MatrixStride 16 - OpMemberDecorate %88 2 Offset 80 - OpDecorate %88 Block - OpDecorate %90 DescriptorSet 0 - OpDecorate %90 Binding 0 - OpDecorate %128 DescriptorSet 0 - OpDecorate %128 Binding 3 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %10 = OpTypeInt 32 0 - %11 = OpTypePointer Function %10 - %13 = OpTypeVector %10 3 - %14 = OpTypePointer Input %13 -+%138 = OpVariable %14 Input - %15 = OpVariable %14 Input - %16 = OpConstant %10 0 - %17 = OpTypePointer Input %10 - %21 = OpConstant %10 1 - %24 = OpTypeInt 32 1 - %25 = OpTypeImage %24 2D 0 0 0 2 R32i - %26 = OpTypePointer UniformConstant %25 - %27 = OpVariable %26 UniformConstant - %29 = OpTypeVector %10 2 - %32 = OpTypeVector %24 2 - %38 = OpTypeVector %24 4 - %40 = OpConstant %10 2 - %41 = OpConstant %10 3400 - %42 = OpConstant %10 264 - %43 = OpTypePointer Function %24 - %45 = OpConstant %24 0 -+%149 = OpTypePointer Uniform %10 - %53 = OpConstant %24 2 - %54 = OpTypeBool - %73 = OpConstant %24 1 - %77 = OpTypeVector %10 4 - %78 = OpTypeFloat 32 - %79 = OpTypeVector %78 3 - %80 = OpTypeStruct %77 %79 %24 - %81 = OpTypePointer Uniform %80 - %82 = OpVariable %81 Uniform - %84 = OpTypePointer Uniform %24 - %86 = OpTypeVector %78 4 - %87 = OpTypeMatrix %86 4 - %88 = OpTypeStruct %10 %87 %78 - %89 = OpTypePointer Uniform %88 - %90 = OpVariable %89 Uniform --%91 = OpTypePointer Uniform %87 -+%179 = OpTypeVector %78 2 - %94 = OpTypePointer Uniform %77 - %108 = OpConstant %24 3 --%110 = OpTypePointer Uniform %79 - %113 = OpTypePointer Uniform %78 - %128 = OpVariable %26 UniformConstant - %130 = OpConstantComposite %32 %45 %45 - %4 = OpFunction %2 None %3 - %5 = OpLabel --%136 = OpFunctionCall %2 %6 - %137 = OpFunctionCall %2 %8 -+%189 = OpFunctionCall %2 %6 - OpReturn - OpFunctionEnd - %6 = OpFunction %2 None %3 - %7 = OpLabel - %12 = OpVariable %11 Function - %20 = OpVariable %11 Function - %44 = OpVariable %43 Function --%46 = OpVariable %43 Function --%56 = OpVariable %43 Function --%18 = OpAccessChain %17 %15 %16 -+%139 = OpAccessChain %17 %138 %16 --%19 = OpLoad %10 %18 -+%19 = OpLoad %10 %139 - OpStore %12 %19 --%22 = OpAccessChain %17 %15 %21 -+%140 = OpAccessChain %17 %138 %21 --%23 = OpLoad %10 %22 -+%23 = OpLoad %10 %140 - OpStore %20 %23 --%28 = OpLoad %25 %27 --%30 = OpLoad %13 %15 --%31 = OpVectorShuffle %29 %30 %30 0 1 --%33 = OpBitcast %32 %31 --%34 = OpLoad %10 %12 --%35 = OpLoad %10 %20 --%36 = OpIAdd %10 %34 %35 --%37 = OpBitcast %24 %36 --%39 = OpCompositeConstruct %38 %37 %37 %37 %37 --OpImageWrite %28 %33 %39 --OpMemoryBarrier %40 %41 --OpControlBarrier %40 %40 %42 - OpStore %44 %45 --OpStore %46 %45 - OpBranch %47 - %47 = OpLabel --OpLoopMerge %49 %50 None -+OpLoopMerge %49 %59 None - OpBranch %51 - %51 = OpLabel --%52 = OpLoad %24 %46 -+%52 = OpLoad %24 %44 - %55 = OpSLessThan %54 %52 %53 - OpBranchConditional %55 %48 %49 - %48 = OpLabel --OpStore %56 %45 --OpBranch %57 --%57 = OpLabel --OpLoopMerge %59 %60 None --OpBranch %61 --%61 = OpLabel --%62 = OpLoad %24 %56 --%63 = OpSLessThan %54 %62 %53 --OpBranchConditional %63 %58 %59 --%58 = OpLabel --%64 = OpLoad %25 %27 --%65 = OpLoad %24 %46 --%66 = OpLoad %24 %56 --%67 = OpCompositeConstruct %32 %65 %66 --%68 = OpImageRead %38 %64 %67 --%69 = OpCompositeExtract %24 %68 0 --%70 = OpLoad %24 %44 --%71 = OpIMul %24 %70 %69 -+%141 = OpLoad %10 %12 -+%142 = OpLoad %10 %20 -+%143 = OpIAdd %10 %141 %142 -+%144 = OpCompositeConstruct %29 %143 %143 -+%145 = OpAccessChain %94 %82 %45 -+%146 = OpLoad %77 %145 -+%147 = OpVectorShuffle %29 %146 %146 0 1 -+%148 = OpIAdd %29 %147 %144 -+%150 = OpAccessChain %149 %82 %45 %16 -+%151 = OpCompositeExtract %10 %148 0 --OpStore %44 %71 -+OpStore %150 %151 --OpBranch %60 --%60 = OpLabel --%72 = OpLoad %24 %56 --%74 = OpIAdd %24 %72 %73 -+%152 = OpAccessChain %149 %82 %45 %21 -+%153 = OpCompositeExtract %10 %148 1 --OpStore %56 %74 -+OpStore %152 %153 --OpBranch %57 -+OpBranch %59 - %59 = OpLabel --OpBranch %50 --%50 = OpLabel --%75 = OpLoad %24 %46 -+%75 = OpLoad %24 %44 - %76 = OpIAdd %24 %75 %73 --OpStore %46 %76 -+OpStore %44 %76 - OpBranch %47 - %49 = OpLabel -+%154 = OpLoad %25 %128 -+%155 = OpLoad %10 %12 -+%156 = OpBitcast %24 %155 -+%157 = OpLoad %10 %20 -+%158 = OpBitcast %24 %157 -+%159 = OpCompositeConstruct %32 %156 %158 -+%160 = OpImageRead %38 %154 %159 -+%161 = OpCompositeExtract %24 %160 1 -+%162 = OpAccessChain %84 %82 %53 -+OpStore %162 %161 - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 --%83 = OpLoad %24 %44 -+%163 = OpLoad %25 %27 -+%164 = OpLoad %10 %20 -+%165 = OpBitcast %24 %164 -+%166 = OpLoad %10 %12 -+%167 = OpBitcast %24 %166 -+%168 = OpCompositeConstruct %32 %165 %167 - %85 = OpAccessChain %84 %82 %53 --OpStore %85 %83 -+%169 = OpLoad %24 %85 -+%170 = OpCompositeConstruct %38 %169 %45 %45 %45 -+OpImageWrite %163 %168 %170 - OpReturn - OpFunctionEnd - %8 = OpFunction %2 None %3 - %9 = OpLabel - %101 = OpVariable %43 Function --%92 = OpAccessChain %91 %90 %73 --%93 = OpLoad %87 %92 --%95 = OpAccessChain %94 %82 %45 --%96 = OpLoad %77 %95 --%97 = OpConvertUToF %86 %96 --%98 = OpMatrixTimesVector %86 %93 %97 --%99 = OpConvertFToU %77 %98 --%100 = OpAccessChain %94 %82 %45 --OpStore %100 %99 -+OpStore %101 %45 --OpStore %101 %45 - OpBranch %102 - %102 = OpLabel --OpLoopMerge %104 %105 None -+OpLoopMerge %171 %172 None - OpBranch %106 - %106 = OpLabel - %107 = OpLoad %24 %101 - %109 = OpSLessThan %54 %107 %108 --OpBranchConditional %109 %103 %104 -+OpBranchConditional %109 %103 %171 - %103 = OpLabel --%111 = OpAccessChain %110 %82 %73 --%112 = OpLoad %79 %111 --%114 = OpAccessChain %113 %90 %53 --%115 = OpLoad %78 %114 --%116 = OpVectorTimesScalar %79 %112 %115 --%117 = OpConvertFToU %13 %116 --%118 = OpCompositeExtract %10 %117 0 --%119 = OpCompositeExtract %10 %117 1 --%120 = OpCompositeExtract %10 %117 2 --%121 = OpCompositeConstruct %77 %118 %119 %120 %16 --%122 = OpAccessChain %94 %82 %45 --%123 = OpLoad %77 %122 --%124 = OpIAdd %77 %123 %121 --%125 = OpAccessChain %94 %82 %45 --OpStore %125 %124 --OpBranch %105 --%105 = OpLabel - %126 = OpLoad %24 %101 --%127 = OpIAdd %24 %126 %73 -+%173 = OpIEqual %54 %126 %45 -+OpSelectionMerge %174 None -+OpBranchConditional %173 %104 %176 -+%176 = OpLabel -+%177 = OpLoad %13 %15 -+%178 = OpConvertUToF %79 %177 -+%180 = OpCompositeExtract %78 %178 0 -+%181 = OpCompositeExtract %78 %178 1 -+%182 = OpCompositeConstruct %179 %180 %181 -+%183 = OpAccessChain %113 %82 %73 %21 -+%184 = OpCompositeExtract %78 %182 0 --OpStore %101 %127 -+OpStore %183 %184 -+%185 = OpAccessChain %113 %82 %73 %40 -+%186 = OpCompositeExtract %78 %182 1 -+OpStore %185 %186 --OpBranch %102 -+OpBranch %174 - %104 = OpLabel --OpMemoryBarrier %40 %41 --OpControlBarrier %40 %40 %42 - %129 = OpLoad %25 %128 - %131 = OpImageRead %38 %129 %130 - %132 = OpCompositeExtract %24 %131 0 - %133 = OpConvertSToF %78 %132 --%134 = OpCompositeConstruct %79 %133 %133 %133 --%135 = OpAccessChain %110 %82 %73 -+%175 = OpAccessChain %113 %82 %73 %16 --OpStore %135 %134 -+OpStore %175 %133 -+OpBranch %174 -+%174 = OpLabel -+OpBranch %172 -+%172 = OpLabel -+%187 = OpLoad %24 %101 -+%188 = OpIAdd %24 %187 %73 -+OpStore %101 %188 -+OpBranch %102 -+%171 = OpLabel - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, LargeFunctionsLargeDiffsNoDebug) { - constexpr char kSrcNoDebug[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" %15 - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpDecorate %15 BuiltIn LocalInvocationId - OpDecorate %27 DescriptorSet 0 - OpDecorate %27 Binding 2 - OpMemberDecorate %80 0 Offset 0 - OpMemberDecorate %80 1 Offset 16 - OpMemberDecorate %80 2 Offset 28 - OpDecorate %80 BufferBlock - OpDecorate %82 DescriptorSet 0 - OpDecorate %82 Binding 1 - OpMemberDecorate %88 0 Offset 0 - OpMemberDecorate %88 1 RowMajor - OpMemberDecorate %88 1 Offset 16 - OpMemberDecorate %88 1 MatrixStride 16 - OpMemberDecorate %88 2 Offset 80 - OpDecorate %88 Block - OpDecorate %90 DescriptorSet 0 - OpDecorate %90 Binding 0 - OpDecorate %128 DescriptorSet 0 - OpDecorate %128 Binding 3 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %10 = OpTypeInt 32 0 - %11 = OpTypePointer Function %10 - %13 = OpTypeVector %10 3 - %14 = OpTypePointer Input %13 - %15 = OpVariable %14 Input - %16 = OpConstant %10 0 - %17 = OpTypePointer Input %10 - %21 = OpConstant %10 1 - %24 = OpTypeInt 32 1 - %25 = OpTypeImage %24 2D 0 0 0 2 R32i - %26 = OpTypePointer UniformConstant %25 - %27 = OpVariable %26 UniformConstant - %29 = OpTypeVector %10 2 - %32 = OpTypeVector %24 2 - %38 = OpTypeVector %24 4 - %40 = OpConstant %10 2 - %41 = OpConstant %10 3400 - %42 = OpConstant %10 264 - %43 = OpTypePointer Function %24 - %45 = OpConstant %24 0 - %53 = OpConstant %24 2 - %54 = OpTypeBool - %73 = OpConstant %24 1 - %77 = OpTypeVector %10 4 - %78 = OpTypeFloat 32 - %79 = OpTypeVector %78 3 - %80 = OpTypeStruct %77 %79 %24 - %81 = OpTypePointer Uniform %80 - %82 = OpVariable %81 Uniform - %84 = OpTypePointer Uniform %24 - %86 = OpTypeVector %78 4 - %87 = OpTypeMatrix %86 4 - %88 = OpTypeStruct %10 %87 %78 - %89 = OpTypePointer Uniform %88 - %90 = OpVariable %89 Uniform - %91 = OpTypePointer Uniform %87 - %94 = OpTypePointer Uniform %77 - %108 = OpConstant %24 3 - %110 = OpTypePointer Uniform %79 - %113 = OpTypePointer Uniform %78 - %128 = OpVariable %26 UniformConstant - %130 = OpConstantComposite %32 %45 %45 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %136 = OpFunctionCall %2 %6 - %137 = OpFunctionCall %2 %8 - OpReturn - OpFunctionEnd - %6 = OpFunction %2 None %3 - %7 = OpLabel - %12 = OpVariable %11 Function - %20 = OpVariable %11 Function - %44 = OpVariable %43 Function - %46 = OpVariable %43 Function - %56 = OpVariable %43 Function - %18 = OpAccessChain %17 %15 %16 - %19 = OpLoad %10 %18 - OpStore %12 %19 - %22 = OpAccessChain %17 %15 %21 - %23 = OpLoad %10 %22 - OpStore %20 %23 - %28 = OpLoad %25 %27 - %30 = OpLoad %13 %15 - %31 = OpVectorShuffle %29 %30 %30 0 1 - %33 = OpBitcast %32 %31 - %34 = OpLoad %10 %12 - %35 = OpLoad %10 %20 - %36 = OpIAdd %10 %34 %35 - %37 = OpBitcast %24 %36 - %39 = OpCompositeConstruct %38 %37 %37 %37 %37 - OpImageWrite %28 %33 %39 - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - OpStore %44 %45 - OpStore %46 %45 - OpBranch %47 - %47 = OpLabel - OpLoopMerge %49 %50 None - OpBranch %51 - %51 = OpLabel - %52 = OpLoad %24 %46 - %55 = OpSLessThan %54 %52 %53 - OpBranchConditional %55 %48 %49 - %48 = OpLabel - OpStore %56 %45 - OpBranch %57 - %57 = OpLabel - OpLoopMerge %59 %60 None - OpBranch %61 - %61 = OpLabel - %62 = OpLoad %24 %56 - %63 = OpSLessThan %54 %62 %53 - OpBranchConditional %63 %58 %59 - %58 = OpLabel - %64 = OpLoad %25 %27 - %65 = OpLoad %24 %46 - %66 = OpLoad %24 %56 - %67 = OpCompositeConstruct %32 %65 %66 - %68 = OpImageRead %38 %64 %67 - %69 = OpCompositeExtract %24 %68 0 - %70 = OpLoad %24 %44 - %71 = OpIMul %24 %70 %69 - OpStore %44 %71 - OpBranch %60 - %60 = OpLabel - %72 = OpLoad %24 %56 - %74 = OpIAdd %24 %72 %73 - OpStore %56 %74 - OpBranch %57 - %59 = OpLabel - OpBranch %50 - %50 = OpLabel - %75 = OpLoad %24 %46 - %76 = OpIAdd %24 %75 %73 - OpStore %46 %76 - OpBranch %47 - %49 = OpLabel - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - %83 = OpLoad %24 %44 - %85 = OpAccessChain %84 %82 %53 - OpStore %85 %83 - OpReturn - OpFunctionEnd - %8 = OpFunction %2 None %3 - %9 = OpLabel - %101 = OpVariable %43 Function - %92 = OpAccessChain %91 %90 %73 - %93 = OpLoad %87 %92 - %95 = OpAccessChain %94 %82 %45 - %96 = OpLoad %77 %95 - %97 = OpConvertUToF %86 %96 - %98 = OpMatrixTimesVector %86 %93 %97 - %99 = OpConvertFToU %77 %98 - %100 = OpAccessChain %94 %82 %45 - OpStore %100 %99 - OpStore %101 %45 - OpBranch %102 - %102 = OpLabel - OpLoopMerge %104 %105 None - OpBranch %106 - %106 = OpLabel - %107 = OpLoad %24 %101 - %109 = OpSLessThan %54 %107 %108 - OpBranchConditional %109 %103 %104 - %103 = OpLabel - %111 = OpAccessChain %110 %82 %73 - %112 = OpLoad %79 %111 - %114 = OpAccessChain %113 %90 %53 - %115 = OpLoad %78 %114 - %116 = OpVectorTimesScalar %79 %112 %115 - %117 = OpConvertFToU %13 %116 - %118 = OpCompositeExtract %10 %117 0 - %119 = OpCompositeExtract %10 %117 1 - %120 = OpCompositeExtract %10 %117 2 - %121 = OpCompositeConstruct %77 %118 %119 %120 %16 - %122 = OpAccessChain %94 %82 %45 - %123 = OpLoad %77 %122 - %124 = OpIAdd %77 %123 %121 - %125 = OpAccessChain %94 %82 %45 - OpStore %125 %124 - OpBranch %105 - %105 = OpLabel - %126 = OpLoad %24 %101 - %127 = OpIAdd %24 %126 %73 - OpStore %101 %127 - OpBranch %102 - %104 = OpLabel - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - %129 = OpLoad %25 %128 - %131 = OpImageRead %38 %129 %130 - %132 = OpCompositeExtract %24 %131 0 - %133 = OpConvertSToF %78 %132 - %134 = OpCompositeConstruct %79 %133 %133 %133 - %135 = OpAccessChain %110 %82 %73 - OpStore %135 %134 - OpReturn - OpFunctionEnd - -)"; - constexpr char kDstNoDebug[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" %15 %110 - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpDecorate %15 BuiltIn GlobalInvocationId - OpMemberDecorate %40 0 Offset 0 - OpMemberDecorate %40 1 Offset 16 - OpMemberDecorate %40 2 Offset 28 - OpDecorate %40 BufferBlock - OpDecorate %42 DescriptorSet 0 - OpDecorate %42 Binding 1 - OpDecorate %63 DescriptorSet 0 - OpDecorate %63 Binding 3 - OpDecorate %79 DescriptorSet 0 - OpDecorate %79 Binding 2 - OpDecorate %110 BuiltIn LocalInvocationId - OpMemberDecorate %127 0 Offset 0 - OpMemberDecorate %127 1 RowMajor - OpMemberDecorate %127 1 Offset 16 - OpMemberDecorate %127 1 MatrixStride 16 - OpMemberDecorate %127 2 Offset 80 - OpDecorate %127 Block - OpDecorate %129 DescriptorSet 0 - OpDecorate %129 Binding 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %10 = OpTypeInt 32 0 - %11 = OpTypePointer Function %10 - %13 = OpTypeVector %10 3 - %14 = OpTypePointer Input %13 - %15 = OpVariable %14 Input - %16 = OpConstant %10 0 - %17 = OpTypePointer Input %10 - %21 = OpConstant %10 1 - %24 = OpTypeInt 32 1 - %25 = OpTypePointer Function %24 - %27 = OpConstant %24 0 - %34 = OpConstant %24 2 - %35 = OpTypeBool - %37 = OpTypeVector %10 4 - %38 = OpTypeFloat 32 - %39 = OpTypeVector %38 3 - %40 = OpTypeStruct %37 %39 %24 - %41 = OpTypePointer Uniform %40 - %42 = OpVariable %41 Uniform - %46 = OpTypeVector %10 2 - %48 = OpTypePointer Uniform %37 - %53 = OpTypePointer Uniform %10 - %59 = OpConstant %24 1 - %61 = OpTypeImage %24 2D 0 0 0 2 R32i - %62 = OpTypePointer UniformConstant %61 - %63 = OpVariable %62 UniformConstant - %69 = OpTypeVector %24 2 - %71 = OpTypeVector %24 4 - %74 = OpTypePointer Uniform %24 - %76 = OpConstant %10 2 - %77 = OpConstant %10 3400 - %78 = OpConstant %10 264 - %79 = OpVariable %62 UniformConstant - %96 = OpConstant %24 3 - %103 = OpConstantComposite %69 %27 %27 - %107 = OpTypePointer Uniform %38 - %110 = OpVariable %14 Input - %113 = OpTypeVector %38 2 - %125 = OpTypeVector %38 4 - %126 = OpTypeMatrix %125 4 - %127 = OpTypeStruct %10 %126 %38 - %128 = OpTypePointer Uniform %127 - %129 = OpVariable %128 Uniform - %4 = OpFunction %2 None %3 - %5 = OpLabel - %123 = OpFunctionCall %2 %8 - %124 = OpFunctionCall %2 %6 - OpReturn - OpFunctionEnd - %6 = OpFunction %2 None %3 - %7 = OpLabel - %12 = OpVariable %11 Function - %20 = OpVariable %11 Function - %26 = OpVariable %25 Function - %18 = OpAccessChain %17 %15 %16 - %19 = OpLoad %10 %18 - OpStore %12 %19 - %22 = OpAccessChain %17 %15 %21 - %23 = OpLoad %10 %22 - OpStore %20 %23 - OpStore %26 %27 - OpBranch %28 - %28 = OpLabel - OpLoopMerge %30 %31 None - OpBranch %32 - %32 = OpLabel - %33 = OpLoad %24 %26 - %36 = OpSLessThan %35 %33 %34 - OpBranchConditional %36 %29 %30 - %29 = OpLabel - %43 = OpLoad %10 %12 - %44 = OpLoad %10 %20 - %45 = OpIAdd %10 %43 %44 - %47 = OpCompositeConstruct %46 %45 %45 - %49 = OpAccessChain %48 %42 %27 - %50 = OpLoad %37 %49 - %51 = OpVectorShuffle %46 %50 %50 0 1 - %52 = OpIAdd %46 %51 %47 - %54 = OpAccessChain %53 %42 %27 %16 - %55 = OpCompositeExtract %10 %52 0 - OpStore %54 %55 - %56 = OpAccessChain %53 %42 %27 %21 - %57 = OpCompositeExtract %10 %52 1 - OpStore %56 %57 - OpBranch %31 - %31 = OpLabel - %58 = OpLoad %24 %26 - %60 = OpIAdd %24 %58 %59 - OpStore %26 %60 - OpBranch %28 - %30 = OpLabel - %64 = OpLoad %61 %63 - %65 = OpLoad %10 %12 - %66 = OpBitcast %24 %65 - %67 = OpLoad %10 %20 - %68 = OpBitcast %24 %67 - %70 = OpCompositeConstruct %69 %66 %68 - %72 = OpImageRead %71 %64 %70 - %73 = OpCompositeExtract %24 %72 1 - %75 = OpAccessChain %74 %42 %34 - OpStore %75 %73 - OpMemoryBarrier %76 %77 - OpControlBarrier %76 %76 %78 - %80 = OpLoad %61 %79 - %81 = OpLoad %10 %20 - %82 = OpBitcast %24 %81 - %83 = OpLoad %10 %12 - %84 = OpBitcast %24 %83 - %85 = OpCompositeConstruct %69 %82 %84 - %86 = OpAccessChain %74 %42 %34 - %87 = OpLoad %24 %86 - %88 = OpCompositeConstruct %71 %87 %27 %27 %27 - OpImageWrite %80 %85 %88 - OpReturn - OpFunctionEnd - %8 = OpFunction %2 None %3 - %9 = OpLabel - %89 = OpVariable %25 Function - OpStore %89 %27 - OpBranch %90 - %90 = OpLabel - OpLoopMerge %92 %93 None - OpBranch %94 - %94 = OpLabel - %95 = OpLoad %24 %89 - %97 = OpSLessThan %35 %95 %96 - OpBranchConditional %97 %91 %92 - %91 = OpLabel - %98 = OpLoad %24 %89 - %99 = OpIEqual %35 %98 %27 - OpSelectionMerge %101 None - OpBranchConditional %99 %100 %109 - %100 = OpLabel - %102 = OpLoad %61 %63 - %104 = OpImageRead %71 %102 %103 - %105 = OpCompositeExtract %24 %104 0 - %106 = OpConvertSToF %38 %105 - %108 = OpAccessChain %107 %42 %59 %16 - OpStore %108 %106 - OpBranch %101 - %109 = OpLabel - %111 = OpLoad %13 %110 - %112 = OpConvertUToF %39 %111 - %114 = OpCompositeExtract %38 %112 0 - %115 = OpCompositeExtract %38 %112 1 - %116 = OpCompositeConstruct %113 %114 %115 - %117 = OpAccessChain %107 %42 %59 %21 - %118 = OpCompositeExtract %38 %116 0 - OpStore %117 %118 - %119 = OpAccessChain %107 %42 %59 %76 - %120 = OpCompositeExtract %38 %116 1 - OpStore %119 %120 - OpBranch %101 - %101 = OpLabel - OpBranch %93 - %93 = OpLabel - %121 = OpLoad %24 %89 - %122 = OpIAdd %24 %121 %59 - OpStore %89 %122 - OpBranch %90 - %92 = OpLabel - OpReturn - OpFunctionEnd - -)"; - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 138 -+; Bound: 220 - ; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 --OpEntryPoint GLCompute %4 "main" %15 -+OpEntryPoint GLCompute %4 "main" %143 %15 - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 -+OpDecorate %143 BuiltIn GlobalInvocationId - OpDecorate %15 BuiltIn LocalInvocationId - OpDecorate %27 DescriptorSet 0 - OpDecorate %27 Binding 2 - OpMemberDecorate %80 0 Offset 0 - OpMemberDecorate %80 1 Offset 16 - OpMemberDecorate %80 2 Offset 28 - OpDecorate %80 BufferBlock - OpDecorate %82 DescriptorSet 0 - OpDecorate %82 Binding 1 - OpMemberDecorate %88 0 Offset 0 - OpMemberDecorate %88 1 RowMajor - OpMemberDecorate %88 1 Offset 16 - OpMemberDecorate %88 1 MatrixStride 16 - OpMemberDecorate %88 2 Offset 80 - OpDecorate %88 Block - OpDecorate %90 DescriptorSet 0 - OpDecorate %90 Binding 0 - OpDecorate %128 DescriptorSet 0 - OpDecorate %128 Binding 3 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %10 = OpTypeInt 32 0 - %11 = OpTypePointer Function %10 - %13 = OpTypeVector %10 3 - %14 = OpTypePointer Input %13 -+%143 = OpVariable %14 Input - %15 = OpVariable %14 Input - %16 = OpConstant %10 0 - %17 = OpTypePointer Input %10 - %21 = OpConstant %10 1 - %24 = OpTypeInt 32 1 - %25 = OpTypeImage %24 2D 0 0 0 2 R32i - %26 = OpTypePointer UniformConstant %25 - %27 = OpVariable %26 UniformConstant - %29 = OpTypeVector %10 2 - %32 = OpTypeVector %24 2 - %38 = OpTypeVector %24 4 - %40 = OpConstant %10 2 - %41 = OpConstant %10 3400 - %42 = OpConstant %10 264 - %43 = OpTypePointer Function %24 - %45 = OpConstant %24 0 -+%165 = OpTypePointer Uniform %10 - %53 = OpConstant %24 2 - %54 = OpTypeBool - %73 = OpConstant %24 1 - %77 = OpTypeVector %10 4 - %78 = OpTypeFloat 32 - %79 = OpTypeVector %78 3 - %80 = OpTypeStruct %77 %79 %24 - %81 = OpTypePointer Uniform %80 - %82 = OpVariable %81 Uniform - %84 = OpTypePointer Uniform %24 - %86 = OpTypeVector %78 4 - %87 = OpTypeMatrix %86 4 - %88 = OpTypeStruct %10 %87 %78 - %89 = OpTypePointer Uniform %88 - %90 = OpVariable %89 Uniform --%91 = OpTypePointer Uniform %87 -+%210 = OpTypeVector %78 2 - %94 = OpTypePointer Uniform %77 - %108 = OpConstant %24 3 --%110 = OpTypePointer Uniform %79 - %113 = OpTypePointer Uniform %78 - %128 = OpVariable %26 UniformConstant - %130 = OpConstantComposite %32 %45 %45 - %4 = OpFunction %2 None %3 - %5 = OpLabel --%136 = OpFunctionCall %2 %6 -+%136 = OpFunctionCall %2 %140 --%137 = OpFunctionCall %2 %8 -+%137 = OpFunctionCall %2 %138 - OpReturn - OpFunctionEnd --%6 = OpFunction %2 None %3 --%7 = OpLabel --%12 = OpVariable %11 Function --%20 = OpVariable %11 Function --%44 = OpVariable %43 Function --%46 = OpVariable %43 Function --%56 = OpVariable %43 Function --%18 = OpAccessChain %17 %15 %16 --%19 = OpLoad %10 %18 --OpStore %12 %19 --%22 = OpAccessChain %17 %15 %21 --%23 = OpLoad %10 %22 --OpStore %20 %23 --%28 = OpLoad %25 %27 --%30 = OpLoad %13 %15 --%31 = OpVectorShuffle %29 %30 %30 0 1 --%33 = OpBitcast %32 %31 --%34 = OpLoad %10 %12 --%35 = OpLoad %10 %20 --%36 = OpIAdd %10 %34 %35 --%37 = OpBitcast %24 %36 --%39 = OpCompositeConstruct %38 %37 %37 %37 %37 --OpImageWrite %28 %33 %39 --OpMemoryBarrier %40 %41 --OpControlBarrier %40 %40 %42 --OpStore %44 %45 --OpStore %46 %45 --OpBranch %47 --%47 = OpLabel --OpLoopMerge %49 %50 None --OpBranch %51 --%51 = OpLabel --%52 = OpLoad %24 %46 --%55 = OpSLessThan %54 %52 %53 --OpBranchConditional %55 %48 %49 --%48 = OpLabel --OpStore %56 %45 --OpBranch %57 --%57 = OpLabel --OpLoopMerge %59 %60 None --OpBranch %61 --%61 = OpLabel --%62 = OpLoad %24 %56 --%63 = OpSLessThan %54 %62 %53 --OpBranchConditional %63 %58 %59 --%58 = OpLabel --%64 = OpLoad %25 %27 --%65 = OpLoad %24 %46 --%66 = OpLoad %24 %56 --%67 = OpCompositeConstruct %32 %65 %66 --%68 = OpImageRead %38 %64 %67 --%69 = OpCompositeExtract %24 %68 0 --%70 = OpLoad %24 %44 --%71 = OpIMul %24 %70 %69 --OpStore %44 %71 --OpBranch %60 --%60 = OpLabel --%72 = OpLoad %24 %56 --%74 = OpIAdd %24 %72 %73 --OpStore %56 %74 --OpBranch %57 --%59 = OpLabel --OpBranch %50 --%50 = OpLabel --%75 = OpLoad %24 %46 --%76 = OpIAdd %24 %75 %73 --OpStore %46 %76 --OpBranch %47 --%49 = OpLabel --OpMemoryBarrier %40 %41 --OpControlBarrier %40 %40 %42 --%83 = OpLoad %24 %44 --%85 = OpAccessChain %84 %82 %53 --OpStore %85 %83 --OpReturn --OpFunctionEnd --%8 = OpFunction %2 None %3 --%9 = OpLabel --%101 = OpVariable %43 Function --%92 = OpAccessChain %91 %90 %73 --%93 = OpLoad %87 %92 --%95 = OpAccessChain %94 %82 %45 --%96 = OpLoad %77 %95 --%97 = OpConvertUToF %86 %96 --%98 = OpMatrixTimesVector %86 %93 %97 --%99 = OpConvertFToU %77 %98 --%100 = OpAccessChain %94 %82 %45 --OpStore %100 %99 --OpStore %101 %45 --OpBranch %102 --%102 = OpLabel --OpLoopMerge %104 %105 None --OpBranch %106 --%106 = OpLabel --%107 = OpLoad %24 %101 --%109 = OpSLessThan %54 %107 %108 --OpBranchConditional %109 %103 %104 --%103 = OpLabel --%111 = OpAccessChain %110 %82 %73 --%112 = OpLoad %79 %111 --%114 = OpAccessChain %113 %90 %53 --%115 = OpLoad %78 %114 --%116 = OpVectorTimesScalar %79 %112 %115 --%117 = OpConvertFToU %13 %116 --%118 = OpCompositeExtract %10 %117 0 --%119 = OpCompositeExtract %10 %117 1 --%120 = OpCompositeExtract %10 %117 2 --%121 = OpCompositeConstruct %77 %118 %119 %120 %16 --%122 = OpAccessChain %94 %82 %45 --%123 = OpLoad %77 %122 --%124 = OpIAdd %77 %123 %121 --%125 = OpAccessChain %94 %82 %45 --OpStore %125 %124 --OpBranch %105 --%105 = OpLabel --%126 = OpLoad %24 %101 --%127 = OpIAdd %24 %126 %73 --OpStore %101 %127 --OpBranch %102 --%104 = OpLabel --OpMemoryBarrier %40 %41 --OpControlBarrier %40 %40 %42 --%129 = OpLoad %25 %128 --%131 = OpImageRead %38 %129 %130 --%132 = OpCompositeExtract %24 %131 0 --%133 = OpConvertSToF %78 %132 --%134 = OpCompositeConstruct %79 %133 %133 %133 --%135 = OpAccessChain %110 %82 %73 --OpStore %135 %134 --OpReturn --OpFunctionEnd -+%138 = OpFunction %2 None %3 -+%139 = OpLabel -+%142 = OpVariable %11 Function -+%146 = OpVariable %11 Function -+%149 = OpVariable %43 Function -+%144 = OpAccessChain %17 %143 %16 -+%145 = OpLoad %10 %144 -+OpStore %142 %145 -+%147 = OpAccessChain %17 %143 %21 -+%148 = OpLoad %10 %147 -+OpStore %146 %148 -+OpStore %149 %45 -+OpBranch %150 -+%150 = OpLabel -+OpLoopMerge %152 %153 None -+OpBranch %154 -+%154 = OpLabel -+%155 = OpLoad %24 %149 -+%156 = OpSLessThan %54 %155 %53 -+OpBranchConditional %156 %151 %152 -+%151 = OpLabel -+%157 = OpLoad %10 %142 -+%158 = OpLoad %10 %146 -+%159 = OpIAdd %10 %157 %158 -+%160 = OpCompositeConstruct %29 %159 %159 -+%161 = OpAccessChain %94 %82 %45 -+%162 = OpLoad %77 %161 -+%163 = OpVectorShuffle %29 %162 %162 0 1 -+%164 = OpIAdd %29 %163 %160 -+%166 = OpAccessChain %165 %82 %45 %16 -+%167 = OpCompositeExtract %10 %164 0 -+OpStore %166 %167 -+%168 = OpAccessChain %165 %82 %45 %21 -+%169 = OpCompositeExtract %10 %164 1 -+OpStore %168 %169 -+OpBranch %153 -+%153 = OpLabel -+%170 = OpLoad %24 %149 -+%171 = OpIAdd %24 %170 %73 -+OpStore %149 %171 -+OpBranch %150 -+%152 = OpLabel -+%172 = OpLoad %25 %128 -+%173 = OpLoad %10 %142 -+%174 = OpBitcast %24 %173 -+%175 = OpLoad %10 %146 -+%176 = OpBitcast %24 %175 -+%177 = OpCompositeConstruct %32 %174 %176 -+%178 = OpImageRead %38 %172 %177 -+%179 = OpCompositeExtract %24 %178 1 -+%180 = OpAccessChain %84 %82 %53 -+OpStore %180 %179 -+OpMemoryBarrier %40 %41 -+OpControlBarrier %40 %40 %42 -+%181 = OpLoad %25 %27 -+%182 = OpLoad %10 %146 -+%183 = OpBitcast %24 %182 -+%184 = OpLoad %10 %142 -+%185 = OpBitcast %24 %184 -+%186 = OpCompositeConstruct %32 %183 %185 -+%187 = OpAccessChain %84 %82 %53 -+%188 = OpLoad %24 %187 -+%189 = OpCompositeConstruct %38 %188 %45 %45 %45 -+OpImageWrite %181 %186 %189 -+OpReturn -+OpFunctionEnd -+%140 = OpFunction %2 None %3 -+%141 = OpLabel -+%190 = OpVariable %43 Function -+OpStore %190 %45 -+OpBranch %191 -+%191 = OpLabel -+OpLoopMerge %193 %194 None -+OpBranch %195 -+%195 = OpLabel -+%196 = OpLoad %24 %190 -+%197 = OpSLessThan %54 %196 %108 -+OpBranchConditional %197 %192 %193 -+%192 = OpLabel -+%198 = OpLoad %24 %190 -+%199 = OpIEqual %54 %198 %45 -+OpSelectionMerge %201 None -+OpBranchConditional %199 %200 %207 -+%207 = OpLabel -+%208 = OpLoad %13 %15 -+%209 = OpConvertUToF %79 %208 -+%211 = OpCompositeExtract %78 %209 0 -+%212 = OpCompositeExtract %78 %209 1 -+%213 = OpCompositeConstruct %210 %211 %212 -+%214 = OpAccessChain %113 %82 %73 %21 -+%215 = OpCompositeExtract %78 %213 0 -+OpStore %214 %215 -+%216 = OpAccessChain %113 %82 %73 %40 -+%217 = OpCompositeExtract %78 %213 1 -+OpStore %216 %217 -+OpBranch %201 -+%200 = OpLabel -+%202 = OpLoad %25 %128 -+%203 = OpImageRead %38 %202 %130 -+%204 = OpCompositeExtract %24 %203 0 -+%205 = OpConvertSToF %78 %204 -+%206 = OpAccessChain %113 %82 %73 %16 -+OpStore %206 %205 -+OpBranch %201 -+%201 = OpLabel -+OpBranch %194 -+%194 = OpLabel -+%218 = OpLoad %24 %190 -+%219 = OpIAdd %24 %218 %73 -+OpStore %190 %219 -+OpBranch %191 -+%193 = OpLabel -+OpReturn -+OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_files/large_functions_large_diffs_dst.spvasm b/test/diff/diff_files/large_functions_large_diffs_dst.spvasm deleted file mode 100644 index be7c1d5f..00000000 --- a/test/diff/diff_files/large_functions_large_diffs_dst.spvasm +++ /dev/null @@ -1,213 +0,0 @@ - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" %15 %110 - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "main" - OpName %6 "f1(" - OpName %8 "f2(" - OpName %12 "x" - OpName %15 "gl_GlobalInvocationID" - OpName %20 "z" - OpName %26 "i" - OpName %40 "BufferOut" - OpMemberName %40 0 "o_uv4" - OpMemberName %40 1 "o_v3" - OpMemberName %40 2 "o_i" - OpName %42 "" - OpName %63 "image2" - OpName %79 "image" - OpName %89 "i" - OpName %110 "gl_LocalInvocationID" - OpName %127 "BufferIn" - OpMemberName %127 0 "i_u" - OpMemberName %127 1 "i_v4" - OpMemberName %127 2 "i_f" - OpName %129 "" - OpDecorate %15 BuiltIn GlobalInvocationId - OpMemberDecorate %40 0 Offset 0 - OpMemberDecorate %40 1 Offset 16 - OpMemberDecorate %40 2 Offset 28 - OpDecorate %40 BufferBlock - OpDecorate %42 DescriptorSet 0 - OpDecorate %42 Binding 1 - OpDecorate %63 DescriptorSet 0 - OpDecorate %63 Binding 3 - OpDecorate %79 DescriptorSet 0 - OpDecorate %79 Binding 2 - OpDecorate %110 BuiltIn LocalInvocationId - OpMemberDecorate %127 0 Offset 0 - OpMemberDecorate %127 1 RowMajor - OpMemberDecorate %127 1 Offset 16 - OpMemberDecorate %127 1 MatrixStride 16 - OpMemberDecorate %127 2 Offset 80 - OpDecorate %127 Block - OpDecorate %129 DescriptorSet 0 - OpDecorate %129 Binding 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %10 = OpTypeInt 32 0 - %11 = OpTypePointer Function %10 - %13 = OpTypeVector %10 3 - %14 = OpTypePointer Input %13 - %15 = OpVariable %14 Input - %16 = OpConstant %10 0 - %17 = OpTypePointer Input %10 - %21 = OpConstant %10 1 - %24 = OpTypeInt 32 1 - %25 = OpTypePointer Function %24 - %27 = OpConstant %24 0 - %34 = OpConstant %24 2 - %35 = OpTypeBool - %37 = OpTypeVector %10 4 - %38 = OpTypeFloat 32 - %39 = OpTypeVector %38 3 - %40 = OpTypeStruct %37 %39 %24 - %41 = OpTypePointer Uniform %40 - %42 = OpVariable %41 Uniform - %46 = OpTypeVector %10 2 - %48 = OpTypePointer Uniform %37 - %53 = OpTypePointer Uniform %10 - %59 = OpConstant %24 1 - %61 = OpTypeImage %24 2D 0 0 0 2 R32i - %62 = OpTypePointer UniformConstant %61 - %63 = OpVariable %62 UniformConstant - %69 = OpTypeVector %24 2 - %71 = OpTypeVector %24 4 - %74 = OpTypePointer Uniform %24 - %76 = OpConstant %10 2 - %77 = OpConstant %10 3400 - %78 = OpConstant %10 264 - %79 = OpVariable %62 UniformConstant - %96 = OpConstant %24 3 - %103 = OpConstantComposite %69 %27 %27 - %107 = OpTypePointer Uniform %38 - %110 = OpVariable %14 Input - %113 = OpTypeVector %38 2 - %125 = OpTypeVector %38 4 - %126 = OpTypeMatrix %125 4 - %127 = OpTypeStruct %10 %126 %38 - %128 = OpTypePointer Uniform %127 - %129 = OpVariable %128 Uniform - %4 = OpFunction %2 None %3 - %5 = OpLabel - %123 = OpFunctionCall %2 %8 - %124 = OpFunctionCall %2 %6 - OpReturn - OpFunctionEnd - %6 = OpFunction %2 None %3 - %7 = OpLabel - %12 = OpVariable %11 Function - %20 = OpVariable %11 Function - %26 = OpVariable %25 Function - %18 = OpAccessChain %17 %15 %16 - %19 = OpLoad %10 %18 - OpStore %12 %19 - %22 = OpAccessChain %17 %15 %21 - %23 = OpLoad %10 %22 - OpStore %20 %23 - OpStore %26 %27 - OpBranch %28 - %28 = OpLabel - OpLoopMerge %30 %31 None - OpBranch %32 - %32 = OpLabel - %33 = OpLoad %24 %26 - %36 = OpSLessThan %35 %33 %34 - OpBranchConditional %36 %29 %30 - %29 = OpLabel - %43 = OpLoad %10 %12 - %44 = OpLoad %10 %20 - %45 = OpIAdd %10 %43 %44 - %47 = OpCompositeConstruct %46 %45 %45 - %49 = OpAccessChain %48 %42 %27 - %50 = OpLoad %37 %49 - %51 = OpVectorShuffle %46 %50 %50 0 1 - %52 = OpIAdd %46 %51 %47 - %54 = OpAccessChain %53 %42 %27 %16 - %55 = OpCompositeExtract %10 %52 0 - OpStore %54 %55 - %56 = OpAccessChain %53 %42 %27 %21 - %57 = OpCompositeExtract %10 %52 1 - OpStore %56 %57 - OpBranch %31 - %31 = OpLabel - %58 = OpLoad %24 %26 - %60 = OpIAdd %24 %58 %59 - OpStore %26 %60 - OpBranch %28 - %30 = OpLabel - %64 = OpLoad %61 %63 - %65 = OpLoad %10 %12 - %66 = OpBitcast %24 %65 - %67 = OpLoad %10 %20 - %68 = OpBitcast %24 %67 - %70 = OpCompositeConstruct %69 %66 %68 - %72 = OpImageRead %71 %64 %70 - %73 = OpCompositeExtract %24 %72 1 - %75 = OpAccessChain %74 %42 %34 - OpStore %75 %73 - OpMemoryBarrier %76 %77 - OpControlBarrier %76 %76 %78 - %80 = OpLoad %61 %79 - %81 = OpLoad %10 %20 - %82 = OpBitcast %24 %81 - %83 = OpLoad %10 %12 - %84 = OpBitcast %24 %83 - %85 = OpCompositeConstruct %69 %82 %84 - %86 = OpAccessChain %74 %42 %34 - %87 = OpLoad %24 %86 - %88 = OpCompositeConstruct %71 %87 %27 %27 %27 - OpImageWrite %80 %85 %88 - OpReturn - OpFunctionEnd - %8 = OpFunction %2 None %3 - %9 = OpLabel - %89 = OpVariable %25 Function - OpStore %89 %27 - OpBranch %90 - %90 = OpLabel - OpLoopMerge %92 %93 None - OpBranch %94 - %94 = OpLabel - %95 = OpLoad %24 %89 - %97 = OpSLessThan %35 %95 %96 - OpBranchConditional %97 %91 %92 - %91 = OpLabel - %98 = OpLoad %24 %89 - %99 = OpIEqual %35 %98 %27 - OpSelectionMerge %101 None - OpBranchConditional %99 %100 %109 - %100 = OpLabel - %102 = OpLoad %61 %63 - %104 = OpImageRead %71 %102 %103 - %105 = OpCompositeExtract %24 %104 0 - %106 = OpConvertSToF %38 %105 - %108 = OpAccessChain %107 %42 %59 %16 - OpStore %108 %106 - OpBranch %101 - %109 = OpLabel - %111 = OpLoad %13 %110 - %112 = OpConvertUToF %39 %111 - %114 = OpCompositeExtract %38 %112 0 - %115 = OpCompositeExtract %38 %112 1 - %116 = OpCompositeConstruct %113 %114 %115 - %117 = OpAccessChain %107 %42 %59 %21 - %118 = OpCompositeExtract %38 %116 0 - OpStore %117 %118 - %119 = OpAccessChain %107 %42 %59 %76 - %120 = OpCompositeExtract %38 %116 1 - OpStore %119 %120 - OpBranch %101 - %101 = OpLabel - OpBranch %93 - %93 = OpLabel - %121 = OpLoad %24 %89 - %122 = OpIAdd %24 %121 %59 - OpStore %89 %122 - OpBranch %90 - %92 = OpLabel - OpReturn - OpFunctionEnd - diff --git a/test/diff/diff_files/large_functions_large_diffs_src.spvasm b/test/diff/diff_files/large_functions_large_diffs_src.spvasm deleted file mode 100644 index 8f0aa614..00000000 --- a/test/diff/diff_files/large_functions_large_diffs_src.spvasm +++ /dev/null @@ -1,230 +0,0 @@ -;; Test where src and dst have a few large functions with large differences. - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" %15 - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "main" - OpName %6 "f1(" - OpName %8 "f2(" - OpName %12 "x" - OpName %15 "gl_LocalInvocationID" - OpName %20 "y" - OpName %27 "image" - OpName %44 "sum" - OpName %46 "i" - OpName %56 "j" - OpName %80 "BufferOut" - OpMemberName %80 0 "o_uv4" - OpMemberName %80 1 "o_v3" - OpMemberName %80 2 "o_i" - OpName %82 "" - OpName %88 "BufferIn" - OpMemberName %88 0 "i_u" - OpMemberName %88 1 "i_v4" - OpMemberName %88 2 "i_f" - OpName %90 "" - OpName %101 "i" - OpName %128 "image2" - OpDecorate %15 BuiltIn LocalInvocationId - OpDecorate %27 DescriptorSet 0 - OpDecorate %27 Binding 2 - OpMemberDecorate %80 0 Offset 0 - OpMemberDecorate %80 1 Offset 16 - OpMemberDecorate %80 2 Offset 28 - OpDecorate %80 BufferBlock - OpDecorate %82 DescriptorSet 0 - OpDecorate %82 Binding 1 - OpMemberDecorate %88 0 Offset 0 - OpMemberDecorate %88 1 RowMajor - OpMemberDecorate %88 1 Offset 16 - OpMemberDecorate %88 1 MatrixStride 16 - OpMemberDecorate %88 2 Offset 80 - OpDecorate %88 Block - OpDecorate %90 DescriptorSet 0 - OpDecorate %90 Binding 0 - OpDecorate %128 DescriptorSet 0 - OpDecorate %128 Binding 3 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %10 = OpTypeInt 32 0 - %11 = OpTypePointer Function %10 - %13 = OpTypeVector %10 3 - %14 = OpTypePointer Input %13 - %15 = OpVariable %14 Input - %16 = OpConstant %10 0 - %17 = OpTypePointer Input %10 - %21 = OpConstant %10 1 - %24 = OpTypeInt 32 1 - %25 = OpTypeImage %24 2D 0 0 0 2 R32i - %26 = OpTypePointer UniformConstant %25 - %27 = OpVariable %26 UniformConstant - %29 = OpTypeVector %10 2 - %32 = OpTypeVector %24 2 - %38 = OpTypeVector %24 4 - %40 = OpConstant %10 2 - %41 = OpConstant %10 3400 - %42 = OpConstant %10 264 - %43 = OpTypePointer Function %24 - %45 = OpConstant %24 0 - %53 = OpConstant %24 2 - %54 = OpTypeBool - %73 = OpConstant %24 1 - %77 = OpTypeVector %10 4 - %78 = OpTypeFloat 32 - %79 = OpTypeVector %78 3 - %80 = OpTypeStruct %77 %79 %24 - %81 = OpTypePointer Uniform %80 - %82 = OpVariable %81 Uniform - %84 = OpTypePointer Uniform %24 - %86 = OpTypeVector %78 4 - %87 = OpTypeMatrix %86 4 - %88 = OpTypeStruct %10 %87 %78 - %89 = OpTypePointer Uniform %88 - %90 = OpVariable %89 Uniform - %91 = OpTypePointer Uniform %87 - %94 = OpTypePointer Uniform %77 - %108 = OpConstant %24 3 - %110 = OpTypePointer Uniform %79 - %113 = OpTypePointer Uniform %78 - %128 = OpVariable %26 UniformConstant - %130 = OpConstantComposite %32 %45 %45 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %136 = OpFunctionCall %2 %6 - %137 = OpFunctionCall %2 %8 - OpReturn - OpFunctionEnd - %6 = OpFunction %2 None %3 - %7 = OpLabel - %12 = OpVariable %11 Function - %20 = OpVariable %11 Function - %44 = OpVariable %43 Function - %46 = OpVariable %43 Function - %56 = OpVariable %43 Function - %18 = OpAccessChain %17 %15 %16 - %19 = OpLoad %10 %18 - OpStore %12 %19 - %22 = OpAccessChain %17 %15 %21 - %23 = OpLoad %10 %22 - OpStore %20 %23 - %28 = OpLoad %25 %27 - %30 = OpLoad %13 %15 - %31 = OpVectorShuffle %29 %30 %30 0 1 - %33 = OpBitcast %32 %31 - %34 = OpLoad %10 %12 - %35 = OpLoad %10 %20 - %36 = OpIAdd %10 %34 %35 - %37 = OpBitcast %24 %36 - %39 = OpCompositeConstruct %38 %37 %37 %37 %37 - OpImageWrite %28 %33 %39 - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - OpStore %44 %45 - OpStore %46 %45 - OpBranch %47 - %47 = OpLabel - OpLoopMerge %49 %50 None - OpBranch %51 - %51 = OpLabel - %52 = OpLoad %24 %46 - %55 = OpSLessThan %54 %52 %53 - OpBranchConditional %55 %48 %49 - %48 = OpLabel - OpStore %56 %45 - OpBranch %57 - %57 = OpLabel - OpLoopMerge %59 %60 None - OpBranch %61 - %61 = OpLabel - %62 = OpLoad %24 %56 - %63 = OpSLessThan %54 %62 %53 - OpBranchConditional %63 %58 %59 - %58 = OpLabel - %64 = OpLoad %25 %27 - %65 = OpLoad %24 %46 - %66 = OpLoad %24 %56 - %67 = OpCompositeConstruct %32 %65 %66 - %68 = OpImageRead %38 %64 %67 - %69 = OpCompositeExtract %24 %68 0 - %70 = OpLoad %24 %44 - %71 = OpIMul %24 %70 %69 - OpStore %44 %71 - OpBranch %60 - %60 = OpLabel - %72 = OpLoad %24 %56 - %74 = OpIAdd %24 %72 %73 - OpStore %56 %74 - OpBranch %57 - %59 = OpLabel - OpBranch %50 - %50 = OpLabel - %75 = OpLoad %24 %46 - %76 = OpIAdd %24 %75 %73 - OpStore %46 %76 - OpBranch %47 - %49 = OpLabel - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - %83 = OpLoad %24 %44 - %85 = OpAccessChain %84 %82 %53 - OpStore %85 %83 - OpReturn - OpFunctionEnd - %8 = OpFunction %2 None %3 - %9 = OpLabel - %101 = OpVariable %43 Function - %92 = OpAccessChain %91 %90 %73 - %93 = OpLoad %87 %92 - %95 = OpAccessChain %94 %82 %45 - %96 = OpLoad %77 %95 - %97 = OpConvertUToF %86 %96 - %98 = OpMatrixTimesVector %86 %93 %97 - %99 = OpConvertFToU %77 %98 - %100 = OpAccessChain %94 %82 %45 - OpStore %100 %99 - OpStore %101 %45 - OpBranch %102 - %102 = OpLabel - OpLoopMerge %104 %105 None - OpBranch %106 - %106 = OpLabel - %107 = OpLoad %24 %101 - %109 = OpSLessThan %54 %107 %108 - OpBranchConditional %109 %103 %104 - %103 = OpLabel - %111 = OpAccessChain %110 %82 %73 - %112 = OpLoad %79 %111 - %114 = OpAccessChain %113 %90 %53 - %115 = OpLoad %78 %114 - %116 = OpVectorTimesScalar %79 %112 %115 - %117 = OpConvertFToU %13 %116 - %118 = OpCompositeExtract %10 %117 0 - %119 = OpCompositeExtract %10 %117 1 - %120 = OpCompositeExtract %10 %117 2 - %121 = OpCompositeConstruct %77 %118 %119 %120 %16 - %122 = OpAccessChain %94 %82 %45 - %123 = OpLoad %77 %122 - %124 = OpIAdd %77 %123 %121 - %125 = OpAccessChain %94 %82 %45 - OpStore %125 %124 - OpBranch %105 - %105 = OpLabel - %126 = OpLoad %24 %101 - %127 = OpIAdd %24 %126 %73 - OpStore %101 %127 - OpBranch %102 - %104 = OpLabel - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - %129 = OpLoad %25 %128 - %131 = OpImageRead %38 %129 %130 - %132 = OpCompositeExtract %24 %131 0 - %133 = OpConvertSToF %78 %132 - %134 = OpCompositeConstruct %79 %133 %133 %133 - %135 = OpAccessChain %110 %82 %73 - OpStore %135 %134 - OpReturn - OpFunctionEnd - diff --git a/test/diff/diff_files/large_functions_small_diffs_autogen.cpp b/test/diff/diff_files/large_functions_small_diffs_autogen.cpp deleted file mode 100644 index 02838d9a..00000000 --- a/test/diff/diff_files/large_functions_small_diffs_autogen.cpp +++ /dev/null @@ -1,1364 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_tests.py -// -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -// Test where src and dst have a few large functions with small differences. -constexpr char kSrc[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" %15 - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "main" - OpName %6 "f1(" - OpName %8 "f2(" - OpName %12 "x" - OpName %15 "gl_LocalInvocationID" - OpName %20 "y" - OpName %27 "image" - OpName %44 "sum" - OpName %46 "i" - OpName %56 "j" - OpName %80 "BufferOut" - OpMemberName %80 0 "o_uv4" - OpMemberName %80 1 "o_v3" - OpMemberName %80 2 "o_i" - OpName %82 "" - OpName %88 "BufferIn" - OpMemberName %88 0 "i_u" - OpMemberName %88 1 "i_v4" - OpMemberName %88 2 "i_f" - OpName %90 "" - OpName %101 "i" - OpDecorate %15 BuiltIn LocalInvocationId - OpDecorate %27 DescriptorSet 0 - OpDecorate %27 Binding 2 - OpMemberDecorate %80 0 Offset 0 - OpMemberDecorate %80 1 Offset 16 - OpMemberDecorate %80 2 Offset 28 - OpDecorate %80 BufferBlock - OpDecorate %82 DescriptorSet 0 - OpDecorate %82 Binding 1 - OpMemberDecorate %88 0 Offset 0 - OpMemberDecorate %88 1 RowMajor - OpMemberDecorate %88 1 Offset 16 - OpMemberDecorate %88 1 MatrixStride 16 - OpMemberDecorate %88 2 Offset 80 - OpDecorate %88 Block - OpDecorate %90 DescriptorSet 0 - OpDecorate %90 Binding 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %10 = OpTypeInt 32 0 - %11 = OpTypePointer Function %10 - %13 = OpTypeVector %10 3 - %14 = OpTypePointer Input %13 - %15 = OpVariable %14 Input - %16 = OpConstant %10 0 - %17 = OpTypePointer Input %10 - %21 = OpConstant %10 1 - %24 = OpTypeInt 32 1 - %25 = OpTypeImage %24 2D 0 0 0 2 R32i - %26 = OpTypePointer UniformConstant %25 - %27 = OpVariable %26 UniformConstant - %29 = OpTypeVector %10 2 - %32 = OpTypeVector %24 2 - %38 = OpTypeVector %24 4 - %40 = OpConstant %10 2 - %41 = OpConstant %10 3400 - %42 = OpConstant %10 264 - %43 = OpTypePointer Function %24 - %45 = OpConstant %24 0 - %53 = OpConstant %24 2 - %54 = OpTypeBool - %73 = OpConstant %24 1 - %77 = OpTypeVector %10 4 - %78 = OpTypeFloat 32 - %79 = OpTypeVector %78 3 - %80 = OpTypeStruct %77 %79 %24 - %81 = OpTypePointer Uniform %80 - %82 = OpVariable %81 Uniform - %84 = OpTypePointer Uniform %24 - %86 = OpTypeVector %78 4 - %87 = OpTypeMatrix %86 4 - %88 = OpTypeStruct %10 %87 %78 - %89 = OpTypePointer Uniform %88 - %90 = OpVariable %89 Uniform - %91 = OpTypePointer Uniform %87 - %94 = OpTypePointer Uniform %77 - %108 = OpConstant %24 3 - %110 = OpTypePointer Uniform %79 - %113 = OpTypePointer Uniform %78 - %129 = OpConstantComposite %32 %45 %45 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %135 = OpFunctionCall %2 %6 - %136 = OpFunctionCall %2 %8 - OpReturn - OpFunctionEnd - %6 = OpFunction %2 None %3 - %7 = OpLabel - %12 = OpVariable %11 Function - %20 = OpVariable %11 Function - %44 = OpVariable %43 Function - %46 = OpVariable %43 Function - %56 = OpVariable %43 Function - %18 = OpAccessChain %17 %15 %16 - %19 = OpLoad %10 %18 - OpStore %12 %19 - %22 = OpAccessChain %17 %15 %21 - %23 = OpLoad %10 %22 - OpStore %20 %23 - %28 = OpLoad %25 %27 - %30 = OpLoad %13 %15 - %31 = OpVectorShuffle %29 %30 %30 0 1 - %33 = OpBitcast %32 %31 - %34 = OpLoad %10 %12 - %35 = OpLoad %10 %20 - %36 = OpIAdd %10 %34 %35 - %37 = OpBitcast %24 %36 - %39 = OpCompositeConstruct %38 %37 %37 %37 %37 - OpImageWrite %28 %33 %39 - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - OpStore %44 %45 - OpStore %46 %45 - OpBranch %47 - %47 = OpLabel - OpLoopMerge %49 %50 None - OpBranch %51 - %51 = OpLabel - %52 = OpLoad %24 %46 - %55 = OpSLessThan %54 %52 %53 - OpBranchConditional %55 %48 %49 - %48 = OpLabel - OpStore %56 %45 - OpBranch %57 - %57 = OpLabel - OpLoopMerge %59 %60 None - OpBranch %61 - %61 = OpLabel - %62 = OpLoad %24 %56 - %63 = OpSLessThan %54 %62 %53 - OpBranchConditional %63 %58 %59 - %58 = OpLabel - %64 = OpLoad %25 %27 - %65 = OpLoad %24 %46 - %66 = OpLoad %24 %56 - %67 = OpCompositeConstruct %32 %65 %66 - %68 = OpImageRead %38 %64 %67 - %69 = OpCompositeExtract %24 %68 0 - %70 = OpLoad %24 %44 - %71 = OpIAdd %24 %70 %69 - OpStore %44 %71 - OpBranch %60 - %60 = OpLabel - %72 = OpLoad %24 %56 - %74 = OpIAdd %24 %72 %73 - OpStore %56 %74 - OpBranch %57 - %59 = OpLabel - OpBranch %50 - %50 = OpLabel - %75 = OpLoad %24 %46 - %76 = OpIAdd %24 %75 %73 - OpStore %46 %76 - OpBranch %47 - %49 = OpLabel - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - %83 = OpLoad %24 %44 - %85 = OpAccessChain %84 %82 %53 - OpStore %85 %83 - OpReturn - OpFunctionEnd - %8 = OpFunction %2 None %3 - %9 = OpLabel - %101 = OpVariable %43 Function - %92 = OpAccessChain %91 %90 %73 - %93 = OpLoad %87 %92 - %95 = OpAccessChain %94 %82 %45 - %96 = OpLoad %77 %95 - %97 = OpConvertUToF %86 %96 - %98 = OpMatrixTimesVector %86 %93 %97 - %99 = OpConvertFToU %77 %98 - %100 = OpAccessChain %94 %82 %45 - OpStore %100 %99 - OpStore %101 %45 - OpBranch %102 - %102 = OpLabel - OpLoopMerge %104 %105 None - OpBranch %106 - %106 = OpLabel - %107 = OpLoad %24 %101 - %109 = OpSLessThan %54 %107 %108 - OpBranchConditional %109 %103 %104 - %103 = OpLabel - %111 = OpAccessChain %110 %82 %73 - %112 = OpLoad %79 %111 - %114 = OpAccessChain %113 %90 %53 - %115 = OpLoad %78 %114 - %116 = OpVectorTimesScalar %79 %112 %115 - %117 = OpConvertFToU %13 %116 - %118 = OpCompositeExtract %10 %117 0 - %119 = OpCompositeExtract %10 %117 1 - %120 = OpCompositeExtract %10 %117 2 - %121 = OpCompositeConstruct %77 %118 %119 %120 %16 - %122 = OpAccessChain %94 %82 %45 - %123 = OpLoad %77 %122 - %124 = OpIAdd %77 %123 %121 - %125 = OpAccessChain %94 %82 %45 - OpStore %125 %124 - OpBranch %105 - %105 = OpLabel - %126 = OpLoad %24 %101 - %127 = OpIAdd %24 %126 %73 - OpStore %101 %127 - OpBranch %102 - %104 = OpLabel - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - %128 = OpLoad %25 %27 - %130 = OpImageRead %38 %128 %129 - %131 = OpCompositeExtract %24 %130 0 - %132 = OpConvertSToF %78 %131 - %133 = OpCompositeConstruct %79 %132 %132 %132 - %134 = OpAccessChain %110 %82 %73 - OpStore %134 %133 - OpReturn - OpFunctionEnd -)"; -constexpr char kDst[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" %15 - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "main" - OpName %6 "f1(" - OpName %8 "f2(" - OpName %12 "x" - OpName %15 "gl_LocalInvocationID" - OpName %20 "y" - OpName %27 "image" - OpName %44 "sum" - OpName %46 "i" - OpName %56 "j" - OpName %80 "BufferOut" - OpMemberName %80 0 "o_uv4" - OpMemberName %80 1 "o_v3" - OpMemberName %80 2 "o_i" - OpName %82 "" - OpName %88 "BufferIn" - OpMemberName %88 0 "i_u" - OpMemberName %88 1 "i_v4" - OpMemberName %88 2 "i_f" - OpName %90 "" - OpName %101 "i" - OpName %128 "image2" - OpDecorate %15 BuiltIn LocalInvocationId - OpDecorate %27 DescriptorSet 0 - OpDecorate %27 Binding 2 - OpMemberDecorate %80 0 Offset 0 - OpMemberDecorate %80 1 Offset 16 - OpMemberDecorate %80 2 Offset 28 - OpDecorate %80 BufferBlock - OpDecorate %82 DescriptorSet 0 - OpDecorate %82 Binding 1 - OpMemberDecorate %88 0 Offset 0 - OpMemberDecorate %88 1 RowMajor - OpMemberDecorate %88 1 Offset 16 - OpMemberDecorate %88 1 MatrixStride 16 - OpMemberDecorate %88 2 Offset 80 - OpDecorate %88 Block - OpDecorate %90 DescriptorSet 0 - OpDecorate %90 Binding 0 - OpDecorate %128 DescriptorSet 0 - OpDecorate %128 Binding 3 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %10 = OpTypeInt 32 0 - %11 = OpTypePointer Function %10 - %13 = OpTypeVector %10 3 - %14 = OpTypePointer Input %13 - %15 = OpVariable %14 Input - %16 = OpConstant %10 0 - %17 = OpTypePointer Input %10 - %21 = OpConstant %10 1 - %24 = OpTypeInt 32 1 - %25 = OpTypeImage %24 2D 0 0 0 2 R32i - %26 = OpTypePointer UniformConstant %25 - %27 = OpVariable %26 UniformConstant - %29 = OpTypeVector %10 2 - %32 = OpTypeVector %24 2 - %38 = OpTypeVector %24 4 - %40 = OpConstant %10 2 - %41 = OpConstant %10 3400 - %42 = OpConstant %10 264 - %43 = OpTypePointer Function %24 - %45 = OpConstant %24 0 - %53 = OpConstant %24 2 - %54 = OpTypeBool - %73 = OpConstant %24 1 - %77 = OpTypeVector %10 4 - %78 = OpTypeFloat 32 - %79 = OpTypeVector %78 3 - %80 = OpTypeStruct %77 %79 %24 - %81 = OpTypePointer Uniform %80 - %82 = OpVariable %81 Uniform - %84 = OpTypePointer Uniform %24 - %86 = OpTypeVector %78 4 - %87 = OpTypeMatrix %86 4 - %88 = OpTypeStruct %10 %87 %78 - %89 = OpTypePointer Uniform %88 - %90 = OpVariable %89 Uniform - %91 = OpTypePointer Uniform %87 - %94 = OpTypePointer Uniform %77 - %108 = OpConstant %24 3 - %110 = OpTypePointer Uniform %79 - %113 = OpTypePointer Uniform %78 - %128 = OpVariable %26 UniformConstant - %130 = OpConstantComposite %32 %45 %45 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %136 = OpFunctionCall %2 %6 - %137 = OpFunctionCall %2 %8 - OpReturn - OpFunctionEnd - %6 = OpFunction %2 None %3 - %7 = OpLabel - %12 = OpVariable %11 Function - %20 = OpVariable %11 Function - %44 = OpVariable %43 Function - %46 = OpVariable %43 Function - %56 = OpVariable %43 Function - %18 = OpAccessChain %17 %15 %16 - %19 = OpLoad %10 %18 - OpStore %12 %19 - %22 = OpAccessChain %17 %15 %21 - %23 = OpLoad %10 %22 - OpStore %20 %23 - %28 = OpLoad %25 %27 - %30 = OpLoad %13 %15 - %31 = OpVectorShuffle %29 %30 %30 0 1 - %33 = OpBitcast %32 %31 - %34 = OpLoad %10 %12 - %35 = OpLoad %10 %20 - %36 = OpIAdd %10 %34 %35 - %37 = OpBitcast %24 %36 - %39 = OpCompositeConstruct %38 %37 %37 %37 %37 - OpImageWrite %28 %33 %39 - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - OpStore %44 %45 - OpStore %46 %45 - OpBranch %47 - %47 = OpLabel - OpLoopMerge %49 %50 None - OpBranch %51 - %51 = OpLabel - %52 = OpLoad %24 %46 - %55 = OpSLessThan %54 %52 %53 - OpBranchConditional %55 %48 %49 - %48 = OpLabel - OpStore %56 %45 - OpBranch %57 - %57 = OpLabel - OpLoopMerge %59 %60 None - OpBranch %61 - %61 = OpLabel - %62 = OpLoad %24 %56 - %63 = OpSLessThan %54 %62 %53 - OpBranchConditional %63 %58 %59 - %58 = OpLabel - %64 = OpLoad %25 %27 - %65 = OpLoad %24 %46 - %66 = OpLoad %24 %56 - %67 = OpCompositeConstruct %32 %65 %66 - %68 = OpImageRead %38 %64 %67 - %69 = OpCompositeExtract %24 %68 0 - %70 = OpLoad %24 %44 - %71 = OpIMul %24 %70 %69 - OpStore %44 %71 - OpBranch %60 - %60 = OpLabel - %72 = OpLoad %24 %56 - %74 = OpIAdd %24 %72 %73 - OpStore %56 %74 - OpBranch %57 - %59 = OpLabel - OpBranch %50 - %50 = OpLabel - %75 = OpLoad %24 %46 - %76 = OpIAdd %24 %75 %73 - OpStore %46 %76 - OpBranch %47 - %49 = OpLabel - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - %83 = OpLoad %24 %44 - %85 = OpAccessChain %84 %82 %53 - OpStore %85 %83 - OpReturn - OpFunctionEnd - %8 = OpFunction %2 None %3 - %9 = OpLabel - %101 = OpVariable %43 Function - %92 = OpAccessChain %91 %90 %73 - %93 = OpLoad %87 %92 - %95 = OpAccessChain %94 %82 %45 - %96 = OpLoad %77 %95 - %97 = OpConvertUToF %86 %96 - %98 = OpMatrixTimesVector %86 %93 %97 - %99 = OpConvertFToU %77 %98 - %100 = OpAccessChain %94 %82 %45 - OpStore %100 %99 - OpStore %101 %45 - OpBranch %102 - %102 = OpLabel - OpLoopMerge %104 %105 None - OpBranch %106 - %106 = OpLabel - %107 = OpLoad %24 %101 - %109 = OpSLessThan %54 %107 %108 - OpBranchConditional %109 %103 %104 - %103 = OpLabel - %111 = OpAccessChain %110 %82 %73 - %112 = OpLoad %79 %111 - %114 = OpAccessChain %113 %90 %53 - %115 = OpLoad %78 %114 - %116 = OpVectorTimesScalar %79 %112 %115 - %117 = OpConvertFToU %13 %116 - %118 = OpCompositeExtract %10 %117 0 - %119 = OpCompositeExtract %10 %117 1 - %120 = OpCompositeExtract %10 %117 2 - %121 = OpCompositeConstruct %77 %118 %119 %120 %16 - %122 = OpAccessChain %94 %82 %45 - %123 = OpLoad %77 %122 - %124 = OpIAdd %77 %123 %121 - %125 = OpAccessChain %94 %82 %45 - OpStore %125 %124 - OpBranch %105 - %105 = OpLabel - %126 = OpLoad %24 %101 - %127 = OpIAdd %24 %126 %73 - OpStore %101 %127 - OpBranch %102 - %104 = OpLabel - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - %129 = OpLoad %25 %128 - %131 = OpImageRead %38 %129 %130 - %132 = OpCompositeExtract %24 %131 0 - %133 = OpConvertSToF %78 %132 - %134 = OpCompositeConstruct %79 %133 %133 %133 - %135 = OpAccessChain %110 %82 %73 - OpStore %135 %134 - OpReturn - OpFunctionEnd - -)"; - -TEST(DiffTest, LargeFunctionsSmallDiffs) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 137 -+; Bound: 140 - ; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" %15 - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "main" - OpName %6 "f1(" - OpName %8 "f2(" - OpName %12 "x" - OpName %15 "gl_LocalInvocationID" - OpName %20 "y" - OpName %27 "image" - OpName %44 "sum" - OpName %46 "i" - OpName %56 "j" - OpName %80 "BufferOut" - OpMemberName %80 0 "o_uv4" - OpMemberName %80 1 "o_v3" - OpMemberName %80 2 "o_i" - OpName %82 "" - OpName %88 "BufferIn" - OpMemberName %88 0 "i_u" - OpMemberName %88 1 "i_v4" - OpMemberName %88 2 "i_f" - OpName %90 "" - OpName %101 "i" -+OpName %138 "image2" - OpDecorate %15 BuiltIn LocalInvocationId - OpDecorate %27 DescriptorSet 0 - OpDecorate %27 Binding 2 - OpMemberDecorate %80 0 Offset 0 - OpMemberDecorate %80 1 Offset 16 - OpMemberDecorate %80 2 Offset 28 - OpDecorate %80 BufferBlock - OpDecorate %82 DescriptorSet 0 - OpDecorate %82 Binding 1 - OpMemberDecorate %88 0 Offset 0 - OpMemberDecorate %88 1 RowMajor - OpMemberDecorate %88 1 Offset 16 - OpMemberDecorate %88 1 MatrixStride 16 - OpMemberDecorate %88 2 Offset 80 - OpDecorate %88 Block - OpDecorate %90 DescriptorSet 0 - OpDecorate %90 Binding 0 -+OpDecorate %138 DescriptorSet 0 -+OpDecorate %138 Binding 3 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %10 = OpTypeInt 32 0 - %11 = OpTypePointer Function %10 - %13 = OpTypeVector %10 3 - %14 = OpTypePointer Input %13 - %15 = OpVariable %14 Input - %16 = OpConstant %10 0 - %17 = OpTypePointer Input %10 - %21 = OpConstant %10 1 - %24 = OpTypeInt 32 1 - %25 = OpTypeImage %24 2D 0 0 0 2 R32i - %26 = OpTypePointer UniformConstant %25 - %27 = OpVariable %26 UniformConstant - %29 = OpTypeVector %10 2 - %32 = OpTypeVector %24 2 - %38 = OpTypeVector %24 4 - %40 = OpConstant %10 2 - %41 = OpConstant %10 3400 - %42 = OpConstant %10 264 - %43 = OpTypePointer Function %24 - %45 = OpConstant %24 0 - %53 = OpConstant %24 2 - %54 = OpTypeBool - %73 = OpConstant %24 1 - %77 = OpTypeVector %10 4 - %78 = OpTypeFloat 32 - %79 = OpTypeVector %78 3 - %80 = OpTypeStruct %77 %79 %24 - %81 = OpTypePointer Uniform %80 - %82 = OpVariable %81 Uniform - %84 = OpTypePointer Uniform %24 - %86 = OpTypeVector %78 4 - %87 = OpTypeMatrix %86 4 - %88 = OpTypeStruct %10 %87 %78 - %89 = OpTypePointer Uniform %88 - %90 = OpVariable %89 Uniform - %91 = OpTypePointer Uniform %87 - %94 = OpTypePointer Uniform %77 - %108 = OpConstant %24 3 - %110 = OpTypePointer Uniform %79 - %113 = OpTypePointer Uniform %78 -+%138 = OpVariable %26 UniformConstant - %129 = OpConstantComposite %32 %45 %45 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %135 = OpFunctionCall %2 %6 - %136 = OpFunctionCall %2 %8 - OpReturn - OpFunctionEnd - %6 = OpFunction %2 None %3 - %7 = OpLabel - %12 = OpVariable %11 Function - %20 = OpVariable %11 Function - %44 = OpVariable %43 Function - %46 = OpVariable %43 Function - %56 = OpVariable %43 Function - %18 = OpAccessChain %17 %15 %16 - %19 = OpLoad %10 %18 - OpStore %12 %19 - %22 = OpAccessChain %17 %15 %21 - %23 = OpLoad %10 %22 - OpStore %20 %23 - %28 = OpLoad %25 %27 - %30 = OpLoad %13 %15 - %31 = OpVectorShuffle %29 %30 %30 0 1 - %33 = OpBitcast %32 %31 - %34 = OpLoad %10 %12 - %35 = OpLoad %10 %20 - %36 = OpIAdd %10 %34 %35 - %37 = OpBitcast %24 %36 - %39 = OpCompositeConstruct %38 %37 %37 %37 %37 - OpImageWrite %28 %33 %39 - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - OpStore %44 %45 - OpStore %46 %45 - OpBranch %47 - %47 = OpLabel - OpLoopMerge %49 %50 None - OpBranch %51 - %51 = OpLabel - %52 = OpLoad %24 %46 - %55 = OpSLessThan %54 %52 %53 - OpBranchConditional %55 %48 %49 - %48 = OpLabel - OpStore %56 %45 - OpBranch %57 - %57 = OpLabel - OpLoopMerge %59 %60 None - OpBranch %61 - %61 = OpLabel - %62 = OpLoad %24 %56 - %63 = OpSLessThan %54 %62 %53 - OpBranchConditional %63 %58 %59 - %58 = OpLabel - %64 = OpLoad %25 %27 - %65 = OpLoad %24 %46 - %66 = OpLoad %24 %56 - %67 = OpCompositeConstruct %32 %65 %66 - %68 = OpImageRead %38 %64 %67 - %69 = OpCompositeExtract %24 %68 0 - %70 = OpLoad %24 %44 --%71 = OpIAdd %24 %70 %69 -+%137 = OpIMul %24 %70 %69 --OpStore %44 %71 -+OpStore %44 %137 - OpBranch %60 - %60 = OpLabel - %72 = OpLoad %24 %56 - %74 = OpIAdd %24 %72 %73 - OpStore %56 %74 - OpBranch %57 - %59 = OpLabel - OpBranch %50 - %50 = OpLabel - %75 = OpLoad %24 %46 - %76 = OpIAdd %24 %75 %73 - OpStore %46 %76 - OpBranch %47 - %49 = OpLabel - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - %83 = OpLoad %24 %44 - %85 = OpAccessChain %84 %82 %53 - OpStore %85 %83 - OpReturn - OpFunctionEnd - %8 = OpFunction %2 None %3 - %9 = OpLabel - %101 = OpVariable %43 Function - %92 = OpAccessChain %91 %90 %73 - %93 = OpLoad %87 %92 - %95 = OpAccessChain %94 %82 %45 - %96 = OpLoad %77 %95 - %97 = OpConvertUToF %86 %96 - %98 = OpMatrixTimesVector %86 %93 %97 - %99 = OpConvertFToU %77 %98 - %100 = OpAccessChain %94 %82 %45 - OpStore %100 %99 - OpStore %101 %45 - OpBranch %102 - %102 = OpLabel - OpLoopMerge %104 %105 None - OpBranch %106 - %106 = OpLabel - %107 = OpLoad %24 %101 - %109 = OpSLessThan %54 %107 %108 - OpBranchConditional %109 %103 %104 - %103 = OpLabel - %111 = OpAccessChain %110 %82 %73 - %112 = OpLoad %79 %111 - %114 = OpAccessChain %113 %90 %53 - %115 = OpLoad %78 %114 - %116 = OpVectorTimesScalar %79 %112 %115 - %117 = OpConvertFToU %13 %116 - %118 = OpCompositeExtract %10 %117 0 - %119 = OpCompositeExtract %10 %117 1 - %120 = OpCompositeExtract %10 %117 2 - %121 = OpCompositeConstruct %77 %118 %119 %120 %16 - %122 = OpAccessChain %94 %82 %45 - %123 = OpLoad %77 %122 - %124 = OpIAdd %77 %123 %121 - %125 = OpAccessChain %94 %82 %45 - OpStore %125 %124 - OpBranch %105 - %105 = OpLabel - %126 = OpLoad %24 %101 - %127 = OpIAdd %24 %126 %73 - OpStore %101 %127 - OpBranch %102 - %104 = OpLabel - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 --%128 = OpLoad %25 %27 -+%139 = OpLoad %25 %138 --%130 = OpImageRead %38 %128 %129 -+%130 = OpImageRead %38 %139 %129 - %131 = OpCompositeExtract %24 %130 0 - %132 = OpConvertSToF %78 %131 - %133 = OpCompositeConstruct %79 %132 %132 %132 - %134 = OpAccessChain %110 %82 %73 - OpStore %134 %133 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, LargeFunctionsSmallDiffsNoDebug) { - constexpr char kSrcNoDebug[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" %15 - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpDecorate %15 BuiltIn LocalInvocationId - OpDecorate %27 DescriptorSet 0 - OpDecorate %27 Binding 2 - OpMemberDecorate %80 0 Offset 0 - OpMemberDecorate %80 1 Offset 16 - OpMemberDecorate %80 2 Offset 28 - OpDecorate %80 BufferBlock - OpDecorate %82 DescriptorSet 0 - OpDecorate %82 Binding 1 - OpMemberDecorate %88 0 Offset 0 - OpMemberDecorate %88 1 RowMajor - OpMemberDecorate %88 1 Offset 16 - OpMemberDecorate %88 1 MatrixStride 16 - OpMemberDecorate %88 2 Offset 80 - OpDecorate %88 Block - OpDecorate %90 DescriptorSet 0 - OpDecorate %90 Binding 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %10 = OpTypeInt 32 0 - %11 = OpTypePointer Function %10 - %13 = OpTypeVector %10 3 - %14 = OpTypePointer Input %13 - %15 = OpVariable %14 Input - %16 = OpConstant %10 0 - %17 = OpTypePointer Input %10 - %21 = OpConstant %10 1 - %24 = OpTypeInt 32 1 - %25 = OpTypeImage %24 2D 0 0 0 2 R32i - %26 = OpTypePointer UniformConstant %25 - %27 = OpVariable %26 UniformConstant - %29 = OpTypeVector %10 2 - %32 = OpTypeVector %24 2 - %38 = OpTypeVector %24 4 - %40 = OpConstant %10 2 - %41 = OpConstant %10 3400 - %42 = OpConstant %10 264 - %43 = OpTypePointer Function %24 - %45 = OpConstant %24 0 - %53 = OpConstant %24 2 - %54 = OpTypeBool - %73 = OpConstant %24 1 - %77 = OpTypeVector %10 4 - %78 = OpTypeFloat 32 - %79 = OpTypeVector %78 3 - %80 = OpTypeStruct %77 %79 %24 - %81 = OpTypePointer Uniform %80 - %82 = OpVariable %81 Uniform - %84 = OpTypePointer Uniform %24 - %86 = OpTypeVector %78 4 - %87 = OpTypeMatrix %86 4 - %88 = OpTypeStruct %10 %87 %78 - %89 = OpTypePointer Uniform %88 - %90 = OpVariable %89 Uniform - %91 = OpTypePointer Uniform %87 - %94 = OpTypePointer Uniform %77 - %108 = OpConstant %24 3 - %110 = OpTypePointer Uniform %79 - %113 = OpTypePointer Uniform %78 - %129 = OpConstantComposite %32 %45 %45 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %135 = OpFunctionCall %2 %6 - %136 = OpFunctionCall %2 %8 - OpReturn - OpFunctionEnd - %6 = OpFunction %2 None %3 - %7 = OpLabel - %12 = OpVariable %11 Function - %20 = OpVariable %11 Function - %44 = OpVariable %43 Function - %46 = OpVariable %43 Function - %56 = OpVariable %43 Function - %18 = OpAccessChain %17 %15 %16 - %19 = OpLoad %10 %18 - OpStore %12 %19 - %22 = OpAccessChain %17 %15 %21 - %23 = OpLoad %10 %22 - OpStore %20 %23 - %28 = OpLoad %25 %27 - %30 = OpLoad %13 %15 - %31 = OpVectorShuffle %29 %30 %30 0 1 - %33 = OpBitcast %32 %31 - %34 = OpLoad %10 %12 - %35 = OpLoad %10 %20 - %36 = OpIAdd %10 %34 %35 - %37 = OpBitcast %24 %36 - %39 = OpCompositeConstruct %38 %37 %37 %37 %37 - OpImageWrite %28 %33 %39 - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - OpStore %44 %45 - OpStore %46 %45 - OpBranch %47 - %47 = OpLabel - OpLoopMerge %49 %50 None - OpBranch %51 - %51 = OpLabel - %52 = OpLoad %24 %46 - %55 = OpSLessThan %54 %52 %53 - OpBranchConditional %55 %48 %49 - %48 = OpLabel - OpStore %56 %45 - OpBranch %57 - %57 = OpLabel - OpLoopMerge %59 %60 None - OpBranch %61 - %61 = OpLabel - %62 = OpLoad %24 %56 - %63 = OpSLessThan %54 %62 %53 - OpBranchConditional %63 %58 %59 - %58 = OpLabel - %64 = OpLoad %25 %27 - %65 = OpLoad %24 %46 - %66 = OpLoad %24 %56 - %67 = OpCompositeConstruct %32 %65 %66 - %68 = OpImageRead %38 %64 %67 - %69 = OpCompositeExtract %24 %68 0 - %70 = OpLoad %24 %44 - %71 = OpIAdd %24 %70 %69 - OpStore %44 %71 - OpBranch %60 - %60 = OpLabel - %72 = OpLoad %24 %56 - %74 = OpIAdd %24 %72 %73 - OpStore %56 %74 - OpBranch %57 - %59 = OpLabel - OpBranch %50 - %50 = OpLabel - %75 = OpLoad %24 %46 - %76 = OpIAdd %24 %75 %73 - OpStore %46 %76 - OpBranch %47 - %49 = OpLabel - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - %83 = OpLoad %24 %44 - %85 = OpAccessChain %84 %82 %53 - OpStore %85 %83 - OpReturn - OpFunctionEnd - %8 = OpFunction %2 None %3 - %9 = OpLabel - %101 = OpVariable %43 Function - %92 = OpAccessChain %91 %90 %73 - %93 = OpLoad %87 %92 - %95 = OpAccessChain %94 %82 %45 - %96 = OpLoad %77 %95 - %97 = OpConvertUToF %86 %96 - %98 = OpMatrixTimesVector %86 %93 %97 - %99 = OpConvertFToU %77 %98 - %100 = OpAccessChain %94 %82 %45 - OpStore %100 %99 - OpStore %101 %45 - OpBranch %102 - %102 = OpLabel - OpLoopMerge %104 %105 None - OpBranch %106 - %106 = OpLabel - %107 = OpLoad %24 %101 - %109 = OpSLessThan %54 %107 %108 - OpBranchConditional %109 %103 %104 - %103 = OpLabel - %111 = OpAccessChain %110 %82 %73 - %112 = OpLoad %79 %111 - %114 = OpAccessChain %113 %90 %53 - %115 = OpLoad %78 %114 - %116 = OpVectorTimesScalar %79 %112 %115 - %117 = OpConvertFToU %13 %116 - %118 = OpCompositeExtract %10 %117 0 - %119 = OpCompositeExtract %10 %117 1 - %120 = OpCompositeExtract %10 %117 2 - %121 = OpCompositeConstruct %77 %118 %119 %120 %16 - %122 = OpAccessChain %94 %82 %45 - %123 = OpLoad %77 %122 - %124 = OpIAdd %77 %123 %121 - %125 = OpAccessChain %94 %82 %45 - OpStore %125 %124 - OpBranch %105 - %105 = OpLabel - %126 = OpLoad %24 %101 - %127 = OpIAdd %24 %126 %73 - OpStore %101 %127 - OpBranch %102 - %104 = OpLabel - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - %128 = OpLoad %25 %27 - %130 = OpImageRead %38 %128 %129 - %131 = OpCompositeExtract %24 %130 0 - %132 = OpConvertSToF %78 %131 - %133 = OpCompositeConstruct %79 %132 %132 %132 - %134 = OpAccessChain %110 %82 %73 - OpStore %134 %133 - OpReturn - OpFunctionEnd - -)"; - constexpr char kDstNoDebug[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" %15 - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpDecorate %15 BuiltIn LocalInvocationId - OpDecorate %27 DescriptorSet 0 - OpDecorate %27 Binding 2 - OpMemberDecorate %80 0 Offset 0 - OpMemberDecorate %80 1 Offset 16 - OpMemberDecorate %80 2 Offset 28 - OpDecorate %80 BufferBlock - OpDecorate %82 DescriptorSet 0 - OpDecorate %82 Binding 1 - OpMemberDecorate %88 0 Offset 0 - OpMemberDecorate %88 1 RowMajor - OpMemberDecorate %88 1 Offset 16 - OpMemberDecorate %88 1 MatrixStride 16 - OpMemberDecorate %88 2 Offset 80 - OpDecorate %88 Block - OpDecorate %90 DescriptorSet 0 - OpDecorate %90 Binding 0 - OpDecorate %128 DescriptorSet 0 - OpDecorate %128 Binding 3 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %10 = OpTypeInt 32 0 - %11 = OpTypePointer Function %10 - %13 = OpTypeVector %10 3 - %14 = OpTypePointer Input %13 - %15 = OpVariable %14 Input - %16 = OpConstant %10 0 - %17 = OpTypePointer Input %10 - %21 = OpConstant %10 1 - %24 = OpTypeInt 32 1 - %25 = OpTypeImage %24 2D 0 0 0 2 R32i - %26 = OpTypePointer UniformConstant %25 - %27 = OpVariable %26 UniformConstant - %29 = OpTypeVector %10 2 - %32 = OpTypeVector %24 2 - %38 = OpTypeVector %24 4 - %40 = OpConstant %10 2 - %41 = OpConstant %10 3400 - %42 = OpConstant %10 264 - %43 = OpTypePointer Function %24 - %45 = OpConstant %24 0 - %53 = OpConstant %24 2 - %54 = OpTypeBool - %73 = OpConstant %24 1 - %77 = OpTypeVector %10 4 - %78 = OpTypeFloat 32 - %79 = OpTypeVector %78 3 - %80 = OpTypeStruct %77 %79 %24 - %81 = OpTypePointer Uniform %80 - %82 = OpVariable %81 Uniform - %84 = OpTypePointer Uniform %24 - %86 = OpTypeVector %78 4 - %87 = OpTypeMatrix %86 4 - %88 = OpTypeStruct %10 %87 %78 - %89 = OpTypePointer Uniform %88 - %90 = OpVariable %89 Uniform - %91 = OpTypePointer Uniform %87 - %94 = OpTypePointer Uniform %77 - %108 = OpConstant %24 3 - %110 = OpTypePointer Uniform %79 - %113 = OpTypePointer Uniform %78 - %128 = OpVariable %26 UniformConstant - %130 = OpConstantComposite %32 %45 %45 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %136 = OpFunctionCall %2 %6 - %137 = OpFunctionCall %2 %8 - OpReturn - OpFunctionEnd - %6 = OpFunction %2 None %3 - %7 = OpLabel - %12 = OpVariable %11 Function - %20 = OpVariable %11 Function - %44 = OpVariable %43 Function - %46 = OpVariable %43 Function - %56 = OpVariable %43 Function - %18 = OpAccessChain %17 %15 %16 - %19 = OpLoad %10 %18 - OpStore %12 %19 - %22 = OpAccessChain %17 %15 %21 - %23 = OpLoad %10 %22 - OpStore %20 %23 - %28 = OpLoad %25 %27 - %30 = OpLoad %13 %15 - %31 = OpVectorShuffle %29 %30 %30 0 1 - %33 = OpBitcast %32 %31 - %34 = OpLoad %10 %12 - %35 = OpLoad %10 %20 - %36 = OpIAdd %10 %34 %35 - %37 = OpBitcast %24 %36 - %39 = OpCompositeConstruct %38 %37 %37 %37 %37 - OpImageWrite %28 %33 %39 - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - OpStore %44 %45 - OpStore %46 %45 - OpBranch %47 - %47 = OpLabel - OpLoopMerge %49 %50 None - OpBranch %51 - %51 = OpLabel - %52 = OpLoad %24 %46 - %55 = OpSLessThan %54 %52 %53 - OpBranchConditional %55 %48 %49 - %48 = OpLabel - OpStore %56 %45 - OpBranch %57 - %57 = OpLabel - OpLoopMerge %59 %60 None - OpBranch %61 - %61 = OpLabel - %62 = OpLoad %24 %56 - %63 = OpSLessThan %54 %62 %53 - OpBranchConditional %63 %58 %59 - %58 = OpLabel - %64 = OpLoad %25 %27 - %65 = OpLoad %24 %46 - %66 = OpLoad %24 %56 - %67 = OpCompositeConstruct %32 %65 %66 - %68 = OpImageRead %38 %64 %67 - %69 = OpCompositeExtract %24 %68 0 - %70 = OpLoad %24 %44 - %71 = OpIMul %24 %70 %69 - OpStore %44 %71 - OpBranch %60 - %60 = OpLabel - %72 = OpLoad %24 %56 - %74 = OpIAdd %24 %72 %73 - OpStore %56 %74 - OpBranch %57 - %59 = OpLabel - OpBranch %50 - %50 = OpLabel - %75 = OpLoad %24 %46 - %76 = OpIAdd %24 %75 %73 - OpStore %46 %76 - OpBranch %47 - %49 = OpLabel - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - %83 = OpLoad %24 %44 - %85 = OpAccessChain %84 %82 %53 - OpStore %85 %83 - OpReturn - OpFunctionEnd - %8 = OpFunction %2 None %3 - %9 = OpLabel - %101 = OpVariable %43 Function - %92 = OpAccessChain %91 %90 %73 - %93 = OpLoad %87 %92 - %95 = OpAccessChain %94 %82 %45 - %96 = OpLoad %77 %95 - %97 = OpConvertUToF %86 %96 - %98 = OpMatrixTimesVector %86 %93 %97 - %99 = OpConvertFToU %77 %98 - %100 = OpAccessChain %94 %82 %45 - OpStore %100 %99 - OpStore %101 %45 - OpBranch %102 - %102 = OpLabel - OpLoopMerge %104 %105 None - OpBranch %106 - %106 = OpLabel - %107 = OpLoad %24 %101 - %109 = OpSLessThan %54 %107 %108 - OpBranchConditional %109 %103 %104 - %103 = OpLabel - %111 = OpAccessChain %110 %82 %73 - %112 = OpLoad %79 %111 - %114 = OpAccessChain %113 %90 %53 - %115 = OpLoad %78 %114 - %116 = OpVectorTimesScalar %79 %112 %115 - %117 = OpConvertFToU %13 %116 - %118 = OpCompositeExtract %10 %117 0 - %119 = OpCompositeExtract %10 %117 1 - %120 = OpCompositeExtract %10 %117 2 - %121 = OpCompositeConstruct %77 %118 %119 %120 %16 - %122 = OpAccessChain %94 %82 %45 - %123 = OpLoad %77 %122 - %124 = OpIAdd %77 %123 %121 - %125 = OpAccessChain %94 %82 %45 - OpStore %125 %124 - OpBranch %105 - %105 = OpLabel - %126 = OpLoad %24 %101 - %127 = OpIAdd %24 %126 %73 - OpStore %101 %127 - OpBranch %102 - %104 = OpLabel - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - %129 = OpLoad %25 %128 - %131 = OpImageRead %38 %129 %130 - %132 = OpCompositeExtract %24 %131 0 - %133 = OpConvertSToF %78 %132 - %134 = OpCompositeConstruct %79 %133 %133 %133 - %135 = OpAccessChain %110 %82 %73 - OpStore %135 %134 - OpReturn - OpFunctionEnd - -)"; - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 137 -+; Bound: 140 - ; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" %15 - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpDecorate %15 BuiltIn LocalInvocationId - OpDecorate %27 DescriptorSet 0 - OpDecorate %27 Binding 2 - OpMemberDecorate %80 0 Offset 0 - OpMemberDecorate %80 1 Offset 16 - OpMemberDecorate %80 2 Offset 28 - OpDecorate %80 BufferBlock - OpDecorate %82 DescriptorSet 0 - OpDecorate %82 Binding 1 - OpMemberDecorate %88 0 Offset 0 - OpMemberDecorate %88 1 RowMajor - OpMemberDecorate %88 1 Offset 16 - OpMemberDecorate %88 1 MatrixStride 16 - OpMemberDecorate %88 2 Offset 80 - OpDecorate %88 Block - OpDecorate %90 DescriptorSet 0 - OpDecorate %90 Binding 0 -+OpDecorate %138 DescriptorSet 0 -+OpDecorate %138 Binding 3 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %10 = OpTypeInt 32 0 - %11 = OpTypePointer Function %10 - %13 = OpTypeVector %10 3 - %14 = OpTypePointer Input %13 - %15 = OpVariable %14 Input - %16 = OpConstant %10 0 - %17 = OpTypePointer Input %10 - %21 = OpConstant %10 1 - %24 = OpTypeInt 32 1 - %25 = OpTypeImage %24 2D 0 0 0 2 R32i - %26 = OpTypePointer UniformConstant %25 - %27 = OpVariable %26 UniformConstant - %29 = OpTypeVector %10 2 - %32 = OpTypeVector %24 2 - %38 = OpTypeVector %24 4 - %40 = OpConstant %10 2 - %41 = OpConstant %10 3400 - %42 = OpConstant %10 264 - %43 = OpTypePointer Function %24 - %45 = OpConstant %24 0 - %53 = OpConstant %24 2 - %54 = OpTypeBool - %73 = OpConstant %24 1 - %77 = OpTypeVector %10 4 - %78 = OpTypeFloat 32 - %79 = OpTypeVector %78 3 - %80 = OpTypeStruct %77 %79 %24 - %81 = OpTypePointer Uniform %80 - %82 = OpVariable %81 Uniform - %84 = OpTypePointer Uniform %24 - %86 = OpTypeVector %78 4 - %87 = OpTypeMatrix %86 4 - %88 = OpTypeStruct %10 %87 %78 - %89 = OpTypePointer Uniform %88 - %90 = OpVariable %89 Uniform - %91 = OpTypePointer Uniform %87 - %94 = OpTypePointer Uniform %77 - %108 = OpConstant %24 3 - %110 = OpTypePointer Uniform %79 - %113 = OpTypePointer Uniform %78 -+%138 = OpVariable %26 UniformConstant - %129 = OpConstantComposite %32 %45 %45 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %135 = OpFunctionCall %2 %6 - %136 = OpFunctionCall %2 %8 - OpReturn - OpFunctionEnd - %6 = OpFunction %2 None %3 - %7 = OpLabel - %12 = OpVariable %11 Function - %20 = OpVariable %11 Function - %44 = OpVariable %43 Function - %46 = OpVariable %43 Function - %56 = OpVariable %43 Function - %18 = OpAccessChain %17 %15 %16 - %19 = OpLoad %10 %18 - OpStore %12 %19 - %22 = OpAccessChain %17 %15 %21 - %23 = OpLoad %10 %22 - OpStore %20 %23 - %28 = OpLoad %25 %27 - %30 = OpLoad %13 %15 - %31 = OpVectorShuffle %29 %30 %30 0 1 - %33 = OpBitcast %32 %31 - %34 = OpLoad %10 %12 - %35 = OpLoad %10 %20 - %36 = OpIAdd %10 %34 %35 - %37 = OpBitcast %24 %36 - %39 = OpCompositeConstruct %38 %37 %37 %37 %37 - OpImageWrite %28 %33 %39 - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - OpStore %44 %45 - OpStore %46 %45 - OpBranch %47 - %47 = OpLabel - OpLoopMerge %49 %50 None - OpBranch %51 - %51 = OpLabel - %52 = OpLoad %24 %46 - %55 = OpSLessThan %54 %52 %53 - OpBranchConditional %55 %48 %49 - %48 = OpLabel - OpStore %56 %45 - OpBranch %57 - %57 = OpLabel - OpLoopMerge %59 %60 None - OpBranch %61 - %61 = OpLabel - %62 = OpLoad %24 %56 - %63 = OpSLessThan %54 %62 %53 - OpBranchConditional %63 %58 %59 - %58 = OpLabel - %64 = OpLoad %25 %27 - %65 = OpLoad %24 %46 - %66 = OpLoad %24 %56 - %67 = OpCompositeConstruct %32 %65 %66 - %68 = OpImageRead %38 %64 %67 - %69 = OpCompositeExtract %24 %68 0 - %70 = OpLoad %24 %44 --%71 = OpIAdd %24 %70 %69 -+%137 = OpIMul %24 %70 %69 --OpStore %44 %71 -+OpStore %44 %137 - OpBranch %60 - %60 = OpLabel - %72 = OpLoad %24 %56 - %74 = OpIAdd %24 %72 %73 - OpStore %56 %74 - OpBranch %57 - %59 = OpLabel - OpBranch %50 - %50 = OpLabel - %75 = OpLoad %24 %46 - %76 = OpIAdd %24 %75 %73 - OpStore %46 %76 - OpBranch %47 - %49 = OpLabel - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - %83 = OpLoad %24 %44 - %85 = OpAccessChain %84 %82 %53 - OpStore %85 %83 - OpReturn - OpFunctionEnd - %8 = OpFunction %2 None %3 - %9 = OpLabel - %101 = OpVariable %43 Function - %92 = OpAccessChain %91 %90 %73 - %93 = OpLoad %87 %92 - %95 = OpAccessChain %94 %82 %45 - %96 = OpLoad %77 %95 - %97 = OpConvertUToF %86 %96 - %98 = OpMatrixTimesVector %86 %93 %97 - %99 = OpConvertFToU %77 %98 - %100 = OpAccessChain %94 %82 %45 - OpStore %100 %99 - OpStore %101 %45 - OpBranch %102 - %102 = OpLabel - OpLoopMerge %104 %105 None - OpBranch %106 - %106 = OpLabel - %107 = OpLoad %24 %101 - %109 = OpSLessThan %54 %107 %108 - OpBranchConditional %109 %103 %104 - %103 = OpLabel - %111 = OpAccessChain %110 %82 %73 - %112 = OpLoad %79 %111 - %114 = OpAccessChain %113 %90 %53 - %115 = OpLoad %78 %114 - %116 = OpVectorTimesScalar %79 %112 %115 - %117 = OpConvertFToU %13 %116 - %118 = OpCompositeExtract %10 %117 0 - %119 = OpCompositeExtract %10 %117 1 - %120 = OpCompositeExtract %10 %117 2 - %121 = OpCompositeConstruct %77 %118 %119 %120 %16 - %122 = OpAccessChain %94 %82 %45 - %123 = OpLoad %77 %122 - %124 = OpIAdd %77 %123 %121 - %125 = OpAccessChain %94 %82 %45 - OpStore %125 %124 - OpBranch %105 - %105 = OpLabel - %126 = OpLoad %24 %101 - %127 = OpIAdd %24 %126 %73 - OpStore %101 %127 - OpBranch %102 - %104 = OpLabel - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 --%128 = OpLoad %25 %27 -+%139 = OpLoad %25 %138 --%130 = OpImageRead %38 %128 %129 -+%130 = OpImageRead %38 %139 %129 - %131 = OpCompositeExtract %24 %130 0 - %132 = OpConvertSToF %78 %131 - %133 = OpCompositeConstruct %79 %132 %132 %132 - %134 = OpAccessChain %110 %82 %73 - OpStore %134 %133 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_files/large_functions_small_diffs_dst.spvasm b/test/diff/diff_files/large_functions_small_diffs_dst.spvasm deleted file mode 100644 index f788e0b6..00000000 --- a/test/diff/diff_files/large_functions_small_diffs_dst.spvasm +++ /dev/null @@ -1,229 +0,0 @@ - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" %15 - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "main" - OpName %6 "f1(" - OpName %8 "f2(" - OpName %12 "x" - OpName %15 "gl_LocalInvocationID" - OpName %20 "y" - OpName %27 "image" - OpName %44 "sum" - OpName %46 "i" - OpName %56 "j" - OpName %80 "BufferOut" - OpMemberName %80 0 "o_uv4" - OpMemberName %80 1 "o_v3" - OpMemberName %80 2 "o_i" - OpName %82 "" - OpName %88 "BufferIn" - OpMemberName %88 0 "i_u" - OpMemberName %88 1 "i_v4" - OpMemberName %88 2 "i_f" - OpName %90 "" - OpName %101 "i" - OpName %128 "image2" - OpDecorate %15 BuiltIn LocalInvocationId - OpDecorate %27 DescriptorSet 0 - OpDecorate %27 Binding 2 - OpMemberDecorate %80 0 Offset 0 - OpMemberDecorate %80 1 Offset 16 - OpMemberDecorate %80 2 Offset 28 - OpDecorate %80 BufferBlock - OpDecorate %82 DescriptorSet 0 - OpDecorate %82 Binding 1 - OpMemberDecorate %88 0 Offset 0 - OpMemberDecorate %88 1 RowMajor - OpMemberDecorate %88 1 Offset 16 - OpMemberDecorate %88 1 MatrixStride 16 - OpMemberDecorate %88 2 Offset 80 - OpDecorate %88 Block - OpDecorate %90 DescriptorSet 0 - OpDecorate %90 Binding 0 - OpDecorate %128 DescriptorSet 0 - OpDecorate %128 Binding 3 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %10 = OpTypeInt 32 0 - %11 = OpTypePointer Function %10 - %13 = OpTypeVector %10 3 - %14 = OpTypePointer Input %13 - %15 = OpVariable %14 Input - %16 = OpConstant %10 0 - %17 = OpTypePointer Input %10 - %21 = OpConstant %10 1 - %24 = OpTypeInt 32 1 - %25 = OpTypeImage %24 2D 0 0 0 2 R32i - %26 = OpTypePointer UniformConstant %25 - %27 = OpVariable %26 UniformConstant - %29 = OpTypeVector %10 2 - %32 = OpTypeVector %24 2 - %38 = OpTypeVector %24 4 - %40 = OpConstant %10 2 - %41 = OpConstant %10 3400 - %42 = OpConstant %10 264 - %43 = OpTypePointer Function %24 - %45 = OpConstant %24 0 - %53 = OpConstant %24 2 - %54 = OpTypeBool - %73 = OpConstant %24 1 - %77 = OpTypeVector %10 4 - %78 = OpTypeFloat 32 - %79 = OpTypeVector %78 3 - %80 = OpTypeStruct %77 %79 %24 - %81 = OpTypePointer Uniform %80 - %82 = OpVariable %81 Uniform - %84 = OpTypePointer Uniform %24 - %86 = OpTypeVector %78 4 - %87 = OpTypeMatrix %86 4 - %88 = OpTypeStruct %10 %87 %78 - %89 = OpTypePointer Uniform %88 - %90 = OpVariable %89 Uniform - %91 = OpTypePointer Uniform %87 - %94 = OpTypePointer Uniform %77 - %108 = OpConstant %24 3 - %110 = OpTypePointer Uniform %79 - %113 = OpTypePointer Uniform %78 - %128 = OpVariable %26 UniformConstant - %130 = OpConstantComposite %32 %45 %45 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %136 = OpFunctionCall %2 %6 - %137 = OpFunctionCall %2 %8 - OpReturn - OpFunctionEnd - %6 = OpFunction %2 None %3 - %7 = OpLabel - %12 = OpVariable %11 Function - %20 = OpVariable %11 Function - %44 = OpVariable %43 Function - %46 = OpVariable %43 Function - %56 = OpVariable %43 Function - %18 = OpAccessChain %17 %15 %16 - %19 = OpLoad %10 %18 - OpStore %12 %19 - %22 = OpAccessChain %17 %15 %21 - %23 = OpLoad %10 %22 - OpStore %20 %23 - %28 = OpLoad %25 %27 - %30 = OpLoad %13 %15 - %31 = OpVectorShuffle %29 %30 %30 0 1 - %33 = OpBitcast %32 %31 - %34 = OpLoad %10 %12 - %35 = OpLoad %10 %20 - %36 = OpIAdd %10 %34 %35 - %37 = OpBitcast %24 %36 - %39 = OpCompositeConstruct %38 %37 %37 %37 %37 - OpImageWrite %28 %33 %39 - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - OpStore %44 %45 - OpStore %46 %45 - OpBranch %47 - %47 = OpLabel - OpLoopMerge %49 %50 None - OpBranch %51 - %51 = OpLabel - %52 = OpLoad %24 %46 - %55 = OpSLessThan %54 %52 %53 - OpBranchConditional %55 %48 %49 - %48 = OpLabel - OpStore %56 %45 - OpBranch %57 - %57 = OpLabel - OpLoopMerge %59 %60 None - OpBranch %61 - %61 = OpLabel - %62 = OpLoad %24 %56 - %63 = OpSLessThan %54 %62 %53 - OpBranchConditional %63 %58 %59 - %58 = OpLabel - %64 = OpLoad %25 %27 - %65 = OpLoad %24 %46 - %66 = OpLoad %24 %56 - %67 = OpCompositeConstruct %32 %65 %66 - %68 = OpImageRead %38 %64 %67 - %69 = OpCompositeExtract %24 %68 0 - %70 = OpLoad %24 %44 - %71 = OpIMul %24 %70 %69 - OpStore %44 %71 - OpBranch %60 - %60 = OpLabel - %72 = OpLoad %24 %56 - %74 = OpIAdd %24 %72 %73 - OpStore %56 %74 - OpBranch %57 - %59 = OpLabel - OpBranch %50 - %50 = OpLabel - %75 = OpLoad %24 %46 - %76 = OpIAdd %24 %75 %73 - OpStore %46 %76 - OpBranch %47 - %49 = OpLabel - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - %83 = OpLoad %24 %44 - %85 = OpAccessChain %84 %82 %53 - OpStore %85 %83 - OpReturn - OpFunctionEnd - %8 = OpFunction %2 None %3 - %9 = OpLabel - %101 = OpVariable %43 Function - %92 = OpAccessChain %91 %90 %73 - %93 = OpLoad %87 %92 - %95 = OpAccessChain %94 %82 %45 - %96 = OpLoad %77 %95 - %97 = OpConvertUToF %86 %96 - %98 = OpMatrixTimesVector %86 %93 %97 - %99 = OpConvertFToU %77 %98 - %100 = OpAccessChain %94 %82 %45 - OpStore %100 %99 - OpStore %101 %45 - OpBranch %102 - %102 = OpLabel - OpLoopMerge %104 %105 None - OpBranch %106 - %106 = OpLabel - %107 = OpLoad %24 %101 - %109 = OpSLessThan %54 %107 %108 - OpBranchConditional %109 %103 %104 - %103 = OpLabel - %111 = OpAccessChain %110 %82 %73 - %112 = OpLoad %79 %111 - %114 = OpAccessChain %113 %90 %53 - %115 = OpLoad %78 %114 - %116 = OpVectorTimesScalar %79 %112 %115 - %117 = OpConvertFToU %13 %116 - %118 = OpCompositeExtract %10 %117 0 - %119 = OpCompositeExtract %10 %117 1 - %120 = OpCompositeExtract %10 %117 2 - %121 = OpCompositeConstruct %77 %118 %119 %120 %16 - %122 = OpAccessChain %94 %82 %45 - %123 = OpLoad %77 %122 - %124 = OpIAdd %77 %123 %121 - %125 = OpAccessChain %94 %82 %45 - OpStore %125 %124 - OpBranch %105 - %105 = OpLabel - %126 = OpLoad %24 %101 - %127 = OpIAdd %24 %126 %73 - OpStore %101 %127 - OpBranch %102 - %104 = OpLabel - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - %129 = OpLoad %25 %128 - %131 = OpImageRead %38 %129 %130 - %132 = OpCompositeExtract %24 %131 0 - %133 = OpConvertSToF %78 %132 - %134 = OpCompositeConstruct %79 %133 %133 %133 - %135 = OpAccessChain %110 %82 %73 - OpStore %135 %134 - OpReturn - OpFunctionEnd - diff --git a/test/diff/diff_files/large_functions_small_diffs_src.spvasm b/test/diff/diff_files/large_functions_small_diffs_src.spvasm deleted file mode 100644 index 78a92785..00000000 --- a/test/diff/diff_files/large_functions_small_diffs_src.spvasm +++ /dev/null @@ -1,226 +0,0 @@ -;; Test where src and dst have a few large functions with small differences. - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" %15 - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "main" - OpName %6 "f1(" - OpName %8 "f2(" - OpName %12 "x" - OpName %15 "gl_LocalInvocationID" - OpName %20 "y" - OpName %27 "image" - OpName %44 "sum" - OpName %46 "i" - OpName %56 "j" - OpName %80 "BufferOut" - OpMemberName %80 0 "o_uv4" - OpMemberName %80 1 "o_v3" - OpMemberName %80 2 "o_i" - OpName %82 "" - OpName %88 "BufferIn" - OpMemberName %88 0 "i_u" - OpMemberName %88 1 "i_v4" - OpMemberName %88 2 "i_f" - OpName %90 "" - OpName %101 "i" - OpDecorate %15 BuiltIn LocalInvocationId - OpDecorate %27 DescriptorSet 0 - OpDecorate %27 Binding 2 - OpMemberDecorate %80 0 Offset 0 - OpMemberDecorate %80 1 Offset 16 - OpMemberDecorate %80 2 Offset 28 - OpDecorate %80 BufferBlock - OpDecorate %82 DescriptorSet 0 - OpDecorate %82 Binding 1 - OpMemberDecorate %88 0 Offset 0 - OpMemberDecorate %88 1 RowMajor - OpMemberDecorate %88 1 Offset 16 - OpMemberDecorate %88 1 MatrixStride 16 - OpMemberDecorate %88 2 Offset 80 - OpDecorate %88 Block - OpDecorate %90 DescriptorSet 0 - OpDecorate %90 Binding 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %10 = OpTypeInt 32 0 - %11 = OpTypePointer Function %10 - %13 = OpTypeVector %10 3 - %14 = OpTypePointer Input %13 - %15 = OpVariable %14 Input - %16 = OpConstant %10 0 - %17 = OpTypePointer Input %10 - %21 = OpConstant %10 1 - %24 = OpTypeInt 32 1 - %25 = OpTypeImage %24 2D 0 0 0 2 R32i - %26 = OpTypePointer UniformConstant %25 - %27 = OpVariable %26 UniformConstant - %29 = OpTypeVector %10 2 - %32 = OpTypeVector %24 2 - %38 = OpTypeVector %24 4 - %40 = OpConstant %10 2 - %41 = OpConstant %10 3400 - %42 = OpConstant %10 264 - %43 = OpTypePointer Function %24 - %45 = OpConstant %24 0 - %53 = OpConstant %24 2 - %54 = OpTypeBool - %73 = OpConstant %24 1 - %77 = OpTypeVector %10 4 - %78 = OpTypeFloat 32 - %79 = OpTypeVector %78 3 - %80 = OpTypeStruct %77 %79 %24 - %81 = OpTypePointer Uniform %80 - %82 = OpVariable %81 Uniform - %84 = OpTypePointer Uniform %24 - %86 = OpTypeVector %78 4 - %87 = OpTypeMatrix %86 4 - %88 = OpTypeStruct %10 %87 %78 - %89 = OpTypePointer Uniform %88 - %90 = OpVariable %89 Uniform - %91 = OpTypePointer Uniform %87 - %94 = OpTypePointer Uniform %77 - %108 = OpConstant %24 3 - %110 = OpTypePointer Uniform %79 - %113 = OpTypePointer Uniform %78 - %129 = OpConstantComposite %32 %45 %45 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %135 = OpFunctionCall %2 %6 - %136 = OpFunctionCall %2 %8 - OpReturn - OpFunctionEnd - %6 = OpFunction %2 None %3 - %7 = OpLabel - %12 = OpVariable %11 Function - %20 = OpVariable %11 Function - %44 = OpVariable %43 Function - %46 = OpVariable %43 Function - %56 = OpVariable %43 Function - %18 = OpAccessChain %17 %15 %16 - %19 = OpLoad %10 %18 - OpStore %12 %19 - %22 = OpAccessChain %17 %15 %21 - %23 = OpLoad %10 %22 - OpStore %20 %23 - %28 = OpLoad %25 %27 - %30 = OpLoad %13 %15 - %31 = OpVectorShuffle %29 %30 %30 0 1 - %33 = OpBitcast %32 %31 - %34 = OpLoad %10 %12 - %35 = OpLoad %10 %20 - %36 = OpIAdd %10 %34 %35 - %37 = OpBitcast %24 %36 - %39 = OpCompositeConstruct %38 %37 %37 %37 %37 - OpImageWrite %28 %33 %39 - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - OpStore %44 %45 - OpStore %46 %45 - OpBranch %47 - %47 = OpLabel - OpLoopMerge %49 %50 None - OpBranch %51 - %51 = OpLabel - %52 = OpLoad %24 %46 - %55 = OpSLessThan %54 %52 %53 - OpBranchConditional %55 %48 %49 - %48 = OpLabel - OpStore %56 %45 - OpBranch %57 - %57 = OpLabel - OpLoopMerge %59 %60 None - OpBranch %61 - %61 = OpLabel - %62 = OpLoad %24 %56 - %63 = OpSLessThan %54 %62 %53 - OpBranchConditional %63 %58 %59 - %58 = OpLabel - %64 = OpLoad %25 %27 - %65 = OpLoad %24 %46 - %66 = OpLoad %24 %56 - %67 = OpCompositeConstruct %32 %65 %66 - %68 = OpImageRead %38 %64 %67 - %69 = OpCompositeExtract %24 %68 0 - %70 = OpLoad %24 %44 - %71 = OpIAdd %24 %70 %69 - OpStore %44 %71 - OpBranch %60 - %60 = OpLabel - %72 = OpLoad %24 %56 - %74 = OpIAdd %24 %72 %73 - OpStore %56 %74 - OpBranch %57 - %59 = OpLabel - OpBranch %50 - %50 = OpLabel - %75 = OpLoad %24 %46 - %76 = OpIAdd %24 %75 %73 - OpStore %46 %76 - OpBranch %47 - %49 = OpLabel - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - %83 = OpLoad %24 %44 - %85 = OpAccessChain %84 %82 %53 - OpStore %85 %83 - OpReturn - OpFunctionEnd - %8 = OpFunction %2 None %3 - %9 = OpLabel - %101 = OpVariable %43 Function - %92 = OpAccessChain %91 %90 %73 - %93 = OpLoad %87 %92 - %95 = OpAccessChain %94 %82 %45 - %96 = OpLoad %77 %95 - %97 = OpConvertUToF %86 %96 - %98 = OpMatrixTimesVector %86 %93 %97 - %99 = OpConvertFToU %77 %98 - %100 = OpAccessChain %94 %82 %45 - OpStore %100 %99 - OpStore %101 %45 - OpBranch %102 - %102 = OpLabel - OpLoopMerge %104 %105 None - OpBranch %106 - %106 = OpLabel - %107 = OpLoad %24 %101 - %109 = OpSLessThan %54 %107 %108 - OpBranchConditional %109 %103 %104 - %103 = OpLabel - %111 = OpAccessChain %110 %82 %73 - %112 = OpLoad %79 %111 - %114 = OpAccessChain %113 %90 %53 - %115 = OpLoad %78 %114 - %116 = OpVectorTimesScalar %79 %112 %115 - %117 = OpConvertFToU %13 %116 - %118 = OpCompositeExtract %10 %117 0 - %119 = OpCompositeExtract %10 %117 1 - %120 = OpCompositeExtract %10 %117 2 - %121 = OpCompositeConstruct %77 %118 %119 %120 %16 - %122 = OpAccessChain %94 %82 %45 - %123 = OpLoad %77 %122 - %124 = OpIAdd %77 %123 %121 - %125 = OpAccessChain %94 %82 %45 - OpStore %125 %124 - OpBranch %105 - %105 = OpLabel - %126 = OpLoad %24 %101 - %127 = OpIAdd %24 %126 %73 - OpStore %101 %127 - OpBranch %102 - %104 = OpLabel - OpMemoryBarrier %40 %41 - OpControlBarrier %40 %40 %42 - %128 = OpLoad %25 %27 - %130 = OpImageRead %38 %128 %129 - %131 = OpCompositeExtract %24 %130 0 - %132 = OpConvertSToF %78 %131 - %133 = OpCompositeConstruct %79 %132 %132 %132 - %134 = OpAccessChain %110 %82 %73 - OpStore %134 %133 - OpReturn - OpFunctionEnd - diff --git a/test/diff/diff_files/multiple_different_entry_points_autogen.cpp b/test/diff/diff_files/multiple_different_entry_points_autogen.cpp deleted file mode 100644 index 29d4b1d8..00000000 --- a/test/diff/diff_files/multiple_different_entry_points_autogen.cpp +++ /dev/null @@ -1,330 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_tests.py -// -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -// Basic test for multiple entry points. The entry points have different -// execution models and so can be trivially matched. -constexpr char kSrc[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %mainv "mainv" %vo %a - OpEntryPoint Fragment %mainf "mainf" %color %vi - OpExecutionMode %mainf OriginUpperLeft - OpSource ESSL 310 - OpName %mainv "mainv" - OpName %mainf "mainf" - OpName %a "a" - OpName %vo "v" - OpName %vi "v" - OpName %color "color" - OpDecorate %a Location 0 - OpDecorate %vo Location 0 - OpDecorate %vi Location 0 - OpDecorate %color Location 0 - OpDecorate %color RelaxedPrecision - OpDecorate %vi RelaxedPrecision - OpDecorate %12 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - - %void = OpTypeVoid - %3 = OpTypeFunction %void - %float = OpTypeFloat 32 - %v4float = OpTypeVector %float 4 - -%_ptr_Input_float = OpTypePointer Input %float - %a = OpVariable %_ptr_Input_float Input -%_ptr_Output_float = OpTypePointer Output %float - %vo = OpVariable %_ptr_Output_float Output - %vi = OpVariable %_ptr_Input_float Input -%_ptr_Output_v4float = OpTypePointer Output %v4float - %color = OpVariable %_ptr_Output_v4float Output - - %mainv = OpFunction %void None %3 - %5 = OpLabel - %11 = OpLoad %float %a - OpStore %vo %11 - OpReturn - OpFunctionEnd - - %mainf = OpFunction %void None %3 - %6 = OpLabel - %12 = OpLoad %float %vi - %13 = OpCompositeConstruct %v4float %12 %12 %12 %12 - OpStore %color %13 - OpReturn - OpFunctionEnd)"; -constexpr char kDst[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %frag "frag" %vi %color - OpEntryPoint Vertex %vert "vert" %a %vo - OpExecutionMode %frag OriginUpperLeft - OpSource ESSL 310 - OpName %frag "frag" - OpName %vert "vert" - OpName %vo "v" - OpName %a "a" - OpName %color "color" - OpName %vi "v" - OpDecorate %vi Location 0 - OpDecorate %color Location 0 - OpDecorate %a Location 0 - OpDecorate %vo Location 0 - OpDecorate %color RelaxedPrecision - OpDecorate %vi RelaxedPrecision - OpDecorate %14 RelaxedPrecision - OpDecorate %17 RelaxedPrecision - - %float = OpTypeFloat 32 - %v4float = OpTypeVector %float 4 - %void = OpTypeVoid - %3 = OpTypeFunction %void - -%_ptr_Output_float = OpTypePointer Output %float - %vo = OpVariable %_ptr_Output_float Output -%_ptr_Input_float = OpTypePointer Input %float - %a = OpVariable %_ptr_Input_float Input - %vi = OpVariable %_ptr_Input_float Input -%_ptr_Output_v4float = OpTypePointer Output %v4float - %color = OpVariable %_ptr_Output_v4float Output - - %frag = OpFunction %void None %3 - %7 = OpLabel - %14 = OpLoad %float %vi - %17 = OpCompositeConstruct %v4float %14 %14 %14 %14 - OpStore %color %17 - OpReturn - OpFunctionEnd - - %vert = OpFunction %void None %3 - %8 = OpLabel - %13 = OpLoad %float %a - OpStore %vo %13 - OpReturn - OpFunctionEnd -)"; - -TEST(DiffTest, MultipleDifferentEntryPoints) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 - ; Bound: 20 - ; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 --OpEntryPoint Vertex %2 "mainv" %4 %7 -+OpEntryPoint Vertex %2 "vert" %7 %4 --OpEntryPoint Fragment %8 "mainf" %9 %10 -+OpEntryPoint Fragment %8 "frag" %10 %9 - OpExecutionMode %8 OriginUpperLeft - OpSource ESSL 310 --OpName %2 "mainv" -+OpName %2 "vert" --OpName %8 "mainf" -+OpName %8 "frag" - OpName %7 "a" - OpName %4 "v" - OpName %10 "v" - OpName %9 "color" - OpDecorate %7 Location 0 - OpDecorate %4 Location 0 - OpDecorate %10 Location 0 - OpDecorate %9 Location 0 - OpDecorate %9 RelaxedPrecision - OpDecorate %10 RelaxedPrecision - OpDecorate %12 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - %14 = OpTypeVoid - %3 = OpTypeFunction %14 - %15 = OpTypeFloat 32 - %16 = OpTypeVector %15 4 - %17 = OpTypePointer Input %15 - %7 = OpVariable %17 Input - %18 = OpTypePointer Output %15 - %4 = OpVariable %18 Output - %10 = OpVariable %17 Input - %19 = OpTypePointer Output %16 - %9 = OpVariable %19 Output - %2 = OpFunction %14 None %3 - %5 = OpLabel - %11 = OpLoad %15 %7 - OpStore %4 %11 - OpReturn - OpFunctionEnd - %8 = OpFunction %14 None %3 - %6 = OpLabel - %12 = OpLoad %15 %10 - %13 = OpCompositeConstruct %16 %12 %12 %12 %12 - OpStore %9 %13 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, MultipleDifferentEntryPointsNoDebug) { - constexpr char kSrcNoDebug[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %mainv "mainv" %vo %a - OpEntryPoint Fragment %mainf "mainf" %color %vi - OpExecutionMode %mainf OriginUpperLeft - OpSource ESSL 310 - OpDecorate %a Location 0 - OpDecorate %vo Location 0 - OpDecorate %vi Location 0 - OpDecorate %color Location 0 - OpDecorate %color RelaxedPrecision - OpDecorate %vi RelaxedPrecision - OpDecorate %12 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - - %void = OpTypeVoid - %3 = OpTypeFunction %void - %float = OpTypeFloat 32 - %v4float = OpTypeVector %float 4 - -%_ptr_Input_float = OpTypePointer Input %float - %a = OpVariable %_ptr_Input_float Input -%_ptr_Output_float = OpTypePointer Output %float - %vo = OpVariable %_ptr_Output_float Output - %vi = OpVariable %_ptr_Input_float Input -%_ptr_Output_v4float = OpTypePointer Output %v4float - %color = OpVariable %_ptr_Output_v4float Output - - %mainv = OpFunction %void None %3 - %5 = OpLabel - %11 = OpLoad %float %a - OpStore %vo %11 - OpReturn - OpFunctionEnd - - %mainf = OpFunction %void None %3 - %6 = OpLabel - %12 = OpLoad %float %vi - %13 = OpCompositeConstruct %v4float %12 %12 %12 %12 - OpStore %color %13 - OpReturn - OpFunctionEnd -)"; - constexpr char kDstNoDebug[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %frag "frag" %vi %color - OpEntryPoint Vertex %vert "vert" %a %vo - OpExecutionMode %frag OriginUpperLeft - OpSource ESSL 310 - OpDecorate %vi Location 0 - OpDecorate %color Location 0 - OpDecorate %a Location 0 - OpDecorate %vo Location 0 - OpDecorate %color RelaxedPrecision - OpDecorate %vi RelaxedPrecision - OpDecorate %14 RelaxedPrecision - OpDecorate %17 RelaxedPrecision - - %float = OpTypeFloat 32 - %v4float = OpTypeVector %float 4 - %void = OpTypeVoid - %3 = OpTypeFunction %void - -%_ptr_Output_float = OpTypePointer Output %float - %vo = OpVariable %_ptr_Output_float Output -%_ptr_Input_float = OpTypePointer Input %float - %a = OpVariable %_ptr_Input_float Input - %vi = OpVariable %_ptr_Input_float Input -%_ptr_Output_v4float = OpTypePointer Output %v4float - %color = OpVariable %_ptr_Output_v4float Output - - %frag = OpFunction %void None %3 - %7 = OpLabel - %14 = OpLoad %float %vi - %17 = OpCompositeConstruct %v4float %14 %14 %14 %14 - OpStore %color %17 - OpReturn - OpFunctionEnd - - %vert = OpFunction %void None %3 - %8 = OpLabel - %13 = OpLoad %float %a - OpStore %vo %13 - OpReturn - OpFunctionEnd -)"; - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 - ; Bound: 20 - ; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 --OpEntryPoint Vertex %2 "mainv" %4 %7 -+OpEntryPoint Vertex %2 "vert" %7 %4 --OpEntryPoint Fragment %8 "mainf" %9 %10 -+OpEntryPoint Fragment %8 "frag" %10 %9 - OpExecutionMode %8 OriginUpperLeft - OpSource ESSL 310 - OpDecorate %7 Location 0 - OpDecorate %4 Location 0 - OpDecorate %10 Location 0 - OpDecorate %9 Location 0 - OpDecorate %9 RelaxedPrecision - OpDecorate %10 RelaxedPrecision - OpDecorate %12 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - %14 = OpTypeVoid - %3 = OpTypeFunction %14 - %15 = OpTypeFloat 32 - %16 = OpTypeVector %15 4 - %17 = OpTypePointer Input %15 - %7 = OpVariable %17 Input - %18 = OpTypePointer Output %15 - %4 = OpVariable %18 Output - %10 = OpVariable %17 Input - %19 = OpTypePointer Output %16 - %9 = OpVariable %19 Output - %2 = OpFunction %14 None %3 - %5 = OpLabel - %11 = OpLoad %15 %7 - OpStore %4 %11 - OpReturn - OpFunctionEnd - %8 = OpFunction %14 None %3 - %6 = OpLabel - %12 = OpLoad %15 %10 - %13 = OpCompositeConstruct %16 %12 %12 %12 %12 - OpStore %9 %13 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_files/multiple_different_entry_points_dst.spvasm b/test/diff/diff_files/multiple_different_entry_points_dst.spvasm deleted file mode 100644 index 72cfe283..00000000 --- a/test/diff/diff_files/multiple_different_entry_points_dst.spvasm +++ /dev/null @@ -1,49 +0,0 @@ - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %frag "frag" %vi %color - OpEntryPoint Vertex %vert "vert" %a %vo - OpExecutionMode %frag OriginUpperLeft - OpSource ESSL 310 - OpName %frag "frag" - OpName %vert "vert" - OpName %vo "v" - OpName %a "a" - OpName %color "color" - OpName %vi "v" - OpDecorate %vi Location 0 - OpDecorate %color Location 0 - OpDecorate %a Location 0 - OpDecorate %vo Location 0 - OpDecorate %color RelaxedPrecision - OpDecorate %vi RelaxedPrecision - OpDecorate %14 RelaxedPrecision - OpDecorate %17 RelaxedPrecision - - %float = OpTypeFloat 32 - %v4float = OpTypeVector %float 4 - %void = OpTypeVoid - %3 = OpTypeFunction %void - -%_ptr_Output_float = OpTypePointer Output %float - %vo = OpVariable %_ptr_Output_float Output -%_ptr_Input_float = OpTypePointer Input %float - %a = OpVariable %_ptr_Input_float Input - %vi = OpVariable %_ptr_Input_float Input -%_ptr_Output_v4float = OpTypePointer Output %v4float - %color = OpVariable %_ptr_Output_v4float Output - - %frag = OpFunction %void None %3 - %7 = OpLabel - %14 = OpLoad %float %vi - %17 = OpCompositeConstruct %v4float %14 %14 %14 %14 - OpStore %color %17 - OpReturn - OpFunctionEnd - - %vert = OpFunction %void None %3 - %8 = OpLabel - %13 = OpLoad %float %a - OpStore %vo %13 - OpReturn - OpFunctionEnd diff --git a/test/diff/diff_files/multiple_different_entry_points_src.spvasm b/test/diff/diff_files/multiple_different_entry_points_src.spvasm deleted file mode 100644 index 2119aa73..00000000 --- a/test/diff/diff_files/multiple_different_entry_points_src.spvasm +++ /dev/null @@ -1,51 +0,0 @@ -;; Basic test for multiple entry points. The entry points have different -;; execution models and so can be trivially matched. - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %mainv "mainv" %vo %a - OpEntryPoint Fragment %mainf "mainf" %color %vi - OpExecutionMode %mainf OriginUpperLeft - OpSource ESSL 310 - OpName %mainv "mainv" - OpName %mainf "mainf" - OpName %a "a" - OpName %vo "v" - OpName %vi "v" - OpName %color "color" - OpDecorate %a Location 0 - OpDecorate %vo Location 0 - OpDecorate %vi Location 0 - OpDecorate %color Location 0 - OpDecorate %color RelaxedPrecision - OpDecorate %vi RelaxedPrecision - OpDecorate %12 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - - %void = OpTypeVoid - %3 = OpTypeFunction %void - %float = OpTypeFloat 32 - %v4float = OpTypeVector %float 4 - -%_ptr_Input_float = OpTypePointer Input %float - %a = OpVariable %_ptr_Input_float Input -%_ptr_Output_float = OpTypePointer Output %float - %vo = OpVariable %_ptr_Output_float Output - %vi = OpVariable %_ptr_Input_float Input -%_ptr_Output_v4float = OpTypePointer Output %v4float - %color = OpVariable %_ptr_Output_v4float Output - - %mainv = OpFunction %void None %3 - %5 = OpLabel - %11 = OpLoad %float %a - OpStore %vo %11 - OpReturn - OpFunctionEnd - - %mainf = OpFunction %void None %3 - %6 = OpLabel - %12 = OpLoad %float %vi - %13 = OpCompositeConstruct %v4float %12 %12 %12 %12 - OpStore %color %13 - OpReturn - OpFunctionEnd diff --git a/test/diff/diff_files/multiple_same_entry_points_autogen.cpp b/test/diff/diff_files/multiple_same_entry_points_autogen.cpp deleted file mode 100644 index 9d011661..00000000 --- a/test/diff/diff_files/multiple_same_entry_points_autogen.cpp +++ /dev/null @@ -1,375 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_tests.py -// -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -// Test for multiple entry points with the same execution model. -constexpr char kSrc[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %4 "main1" %8 %10 - OpEntryPoint Vertex %12 "main2" %13 %14 %15 - OpSource ESSL 310 - OpName %4 "main1" - OpName %12 "main2" - OpName %8 "v" - OpName %10 "a" - OpName %13 "v" - OpName %14 "a" - OpName %15 "b" - OpDecorate %8 Location 0 - OpDecorate %10 Location 0 - OpDecorate %13 Location 0 - OpDecorate %14 Location 0 - OpDecorate %15 Location 1 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - - %7 = OpTypePointer Output %6 - %9 = OpTypePointer Input %6 - %8 = OpVariable %7 Output - %10 = OpVariable %9 Input - %13 = OpVariable %7 Output - %14 = OpVariable %9 Input - %15 = OpVariable %9 Input - - %4 = OpFunction %2 None %3 - %5 = OpLabel - %11 = OpLoad %6 %10 - OpStore %8 %11 - OpReturn - OpFunctionEnd - - %12 = OpFunction %2 None %3 - %16 = OpLabel - %17 = OpLoad %6 %14 - %18 = OpLoad %6 %15 - %19 = OpFAdd %6 %17 %18 - OpStore %13 %19 - OpReturn - OpFunctionEnd)"; -constexpr char kDst[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %4 "main2" %13 %14 %15 - OpEntryPoint Vertex %12 "main1" %8 %10 - OpSource ESSL 310 - OpName %12 "main1" - OpName %4 "main2" - OpName %8 "v" - OpName %10 "a" - OpName %13 "v" - OpName %14 "a" - OpName %15 "b" - OpDecorate %8 Location 0 - OpDecorate %10 Location 0 - OpDecorate %13 Location 0 - OpDecorate %14 Location 0 - OpDecorate %15 Location 1 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - - %7 = OpTypePointer Output %6 - %9 = OpTypePointer Input %6 - %8 = OpVariable %7 Output - %10 = OpVariable %9 Input - %13 = OpVariable %7 Output - %14 = OpVariable %9 Input - %15 = OpVariable %9 Input - - %4 = OpFunction %2 None %3 - %16 = OpLabel - %17 = OpLoad %6 %14 - %18 = OpLoad %6 %15 - %19 = OpFAdd %6 %17 %18 - OpStore %13 %19 - OpReturn - OpFunctionEnd - - %12 = OpFunction %2 None %3 - %5 = OpLabel - %11 = OpLoad %6 %10 - OpStore %8 %11 - OpReturn - OpFunctionEnd -)"; - -TEST(DiffTest, MultipleSameEntryPoints) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 - ; Bound: 20 - ; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 -+OpEntryPoint Vertex %12 "main2" %13 %14 %15 - OpEntryPoint Vertex %4 "main1" %8 %10 --OpEntryPoint Vertex %12 "main2" %13 %14 %15 - OpSource ESSL 310 - OpName %4 "main1" - OpName %12 "main2" - OpName %8 "v" - OpName %10 "a" - OpName %13 "v" - OpName %14 "a" - OpName %15 "b" - OpDecorate %8 Location 0 - OpDecorate %10 Location 0 - OpDecorate %13 Location 0 - OpDecorate %14 Location 0 - OpDecorate %15 Location 1 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypePointer Output %6 - %9 = OpTypePointer Input %6 - %8 = OpVariable %7 Output - %10 = OpVariable %9 Input - %13 = OpVariable %7 Output - %14 = OpVariable %9 Input - %15 = OpVariable %9 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %11 = OpLoad %6 %10 - OpStore %8 %11 - OpReturn - OpFunctionEnd - %12 = OpFunction %2 None %3 - %16 = OpLabel - %17 = OpLoad %6 %14 - %18 = OpLoad %6 %15 - %19 = OpFAdd %6 %17 %18 - OpStore %13 %19 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, MultipleSameEntryPointsNoDebug) { - constexpr char kSrcNoDebug[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %4 "main1" %8 %10 - OpEntryPoint Vertex %12 "main2" %13 %14 %15 - OpSource ESSL 310 - OpDecorate %8 Location 0 - OpDecorate %10 Location 0 - OpDecorate %13 Location 0 - OpDecorate %14 Location 0 - OpDecorate %15 Location 1 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - - %7 = OpTypePointer Output %6 - %9 = OpTypePointer Input %6 - %8 = OpVariable %7 Output - %10 = OpVariable %9 Input - %13 = OpVariable %7 Output - %14 = OpVariable %9 Input - %15 = OpVariable %9 Input - - %4 = OpFunction %2 None %3 - %5 = OpLabel - %11 = OpLoad %6 %10 - OpStore %8 %11 - OpReturn - OpFunctionEnd - - %12 = OpFunction %2 None %3 - %16 = OpLabel - %17 = OpLoad %6 %14 - %18 = OpLoad %6 %15 - %19 = OpFAdd %6 %17 %18 - OpStore %13 %19 - OpReturn - OpFunctionEnd -)"; - constexpr char kDstNoDebug[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %4 "main2" %13 %14 %15 - OpEntryPoint Vertex %12 "main1" %8 %10 - OpSource ESSL 310 - OpDecorate %8 Location 0 - OpDecorate %10 Location 0 - OpDecorate %13 Location 0 - OpDecorate %14 Location 0 - OpDecorate %15 Location 1 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - - %7 = OpTypePointer Output %6 - %9 = OpTypePointer Input %6 - %8 = OpVariable %7 Output - %10 = OpVariable %9 Input - %13 = OpVariable %7 Output - %14 = OpVariable %9 Input - %15 = OpVariable %9 Input - - %4 = OpFunction %2 None %3 - %16 = OpLabel - %17 = OpLoad %6 %14 - %18 = OpLoad %6 %15 - %19 = OpFAdd %6 %17 %18 - OpStore %13 %19 - OpReturn - OpFunctionEnd - - %12 = OpFunction %2 None %3 - %5 = OpLabel - %11 = OpLoad %6 %10 - OpStore %8 %11 - OpReturn - OpFunctionEnd -)"; - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 - ; Bound: 20 - ; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 -+OpEntryPoint Vertex %12 "main2" %13 %14 %15 - OpEntryPoint Vertex %4 "main1" %8 %10 --OpEntryPoint Vertex %12 "main2" %13 %14 %15 - OpSource ESSL 310 - OpDecorate %8 Location 0 - OpDecorate %10 Location 0 - OpDecorate %13 Location 0 - OpDecorate %14 Location 0 - OpDecorate %15 Location 1 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypePointer Output %6 - %9 = OpTypePointer Input %6 - %8 = OpVariable %7 Output - %10 = OpVariable %9 Input - %13 = OpVariable %7 Output - %14 = OpVariable %9 Input - %15 = OpVariable %9 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %11 = OpLoad %6 %10 - OpStore %8 %11 - OpReturn - OpFunctionEnd - %12 = OpFunction %2 None %3 - %16 = OpLabel - %17 = OpLoad %6 %14 - %18 = OpLoad %6 %15 - %19 = OpFAdd %6 %17 %18 - OpStore %13 %19 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -} - -TEST(DiffTest, MultipleSameEntryPointsDumpIds) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 - ; Bound: 20 - ; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 -+OpEntryPoint Vertex %12 "main2" %13 %14 %15 - OpEntryPoint Vertex %4 "main1" %8 %10 --OpEntryPoint Vertex %12 "main2" %13 %14 %15 - OpSource ESSL 310 - OpName %4 "main1" - OpName %12 "main2" - OpName %8 "v" - OpName %10 "a" - OpName %13 "v" - OpName %14 "a" - OpName %15 "b" - OpDecorate %8 Location 0 - OpDecorate %10 Location 0 - OpDecorate %13 Location 0 - OpDecorate %14 Location 0 - OpDecorate %15 Location 1 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypePointer Output %6 - %9 = OpTypePointer Input %6 - %8 = OpVariable %7 Output - %10 = OpVariable %9 Input - %13 = OpVariable %7 Output - %14 = OpVariable %9 Input - %15 = OpVariable %9 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %11 = OpLoad %6 %10 - OpStore %8 %11 - OpReturn - OpFunctionEnd - %12 = OpFunction %2 None %3 - %16 = OpLabel - %17 = OpLoad %6 %14 - %18 = OpLoad %6 %15 - %19 = OpFAdd %6 %17 %18 - OpStore %13 %19 - OpReturn - OpFunctionEnd - Src -> Dst - 1 -> 1 [ExtInstImport] - 2 -> 2 [TypeVoid] - 3 -> 3 [TypeFunction] - 4 -> 12 [Function] - 5 -> 5 [Label] - 6 -> 6 [TypeFloat] - 7 -> 7 [TypePointer] - 8 -> 8 [Variable] - 9 -> 9 [TypePointer] - 10 -> 10 [Variable] - 11 -> 11 [Load] - 12 -> 4 [Function] - 13 -> 13 [Variable] - 14 -> 14 [Variable] - 15 -> 15 [Variable] - 16 -> 16 [Label] - 17 -> 17 [Load] - 18 -> 18 [Load] - 19 -> 19 [FAdd] -)"; - Options options; - options.dump_id_map = true; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_files/multiple_same_entry_points_dst.spvasm b/test/diff/diff_files/multiple_same_entry_points_dst.spvasm deleted file mode 100644 index e2007220..00000000 --- a/test/diff/diff_files/multiple_same_entry_points_dst.spvasm +++ /dev/null @@ -1,45 +0,0 @@ - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %4 "main2" %13 %14 %15 - OpEntryPoint Vertex %12 "main1" %8 %10 - OpSource ESSL 310 - OpName %12 "main1" - OpName %4 "main2" - OpName %8 "v" - OpName %10 "a" - OpName %13 "v" - OpName %14 "a" - OpName %15 "b" - OpDecorate %8 Location 0 - OpDecorate %10 Location 0 - OpDecorate %13 Location 0 - OpDecorate %14 Location 0 - OpDecorate %15 Location 1 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - - %7 = OpTypePointer Output %6 - %9 = OpTypePointer Input %6 - %8 = OpVariable %7 Output - %10 = OpVariable %9 Input - %13 = OpVariable %7 Output - %14 = OpVariable %9 Input - %15 = OpVariable %9 Input - - %4 = OpFunction %2 None %3 - %16 = OpLabel - %17 = OpLoad %6 %14 - %18 = OpLoad %6 %15 - %19 = OpFAdd %6 %17 %18 - OpStore %13 %19 - OpReturn - OpFunctionEnd - - %12 = OpFunction %2 None %3 - %5 = OpLabel - %11 = OpLoad %6 %10 - OpStore %8 %11 - OpReturn - OpFunctionEnd diff --git a/test/diff/diff_files/multiple_same_entry_points_src.spvasm b/test/diff/diff_files/multiple_same_entry_points_src.spvasm deleted file mode 100644 index 17001b57..00000000 --- a/test/diff/diff_files/multiple_same_entry_points_src.spvasm +++ /dev/null @@ -1,46 +0,0 @@ -;; Test for multiple entry points with the same execution model. - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %4 "main1" %8 %10 - OpEntryPoint Vertex %12 "main2" %13 %14 %15 - OpSource ESSL 310 - OpName %4 "main1" - OpName %12 "main2" - OpName %8 "v" - OpName %10 "a" - OpName %13 "v" - OpName %14 "a" - OpName %15 "b" - OpDecorate %8 Location 0 - OpDecorate %10 Location 0 - OpDecorate %13 Location 0 - OpDecorate %14 Location 0 - OpDecorate %15 Location 1 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - - %7 = OpTypePointer Output %6 - %9 = OpTypePointer Input %6 - %8 = OpVariable %7 Output - %10 = OpVariable %9 Input - %13 = OpVariable %7 Output - %14 = OpVariable %9 Input - %15 = OpVariable %9 Input - - %4 = OpFunction %2 None %3 - %5 = OpLabel - %11 = OpLoad %6 %10 - OpStore %8 %11 - OpReturn - OpFunctionEnd - - %12 = OpFunction %2 None %3 - %16 = OpLabel - %17 = OpLoad %6 %14 - %18 = OpLoad %6 %15 - %19 = OpFAdd %6 %17 %18 - OpStore %13 %19 - OpReturn - OpFunctionEnd diff --git a/test/diff/diff_files/reordered_if_blocks_autogen.cpp b/test/diff/diff_files/reordered_if_blocks_autogen.cpp deleted file mode 100644 index 0788199f..00000000 --- a/test/diff/diff_files/reordered_if_blocks_autogen.cpp +++ /dev/null @@ -1,568 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_tests.py -// -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -// Test where src and dst have the true and false blocks of an if reordered. -constexpr char kSrc[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %8 %44 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %8 "v" - OpName %44 "color" - OpDecorate %8 RelaxedPrecision - OpDecorate %8 Location 0 - OpDecorate %9 RelaxedPrecision - OpDecorate %18 RelaxedPrecision - OpDecorate %19 RelaxedPrecision - OpDecorate %20 RelaxedPrecision - OpDecorate %23 RelaxedPrecision - OpDecorate %24 RelaxedPrecision - OpDecorate %25 RelaxedPrecision - OpDecorate %26 RelaxedPrecision - OpDecorate %27 RelaxedPrecision - OpDecorate %28 RelaxedPrecision - OpDecorate %29 RelaxedPrecision - OpDecorate %30 RelaxedPrecision - OpDecorate %31 RelaxedPrecision - OpDecorate %33 RelaxedPrecision - OpDecorate %34 RelaxedPrecision - OpDecorate %35 RelaxedPrecision - OpDecorate %36 RelaxedPrecision - OpDecorate %37 RelaxedPrecision - OpDecorate %39 RelaxedPrecision - OpDecorate %40 RelaxedPrecision - OpDecorate %41 RelaxedPrecision - OpDecorate %42 RelaxedPrecision - OpDecorate %44 RelaxedPrecision - OpDecorate %44 Location 0 - OpDecorate %45 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypePointer Input %6 - %8 = OpVariable %7 Input - %10 = OpConstant %6 0 - %11 = OpTypeBool - %15 = OpTypeVector %6 4 - %16 = OpTypePointer Function %15 - %21 = OpConstant %6 -0.5 - %22 = OpConstant %6 -0.300000012 - %38 = OpConstant %6 0.5 - %43 = OpTypePointer Output %15 - %44 = OpVariable %43 Output - %4 = OpFunction %2 None %3 - %5 = OpLabel - %9 = OpLoad %6 %8 - %12 = OpFOrdLessThanEqual %11 %9 %10 - OpSelectionMerge %14 None - OpBranchConditional %12 %13 %32 - %13 = OpLabel - %18 = OpLoad %6 %8 - %19 = OpExtInst %6 %1 Log %18 - %20 = OpLoad %6 %8 - %23 = OpExtInst %6 %1 FClamp %20 %21 %22 - %24 = OpFMul %6 %19 %23 - %25 = OpLoad %6 %8 - %26 = OpExtInst %6 %1 Sin %25 - %27 = OpLoad %6 %8 - %28 = OpExtInst %6 %1 Cos %27 - %29 = OpLoad %6 %8 - %30 = OpExtInst %6 %1 Exp %29 - %31 = OpCompositeConstruct %15 %24 %26 %28 %30 - OpBranch %14 - %32 = OpLabel - %33 = OpLoad %6 %8 - %34 = OpExtInst %6 %1 Sqrt %33 - %35 = OpLoad %6 %8 - %36 = OpExtInst %6 %1 FSign %35 - %37 = OpLoad %6 %8 - %39 = OpExtInst %6 %1 FMax %37 %38 - %40 = OpLoad %6 %8 - %41 = OpExtInst %6 %1 Floor %40 - %42 = OpCompositeConstruct %15 %34 %36 %39 %41 - OpBranch %14 - %14 = OpLabel - %45 = OpPhi %15 %31 %13 %42 %32 - OpStore %44 %45 - OpReturn - OpFunctionEnd)"; -constexpr char kDst[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %8 %44 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %8 "v" - OpName %44 "color" - OpDecorate %8 RelaxedPrecision - OpDecorate %8 Location 0 - OpDecorate %9 RelaxedPrecision - OpDecorate %18 RelaxedPrecision - OpDecorate %19 RelaxedPrecision - OpDecorate %20 RelaxedPrecision - OpDecorate %21 RelaxedPrecision - OpDecorate %22 RelaxedPrecision - OpDecorate %24 RelaxedPrecision - OpDecorate %25 RelaxedPrecision - OpDecorate %26 RelaxedPrecision - OpDecorate %27 RelaxedPrecision - OpDecorate %29 RelaxedPrecision - OpDecorate %30 RelaxedPrecision - OpDecorate %31 RelaxedPrecision - OpDecorate %34 RelaxedPrecision - OpDecorate %35 RelaxedPrecision - OpDecorate %36 RelaxedPrecision - OpDecorate %37 RelaxedPrecision - OpDecorate %38 RelaxedPrecision - OpDecorate %39 RelaxedPrecision - OpDecorate %40 RelaxedPrecision - OpDecorate %41 RelaxedPrecision - OpDecorate %42 RelaxedPrecision - OpDecorate %44 RelaxedPrecision - OpDecorate %44 Location 0 - OpDecorate %45 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypePointer Input %6 - %8 = OpVariable %7 Input - %10 = OpConstant %6 0 - %11 = OpTypeBool - %15 = OpTypeVector %6 4 - %16 = OpTypePointer Function %15 - %23 = OpConstant %6 0.5 - %32 = OpConstant %6 -0.5 - %33 = OpConstant %6 -0.300000012 - %43 = OpTypePointer Output %15 - %44 = OpVariable %43 Output - %4 = OpFunction %2 None %3 - %5 = OpLabel - %9 = OpLoad %6 %8 - %12 = OpFOrdLessThanEqual %11 %9 %10 - OpSelectionMerge %14 None - OpBranchConditional %12 %28 %13 - %13 = OpLabel - %18 = OpLoad %6 %8 - %19 = OpExtInst %6 %1 Sqrt %18 - %20 = OpLoad %6 %8 - %21 = OpExtInst %6 %1 FSign %20 - %22 = OpLoad %6 %8 - %24 = OpExtInst %6 %1 FMax %22 %23 - %25 = OpLoad %6 %8 - %26 = OpExtInst %6 %1 Floor %25 - %27 = OpCompositeConstruct %15 %19 %21 %24 %26 - OpBranch %14 - %28 = OpLabel - %29 = OpLoad %6 %8 - %30 = OpExtInst %6 %1 Log %29 - %31 = OpLoad %6 %8 - %34 = OpExtInst %6 %1 FClamp %31 %32 %33 - %35 = OpFMul %6 %30 %34 - %36 = OpLoad %6 %8 - %37 = OpExtInst %6 %1 Sin %36 - %38 = OpLoad %6 %8 - %39 = OpExtInst %6 %1 Cos %38 - %40 = OpLoad %6 %8 - %41 = OpExtInst %6 %1 Exp %40 - %42 = OpCompositeConstruct %15 %35 %37 %39 %41 - OpBranch %14 - %14 = OpLabel - %45 = OpPhi %15 %27 %13 %42 %28 - OpStore %44 %45 - OpReturn - OpFunctionEnd - -)"; - -TEST(DiffTest, ReorderedIfBlocks) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 46 -+; Bound: 47 - ; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %8 %44 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %8 "v" - OpName %44 "color" - OpDecorate %8 RelaxedPrecision - OpDecorate %8 Location 0 - OpDecorate %9 RelaxedPrecision - OpDecorate %18 RelaxedPrecision - OpDecorate %19 RelaxedPrecision - OpDecorate %20 RelaxedPrecision - OpDecorate %23 RelaxedPrecision - OpDecorate %24 RelaxedPrecision - OpDecorate %25 RelaxedPrecision - OpDecorate %26 RelaxedPrecision - OpDecorate %27 RelaxedPrecision - OpDecorate %28 RelaxedPrecision - OpDecorate %29 RelaxedPrecision - OpDecorate %30 RelaxedPrecision - OpDecorate %31 RelaxedPrecision - OpDecorate %33 RelaxedPrecision - OpDecorate %34 RelaxedPrecision - OpDecorate %35 RelaxedPrecision - OpDecorate %36 RelaxedPrecision - OpDecorate %37 RelaxedPrecision - OpDecorate %39 RelaxedPrecision - OpDecorate %40 RelaxedPrecision - OpDecorate %41 RelaxedPrecision - OpDecorate %42 RelaxedPrecision - OpDecorate %44 RelaxedPrecision - OpDecorate %44 Location 0 - OpDecorate %45 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypePointer Input %6 - %8 = OpVariable %7 Input - %10 = OpConstant %6 0 - %11 = OpTypeBool - %15 = OpTypeVector %6 4 - %16 = OpTypePointer Function %15 - %21 = OpConstant %6 -0.5 - %22 = OpConstant %6 -0.300000012 - %38 = OpConstant %6 0.5 - %43 = OpTypePointer Output %15 - %44 = OpVariable %43 Output - %4 = OpFunction %2 None %3 - %5 = OpLabel - %9 = OpLoad %6 %8 - %12 = OpFOrdLessThanEqual %11 %9 %10 - OpSelectionMerge %14 None - OpBranchConditional %12 %13 %32 - %32 = OpLabel - %33 = OpLoad %6 %8 - %34 = OpExtInst %6 %1 Sqrt %33 - %35 = OpLoad %6 %8 - %36 = OpExtInst %6 %1 FSign %35 - %37 = OpLoad %6 %8 - %39 = OpExtInst %6 %1 FMax %37 %38 - %40 = OpLoad %6 %8 - %41 = OpExtInst %6 %1 Floor %40 - %42 = OpCompositeConstruct %15 %34 %36 %39 %41 - OpBranch %14 - %13 = OpLabel - %18 = OpLoad %6 %8 - %19 = OpExtInst %6 %1 Log %18 - %20 = OpLoad %6 %8 - %23 = OpExtInst %6 %1 FClamp %20 %21 %22 - %24 = OpFMul %6 %19 %23 - %25 = OpLoad %6 %8 - %26 = OpExtInst %6 %1 Sin %25 - %27 = OpLoad %6 %8 - %28 = OpExtInst %6 %1 Cos %27 - %29 = OpLoad %6 %8 - %30 = OpExtInst %6 %1 Exp %29 - %31 = OpCompositeConstruct %15 %24 %26 %28 %30 - OpBranch %14 - %14 = OpLabel --%45 = OpPhi %15 %31 %13 %42 %32 -+%45 = OpPhi %15 %42 %32 %31 %13 - OpStore %44 %45 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, ReorderedIfBlocksNoDebug) { - constexpr char kSrcNoDebug[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %8 %44 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpDecorate %8 RelaxedPrecision - OpDecorate %8 Location 0 - OpDecorate %9 RelaxedPrecision - OpDecorate %18 RelaxedPrecision - OpDecorate %19 RelaxedPrecision - OpDecorate %20 RelaxedPrecision - OpDecorate %23 RelaxedPrecision - OpDecorate %24 RelaxedPrecision - OpDecorate %25 RelaxedPrecision - OpDecorate %26 RelaxedPrecision - OpDecorate %27 RelaxedPrecision - OpDecorate %28 RelaxedPrecision - OpDecorate %29 RelaxedPrecision - OpDecorate %30 RelaxedPrecision - OpDecorate %31 RelaxedPrecision - OpDecorate %33 RelaxedPrecision - OpDecorate %34 RelaxedPrecision - OpDecorate %35 RelaxedPrecision - OpDecorate %36 RelaxedPrecision - OpDecorate %37 RelaxedPrecision - OpDecorate %39 RelaxedPrecision - OpDecorate %40 RelaxedPrecision - OpDecorate %41 RelaxedPrecision - OpDecorate %42 RelaxedPrecision - OpDecorate %44 RelaxedPrecision - OpDecorate %44 Location 0 - OpDecorate %45 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypePointer Input %6 - %8 = OpVariable %7 Input - %10 = OpConstant %6 0 - %11 = OpTypeBool - %15 = OpTypeVector %6 4 - %16 = OpTypePointer Function %15 - %21 = OpConstant %6 -0.5 - %22 = OpConstant %6 -0.300000012 - %38 = OpConstant %6 0.5 - %43 = OpTypePointer Output %15 - %44 = OpVariable %43 Output - %4 = OpFunction %2 None %3 - %5 = OpLabel - %9 = OpLoad %6 %8 - %12 = OpFOrdLessThanEqual %11 %9 %10 - OpSelectionMerge %14 None - OpBranchConditional %12 %13 %32 - %13 = OpLabel - %18 = OpLoad %6 %8 - %19 = OpExtInst %6 %1 Log %18 - %20 = OpLoad %6 %8 - %23 = OpExtInst %6 %1 FClamp %20 %21 %22 - %24 = OpFMul %6 %19 %23 - %25 = OpLoad %6 %8 - %26 = OpExtInst %6 %1 Sin %25 - %27 = OpLoad %6 %8 - %28 = OpExtInst %6 %1 Cos %27 - %29 = OpLoad %6 %8 - %30 = OpExtInst %6 %1 Exp %29 - %31 = OpCompositeConstruct %15 %24 %26 %28 %30 - OpBranch %14 - %32 = OpLabel - %33 = OpLoad %6 %8 - %34 = OpExtInst %6 %1 Sqrt %33 - %35 = OpLoad %6 %8 - %36 = OpExtInst %6 %1 FSign %35 - %37 = OpLoad %6 %8 - %39 = OpExtInst %6 %1 FMax %37 %38 - %40 = OpLoad %6 %8 - %41 = OpExtInst %6 %1 Floor %40 - %42 = OpCompositeConstruct %15 %34 %36 %39 %41 - OpBranch %14 - %14 = OpLabel - %45 = OpPhi %15 %31 %13 %42 %32 - OpStore %44 %45 - OpReturn - OpFunctionEnd -)"; - constexpr char kDstNoDebug[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %8 %44 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpDecorate %8 RelaxedPrecision - OpDecorate %8 Location 0 - OpDecorate %9 RelaxedPrecision - OpDecorate %18 RelaxedPrecision - OpDecorate %19 RelaxedPrecision - OpDecorate %20 RelaxedPrecision - OpDecorate %21 RelaxedPrecision - OpDecorate %22 RelaxedPrecision - OpDecorate %24 RelaxedPrecision - OpDecorate %25 RelaxedPrecision - OpDecorate %26 RelaxedPrecision - OpDecorate %27 RelaxedPrecision - OpDecorate %29 RelaxedPrecision - OpDecorate %30 RelaxedPrecision - OpDecorate %31 RelaxedPrecision - OpDecorate %34 RelaxedPrecision - OpDecorate %35 RelaxedPrecision - OpDecorate %36 RelaxedPrecision - OpDecorate %37 RelaxedPrecision - OpDecorate %38 RelaxedPrecision - OpDecorate %39 RelaxedPrecision - OpDecorate %40 RelaxedPrecision - OpDecorate %41 RelaxedPrecision - OpDecorate %42 RelaxedPrecision - OpDecorate %44 RelaxedPrecision - OpDecorate %44 Location 0 - OpDecorate %45 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypePointer Input %6 - %8 = OpVariable %7 Input - %10 = OpConstant %6 0 - %11 = OpTypeBool - %15 = OpTypeVector %6 4 - %16 = OpTypePointer Function %15 - %23 = OpConstant %6 0.5 - %32 = OpConstant %6 -0.5 - %33 = OpConstant %6 -0.300000012 - %43 = OpTypePointer Output %15 - %44 = OpVariable %43 Output - %4 = OpFunction %2 None %3 - %5 = OpLabel - %9 = OpLoad %6 %8 - %12 = OpFOrdLessThanEqual %11 %9 %10 - OpSelectionMerge %14 None - OpBranchConditional %12 %28 %13 - %13 = OpLabel - %18 = OpLoad %6 %8 - %19 = OpExtInst %6 %1 Sqrt %18 - %20 = OpLoad %6 %8 - %21 = OpExtInst %6 %1 FSign %20 - %22 = OpLoad %6 %8 - %24 = OpExtInst %6 %1 FMax %22 %23 - %25 = OpLoad %6 %8 - %26 = OpExtInst %6 %1 Floor %25 - %27 = OpCompositeConstruct %15 %19 %21 %24 %26 - OpBranch %14 - %28 = OpLabel - %29 = OpLoad %6 %8 - %30 = OpExtInst %6 %1 Log %29 - %31 = OpLoad %6 %8 - %34 = OpExtInst %6 %1 FClamp %31 %32 %33 - %35 = OpFMul %6 %30 %34 - %36 = OpLoad %6 %8 - %37 = OpExtInst %6 %1 Sin %36 - %38 = OpLoad %6 %8 - %39 = OpExtInst %6 %1 Cos %38 - %40 = OpLoad %6 %8 - %41 = OpExtInst %6 %1 Exp %40 - %42 = OpCompositeConstruct %15 %35 %37 %39 %41 - OpBranch %14 - %14 = OpLabel - %45 = OpPhi %15 %27 %13 %42 %28 - OpStore %44 %45 - OpReturn - OpFunctionEnd - -)"; - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 46 -+; Bound: 47 - ; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %8 %44 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpDecorate %8 RelaxedPrecision - OpDecorate %8 Location 0 - OpDecorate %9 RelaxedPrecision - OpDecorate %18 RelaxedPrecision - OpDecorate %19 RelaxedPrecision - OpDecorate %20 RelaxedPrecision - OpDecorate %23 RelaxedPrecision - OpDecorate %24 RelaxedPrecision - OpDecorate %25 RelaxedPrecision - OpDecorate %26 RelaxedPrecision - OpDecorate %27 RelaxedPrecision - OpDecorate %28 RelaxedPrecision - OpDecorate %29 RelaxedPrecision - OpDecorate %30 RelaxedPrecision - OpDecorate %31 RelaxedPrecision - OpDecorate %33 RelaxedPrecision - OpDecorate %34 RelaxedPrecision - OpDecorate %35 RelaxedPrecision - OpDecorate %36 RelaxedPrecision - OpDecorate %37 RelaxedPrecision - OpDecorate %39 RelaxedPrecision - OpDecorate %40 RelaxedPrecision - OpDecorate %41 RelaxedPrecision - OpDecorate %42 RelaxedPrecision - OpDecorate %44 RelaxedPrecision - OpDecorate %44 Location 0 - OpDecorate %45 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypePointer Input %6 - %8 = OpVariable %7 Input - %10 = OpConstant %6 0 - %11 = OpTypeBool - %15 = OpTypeVector %6 4 - %16 = OpTypePointer Function %15 - %21 = OpConstant %6 -0.5 - %22 = OpConstant %6 -0.300000012 - %38 = OpConstant %6 0.5 - %43 = OpTypePointer Output %15 - %44 = OpVariable %43 Output - %4 = OpFunction %2 None %3 - %5 = OpLabel - %9 = OpLoad %6 %8 - %12 = OpFOrdLessThanEqual %11 %9 %10 - OpSelectionMerge %14 None - OpBranchConditional %12 %13 %32 - %32 = OpLabel - %33 = OpLoad %6 %8 - %34 = OpExtInst %6 %1 Sqrt %33 - %35 = OpLoad %6 %8 - %36 = OpExtInst %6 %1 FSign %35 - %37 = OpLoad %6 %8 - %39 = OpExtInst %6 %1 FMax %37 %38 - %40 = OpLoad %6 %8 - %41 = OpExtInst %6 %1 Floor %40 - %42 = OpCompositeConstruct %15 %34 %36 %39 %41 - OpBranch %14 - %13 = OpLabel - %18 = OpLoad %6 %8 - %19 = OpExtInst %6 %1 Log %18 - %20 = OpLoad %6 %8 - %23 = OpExtInst %6 %1 FClamp %20 %21 %22 - %24 = OpFMul %6 %19 %23 - %25 = OpLoad %6 %8 - %26 = OpExtInst %6 %1 Sin %25 - %27 = OpLoad %6 %8 - %28 = OpExtInst %6 %1 Cos %27 - %29 = OpLoad %6 %8 - %30 = OpExtInst %6 %1 Exp %29 - %31 = OpCompositeConstruct %15 %24 %26 %28 %30 - OpBranch %14 - %14 = OpLabel --%45 = OpPhi %15 %31 %13 %42 %32 -+%45 = OpPhi %15 %42 %32 %31 %13 - OpStore %44 %45 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_files/reordered_if_blocks_dst.spvasm b/test/diff/diff_files/reordered_if_blocks_dst.spvasm deleted file mode 100644 index cd1d6d52..00000000 --- a/test/diff/diff_files/reordered_if_blocks_dst.spvasm +++ /dev/null @@ -1,87 +0,0 @@ - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %8 %44 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %8 "v" - OpName %44 "color" - OpDecorate %8 RelaxedPrecision - OpDecorate %8 Location 0 - OpDecorate %9 RelaxedPrecision - OpDecorate %18 RelaxedPrecision - OpDecorate %19 RelaxedPrecision - OpDecorate %20 RelaxedPrecision - OpDecorate %21 RelaxedPrecision - OpDecorate %22 RelaxedPrecision - OpDecorate %24 RelaxedPrecision - OpDecorate %25 RelaxedPrecision - OpDecorate %26 RelaxedPrecision - OpDecorate %27 RelaxedPrecision - OpDecorate %29 RelaxedPrecision - OpDecorate %30 RelaxedPrecision - OpDecorate %31 RelaxedPrecision - OpDecorate %34 RelaxedPrecision - OpDecorate %35 RelaxedPrecision - OpDecorate %36 RelaxedPrecision - OpDecorate %37 RelaxedPrecision - OpDecorate %38 RelaxedPrecision - OpDecorate %39 RelaxedPrecision - OpDecorate %40 RelaxedPrecision - OpDecorate %41 RelaxedPrecision - OpDecorate %42 RelaxedPrecision - OpDecorate %44 RelaxedPrecision - OpDecorate %44 Location 0 - OpDecorate %45 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypePointer Input %6 - %8 = OpVariable %7 Input - %10 = OpConstant %6 0 - %11 = OpTypeBool - %15 = OpTypeVector %6 4 - %16 = OpTypePointer Function %15 - %23 = OpConstant %6 0.5 - %32 = OpConstant %6 -0.5 - %33 = OpConstant %6 -0.300000012 - %43 = OpTypePointer Output %15 - %44 = OpVariable %43 Output - %4 = OpFunction %2 None %3 - %5 = OpLabel - %9 = OpLoad %6 %8 - %12 = OpFOrdLessThanEqual %11 %9 %10 - OpSelectionMerge %14 None - OpBranchConditional %12 %28 %13 - %13 = OpLabel - %18 = OpLoad %6 %8 - %19 = OpExtInst %6 %1 Sqrt %18 - %20 = OpLoad %6 %8 - %21 = OpExtInst %6 %1 FSign %20 - %22 = OpLoad %6 %8 - %24 = OpExtInst %6 %1 FMax %22 %23 - %25 = OpLoad %6 %8 - %26 = OpExtInst %6 %1 Floor %25 - %27 = OpCompositeConstruct %15 %19 %21 %24 %26 - OpBranch %14 - %28 = OpLabel - %29 = OpLoad %6 %8 - %30 = OpExtInst %6 %1 Log %29 - %31 = OpLoad %6 %8 - %34 = OpExtInst %6 %1 FClamp %31 %32 %33 - %35 = OpFMul %6 %30 %34 - %36 = OpLoad %6 %8 - %37 = OpExtInst %6 %1 Sin %36 - %38 = OpLoad %6 %8 - %39 = OpExtInst %6 %1 Cos %38 - %40 = OpLoad %6 %8 - %41 = OpExtInst %6 %1 Exp %40 - %42 = OpCompositeConstruct %15 %35 %37 %39 %41 - OpBranch %14 - %14 = OpLabel - %45 = OpPhi %15 %27 %13 %42 %28 - OpStore %44 %45 - OpReturn - OpFunctionEnd - diff --git a/test/diff/diff_files/reordered_if_blocks_src.spvasm b/test/diff/diff_files/reordered_if_blocks_src.spvasm deleted file mode 100644 index 209cb45b..00000000 --- a/test/diff/diff_files/reordered_if_blocks_src.spvasm +++ /dev/null @@ -1,87 +0,0 @@ -;; Test where src and dst have the true and false blocks of an if reordered. - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %8 %44 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %8 "v" - OpName %44 "color" - OpDecorate %8 RelaxedPrecision - OpDecorate %8 Location 0 - OpDecorate %9 RelaxedPrecision - OpDecorate %18 RelaxedPrecision - OpDecorate %19 RelaxedPrecision - OpDecorate %20 RelaxedPrecision - OpDecorate %23 RelaxedPrecision - OpDecorate %24 RelaxedPrecision - OpDecorate %25 RelaxedPrecision - OpDecorate %26 RelaxedPrecision - OpDecorate %27 RelaxedPrecision - OpDecorate %28 RelaxedPrecision - OpDecorate %29 RelaxedPrecision - OpDecorate %30 RelaxedPrecision - OpDecorate %31 RelaxedPrecision - OpDecorate %33 RelaxedPrecision - OpDecorate %34 RelaxedPrecision - OpDecorate %35 RelaxedPrecision - OpDecorate %36 RelaxedPrecision - OpDecorate %37 RelaxedPrecision - OpDecorate %39 RelaxedPrecision - OpDecorate %40 RelaxedPrecision - OpDecorate %41 RelaxedPrecision - OpDecorate %42 RelaxedPrecision - OpDecorate %44 RelaxedPrecision - OpDecorate %44 Location 0 - OpDecorate %45 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypePointer Input %6 - %8 = OpVariable %7 Input - %10 = OpConstant %6 0 - %11 = OpTypeBool - %15 = OpTypeVector %6 4 - %16 = OpTypePointer Function %15 - %21 = OpConstant %6 -0.5 - %22 = OpConstant %6 -0.300000012 - %38 = OpConstant %6 0.5 - %43 = OpTypePointer Output %15 - %44 = OpVariable %43 Output - %4 = OpFunction %2 None %3 - %5 = OpLabel - %9 = OpLoad %6 %8 - %12 = OpFOrdLessThanEqual %11 %9 %10 - OpSelectionMerge %14 None - OpBranchConditional %12 %13 %32 - %13 = OpLabel - %18 = OpLoad %6 %8 - %19 = OpExtInst %6 %1 Log %18 - %20 = OpLoad %6 %8 - %23 = OpExtInst %6 %1 FClamp %20 %21 %22 - %24 = OpFMul %6 %19 %23 - %25 = OpLoad %6 %8 - %26 = OpExtInst %6 %1 Sin %25 - %27 = OpLoad %6 %8 - %28 = OpExtInst %6 %1 Cos %27 - %29 = OpLoad %6 %8 - %30 = OpExtInst %6 %1 Exp %29 - %31 = OpCompositeConstruct %15 %24 %26 %28 %30 - OpBranch %14 - %32 = OpLabel - %33 = OpLoad %6 %8 - %34 = OpExtInst %6 %1 Sqrt %33 - %35 = OpLoad %6 %8 - %36 = OpExtInst %6 %1 FSign %35 - %37 = OpLoad %6 %8 - %39 = OpExtInst %6 %1 FMax %37 %38 - %40 = OpLoad %6 %8 - %41 = OpExtInst %6 %1 Floor %40 - %42 = OpCompositeConstruct %15 %34 %36 %39 %41 - OpBranch %14 - %14 = OpLabel - %45 = OpPhi %15 %31 %13 %42 %32 - OpStore %44 %45 - OpReturn - OpFunctionEnd diff --git a/test/diff/diff_files/reordered_switch_blocks_autogen.cpp b/test/diff/diff_files/reordered_switch_blocks_autogen.cpp deleted file mode 100644 index c0ba48d1..00000000 --- a/test/diff/diff_files/reordered_switch_blocks_autogen.cpp +++ /dev/null @@ -1,582 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_tests.py -// -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -// Test where src and dst have cases of a switch in different order. -constexpr char kSrc[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "main" - OpName %7 "BufferIn" - OpMemberName %7 0 "i" - OpName %9 "" - OpName %23 "BufferOut" - OpMemberName %23 0 "o" - OpName %25 "" - OpMemberDecorate %7 0 Offset 0 - OpDecorate %7 Block - OpDecorate %9 DescriptorSet 0 - OpDecorate %9 Binding 0 - OpMemberDecorate %23 0 Offset 0 - OpDecorate %23 BufferBlock - OpDecorate %25 DescriptorSet 0 - OpDecorate %25 Binding 1 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 0 - %7 = OpTypeStruct %6 - %8 = OpTypePointer Uniform %7 - %9 = OpVariable %8 Uniform - %10 = OpTypeInt 32 1 - %11 = OpConstant %10 0 - %12 = OpTypePointer Uniform %6 - %23 = OpTypeStruct %6 - %24 = OpTypePointer Uniform %23 - %25 = OpVariable %24 Uniform - %28 = OpConstant %10 1 - %34 = OpConstant %6 2 - %52 = OpConstant %6 1 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %13 = OpAccessChain %12 %9 %11 - %14 = OpLoad %6 %13 - OpSelectionMerge %22 None - OpSwitch %14 %21 0 %15 1 %16 2 %17 3 %18 4 %19 5 %20 - %21 = OpLabel - %54 = OpAccessChain %12 %25 %11 - %55 = OpLoad %6 %54 - %56 = OpIAdd %6 %55 %34 - %57 = OpAccessChain %12 %25 %11 - OpStore %57 %56 - OpBranch %22 - %15 = OpLabel - %26 = OpAccessChain %12 %25 %11 - %27 = OpLoad %6 %26 - %29 = OpIAdd %6 %27 %28 - OpStore %26 %29 - OpBranch %22 - %16 = OpLabel - %31 = OpAccessChain %12 %25 %11 - %32 = OpLoad %6 %31 - %33 = OpISub %6 %32 %28 - OpStore %31 %33 - OpBranch %17 - %17 = OpLabel - %35 = OpAccessChain %12 %25 %11 - %36 = OpLoad %6 %35 - %37 = OpIMul %6 %36 %34 - %38 = OpAccessChain %12 %25 %11 - OpStore %38 %37 - OpBranch %22 - %18 = OpLabel - %40 = OpAccessChain %12 %25 %11 - %41 = OpLoad %6 %40 - %42 = OpUDiv %6 %41 %34 - %43 = OpAccessChain %12 %25 %11 - OpStore %43 %42 - OpBranch %22 - %19 = OpLabel - %45 = OpAccessChain %12 %25 %11 - %46 = OpLoad %6 %45 - %47 = OpAccessChain %12 %25 %11 - %48 = OpLoad %6 %47 - %49 = OpIMul %6 %46 %48 - %50 = OpAccessChain %12 %25 %11 - OpStore %50 %49 - OpBranch %22 - %20 = OpLabel - %53 = OpAccessChain %12 %25 %11 - OpStore %53 %52 - OpBranch %21 - %22 = OpLabel - OpReturn - OpFunctionEnd)"; -constexpr char kDst[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "main" - OpName %7 "BufferIn" - OpMemberName %7 0 "i" - OpName %9 "" - OpName %23 "BufferOut" - OpMemberName %23 0 "o" - OpName %25 "" - OpMemberDecorate %7 0 Offset 0 - OpDecorate %7 Block - OpDecorate %9 DescriptorSet 0 - OpDecorate %9 Binding 0 - OpMemberDecorate %23 0 Offset 0 - OpDecorate %23 BufferBlock - OpDecorate %25 DescriptorSet 0 - OpDecorate %25 Binding 1 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 0 - %7 = OpTypeStruct %6 - %8 = OpTypePointer Uniform %7 - %9 = OpVariable %8 Uniform - %10 = OpTypeInt 32 1 - %11 = OpConstant %10 0 - %12 = OpTypePointer Uniform %6 - %23 = OpTypeStruct %6 - %24 = OpTypePointer Uniform %23 - %25 = OpVariable %24 Uniform - %28 = OpConstant %10 1 - %34 = OpConstant %6 2 - %52 = OpConstant %6 1 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %13 = OpAccessChain %12 %9 %11 - %14 = OpLoad %6 %13 - OpSelectionMerge %22 None - OpSwitch %14 %21 0 %15 1 %16 2 %17 3 %18 4 %19 5 %20 - %17 = OpLabel - %35 = OpAccessChain %12 %25 %11 - %36 = OpLoad %6 %35 - %37 = OpIMul %6 %36 %34 - %38 = OpAccessChain %12 %25 %11 - OpStore %38 %37 - OpBranch %22 - %18 = OpLabel - %40 = OpAccessChain %12 %25 %11 - %41 = OpLoad %6 %40 - %42 = OpUDiv %6 %41 %34 - %43 = OpAccessChain %12 %25 %11 - OpStore %43 %42 - OpBranch %22 - %21 = OpLabel - %54 = OpAccessChain %12 %25 %11 - %55 = OpLoad %6 %54 - %56 = OpIAdd %6 %55 %34 - %57 = OpAccessChain %12 %25 %11 - OpStore %57 %56 - OpBranch %22 - %20 = OpLabel - %53 = OpAccessChain %12 %25 %11 - OpStore %53 %52 - OpBranch %21 - %15 = OpLabel - %26 = OpAccessChain %12 %25 %11 - %27 = OpLoad %6 %26 - %29 = OpIAdd %6 %27 %28 - OpStore %26 %29 - OpBranch %22 - %19 = OpLabel - %45 = OpAccessChain %12 %25 %11 - %46 = OpLoad %6 %45 - %47 = OpAccessChain %12 %25 %11 - %48 = OpLoad %6 %47 - %49 = OpIMul %6 %46 %48 - %50 = OpAccessChain %12 %25 %11 - OpStore %50 %49 - OpBranch %22 - %16 = OpLabel - %31 = OpAccessChain %12 %25 %11 - %32 = OpLoad %6 %31 - %33 = OpISub %6 %32 %28 - OpStore %31 %33 - OpBranch %17 - %22 = OpLabel - OpReturn - OpFunctionEnd -)"; - -TEST(DiffTest, ReorderedSwitchBlocks) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 58 -+; Bound: 62 - ; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "main" - OpName %7 "BufferIn" - OpMemberName %7 0 "i" - OpName %9 "" - OpName %23 "BufferOut" - OpMemberName %23 0 "o" - OpName %25 "" - OpMemberDecorate %7 0 Offset 0 - OpDecorate %7 Block - OpDecorate %9 DescriptorSet 0 - OpDecorate %9 Binding 0 - OpMemberDecorate %23 0 Offset 0 - OpDecorate %23 BufferBlock - OpDecorate %25 DescriptorSet 0 - OpDecorate %25 Binding 1 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 0 - %7 = OpTypeStruct %6 - %8 = OpTypePointer Uniform %7 - %9 = OpVariable %8 Uniform - %10 = OpTypeInt 32 1 - %11 = OpConstant %10 0 - %12 = OpTypePointer Uniform %6 - %23 = OpTypeStruct %6 - %24 = OpTypePointer Uniform %23 - %25 = OpVariable %24 Uniform - %28 = OpConstant %10 1 - %34 = OpConstant %6 2 - %52 = OpConstant %6 1 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %13 = OpAccessChain %12 %9 %11 - %14 = OpLoad %6 %13 - OpSelectionMerge %22 None - OpSwitch %14 %21 0 %15 1 %16 2 %17 3 %18 4 %19 5 %20 - %20 = OpLabel - %53 = OpAccessChain %12 %25 %11 - OpStore %53 %52 - OpBranch %21 - %19 = OpLabel - %45 = OpAccessChain %12 %25 %11 - %46 = OpLoad %6 %45 - %47 = OpAccessChain %12 %25 %11 - %48 = OpLoad %6 %47 - %49 = OpIMul %6 %46 %48 - %50 = OpAccessChain %12 %25 %11 - OpStore %50 %49 - OpBranch %22 - %18 = OpLabel - %40 = OpAccessChain %12 %25 %11 - %41 = OpLoad %6 %40 - %42 = OpUDiv %6 %41 %34 - %43 = OpAccessChain %12 %25 %11 - OpStore %43 %42 - OpBranch %22 - %16 = OpLabel - %31 = OpAccessChain %12 %25 %11 - %32 = OpLoad %6 %31 - %33 = OpISub %6 %32 %28 - OpStore %31 %33 - OpBranch %17 - %17 = OpLabel - %35 = OpAccessChain %12 %25 %11 - %36 = OpLoad %6 %35 - %37 = OpIMul %6 %36 %34 - %38 = OpAccessChain %12 %25 %11 - OpStore %38 %37 - OpBranch %22 - %15 = OpLabel - %26 = OpAccessChain %12 %25 %11 - %27 = OpLoad %6 %26 - %29 = OpIAdd %6 %27 %28 - OpStore %26 %29 - OpBranch %22 - %21 = OpLabel - %54 = OpAccessChain %12 %25 %11 - %55 = OpLoad %6 %54 - %56 = OpIAdd %6 %55 %34 - %57 = OpAccessChain %12 %25 %11 - OpStore %57 %56 - OpBranch %22 - %22 = OpLabel - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, ReorderedSwitchBlocksNoDebug) { - constexpr char kSrcNoDebug[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpMemberDecorate %7 0 Offset 0 - OpDecorate %7 Block - OpDecorate %9 DescriptorSet 0 - OpDecorate %9 Binding 0 - OpMemberDecorate %23 0 Offset 0 - OpDecorate %23 BufferBlock - OpDecorate %25 DescriptorSet 0 - OpDecorate %25 Binding 1 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 0 - %7 = OpTypeStruct %6 - %8 = OpTypePointer Uniform %7 - %9 = OpVariable %8 Uniform - %10 = OpTypeInt 32 1 - %11 = OpConstant %10 0 - %12 = OpTypePointer Uniform %6 - %23 = OpTypeStruct %6 - %24 = OpTypePointer Uniform %23 - %25 = OpVariable %24 Uniform - %28 = OpConstant %10 1 - %34 = OpConstant %6 2 - %52 = OpConstant %6 1 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %13 = OpAccessChain %12 %9 %11 - %14 = OpLoad %6 %13 - OpSelectionMerge %22 None - OpSwitch %14 %21 0 %15 1 %16 2 %17 3 %18 4 %19 5 %20 - %21 = OpLabel - %54 = OpAccessChain %12 %25 %11 - %55 = OpLoad %6 %54 - %56 = OpIAdd %6 %55 %34 - %57 = OpAccessChain %12 %25 %11 - OpStore %57 %56 - OpBranch %22 - %15 = OpLabel - %26 = OpAccessChain %12 %25 %11 - %27 = OpLoad %6 %26 - %29 = OpIAdd %6 %27 %28 - OpStore %26 %29 - OpBranch %22 - %16 = OpLabel - %31 = OpAccessChain %12 %25 %11 - %32 = OpLoad %6 %31 - %33 = OpISub %6 %32 %28 - OpStore %31 %33 - OpBranch %17 - %17 = OpLabel - %35 = OpAccessChain %12 %25 %11 - %36 = OpLoad %6 %35 - %37 = OpIMul %6 %36 %34 - %38 = OpAccessChain %12 %25 %11 - OpStore %38 %37 - OpBranch %22 - %18 = OpLabel - %40 = OpAccessChain %12 %25 %11 - %41 = OpLoad %6 %40 - %42 = OpUDiv %6 %41 %34 - %43 = OpAccessChain %12 %25 %11 - OpStore %43 %42 - OpBranch %22 - %19 = OpLabel - %45 = OpAccessChain %12 %25 %11 - %46 = OpLoad %6 %45 - %47 = OpAccessChain %12 %25 %11 - %48 = OpLoad %6 %47 - %49 = OpIMul %6 %46 %48 - %50 = OpAccessChain %12 %25 %11 - OpStore %50 %49 - OpBranch %22 - %20 = OpLabel - %53 = OpAccessChain %12 %25 %11 - OpStore %53 %52 - OpBranch %21 - %22 = OpLabel - OpReturn - OpFunctionEnd -)"; - constexpr char kDstNoDebug[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpMemberDecorate %7 0 Offset 0 - OpDecorate %7 Block - OpDecorate %9 DescriptorSet 0 - OpDecorate %9 Binding 0 - OpMemberDecorate %23 0 Offset 0 - OpDecorate %23 BufferBlock - OpDecorate %25 DescriptorSet 0 - OpDecorate %25 Binding 1 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 0 - %7 = OpTypeStruct %6 - %8 = OpTypePointer Uniform %7 - %9 = OpVariable %8 Uniform - %10 = OpTypeInt 32 1 - %11 = OpConstant %10 0 - %12 = OpTypePointer Uniform %6 - %23 = OpTypeStruct %6 - %24 = OpTypePointer Uniform %23 - %25 = OpVariable %24 Uniform - %28 = OpConstant %10 1 - %34 = OpConstant %6 2 - %52 = OpConstant %6 1 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %13 = OpAccessChain %12 %9 %11 - %14 = OpLoad %6 %13 - OpSelectionMerge %22 None - OpSwitch %14 %21 0 %15 1 %16 2 %17 3 %18 4 %19 5 %20 - %17 = OpLabel - %35 = OpAccessChain %12 %25 %11 - %36 = OpLoad %6 %35 - %37 = OpIMul %6 %36 %34 - %38 = OpAccessChain %12 %25 %11 - OpStore %38 %37 - OpBranch %22 - %18 = OpLabel - %40 = OpAccessChain %12 %25 %11 - %41 = OpLoad %6 %40 - %42 = OpUDiv %6 %41 %34 - %43 = OpAccessChain %12 %25 %11 - OpStore %43 %42 - OpBranch %22 - %21 = OpLabel - %54 = OpAccessChain %12 %25 %11 - %55 = OpLoad %6 %54 - %56 = OpIAdd %6 %55 %34 - %57 = OpAccessChain %12 %25 %11 - OpStore %57 %56 - OpBranch %22 - %20 = OpLabel - %53 = OpAccessChain %12 %25 %11 - OpStore %53 %52 - OpBranch %21 - %15 = OpLabel - %26 = OpAccessChain %12 %25 %11 - %27 = OpLoad %6 %26 - %29 = OpIAdd %6 %27 %28 - OpStore %26 %29 - OpBranch %22 - %19 = OpLabel - %45 = OpAccessChain %12 %25 %11 - %46 = OpLoad %6 %45 - %47 = OpAccessChain %12 %25 %11 - %48 = OpLoad %6 %47 - %49 = OpIMul %6 %46 %48 - %50 = OpAccessChain %12 %25 %11 - OpStore %50 %49 - OpBranch %22 - %16 = OpLabel - %31 = OpAccessChain %12 %25 %11 - %32 = OpLoad %6 %31 - %33 = OpISub %6 %32 %28 - OpStore %31 %33 - OpBranch %17 - %22 = OpLabel - OpReturn - OpFunctionEnd -)"; - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 58 -+; Bound: 62 - ; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpMemberDecorate %7 0 Offset 0 - OpDecorate %7 Block - OpDecorate %9 DescriptorSet 0 - OpDecorate %9 Binding 0 - OpMemberDecorate %23 0 Offset 0 - OpDecorate %23 BufferBlock - OpDecorate %25 DescriptorSet 0 - OpDecorate %25 Binding 1 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 0 - %7 = OpTypeStruct %6 - %8 = OpTypePointer Uniform %7 - %9 = OpVariable %8 Uniform - %10 = OpTypeInt 32 1 - %11 = OpConstant %10 0 - %12 = OpTypePointer Uniform %6 - %23 = OpTypeStruct %6 - %24 = OpTypePointer Uniform %23 - %25 = OpVariable %24 Uniform - %28 = OpConstant %10 1 - %34 = OpConstant %6 2 - %52 = OpConstant %6 1 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %13 = OpAccessChain %12 %9 %11 - %14 = OpLoad %6 %13 - OpSelectionMerge %22 None - OpSwitch %14 %21 0 %15 1 %16 2 %17 3 %18 4 %19 5 %20 - %20 = OpLabel - %53 = OpAccessChain %12 %25 %11 - OpStore %53 %52 - OpBranch %21 - %19 = OpLabel - %45 = OpAccessChain %12 %25 %11 - %46 = OpLoad %6 %45 - %47 = OpAccessChain %12 %25 %11 - %48 = OpLoad %6 %47 - %49 = OpIMul %6 %46 %48 - %50 = OpAccessChain %12 %25 %11 - OpStore %50 %49 - OpBranch %22 - %18 = OpLabel - %40 = OpAccessChain %12 %25 %11 - %41 = OpLoad %6 %40 - %42 = OpUDiv %6 %41 %34 - %43 = OpAccessChain %12 %25 %11 - OpStore %43 %42 - OpBranch %22 - %16 = OpLabel - %31 = OpAccessChain %12 %25 %11 - %32 = OpLoad %6 %31 - %33 = OpISub %6 %32 %28 - OpStore %31 %33 - OpBranch %17 - %17 = OpLabel - %35 = OpAccessChain %12 %25 %11 - %36 = OpLoad %6 %35 - %37 = OpIMul %6 %36 %34 - %38 = OpAccessChain %12 %25 %11 - OpStore %38 %37 - OpBranch %22 - %15 = OpLabel - %26 = OpAccessChain %12 %25 %11 - %27 = OpLoad %6 %26 - %29 = OpIAdd %6 %27 %28 - OpStore %26 %29 - OpBranch %22 - %21 = OpLabel - %54 = OpAccessChain %12 %25 %11 - %55 = OpLoad %6 %54 - %56 = OpIAdd %6 %55 %34 - %57 = OpAccessChain %12 %25 %11 - OpStore %57 %56 - OpBranch %22 - %22 = OpLabel - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_files/reordered_switch_blocks_dst.spvasm b/test/diff/diff_files/reordered_switch_blocks_dst.spvasm deleted file mode 100644 index 8eabb4ef..00000000 --- a/test/diff/diff_files/reordered_switch_blocks_dst.spvasm +++ /dev/null @@ -1,91 +0,0 @@ - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "main" - OpName %7 "BufferIn" - OpMemberName %7 0 "i" - OpName %9 "" - OpName %23 "BufferOut" - OpMemberName %23 0 "o" - OpName %25 "" - OpMemberDecorate %7 0 Offset 0 - OpDecorate %7 Block - OpDecorate %9 DescriptorSet 0 - OpDecorate %9 Binding 0 - OpMemberDecorate %23 0 Offset 0 - OpDecorate %23 BufferBlock - OpDecorate %25 DescriptorSet 0 - OpDecorate %25 Binding 1 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 0 - %7 = OpTypeStruct %6 - %8 = OpTypePointer Uniform %7 - %9 = OpVariable %8 Uniform - %10 = OpTypeInt 32 1 - %11 = OpConstant %10 0 - %12 = OpTypePointer Uniform %6 - %23 = OpTypeStruct %6 - %24 = OpTypePointer Uniform %23 - %25 = OpVariable %24 Uniform - %28 = OpConstant %10 1 - %34 = OpConstant %6 2 - %52 = OpConstant %6 1 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %13 = OpAccessChain %12 %9 %11 - %14 = OpLoad %6 %13 - OpSelectionMerge %22 None - OpSwitch %14 %21 0 %15 1 %16 2 %17 3 %18 4 %19 5 %20 - %17 = OpLabel - %35 = OpAccessChain %12 %25 %11 - %36 = OpLoad %6 %35 - %37 = OpIMul %6 %36 %34 - %38 = OpAccessChain %12 %25 %11 - OpStore %38 %37 - OpBranch %22 - %18 = OpLabel - %40 = OpAccessChain %12 %25 %11 - %41 = OpLoad %6 %40 - %42 = OpUDiv %6 %41 %34 - %43 = OpAccessChain %12 %25 %11 - OpStore %43 %42 - OpBranch %22 - %21 = OpLabel - %54 = OpAccessChain %12 %25 %11 - %55 = OpLoad %6 %54 - %56 = OpIAdd %6 %55 %34 - %57 = OpAccessChain %12 %25 %11 - OpStore %57 %56 - OpBranch %22 - %20 = OpLabel - %53 = OpAccessChain %12 %25 %11 - OpStore %53 %52 - OpBranch %21 - %15 = OpLabel - %26 = OpAccessChain %12 %25 %11 - %27 = OpLoad %6 %26 - %29 = OpIAdd %6 %27 %28 - OpStore %26 %29 - OpBranch %22 - %19 = OpLabel - %45 = OpAccessChain %12 %25 %11 - %46 = OpLoad %6 %45 - %47 = OpAccessChain %12 %25 %11 - %48 = OpLoad %6 %47 - %49 = OpIMul %6 %46 %48 - %50 = OpAccessChain %12 %25 %11 - OpStore %50 %49 - OpBranch %22 - %16 = OpLabel - %31 = OpAccessChain %12 %25 %11 - %32 = OpLoad %6 %31 - %33 = OpISub %6 %32 %28 - OpStore %31 %33 - OpBranch %17 - %22 = OpLabel - OpReturn - OpFunctionEnd diff --git a/test/diff/diff_files/reordered_switch_blocks_src.spvasm b/test/diff/diff_files/reordered_switch_blocks_src.spvasm deleted file mode 100644 index e3772282..00000000 --- a/test/diff/diff_files/reordered_switch_blocks_src.spvasm +++ /dev/null @@ -1,92 +0,0 @@ -;; Test where src and dst have cases of a switch in different order. - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "main" - OpName %7 "BufferIn" - OpMemberName %7 0 "i" - OpName %9 "" - OpName %23 "BufferOut" - OpMemberName %23 0 "o" - OpName %25 "" - OpMemberDecorate %7 0 Offset 0 - OpDecorate %7 Block - OpDecorate %9 DescriptorSet 0 - OpDecorate %9 Binding 0 - OpMemberDecorate %23 0 Offset 0 - OpDecorate %23 BufferBlock - OpDecorate %25 DescriptorSet 0 - OpDecorate %25 Binding 1 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 0 - %7 = OpTypeStruct %6 - %8 = OpTypePointer Uniform %7 - %9 = OpVariable %8 Uniform - %10 = OpTypeInt 32 1 - %11 = OpConstant %10 0 - %12 = OpTypePointer Uniform %6 - %23 = OpTypeStruct %6 - %24 = OpTypePointer Uniform %23 - %25 = OpVariable %24 Uniform - %28 = OpConstant %10 1 - %34 = OpConstant %6 2 - %52 = OpConstant %6 1 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %13 = OpAccessChain %12 %9 %11 - %14 = OpLoad %6 %13 - OpSelectionMerge %22 None - OpSwitch %14 %21 0 %15 1 %16 2 %17 3 %18 4 %19 5 %20 - %21 = OpLabel - %54 = OpAccessChain %12 %25 %11 - %55 = OpLoad %6 %54 - %56 = OpIAdd %6 %55 %34 - %57 = OpAccessChain %12 %25 %11 - OpStore %57 %56 - OpBranch %22 - %15 = OpLabel - %26 = OpAccessChain %12 %25 %11 - %27 = OpLoad %6 %26 - %29 = OpIAdd %6 %27 %28 - OpStore %26 %29 - OpBranch %22 - %16 = OpLabel - %31 = OpAccessChain %12 %25 %11 - %32 = OpLoad %6 %31 - %33 = OpISub %6 %32 %28 - OpStore %31 %33 - OpBranch %17 - %17 = OpLabel - %35 = OpAccessChain %12 %25 %11 - %36 = OpLoad %6 %35 - %37 = OpIMul %6 %36 %34 - %38 = OpAccessChain %12 %25 %11 - OpStore %38 %37 - OpBranch %22 - %18 = OpLabel - %40 = OpAccessChain %12 %25 %11 - %41 = OpLoad %6 %40 - %42 = OpUDiv %6 %41 %34 - %43 = OpAccessChain %12 %25 %11 - OpStore %43 %42 - OpBranch %22 - %19 = OpLabel - %45 = OpAccessChain %12 %25 %11 - %46 = OpLoad %6 %45 - %47 = OpAccessChain %12 %25 %11 - %48 = OpLoad %6 %47 - %49 = OpIMul %6 %46 %48 - %50 = OpAccessChain %12 %25 %11 - OpStore %50 %49 - OpBranch %22 - %20 = OpLabel - %53 = OpAccessChain %12 %25 %11 - OpStore %53 %52 - OpBranch %21 - %22 = OpLabel - OpReturn - OpFunctionEnd diff --git a/test/diff/diff_files/small_functions_small_diffs_autogen.cpp b/test/diff/diff_files/small_functions_small_diffs_autogen.cpp deleted file mode 100644 index c1a91009..00000000 --- a/test/diff/diff_files/small_functions_small_diffs_autogen.cpp +++ /dev/null @@ -1,747 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_tests.py -// -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -// Test where src and dst have many small functions with small differences. -constexpr char kSrc[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "main" - OpName %6 "f1(" - OpName %8 "f2(" - OpName %10 "f3(" - OpName %12 "f4(" - OpName %14 "f5(" - OpName %17 "BufferOut" - OpMemberName %17 0 "o" - OpName %19 "" - OpName %22 "BufferIn" - OpMemberName %22 0 "i" - OpName %24 "" - OpMemberDecorate %17 0 Offset 0 - OpDecorate %17 BufferBlock - OpDecorate %19 DescriptorSet 0 - OpDecorate %19 Binding 1 - OpMemberDecorate %22 0 Offset 0 - OpDecorate %22 Block - OpDecorate %24 DescriptorSet 0 - OpDecorate %24 Binding 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %16 = OpTypeInt 32 0 - %17 = OpTypeStruct %16 - %18 = OpTypePointer Uniform %17 - %19 = OpVariable %18 Uniform - %20 = OpTypeInt 32 1 - %21 = OpConstant %20 0 - %22 = OpTypeStruct %16 - %23 = OpTypePointer Uniform %22 - %24 = OpVariable %23 Uniform - %25 = OpTypePointer Uniform %16 - %31 = OpConstant %20 1 - %36 = OpConstant %16 2 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %45 = OpFunctionCall %2 %6 - %46 = OpFunctionCall %2 %8 - %47 = OpFunctionCall %2 %10 - %48 = OpFunctionCall %2 %12 - %49 = OpFunctionCall %2 %14 - OpReturn - OpFunctionEnd - %6 = OpFunction %2 None %3 - %7 = OpLabel - %26 = OpAccessChain %25 %24 %21 - %27 = OpLoad %16 %26 - %28 = OpAccessChain %25 %19 %21 - OpStore %28 %27 - OpReturn - OpFunctionEnd - %8 = OpFunction %2 None %3 - %9 = OpLabel - %29 = OpAccessChain %25 %19 %21 - %30 = OpLoad %16 %29 - %32 = OpIAdd %16 %30 %31 - OpStore %29 %32 - OpReturn - OpFunctionEnd - %10 = OpFunction %2 None %3 - %11 = OpLabel - %33 = OpAccessChain %25 %19 %21 - %34 = OpLoad %16 %33 - %35 = OpISub %16 %34 %31 - OpStore %33 %35 - OpReturn - OpFunctionEnd - %12 = OpFunction %2 None %3 - %13 = OpLabel - %37 = OpAccessChain %25 %19 %21 - %38 = OpLoad %16 %37 - %39 = OpIMul %16 %38 %36 - %40 = OpAccessChain %25 %19 %21 - OpStore %40 %39 - OpReturn - OpFunctionEnd - %14 = OpFunction %2 None %3 - %15 = OpLabel - %41 = OpAccessChain %25 %19 %21 - %42 = OpLoad %16 %41 - %43 = OpUDiv %16 %42 %36 - %44 = OpAccessChain %25 %19 %21 - OpStore %44 %43 - OpReturn - OpFunctionEnd -)"; -constexpr char kDst[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "main" - OpName %6 "f1(" - OpName %8 "f2(" - OpName %10 "f3(" - OpName %12 "f4(" - OpName %14 "f5(" - OpName %17 "BufferOut" - OpMemberName %17 0 "o" - OpName %19 "" - OpName %22 "BufferIn" - OpMemberName %22 0 "i" - OpName %24 "" - OpMemberDecorate %17 0 Offset 0 - OpDecorate %17 BufferBlock - OpDecorate %19 DescriptorSet 0 - OpDecorate %19 Binding 1 - OpMemberDecorate %22 0 Offset 0 - OpDecorate %22 Block - OpDecorate %24 DescriptorSet 0 - OpDecorate %24 Binding 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %16 = OpTypeInt 32 0 - %17 = OpTypeStruct %16 - %18 = OpTypePointer Uniform %17 - %19 = OpVariable %18 Uniform - %20 = OpTypeInt 32 1 - %21 = OpConstant %20 0 - %22 = OpTypeStruct %16 - %23 = OpTypePointer Uniform %22 - %24 = OpVariable %23 Uniform - %25 = OpTypePointer Uniform %16 - %31 = OpConstant %20 1 - %36 = OpConstant %16 2 - %6 = OpFunction %2 None %3 - %7 = OpLabel - %26 = OpAccessChain %25 %24 %21 - %27 = OpLoad %16 %26 - %28 = OpAccessChain %25 %19 %21 - OpStore %28 %27 - OpReturn - OpFunctionEnd - %14 = OpFunction %2 None %3 - %15 = OpLabel - %41 = OpAccessChain %25 %19 %21 - %42 = OpLoad %16 %41 - %43 = OpIAdd %16 %42 %36 - %44 = OpAccessChain %25 %19 %21 - OpStore %44 %43 - OpReturn - OpFunctionEnd - %8 = OpFunction %2 None %3 - %9 = OpLabel - %29 = OpAccessChain %25 %19 %21 - %30 = OpLoad %16 %29 - %32 = OpISub %16 %30 %31 - OpStore %29 %32 - OpReturn - OpFunctionEnd - %10 = OpFunction %2 None %3 - %11 = OpLabel - %33 = OpAccessChain %25 %19 %21 - %34 = OpLoad %16 %33 - %35 = OpIAdd %16 %34 %31 - OpStore %33 %35 - OpReturn - OpFunctionEnd - %4 = OpFunction %2 None %3 - %5 = OpLabel - %45 = OpFunctionCall %2 %6 - %46 = OpFunctionCall %2 %8 - %47 = OpFunctionCall %2 %10 - %48 = OpFunctionCall %2 %12 - %49 = OpFunctionCall %2 %14 - OpReturn - OpFunctionEnd - %12 = OpFunction %2 None %3 - %13 = OpLabel - %37 = OpAccessChain %25 %19 %21 - %38 = OpLoad %16 %37 - %39 = OpISub %16 %38 %36 - %40 = OpAccessChain %25 %19 %21 - OpStore %40 %39 - OpReturn - OpFunctionEnd - -)"; - -TEST(DiffTest, SmallFunctionsSmallDiffs) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 50 -+; Bound: 54 - ; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "main" - OpName %6 "f1(" - OpName %8 "f2(" - OpName %10 "f3(" - OpName %12 "f4(" - OpName %14 "f5(" - OpName %17 "BufferOut" - OpMemberName %17 0 "o" - OpName %19 "" - OpName %22 "BufferIn" - OpMemberName %22 0 "i" - OpName %24 "" - OpMemberDecorate %17 0 Offset 0 - OpDecorate %17 BufferBlock - OpDecorate %19 DescriptorSet 0 - OpDecorate %19 Binding 1 - OpMemberDecorate %22 0 Offset 0 - OpDecorate %22 Block - OpDecorate %24 DescriptorSet 0 - OpDecorate %24 Binding 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %16 = OpTypeInt 32 0 - %17 = OpTypeStruct %16 - %18 = OpTypePointer Uniform %17 - %19 = OpVariable %18 Uniform - %20 = OpTypeInt 32 1 - %21 = OpConstant %20 0 - %22 = OpTypeStruct %16 - %23 = OpTypePointer Uniform %22 - %24 = OpVariable %23 Uniform - %25 = OpTypePointer Uniform %16 - %31 = OpConstant %20 1 - %36 = OpConstant %16 2 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %45 = OpFunctionCall %2 %6 - %46 = OpFunctionCall %2 %8 - %47 = OpFunctionCall %2 %10 - %48 = OpFunctionCall %2 %12 - %49 = OpFunctionCall %2 %14 - OpReturn - OpFunctionEnd - %6 = OpFunction %2 None %3 - %7 = OpLabel - %26 = OpAccessChain %25 %24 %21 - %27 = OpLoad %16 %26 - %28 = OpAccessChain %25 %19 %21 - OpStore %28 %27 - OpReturn - OpFunctionEnd - %8 = OpFunction %2 None %3 - %9 = OpLabel - %29 = OpAccessChain %25 %19 %21 - %30 = OpLoad %16 %29 --%32 = OpIAdd %16 %30 %31 -+%50 = OpISub %16 %30 %31 --OpStore %29 %32 -+OpStore %29 %50 - OpReturn - OpFunctionEnd - %10 = OpFunction %2 None %3 - %11 = OpLabel - %33 = OpAccessChain %25 %19 %21 - %34 = OpLoad %16 %33 --%35 = OpISub %16 %34 %31 -+%51 = OpIAdd %16 %34 %31 --OpStore %33 %35 -+OpStore %33 %51 - OpReturn - OpFunctionEnd - %12 = OpFunction %2 None %3 - %13 = OpLabel - %37 = OpAccessChain %25 %19 %21 - %38 = OpLoad %16 %37 --%39 = OpIMul %16 %38 %36 -+%52 = OpISub %16 %38 %36 - %40 = OpAccessChain %25 %19 %21 --OpStore %40 %39 -+OpStore %40 %52 - OpReturn - OpFunctionEnd - %14 = OpFunction %2 None %3 - %15 = OpLabel - %41 = OpAccessChain %25 %19 %21 - %42 = OpLoad %16 %41 --%43 = OpUDiv %16 %42 %36 -+%53 = OpIAdd %16 %42 %36 - %44 = OpAccessChain %25 %19 %21 --OpStore %44 %43 -+OpStore %44 %53 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, SmallFunctionsSmallDiffsNoDebug) { - constexpr char kSrcNoDebug[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpMemberDecorate %17 0 Offset 0 - OpDecorate %17 BufferBlock - OpDecorate %19 DescriptorSet 0 - OpDecorate %19 Binding 1 - OpMemberDecorate %22 0 Offset 0 - OpDecorate %22 Block - OpDecorate %24 DescriptorSet 0 - OpDecorate %24 Binding 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %16 = OpTypeInt 32 0 - %17 = OpTypeStruct %16 - %18 = OpTypePointer Uniform %17 - %19 = OpVariable %18 Uniform - %20 = OpTypeInt 32 1 - %21 = OpConstant %20 0 - %22 = OpTypeStruct %16 - %23 = OpTypePointer Uniform %22 - %24 = OpVariable %23 Uniform - %25 = OpTypePointer Uniform %16 - %31 = OpConstant %20 1 - %36 = OpConstant %16 2 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %45 = OpFunctionCall %2 %6 - %46 = OpFunctionCall %2 %8 - %47 = OpFunctionCall %2 %10 - %48 = OpFunctionCall %2 %12 - %49 = OpFunctionCall %2 %14 - OpReturn - OpFunctionEnd - %6 = OpFunction %2 None %3 - %7 = OpLabel - %26 = OpAccessChain %25 %24 %21 - %27 = OpLoad %16 %26 - %28 = OpAccessChain %25 %19 %21 - OpStore %28 %27 - OpReturn - OpFunctionEnd - %8 = OpFunction %2 None %3 - %9 = OpLabel - %29 = OpAccessChain %25 %19 %21 - %30 = OpLoad %16 %29 - %32 = OpIAdd %16 %30 %31 - OpStore %29 %32 - OpReturn - OpFunctionEnd - %10 = OpFunction %2 None %3 - %11 = OpLabel - %33 = OpAccessChain %25 %19 %21 - %34 = OpLoad %16 %33 - %35 = OpISub %16 %34 %31 - OpStore %33 %35 - OpReturn - OpFunctionEnd - %12 = OpFunction %2 None %3 - %13 = OpLabel - %37 = OpAccessChain %25 %19 %21 - %38 = OpLoad %16 %37 - %39 = OpIMul %16 %38 %36 - %40 = OpAccessChain %25 %19 %21 - OpStore %40 %39 - OpReturn - OpFunctionEnd - %14 = OpFunction %2 None %3 - %15 = OpLabel - %41 = OpAccessChain %25 %19 %21 - %42 = OpLoad %16 %41 - %43 = OpUDiv %16 %42 %36 - %44 = OpAccessChain %25 %19 %21 - OpStore %44 %43 - OpReturn - OpFunctionEnd - -)"; - constexpr char kDstNoDebug[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpMemberDecorate %17 0 Offset 0 - OpDecorate %17 BufferBlock - OpDecorate %19 DescriptorSet 0 - OpDecorate %19 Binding 1 - OpMemberDecorate %22 0 Offset 0 - OpDecorate %22 Block - OpDecorate %24 DescriptorSet 0 - OpDecorate %24 Binding 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %16 = OpTypeInt 32 0 - %17 = OpTypeStruct %16 - %18 = OpTypePointer Uniform %17 - %19 = OpVariable %18 Uniform - %20 = OpTypeInt 32 1 - %21 = OpConstant %20 0 - %22 = OpTypeStruct %16 - %23 = OpTypePointer Uniform %22 - %24 = OpVariable %23 Uniform - %25 = OpTypePointer Uniform %16 - %31 = OpConstant %20 1 - %36 = OpConstant %16 2 - %6 = OpFunction %2 None %3 - %7 = OpLabel - %26 = OpAccessChain %25 %24 %21 - %27 = OpLoad %16 %26 - %28 = OpAccessChain %25 %19 %21 - OpStore %28 %27 - OpReturn - OpFunctionEnd - %14 = OpFunction %2 None %3 - %15 = OpLabel - %41 = OpAccessChain %25 %19 %21 - %42 = OpLoad %16 %41 - %43 = OpIAdd %16 %42 %36 - %44 = OpAccessChain %25 %19 %21 - OpStore %44 %43 - OpReturn - OpFunctionEnd - %8 = OpFunction %2 None %3 - %9 = OpLabel - %29 = OpAccessChain %25 %19 %21 - %30 = OpLoad %16 %29 - %32 = OpISub %16 %30 %31 - OpStore %29 %32 - OpReturn - OpFunctionEnd - %10 = OpFunction %2 None %3 - %11 = OpLabel - %33 = OpAccessChain %25 %19 %21 - %34 = OpLoad %16 %33 - %35 = OpIAdd %16 %34 %31 - OpStore %33 %35 - OpReturn - OpFunctionEnd - %4 = OpFunction %2 None %3 - %5 = OpLabel - %45 = OpFunctionCall %2 %6 - %46 = OpFunctionCall %2 %8 - %47 = OpFunctionCall %2 %10 - %48 = OpFunctionCall %2 %12 - %49 = OpFunctionCall %2 %14 - OpReturn - OpFunctionEnd - %12 = OpFunction %2 None %3 - %13 = OpLabel - %37 = OpAccessChain %25 %19 %21 - %38 = OpLoad %16 %37 - %39 = OpISub %16 %38 %36 - %40 = OpAccessChain %25 %19 %21 - OpStore %40 %39 - OpReturn - OpFunctionEnd - -)"; - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 50 -+; Bound: 52 - ; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpMemberDecorate %17 0 Offset 0 - OpDecorate %17 BufferBlock - OpDecorate %19 DescriptorSet 0 - OpDecorate %19 Binding 1 - OpMemberDecorate %22 0 Offset 0 - OpDecorate %22 Block - OpDecorate %24 DescriptorSet 0 - OpDecorate %24 Binding 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %16 = OpTypeInt 32 0 - %17 = OpTypeStruct %16 - %18 = OpTypePointer Uniform %17 - %19 = OpVariable %18 Uniform - %20 = OpTypeInt 32 1 - %21 = OpConstant %20 0 - %22 = OpTypeStruct %16 - %23 = OpTypePointer Uniform %22 - %24 = OpVariable %23 Uniform - %25 = OpTypePointer Uniform %16 - %31 = OpConstant %20 1 - %36 = OpConstant %16 2 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %45 = OpFunctionCall %2 %6 --%46 = OpFunctionCall %2 %8 -+%46 = OpFunctionCall %2 %10 --%47 = OpFunctionCall %2 %10 -+%47 = OpFunctionCall %2 %8 - %48 = OpFunctionCall %2 %12 - %49 = OpFunctionCall %2 %14 - OpReturn - OpFunctionEnd - %6 = OpFunction %2 None %3 - %7 = OpLabel - %26 = OpAccessChain %25 %24 %21 - %27 = OpLoad %16 %26 - %28 = OpAccessChain %25 %19 %21 - OpStore %28 %27 - OpReturn - OpFunctionEnd - %8 = OpFunction %2 None %3 - %9 = OpLabel - %29 = OpAccessChain %25 %19 %21 - %30 = OpLoad %16 %29 - %32 = OpIAdd %16 %30 %31 - OpStore %29 %32 - OpReturn - OpFunctionEnd - %10 = OpFunction %2 None %3 - %11 = OpLabel - %33 = OpAccessChain %25 %19 %21 - %34 = OpLoad %16 %33 - %35 = OpISub %16 %34 %31 - OpStore %33 %35 - OpReturn - OpFunctionEnd - %12 = OpFunction %2 None %3 - %13 = OpLabel - %37 = OpAccessChain %25 %19 %21 - %38 = OpLoad %16 %37 --%39 = OpIMul %16 %38 %36 -+%50 = OpISub %16 %38 %36 - %40 = OpAccessChain %25 %19 %21 --OpStore %40 %39 -+OpStore %40 %50 - OpReturn - OpFunctionEnd - %14 = OpFunction %2 None %3 - %15 = OpLabel - %41 = OpAccessChain %25 %19 %21 - %42 = OpLoad %16 %41 --%43 = OpUDiv %16 %42 %36 -+%51 = OpIAdd %16 %42 %36 - %44 = OpAccessChain %25 %19 %21 --OpStore %44 %43 -+OpStore %44 %51 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -} - -TEST(DiffTest, SmallFunctionsSmallDiffsDumpIds) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 50 -+; Bound: 54 - ; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "main" - OpName %6 "f1(" - OpName %8 "f2(" - OpName %10 "f3(" - OpName %12 "f4(" - OpName %14 "f5(" - OpName %17 "BufferOut" - OpMemberName %17 0 "o" - OpName %19 "" - OpName %22 "BufferIn" - OpMemberName %22 0 "i" - OpName %24 "" - OpMemberDecorate %17 0 Offset 0 - OpDecorate %17 BufferBlock - OpDecorate %19 DescriptorSet 0 - OpDecorate %19 Binding 1 - OpMemberDecorate %22 0 Offset 0 - OpDecorate %22 Block - OpDecorate %24 DescriptorSet 0 - OpDecorate %24 Binding 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %16 = OpTypeInt 32 0 - %17 = OpTypeStruct %16 - %18 = OpTypePointer Uniform %17 - %19 = OpVariable %18 Uniform - %20 = OpTypeInt 32 1 - %21 = OpConstant %20 0 - %22 = OpTypeStruct %16 - %23 = OpTypePointer Uniform %22 - %24 = OpVariable %23 Uniform - %25 = OpTypePointer Uniform %16 - %31 = OpConstant %20 1 - %36 = OpConstant %16 2 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %45 = OpFunctionCall %2 %6 - %46 = OpFunctionCall %2 %8 - %47 = OpFunctionCall %2 %10 - %48 = OpFunctionCall %2 %12 - %49 = OpFunctionCall %2 %14 - OpReturn - OpFunctionEnd - %6 = OpFunction %2 None %3 - %7 = OpLabel - %26 = OpAccessChain %25 %24 %21 - %27 = OpLoad %16 %26 - %28 = OpAccessChain %25 %19 %21 - OpStore %28 %27 - OpReturn - OpFunctionEnd - %8 = OpFunction %2 None %3 - %9 = OpLabel - %29 = OpAccessChain %25 %19 %21 - %30 = OpLoad %16 %29 --%32 = OpIAdd %16 %30 %31 -+%50 = OpISub %16 %30 %31 --OpStore %29 %32 -+OpStore %29 %50 - OpReturn - OpFunctionEnd - %10 = OpFunction %2 None %3 - %11 = OpLabel - %33 = OpAccessChain %25 %19 %21 - %34 = OpLoad %16 %33 --%35 = OpISub %16 %34 %31 -+%51 = OpIAdd %16 %34 %31 --OpStore %33 %35 -+OpStore %33 %51 - OpReturn - OpFunctionEnd - %12 = OpFunction %2 None %3 - %13 = OpLabel - %37 = OpAccessChain %25 %19 %21 - %38 = OpLoad %16 %37 --%39 = OpIMul %16 %38 %36 -+%52 = OpISub %16 %38 %36 - %40 = OpAccessChain %25 %19 %21 --OpStore %40 %39 -+OpStore %40 %52 - OpReturn - OpFunctionEnd - %14 = OpFunction %2 None %3 - %15 = OpLabel - %41 = OpAccessChain %25 %19 %21 - %42 = OpLoad %16 %41 --%43 = OpUDiv %16 %42 %36 -+%53 = OpIAdd %16 %42 %36 - %44 = OpAccessChain %25 %19 %21 --OpStore %44 %43 -+OpStore %44 %53 - OpReturn - OpFunctionEnd - Src -> Dst - 1 -> 1 [ExtInstImport] - 2 -> 2 [TypeVoid] - 3 -> 3 [TypeFunction] - 4 -> 4 [Function] - 5 -> 5 [Label] - 6 -> 6 [Function] - 7 -> 7 [Label] - 8 -> 8 [Function] - 9 -> 9 [Label] - 10 -> 10 [Function] - 11 -> 11 [Label] - 12 -> 12 [Function] - 13 -> 13 [Label] - 14 -> 14 [Function] - 15 -> 15 [Label] - 16 -> 16 [TypeInt] - 17 -> 17 [TypeStruct] - 18 -> 18 [TypePointer] - 19 -> 19 [Variable] - 20 -> 20 [TypeInt] - 21 -> 21 [Constant] - 22 -> 22 [TypeStruct] - 23 -> 23 [TypePointer] - 24 -> 24 [Variable] - 25 -> 25 [TypePointer] - 26 -> 26 [AccessChain] - 27 -> 27 [Load] - 28 -> 28 [AccessChain] - 29 -> 29 [AccessChain] - 30 -> 30 [Load] - 31 -> 31 [Constant] - 32 -> 50 [IAdd] - 33 -> 33 [AccessChain] - 34 -> 34 [Load] - 35 -> 51 [ISub] - 36 -> 36 [Constant] - 37 -> 37 [AccessChain] - 38 -> 38 [Load] - 39 -> 52 [IMul] - 40 -> 40 [AccessChain] - 41 -> 41 [AccessChain] - 42 -> 42 [Load] - 43 -> 53 [UDiv] - 44 -> 44 [AccessChain] - 45 -> 45 [FunctionCall] - 46 -> 46 [FunctionCall] - 47 -> 47 [FunctionCall] - 48 -> 48 [FunctionCall] - 49 -> 49 [FunctionCall] -)"; - Options options; - options.dump_id_map = true; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_files/small_functions_small_diffs_dst.spvasm b/test/diff/diff_files/small_functions_small_diffs_dst.spvasm deleted file mode 100644 index fabf5692..00000000 --- a/test/diff/diff_files/small_functions_small_diffs_dst.spvasm +++ /dev/null @@ -1,92 +0,0 @@ - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "main" - OpName %6 "f1(" - OpName %8 "f2(" - OpName %10 "f3(" - OpName %12 "f4(" - OpName %14 "f5(" - OpName %17 "BufferOut" - OpMemberName %17 0 "o" - OpName %19 "" - OpName %22 "BufferIn" - OpMemberName %22 0 "i" - OpName %24 "" - OpMemberDecorate %17 0 Offset 0 - OpDecorate %17 BufferBlock - OpDecorate %19 DescriptorSet 0 - OpDecorate %19 Binding 1 - OpMemberDecorate %22 0 Offset 0 - OpDecorate %22 Block - OpDecorate %24 DescriptorSet 0 - OpDecorate %24 Binding 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %16 = OpTypeInt 32 0 - %17 = OpTypeStruct %16 - %18 = OpTypePointer Uniform %17 - %19 = OpVariable %18 Uniform - %20 = OpTypeInt 32 1 - %21 = OpConstant %20 0 - %22 = OpTypeStruct %16 - %23 = OpTypePointer Uniform %22 - %24 = OpVariable %23 Uniform - %25 = OpTypePointer Uniform %16 - %31 = OpConstant %20 1 - %36 = OpConstant %16 2 - %6 = OpFunction %2 None %3 - %7 = OpLabel - %26 = OpAccessChain %25 %24 %21 - %27 = OpLoad %16 %26 - %28 = OpAccessChain %25 %19 %21 - OpStore %28 %27 - OpReturn - OpFunctionEnd - %14 = OpFunction %2 None %3 - %15 = OpLabel - %41 = OpAccessChain %25 %19 %21 - %42 = OpLoad %16 %41 - %43 = OpIAdd %16 %42 %36 - %44 = OpAccessChain %25 %19 %21 - OpStore %44 %43 - OpReturn - OpFunctionEnd - %8 = OpFunction %2 None %3 - %9 = OpLabel - %29 = OpAccessChain %25 %19 %21 - %30 = OpLoad %16 %29 - %32 = OpISub %16 %30 %31 - OpStore %29 %32 - OpReturn - OpFunctionEnd - %10 = OpFunction %2 None %3 - %11 = OpLabel - %33 = OpAccessChain %25 %19 %21 - %34 = OpLoad %16 %33 - %35 = OpIAdd %16 %34 %31 - OpStore %33 %35 - OpReturn - OpFunctionEnd - %4 = OpFunction %2 None %3 - %5 = OpLabel - %45 = OpFunctionCall %2 %6 - %46 = OpFunctionCall %2 %8 - %47 = OpFunctionCall %2 %10 - %48 = OpFunctionCall %2 %12 - %49 = OpFunctionCall %2 %14 - OpReturn - OpFunctionEnd - %12 = OpFunction %2 None %3 - %13 = OpLabel - %37 = OpAccessChain %25 %19 %21 - %38 = OpLoad %16 %37 - %39 = OpISub %16 %38 %36 - %40 = OpAccessChain %25 %19 %21 - OpStore %40 %39 - OpReturn - OpFunctionEnd - diff --git a/test/diff/diff_files/small_functions_small_diffs_src.spvasm b/test/diff/diff_files/small_functions_small_diffs_src.spvasm deleted file mode 100644 index 895285b1..00000000 --- a/test/diff/diff_files/small_functions_small_diffs_src.spvasm +++ /dev/null @@ -1,93 +0,0 @@ -;; Test where src and dst have many small functions with small differences. - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "main" - OpName %6 "f1(" - OpName %8 "f2(" - OpName %10 "f3(" - OpName %12 "f4(" - OpName %14 "f5(" - OpName %17 "BufferOut" - OpMemberName %17 0 "o" - OpName %19 "" - OpName %22 "BufferIn" - OpMemberName %22 0 "i" - OpName %24 "" - OpMemberDecorate %17 0 Offset 0 - OpDecorate %17 BufferBlock - OpDecorate %19 DescriptorSet 0 - OpDecorate %19 Binding 1 - OpMemberDecorate %22 0 Offset 0 - OpDecorate %22 Block - OpDecorate %24 DescriptorSet 0 - OpDecorate %24 Binding 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %16 = OpTypeInt 32 0 - %17 = OpTypeStruct %16 - %18 = OpTypePointer Uniform %17 - %19 = OpVariable %18 Uniform - %20 = OpTypeInt 32 1 - %21 = OpConstant %20 0 - %22 = OpTypeStruct %16 - %23 = OpTypePointer Uniform %22 - %24 = OpVariable %23 Uniform - %25 = OpTypePointer Uniform %16 - %31 = OpConstant %20 1 - %36 = OpConstant %16 2 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %45 = OpFunctionCall %2 %6 - %46 = OpFunctionCall %2 %8 - %47 = OpFunctionCall %2 %10 - %48 = OpFunctionCall %2 %12 - %49 = OpFunctionCall %2 %14 - OpReturn - OpFunctionEnd - %6 = OpFunction %2 None %3 - %7 = OpLabel - %26 = OpAccessChain %25 %24 %21 - %27 = OpLoad %16 %26 - %28 = OpAccessChain %25 %19 %21 - OpStore %28 %27 - OpReturn - OpFunctionEnd - %8 = OpFunction %2 None %3 - %9 = OpLabel - %29 = OpAccessChain %25 %19 %21 - %30 = OpLoad %16 %29 - %32 = OpIAdd %16 %30 %31 - OpStore %29 %32 - OpReturn - OpFunctionEnd - %10 = OpFunction %2 None %3 - %11 = OpLabel - %33 = OpAccessChain %25 %19 %21 - %34 = OpLoad %16 %33 - %35 = OpISub %16 %34 %31 - OpStore %33 %35 - OpReturn - OpFunctionEnd - %12 = OpFunction %2 None %3 - %13 = OpLabel - %37 = OpAccessChain %25 %19 %21 - %38 = OpLoad %16 %37 - %39 = OpIMul %16 %38 %36 - %40 = OpAccessChain %25 %19 %21 - OpStore %40 %39 - OpReturn - OpFunctionEnd - %14 = OpFunction %2 None %3 - %15 = OpLabel - %41 = OpAccessChain %25 %19 %21 - %42 = OpLoad %16 %41 - %43 = OpUDiv %16 %42 %36 - %44 = OpAccessChain %25 %19 %21 - OpStore %44 %43 - OpReturn - OpFunctionEnd - diff --git a/test/diff/diff_files/spec_constant_array_size_autogen.cpp b/test/diff/diff_files/spec_constant_array_size_autogen.cpp deleted file mode 100644 index 1962d27e..00000000 --- a/test/diff/diff_files/spec_constant_array_size_autogen.cpp +++ /dev/null @@ -1,310 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_tests.py -// -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -// Tests that identical specialization constants are not matched with constants -// when used as array size. -constexpr char kSrc[] = R"(; SPIR-V -; Version: 1.0 -; Generator: Google ANGLE Shader Compiler; 0 -; Bound: 27 -; Schema: 0 -OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %22 "main" %4 %19 -OpSource GLSL 450 -OpName %4 "_ua_position" -OpName %17 "gl_PerVertex" -OpMemberName %17 0 "gl_Position" -OpMemberName %17 1 "gl_PointSize" -OpMemberName %17 2 "gl_ClipDistance" -OpMemberName %17 3 "gl_CullDistance" -OpName %19 "" -OpName %22 "main" -OpDecorate %4 Location 0 -OpMemberDecorate %17 1 RelaxedPrecision -OpMemberDecorate %17 0 BuiltIn Position -OpMemberDecorate %17 1 BuiltIn PointSize -OpMemberDecorate %17 2 BuiltIn ClipDistance -OpMemberDecorate %17 3 BuiltIn CullDistance -OpDecorate %17 Block -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%5 = OpTypeInt 32 0 -%8 = OpTypeVector %5 4 -%15 = OpConstant %5 8 -%16 = OpTypeArray %1 %15 -%17 = OpTypeStruct %2 %1 %16 %16 -%20 = OpTypeVoid -%25 = OpConstant %5 0 -%3 = OpTypePointer Input %2 -%13 = OpTypePointer Output %2 -%18 = OpTypePointer Output %17 -%21 = OpTypeFunction %20 -%4 = OpVariable %3 Input -%19 = OpVariable %18 Output -%22 = OpFunction %20 None %21 -%23 = OpLabel -%24 = OpLoad %2 %4 -%26 = OpAccessChain %13 %19 %25 -OpStore %26 %24 -OpReturn -OpFunctionEnd)"; -constexpr char kDst[] = R"(; SPIR-V -; Version: 1.0 -; Generator: Google ANGLE Shader Compiler; 0 -; Bound: 27 -; Schema: 0 -OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %22 "main" %4 %19 -OpSource GLSL 450 -OpName %4 "_ua_position" -OpName %17 "gl_PerVertex" -OpMemberName %17 0 "gl_Position" -OpMemberName %17 1 "gl_PointSize" -OpMemberName %17 2 "gl_ClipDistance" -OpMemberName %17 3 "gl_CullDistance" -OpName %19 "" -OpName %22 "main" -OpDecorate %4 Location 0 -OpDecorate %15 SpecId 4 -OpMemberDecorate %17 1 RelaxedPrecision -OpMemberDecorate %17 0 BuiltIn Position -OpMemberDecorate %17 1 BuiltIn PointSize -OpMemberDecorate %17 2 BuiltIn ClipDistance -OpMemberDecorate %17 3 BuiltIn CullDistance -OpDecorate %17 Block -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%5 = OpTypeInt 32 0 -%8 = OpTypeVector %5 4 -%15 = OpSpecConstant %5 8 -%16 = OpTypeArray %1 %15 -%17 = OpTypeStruct %2 %1 %16 %16 -%20 = OpTypeVoid -%25 = OpConstant %5 0 -%3 = OpTypePointer Input %2 -%13 = OpTypePointer Output %2 -%18 = OpTypePointer Output %17 -%21 = OpTypeFunction %20 -%4 = OpVariable %3 Input -%19 = OpVariable %18 Output -%22 = OpFunction %20 None %21 -%23 = OpLabel -%24 = OpLoad %2 %4 -%26 = OpAccessChain %13 %19 %25 -OpStore %26 %24 -OpReturn -OpFunctionEnd -)"; - -TEST(DiffTest, SpecConstantArraySize) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 27 -+; Bound: 36 - ; Schema: 0 - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %22 "main" %4 %19 - OpSource GLSL 450 - OpName %4 "_ua_position" - OpName %17 "gl_PerVertex" - OpMemberName %17 0 "gl_Position" - OpMemberName %17 1 "gl_PointSize" - OpMemberName %17 2 "gl_ClipDistance" - OpMemberName %17 3 "gl_CullDistance" - OpName %19 "" - OpName %22 "main" - OpDecorate %4 Location 0 -+OpDecorate %34 SpecId 4 - OpMemberDecorate %17 1 RelaxedPrecision - OpMemberDecorate %17 0 BuiltIn Position - OpMemberDecorate %17 1 BuiltIn PointSize - OpMemberDecorate %17 2 BuiltIn ClipDistance - OpMemberDecorate %17 3 BuiltIn CullDistance - OpDecorate %17 Block - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 - %5 = OpTypeInt 32 0 - %8 = OpTypeVector %5 4 --%15 = OpConstant %5 8 --%16 = OpTypeArray %1 %15 -+%34 = OpSpecConstant %5 8 -+%35 = OpTypeArray %1 %34 --%17 = OpTypeStruct %2 %1 %16 %16 -+%17 = OpTypeStruct %2 %1 %35 %35 - %20 = OpTypeVoid - %25 = OpConstant %5 0 - %3 = OpTypePointer Input %2 - %13 = OpTypePointer Output %2 - %18 = OpTypePointer Output %17 - %21 = OpTypeFunction %20 - %4 = OpVariable %3 Input - %19 = OpVariable %18 Output - %22 = OpFunction %20 None %21 - %23 = OpLabel - %24 = OpLoad %2 %4 - %26 = OpAccessChain %13 %19 %25 - OpStore %26 %24 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, SpecConstantArraySizeNoDebug) { - constexpr char kSrcNoDebug[] = R"(; SPIR-V -; Version: 1.0 -; Generator: Google ANGLE Shader Compiler; 0 -; Bound: 27 -; Schema: 0 -OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %22 "main" %4 %19 -OpSource GLSL 450 -OpDecorate %4 Location 0 -OpMemberDecorate %17 1 RelaxedPrecision -OpMemberDecorate %17 0 BuiltIn Position -OpMemberDecorate %17 1 BuiltIn PointSize -OpMemberDecorate %17 2 BuiltIn ClipDistance -OpMemberDecorate %17 3 BuiltIn CullDistance -OpDecorate %17 Block -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%5 = OpTypeInt 32 0 -%8 = OpTypeVector %5 4 -%15 = OpConstant %5 8 -%16 = OpTypeArray %1 %15 -%17 = OpTypeStruct %2 %1 %16 %16 -%20 = OpTypeVoid -%25 = OpConstant %5 0 -%3 = OpTypePointer Input %2 -%13 = OpTypePointer Output %2 -%18 = OpTypePointer Output %17 -%21 = OpTypeFunction %20 -%4 = OpVariable %3 Input -%19 = OpVariable %18 Output -%22 = OpFunction %20 None %21 -%23 = OpLabel -%24 = OpLoad %2 %4 -%26 = OpAccessChain %13 %19 %25 -OpStore %26 %24 -OpReturn -OpFunctionEnd -)"; - constexpr char kDstNoDebug[] = R"(; SPIR-V -; Version: 1.0 -; Generator: Google ANGLE Shader Compiler; 0 -; Bound: 27 -; Schema: 0 -OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %22 "main" %4 %19 -OpSource GLSL 450 -OpDecorate %4 Location 0 -OpDecorate %15 SpecId 4 -OpMemberDecorate %17 1 RelaxedPrecision -OpMemberDecorate %17 0 BuiltIn Position -OpMemberDecorate %17 1 BuiltIn PointSize -OpMemberDecorate %17 2 BuiltIn ClipDistance -OpMemberDecorate %17 3 BuiltIn CullDistance -OpDecorate %17 Block -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%5 = OpTypeInt 32 0 -%8 = OpTypeVector %5 4 -%15 = OpSpecConstant %5 8 -%16 = OpTypeArray %1 %15 -%17 = OpTypeStruct %2 %1 %16 %16 -%20 = OpTypeVoid -%25 = OpConstant %5 0 -%3 = OpTypePointer Input %2 -%13 = OpTypePointer Output %2 -%18 = OpTypePointer Output %17 -%21 = OpTypeFunction %20 -%4 = OpVariable %3 Input -%19 = OpVariable %18 Output -%22 = OpFunction %20 None %21 -%23 = OpLabel -%24 = OpLoad %2 %4 -%26 = OpAccessChain %13 %19 %25 -OpStore %26 %24 -OpReturn -OpFunctionEnd -)"; - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 27 -+; Bound: 36 - ; Schema: 0 - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %22 "main" %4 %19 - OpSource GLSL 450 - OpDecorate %4 Location 0 -+OpDecorate %34 SpecId 4 - OpMemberDecorate %17 1 RelaxedPrecision - OpMemberDecorate %17 0 BuiltIn Position - OpMemberDecorate %17 1 BuiltIn PointSize - OpMemberDecorate %17 2 BuiltIn ClipDistance - OpMemberDecorate %17 3 BuiltIn CullDistance - OpDecorate %17 Block - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 - %5 = OpTypeInt 32 0 - %8 = OpTypeVector %5 4 --%15 = OpConstant %5 8 --%16 = OpTypeArray %1 %15 -+%34 = OpSpecConstant %5 8 -+%35 = OpTypeArray %1 %34 --%17 = OpTypeStruct %2 %1 %16 %16 -+%17 = OpTypeStruct %2 %1 %35 %35 - %20 = OpTypeVoid - %25 = OpConstant %5 0 - %3 = OpTypePointer Input %2 - %13 = OpTypePointer Output %2 - %18 = OpTypePointer Output %17 - %21 = OpTypeFunction %20 - %4 = OpVariable %3 Input - %19 = OpVariable %18 Output - %22 = OpFunction %20 None %21 - %23 = OpLabel - %24 = OpLoad %2 %4 - %26 = OpAccessChain %13 %19 %25 - OpStore %26 %24 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_files/spec_constant_array_size_dst.spvasm b/test/diff/diff_files/spec_constant_array_size_dst.spvasm deleted file mode 100644 index 7cedf083..00000000 --- a/test/diff/diff_files/spec_constant_array_size_dst.spvasm +++ /dev/null @@ -1,47 +0,0 @@ -; SPIR-V -; Version: 1.0 -; Generator: Google ANGLE Shader Compiler; 0 -; Bound: 27 -; Schema: 0 -OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %22 "main" %4 %19 -OpSource GLSL 450 -OpName %4 "_ua_position" -OpName %17 "gl_PerVertex" -OpMemberName %17 0 "gl_Position" -OpMemberName %17 1 "gl_PointSize" -OpMemberName %17 2 "gl_ClipDistance" -OpMemberName %17 3 "gl_CullDistance" -OpName %19 "" -OpName %22 "main" -OpDecorate %4 Location 0 -OpDecorate %15 SpecId 4 -OpMemberDecorate %17 1 RelaxedPrecision -OpMemberDecorate %17 0 BuiltIn Position -OpMemberDecorate %17 1 BuiltIn PointSize -OpMemberDecorate %17 2 BuiltIn ClipDistance -OpMemberDecorate %17 3 BuiltIn CullDistance -OpDecorate %17 Block -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%5 = OpTypeInt 32 0 -%8 = OpTypeVector %5 4 -%15 = OpSpecConstant %5 8 -%16 = OpTypeArray %1 %15 -%17 = OpTypeStruct %2 %1 %16 %16 -%20 = OpTypeVoid -%25 = OpConstant %5 0 -%3 = OpTypePointer Input %2 -%13 = OpTypePointer Output %2 -%18 = OpTypePointer Output %17 -%21 = OpTypeFunction %20 -%4 = OpVariable %3 Input -%19 = OpVariable %18 Output -%22 = OpFunction %20 None %21 -%23 = OpLabel -%24 = OpLoad %2 %4 -%26 = OpAccessChain %13 %19 %25 -OpStore %26 %24 -OpReturn -OpFunctionEnd diff --git a/test/diff/diff_files/spec_constant_array_size_src.spvasm b/test/diff/diff_files/spec_constant_array_size_src.spvasm deleted file mode 100644 index e17e04ac..00000000 --- a/test/diff/diff_files/spec_constant_array_size_src.spvasm +++ /dev/null @@ -1,48 +0,0 @@ -;; Tests that identical specialization constants are not matched with constants -;; when used as array size. -; SPIR-V -; Version: 1.0 -; Generator: Google ANGLE Shader Compiler; 0 -; Bound: 27 -; Schema: 0 -OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %22 "main" %4 %19 -OpSource GLSL 450 -OpName %4 "_ua_position" -OpName %17 "gl_PerVertex" -OpMemberName %17 0 "gl_Position" -OpMemberName %17 1 "gl_PointSize" -OpMemberName %17 2 "gl_ClipDistance" -OpMemberName %17 3 "gl_CullDistance" -OpName %19 "" -OpName %22 "main" -OpDecorate %4 Location 0 -OpMemberDecorate %17 1 RelaxedPrecision -OpMemberDecorate %17 0 BuiltIn Position -OpMemberDecorate %17 1 BuiltIn PointSize -OpMemberDecorate %17 2 BuiltIn ClipDistance -OpMemberDecorate %17 3 BuiltIn CullDistance -OpDecorate %17 Block -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%5 = OpTypeInt 32 0 -%8 = OpTypeVector %5 4 -%15 = OpConstant %5 8 -%16 = OpTypeArray %1 %15 -%17 = OpTypeStruct %2 %1 %16 %16 -%20 = OpTypeVoid -%25 = OpConstant %5 0 -%3 = OpTypePointer Input %2 -%13 = OpTypePointer Output %2 -%18 = OpTypePointer Output %17 -%21 = OpTypeFunction %20 -%4 = OpVariable %3 Input -%19 = OpVariable %18 Output -%22 = OpFunction %20 None %21 -%23 = OpLabel -%24 = OpLoad %2 %4 -%26 = OpAccessChain %13 %19 %25 -OpStore %26 %24 -OpReturn -OpFunctionEnd diff --git a/test/diff/diff_files/spec_constant_composite_autogen.cpp b/test/diff/diff_files/spec_constant_composite_autogen.cpp deleted file mode 100644 index e4b52cb6..00000000 --- a/test/diff/diff_files/spec_constant_composite_autogen.cpp +++ /dev/null @@ -1,186 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_tests.py -// -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -// Tests OpSpecConstantComposite matching. -constexpr char kSrc[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %main "main" - OpExecutionMode %main LocalSize 1 1 1 - OpSource GLSL 450 - OpName %main "main" - OpDecorate %7 SpecId 3 - OpDecorate %8 SpecId 4 - OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize - %void = OpTypeVoid - %3 = OpTypeFunction %void - %uint = OpTypeInt 32 0 - %7 = OpSpecConstant %uint 1 - %8 = OpSpecConstant %uint 1 - %uint_1 = OpConstant %uint 1 - %v3uint = OpTypeVector %uint 3 -%gl_WorkGroupSize = OpSpecConstantComposite %v3uint %7 %8 %uint_1 - %main = OpFunction %void None %3 - %5 = OpLabel - OpReturn - OpFunctionEnd)"; -constexpr char kDst[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %main "main" - OpExecutionMode %main LocalSize 1 1 1 - OpSource GLSL 450 - OpName %main "main" - OpDecorate %7 SpecId 3 - OpDecorate %8 SpecId 4 - OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize - %void = OpTypeVoid - %3 = OpTypeFunction %void - %uint = OpTypeInt 32 0 - %7 = OpSpecConstant %uint 2048 - %8 = OpSpecConstant %uint 1 - %uint_1 = OpConstant %uint 1 - %v3uint = OpTypeVector %uint 3 -%gl_WorkGroupSize = OpSpecConstantComposite %v3uint %7 %8 %uint_1 - %main = OpFunction %void None %3 - %5 = OpLabel - OpReturn - OpFunctionEnd -)"; - -TEST(DiffTest, SpecConstantComposite) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 - ; Bound: 12 - ; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %2 "main" - OpExecutionMode %2 LocalSize 1 1 1 - OpSource GLSL 450 - OpName %2 "main" - OpDecorate %7 SpecId 3 - OpDecorate %8 SpecId 4 - OpDecorate %4 BuiltIn WorkgroupSize - %6 = OpTypeVoid - %3 = OpTypeFunction %6 - %9 = OpTypeInt 32 0 --%7 = OpSpecConstant %9 1 -+%7 = OpSpecConstant %9 2048 - %8 = OpSpecConstant %9 1 - %10 = OpConstant %9 1 - %11 = OpTypeVector %9 3 - %4 = OpSpecConstantComposite %11 %7 %8 %10 - %2 = OpFunction %6 None %3 - %5 = OpLabel - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, SpecConstantCompositeNoDebug) { - constexpr char kSrcNoDebug[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %main "main" - OpExecutionMode %main LocalSize 1 1 1 - OpSource GLSL 450 - OpDecorate %7 SpecId 3 - OpDecorate %8 SpecId 4 - OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize - %void = OpTypeVoid - %3 = OpTypeFunction %void - %uint = OpTypeInt 32 0 - %7 = OpSpecConstant %uint 1 - %8 = OpSpecConstant %uint 1 - %uint_1 = OpConstant %uint 1 - %v3uint = OpTypeVector %uint 3 -%gl_WorkGroupSize = OpSpecConstantComposite %v3uint %7 %8 %uint_1 - %main = OpFunction %void None %3 - %5 = OpLabel - OpReturn - OpFunctionEnd -)"; - constexpr char kDstNoDebug[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %main "main" - OpExecutionMode %main LocalSize 1 1 1 - OpSource GLSL 450 - OpDecorate %7 SpecId 3 - OpDecorate %8 SpecId 4 - OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize - %void = OpTypeVoid - %3 = OpTypeFunction %void - %uint = OpTypeInt 32 0 - %7 = OpSpecConstant %uint 2048 - %8 = OpSpecConstant %uint 1 - %uint_1 = OpConstant %uint 1 - %v3uint = OpTypeVector %uint 3 -%gl_WorkGroupSize = OpSpecConstantComposite %v3uint %7 %8 %uint_1 - %main = OpFunction %void None %3 - %5 = OpLabel - OpReturn - OpFunctionEnd -)"; - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 - ; Bound: 12 - ; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %2 "main" - OpExecutionMode %2 LocalSize 1 1 1 - OpSource GLSL 450 - OpDecorate %7 SpecId 3 - OpDecorate %8 SpecId 4 - OpDecorate %4 BuiltIn WorkgroupSize - %6 = OpTypeVoid - %3 = OpTypeFunction %6 - %9 = OpTypeInt 32 0 --%7 = OpSpecConstant %9 1 -+%7 = OpSpecConstant %9 2048 - %8 = OpSpecConstant %9 1 - %10 = OpConstant %9 1 - %11 = OpTypeVector %9 3 - %4 = OpSpecConstantComposite %11 %7 %8 %10 - %2 = OpFunction %6 None %3 - %5 = OpLabel - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_files/spec_constant_composite_dst.spvasm b/test/diff/diff_files/spec_constant_composite_dst.spvasm deleted file mode 100644 index 3ab8d4d3..00000000 --- a/test/diff/diff_files/spec_constant_composite_dst.spvasm +++ /dev/null @@ -1,22 +0,0 @@ - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %main "main" - OpExecutionMode %main LocalSize 1 1 1 - OpSource GLSL 450 - OpName %main "main" - OpDecorate %7 SpecId 3 - OpDecorate %8 SpecId 4 - OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize - %void = OpTypeVoid - %3 = OpTypeFunction %void - %uint = OpTypeInt 32 0 - %7 = OpSpecConstant %uint 2048 - %8 = OpSpecConstant %uint 1 - %uint_1 = OpConstant %uint 1 - %v3uint = OpTypeVector %uint 3 -%gl_WorkGroupSize = OpSpecConstantComposite %v3uint %7 %8 %uint_1 - %main = OpFunction %void None %3 - %5 = OpLabel - OpReturn - OpFunctionEnd diff --git a/test/diff/diff_files/spec_constant_composite_src.spvasm b/test/diff/diff_files/spec_constant_composite_src.spvasm deleted file mode 100644 index ee48ef9d..00000000 --- a/test/diff/diff_files/spec_constant_composite_src.spvasm +++ /dev/null @@ -1,23 +0,0 @@ -;; Tests OpSpecConstantComposite matching. - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %main "main" - OpExecutionMode %main LocalSize 1 1 1 - OpSource GLSL 450 - OpName %main "main" - OpDecorate %7 SpecId 3 - OpDecorate %8 SpecId 4 - OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize - %void = OpTypeVoid - %3 = OpTypeFunction %void - %uint = OpTypeInt 32 0 - %7 = OpSpecConstant %uint 1 - %8 = OpSpecConstant %uint 1 - %uint_1 = OpConstant %uint 1 - %v3uint = OpTypeVector %uint 3 -%gl_WorkGroupSize = OpSpecConstantComposite %v3uint %7 %8 %uint_1 - %main = OpFunction %void None %3 - %5 = OpLabel - OpReturn - OpFunctionEnd diff --git a/test/diff/diff_files/unrelated_shaders_autogen.cpp b/test/diff/diff_files/unrelated_shaders_autogen.cpp deleted file mode 100644 index e1a58ccc..00000000 --- a/test/diff/diff_files/unrelated_shaders_autogen.cpp +++ /dev/null @@ -1,230 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_tests.py -// -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "../diff_test_utils.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -// Tests diff of unrelated shaders (with different execution models). -constexpr char kSrc[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %4 "main" %8 %10 - OpSource ESSL 310 - OpName %4 "main" - OpName %8 "v" - OpName %10 "a" - OpDecorate %8 Location 0 - OpDecorate %10 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypePointer Output %6 - %8 = OpVariable %7 Output - %9 = OpTypePointer Input %6 - %10 = OpVariable %9 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %11 = OpLoad %6 %10 - OpStore %8 %11 - OpReturn - OpFunctionEnd -)"; -constexpr char kDst[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %9 %11 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %9 "color" - OpName %11 "v" - OpDecorate %9 RelaxedPrecision - OpDecorate %9 Location 0 - OpDecorate %11 RelaxedPrecision - OpDecorate %11 Location 0 - OpDecorate %12 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 4 - %8 = OpTypePointer Output %7 - %9 = OpVariable %8 Output - %10 = OpTypePointer Input %6 - %11 = OpVariable %10 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %12 = OpLoad %6 %11 - %13 = OpCompositeConstruct %7 %12 %12 %12 %12 - OpStore %9 %13 - OpReturn - OpFunctionEnd - -)"; - -TEST(DiffTest, UnrelatedShaders) { - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 12 -+; Bound: 16 - ; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 --OpEntryPoint Vertex %4 "main" %8 %10 -+OpEntryPoint Fragment %4 "main" %14 %8 -+OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" -+OpName %14 "color" - OpName %8 "v" --OpName %10 "a" -+OpDecorate %14 RelaxedPrecision -+OpDecorate %14 Location 0 -+OpDecorate %8 RelaxedPrecision - OpDecorate %8 Location 0 --OpDecorate %10 Location 0 -+OpDecorate %11 RelaxedPrecision -+OpDecorate %15 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 --%7 = OpTypePointer Output %6 -+%12 = OpTypeVector %6 4 -+%13 = OpTypePointer Output %12 -+%14 = OpVariable %13 Output --%8 = OpVariable %7 Output -+%8 = OpVariable %9 Input - %9 = OpTypePointer Input %6 --%10 = OpVariable %9 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel --%11 = OpLoad %6 %10 -+%11 = OpLoad %6 %8 --OpStore %8 %11 -+%15 = OpCompositeConstruct %12 %11 %11 %11 %11 -+OpStore %14 %15 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrc, kDst, kDiff, options); -} - -TEST(DiffTest, UnrelatedShadersNoDebug) { - constexpr char kSrcNoDebug[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %4 "main" %8 %10 - OpSource ESSL 310 - OpDecorate %8 Location 0 - OpDecorate %10 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypePointer Output %6 - %8 = OpVariable %7 Output - %9 = OpTypePointer Input %6 - %10 = OpVariable %9 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %11 = OpLoad %6 %10 - OpStore %8 %11 - OpReturn - OpFunctionEnd - -)"; - constexpr char kDstNoDebug[] = R"( OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %9 %11 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpDecorate %9 RelaxedPrecision - OpDecorate %9 Location 0 - OpDecorate %11 RelaxedPrecision - OpDecorate %11 Location 0 - OpDecorate %12 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 4 - %8 = OpTypePointer Output %7 - %9 = OpVariable %8 Output - %10 = OpTypePointer Input %6 - %11 = OpVariable %10 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %12 = OpLoad %6 %11 - %13 = OpCompositeConstruct %7 %12 %12 %12 %12 - OpStore %9 %13 - OpReturn - OpFunctionEnd - -)"; - constexpr char kDiff[] = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 --; Bound: 12 -+; Bound: 15 - ; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 --OpEntryPoint Vertex %4 "main" %8 %10 -+OpEntryPoint Fragment %4 "main" %8 %10 -+OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 -+OpDecorate %8 RelaxedPrecision - OpDecorate %8 Location 0 -+OpDecorate %10 RelaxedPrecision - OpDecorate %10 Location 0 -+OpDecorate %11 RelaxedPrecision -+OpDecorate %14 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 --%7 = OpTypePointer Output %6 -+%12 = OpTypeVector %6 4 -+%13 = OpTypePointer Output %12 --%8 = OpVariable %7 Output -+%8 = OpVariable %13 Output - %9 = OpTypePointer Input %6 - %10 = OpVariable %9 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %11 = OpLoad %6 %10 -+%14 = OpCompositeConstruct %12 %11 %11 %11 %11 --OpStore %8 %11 -+OpStore %8 %14 - OpReturn - OpFunctionEnd -)"; - Options options; - DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_files/unrelated_shaders_dst.spvasm b/test/diff/diff_files/unrelated_shaders_dst.spvasm deleted file mode 100644 index 719715ba..00000000 --- a/test/diff/diff_files/unrelated_shaders_dst.spvasm +++ /dev/null @@ -1,31 +0,0 @@ - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %9 %11 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %9 "color" - OpName %11 "v" - OpDecorate %9 RelaxedPrecision - OpDecorate %9 Location 0 - OpDecorate %11 RelaxedPrecision - OpDecorate %11 Location 0 - OpDecorate %12 RelaxedPrecision - OpDecorate %13 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 4 - %8 = OpTypePointer Output %7 - %9 = OpVariable %8 Output - %10 = OpTypePointer Input %6 - %11 = OpVariable %10 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %12 = OpLoad %6 %11 - %13 = OpCompositeConstruct %7 %12 %12 %12 %12 - OpStore %9 %13 - OpReturn - OpFunctionEnd - diff --git a/test/diff/diff_files/unrelated_shaders_src.spvasm b/test/diff/diff_files/unrelated_shaders_src.spvasm deleted file mode 100644 index e77b2d20..00000000 --- a/test/diff/diff_files/unrelated_shaders_src.spvasm +++ /dev/null @@ -1,25 +0,0 @@ -;; Tests diff of unrelated shaders (with different execution models). - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %4 "main" %8 %10 - OpSource ESSL 310 - OpName %4 "main" - OpName %8 "v" - OpName %10 "a" - OpDecorate %8 Location 0 - OpDecorate %10 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypePointer Output %6 - %8 = OpVariable %7 Output - %9 = OpTypePointer Input %6 - %10 = OpVariable %9 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %11 = OpLoad %6 %10 - OpStore %8 %11 - OpReturn - OpFunctionEnd - diff --git a/test/diff/diff_test.cpp b/test/diff/diff_test.cpp deleted file mode 100644 index 5b11d0eb..00000000 --- a/test/diff/diff_test.cpp +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/diff/diff.h" - -#include "diff_test_utils.h" - -#include "source/opt/build_module.h" -#include "source/opt/ir_context.h" -#include "source/spirv_constant.h" -#include "spirv-tools/libspirv.hpp" -#include "tools/io.h" -#include "tools/util/cli_consumer.h" - -#include -#include - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -constexpr auto kDefaultEnvironment = SPV_ENV_UNIVERSAL_1_6; - -std::unique_ptr Assemble(const std::string& spirv) { - spvtools::SpirvTools t(kDefaultEnvironment); - t.SetMessageConsumer(spvtools::utils::CLIMessageConsumer); - std::vector binary; - if (!t.Assemble(spirv, &binary, - spvtools::SpirvTools::kDefaultAssembleOption | - SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS)) - return nullptr; - return spvtools::BuildModule(kDefaultEnvironment, - spvtools::utils::CLIMessageConsumer, - binary.data(), binary.size()); -} - -TEST(DiffIndentTest, Diff) { - const std::string src = R"(OpCapability Shader - %ext_inst = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %main "main" - OpExecutionMode %main OriginUpperLeft - %void = OpTypeVoid - %func = OpTypeFunction %void - - %main = OpFunction %void None %func - %main_entry = OpLabel - OpReturn - OpFunctionEnd;)"; - - const std::string dst = R"(OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %main "main" - OpExecutionMode %main OriginUpperLeft - %void = OpTypeVoid - %func = OpTypeFunction %void - - %main = OpFunction %void None %func - %main_entry = OpLabel - OpReturn - OpFunctionEnd;)"; - - const std::string diff = R"( ; SPIR-V - ; Version: 1.6 - ; Generator: Khronos SPIR-V Tools Assembler; 0 - ; Bound: 6 - ; Schema: 0 - OpCapability Shader -- %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %2 "main" - OpExecutionMode %2 OriginUpperLeft - %3 = OpTypeVoid - %4 = OpTypeFunction %3 - %2 = OpFunction %3 None %4 - %5 = OpLabel - OpReturn - OpFunctionEnd -)"; - - Options options; - options.indent = true; - DoStringDiffTest(src, dst, diff, options); -} - -TEST(DiffNoHeaderTest, Diff) { - const std::string src = R"(OpCapability Shader - %ext_inst = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %main "main" - OpExecutionMode %main OriginUpperLeft - %void = OpTypeVoid - %func = OpTypeFunction %void - - %main = OpFunction %void None %func - %main_entry = OpLabel - OpReturn - OpFunctionEnd;)"; - - const std::string dst = R"(OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %main "main" - OpExecutionMode %main OriginUpperLeft - %void = OpTypeVoid - %func = OpTypeFunction %void - - %main = OpFunction %void None %func - %main_entry = OpLabel - OpReturn - OpFunctionEnd;)"; - - const std::string diff = R"( OpCapability Shader --%1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %2 "main" - OpExecutionMode %2 OriginUpperLeft - %3 = OpTypeVoid - %4 = OpTypeFunction %3 - %2 = OpFunction %3 None %4 - %5 = OpLabel - OpReturn - OpFunctionEnd -)"; - - Options options; - options.no_header = true; - DoStringDiffTest(src, dst, diff, options); -} - -TEST(DiffHeaderTest, Diff) { - const std::string src_spirv = R"(OpCapability Shader - %ext_inst = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %main "main" - OpExecutionMode %main OriginUpperLeft - %void = OpTypeVoid - %func = OpTypeFunction %void - - %main = OpFunction %void None %func - %main_entry = OpLabel - OpReturn - OpFunctionEnd;)"; - - const std::string dst_spirv = R"(OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %main "main" - OpExecutionMode %main OriginUpperLeft - %void = OpTypeVoid - %func = OpTypeFunction %void - - %main = OpFunction %void None %func - %main_entry = OpLabel - OpReturn - OpFunctionEnd;)"; - - const std::string diff = R"( ; SPIR-V --; Version: 1.3 -+; Version: 1.2 --; Generator: Khronos SPIR-V Tools Assembler; 3 -+; Generator: Khronos Glslang Reference Front End; 10 - ; Bound: 6 - ; Schema: 0 - OpCapability Shader --%1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %2 "main" - OpExecutionMode %2 OriginUpperLeft - %3 = OpTypeVoid - %4 = OpTypeFunction %3 - %2 = OpFunction %3 None %4 - %5 = OpLabel - OpReturn - OpFunctionEnd -)"; - - // Load the src and dst modules - std::unique_ptr src = Assemble(src_spirv); - ASSERT_TRUE(src); - - std::unique_ptr dst = Assemble(dst_spirv); - ASSERT_TRUE(dst); - - // Differentiate them in the header. - const spvtools::opt::ModuleHeader src_header = { - SpvMagicNumber, - SPV_SPIRV_VERSION_WORD(1, 3), - SPV_GENERATOR_WORD(SPV_GENERATOR_KHRONOS_ASSEMBLER, 3), - src->module()->IdBound(), - src->module()->schema(), - }; - const spvtools::opt::ModuleHeader dst_header = { - SpvMagicNumber, - SPV_SPIRV_VERSION_WORD(1, 2), - SPV_GENERATOR_WORD(SPV_GENERATOR_KHRONOS_GLSLANG, 10), - dst->module()->IdBound(), - dst->module()->schema(), - }; - - src->module()->SetHeader(src_header); - dst->module()->SetHeader(dst_header); - - // Take the diff - Options options; - std::ostringstream diff_result; - spv_result_t result = - spvtools::diff::Diff(src.get(), dst.get(), diff_result, options); - ASSERT_EQ(result, SPV_SUCCESS); - - // Expect they match - EXPECT_EQ(diff_result.str(), diff); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_test_utils.cpp b/test/diff/diff_test_utils.cpp deleted file mode 100644 index 14bb8215..00000000 --- a/test/diff/diff_test_utils.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "diff_test_utils.h" - -#include "source/opt/build_module.h" -#include "source/opt/ir_context.h" - -#include "spirv-tools/libspirv.hpp" -#include "tools/io.h" -#include "tools/util/cli_consumer.h" - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { - -static constexpr auto kDefaultEnvironment = SPV_ENV_UNIVERSAL_1_6; - -void DoStringDiffTest(const std::string& src_spirv, - const std::string& dst_spirv, - const std::string& expected_diff, Options options) { - // Load the src and dst modules - std::unique_ptr src = spvtools::BuildModule( - kDefaultEnvironment, spvtools::utils::CLIMessageConsumer, src_spirv, - spvtools::SpirvTools::kDefaultAssembleOption | - SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - ASSERT_TRUE(src); - - std::unique_ptr dst = spvtools::BuildModule( - kDefaultEnvironment, spvtools::utils::CLIMessageConsumer, dst_spirv, - spvtools::SpirvTools::kDefaultAssembleOption | - SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - ASSERT_TRUE(dst); - - // Take the diff - std::ostringstream diff_result; - spv_result_t result = - spvtools::diff::Diff(src.get(), dst.get(), diff_result, options); - ASSERT_EQ(result, SPV_SUCCESS); - - // Expect they match - EXPECT_EQ(diff_result.str(), expected_diff); -} - -} // namespace diff -} // namespace spvtools diff --git a/test/diff/diff_test_utils.h b/test/diff/diff_test_utils.h deleted file mode 100644 index 938236e6..00000000 --- a/test/diff/diff_test_utils.h +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef TEST_DIFF_DIFF_TEST_UTILS_H_ -#define TEST_DIFF_DIFF_TEST_UTILS_H_ - -#include "source/diff/diff.h" - -namespace spvtools { -namespace diff { - -void DoStringDiffTest(const std::string& src_spirv, - const std::string& dst_spirv, - const std::string& expected_diff, Options options); - -} // namespace diff -} // namespace spvtools - -#endif // TEST_DIFF_DIFF_TEST_UTILS_H_ diff --git a/test/diff/lcs_test.cpp b/test/diff/lcs_test.cpp deleted file mode 100644 index 3e097b3e..00000000 --- a/test/diff/lcs_test.cpp +++ /dev/null @@ -1,329 +0,0 @@ -// Copyright (c) 2022 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/diff/lcs.h" - -#include - -#include "gtest/gtest.h" - -namespace spvtools { -namespace diff { -namespace { - -using Sequence = std::vector; -using LCS = LongestCommonSubsequence; - -void VerifyMatch(const Sequence& src, const Sequence& dst, - size_t expected_match_count) { - DiffMatch src_match, dst_match; - - LCS lcs(src, dst); - size_t match_count = - lcs.Get([](int s, int d) { return s == d; }, &src_match, &dst_match); - - EXPECT_EQ(match_count, expected_match_count); - - size_t src_cur = 0; - size_t dst_cur = 0; - size_t matches_seen = 0; - - while (src_cur < src.size() && dst_cur < dst.size()) { - if (src_match[src_cur] && dst_match[dst_cur]) { - EXPECT_EQ(src[src_cur], dst[dst_cur]) - << "Src: " << src_cur << " Dst: " << dst_cur; - ++src_cur; - ++dst_cur; - ++matches_seen; - continue; - } - if (!src_match[src_cur]) { - ++src_cur; - } - if (!dst_match[dst_cur]) { - ++dst_cur; - } - } - - EXPECT_EQ(matches_seen, expected_match_count); -} - -TEST(LCSTest, EmptySequences) { - Sequence src, dst; - - DiffMatch src_match, dst_match; - - LCS lcs(src, dst); - size_t match_count = - lcs.Get([](int s, int d) { return s == d; }, &src_match, &dst_match); - - EXPECT_EQ(match_count, 0u); - EXPECT_TRUE(src_match.empty()); - EXPECT_TRUE(dst_match.empty()); -} - -TEST(LCSTest, EmptySrc) { - Sequence src, dst = {1, 2, 3}; - - DiffMatch src_match, dst_match; - - LCS lcs(src, dst); - size_t match_count = - lcs.Get([](int s, int d) { return s == d; }, &src_match, &dst_match); - - EXPECT_EQ(match_count, 0u); - EXPECT_TRUE(src_match.empty()); - EXPECT_EQ(dst_match, DiffMatch(3, false)); -} - -TEST(LCSTest, EmptyDst) { - Sequence src = {1, 2, 3}, dst; - - DiffMatch src_match, dst_match; - - LCS lcs(src, dst); - size_t match_count = - lcs.Get([](int s, int d) { return s == d; }, &src_match, &dst_match); - - EXPECT_EQ(match_count, 0u); - EXPECT_EQ(src_match, DiffMatch(3, false)); - EXPECT_TRUE(dst_match.empty()); -} - -TEST(LCSTest, Identical) { - Sequence src = {1, 2, 3, 4, 5, 6}, dst = {1, 2, 3, 4, 5, 6}; - - DiffMatch src_match, dst_match; - - LCS lcs(src, dst); - size_t match_count = - lcs.Get([](int s, int d) { return s == d; }, &src_match, &dst_match); - - EXPECT_EQ(match_count, 6u); - EXPECT_EQ(src_match, DiffMatch(6, true)); - EXPECT_EQ(dst_match, DiffMatch(6, true)); -} - -TEST(LCSTest, SrcPrefix) { - Sequence src = {1, 2, 3, 4}, dst = {1, 2, 3, 4, 5, 6}; - - DiffMatch src_match, dst_match; - - LCS lcs(src, dst); - size_t match_count = - lcs.Get([](int s, int d) { return s == d; }, &src_match, &dst_match); - - const DiffMatch src_expect = {true, true, true, true}; - const DiffMatch dst_expect = {true, true, true, true, false, false}; - - EXPECT_EQ(match_count, 4u); - EXPECT_EQ(src_match, src_expect); - EXPECT_EQ(dst_match, dst_expect); -} - -TEST(LCSTest, DstPrefix) { - Sequence src = {1, 2, 3, 4, 5, 6}, dst = {1, 2, 3, 4, 5}; - - DiffMatch src_match, dst_match; - - LCS lcs(src, dst); - size_t match_count = - lcs.Get([](int s, int d) { return s == d; }, &src_match, &dst_match); - - const DiffMatch src_expect = {true, true, true, true, true, false}; - const DiffMatch dst_expect = {true, true, true, true, true}; - - EXPECT_EQ(match_count, 5u); - EXPECT_EQ(src_match, src_expect); - EXPECT_EQ(dst_match, dst_expect); -} - -TEST(LCSTest, SrcSuffix) { - Sequence src = {3, 4, 5, 6}, dst = {1, 2, 3, 4, 5, 6}; - - DiffMatch src_match, dst_match; - - LCS lcs(src, dst); - size_t match_count = - lcs.Get([](int s, int d) { return s == d; }, &src_match, &dst_match); - - const DiffMatch src_expect = {true, true, true, true}; - const DiffMatch dst_expect = {false, false, true, true, true, true}; - - EXPECT_EQ(match_count, 4u); - EXPECT_EQ(src_match, src_expect); - EXPECT_EQ(dst_match, dst_expect); -} - -TEST(LCSTest, DstSuffix) { - Sequence src = {1, 2, 3, 4, 5, 6}, dst = {5, 6}; - - DiffMatch src_match, dst_match; - - LCS lcs(src, dst); - size_t match_count = - lcs.Get([](int s, int d) { return s == d; }, &src_match, &dst_match); - - const DiffMatch src_expect = {false, false, false, false, true, true}; - const DiffMatch dst_expect = {true, true}; - - EXPECT_EQ(match_count, 2u); - EXPECT_EQ(src_match, src_expect); - EXPECT_EQ(dst_match, dst_expect); -} - -TEST(LCSTest, None) { - Sequence src = {1, 3, 5, 7, 9}, dst = {2, 4, 6, 8, 10, 12}; - - DiffMatch src_match, dst_match; - - LCS lcs(src, dst); - size_t match_count = - lcs.Get([](int s, int d) { return s == d; }, &src_match, &dst_match); - - EXPECT_EQ(match_count, 0u); - EXPECT_EQ(src_match, DiffMatch(5, false)); - EXPECT_EQ(dst_match, DiffMatch(6, false)); -} - -TEST(LCSTest, NonContiguous) { - Sequence src = {1, 2, 3, 4, 5, 6, 10}, dst = {2, 4, 5, 8, 9, 10, 12}; - - DiffMatch src_match, dst_match; - - LCS lcs(src, dst); - size_t match_count = - lcs.Get([](int s, int d) { return s == d; }, &src_match, &dst_match); - - const DiffMatch src_expect = {false, true, false, true, true, false, true}; - const DiffMatch dst_expect = {true, true, true, false, false, true, false}; - - EXPECT_EQ(match_count, 4u); - EXPECT_EQ(src_match, src_expect); - EXPECT_EQ(dst_match, dst_expect); -} - -TEST(LCSTest, WithDuplicates) { - Sequence src = {1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4}, - dst = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4}; - VerifyMatch(src, dst, 6); -} - -TEST(LCSTest, Large) { - const std::string src_str = - "GUJwrJSlkKJXxCVIAxlVgnUyOrdyRyFtlZwWMmFhYGfkFTNnhiBmClgHyrcXMVwfrRxNUfQk" - "qaoGvCbPZHAzXsaZpXHPfJxOMCUtRDmIQpfiXKbHQbhTfPqhxBDWvmTQAqwsWTLajZYtMUnf" - "hNNCfkuAXkZsaebwEbIZOxTDZsqSMUfCMoGeKJGVSNFgLTiBMbdvchHGfFRkHKcYCDjBfIcj" - "todPnvDjzQYWBcvIfVvyBzHikrwpDORaGEZLhmyztIFCLJOqeLhOzERYmVqzlsoUzruTXTXq" - "DLTxQRakOCMRrgRzCDTXfwwfDcKMBVnxRZemjcwcEsOVxwtwdBCWJycsDcZKlvrCvZaenKlv" - "vyByDQeLdxAyBnPkIMQlMQwqjUfRLybeoaOanlbFkpTPPZdHelQrIvucTHzMpWWQTbuANwvN" - "OVhCGGoIcGNDpfIsaBexlMMdHsxMGerTngmjpdPeQQJHfvKZkdYqAzrtDohqtDsaFMxQViVQ" - "YszDVgyoSHZdOXAvXkJidojLvGZOzhRajVPhWDwKuGqdaympELxHsrXAJYufdCPwJdGJfWqq" - "yvTWpcrFHOIuCEmNLnSCDsxQGRVDwyCykBJazhApfCnrOadnafvqfVuFqEXMSrYbHTfTnzbz" - "MhISyOtMUITaurCXvanCbuOXBhHyCjOhVbxnMvhlPmZBMQgEHCghtAJVMXGPNRtszVZlPxVl" - "QIPTBnPUPejlyZGPqeICyNngdQGkvKbIoWlTLBtVhMdBeUMozNlKQTIPYBeImVcMdLafuxUf" - "TIXysmcTrUTcspOSKBxhdhLwiRnREGFWJTfUKsgGOAQeYojXdrqsGjMJfiKalyoiqrgLnlij" - "CtOapoxDGVOOBalNYGzCtBlxbvaAzxipGnJpOEbmXcpeoIsAdxspKBzBDgoPVxnuRBUwmTSr" - "CRpWhxikgUYQVCwalLUIeBPRyhhsECGCXJmGDZSCIUaBwROkigzdeVPOXhgCGBEprWtNdYfL" - "tOUYJHQXxiIJgSGmWntezJFpNQoTPbRRYAGhtYvAechvBcYWocLkYFxsDAuszvQNLXdhmAHw" - "DErcjbtCdQllnKcDADVNWVezljjLrAuyGHetINMgAvJZwOEYakihYVUbZGCsHEufluLNyNHy" - "gqtSTSFFjBHiIqQejTPWybLdpWNwZrWvIWnlzUcGNQPEYHVPCbteWknjAnWrdTBeCbHUDBoK" - "aHvDStmpNRGIjvlumiZTbdZNAzUeSFnFChCsSExwXeEfDJfjyOoSBofHzJqJErvHLNyUJTjX" - "qmtgKPpMKohUPBMhtCteQFcNEpWrUVGbibMOpvBwdiWYXNissArpSasVJFgDzrqTyGkerTMX" - "gcrzFUGFZRhNdekaJeKYPogsofJaRsUQmIRyYdkrxKeMgLPpwOfSKJOqzXDoeHljTzhOwEVy" - "krOEnACFrWhufajsMitjOWdLOHHchQDddGPzxknEgdwmZepKDvRZGCuPqzeQkjOPqUBKpKLJ" - "eKieSsRXkaqxSPGajfvPKmwFWdLByEcLgvrmteazgFjmMGrLYqRRxzUOfOCokenqHVYstBHf" - "AwsWsqPTvqsRJUfGGTaYiylZMGbQqTzINhFHvdlRQvvYKBcuAHdBeKlHSxVrSsEKbcAvnIcf" - "xzdVDdwQPHMCHeZZRpGHWvKzgTGzSTbYTeOPyKvvYWmQToTpsjAtKUJUjcEHWhmdBLDTBMHJ" - "ivBXcLGtCsumNNVFyGbVviGmqHTdyBlkneibXBesKJGOUzOtIwXCPJggqBekSzNQYkALlItk" - "cbEhbdXAIKVHYpInLwxXalKZrkrpxtfuagqMGmRJnJbFQaEoYMoqPsxZpocddPXXPyvxVkaF" - "qdKISejWDhBImnEEOPDcyWTubbfVfwUztciaFJcsPLhgYVfhqlOfoNjKbmTFptFttYuyBrUI" - "zzmZypOqrjQHTGFwlHStpIwxPtMvtsEDpsmWIgwzYgwmdpbMOnfElZMYpVIcvzSWejeJcdUB" - "QUoBRUmGQVVWvEDseuozrDjgdXFScPwwsgaUPwSzScfBNrkpmEFDSZLKfNjMqvOmUtocUkbo" - "VGFEKgGLbNruwLgXHTloWDrnqymPVAtzjWPutonIsMDPeeCmTjYWAFXcyTAlBeiJTIRkZxiM" - "kLjMnAflSNJzmZkatXkYiPEMYSmzHbLKEizHbEjQOxBDzpRHiFjhedqiyMiUMvThjaRFmwll" - "aMGgwKBIKepwyoEdnuhtzJzboiNEAFKiqiWxxmkRFRoTiFWXLPAWLuzSCrajgkQhDxAQDqyM" - "VwZlhZicQLEDYYisEalesDWZAYzcvENuHUwRutIsGgsdoYwOZiURhcgdbTGWBNqhrFjvTQCj" - "VlTPNlRdRLaaqzUBBwbdtyXFkCBUYYMbmRrkFxfxbCqkgZNGyHPKLkOPnezfVTRmRQgCgHbx" - "wcZlInVOwmFePnSIbThMJosimzkhfuiqYEpwHQiemqsSDNNdbNhBLzbsPZBJZujSHJGtYKGb" - "HaAYGJZxBumsKUrATwPuqXFLfwNyImLQbchBKiJAYRZhkcrKCHXBEGYyBhBGvSqvabcRUrfq" - "AbPiMzjHAehGYjDEmxAnYLyoSFdeWVrfJUCuYZPluhXEBuyUpKaRXDKXeiCvGidpvATwMbcz" - "DZpzxrhTZYyrFORFQWTbPLCBjMKMhlRMFEiarDgGPttjmkrQVlujztMSkxXffXFNqLWOLThI" - "KBoyMHoFTEPCdUAZjLTifAdjjUehyDLEGKlRTFoLpjalziRSUjZfRYbNzhiHgTHowMMkKTwE" - "ZgnqiirMtnNpaBJqhcIVrWXPpcPWZfRpsPstHleFJDZYAsxYhOREVbFtebXTZRAIjGgWeoiN" - "qPLCCAVadqmUrjOcqIbdCTpcDRWuDVbHrZOQRPhqbyvOWwxAWJphjLiDgoAybcjzgfVktPlj" - "kNBCjelpuQfnYsiTgPpCNKYtOrxGaLEEtAuLdGdDsONHNhSn"; - const std::string dst_str = - "KzitfifORCbGhfNEbnbObUdFLLaAsLOpMkOeKupjCoatzqfHBkNJfSgqSMYouswfNMnoQngK" - "jWwyPKmEnoZWyPBUdQRmKUNudUclueKXKQefUdXWUyyqtumzsFKznrLVLwfvPZpLChNYrrHK" - "AtpfOuVHiUKyeRCrktJAhkyFKmPWrASEMvBLNOzuGlvinZjvZUUXazNEkyMPiOLdqXvCIroC" - "MeWsvjHShlLhDwLZrVlpYBnDJmILcsNFDSoaLWOKNNkNGBgNBvVjPCJXAuKfsrKZhYcdEpxK" - "UihiRkYvMiLyOUvaqBMklLDwEhvQBfCXHSRoqsLsSCzLZQhIYMhBapvHaPbDoRrHoJXZsNXc" - "rxZYCrOMIzYcVPwDCFiHBFnPNTTeAeKEMGeVUeCaAeuWZmngyPWlQBcgWumSUIfbhjVYdnpV" - "hRSJXrIoFZubBXfNOMhilAkVPixrhILZKgDoFTvytPFPfBLMnbhSOBmLWCbJsLQxrCrMAlOw" - "RmfSQyGhrjhzYVqFSBHeoQBagFwyxIjcHFZngntpVHbSwqhwHeMnWSsISPljTxSNXfCxLebW" - "GhMdlphtJbdvhEcjNpwPCFqhdquxCyOxkjsDUPNgjpDcpIMhMwMclNhfESTrroJaoyeGQclV" - "gonnhuQRmXcBwcsWeLqjNngZOlyMyfeQBwnwMVJEvGqknDyzSApniRTPgJpFoDkJJhXQFuFB" - "VqhuEPMRGCeTDOSEFmXeIHOnDxaJacvnmORwVpmrRhGjDpUCkuODNPdZMdupYExDEDnDLdNF" - "iObKBaVWpGVMKdgNLgsNxcpypBPPKKoaajeSGPZQJWSOKrkLjiFexYVmUGxJnbTNsCXXLfZp" - "jfxQAEVYvqKehBzMsVHVGWmTshWFAoCNDkNppzzjHBZWckrzSTANICioCJSpLwPwQvtXVxst" - "nTRBAboPFREEUFazibpFesCsjzUOnECwoPCOFiwGORlIZVLpUkJyhYXCENmzTBLVigOFuCWO" - "IiXBYmiMtsxnUdoqSTTGyEFFrQsNAjcDdOKDtHwlANWoUVwiJCMCQFILdGqzEePuSXFbOEOz" - "dLlEnTJbKRSTfAFToOZNtDXTfFgvQiefAKbSUWUXFcpCjRYCBNXCCcLMjjuUDXErpiNsRuIx" - "mgHsrObTEXcnmjdqxTGhTjTeYizNnkrJRhNQIqDXmZMwArBccnixpcuiGOOexjgkpcEyGAnz" - "UbgiBfflTUyJfZeFFLrZVueFkSRosebnnwAnakIrywTGByhQKWvmNQJsWQezqLhHQzXnEpeD" - "rFRTSQSpVxPzSeEzfWYzfpcenxsUyzOMLxhNEhfcuprDtqubsXehuqKqZlLQeSclvoGjuKJK" - "XoWrazsgjXXnkWHdqFESZdMGDYldyYdbpSZcgBPgEKLWZHfBirNPLUadmajYkiEzmGuWGELB" - "WLiSrMdaGSbptKmgYVqMGcQaaATStiZYteGAPxSEBHuAzzjlRHYsrdDkaGNXmzRGoalJMiCC" - "GMtWSDMhgvRSEgKnywbRgnqWXFlwrhXbbvcgLGtWSuKQBiqIlWkfPMozOTWgVoLHavDJGRYI" - "YerrmZnTMtuuxmZALWakfzUbksTwoetqkOiRPGqGZepcVXHoZyOaaaijjZWQLlIhYwiQNbfc" - "KCwhhFaMQBoaCnOecJEdKzdsMPFEYQuJNPYiiNtsYxaWBRuWjlLqGokHMNtyTQfSJKbgGdol" - "fWlOZdupouQMfUWXIYHzyJHefMDnqxxasDxtgArvDqtwjDBaVEMACPkLFpiDOoKCHqkWVizh" - "lKqbOHpsPKkhjRQRNGYRYEfxtBjYvlCvHBNUwVuIwDJYMqHxEFtwdLqYWvjdOfQmNiviDfUq" - "pbucbNwjNQfMYgwUuPnQWIPOlqHcbjtuDXvTzLtkdBQanJbrmLSyFqSapZCSPMDOrxWVYzyO" - "lwDTTJFmKxoyfPunadkHcrcSQaQsAbrQtbhqwSTXGTPURYTCbNozjAVwbmcyVxIbZudBZWYm" - "rnSDyelGCRRWYtrUxvOVWlTLHHdYuAmVMGnGbHscbjmjmAzmYLaCxNNwhmMYdExKvySxuYpE" - "rVGwfqMngBCHnZodotNaNJZiNRFWubuPDfiywXPiyVWoQMeOlSuWmpilLTIFOvfpjmJTgrWa" - "dgoxYeyPyOaglOvZVGdFOBSeqEcGXBwjoeUAXqkpvOxEpSXhmklKZydTvRVYVvfQdRNNDkCT" - "dLNfcZCFQbZORdcDOhwotoyccrSbWvlqYMoiAYeEpDzZTvkamapzZMmCpEutZFCcHBWGIIkr" - "urwDNHrobaErPpclyEegLJDtkfUWSNWZosWSbBGAHIvJsFNUlJXbnkSVycLkOVQVcNcUtiBy" - "djLDIFsycbPBEWaMvCbntNtJlOeCttvXypGnHAQFnFSiXFWWqonWuVIKmVPpKXuJtFguXCWC" - "rNExYYvxLGEmuZJLJDjHgjlQyOzeieCpizJxkrdqKCgomyEkvsyVYSsLeyLvOZQrrgEJgRFK" - "CjYtoOfluNrLdRMTRkQXmAiMRFwloYECpXCReAMxOkNiwCtutsrqWoMHsrogRqPoUCueonvW" - "MTwmkAkajfGJkhnQidwpwIMEttQkzIMOPvvyWZHpqkMHWlNTeSKibfRfwDyxveKENZhtlPwP" - "dfAjwegjRcavtFnkkTNVYdCdCrgdUvzsIcqmUjwGmVvuuQvjVrWWIDBmAzQtiZPYvCOEWjce" - "rWzeqVKeiYTJBOedmQCVidOgUIEjfRnbGvUbctYxfRybJkdmeAkLZQMRMGPOnsPbFswXAoCK" - "IxWGwohoPpEJxslbqHFKSwknxTmrDCITRZWEDkGQeucPxHBdYkduwbYhKnoxCKhgjBFiFawC" - "QtgTDldTQmlOsBiGLquMjuecAbrUJJvNtXbFNGjWxaZPimSRXUJWgRbydpsczOqSFIeEtuKA" - "ZpRhmLtPdVNKdSDQZeeImUFmUwXApRTUNHItyvFyJtNtn"; - - Sequence src; - Sequence dst; - - src.reserve(src_str.length()); - dst.reserve(dst_str.length()); - - for (char c : src_str) { - src.push_back(c); - } - for (char c : dst_str) { - dst.push_back(c); - } - - VerifyMatch(src, dst, 723); -} - -} // namespace -} // namespace diff -} // namespace spvtools diff --git a/test/fuzz/CMakeLists.txt b/test/fuzz/CMakeLists.txt index 56af0b9d..56fbed81 100644 --- a/test/fuzz/CMakeLists.txt +++ b/test/fuzz/CMakeLists.txt @@ -31,7 +31,6 @@ if (${SPIRV_BUILD_FUZZER}) fuzzer_pass_construct_composites_test.cpp fuzzer_pass_donate_modules_test.cpp fuzzer_pass_outline_functions_test.cpp - fuzzerutil_test.cpp instruction_descriptor_test.cpp fuzzer_pass_test.cpp replayer_test.cpp @@ -115,14 +114,11 @@ if (${SPIRV_BUILD_FUZZER}) transformation_store_test.cpp transformation_swap_commutable_operands_test.cpp transformation_swap_conditional_branch_operands_test.cpp - transformation_swap_function_variables_test.cpp - transformation_swap_two_functions_test.cpp transformation_toggle_access_chain_instruction_test.cpp transformation_record_synonymous_constants_test.cpp transformation_vector_shuffle_test.cpp transformation_wrap_early_terminator_in_function_test.cpp transformation_wrap_region_in_selection_test.cpp - transformation_wrap_vector_synonym_test.cpp uniform_buffer_element_descriptor_test.cpp) if (${SPIRV_ENABLE_LONG_FUZZER_TESTS}) diff --git a/test/fuzz/fuzz_test_util.cpp b/test/fuzz/fuzz_test_util.cpp index bf0a4ff5..28d3f892 100644 --- a/test/fuzz/fuzz_test_util.cpp +++ b/test/fuzz/fuzz_test_util.cpp @@ -160,19 +160,13 @@ void ApplyAndCheckFreshIds( const Transformation& transformation, opt::IRContext* ir_context, TransformationContext* transformation_context, const std::unordered_set& issued_overflow_ids) { - // To ensure that we cover all ToMessage and message-based constructor methods - // in our tests, we turn this into a message and back into a transformation, - // and use the reconstructed transformation in the rest of the function. - auto message = transformation.ToMessage(); - auto reconstructed_transformation = Transformation::FromMessage(message); - opt::analysis::DefUseManager::IdToDefMap before_transformation = ir_context->get_def_use_mgr()->id_to_defs(); - reconstructed_transformation->Apply(ir_context, transformation_context); + transformation.Apply(ir_context, transformation_context); opt::analysis::DefUseManager::IdToDefMap after_transformation = ir_context->get_def_use_mgr()->id_to_defs(); std::unordered_set fresh_ids_for_transformation = - reconstructed_transformation->GetFreshIds(); + transformation.GetFreshIds(); for (auto& entry : after_transformation) { uint32_t id = entry.first; bool introduced_by_transformation_message = diff --git a/test/fuzz/fuzzer_pass_add_opphi_synonyms_test.cpp b/test/fuzz/fuzzer_pass_add_opphi_synonyms_test.cpp index 1045f8a1..734f47af 100644 --- a/test/fuzz/fuzzer_pass_add_opphi_synonyms_test.cpp +++ b/test/fuzz/fuzzer_pass_add_opphi_synonyms_test.cpp @@ -134,7 +134,7 @@ TEST(FuzzerPassAddOpPhiSynonymsTest, HelperFunctions) { FuzzerPassAddOpPhiSynonyms fuzzer_pass(context.get(), &transformation_context, &fuzzer_context, - &transformation_sequence, false); + &transformation_sequence); SetUpIdSynonyms(transformation_context.GetFactManager()); diff --git a/test/fuzz/fuzzer_pass_construct_composites_test.cpp b/test/fuzz/fuzzer_pass_construct_composites_test.cpp index a858e4ce..a02176b2 100644 --- a/test/fuzz/fuzzer_pass_construct_composites_test.cpp +++ b/test/fuzz/fuzzer_pass_construct_composites_test.cpp @@ -92,7 +92,7 @@ TEST(FuzzerPassConstructCompositesTest, IsomorphicStructs) { FuzzerPassConstructComposites fuzzer_pass( context.get(), &transformation_context, &fuzzer_context, - &transformation_sequence, false); + &transformation_sequence); fuzzer_pass.Apply(); @@ -173,7 +173,7 @@ TEST(FuzzerPassConstructCompositesTest, IsomorphicArrays) { FuzzerPassConstructComposites fuzzer_pass( context.get(), &transformation_context, &fuzzer_context, - &transformation_sequence, false); + &transformation_sequence); fuzzer_pass.Apply(); diff --git a/test/fuzz/fuzzer_pass_donate_modules_test.cpp b/test/fuzz/fuzzer_pass_donate_modules_test.cpp index fe8e671d..f11885d4 100644 --- a/test/fuzz/fuzzer_pass_donate_modules_test.cpp +++ b/test/fuzz/fuzzer_pass_donate_modules_test.cpp @@ -210,7 +210,7 @@ TEST(FuzzerPassDonateModulesTest, BasicDonation) { FuzzerPassDonateModules fuzzer_pass(recipient_context.get(), &transformation_context, &fuzzer_context, - &transformation_sequence, false, {}); + &transformation_sequence, {}); fuzzer_pass.DonateSingleModule(donor_context.get(), false); @@ -291,7 +291,7 @@ TEST(FuzzerPassDonateModulesTest, DonationWithUniforms) { FuzzerPassDonateModules fuzzer_pass(recipient_context.get(), &transformation_context, &fuzzer_context, - &transformation_sequence, false, {}); + &transformation_sequence, {}); fuzzer_pass.DonateSingleModule(donor_context.get(), false); @@ -422,7 +422,7 @@ TEST(FuzzerPassDonateModulesTest, DonationWithInputAndOutputVariables) { FuzzerPassDonateModules fuzzer_pass(recipient_context.get(), &transformation_context, &fuzzer_context, - &transformation_sequence, false, {}); + &transformation_sequence, {}); fuzzer_pass.DonateSingleModule(donor_context.get(), false); @@ -517,7 +517,7 @@ TEST(FuzzerPassDonateModulesTest, DonateFunctionTypeWithDifferentPointers) { FuzzerPassDonateModules fuzzer_pass(recipient_context.get(), &transformation_context, &fuzzer_context, - &transformation_sequence, false, {}); + &transformation_sequence, {}); fuzzer_pass.DonateSingleModule(donor_context.get(), false); @@ -531,7 +531,6 @@ TEST(FuzzerPassDonateModulesTest, DonateOpConstantNull) { std::string recipient_shader = R"( OpCapability Shader OpCapability ImageQuery - OpCapability VariablePointers %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %4 "main" @@ -549,7 +548,6 @@ TEST(FuzzerPassDonateModulesTest, DonateOpConstantNull) { std::string donor_shader = R"( OpCapability Shader OpCapability ImageQuery - OpCapability VariablePointers %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %4 "main" @@ -589,7 +587,7 @@ TEST(FuzzerPassDonateModulesTest, DonateOpConstantNull) { FuzzerPassDonateModules fuzzer_pass(recipient_context.get(), &transformation_context, &fuzzer_context, - &transformation_sequence, false, {}); + &transformation_sequence, {}); fuzzer_pass.DonateSingleModule(donor_context.get(), false); @@ -717,7 +715,7 @@ TEST(FuzzerPassDonateModulesTest, DonateCodeThatUsesImages) { FuzzerPassDonateModules fuzzer_pass(recipient_context.get(), &transformation_context, &fuzzer_context, - &transformation_sequence, false, {}); + &transformation_sequence, {}); fuzzer_pass.DonateSingleModule(donor_context.get(), false); @@ -813,7 +811,7 @@ TEST(FuzzerPassDonateModulesTest, DonateCodeThatUsesSampler) { FuzzerPassDonateModules fuzzer_pass(recipient_context.get(), &transformation_context, &fuzzer_context, - &transformation_sequence, false, {}); + &transformation_sequence, {}); fuzzer_pass.DonateSingleModule(donor_context.get(), false); @@ -945,7 +943,7 @@ TEST(FuzzerPassDonateModulesTest, DonateCodeThatUsesImageStructField) { FuzzerPassDonateModules fuzzer_pass(recipient_context.get(), &transformation_context, &fuzzer_context, - &transformation_sequence, false, {}); + &transformation_sequence, {}); fuzzer_pass.DonateSingleModule(donor_context.get(), false); @@ -1081,7 +1079,7 @@ TEST(FuzzerPassDonateModulesTest, DonateCodeThatUsesImageFunctionParameter) { FuzzerPassDonateModules fuzzer_pass(recipient_context.get(), &transformation_context, &fuzzer_context, - &transformation_sequence, false, {}); + &transformation_sequence, {}); fuzzer_pass.DonateSingleModule(donor_context.get(), false); @@ -1163,7 +1161,7 @@ TEST(FuzzerPassDonateModulesTest, DonateShaderWithImageStorageClass) { FuzzerPassDonateModules fuzzer_pass(recipient_context.get(), &transformation_context, &fuzzer_context, - &transformation_sequence, false, {}); + &transformation_sequence, {}); fuzzer_pass.DonateSingleModule(donor_context.get(), true); @@ -1250,7 +1248,7 @@ TEST(FuzzerPassDonateModulesTest, DonateComputeShaderWithRuntimeArray) { FuzzerPassDonateModules fuzzer_pass(recipient_context.get(), &transformation_context, &fuzzer_context, - &transformation_sequence, false, {}); + &transformation_sequence, {}); fuzzer_pass.DonateSingleModule(donor_context.get(), false); @@ -1354,7 +1352,7 @@ TEST(FuzzerPassDonateModulesTest, DonateComputeShaderWithRuntimeArrayLivesafe) { FuzzerPassDonateModules fuzzer_pass(recipient_context.get(), &transformation_context, &fuzzer_context, - &transformation_sequence, false, {}); + &transformation_sequence, {}); fuzzer_pass.DonateSingleModule(donor_context.get(), true); @@ -1426,7 +1424,7 @@ TEST(FuzzerPassDonateModulesTest, DonateComputeShaderWithWorkgroupVariables) { FuzzerPassDonateModules fuzzer_pass(recipient_context.get(), &transformation_context, &fuzzer_context, - &transformation_sequence, false, {}); + &transformation_sequence, {}); fuzzer_pass.DonateSingleModule(donor_context.get(), true); @@ -1536,7 +1534,7 @@ TEST(FuzzerPassDonateModulesTest, DonateComputeShaderWithAtomics) { FuzzerPassDonateModules fuzzer_pass(recipient_context.get(), &transformation_context, &fuzzer_context, - &transformation_sequence, false, {}); + &transformation_sequence, {}); fuzzer_pass.DonateSingleModule(donor_context.get(), true); @@ -1720,7 +1718,7 @@ TEST(FuzzerPassDonateModulesTest, Miscellaneous1) { FuzzerPassDonateModules fuzzer_pass(recipient_context.get(), &transformation_context, &fuzzer_context, - &transformation_sequence, false, {}); + &transformation_sequence, {}); fuzzer_pass.DonateSingleModule(donor_context.get(), false); @@ -1792,7 +1790,7 @@ TEST(FuzzerPassDonateModulesTest, OpSpecConstantInstructions) { FuzzerPassDonateModules fuzzer_pass(recipient_context.get(), &transformation_context, &fuzzer_context, - &transformation_sequence, false, {}); + &transformation_sequence, {}); fuzzer_pass.DonateSingleModule(donor_context.get(), false); @@ -1949,7 +1947,7 @@ TEST(FuzzerPassDonateModulesTest, DonationSupportsOpTypeRuntimeArray) { FuzzerPassDonateModules fuzzer_pass(recipient_context.get(), &transformation_context, &fuzzer_context, - &transformation_sequence, false, {}); + &transformation_sequence, {}); fuzzer_pass.DonateSingleModule(donor_context.get(), false); @@ -2022,7 +2020,7 @@ TEST(FuzzerPassDonateModulesTest, HandlesCapabilities) { FuzzerPassDonateModules fuzzer_pass(recipient_context.get(), &transformation_context, &fuzzer_context, - &transformation_sequence, false, {}); + &transformation_sequence, {}); ASSERT_TRUE(donor_context->get_feature_mgr()->HasCapability( SpvCapabilityVariablePointersStorageBuffer)); @@ -2255,7 +2253,7 @@ TEST(FuzzerPassDonateModulesTest, HandlesOpPhisInMergeBlock) { FuzzerPassDonateModules fuzzer_pass(recipient_context.get(), &transformation_context, &fuzzer_context, - &transformation_sequence, false, {}); + &transformation_sequence, {}); fuzzer_pass.DonateSingleModule(donor_context.get(), true); diff --git a/test/fuzz/fuzzer_pass_outline_functions_test.cpp b/test/fuzz/fuzzer_pass_outline_functions_test.cpp index a088e17b..0d2c5bf7 100644 --- a/test/fuzz/fuzzer_pass_outline_functions_test.cpp +++ b/test/fuzz/fuzzer_pass_outline_functions_test.cpp @@ -130,7 +130,7 @@ TEST(FuzzerPassOutlineFunctionsTest, EntryIsAlreadySuitable) { FuzzerPassOutlineFunctions fuzzer_pass(context.get(), &transformation_context, &fuzzer_context, - &transformation_sequence, false); + &transformation_sequence); // Block 28 auto suitable_entry_block = @@ -173,7 +173,7 @@ TEST(FuzzerPassOutlineFunctionsTest, EntryHasOpVariable) { FuzzerPassOutlineFunctions fuzzer_pass(context.get(), &transformation_context, &fuzzer_context, - &transformation_sequence, false); + &transformation_sequence); // Block 20 auto suitable_entry_block = @@ -297,7 +297,7 @@ TEST(FuzzerPassOutlineFunctionsTest, EntryBlockIsHeader) { FuzzerPassOutlineFunctions fuzzer_pass(context.get(), &transformation_context, &fuzzer_context, - &transformation_sequence, false); + &transformation_sequence); // Block 21 auto suitable_entry_block = @@ -464,7 +464,7 @@ TEST(FuzzerPassOutlineFunctionsTest, ExitBlock) { FuzzerPassOutlineFunctions fuzzer_pass(context.get(), &transformation_context, &fuzzer_context, - &transformation_sequence, false); + &transformation_sequence); // Block 39 is not a merge block, so it is already suitable. auto suitable_exit_block = fuzzer_pass.MaybeGetExitBlockSuitableForOutlining( diff --git a/test/fuzz/fuzzer_pass_test.cpp b/test/fuzz/fuzzer_pass_test.cpp index 31b8582a..b035de74 100644 --- a/test/fuzz/fuzzer_pass_test.cpp +++ b/test/fuzz/fuzzer_pass_test.cpp @@ -29,7 +29,7 @@ class FuzzerPassMock : public FuzzerPass { FuzzerContext* fuzzer_context, protobufs::TransformationSequence* transformations) : FuzzerPass(ir_context, transformation_context, fuzzer_context, - transformations, false) {} + transformations) {} ~FuzzerPassMock() override = default; diff --git a/test/fuzz/fuzzer_replayer_test.cpp b/test/fuzz/fuzzer_replayer_test.cpp index 2a22e6a5..6dc7ffb1 100644 --- a/test/fuzz/fuzzer_replayer_test.cpp +++ b/test/fuzz/fuzzer_replayer_test.cpp @@ -1596,23 +1596,6 @@ const std::string kTestShader6 = R"( OpFunctionEnd )"; -// A virtually empty piece of SPIR-V. - -const std::string kTestShader7 = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 320 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %4 = OpFunction %2 None %3 - %5 = OpLabel - OpReturn - OpFunctionEnd - )"; - void AddConstantUniformFact(protobufs::FactSequence* facts, uint32_t descriptor_set, uint32_t binding, std::vector&& indices, uint32_t value) { @@ -1685,7 +1668,7 @@ void RunFuzzerAndReplayer(const std::string& shader, Fuzzer fuzzer(std::move(ir_context), std::move(transformation_context), std::move(fuzzer_context), kConsoleMessageConsumer, donor_suppliers, enable_all_passes, - strategies[strategy_index], true, validator_options, false); + strategies[strategy_index], true, validator_options); auto fuzzer_result = fuzzer.Run(0); // Cycle the repeated pass strategy so that we try a different one next time @@ -1777,13 +1760,6 @@ TEST(FuzzerReplayerTest, Miscellaneous6) { kNumFuzzerRuns); } -TEST(FuzzerReplayerTest, Miscellaneous7) { - // Do some fuzzer runs, starting from an initial seed of 1 (seed value chosen - // arbitrarily). - RunFuzzerAndReplayer(kTestShader7, protobufs::FactSequence(), 1, - kNumFuzzerRuns); -} - } // namespace } // namespace fuzz } // namespace spvtools diff --git a/test/fuzz/fuzzer_shrinker_test.cpp b/test/fuzz/fuzzer_shrinker_test.cpp index acee03c7..e7921169 100644 --- a/test/fuzz/fuzzer_shrinker_test.cpp +++ b/test/fuzz/fuzzer_shrinker_test.cpp @@ -1068,7 +1068,7 @@ void RunFuzzerAndShrinker(const std::string& shader, Fuzzer fuzzer(std::move(ir_context), std::move(transformation_context), std::move(fuzzer_context), kConsoleMessageConsumer, donor_suppliers, enable_all_passes, repeated_pass_strategy, - true, validator_options, false); + true, validator_options); auto fuzzer_result = fuzzer.Run(0); ASSERT_NE(Fuzzer::Status::kFuzzerPassLedToInvalidModule, fuzzer_result.status); diff --git a/test/fuzz/fuzzerutil_test.cpp b/test/fuzz/fuzzerutil_test.cpp deleted file mode 100644 index 6771c404..00000000 --- a/test/fuzz/fuzzerutil_test.cpp +++ /dev/null @@ -1,1554 +0,0 @@ -// Copyright (c) 2021 Shiyu Liu -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "gtest/gtest.h" -#include "source/fuzz/fuzzer_util.h" -#include "test/fuzz/fuzz_test_util.h" - -namespace spvtools { -namespace fuzz { -namespace { - -TEST(FuzzerUtilMaybeFindBlockTest, BasicTest) { - std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpDecorate %8 RelaxedPrecision - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %7 = OpTypePointer Function %6 - %9 = OpConstant %6 1 - %10 = OpConstant %6 2 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %8 = OpVariable %7 Function - OpBranch %11 - %11 = OpLabel - OpStore %8 %9 - OpBranch %12 - %12 = OpLabel - OpStore %8 %10 - OpReturn - OpFunctionEnd - )"; - - const auto env = SPV_ENV_UNIVERSAL_1_4; - const auto consumer = nullptr; - const std::unique_ptr context = - BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - - // Only blocks with id 11 and 12 can be found. - // Should return nullptr when id is not a label or id was not found. - uint32_t block_id1 = 11; - uint32_t block_id2 = 12; - uint32_t block_id3 = 13; - uint32_t block_id4 = 8; - - opt::IRContext* ir_context = context.get(); - // Block with id 11 should be found. - ASSERT_TRUE(fuzzerutil::MaybeFindBlock(ir_context, block_id1) != nullptr); - // Block with id 12 should be found. - ASSERT_TRUE(fuzzerutil::MaybeFindBlock(ir_context, block_id2) != nullptr); - // Block with id 13 cannot be found. - ASSERT_FALSE(fuzzerutil::MaybeFindBlock(ir_context, block_id3) != nullptr); - // Block with id 8 exisits but don't not of type OpLabel. - ASSERT_FALSE(fuzzerutil::MaybeFindBlock(ir_context, block_id4) != nullptr); -} - -TEST(FuzzerutilTest, FuzzerUtilMaybeGetBoolConstantTest) { - std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %36 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %8 "b1" - OpName %10 "b2" - OpName %12 "b3" - OpName %13 "b4" - OpName %16 "f1" - OpName %18 "f2" - OpName %20 "cf1" - OpName %22 "cf2" - OpName %26 "i1" - OpName %28 "i2" - OpName %30 "ci1" - OpName %32 "ci2" - OpName %36 "value" - OpDecorate %26 RelaxedPrecision - OpDecorate %28 RelaxedPrecision - OpDecorate %30 RelaxedPrecision - OpDecorate %32 RelaxedPrecision - OpDecorate %36 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeBool - %7 = OpTypePointer Function %6 - %9 = OpConstantTrue %6 - %11 = OpConstantFalse %6 - %14 = OpTypeFloat 32 - %15 = OpTypePointer Function %14 - %17 = OpConstant %14 1.23000002 - %19 = OpConstant %14 1.11000001 - %21 = OpConstant %14 2 - %23 = OpConstant %14 3.29999995 - %24 = OpTypeInt 32 1 - %25 = OpTypePointer Function %24 - %27 = OpConstant %24 1 - %29 = OpConstant %24 100 - %31 = OpConstant %24 123 - %33 = OpConstant %24 1111 - %35 = OpTypePointer Input %14 - %36 = OpVariable %35 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %8 = OpVariable %7 Function - %10 = OpVariable %7 Function - %12 = OpVariable %7 Function - %13 = OpVariable %7 Function - %16 = OpVariable %15 Function - %18 = OpVariable %15 Function - %20 = OpVariable %15 Function - %22 = OpVariable %15 Function - %26 = OpVariable %25 Function - %28 = OpVariable %25 Function - %30 = OpVariable %25 Function - %32 = OpVariable %25 Function - OpStore %8 %9 - OpStore %10 %11 - OpStore %12 %9 - OpStore %13 %11 - OpStore %16 %17 - OpStore %18 %19 - OpStore %20 %21 - OpStore %22 %23 - OpStore %26 %27 - OpStore %28 %29 - OpStore %30 %31 - OpStore %32 %33 - OpReturn - OpFunctionEnd - )"; - - const auto env = SPV_ENV_UNIVERSAL_1_4; - const auto consumer = nullptr; - const std::unique_ptr context = - BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - TransformationContext transformation_context( - MakeUnique(context.get()), validator_options); - - opt::IRContext* ir_context = context.get(); - // A bool constant with value false exists and the id is 11. - ASSERT_EQ(11, fuzzerutil::MaybeGetBoolConstant( - ir_context, transformation_context, false, false)); - // A bool constant with value true exists and the id is 9. - ASSERT_EQ(9, fuzzerutil::MaybeGetBoolConstant( - ir_context, transformation_context, true, false)); -} - -TEST(FuzzerutilTest, FuzzerUtilMaybeGetBoolTypeTest) { - std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %92 %52 %53 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpDecorate %92 BuiltIn FragCoord - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %7 = OpTypeFloat 32 - %8 = OpTypeStruct %6 %7 - %9 = OpTypePointer Function %8 - %10 = OpTypeFunction %6 %9 - %14 = OpConstant %6 0 - %15 = OpTypePointer Function %6 - %51 = OpTypePointer Private %6 - %21 = OpConstant %6 2 - %23 = OpConstant %6 1 - %24 = OpConstant %7 1 - %25 = OpTypePointer Function %7 - %50 = OpTypePointer Private %7 - %34 = OpTypeBool - %35 = OpConstantFalse %34 - %52 = OpVariable %50 Private - %53 = OpVariable %51 Private - %80 = OpConstantComposite %8 %21 %24 - %90 = OpTypeVector %7 4 - %91 = OpTypePointer Input %90 - %92 = OpVariable %91 Input - %93 = OpConstantComposite %90 %24 %24 %24 %24 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %20 = OpVariable %9 Function - %27 = OpVariable %9 Function - %22 = OpAccessChain %15 %20 %14 - %44 = OpCopyObject %9 %20 - %26 = OpAccessChain %25 %20 %23 - %29 = OpFunctionCall %6 %12 %27 - %30 = OpAccessChain %15 %20 %14 - %45 = OpCopyObject %15 %30 - %81 = OpCopyObject %9 %27 - %33 = OpAccessChain %15 %20 %14 - OpSelectionMerge %37 None - OpBranchConditional %35 %36 %37 - %36 = OpLabel - %38 = OpAccessChain %15 %20 %14 - %40 = OpAccessChain %15 %20 %14 - %43 = OpAccessChain %15 %20 %14 - %82 = OpCopyObject %9 %27 - OpBranch %37 - %37 = OpLabel - OpReturn - OpFunctionEnd - %12 = OpFunction %6 None %10 - %11 = OpFunctionParameter %9 - %13 = OpLabel - %46 = OpCopyObject %9 %11 - %16 = OpAccessChain %15 %11 %14 - %95 = OpCopyObject %8 %80 - OpReturnValue %21 - %100 = OpLabel - OpUnreachable - OpFunctionEnd - )"; - - const auto env = SPV_ENV_UNIVERSAL_1_4; - const auto consumer = nullptr; - const std::unique_ptr context = - BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - - opt::IRContext* ir_context = context.get(); - // A bool type with result id of 34 exists. - ASSERT_TRUE(fuzzerutil::MaybeGetBoolType(ir_context)); -} - -TEST(FuzzerutilTest, FuzzerUtilMaybeGetCompositeConstantTest) { - std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %54 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %8 "b1" - OpName %10 "b2" - OpName %12 "b3" - OpName %13 "b4" - OpName %16 "f1" - OpName %18 "f2" - OpName %22 "zc" - OpName %24 "i1" - OpName %28 "i2" - OpName %30 "i3" - OpName %32 "i4" - OpName %37 "f_arr" - OpName %47 "i_arr" - OpName %54 "value" - OpDecorate %22 RelaxedPrecision - OpDecorate %24 RelaxedPrecision - OpDecorate %28 RelaxedPrecision - OpDecorate %30 RelaxedPrecision - OpDecorate %32 RelaxedPrecision - OpDecorate %47 RelaxedPrecision - OpDecorate %54 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeBool - %7 = OpTypePointer Function %6 - %9 = OpConstantTrue %6 - %11 = OpConstantFalse %6 - %14 = OpTypeFloat 32 - %15 = OpTypePointer Function %14 - %17 = OpConstant %14 1.23000002 - %19 = OpConstant %14 1.11000001 - %20 = OpTypeInt 32 1 - %21 = OpTypePointer Function %20 - %23 = OpConstant %20 0 - %25 = OpConstant %20 1 - %26 = OpTypeInt 32 0 - %27 = OpTypePointer Function %26 - %29 = OpConstant %26 100 - %31 = OpConstant %20 -1 - %33 = OpConstant %20 -99 - %34 = OpConstant %26 5 - %35 = OpTypeArray %14 %34 - %36 = OpTypePointer Function %35 - %38 = OpConstant %14 5.5 - %39 = OpConstant %14 4.4000001 - %40 = OpConstant %14 3.29999995 - %41 = OpConstant %14 2.20000005 - %42 = OpConstant %14 1.10000002 - %43 = OpConstantComposite %35 %38 %39 %40 %41 %42 - %44 = OpConstant %26 3 - %45 = OpTypeArray %20 %44 - %46 = OpTypePointer Function %45 - %48 = OpConstant %20 3 - %49 = OpConstant %20 7 - %50 = OpConstant %20 9 - %51 = OpConstantComposite %45 %48 %49 %50 - %53 = OpTypePointer Input %14 - %54 = OpVariable %53 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %8 = OpVariable %7 Function - %10 = OpVariable %7 Function - %12 = OpVariable %7 Function - %13 = OpVariable %7 Function - %16 = OpVariable %15 Function - %18 = OpVariable %15 Function - %22 = OpVariable %21 Function - %24 = OpVariable %21 Function - %28 = OpVariable %27 Function - %30 = OpVariable %21 Function - %32 = OpVariable %21 Function - %37 = OpVariable %36 Function - %47 = OpVariable %46 Function - OpStore %8 %9 - OpStore %10 %11 - OpStore %12 %9 - OpStore %13 %11 - OpStore %16 %17 - OpStore %18 %19 - OpStore %22 %23 - OpStore %24 %25 - OpStore %28 %29 - OpStore %30 %31 - OpStore %32 %33 - OpStore %37 %43 - OpStore %47 %51 - OpReturn - OpFunctionEnd - )"; - - const auto env = SPV_ENV_UNIVERSAL_1_4; - const auto consumer = nullptr; - const std::unique_ptr context = - BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - TransformationContext transformation_context( - MakeUnique(context.get()), validator_options); - - opt::IRContext* ir_context = context.get(); - - // %43 = OpConstantComposite %35 %38 %39 %40 %41 %42 - // %51 = OpConstantComposite %45 %48 %49 %50 - // This should pass as a float array with 5 elements exist and its id is 43. - ASSERT_EQ(43, fuzzerutil::MaybeGetCompositeConstant( - ir_context, transformation_context, {38, 39, 40, 41, 42}, - 35, false)); - // This should pass as an int array with 3 elements exist and its id is 51. - ASSERT_EQ(51, - fuzzerutil::MaybeGetCompositeConstant( - ir_context, transformation_context, {48, 49, 50}, 45, false)); - // An int array with 2 elements does not exist. - ASSERT_EQ(0, fuzzerutil::MaybeGetCompositeConstant( - ir_context, transformation_context, {48, 49}, 45, false)); -} - -TEST(FuzzerutilTest, FuzzerUtilMaybeGetFloatConstantTest) { - std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %36 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %8 "b1" - OpName %10 "b2" - OpName %12 "b3" - OpName %13 "b4" - OpName %16 "f1" - OpName %18 "f2" - OpName %20 "cf1" - OpName %22 "cf2" - OpName %26 "i1" - OpName %28 "i2" - OpName %30 "ci1" - OpName %32 "ci2" - OpName %36 "value" - OpDecorate %26 RelaxedPrecision - OpDecorate %28 RelaxedPrecision - OpDecorate %30 RelaxedPrecision - OpDecorate %32 RelaxedPrecision - OpDecorate %36 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeBool - %7 = OpTypePointer Function %6 - %9 = OpConstantTrue %6 - %11 = OpConstantFalse %6 - %14 = OpTypeFloat 32 - %15 = OpTypePointer Function %14 - %17 = OpConstant %14 1.23000002 - %19 = OpConstant %14 1.11000001 - %21 = OpConstant %14 2 - %23 = OpConstant %14 3.29999995 - %24 = OpTypeInt 32 1 - %25 = OpTypePointer Function %24 - %27 = OpConstant %24 1 - %29 = OpConstant %24 100 - %31 = OpConstant %24 123 - %33 = OpConstant %24 1111 - %35 = OpTypePointer Input %14 - %36 = OpVariable %35 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %8 = OpVariable %7 Function - %10 = OpVariable %7 Function - %12 = OpVariable %7 Function - %13 = OpVariable %7 Function - %16 = OpVariable %15 Function - %18 = OpVariable %15 Function - %20 = OpVariable %15 Function - %22 = OpVariable %15 Function - %26 = OpVariable %25 Function - %28 = OpVariable %25 Function - %30 = OpVariable %25 Function - %32 = OpVariable %25 Function - OpStore %8 %9 - OpStore %10 %11 - OpStore %12 %9 - OpStore %13 %11 - OpStore %16 %17 - OpStore %18 %19 - OpStore %20 %21 - OpStore %22 %23 - OpStore %26 %27 - OpStore %28 %29 - OpStore %30 %31 - OpStore %32 %33 - OpReturn - OpFunctionEnd - )"; - - const auto env = SPV_ENV_UNIVERSAL_1_4; - const auto consumer = nullptr; - const std::unique_ptr context = - BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - TransformationContext transformation_context( - MakeUnique(context.get()), validator_options); - - opt::IRContext* ir_context = context.get(); - - uint32_t word1 = fuzzerutil::FloatToWord(2); - uint32_t word2 = fuzzerutil::FloatToWord(1.23f); - - // A 32 bit float constant of value 2 exists and its id is 21. - ASSERT_EQ(21, fuzzerutil::MaybeGetFloatConstant( - ir_context, transformation_context, - std::vector{word1}, 32, false)); - // A 32 bit float constant of value 1.23 exists and its id is 17. - ASSERT_EQ(17, fuzzerutil::MaybeGetFloatConstant( - ir_context, transformation_context, - std::vector{word2}, 32, false)); -} - -TEST(FuzzerutilTest, FuzzerUtilMaybeGetFloatTypeTest) { - std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %92 %52 %53 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpDecorate %92 BuiltIn FragCoord - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %7 = OpTypeFloat 32 - %8 = OpTypeStruct %6 %7 - %9 = OpTypePointer Function %8 - %10 = OpTypeFunction %6 %9 - %14 = OpConstant %6 0 - %15 = OpTypePointer Function %6 - %51 = OpTypePointer Private %6 - %21 = OpConstant %6 2 - %23 = OpConstant %6 1 - %24 = OpConstant %7 1 - %25 = OpTypePointer Function %7 - %50 = OpTypePointer Private %7 - %34 = OpTypeBool - %35 = OpConstantFalse %34 - %52 = OpVariable %50 Private - %53 = OpVariable %51 Private - %80 = OpConstantComposite %8 %21 %24 - %90 = OpTypeVector %7 4 - %91 = OpTypePointer Input %90 - %92 = OpVariable %91 Input - %93 = OpConstantComposite %90 %24 %24 %24 %24 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %20 = OpVariable %9 Function - %27 = OpVariable %9 Function - %22 = OpAccessChain %15 %20 %14 - %44 = OpCopyObject %9 %20 - %26 = OpAccessChain %25 %20 %23 - %29 = OpFunctionCall %6 %12 %27 - %30 = OpAccessChain %15 %20 %14 - %45 = OpCopyObject %15 %30 - %81 = OpCopyObject %9 %27 - %33 = OpAccessChain %15 %20 %14 - OpSelectionMerge %37 None - OpBranchConditional %35 %36 %37 - %36 = OpLabel - %38 = OpAccessChain %15 %20 %14 - %40 = OpAccessChain %15 %20 %14 - %43 = OpAccessChain %15 %20 %14 - %82 = OpCopyObject %9 %27 - OpBranch %37 - %37 = OpLabel - OpReturn - OpFunctionEnd - %12 = OpFunction %6 None %10 - %11 = OpFunctionParameter %9 - %13 = OpLabel - %46 = OpCopyObject %9 %11 - %16 = OpAccessChain %15 %11 %14 - %95 = OpCopyObject %8 %80 - OpReturnValue %21 - %100 = OpLabel - OpUnreachable - OpFunctionEnd - )"; - - const auto env = SPV_ENV_UNIVERSAL_1_4; - const auto consumer = nullptr; - const std::unique_ptr context = - BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - - opt::IRContext* ir_context = context.get(); - // A float type with width = 32 and result id of 7 exists. - ASSERT_EQ(7, fuzzerutil::MaybeGetFloatType(ir_context, 32)); - - // A float int type with width = 32 exists, but the id should be 7. - ASSERT_NE(5, fuzzerutil::MaybeGetFloatType(ir_context, 32)); - - // A float type with width 30 does not exist. - ASSERT_EQ(0, fuzzerutil::MaybeGetFloatType(ir_context, 30)); -} - -TEST(FuzzerutilTest, FuzzerUtilMaybeGetIntegerConstantFromValueAndTypeTest) { - std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %36 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %8 "b1" - OpName %10 "b2" - OpName %12 "b3" - OpName %13 "b4" - OpName %16 "f1" - OpName %18 "f2" - OpName %22 "zc" - OpName %24 "i1" - OpName %28 "i2" - OpName %30 "i3" - OpName %32 "i4" - OpName %36 "value" - OpDecorate %22 RelaxedPrecision - OpDecorate %24 RelaxedPrecision - OpDecorate %28 RelaxedPrecision - OpDecorate %30 RelaxedPrecision - OpDecorate %32 RelaxedPrecision - OpDecorate %36 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeBool - %7 = OpTypePointer Function %6 - %9 = OpConstantTrue %6 - %11 = OpConstantFalse %6 - %14 = OpTypeFloat 32 - %15 = OpTypePointer Function %14 - %17 = OpConstant %14 1.23000002 - %19 = OpConstant %14 1.11000001 - %20 = OpTypeInt 32 1 - %21 = OpTypePointer Function %20 - %23 = OpConstant %20 0 - %25 = OpConstant %20 1 - %26 = OpTypeInt 32 0 - %27 = OpTypePointer Function %26 - %29 = OpConstant %26 100 - %31 = OpConstant %20 -1 - %33 = OpConstant %20 -99 - %35 = OpTypePointer Input %14 - %36 = OpVariable %35 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %8 = OpVariable %7 Function - %10 = OpVariable %7 Function - %12 = OpVariable %7 Function - %13 = OpVariable %7 Function - %16 = OpVariable %15 Function - %18 = OpVariable %15 Function - %22 = OpVariable %21 Function - %24 = OpVariable %21 Function - %28 = OpVariable %27 Function - %30 = OpVariable %21 Function - %32 = OpVariable %21 Function - OpStore %8 %9 - OpStore %10 %11 - OpStore %12 %9 - OpStore %13 %11 - OpStore %16 %17 - OpStore %18 %19 - OpStore %22 %23 - OpStore %24 %25 - OpStore %28 %29 - OpStore %30 %31 - OpStore %32 %33 - OpReturn - OpFunctionEnd - )"; - - const auto env = SPV_ENV_UNIVERSAL_1_4; - const auto consumer = nullptr; - const std::unique_ptr context = - BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - - opt::IRContext* ir_context = context.get(); - - // A 32 bit signed int constant (with int type id 20) with value 1 exists and - // the id is 25. - ASSERT_EQ(25, fuzzerutil::MaybeGetIntegerConstantFromValueAndType(ir_context, - 1, 20)); - // A 32 bit unsigned int constant (with int type id 0) with value 100 exists - // and the id is 29. - ASSERT_EQ(29, fuzzerutil::MaybeGetIntegerConstantFromValueAndType(ir_context, - 100, 26)); - // A 32 bit unsigned int constant with value 50 does not exist. - ASSERT_EQ(0, fuzzerutil::MaybeGetIntegerConstantFromValueAndType(ir_context, - 50, 26)); -} - -TEST(FuzzerutilTest, FuzzerUtilMaybeGetIntegerConstantTest) { - std::string shader = R"( -OpCapability Shader - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %36 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %8 "b1" - OpName %10 "b2" - OpName %12 "b3" - OpName %13 "b4" - OpName %16 "f1" - OpName %18 "f2" - OpName %22 "zc" - OpName %24 "i1" - OpName %28 "i2" - OpName %30 "i3" - OpName %32 "i4" - OpName %36 "value" - OpDecorate %22 RelaxedPrecision - OpDecorate %24 RelaxedPrecision - OpDecorate %28 RelaxedPrecision - OpDecorate %30 RelaxedPrecision - OpDecorate %32 RelaxedPrecision - OpDecorate %36 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeBool - %7 = OpTypePointer Function %6 - %9 = OpConstantTrue %6 - %11 = OpConstantFalse %6 - %14 = OpTypeFloat 32 - %15 = OpTypePointer Function %14 - %17 = OpConstant %14 1.23000002 - %19 = OpConstant %14 1.11000001 - %20 = OpTypeInt 32 1 - %21 = OpTypePointer Function %20 - %23 = OpConstant %20 0 - %25 = OpConstant %20 1 - %26 = OpTypeInt 32 0 - %27 = OpTypePointer Function %26 - %29 = OpConstant %26 100 - %31 = OpConstant %20 -1 - %33 = OpConstant %20 -99 - %35 = OpTypePointer Input %14 - %36 = OpVariable %35 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %8 = OpVariable %7 Function - %10 = OpVariable %7 Function - %12 = OpVariable %7 Function - %13 = OpVariable %7 Function - %16 = OpVariable %15 Function - %18 = OpVariable %15 Function - %22 = OpVariable %21 Function - %24 = OpVariable %21 Function - %28 = OpVariable %27 Function - %30 = OpVariable %21 Function - %32 = OpVariable %21 Function - OpStore %8 %9 - OpStore %10 %11 - OpStore %12 %9 - OpStore %13 %11 - OpStore %16 %17 - OpStore %18 %19 - OpStore %22 %23 - OpStore %24 %25 - OpStore %28 %29 - OpStore %30 %31 - OpStore %32 %33 - OpReturn - OpFunctionEnd - )"; - - const auto env = SPV_ENV_UNIVERSAL_1_4; - const auto consumer = nullptr; - const std::unique_ptr context = - BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - TransformationContext transformation_context( - MakeUnique(context.get()), validator_options); - - opt::IRContext* ir_context = context.get(); - - // A 32 bit unsigned int constant with value 1 exists and the id is 25. - ASSERT_EQ(25, fuzzerutil::MaybeGetIntegerConstant( - ir_context, transformation_context, - std::vector{1}, 32, true, false)); - // A 32 bit unsigned int constant with value 100 exists and the id is 29. - ASSERT_EQ(29, fuzzerutil::MaybeGetIntegerConstant( - ir_context, transformation_context, - std::vector{100}, 32, false, false)); - // A 32 bit signed int constant with value 99 doesn't not exist and should - // return 0. - ASSERT_EQ(0, fuzzerutil::MaybeGetIntegerConstant( - ir_context, transformation_context, - std::vector{99}, 32, true, false)); -} - -TEST(FuzzerutilTest, FuzzerUtilMaybeGetIntegerTypeTest) { - std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %92 %52 %53 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpDecorate %92 BuiltIn FragCoord - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %7 = OpTypeFloat 32 - %8 = OpTypeStruct %6 %7 - %9 = OpTypePointer Function %8 - %10 = OpTypeFunction %6 %9 - %14 = OpConstant %6 0 - %15 = OpTypePointer Function %6 - %51 = OpTypePointer Private %6 - %21 = OpConstant %6 2 - %23 = OpConstant %6 1 - %24 = OpConstant %7 1 - %25 = OpTypePointer Function %7 - %50 = OpTypePointer Private %7 - %34 = OpTypeBool - %35 = OpConstantFalse %34 - %52 = OpVariable %50 Private - %53 = OpVariable %51 Private - %80 = OpConstantComposite %8 %21 %24 - %90 = OpTypeVector %7 4 - %91 = OpTypePointer Input %90 - %92 = OpVariable %91 Input - %93 = OpConstantComposite %90 %24 %24 %24 %24 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %20 = OpVariable %9 Function - %27 = OpVariable %9 Function - %22 = OpAccessChain %15 %20 %14 - %44 = OpCopyObject %9 %20 - %26 = OpAccessChain %25 %20 %23 - %29 = OpFunctionCall %6 %12 %27 - %30 = OpAccessChain %15 %20 %14 - %45 = OpCopyObject %15 %30 - %81 = OpCopyObject %9 %27 - %33 = OpAccessChain %15 %20 %14 - OpSelectionMerge %37 None - OpBranchConditional %35 %36 %37 - %36 = OpLabel - %38 = OpAccessChain %15 %20 %14 - %40 = OpAccessChain %15 %20 %14 - %43 = OpAccessChain %15 %20 %14 - %82 = OpCopyObject %9 %27 - OpBranch %37 - %37 = OpLabel - OpReturn - OpFunctionEnd - %12 = OpFunction %6 None %10 - %11 = OpFunctionParameter %9 - %13 = OpLabel - %46 = OpCopyObject %9 %11 - %16 = OpAccessChain %15 %11 %14 - %95 = OpCopyObject %8 %80 - OpReturnValue %21 - %100 = OpLabel - OpUnreachable - OpFunctionEnd - )"; - - const auto env = SPV_ENV_UNIVERSAL_1_4; - const auto consumer = nullptr; - const std::unique_ptr context = - BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - - opt::IRContext* ir_context = context.get(); - - // A signed int type with width = 32 and result id of 6 exists. - ASSERT_EQ(6, fuzzerutil::MaybeGetIntegerType(ir_context, 32, true)); - - // A signed int type with width = 32 exists, but the id should be 6. - ASSERT_FALSE(fuzzerutil::MaybeGetIntegerType(ir_context, 32, true) == 5); - - // A int type with width = 32 and result id of 6 exists, but it should be a - // signed int. - ASSERT_EQ(0, fuzzerutil::MaybeGetIntegerType(ir_context, 32, false)); - // A signed int type with width 30 does not exist. - ASSERT_EQ(0, fuzzerutil::MaybeGetIntegerType(ir_context, 30, true)); - // An unsigned int type with width 22 does not exist. - ASSERT_EQ(0, fuzzerutil::MaybeGetIntegerType(ir_context, 22, false)); -} - -TEST(FuzzerutilTest, FuzzerUtilMaybeGetPointerTypeTest) { - std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %92 %52 %53 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpDecorate %92 BuiltIn FragCoord - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %7 = OpTypeFloat 32 - %8 = OpTypeStruct %6 %7 - %9 = OpTypePointer Function %8 - %10 = OpTypeFunction %6 %9 - %14 = OpConstant %6 0 - %15 = OpTypePointer Function %6 - %51 = OpTypePointer Private %6 - %21 = OpConstant %6 2 - %23 = OpConstant %6 1 - %24 = OpConstant %7 1 - %25 = OpTypePointer Function %7 - %50 = OpTypePointer Private %7 - %34 = OpTypeBool - %35 = OpConstantFalse %34 - %52 = OpVariable %50 Private - %53 = OpVariable %51 Private - %80 = OpConstantComposite %8 %21 %24 - %90 = OpTypeVector %7 4 - %91 = OpTypePointer Input %90 - %92 = OpVariable %91 Input - %93 = OpConstantComposite %90 %24 %24 %24 %24 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %20 = OpVariable %9 Function - %27 = OpVariable %9 Function - %22 = OpAccessChain %15 %20 %14 - %44 = OpCopyObject %9 %20 - %26 = OpAccessChain %25 %20 %23 - %29 = OpFunctionCall %6 %12 %27 - %30 = OpAccessChain %15 %20 %14 - %45 = OpCopyObject %15 %30 - %81 = OpCopyObject %9 %27 - %33 = OpAccessChain %15 %20 %14 - OpSelectionMerge %37 None - OpBranchConditional %35 %36 %37 - %36 = OpLabel - %38 = OpAccessChain %15 %20 %14 - %40 = OpAccessChain %15 %20 %14 - %43 = OpAccessChain %15 %20 %14 - %82 = OpCopyObject %9 %27 - OpBranch %37 - %37 = OpLabel - OpReturn - OpFunctionEnd - %12 = OpFunction %6 None %10 - %11 = OpFunctionParameter %9 - %13 = OpLabel - %46 = OpCopyObject %9 %11 - %16 = OpAccessChain %15 %11 %14 - %95 = OpCopyObject %8 %80 - OpReturnValue %21 - %100 = OpLabel - OpUnreachable - OpFunctionEnd - )"; - - const auto env = SPV_ENV_UNIVERSAL_1_4; - const auto consumer = nullptr; - const std::unique_ptr context = - BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - - opt::IRContext* ir_context = context.get(); - auto private_storage_class = SpvStorageClassPrivate; - auto function_storage_class = SpvStorageClassFunction; - auto input_storage_class = SpvStorageClassInput; - - // A valid pointer must have the correct |pointee_type_id| and |storageClass|. - // A function type pointer with id = 9 and pointee type id 8 should be found. - ASSERT_EQ(9, fuzzerutil::MaybeGetPointerType(ir_context, 8, - function_storage_class)); - // A function type pointer with id = 15 and pointee type id 6 should be found. - ASSERT_EQ(15, fuzzerutil::MaybeGetPointerType(ir_context, 6, - function_storage_class)); - // A function type pointer with id = 25 and pointee type id 7 should be found. - ASSERT_EQ(25, fuzzerutil::MaybeGetPointerType(ir_context, 7, - function_storage_class)); - - // A private type pointer with id=51 and pointee type id 6 should be found. - ASSERT_EQ(51, fuzzerutil::MaybeGetPointerType(ir_context, 6, - private_storage_class)); - // A function pointer with id=50 and pointee type id 7 should be found. - ASSERT_EQ(50, fuzzerutil::MaybeGetPointerType(ir_context, 7, - private_storage_class)); - - // A input type pointer with id=91 and pointee type id 90 should be found. - ASSERT_EQ( - 91, fuzzerutil::MaybeGetPointerType(ir_context, 90, input_storage_class)); - - // A pointer with id=91 and pointee type 90 exisits, but the type should be - // input. - ASSERT_EQ(0, fuzzerutil::MaybeGetPointerType(ir_context, 90, - function_storage_class)); - // A input type pointer with id=91 exists but the pointee id should be 90. - ASSERT_EQ( - 0, fuzzerutil::MaybeGetPointerType(ir_context, 89, input_storage_class)); - // A input type pointer with pointee id 90 exists but result id of the pointer - // should be 91. - ASSERT_NE( - 58, fuzzerutil::MaybeGetPointerType(ir_context, 90, input_storage_class)); -} - -TEST(FuzzerutilTest, FuzzerUtilMaybeGetScalarConstantTest) { - std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %56 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %8 "b1" - OpName %10 "b2" - OpName %12 "b3" - OpName %13 "b4" - OpName %16 "f1" - OpName %18 "f2" - OpName %22 "zc" - OpName %24 "i1" - OpName %28 "i2" - OpName %30 "i" - OpName %32 "i3" - OpName %34 "i4" - OpName %39 "f_arr" - OpName %49 "i_arr" - OpName %56 "value" - OpDecorate %22 RelaxedPrecision - OpDecorate %24 RelaxedPrecision - OpDecorate %28 RelaxedPrecision - OpDecorate %30 RelaxedPrecision - OpDecorate %32 RelaxedPrecision - OpDecorate %34 RelaxedPrecision - OpDecorate %49 RelaxedPrecision - OpDecorate %56 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeBool - %7 = OpTypePointer Function %6 - %9 = OpConstantTrue %6 - %11 = OpConstantFalse %6 - %14 = OpTypeFloat 32 - %15 = OpTypePointer Function %14 - %17 = OpConstant %14 1.23000002 - %19 = OpConstant %14 1.11000001 - %20 = OpTypeInt 32 1 - %21 = OpTypePointer Function %20 - %23 = OpConstant %20 0 - %25 = OpConstant %20 1 - %26 = OpTypeInt 32 0 - %27 = OpTypePointer Function %26 - %29 = OpConstant %26 100 - %31 = OpConstant %26 0 - %33 = OpConstant %20 -1 - %35 = OpConstant %20 -99 - %36 = OpConstant %26 5 - %37 = OpTypeArray %14 %36 - %38 = OpTypePointer Function %37 - %40 = OpConstant %14 5.5 - %41 = OpConstant %14 4.4000001 - %42 = OpConstant %14 3.29999995 - %43 = OpConstant %14 2.20000005 - %44 = OpConstant %14 1.10000002 - %45 = OpConstantComposite %37 %40 %41 %42 %43 %44 - %46 = OpConstant %26 3 - %47 = OpTypeArray %20 %46 - %48 = OpTypePointer Function %47 - %50 = OpConstant %20 3 - %51 = OpConstant %20 7 - %52 = OpConstant %20 9 - %53 = OpConstantComposite %47 %50 %51 %52 - %55 = OpTypePointer Input %14 - %56 = OpVariable %55 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %8 = OpVariable %7 Function - %10 = OpVariable %7 Function - %12 = OpVariable %7 Function - %13 = OpVariable %7 Function - %16 = OpVariable %15 Function - %18 = OpVariable %15 Function - %22 = OpVariable %21 Function - %24 = OpVariable %21 Function - %28 = OpVariable %27 Function - %30 = OpVariable %27 Function - %32 = OpVariable %21 Function - %34 = OpVariable %21 Function - %39 = OpVariable %38 Function - %49 = OpVariable %48 Function - OpStore %8 %9 - OpStore %10 %11 - OpStore %12 %9 - OpStore %13 %11 - OpStore %16 %17 - OpStore %18 %19 - OpStore %22 %23 - OpStore %24 %25 - OpStore %28 %29 - OpStore %30 %31 - OpStore %32 %33 - OpStore %34 %35 - OpStore %39 %45 - OpStore %49 %53 - OpReturn - OpFunctionEnd - )"; - - const auto env = SPV_ENV_UNIVERSAL_1_4; - const auto consumer = nullptr; - const std::unique_ptr context = - BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - TransformationContext transformation_context( - MakeUnique(context.get()), validator_options); - - opt::IRContext* ir_context = context.get(); - - std::vector uint_words1 = fuzzerutil::IntToWords(100, 32, false); - std::vector uint_words2 = fuzzerutil::IntToWords(0, 32, false); - std::vector int_words1 = fuzzerutil::IntToWords(-99, 32, true); - std::vector int_words2 = fuzzerutil::IntToWords(1, 32, true); - uint32_t float_word1 = fuzzerutil::FloatToWord(1.11f); - uint32_t float_word2 = fuzzerutil::FloatToWord(4.4f); - - // A unsigned int of value 100 that has a scalar type id of 26 exists and its - // id is 29. - ASSERT_EQ( - 29, fuzzerutil::MaybeGetScalarConstant(ir_context, transformation_context, - uint_words1, 26, false)); - // A unsigned int of value 0 that has a scalar type id of 26 exists and its id - // is 29. - ASSERT_EQ( - 31, fuzzerutil::MaybeGetScalarConstant(ir_context, transformation_context, - uint_words2, 26, false)); - // A signed int of value -99 that has a scalar type id of 20 exists and its id - // is 35. - ASSERT_EQ(35, fuzzerutil::MaybeGetScalarConstant( - ir_context, transformation_context, int_words1, 20, false)); - // A signed int of value 1 that has a scalar type id of 20 exists and its id - // is 25. - ASSERT_EQ(25, fuzzerutil::MaybeGetScalarConstant( - ir_context, transformation_context, int_words2, 20, false)); - // A float of value 1.11 that has a scalar type id of 14 exists and its id - // is 19. - ASSERT_EQ(19, fuzzerutil::MaybeGetScalarConstant( - ir_context, transformation_context, - std::vector{float_word1}, 14, false)); - // A signed int of value 1 that has a scalar type id of 20 exists and its id - // is 25. - ASSERT_EQ(41, fuzzerutil::MaybeGetScalarConstant( - ir_context, transformation_context, - std::vector{float_word2}, 14, false)); -} - -TEST(FuzzerutilTest, FuzzerUtilMaybeGetStructTypeTest) { - std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %92 %52 %53 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpDecorate %92 BuiltIn FragCoord - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %7 = OpTypeFloat 32 - %8 = OpTypeStruct %6 %7 - %9 = OpTypePointer Function %8 - %10 = OpTypeFunction %6 %9 - %14 = OpConstant %6 0 - %15 = OpTypePointer Function %6 - %51 = OpTypePointer Private %6 - %21 = OpConstant %6 2 - %23 = OpConstant %6 1 - %24 = OpConstant %7 1 - %25 = OpTypePointer Function %7 - %50 = OpTypePointer Private %7 - %34 = OpTypeBool - %35 = OpConstantFalse %34 - %52 = OpVariable %50 Private - %53 = OpVariable %51 Private - %80 = OpConstantComposite %8 %21 %24 - %90 = OpTypeVector %7 4 - %91 = OpTypePointer Input %90 - %92 = OpVariable %91 Input - %93 = OpConstantComposite %90 %24 %24 %24 %24 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %20 = OpVariable %9 Function - %27 = OpVariable %9 Function - %22 = OpAccessChain %15 %20 %14 - %44 = OpCopyObject %9 %20 - %26 = OpAccessChain %25 %20 %23 - %29 = OpFunctionCall %6 %12 %27 - %30 = OpAccessChain %15 %20 %14 - %45 = OpCopyObject %15 %30 - %81 = OpCopyObject %9 %27 - %33 = OpAccessChain %15 %20 %14 - OpSelectionMerge %37 None - OpBranchConditional %35 %36 %37 - %36 = OpLabel - %38 = OpAccessChain %15 %20 %14 - %40 = OpAccessChain %15 %20 %14 - %43 = OpAccessChain %15 %20 %14 - %82 = OpCopyObject %9 %27 - OpBranch %37 - %37 = OpLabel - OpReturn - OpFunctionEnd - %12 = OpFunction %6 None %10 - %11 = OpFunctionParameter %9 - %13 = OpLabel - %46 = OpCopyObject %9 %11 - %16 = OpAccessChain %15 %11 %14 - %95 = OpCopyObject %8 %80 - OpReturnValue %21 - %100 = OpLabel - OpUnreachable - OpFunctionEnd - )"; - - const auto env = SPV_ENV_UNIVERSAL_1_4; - const auto consumer = nullptr; - const std::unique_ptr context = - BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - - opt::IRContext* ir_context = context.get(); - - // 6 and 7 are all valid ids from OpTypeInt and OpTypeFloat - // so the result id of 8 should be found. - ASSERT_EQ(8, fuzzerutil::MaybeGetStructType(ir_context, - std::vector{6, 7})); - - // |component_type_id| of 16 does not exist in the module, so such a struct - // type cannot be found. - ASSERT_EQ(0, fuzzerutil::MaybeGetStructType(ir_context, - std::vector(6, 16))); - - // |component_type_id| of 10 is of OpTypeFunction type and thus the struct - // cannot be found. - ASSERT_EQ(0, fuzzerutil::MaybeGetStructType(ir_context, - std::vector(6, 10))); -} - -TEST(FuzzerutilTest, FuzzerUtilMaybeGetVectorTypeTest) { - std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %92 %52 %53 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpDecorate %92 BuiltIn FragCoord - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %7 = OpTypeFloat 32 - %8 = OpTypeStruct %6 %7 - %9 = OpTypePointer Function %8 - %10 = OpTypeFunction %6 %9 - %14 = OpConstant %6 0 - %15 = OpTypePointer Function %6 - %51 = OpTypePointer Private %6 - %21 = OpConstant %6 2 - %23 = OpConstant %6 1 - %24 = OpConstant %7 1 - %25 = OpTypePointer Function %7 - %50 = OpTypePointer Private %7 - %34 = OpTypeBool - %35 = OpConstantFalse %34 - %52 = OpVariable %50 Private - %53 = OpVariable %51 Private - %80 = OpConstantComposite %8 %21 %24 - %90 = OpTypeVector %7 4 - %91 = OpTypePointer Input %90 - %92 = OpVariable %91 Input - %93 = OpConstantComposite %90 %24 %24 %24 %24 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %20 = OpVariable %9 Function - %27 = OpVariable %9 Function - %22 = OpAccessChain %15 %20 %14 - %44 = OpCopyObject %9 %20 - %26 = OpAccessChain %25 %20 %23 - %29 = OpFunctionCall %6 %12 %27 - %30 = OpAccessChain %15 %20 %14 - %45 = OpCopyObject %15 %30 - %81 = OpCopyObject %9 %27 - %33 = OpAccessChain %15 %20 %14 - OpSelectionMerge %37 None - OpBranchConditional %35 %36 %37 - %36 = OpLabel - %38 = OpAccessChain %15 %20 %14 - %40 = OpAccessChain %15 %20 %14 - %43 = OpAccessChain %15 %20 %14 - %82 = OpCopyObject %9 %27 - OpBranch %37 - %37 = OpLabel - OpReturn - OpFunctionEnd - %12 = OpFunction %6 None %10 - %11 = OpFunctionParameter %9 - %13 = OpLabel - %46 = OpCopyObject %9 %11 - %16 = OpAccessChain %15 %11 %14 - %95 = OpCopyObject %8 %80 - OpReturnValue %21 - %100 = OpLabel - OpUnreachable - OpFunctionEnd - )"; - - const auto env = SPV_ENV_UNIVERSAL_1_4; - const auto consumer = nullptr; - const std::unique_ptr context = - BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - - opt::IRContext* ir_context = context.get(); - // The vector type with |element_count| 4 and |component_type_id| 7 - // is present and has a result id of 90. - ASSERT_EQ(90, fuzzerutil::MaybeGetVectorType(ir_context, 7, 4)); - - // The vector type with |element_count| 3 and |component_type_id| 7 - // is not present in the module. - ASSERT_EQ(0, fuzzerutil::MaybeGetVectorType(ir_context, 7, 3)); - -#ifndef NDEBUG - // It should abort with |component_type_id| of 100 - // |component_type_id| must be a valid result id of an OpTypeInt, - // OpTypeFloat or OpTypeBool instruction in the module. - ASSERT_DEATH(fuzzerutil::MaybeGetVectorType(ir_context, 100, 4), - "\\|component_type_id\\| is invalid"); - - // It should abort with |element_count| of 5. - // |element_count| must be in the range [2,4]. - ASSERT_DEATH(fuzzerutil::MaybeGetVectorType(ir_context, 7, 5), - "Precondition: component count must be in range \\[2, 4\\]."); -#endif -} - -TEST(FuzzerutilTest, FuzzerUtilMaybeGetVoidTypeTest) { - std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %92 %52 %53 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpDecorate %92 BuiltIn FragCoord - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %7 = OpTypeFloat 32 - %8 = OpTypeStruct %6 %7 - %9 = OpTypePointer Function %8 - %10 = OpTypeFunction %6 %9 - %14 = OpConstant %6 0 - %15 = OpTypePointer Function %6 - %51 = OpTypePointer Private %6 - %21 = OpConstant %6 2 - %23 = OpConstant %6 1 - %24 = OpConstant %7 1 - %25 = OpTypePointer Function %7 - %50 = OpTypePointer Private %7 - %34 = OpTypeBool - %35 = OpConstantFalse %34 - %52 = OpVariable %50 Private - %53 = OpVariable %51 Private - %80 = OpConstantComposite %8 %21 %24 - %90 = OpTypeVector %7 4 - %91 = OpTypePointer Input %90 - %92 = OpVariable %91 Input - %93 = OpConstantComposite %90 %24 %24 %24 %24 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %20 = OpVariable %9 Function - %27 = OpVariable %9 Function - %22 = OpAccessChain %15 %20 %14 - %44 = OpCopyObject %9 %20 - %26 = OpAccessChain %25 %20 %23 - %29 = OpFunctionCall %6 %12 %27 - %30 = OpAccessChain %15 %20 %14 - %45 = OpCopyObject %15 %30 - %81 = OpCopyObject %9 %27 - %33 = OpAccessChain %15 %20 %14 - OpSelectionMerge %37 None - OpBranchConditional %35 %36 %37 - %36 = OpLabel - %38 = OpAccessChain %15 %20 %14 - %40 = OpAccessChain %15 %20 %14 - %43 = OpAccessChain %15 %20 %14 - %82 = OpCopyObject %9 %27 - OpBranch %37 - %37 = OpLabel - OpReturn - OpFunctionEnd - %12 = OpFunction %6 None %10 - %11 = OpFunctionParameter %9 - %13 = OpLabel - %46 = OpCopyObject %9 %11 - %16 = OpAccessChain %15 %11 %14 - %95 = OpCopyObject %8 %80 - OpReturnValue %21 - %100 = OpLabel - OpUnreachable - OpFunctionEnd - )"; - - const auto env = SPV_ENV_UNIVERSAL_1_4; - const auto consumer = nullptr; - const std::unique_ptr context = - BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - - opt::IRContext* ir_context = context.get(); - // A void type with a result id of 2 can be found. - ASSERT_EQ(2, fuzzerutil::MaybeGetVoidType(ir_context)); -} - -TEST(FuzzerutilTest, FuzzerUtilMaybeGetZeroConstantTest) { - std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %56 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %8 "b1" - OpName %10 "b2" - OpName %12 "b3" - OpName %13 "b4" - OpName %16 "f1" - OpName %18 "f2" - OpName %22 "zc" - OpName %24 "i1" - OpName %28 "i2" - OpName %30 "i" - OpName %32 "i3" - OpName %34 "i4" - OpName %39 "f_arr" - OpName %49 "i_arr" - OpName %56 "value" - OpDecorate %22 RelaxedPrecision - OpDecorate %24 RelaxedPrecision - OpDecorate %28 RelaxedPrecision - OpDecorate %30 RelaxedPrecision - OpDecorate %32 RelaxedPrecision - OpDecorate %34 RelaxedPrecision - OpDecorate %49 RelaxedPrecision - OpDecorate %56 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeBool - %7 = OpTypePointer Function %6 - %9 = OpConstantTrue %6 - %11 = OpConstantFalse %6 - %14 = OpTypeFloat 32 - %15 = OpTypePointer Function %14 - %17 = OpConstant %14 1.23000002 - %19 = OpConstant %14 1.11000001 - %20 = OpTypeInt 32 1 - %21 = OpTypePointer Function %20 - %23 = OpConstant %20 0 - %25 = OpConstant %20 1 - %26 = OpTypeInt 32 0 - %27 = OpTypePointer Function %26 - %29 = OpConstant %26 100 - %31 = OpConstant %26 0 - %33 = OpConstant %20 -1 - %35 = OpConstant %20 -99 - %36 = OpConstant %26 5 - %37 = OpTypeArray %14 %36 - %38 = OpTypePointer Function %37 - %40 = OpConstant %14 5.5 - %41 = OpConstant %14 4.4000001 - %42 = OpConstant %14 3.29999995 - %43 = OpConstant %14 2.20000005 - %44 = OpConstant %14 1.10000002 - %45 = OpConstantComposite %37 %40 %41 %42 %43 %44 - %46 = OpConstant %26 3 - %47 = OpTypeArray %20 %46 - %48 = OpTypePointer Function %47 - %50 = OpConstant %20 3 - %51 = OpConstant %20 7 - %52 = OpConstant %20 9 - %53 = OpConstantComposite %47 %50 %51 %52 - %55 = OpTypePointer Input %14 - %56 = OpVariable %55 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %8 = OpVariable %7 Function - %10 = OpVariable %7 Function - %12 = OpVariable %7 Function - %13 = OpVariable %7 Function - %16 = OpVariable %15 Function - %18 = OpVariable %15 Function - %22 = OpVariable %21 Function - %24 = OpVariable %21 Function - %28 = OpVariable %27 Function - %30 = OpVariable %27 Function - %32 = OpVariable %21 Function - %34 = OpVariable %21 Function - %39 = OpVariable %38 Function - %49 = OpVariable %48 Function - OpStore %8 %9 - OpStore %10 %11 - OpStore %12 %9 - OpStore %13 %11 - OpStore %16 %17 - OpStore %18 %19 - OpStore %22 %23 - OpStore %24 %25 - OpStore %28 %29 - OpStore %30 %31 - OpStore %32 %33 - OpStore %34 %35 - OpStore %39 %45 - OpStore %49 %53 - OpReturn - OpFunctionEnd - )"; - - const auto env = SPV_ENV_UNIVERSAL_1_4; - const auto consumer = nullptr; - const std::unique_ptr context = - BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - TransformationContext transformation_context( - MakeUnique(context.get()), validator_options); - - opt::IRContext* ir_context = context.get(); - - // The id of a boolean constant will be returned give boolean type id 6. - uint32_t maybe_bool_id = fuzzerutil::MaybeGetZeroConstant( - ir_context, transformation_context, 6, false); - // The id of a 32 bit float constant will be returned given the float type - // id 14. - uint32_t maybe_float_id = fuzzerutil::MaybeGetZeroConstant( - ir_context, transformation_context, 14, false); - uint32_t maybe_signed_int_id = fuzzerutil::MaybeGetZeroConstant( - ir_context, transformation_context, 20, false); - uint32_t maybe_unsigned_int_id = fuzzerutil::MaybeGetZeroConstant( - ir_context, transformation_context, 26, false); - - // Lists of possible ids for float, signed int, unsigned int and array. - std::vector float_ids{17, 19}; - std::vector signed_int_ids{23, 25, 31, 33}; - - ASSERT_TRUE(maybe_bool_id == 9 || maybe_bool_id == 11); - ASSERT_TRUE(std::find(signed_int_ids.begin(), signed_int_ids.end(), - maybe_signed_int_id) != signed_int_ids.end()); - - // There is a unsigned int typed zero constant and its id is 31. - ASSERT_EQ(31, maybe_unsigned_int_id); - - // There is no zero float constant. - ASSERT_TRUE(std::find(float_ids.begin(), float_ids.end(), maybe_float_id) == - float_ids.end()); -} - -} // namespace -} // namespace fuzz -} // namespace spvtools diff --git a/test/fuzz/shrinker_test.cpp b/test/fuzz/shrinker_test.cpp index 942de29a..447ebecd 100644 --- a/test/fuzz/shrinker_test.cpp +++ b/test/fuzz/shrinker_test.cpp @@ -171,7 +171,7 @@ TEST(ShrinkerTest, ReduceAddedFunctions) { protobufs::TransformationSequence transformations; FuzzerPassDonateModules pass(variant_ir_context.get(), &transformation_context, &fuzzer_context, - &transformations, false, {}); + &transformations, {}); pass.DonateSingleModule(donor_ir_context.get(), true); protobufs::FactSequence no_facts; @@ -349,7 +349,7 @@ TEST(ShrinkerTest, HitStepLimitWhenReducingAddedFunctions) { protobufs::TransformationSequence transformations; FuzzerPassDonateModules pass(variant_ir_context.get(), &transformation_context, &fuzzer_context, - &transformations, false, {}); + &transformations, {}); pass.DonateSingleModule(donor_ir_context.get(), true); protobufs::FactSequence no_facts; diff --git a/test/fuzz/transformation_access_chain_test.cpp b/test/fuzz/transformation_access_chain_test.cpp index bddcf5fe..5c431279 100644 --- a/test/fuzz/transformation_access_chain_test.cpp +++ b/test/fuzz/transformation_access_chain_test.cpp @@ -26,7 +26,6 @@ namespace { TEST(TransformationAccessChainTest, BasicTest) { std::string shader = R"( OpCapability Shader - OpCapability VariablePointers %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %4 "main" %48 %54 @@ -64,6 +63,7 @@ TEST(TransformationAccessChainTest, BasicTest) { %85 = OpConstant %10 5 %52 = OpTypeArray %50 %51 %53 = OpTypePointer Private %52 + %45 = OpUndef %9 %46 = OpConstantNull %9 %47 = OpTypePointer Private %8 %48 = OpVariable %47 Private @@ -127,16 +127,6 @@ TEST(TransformationAccessChainTest, BasicTest) { transformation_context.GetFactManager()->AddFactValueOfPointeeIsIrrelevant( 54); - // Check the case where the index type is not a 32-bit integer. - TransformationAccessChain invalid_index_example1( - 101, 28, {29}, MakeInstructionDescriptor(42, SpvOpReturn, 0)); - - // Since the index is not a 32-bit integer type but a 32-bit float type, - // ValidIndexComposite should return false and thus the transformation is not - // applicable. - ASSERT_FALSE(invalid_index_example1.IsApplicable(context.get(), - transformation_context)); - // Bad: id is not fresh ASSERT_FALSE(TransformationAccessChain( 43, 43, {80}, MakeInstructionDescriptor(24, SpvOpLoad, 0)) @@ -203,6 +193,15 @@ TEST(TransformationAccessChainTest, BasicTest) { #ifndef NDEBUG // Bad: pointer is null + ASSERT_DEATH( + TransformationAccessChain(100, 45, {80}, + MakeInstructionDescriptor(24, SpvOpLoad, 0)) + .IsApplicable(context.get(), transformation_context), + "Access chains should not be created from null/undefined pointers"); +#endif + +#ifndef NDEBUG + // Bad: pointer is undef ASSERT_DEATH( TransformationAccessChain(100, 46, {80}, MakeInstructionDescriptor(24, SpvOpLoad, 0)) @@ -305,24 +304,9 @@ TEST(TransformationAccessChainTest, BasicTest) { ASSERT_FALSE( transformation_context.GetFactManager()->PointeeValueIsIrrelevant(107)); } - { - // Check the case where the access chain's base pointer has the irrelevant - // pointee fact; the resulting access chain should inherit this fact. - TransformationAccessChain transformation( - 107, 54, {}, MakeInstructionDescriptor(24, SpvOpLoad, 0)); - ASSERT_TRUE( - transformation.IsApplicable(context.get(), transformation_context)); - ApplyAndCheckFreshIds(transformation, context.get(), - &transformation_context); - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed( - context.get(), validator_options, kConsoleMessageConsumer)); - ASSERT_TRUE( - transformation_context.GetFactManager()->PointeeValueIsIrrelevant(54)); - } std::string after_transformation = R"( OpCapability Shader - OpCapability VariablePointers %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %4 "main" %48 %54 @@ -360,6 +344,7 @@ TEST(TransformationAccessChainTest, BasicTest) { %85 = OpConstant %10 5 %52 = OpTypeArray %50 %51 %53 = OpTypePointer Private %52 + %45 = OpUndef %9 %46 = OpConstantNull %9 %47 = OpTypePointer Private %8 %48 = OpVariable %47 Private @@ -398,7 +383,6 @@ TEST(TransformationAccessChainTest, BasicTest) { %23 = OpConvertFToS %10 %22 %100 = OpAccessChain %70 %43 %80 %106 = OpAccessChain %11 %14 - %107 = OpAccessChain %53 %54 %24 = OpLoad %10 %14 %25 = OpIAdd %10 %23 %24 OpReturnValue %25 @@ -407,44 +391,6 @@ TEST(TransformationAccessChainTest, BasicTest) { ASSERT_TRUE(IsEqual(env, after_transformation, context.get())); } -TEST(TransformationAccessChainTest, StructIndexMustBeConstant) { - std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 320 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %20 = OpUndef %6 - %7 = OpTypeStruct %6 %6 - %8 = OpTypePointer Function %7 - %10 = OpConstant %6 0 - %11 = OpConstant %6 2 - %12 = OpTypePointer Function %6 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %9 = OpVariable %8 Function - OpReturn - OpFunctionEnd - )"; - - const auto env = SPV_ENV_UNIVERSAL_1_4; - const auto consumer = nullptr; - const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - TransformationContext transformation_context( - MakeUnique(context.get()), validator_options); - // Bad: %9 is a pointer to a struct, but %20 is not a constant. - ASSERT_FALSE(TransformationAccessChain( - 100, 9, {20}, MakeInstructionDescriptor(9, SpvOpReturn, 0)) - .IsApplicable(context.get(), transformation_context)); -} - TEST(TransformationAccessChainTest, IsomorphicStructs) { std::string shader = R"( OpCapability Shader diff --git a/test/fuzz/transformation_add_bit_instruction_synonym_test.cpp b/test/fuzz/transformation_add_bit_instruction_synonym_test.cpp index d6b2ce51..ccfbcf53 100644 --- a/test/fuzz/transformation_add_bit_instruction_synonym_test.cpp +++ b/test/fuzz/transformation_add_bit_instruction_synonym_test.cpp @@ -937,7 +937,11 @@ TEST(TransformationAddBitInstructionSynonymTest, NoSynonymWhenBlockIsDead) { MakeDataDescriptor(166, {}), MakeDataDescriptor(39, {}))); } -TEST(TransformationAddBitInstructionSynonymTest, DifferentSingedness) { +TEST(TransformationAddBitInstructionSynonymTest, DISABLED_DifferentSingedness) { + // This test will fail due to a bug in the transformation. The reason is that + // OpNot supports its operand and result type having different signedness. + // OpBitFieldUExtract and OpBitFieldInsert, however, don't support this + // (these instructions are added by the transformation). std::string reference_shader = R"( OpCapability Shader %1 = OpExtInstImport "GLSL.std.450" @@ -983,14 +987,11 @@ TEST(TransformationAddBitInstructionSynonymTest, DifferentSingedness) { %34 = OpConstant %2 29 %35 = OpConstant %2 30 %36 = OpConstant %2 31 - %45 = OpConstant %200 32 ; main function %37 = OpFunction %3 None %4 %38 = OpLabel %39 = OpNot %200 %5 ; bit instruction - %40 = OpBitwiseOr %200 %6 %45 ; bit instruction - %41 = OpBitwiseAnd %2 %5 %6 ; bit instruction OpReturn OpFunctionEnd )"; @@ -1005,61 +1006,17 @@ TEST(TransformationAddBitInstructionSynonymTest, DifferentSingedness) { TransformationContext transformation_context( MakeUnique(context.get()), validator_options); - // Invalid because the sign of id 200 result is not equal to the sign of id 5 - // operand in OpNot. + // Adds OpNot synonym. auto transformation = TransformationAddBitInstructionSynonym( - 39, {300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, - 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, - 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427}); + 39, {40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134}); ASSERT_FALSE( transformation.IsApplicable(context.get(), transformation_context)); - - // Invalid because the sign of two operands not the same and the first operand - // sign not equal the result sign in OpBitwiseOr. - transformation = TransformationAddBitInstructionSynonym( - 40, {300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, - 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, - 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427}); - ASSERT_FALSE( - transformation.IsApplicable(context.get(), transformation_context)); - - // Successful transformation - { - // Instruction operands are the same and it's equal with the result sign in - // OpBitwiseAnd bitwise operation. - transformation = TransformationAddBitInstructionSynonym( - 41, {46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172}); - ASSERT_TRUE( - transformation.IsApplicable(context.get(), transformation_context)); - - ApplyAndCheckFreshIds(transformation, context.get(), - &transformation_context); - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed( - context.get(), validator_options, kConsoleMessageConsumer)); - } } } // namespace diff --git a/test/fuzz/transformation_add_constant_scalar_test.cpp b/test/fuzz/transformation_add_constant_scalar_test.cpp index 00c05416..91339dbb 100644 --- a/test/fuzz/transformation_add_constant_scalar_test.cpp +++ b/test/fuzz/transformation_add_constant_scalar_test.cpp @@ -114,11 +114,6 @@ TEST(TransformationAddConstantScalarTest, IsApplicable) { transformation = TransformationAddConstantScalar(19, 5, {0, 1, 2}, false); ASSERT_FALSE( transformation.IsApplicable(context.get(), transformation_context)); - - // Tests |words| having 2 words for a 32-bit float type. - transformation = TransformationAddConstantScalar(19, 4, {0, 1}, false); - ASSERT_FALSE( - transformation.IsApplicable(context.get(), transformation_context)); } TEST(TransformationAddConstantScalarTest, Apply) { diff --git a/test/fuzz/transformation_add_copy_memory_test.cpp b/test/fuzz/transformation_add_copy_memory_test.cpp index ff8ac72e..642a5561 100644 --- a/test/fuzz/transformation_add_copy_memory_test.cpp +++ b/test/fuzz/transformation_add_copy_memory_test.cpp @@ -26,7 +26,6 @@ namespace { TEST(TransformationAddCopyMemoryTest, BasicTest) { std::string shader = R"( OpCapability Shader - OpCapability VariablePointers %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %4 "main" @@ -65,6 +64,7 @@ TEST(TransformationAddCopyMemoryTest, BasicTest) { %67 = OpTypePointer Function %66 %83 = OpTypePointer Private %66 %86 = OpVariable %79 Private %20 + %87 = OpUndef %79 %88 = OpConstantNull %79 %4 = OpFunction %2 None %3 %5 = OpLabel @@ -182,6 +182,12 @@ TEST(TransformationAddCopyMemoryTest, BasicTest) { 90, 40, SpvStorageClassPrivate, 0) .IsApplicable(context.get(), transformation_context)); + // Source instruction is OpUndef. + ASSERT_FALSE( + TransformationAddCopyMemory(MakeInstructionDescriptor(41, SpvOpLoad, 0), + 90, 87, SpvStorageClassPrivate, 0) + .IsApplicable(context.get(), transformation_context)); + // Source instruction is OpConstantNull. ASSERT_FALSE( TransformationAddCopyMemory(MakeInstructionDescriptor(41, SpvOpLoad, 0), @@ -249,7 +255,6 @@ TEST(TransformationAddCopyMemoryTest, BasicTest) { std::string expected = R"( OpCapability Shader - OpCapability VariablePointers %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %4 "main" @@ -288,6 +293,7 @@ TEST(TransformationAddCopyMemoryTest, BasicTest) { %67 = OpTypePointer Function %66 %83 = OpTypePointer Private %66 %86 = OpVariable %79 Private %20 + %87 = OpUndef %79 %88 = OpConstantNull %79 %90 = OpVariable %79 Private %20 %92 = OpVariable %78 Private %25 diff --git a/test/fuzz/transformation_add_dead_block_test.cpp b/test/fuzz/transformation_add_dead_block_test.cpp index 3c9e6b43..687f00c7 100644 --- a/test/fuzz/transformation_add_dead_block_test.cpp +++ b/test/fuzz/transformation_add_dead_block_test.cpp @@ -142,99 +142,6 @@ TEST(TransformationAddDeadBlockTest, BasicTest) { ASSERT_TRUE(IsEqual(env, variant_shader, context.get())); } -TEST(TransformationAddDeadBlockTest, ApplicableWithFalseCondition) { - std::string reference_shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %6 "main" - OpExecutionMode %6 OriginUpperLeft - -; Types - %2 = OpTypeBool - %3 = OpTypeVoid - %4 = OpTypeFunction %3 - -; Constants - %5 = OpConstantFalse %2 - -; main function - %6 = OpFunction %3 None %4 - %7 = OpLabel - OpSelectionMerge %11 None - OpBranchConditional %5 %8 %9 - %8 = OpLabel - OpBranch %10 - %9 = OpLabel - OpBranch %10 - %10 = OpLabel - OpBranch %11 - %11 = OpLabel - OpBranch %13 - %12 = OpLabel - OpBranch %13 - %13 = OpLabel - OpReturn - OpFunctionEnd - )"; - const auto env = SPV_ENV_UNIVERSAL_1_4; - const auto consumer = nullptr; - const auto context = - BuildModule(env, consumer, reference_shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - TransformationContext transformation_context( - MakeUnique(context.get()), validator_options); - auto transformation = TransformationAddDeadBlock(14, 11, false); - - ASSERT_TRUE( - transformation.IsApplicable(context.get(), transformation_context)); - ApplyAndCheckFreshIds(transformation, context.get(), &transformation_context); - - std::string variant_shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %6 "main" - OpExecutionMode %6 OriginUpperLeft - -; Types - %2 = OpTypeBool - %3 = OpTypeVoid - %4 = OpTypeFunction %3 - -; Constants - %5 = OpConstantFalse %2 - -; main function - %6 = OpFunction %3 None %4 - %7 = OpLabel - OpSelectionMerge %11 None - OpBranchConditional %5 %8 %9 - %8 = OpLabel - OpBranch %10 - %9 = OpLabel - OpBranch %10 - %10 = OpLabel - OpBranch %11 - %11 = OpLabel - OpSelectionMerge %13 None - OpBranchConditional %5 %14 %13 - %14 = OpLabel - OpBranch %13 - %12 = OpLabel - OpBranch %13 - %13 = OpLabel - OpReturn - OpFunctionEnd - )"; - - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - ASSERT_TRUE(IsEqual(env, variant_shader, context.get())); -} - TEST(TransformationAddDeadBlockTest, TargetBlockMustNotBeSelectionMerge) { std::string shader = R"( OpCapability Shader diff --git a/test/fuzz/transformation_add_parameter_test.cpp b/test/fuzz/transformation_add_parameter_test.cpp index 2ae60c9d..7b2a15f7 100644 --- a/test/fuzz/transformation_add_parameter_test.cpp +++ b/test/fuzz/transformation_add_parameter_test.cpp @@ -35,10 +35,6 @@ TEST(TransformationAddParameterTest, NonPointerBasicTest) { %7 = OpTypeBool %11 = OpTypeInt 32 1 %16 = OpTypeFloat 32 - %51 = OpConstant %11 2 - %52 = OpTypeArray %16 %51 - %53 = OpConstant %16 7 - %54 = OpConstantComposite %52 %53 %53 %3 = OpTypeFunction %2 %6 = OpTypeFunction %7 %7 %8 = OpConstant %11 23 @@ -144,14 +140,6 @@ TEST(TransformationAddParameterTest, NonPointerBasicTest) { context.get(), validator_options, kConsoleMessageConsumer)); ASSERT_TRUE(transformation_context.GetFactManager()->IdIsIrrelevant(60)); } - { - TransformationAddParameter correct(9, 68, 52, {{{13, 54}}}, 69); - ASSERT_TRUE(correct.IsApplicable(context.get(), transformation_context)); - ApplyAndCheckFreshIds(correct, context.get(), &transformation_context); - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed( - context.get(), validator_options, kConsoleMessageConsumer)); - ASSERT_TRUE(transformation_context.GetFactManager()->IdIsIrrelevant(68)); - } { TransformationAddParameter correct(17, 62, 7, {{}}, 63); ASSERT_TRUE(correct.IsApplicable(context.get(), transformation_context)); @@ -189,10 +177,6 @@ TEST(TransformationAddParameterTest, NonPointerBasicTest) { %7 = OpTypeBool %11 = OpTypeInt 32 1 %16 = OpTypeFloat 32 - %51 = OpConstant %11 2 - %52 = OpTypeArray %16 %51 - %53 = OpConstant %16 7 - %54 = OpConstantComposite %52 %53 %53 %3 = OpTypeFunction %2 %8 = OpConstant %11 23 %12 = OpConstantTrue %7 @@ -204,11 +188,11 @@ TEST(TransformationAddParameterTest, NonPointerBasicTest) { %41 = OpTypeStruct %11 %16 %42 = OpConstantComposite %41 %8 %32 %44 = OpTypeFunction %2 %41 %7 - %6 = OpTypeFunction %7 %7 %11 %52 + %6 = OpTypeFunction %7 %7 %11 %65 = OpTypeFunction %2 %31 %4 = OpFunction %2 None %3 %5 = OpLabel - %13 = OpFunctionCall %7 %9 %12 %8 %54 + %13 = OpFunctionCall %7 %9 %12 %8 OpReturn OpFunctionEnd @@ -216,7 +200,6 @@ TEST(TransformationAddParameterTest, NonPointerBasicTest) { %9 = OpFunction %7 None %6 %14 = OpFunctionParameter %7 %60 = OpFunctionParameter %11 - %68 = OpFunctionParameter %52 %10 = OpLabel OpReturnValue %12 OpFunctionEnd diff --git a/test/fuzz/transformation_add_synonym_test.cpp b/test/fuzz/transformation_add_synonym_test.cpp index ffcf1c9b..3803fa3a 100644 --- a/test/fuzz/transformation_add_synonym_test.cpp +++ b/test/fuzz/transformation_add_synonym_test.cpp @@ -197,7 +197,6 @@ TEST(TransformationAddSynonymTest, AddZeroSubZeroMulOne) { %37 = OpTypeVector %36 2 %38 = OpConstantTrue %36 %39 = OpConstantComposite %37 %38 %38 - %40 = OpConstant %6 37 %4 = OpFunction %2 None %3 %5 = OpLabel OpReturn @@ -250,29 +249,6 @@ TEST(TransformationAddSynonymTest, AddZeroSubZeroMulOne) { ++fresh_id; } } - { - TransformationAddSynonym transformation( - 40, protobufs::TransformationAddSynonym::BITWISE_OR, fresh_id, - insert_before); - ASSERT_TRUE( - transformation.IsApplicable(context.get(), transformation_context)); - ApplyAndCheckFreshIds(transformation, context.get(), - &transformation_context); - ASSERT_TRUE(transformation_context.GetFactManager()->IsSynonymous( - MakeDataDescriptor(40, {}), MakeDataDescriptor(fresh_id, {}))); - ++fresh_id; - } - { - TransformationAddSynonym transformation( - 40, protobufs::TransformationAddSynonym::BITWISE_XOR, fresh_id, - insert_before); - ASSERT_TRUE( - transformation.IsApplicable(context.get(), transformation_context)); - ApplyAndCheckFreshIds(transformation, context.get(), - &transformation_context); - ASSERT_TRUE(transformation_context.GetFactManager()->IsSynonymous( - MakeDataDescriptor(40, {}), MakeDataDescriptor(fresh_id, {}))); - } std::string expected_shader = R"( OpCapability Shader @@ -313,7 +289,6 @@ TEST(TransformationAddSynonymTest, AddZeroSubZeroMulOne) { %37 = OpTypeVector %36 2 %38 = OpConstantTrue %36 %39 = OpConstantComposite %37 %38 %38 - %40 = OpConstant %6 37 %4 = OpFunction %2 None %3 %5 = OpLabel %50 = OpIAdd %6 %9 %7 @@ -328,8 +303,6 @@ TEST(TransformationAddSynonymTest, AddZeroSubZeroMulOne) { %59 = OpFMul %14 %17 %16 %60 = OpFMul %18 %23 %20 %61 = OpIMul %24 %29 %26 - %62 = OpBitwiseOr %6 %40 %7 - %63 = OpBitwiseXor %6 %40 %7 OpReturn OpFunctionEnd )"; @@ -1242,10 +1215,9 @@ TEST(TransformationAddSynonymTest, MiscellaneousCopies) { ASSERT_TRUE(IsEqual(env, after_transformation, context.get())); } -TEST(TransformationAddSynonymTest, DoNotCopyNullPointers) { +TEST(TransformationAddSynonymTest, DoNotCopyNullOrUndefPointers) { std::string shader = R"( OpCapability Shader - OpCapability VariablePointers %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %4 "main" @@ -1256,6 +1228,7 @@ TEST(TransformationAddSynonymTest, DoNotCopyNullPointers) { %6 = OpTypeInt 32 1 %7 = OpTypePointer Function %6 %8 = OpConstantNull %7 + %9 = OpUndef %7 %4 = OpFunction %2 None %3 %5 = OpLabel OpReturn @@ -1275,6 +1248,12 @@ TEST(TransformationAddSynonymTest, DoNotCopyNullPointers) { 8, protobufs::TransformationAddSynonym::COPY_OBJECT, 100, MakeInstructionDescriptor(5, SpvOpReturn, 0)) .IsApplicable(context.get(), transformation_context)); + + // Illegal to copy an OpUndef of pointer type. + ASSERT_FALSE(TransformationAddSynonym( + 9, protobufs::TransformationAddSynonym::COPY_OBJECT, 100, + MakeInstructionDescriptor(5, SpvOpReturn, 0)) + .IsApplicable(context.get(), transformation_context)); } TEST(TransformationAddSynonymTest, PropagateIrrelevantPointeeFact) { diff --git a/test/fuzz/transformation_add_type_float_test.cpp b/test/fuzz/transformation_add_type_float_test.cpp index 9275bec1..dc57ccda 100644 --- a/test/fuzz/transformation_add_type_float_test.cpp +++ b/test/fuzz/transformation_add_type_float_test.cpp @@ -61,8 +61,7 @@ TEST(TransformationAddTypeFloatTest, IsApplicable) { ASSERT_FALSE( transformation.IsApplicable(context.get(), transformation_context)); - // The transformation is not applicable because there is already a 16-bit - // float type declared in the module. + // Tests existing 16-bit float type. transformation = TransformationAddTypeFloat(7, 16); ASSERT_FALSE( transformation.IsApplicable(context.get(), transformation_context)); @@ -71,19 +70,6 @@ TEST(TransformationAddTypeFloatTest, IsApplicable) { transformation = TransformationAddTypeFloat(7, 32); ASSERT_TRUE( transformation.IsApplicable(context.get(), transformation_context)); - - // By default, SPIR-V does not support 64-bit float types. - // Below we add such capability, so the test should now pass. - context.get()->get_feature_mgr()->AddCapability(SpvCapabilityFloat64); - ASSERT_TRUE(TransformationAddTypeFloat(7, 64).IsApplicable( - context.get(), transformation_context)); - -#ifndef NDEBUG - // Should not be able to add float type of width different from 16/32/64 - ASSERT_DEATH(TransformationAddTypeFloat(7, 20).IsApplicable( - context.get(), transformation_context), - "Unexpected float type width"); -#endif } TEST(TransformationAddTypeFloatTest, Apply) { diff --git a/test/fuzz/transformation_add_type_int_test.cpp b/test/fuzz/transformation_add_type_int_test.cpp index ed8e00a6..273420c5 100644 --- a/test/fuzz/transformation_add_type_int_test.cpp +++ b/test/fuzz/transformation_add_type_int_test.cpp @@ -85,29 +85,6 @@ TEST(TransformationAddTypeIntTest, IsApplicable) { transformation = TransformationAddTypeInt(7, 32, true); ASSERT_TRUE( transformation.IsApplicable(context.get(), transformation_context)); - - // By default SPIR-V does not support 16-bit integers. - // Below we add such capability, so the test should now be succesful. - context.get()->get_feature_mgr()->AddCapability(SpvCapabilityInt16); - ASSERT_TRUE(TransformationAddTypeInt(7, 16, true) - .IsApplicable(context.get(), transformation_context)); - - // By default SPIR-V does not support 64-bit integers. - // Below we add such capability, so the test should now pass. - context.get()->get_feature_mgr()->AddCapability(SpvCapabilityInt64); - ASSERT_TRUE(TransformationAddTypeInt(7, 64, true) - .IsApplicable(context.get(), transformation_context)); - -#ifndef NDEBUG - // Should not be able to add signed/unsigned integers of width different from - // 16/32/64 bits. - ASSERT_DEATH(TransformationAddTypeInt(7, 20, false) - .IsApplicable(context.get(), transformation_context), - "Unexpected integer type width"); - ASSERT_DEATH(TransformationAddTypeInt(12, 15, false) - .IsApplicable(context.get(), transformation_context), - "Unexpected integer type width"); -#endif } TEST(TransformationAddTypeIntTest, Apply) { diff --git a/test/fuzz/transformation_composite_construct_test.cpp b/test/fuzz/transformation_composite_construct_test.cpp index 3c5f7310..9b68721d 100644 --- a/test/fuzz/transformation_composite_construct_test.cpp +++ b/test/fuzz/transformation_composite_construct_test.cpp @@ -142,16 +142,10 @@ TEST(TransformationCompositeConstructTest, ConstructArrays) { TransformationCompositeConstruct make_vec2_array_length_3_bad( 37, {41, 45, 27, 27}, MakeInstructionDescriptor(46, SpvOpAccessChain, 0), 200); - // The first component does not correspond to an instruction with a result - // type so this check should return false. - TransformationCompositeConstruct make_vec2_array_length_3_nores( - 37, {2, 45, 27}, MakeInstructionDescriptor(46, SpvOpAccessChain, 0), 200); ASSERT_TRUE(make_vec2_array_length_3.IsApplicable(context.get(), transformation_context)); ASSERT_FALSE(make_vec2_array_length_3_bad.IsApplicable( context.get(), transformation_context)); - ASSERT_FALSE(make_vec2_array_length_3_nores.IsApplicable( - context.get(), transformation_context)); ASSERT_EQ(nullptr, context->get_def_use_mgr()->GetDef(200)); ASSERT_EQ(nullptr, context->get_instr_block(200)); uint32_t num_uses_of_41_before = context->get_def_use_mgr()->NumUses(41); @@ -429,15 +423,9 @@ TEST(TransformationCompositeConstructTest, ConstructMatrices) { // Bad: %35 is mat4x3, not mat3x4. TransformationCompositeConstruct make_mat34_bad( 35, {25, 28, 31}, MakeInstructionDescriptor(31, SpvOpReturn, 0), 200); - // The first component does not correspond to an instruction with a result - // type so this check should return false. - TransformationCompositeConstruct make_mat34_nores( - 32, {2, 28, 31}, MakeInstructionDescriptor(31, SpvOpReturn, 0), 200); ASSERT_TRUE(make_mat34.IsApplicable(context.get(), transformation_context)); ASSERT_FALSE( make_mat34_bad.IsApplicable(context.get(), transformation_context)); - ASSERT_FALSE( - make_mat34_nores.IsApplicable(context.get(), transformation_context)); ApplyAndCheckFreshIds(make_mat34, context.get(), &transformation_context); ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, kConsoleMessageConsumer)); @@ -648,15 +636,9 @@ TEST(TransformationCompositeConstructTest, ConstructStructs) { // Bad: Too few fields to make the struct. TransformationCompositeConstruct make_inner_bad( 9, {25}, MakeInstructionDescriptor(57, SpvOpAccessChain, 0), 200); - // The first component does not correspond to an instruction with a result - // type so this check should return false. - TransformationCompositeConstruct make_inner_nores( - 9, {2, 19}, MakeInstructionDescriptor(57, SpvOpAccessChain, 0), 200); ASSERT_TRUE(make_inner.IsApplicable(context.get(), transformation_context)); ASSERT_FALSE( make_inner_bad.IsApplicable(context.get(), transformation_context)); - ASSERT_FALSE( - make_inner_nores.IsApplicable(context.get(), transformation_context)); ApplyAndCheckFreshIds(make_inner, context.get(), &transformation_context); ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, kConsoleMessageConsumer)); diff --git a/test/fuzz/transformation_load_test.cpp b/test/fuzz/transformation_load_test.cpp index 370826eb..a03ffdd6 100644 --- a/test/fuzz/transformation_load_test.cpp +++ b/test/fuzz/transformation_load_test.cpp @@ -26,7 +26,6 @@ namespace { TEST(TransformationLoadTest, BasicTest) { std::string shader = R"( OpCapability Shader - OpCapability VariablePointers %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %4 "main" @@ -50,6 +49,7 @@ TEST(TransformationLoadTest, BasicTest) { %34 = OpTypeBool %35 = OpConstantFalse %34 %60 = OpConstantNull %50 + %61 = OpUndef %51 %52 = OpVariable %50 Private %53 = OpVariable %51 Private %4 = OpFunction %2 None %3 @@ -129,69 +129,65 @@ TEST(TransformationLoadTest, BasicTest) { // Pointers that cannot be used: // 60 - null + // 61 - undefined // Bad: id is not fresh - ASSERT_FALSE( - TransformationLoad(33, 33, false, 0, 0, - MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE(TransformationLoad( + 33, 33, MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) + .IsApplicable(context.get(), transformation_context)); // Bad: attempt to load from 11 from outside its function - ASSERT_FALSE( - TransformationLoad(100, 11, false, 0, 0, - MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE(TransformationLoad( + 100, 11, MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) + .IsApplicable(context.get(), transformation_context)); // Bad: pointer is not available - ASSERT_FALSE( - TransformationLoad(100, 33, false, 0, 0, - MakeInstructionDescriptor(45, SpvOpCopyObject, 0)) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE(TransformationLoad( + 100, 33, MakeInstructionDescriptor(45, SpvOpCopyObject, 0)) + .IsApplicable(context.get(), transformation_context)); // Bad: attempt to insert before OpVariable - ASSERT_FALSE( - TransformationLoad(100, 27, false, 0, 0, - MakeInstructionDescriptor(27, SpvOpVariable, 0)) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE(TransformationLoad( + 100, 27, MakeInstructionDescriptor(27, SpvOpVariable, 0)) + .IsApplicable(context.get(), transformation_context)); // Bad: pointer id does not exist ASSERT_FALSE( - TransformationLoad(100, 1000, false, 0, 0, + TransformationLoad(100, 1000, MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) .IsApplicable(context.get(), transformation_context)); // Bad: pointer id exists but does not have a type - ASSERT_FALSE( - TransformationLoad(100, 5, false, 0, 0, - MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - - // Bad: pointer id exists and has a type, but is not a pointer - ASSERT_FALSE( - TransformationLoad(100, 24, false, 0, 0, - MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - - // Bad: attempt to load from null pointer - ASSERT_FALSE( - TransformationLoad(100, 60, false, 0, 0, - MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - - // Bad: %40 is not available at the program point - ASSERT_FALSE(TransformationLoad(100, 40, false, 0, 0, - MakeInstructionDescriptor(37, SpvOpReturn, 0)) + ASSERT_FALSE(TransformationLoad( + 100, 5, MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) .IsApplicable(context.get(), transformation_context)); - // Bad: The described instruction does not exist + // Bad: pointer id exists and has a type, but is not a pointer + ASSERT_FALSE(TransformationLoad( + 100, 24, MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) + .IsApplicable(context.get(), transformation_context)); + + // Bad: attempt to load from null pointer + ASSERT_FALSE(TransformationLoad( + 100, 60, MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) + .IsApplicable(context.get(), transformation_context)); + + // Bad: attempt to load from undefined pointer + ASSERT_FALSE(TransformationLoad( + 100, 61, MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) + .IsApplicable(context.get(), transformation_context)); + // Bad: %40 is not available at the program point ASSERT_FALSE( - TransformationLoad(100, 33, false, 0, 0, - MakeInstructionDescriptor(1000, SpvOpReturn, 0)) + TransformationLoad(100, 40, MakeInstructionDescriptor(37, SpvOpReturn, 0)) .IsApplicable(context.get(), transformation_context)); + // Bad: The described instruction does not exist + ASSERT_FALSE(TransformationLoad( + 100, 33, MakeInstructionDescriptor(1000, SpvOpReturn, 0)) + .IsApplicable(context.get(), transformation_context)); + { TransformationLoad transformation( - 100, 33, false, 0, 0, - MakeInstructionDescriptor(38, SpvOpAccessChain, 0)); + 100, 33, MakeInstructionDescriptor(38, SpvOpAccessChain, 0)); ASSERT_TRUE( transformation.IsApplicable(context.get(), transformation_context)); ApplyAndCheckFreshIds(transformation, context.get(), @@ -202,8 +198,7 @@ TEST(TransformationLoadTest, BasicTest) { { TransformationLoad transformation( - 101, 46, false, 0, 0, - MakeInstructionDescriptor(16, SpvOpReturnValue, 0)); + 101, 46, MakeInstructionDescriptor(16, SpvOpReturnValue, 0)); ASSERT_TRUE( transformation.IsApplicable(context.get(), transformation_context)); ApplyAndCheckFreshIds(transformation, context.get(), @@ -214,8 +209,7 @@ TEST(TransformationLoadTest, BasicTest) { { TransformationLoad transformation( - 102, 16, false, 0, 0, - MakeInstructionDescriptor(16, SpvOpReturnValue, 0)); + 102, 16, MakeInstructionDescriptor(16, SpvOpReturnValue, 0)); ASSERT_TRUE( transformation.IsApplicable(context.get(), transformation_context)); ApplyAndCheckFreshIds(transformation, context.get(), @@ -226,8 +220,7 @@ TEST(TransformationLoadTest, BasicTest) { { TransformationLoad transformation( - 103, 40, false, 0, 0, - MakeInstructionDescriptor(43, SpvOpAccessChain, 0)); + 103, 40, MakeInstructionDescriptor(43, SpvOpAccessChain, 0)); ASSERT_TRUE( transformation.IsApplicable(context.get(), transformation_context)); ApplyAndCheckFreshIds(transformation, context.get(), @@ -238,7 +231,6 @@ TEST(TransformationLoadTest, BasicTest) { std::string after_transformation = R"( OpCapability Shader - OpCapability VariablePointers %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %4 "main" @@ -262,6 +254,7 @@ TEST(TransformationLoadTest, BasicTest) { %34 = OpTypeBool %35 = OpConstantFalse %34 %60 = OpConstantNull %50 + %61 = OpUndef %51 %52 = OpVariable %50 Private %53 = OpVariable %51 Private %4 = OpFunction %2 None %3 @@ -300,296 +293,6 @@ TEST(TransformationLoadTest, BasicTest) { ASSERT_TRUE(IsEqual(env, after_transformation, context.get())); } -TEST(TransformationLoadTest, AtomicLoadTestCase) { - const std::string shader = R"( - OpCapability Shader - OpCapability Int8 - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 320 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %7 = OpTypeInt 8 1 - %9 = OpTypeInt 32 0 - %26 = OpTypeFloat 32 - %8 = OpTypeStruct %6 - %10 = OpTypePointer StorageBuffer %8 - %11 = OpVariable %10 StorageBuffer - %19 = OpConstant %26 0 - %18 = OpConstant %9 1 - %12 = OpConstant %6 0 - %13 = OpTypePointer StorageBuffer %6 - %15 = OpConstant %6 4 - %16 = OpConstant %6 7 - %17 = OpConstant %7 4 - %20 = OpConstant %9 64 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %14 = OpAccessChain %13 %11 %12 - %24 = OpAccessChain %13 %11 %12 - OpReturn - OpFunctionEnd - )"; - - const auto env = SPV_ENV_UNIVERSAL_1_3; - const auto consumer = nullptr; - const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - TransformationContext transformation_context( - MakeUnique(context.get()), validator_options); - - // Bad: id is not fresh. - ASSERT_FALSE( - TransformationLoad(14, 14, true, 15, 20, - MakeInstructionDescriptor(24, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - - // Bad: id 100 of memory scope instruction does not exist. - ASSERT_FALSE( - TransformationLoad(21, 14, true, 100, 20, - MakeInstructionDescriptor(24, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - // Bad: id 100 of memory semantics instruction does not exist. - ASSERT_FALSE( - TransformationLoad(21, 14, true, 15, 100, - MakeInstructionDescriptor(24, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - // Bad: memory scope should be |OpConstant| opcode. - ASSERT_FALSE( - TransformationLoad(21, 14, true, 5, 20, - MakeInstructionDescriptor(24, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - // Bad: memory semantics should be |OpConstant| opcode. - ASSERT_FALSE( - TransformationLoad(21, 14, true, 15, 5, - MakeInstructionDescriptor(24, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - - // Bad: The memory scope instruction must have an Integer operand. - ASSERT_FALSE( - TransformationLoad(21, 14, true, 15, 19, - MakeInstructionDescriptor(24, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - // Bad: The memory memory semantics instruction must have an Integer operand. - ASSERT_FALSE( - TransformationLoad(21, 14, true, 19, 20, - MakeInstructionDescriptor(24, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - - // Bad: Integer size of the memory scope must be equal to 32 bits. - ASSERT_FALSE( - TransformationLoad(21, 14, true, 17, 20, - MakeInstructionDescriptor(24, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - - // Bad: Integer size of memory semantics must be equal to 32 bits. - ASSERT_FALSE( - TransformationLoad(21, 14, true, 15, 17, - MakeInstructionDescriptor(24, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - - // Bad: memory scope value must be 4 (SpvScopeInvocation). - ASSERT_FALSE( - TransformationLoad(21, 14, true, 16, 20, - MakeInstructionDescriptor(24, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - - // Bad: memory semantics value must be either: - // 64 (SpvMemorySemanticsUniformMemoryMask) - // 256 (SpvMemorySemanticsWorkgroupMemoryMask) - ASSERT_FALSE( - TransformationLoad(21, 14, true, 15, 16, - MakeInstructionDescriptor(24, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - - // Bad: The described instruction does not exist - ASSERT_FALSE( - TransformationLoad(21, 14, false, 15, 20, - MakeInstructionDescriptor(150, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - - // Successful transformations. - { - TransformationLoad transformation( - 21, 14, true, 15, 20, - MakeInstructionDescriptor(24, SpvOpAccessChain, 0)); - ASSERT_TRUE( - transformation.IsApplicable(context.get(), transformation_context)); - ApplyAndCheckFreshIds(transformation, context.get(), - &transformation_context); - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed( - context.get(), validator_options, kConsoleMessageConsumer)); - } - - const std::string after_transformation = R"( - OpCapability Shader - OpCapability Int8 - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 320 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %7 = OpTypeInt 8 1 - %9 = OpTypeInt 32 0 - %26 = OpTypeFloat 32 - %8 = OpTypeStruct %6 - %10 = OpTypePointer StorageBuffer %8 - %11 = OpVariable %10 StorageBuffer - %19 = OpConstant %26 0 - %18 = OpConstant %9 1 - %12 = OpConstant %6 0 - %13 = OpTypePointer StorageBuffer %6 - %15 = OpConstant %6 4 - %16 = OpConstant %6 7 - %17 = OpConstant %7 4 - %20 = OpConstant %9 64 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %14 = OpAccessChain %13 %11 %12 - %21 = OpAtomicLoad %6 %14 %15 %20 - %24 = OpAccessChain %13 %11 %12 - OpReturn - OpFunctionEnd - )"; - - ASSERT_TRUE(IsEqual(env, after_transformation, context.get())); -} - -TEST(TransformationLoadTest, AtomicLoadTestCaseForWorkgroupMemory) { - std::string shader = R"( - OpCapability Shader - OpCapability Int8 - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %26 = OpTypeFloat 32 - %27 = OpTypeInt 8 1 - %7 = OpTypeInt 32 0 ; 0 means unsigned - %8 = OpConstant %7 0 - %17 = OpConstant %27 4 - %19 = OpConstant %26 0 - %9 = OpTypePointer Function %6 - %13 = OpTypeStruct %6 - %12 = OpTypePointer Workgroup %13 - %11 = OpVariable %12 Workgroup - %14 = OpConstant %6 0 - %15 = OpTypePointer Function %6 - %51 = OpTypePointer Private %6 - %21 = OpConstant %6 4 - %23 = OpConstant %6 256 - %25 = OpTypePointer Function %7 - %50 = OpTypePointer Workgroup %6 - %34 = OpTypeBool - %35 = OpConstantFalse %34 - %53 = OpVariable %51 Private - %4 = OpFunction %2 None %3 - %5 = OpLabel - OpSelectionMerge %37 None - OpBranchConditional %35 %36 %37 - %36 = OpLabel - %38 = OpAccessChain %50 %11 %14 - %40 = OpAccessChain %50 %11 %14 - OpBranch %37 - %37 = OpLabel - OpReturn - OpFunctionEnd - )"; - - const auto env = SPV_ENV_UNIVERSAL_1_3; - const auto consumer = nullptr; - const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - TransformationContext transformation_context( - MakeUnique(context.get()), validator_options); - - // Bad: Can't insert OpAccessChain before the id 23 of memory scope. - ASSERT_FALSE( - TransformationLoad(60, 38, true, 21, 23, - MakeInstructionDescriptor(23, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - - // Bad: Can't insert OpAccessChain before the id 23 of memory semantics. - ASSERT_FALSE( - TransformationLoad(60, 38, true, 21, 23, - MakeInstructionDescriptor(21, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - - // Successful transformations. - { - TransformationLoad transformation( - 60, 38, true, 21, 23, - MakeInstructionDescriptor(40, SpvOpAccessChain, 0)); - ASSERT_TRUE( - transformation.IsApplicable(context.get(), transformation_context)); - ApplyAndCheckFreshIds(transformation, context.get(), - &transformation_context); - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed( - context.get(), validator_options, kConsoleMessageConsumer)); - } - - std::string after_transformation = R"( - OpCapability Shader - OpCapability Int8 - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %26 = OpTypeFloat 32 - %27 = OpTypeInt 8 1 - %7 = OpTypeInt 32 0 ; 0 means unsigned - %8 = OpConstant %7 0 - %17 = OpConstant %27 4 - %19 = OpConstant %26 0 - %9 = OpTypePointer Function %6 - %13 = OpTypeStruct %6 - %12 = OpTypePointer Workgroup %13 - %11 = OpVariable %12 Workgroup - %14 = OpConstant %6 0 - %15 = OpTypePointer Function %6 - %51 = OpTypePointer Private %6 - %21 = OpConstant %6 4 - %23 = OpConstant %6 256 - %25 = OpTypePointer Function %7 - %50 = OpTypePointer Workgroup %6 - %34 = OpTypeBool - %35 = OpConstantFalse %34 - %53 = OpVariable %51 Private - %4 = OpFunction %2 None %3 - %5 = OpLabel - OpSelectionMerge %37 None - OpBranchConditional %35 %36 %37 - %36 = OpLabel - %38 = OpAccessChain %50 %11 %14 - %60 = OpAtomicLoad %6 %38 %21 %23 - %40 = OpAccessChain %50 %11 %14 - OpBranch %37 - %37 = OpLabel - OpReturn - OpFunctionEnd - )"; - - ASSERT_TRUE(IsEqual(env, after_transformation, context.get())); -} - } // namespace } // namespace fuzz } // namespace spvtools diff --git a/test/fuzz/transformation_merge_function_returns_test.cpp b/test/fuzz/transformation_merge_function_returns_test.cpp index 400d49ad..e60d3458 100644 --- a/test/fuzz/transformation_merge_function_returns_test.cpp +++ b/test/fuzz/transformation_merge_function_returns_test.cpp @@ -147,12 +147,12 @@ TEST(TransformationMergeFunctionReturnsTest, SimpleInapplicable) { MakeUnique(context.get()), validator_options); // Function %1 does not exist. - ASSERT_FALSE(TransformationMergeFunctionReturns(1, 100, 200, 101, 0, 0, {{}}) + ASSERT_FALSE(TransformationMergeFunctionReturns(1, 100, 101, 0, 0, {{}}) .IsApplicable(context.get(), transformation_context)); // The entry block (%22) of function %15 does not branch unconditionally to // the following block. - ASSERT_FALSE(TransformationMergeFunctionReturns(16, 100, 200, 101, 0, 0, {{}}) + ASSERT_FALSE(TransformationMergeFunctionReturns(16, 100, 101, 0, 0, {{}}) .IsApplicable(context.get(), transformation_context)); // Block %28 is the merge block of a loop containing a return instruction, but @@ -160,7 +160,7 @@ TEST(TransformationMergeFunctionReturnsTest, SimpleInapplicable) { // not OpLabel, OpPhi or OpBranch). ASSERT_FALSE( TransformationMergeFunctionReturns( - 18, 100, 200, 101, 0, 0, {{MakeReturnMergingInfo(29, 102, 0, {{}})}}) + 18, 100, 101, 0, 0, {{MakeReturnMergingInfo(29, 102, 0, {{}})}}) .IsApplicable(context.get(), transformation_context)); // Block %34 is the merge block of a loop containing a return instruction, but @@ -168,24 +168,21 @@ TEST(TransformationMergeFunctionReturnsTest, SimpleInapplicable) { // that are not OpLabel, OpPhi or OpBranch). ASSERT_FALSE( TransformationMergeFunctionReturns( - 20, 100, 200, 101, 0, 0, {{MakeReturnMergingInfo(35, 102, 0, {{}})}}) + 20, 100, 101, 0, 0, {{MakeReturnMergingInfo(35, 102, 0, {{}})}}) .IsApplicable(context.get(), transformation_context)); // Id %1000 cannot be found in the module and there is no id of the correct // type (float) available at the end of the entry block of function %21. - ASSERT_FALSE( - TransformationMergeFunctionReturns(22, 100, 200, 101, 102, 1000, {{}}) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE(TransformationMergeFunctionReturns(22, 100, 101, 102, 1000, {{}}) + .IsApplicable(context.get(), transformation_context)); // Id %47 is of type float, while function %45 has return type int. - ASSERT_FALSE( - TransformationMergeFunctionReturns(45, 100, 200, 101, 102, 47, {{}}) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE(TransformationMergeFunctionReturns(45, 100, 101, 102, 47, {{}}) + .IsApplicable(context.get(), transformation_context)); // Id %50 is not available at the end of the entry block of function %45. - ASSERT_FALSE( - TransformationMergeFunctionReturns(45, 100, 200, 101, 102, 50, {{}}) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE(TransformationMergeFunctionReturns(45, 100, 101, 102, 50, {{}}) + .IsApplicable(context.get(), transformation_context)); } TEST(TransformationMergeFunctionReturnsTest, MissingBooleans) { @@ -238,9 +235,8 @@ TEST(TransformationMergeFunctionReturnsTest, MissingBooleans) { TransformationContext transformation_context( MakeUnique(context.get()), validator_options); - ASSERT_FALSE( - TransformationMergeFunctionReturns(3, 100, 200, 101, 0, 0, {{}}) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE(TransformationMergeFunctionReturns(3, 100, 101, 0, 0, {{}}) + .IsApplicable(context.get(), transformation_context)); } { // OpConstantFalse is missing. @@ -291,9 +287,8 @@ TEST(TransformationMergeFunctionReturnsTest, MissingBooleans) { TransformationContext transformation_context( MakeUnique(context.get()), validator_options); - ASSERT_FALSE( - TransformationMergeFunctionReturns(3, 100, 200, 101, 0, 0, {{}}) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE(TransformationMergeFunctionReturns(3, 100, 101, 0, 0, {{}}) + .IsApplicable(context.get(), transformation_context)); } } @@ -391,65 +386,59 @@ TEST(TransformationMergeFunctionReturnsTest, InvalidIds) { // Fresh id %100 is used twice. ASSERT_FALSE( TransformationMergeFunctionReturns( - 17, 100, 200, 100, 0, 0, {{MakeReturnMergingInfo(20, 101, 0, {{}})}}) + 17, 100, 100, 0, 0, {{MakeReturnMergingInfo(20, 101, 0, {{}})}}) .IsApplicable(context.get(), transformation_context)); // Fresh id %100 is used twice. ASSERT_FALSE( TransformationMergeFunctionReturns( - 17, 100, 200, 101, 0, 0, {{MakeReturnMergingInfo(20, 100, 0, {{}})}}) + 17, 100, 101, 0, 0, {{MakeReturnMergingInfo(20, 100, 0, {{}})}}) .IsApplicable(context.get(), transformation_context)); // %0 cannot be a fresh id for the new merge block. ASSERT_FALSE( TransformationMergeFunctionReturns( - 17, 100, 200, 0, 0, 0, {{MakeReturnMergingInfo(20, 101, 0, {{}})}}) - .IsApplicable(context.get(), transformation_context)); - - // %0 cannot be a fresh id for the new continue block. - ASSERT_FALSE( - TransformationMergeFunctionReturns( - 17, 100, 0, 200, 0, 0, {{MakeReturnMergingInfo(20, 101, 0, {{}})}}) + 17, 100, 0, 0, 0, {{MakeReturnMergingInfo(20, 101, 0, {{}})}}) .IsApplicable(context.get(), transformation_context)); // %0 cannot be a fresh id for the new header block. ASSERT_FALSE( TransformationMergeFunctionReturns( - 17, 0, 200, 100, 0, 0, {{MakeReturnMergingInfo(20, 101, 0, {{}})}}) + 17, 0, 100, 0, 0, {{MakeReturnMergingInfo(20, 101, 0, {{}})}}) .IsApplicable(context.get(), transformation_context)); // %0 cannot be a fresh id for the new |is_returning| instruction in an // existing merge block. ASSERT_FALSE( TransformationMergeFunctionReturns( - 17, 100, 200, 101, 0, 0, {{MakeReturnMergingInfo(20, 0, 0, {{}})}}) + 17, 100, 101, 0, 0, {{MakeReturnMergingInfo(20, 0, 0, {{}})}}) .IsApplicable(context.get(), transformation_context)); // %0 cannot be a fresh id for the new |return_val| instruction in the new // return block. - ASSERT_FALSE(TransformationMergeFunctionReturns( - 14, 100, 200, 101, 0, 10, - {{MakeReturnMergingInfo(27, 102, 103, {{}})}}) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE( + TransformationMergeFunctionReturns( + 14, 100, 101, 0, 10, {{MakeReturnMergingInfo(27, 102, 103, {{}})}}) + .IsApplicable(context.get(), transformation_context)); // %0 cannot be a fresh id for the new |maybe_return_val| instruction in an // existing merge block, inside a non-void function. - ASSERT_FALSE(TransformationMergeFunctionReturns( - 14, 100, 200, 101, 102, 10, - {{MakeReturnMergingInfo(27, 103, 0, {{}})}}) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE( + TransformationMergeFunctionReturns( + 14, 100, 101, 102, 10, {{MakeReturnMergingInfo(27, 103, 0, {{}})}}) + .IsApplicable(context.get(), transformation_context)); // Fresh id %102 is repeated. - ASSERT_FALSE(TransformationMergeFunctionReturns( - 14, 100, 200, 101, 102, 10, - {{MakeReturnMergingInfo(27, 102, 104, {{}})}}) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE( + TransformationMergeFunctionReturns( + 14, 100, 101, 102, 10, {{MakeReturnMergingInfo(27, 102, 104, {{}})}}) + .IsApplicable(context.get(), transformation_context)); // Id %11 (type int) does not have the correct type (float) for OpPhi // instruction %31. ASSERT_FALSE( TransformationMergeFunctionReturns( - 16, 100, 200, 101, 0, 0, + 16, 100, 101, 0, 0, {{MakeReturnMergingInfo(36, 103, 104, {{{31, 11}, {32, 11}}})}}) .IsApplicable(context.get(), transformation_context)); @@ -457,21 +446,21 @@ TEST(TransformationMergeFunctionReturnsTest, InvalidIds) { // instruction %31. ASSERT_FALSE( TransformationMergeFunctionReturns( - 16, 100, 200, 101, 0, 0, + 16, 100, 101, 0, 0, {{MakeReturnMergingInfo(36, 102, 0, {{{31, 11}, {32, 11}}})}}) .IsApplicable(context.get(), transformation_context)); // Id %43 is not available at the end of the entry block. ASSERT_FALSE( TransformationMergeFunctionReturns( - 16, 100, 200, 101, 0, 0, + 16, 100, 101, 0, 0, {{MakeReturnMergingInfo(36, 102, 0, {{{31, 44}, {32, 11}}})}}) .IsApplicable(context.get(), transformation_context)); // There is not a mapping for id %31 (float OpPhi instruction in a loop merge // block) and no suitable id is available at the end of the entry block. ASSERT_FALSE(TransformationMergeFunctionReturns( - 16, 100, 200, 101, 0, 0, + 16, 100, 101, 0, 0, {{MakeReturnMergingInfo(36, 102, 0, {{{32, 11}}})}}) .IsApplicable(context.get(), transformation_context)); @@ -479,7 +468,7 @@ TEST(TransformationMergeFunctionReturnsTest, InvalidIds) { // available at the end of the entry block. ASSERT_FALSE( TransformationMergeFunctionReturns( - 16, 100, 200, 101, 0, 0, + 16, 100, 101, 0, 0, {{MakeReturnMergingInfo(36, 102, 0, {{{31, 1000}, {32, 11}}})}}) .IsApplicable(context.get(), transformation_context)); } @@ -571,7 +560,7 @@ TEST(TransformationMergeFunctionReturnsTest, Simple) { // The 0s are allowed because the function's return type is void. auto transformation1 = - TransformationMergeFunctionReturns(14, 100, 200, 101, 0, 0, {{}}); + TransformationMergeFunctionReturns(14, 100, 101, 0, 0, {{}}); ASSERT_TRUE( transformation1.IsApplicable(context.get(), transformation_context)); ApplyAndCheckFreshIds(transformation1, context.get(), @@ -581,14 +570,13 @@ TEST(TransformationMergeFunctionReturnsTest, Simple) { // %12 is available at the end of the entry block of %19 (it is a global // variable). - ASSERT_TRUE( - TransformationMergeFunctionReturns(19, 110, 210, 111, 112, 12, {{}}) - .IsApplicable(context.get(), transformation_context)); + ASSERT_TRUE(TransformationMergeFunctionReturns(19, 110, 111, 112, 12, {{}}) + .IsApplicable(context.get(), transformation_context)); // %1000 cannot be found in the module, but there is a suitable id available // at the end of the entry block (%12). auto transformation2 = - TransformationMergeFunctionReturns(19, 110, 210, 111, 112, 1000, {{}}); + TransformationMergeFunctionReturns(19, 110, 111, 112, 1000, {{}}); ASSERT_TRUE( transformation2.IsApplicable(context.get(), transformation_context)); ApplyAndCheckFreshIds(transformation2, context.get(), @@ -598,14 +586,13 @@ TEST(TransformationMergeFunctionReturnsTest, Simple) { // %27 is available at the end of the entry block of %26 (it is a function // parameter). - ASSERT_TRUE( - TransformationMergeFunctionReturns(26, 120, 220, 121, 122, 27, {{}}) - .IsApplicable(context.get(), transformation_context)); + ASSERT_TRUE(TransformationMergeFunctionReturns(26, 120, 121, 122, 27, {{}}) + .IsApplicable(context.get(), transformation_context)); // %1000 cannot be found in the module, but there is a suitable id available // at the end of the entry block (%27). auto transformation3 = - TransformationMergeFunctionReturns(26, 120, 220, 121, 122, 1000, {{}}); + TransformationMergeFunctionReturns(26, 120, 121, 122, 1000, {{}}); ASSERT_TRUE( transformation3.IsApplicable(context.get(), transformation_context)); ApplyAndCheckFreshIds(transformation3, context.get(), @@ -615,14 +602,13 @@ TEST(TransformationMergeFunctionReturnsTest, Simple) { // %35 is available at the end of the entry block of %33 (it is in the entry // block). - ASSERT_TRUE( - TransformationMergeFunctionReturns(26, 130, 230, 131, 132, 27, {{}}) - .IsApplicable(context.get(), transformation_context)); + ASSERT_TRUE(TransformationMergeFunctionReturns(26, 130, 131, 132, 27, {{}}) + .IsApplicable(context.get(), transformation_context)); // %1000 cannot be found in the module, but there is a suitable id available // at the end of the entry block (%35). auto transformation4 = - TransformationMergeFunctionReturns(33, 130, 230, 131, 132, 1000, {{}}); + TransformationMergeFunctionReturns(33, 130, 131, 132, 1000, {{}}); ASSERT_TRUE( transformation4.IsApplicable(context.get(), transformation_context)); ApplyAndCheckFreshIds(transformation4, context.get(), @@ -656,8 +642,8 @@ TEST(TransformationMergeFunctionReturnsTest, Simple) { %15 = OpLabel OpBranch %100 %100 = OpLabel - OpLoopMerge %101 %200 None - OpBranch %16 + OpLoopMerge %101 %100 None + OpBranchConditional %11 %16 %100 %16 = OpLabel OpSelectionMerge %17 None OpBranchConditional %11 %18 %17 @@ -667,15 +653,13 @@ TEST(TransformationMergeFunctionReturnsTest, Simple) { OpBranch %101 %101 = OpLabel OpReturn - %200 = OpLabel - OpBranch %100 OpFunctionEnd %19 = OpFunction %5 None %6 %20 = OpLabel OpBranch %110 %110 = OpLabel - OpLoopMerge %111 %210 None - OpBranch %21 + OpLoopMerge %111 %110 None + OpBranchConditional %11 %21 %110 %21 = OpLabel OpSelectionMerge %22 None OpBranchConditional %11 %23 %24 @@ -689,16 +673,14 @@ TEST(TransformationMergeFunctionReturnsTest, Simple) { %111 = OpLabel %112 = OpPhi %5 %12 %23 %25 %24 OpReturnValue %112 - %210 = OpLabel - OpBranch %110 OpFunctionEnd %26 = OpFunction %7 None %8 %27 = OpFunctionParameter %7 %28 = OpLabel OpBranch %120 %120 = OpLabel - OpLoopMerge %121 %220 None - OpBranch %29 + OpLoopMerge %121 %120 None + OpBranchConditional %11 %29 %120 %29 = OpLabel OpSelectionMerge %30 None OpBranchConditional %11 %31 %30 @@ -710,16 +692,14 @@ TEST(TransformationMergeFunctionReturnsTest, Simple) { %121 = OpLabel %122 = OpPhi %7 %27 %30 %32 %31 OpReturnValue %122 - %220 = OpLabel - OpBranch %120 OpFunctionEnd %33 = OpFunction %7 None %9 %34 = OpLabel %35 = OpConvertSToF %7 %12 OpBranch %130 %130 = OpLabel - OpLoopMerge %131 %230 None - OpBranch %36 + OpLoopMerge %131 %130 None + OpBranchConditional %11 %36 %130 %36 = OpLabel OpSelectionMerge %37 None OpBranchConditional %11 %38 %37 @@ -731,8 +711,6 @@ TEST(TransformationMergeFunctionReturnsTest, Simple) { %131 = OpLabel %132 = OpPhi %7 %35 %37 %39 %38 OpReturnValue %132 - %230 = OpLabel - OpBranch %130 OpFunctionEnd )"; @@ -765,8 +743,8 @@ TEST(TransformationMergeFunctionReturnsTest, NestedLoops) { %15 = OpLabel OpBranch %16 %16 = OpLabel - OpLoopMerge %17 %916 None - OpBranch %18 + OpLoopMerge %17 %16 None + OpBranchConditional %8 %18 %16 %18 = OpLabel OpLoopMerge %19 %20 None OpBranchConditional %8 %19 %21 @@ -789,8 +767,8 @@ TEST(TransformationMergeFunctionReturnsTest, NestedLoops) { %28 = OpLabel OpBranch %29 %29 = OpLabel - OpLoopMerge %30 %929 None - OpBranch %30 + OpLoopMerge %30 %29 None + OpBranchConditional %8 %30 %29 %30 = OpLabel OpLoopMerge %31 %32 None OpBranch %33 @@ -814,10 +792,6 @@ TEST(TransformationMergeFunctionReturnsTest, NestedLoops) { OpBranch %38 %38 = OpLabel OpReturnValue %12 - %916 = OpLabel - OpBranch %16 - %929 = OpLabel - OpBranch %29 OpFunctionEnd )"; @@ -831,7 +805,7 @@ TEST(TransformationMergeFunctionReturnsTest, NestedLoops) { MakeUnique(context.get()), validator_options); auto transformation = TransformationMergeFunctionReturns( - 14, 100, 200, 101, 102, 11, + 14, 100, 101, 102, 11, {{MakeReturnMergingInfo(19, 103, 104, {{}}), MakeReturnMergingInfo(17, 105, 106, {{}}), MakeReturnMergingInfo(31, 107, 108, {{{35, 10}, {36, 12}}}), @@ -867,11 +841,11 @@ TEST(TransformationMergeFunctionReturnsTest, NestedLoops) { %15 = OpLabel OpBranch %100 %100 = OpLabel - OpLoopMerge %101 %200 None - OpBranch %16 + OpLoopMerge %101 %100 None + OpBranchConditional %8 %16 %100 %16 = OpLabel - OpLoopMerge %17 %916 None - OpBranch %18 + OpLoopMerge %17 %16 None + OpBranchConditional %8 %18 %16 %18 = OpLabel OpLoopMerge %19 %20 None OpBranchConditional %8 %19 %21 @@ -898,8 +872,8 @@ TEST(TransformationMergeFunctionReturnsTest, NestedLoops) { %28 = OpLabel OpBranch %29 %29 = OpLabel - OpLoopMerge %30 %929 None - OpBranch %30 + OpLoopMerge %30 %29 None + OpBranchConditional %8 %30 %29 %30 = OpLabel OpLoopMerge %31 %32 None OpBranch %33 @@ -927,15 +901,9 @@ TEST(TransformationMergeFunctionReturnsTest, NestedLoops) { OpBranchConditional %109 %101 %38 %38 = OpLabel OpBranch %101 - %916 = OpLabel - OpBranch %16 - %929 = OpLabel - OpBranch %29 %101 = OpLabel %102 = OpPhi %5 %106 %17 %110 %23 %12 %38 OpReturnValue %102 - %200 = OpLabel - OpBranch %100 OpFunctionEnd )"; @@ -1029,7 +997,7 @@ TEST(TransformationMergeFunctionReturnsTest, OverflowIds) { // No mapping from merge block %16 to fresh ids is given, so overflow ids are // needed. auto transformation1 = - TransformationMergeFunctionReturns(12, 100, 200, 101, 102, 10, {{}}); + TransformationMergeFunctionReturns(12, 100, 101, 102, 10, {{}}); #ifndef NDEBUG ASSERT_DEATH( @@ -1048,7 +1016,7 @@ TEST(TransformationMergeFunctionReturnsTest, OverflowIds) { // No mapping from merge block %27 to fresh ids is given, so overflow ids are // needed. auto transformation2 = - TransformationMergeFunctionReturns(24, 110, 210, 111, 0, 0, {{}}); + TransformationMergeFunctionReturns(24, 110, 111, 0, 0, {{}}); #ifndef NDEBUG ASSERT_DEATH( @@ -1086,8 +1054,8 @@ TEST(TransformationMergeFunctionReturnsTest, OverflowIds) { %13 = OpLabel OpBranch %100 %100 = OpLabel - OpLoopMerge %101 %200 None - OpBranch %14 + OpLoopMerge %101 %100 None + OpBranchConditional %8 %14 %100 %14 = OpLabel %15 = OpIAdd %5 %10 %10 OpLoopMerge %16 %17 None @@ -1113,15 +1081,13 @@ TEST(TransformationMergeFunctionReturnsTest, OverflowIds) { %101 = OpLabel %102 = OpPhi %5 %1001 %16 %22 %23 OpReturnValue %102 - %200 = OpLabel - OpBranch %100 OpFunctionEnd %24 = OpFunction %3 None %4 %25 = OpLabel OpBranch %110 %110 = OpLabel - OpLoopMerge %111 %210 None - OpBranch %26 + OpLoopMerge %111 %110 None + OpBranchConditional %8 %26 %110 %26 = OpLabel OpLoopMerge %27 %28 None OpBranch %29 @@ -1144,8 +1110,6 @@ TEST(TransformationMergeFunctionReturnsTest, OverflowIds) { OpBranch %111 %111 = OpLabel OpReturn - %210 = OpLabel - OpBranch %110 OpFunctionEnd )"; @@ -1215,7 +1179,7 @@ TEST(TransformationMergeFunctionReturnsTest, MissingIdsForOpPhi) { // corresponding mapping. auto transformation = TransformationMergeFunctionReturns( - 12, 101, 200, 102, 0, 0, + 12, 101, 102, 0, 0, {{MakeReturnMergingInfo(17, 103, 0, {{{25, 7}, {35, 8}}})}}); ASSERT_TRUE( transformation.IsApplicable(context.get(), transformation_context)); @@ -1248,8 +1212,8 @@ TEST(TransformationMergeFunctionReturnsTest, MissingIdsForOpPhi) { %15 = OpConvertSToF %10 %13 OpBranch %101 %101 = OpLabel - OpLoopMerge %102 %200 None - OpBranch %16 + OpLoopMerge %102 %101 None + OpBranchConditional %6 %16 %101 %16 = OpLabel OpLoopMerge %17 %18 None OpBranch %19 @@ -1274,8 +1238,6 @@ TEST(TransformationMergeFunctionReturnsTest, MissingIdsForOpPhi) { OpBranch %102 %102 = OpLabel OpReturn - %200 = OpLabel - OpBranch %101 OpFunctionEnd )"; @@ -1362,14 +1324,14 @@ TEST(TransformationMergeFunctionReturnsTest, RespectDominanceRules1) { // block %14 is added. ASSERT_FALSE( TransformationMergeFunctionReturns( - 2, 100, 200, 101, 0, 0, {{MakeReturnMergingInfo(10, 102, 103, {{}})}}) + 2, 100, 101, 0, 0, {{MakeReturnMergingInfo(10, 102, 103, {{}})}}) .IsApplicable(context.get(), transformation_context)); // In function %18, The definition of id %26 will still dominate its use in // instruction %27 (inside merge block %21), because %27 is an OpPhi // instruction. auto transformation = TransformationMergeFunctionReturns( - 18, 100, 200, 101, 0, 0, {{MakeReturnMergingInfo(21, 102, 103, {{}})}}); + 18, 100, 101, 0, 0, {{MakeReturnMergingInfo(21, 102, 103, {{}})}}); ASSERT_TRUE( transformation.IsApplicable(context.get(), transformation_context)); ApplyAndCheckFreshIds(transformation, context.get(), &transformation_context); @@ -1414,8 +1376,8 @@ TEST(TransformationMergeFunctionReturnsTest, RespectDominanceRules1) { %19 = OpLabel OpBranch %100 %100 = OpLabel - OpLoopMerge %101 %200 None - OpBranch %20 + OpLoopMerge %101 %100 None + OpBranchConditional %6 %20 %100 %20 = OpLabel OpLoopMerge %21 %22 None OpBranch %23 @@ -1437,8 +1399,6 @@ TEST(TransformationMergeFunctionReturnsTest, RespectDominanceRules1) { OpBranch %101 %101 = OpLabel OpReturn - %200 = OpLabel - OpBranch %100 OpFunctionEnd )"; @@ -1522,17 +1482,17 @@ TEST(TransformationMergeFunctionReturnsTest, RespectDominanceRules2) { // block %14 to merge block %10 is added. ASSERT_FALSE( TransformationMergeFunctionReturns( - 2, 100, 200, 101, 0, 0, {{MakeReturnMergingInfo(10, 102, 103, {{}})}}) + 2, 100, 101, 0, 0, {{MakeReturnMergingInfo(10, 102, 103, {{}})}}) .IsApplicable(context.get(), transformation_context)); // In function %18, the definition of id %26 will not dominate its use in // instruction %28 (inside block %27) after a new branch from return // block %25 to merge block %21 is added. - ASSERT_FALSE( - TransformationMergeFunctionReturns( - 2, 100, 200, 101, 0, 0, {{MakeReturnMergingInfo(10, 102, 0, {{}}), - MakeReturnMergingInfo(21, 103, 0, {{}})}}) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE(TransformationMergeFunctionReturns( + 2, 100, 101, 0, 0, + {{MakeReturnMergingInfo(10, 102, 0, {{}}), + MakeReturnMergingInfo(21, 103, 0, {{}})}}) + .IsApplicable(context.get(), transformation_context)); } TEST(TransformationMergeFunctionReturnsTest, RespectDominanceRules3) { @@ -1596,7 +1556,7 @@ TEST(TransformationMergeFunctionReturnsTest, RespectDominanceRules3) { // fact that the id definition dominates the uses does not depend on it // dominating the merge block. auto transformation = TransformationMergeFunctionReturns( - 2, 100, 200, 101, 0, 0, {{MakeReturnMergingInfo(10, 102, 103, {{}})}}); + 2, 100, 101, 0, 0, {{MakeReturnMergingInfo(10, 102, 103, {{}})}}); ASSERT_TRUE( transformation.IsApplicable(context.get(), transformation_context)); ApplyAndCheckFreshIds(transformation, context.get(), &transformation_context); @@ -1619,8 +1579,8 @@ TEST(TransformationMergeFunctionReturnsTest, RespectDominanceRules3) { %8 = OpLabel OpBranch %100 %100 = OpLabel - OpLoopMerge %101 %200 None - OpBranch %9 + OpLoopMerge %101 %100 None + OpBranchConditional %6 %9 %100 %9 = OpLabel OpLoopMerge %10 %11 None OpBranch %12 @@ -1648,8 +1608,6 @@ TEST(TransformationMergeFunctionReturnsTest, RespectDominanceRules3) { OpBranch %101 %101 = OpLabel OpReturn - %200 = OpLabel - OpBranch %100 OpFunctionEnd )"; @@ -1742,7 +1700,7 @@ TEST(TransformationMergeFunctionReturnsTest, RespectDominanceRules4) { // instruction %19 after the transformation is applied, because %13 dominates // all of the return blocks. auto transformation = TransformationMergeFunctionReturns( - 2, 100, 200, 101, 0, 0, {{MakeReturnMergingInfo(10, 102, 103, {{}})}}); + 2, 100, 101, 0, 0, {{MakeReturnMergingInfo(10, 102, 103, {{}})}}); ASSERT_TRUE( transformation.IsApplicable(context.get(), transformation_context)); ApplyAndCheckFreshIds(transformation, context.get(), &transformation_context); @@ -1752,10 +1710,10 @@ TEST(TransformationMergeFunctionReturnsTest, RespectDominanceRules4) { // In function %20, the definition of id %28 will not dominate its use in // instruction %32 after the transformation is applied, because %28 dominates // only one of the return blocks. - ASSERT_FALSE(TransformationMergeFunctionReturns( - 20, 100, 200, 101, 0, 0, - {{MakeReturnMergingInfo(23, 102, 103, {{}})}}) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE( + TransformationMergeFunctionReturns( + 20, 100, 101, 0, 0, {{MakeReturnMergingInfo(23, 102, 103, {{}})}}) + .IsApplicable(context.get(), transformation_context)); std::string after_transformation = R"( OpCapability Shader @@ -1773,8 +1731,8 @@ TEST(TransformationMergeFunctionReturnsTest, RespectDominanceRules4) { %8 = OpLabel OpBranch %100 %100 = OpLabel - OpLoopMerge %101 %200 None - OpBranch %9 + OpLoopMerge %101 %100 None + OpBranchConditional %6 %9 %100 %9 = OpLabel OpLoopMerge %10 %11 None OpBranch %12 @@ -1801,8 +1759,6 @@ TEST(TransformationMergeFunctionReturnsTest, RespectDominanceRules4) { OpBranch %101 %101 = OpLabel OpReturn - %200 = OpLabel - OpBranch %100 OpFunctionEnd %20 = OpFunction %3 None %4 %21 = OpLabel @@ -1874,7 +1830,7 @@ TEST(TransformationMergeFunctionReturnsTest, OpPhiAfterFirstBlock) { MakeUnique(context.get()), validator_options); auto transformation = - TransformationMergeFunctionReturns(2, 100, 200, 101, 0, 0, {}); + TransformationMergeFunctionReturns(2, 100, 101, 0, 0, {}); ASSERT_TRUE( transformation.IsApplicable(context.get(), transformation_context)); ApplyAndCheckFreshIds(transformation, context.get(), &transformation_context); @@ -1907,8 +1863,8 @@ TEST(TransformationMergeFunctionReturnsTest, OpPhiAfterFirstBlock) { %8 = OpLabel OpBranch %100 %100 = OpLabel - OpLoopMerge %101 %200 None - OpBranch %9 + OpLoopMerge %101 %100 None + OpBranchConditional %6 %9 %100 %9 = OpLabel %10 = OpPhi %5 %6 %100 OpSelectionMerge %11 None @@ -1919,8 +1875,6 @@ TEST(TransformationMergeFunctionReturnsTest, OpPhiAfterFirstBlock) { OpBranch %101 %101 = OpLabel OpReturn - %200 = OpLabel - OpBranch %100 OpFunctionEnd )"; diff --git a/test/fuzz/transformation_mutate_pointer_test.cpp b/test/fuzz/transformation_mutate_pointer_test.cpp index e869efa6..ae423100 100644 --- a/test/fuzz/transformation_mutate_pointer_test.cpp +++ b/test/fuzz/transformation_mutate_pointer_test.cpp @@ -26,7 +26,6 @@ namespace { TEST(TransformationMutatePointerTest, BasicTest) { std::string shader = R"( OpCapability Shader - OpCapability VariablePointers %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %4 "main" @@ -61,6 +60,7 @@ TEST(TransformationMutatePointerTest, BasicTest) { %23 = OpTypePointer Output %6 %24 = OpVariable %23 Output %27 = OpTypeFunction %2 %13 + %32 = OpUndef %16 %33 = OpConstantNull %16 %4 = OpFunction %2 None %3 %5 = OpLabel @@ -110,6 +110,10 @@ TEST(TransformationMutatePointerTest, BasicTest) { ASSERT_FALSE(TransformationMutatePointer(11, 70, insert_before) .IsApplicable(context.get(), transformation_context)); + // |pointer_id| is a result id of OpUndef. + ASSERT_FALSE(TransformationMutatePointer(32, 70, insert_before) + .IsApplicable(context.get(), transformation_context)); + // |pointer_id| is a result id of OpConstantNull. ASSERT_FALSE(TransformationMutatePointer(33, 70, insert_before) .IsApplicable(context.get(), transformation_context)); @@ -159,7 +163,6 @@ TEST(TransformationMutatePointerTest, BasicTest) { std::string after_transformation = R"( OpCapability Shader - OpCapability VariablePointers %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %4 "main" @@ -194,6 +197,7 @@ TEST(TransformationMutatePointerTest, BasicTest) { %23 = OpTypePointer Output %6 %24 = OpVariable %23 Output %27 = OpTypeFunction %2 %13 + %32 = OpUndef %16 %33 = OpConstantNull %16 %4 = OpFunction %2 None %3 %5 = OpLabel diff --git a/test/fuzz/transformation_outline_function_test.cpp b/test/fuzz/transformation_outline_function_test.cpp index cc62049d..c567680c 100644 --- a/test/fuzz/transformation_outline_function_test.cpp +++ b/test/fuzz/transformation_outline_function_test.cpp @@ -3207,45 +3207,6 @@ TEST(TransformationOutlineFunctionTest, Miscellaneous4) { ASSERT_TRUE(IsEqual(env, after_transformation, context.get())); } -TEST(TransformationOutlineFunctionTest, NoOutlineWithUnreachableBlocks) { - // This checks that outlining will not be performed if a node in the region - // has an unreachable predecessor. - - std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %4 = OpFunction %2 None %3 - %7 = OpLabel - OpBranch %5 - %5 = OpLabel - OpReturn - %6 = OpLabel - OpBranch %5 - OpFunctionEnd - )"; - - const auto env = SPV_ENV_UNIVERSAL_1_4; - const auto consumer = nullptr; - const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - TransformationContext transformation_context( - MakeUnique(context.get()), validator_options); - TransformationOutlineFunction transformation(5, 5, /* not relevant */ 200, - 100, 101, 102, 103, - /* not relevant */ 201, {}, {}); - ASSERT_FALSE( - transformation.IsApplicable(context.get(), transformation_context)); -} - } // namespace } // namespace fuzz } // namespace spvtools diff --git a/test/fuzz/transformation_permute_phi_operands_test.cpp b/test/fuzz/transformation_permute_phi_operands_test.cpp index 0774dcf3..3df399a5 100644 --- a/test/fuzz/transformation_permute_phi_operands_test.cpp +++ b/test/fuzz/transformation_permute_phi_operands_test.cpp @@ -60,7 +60,6 @@ TEST(TransformationPermutePhiOperandsTest, BasicTest) { OpBranch %17 %17 = OpLabel %25 = OpPhi %6 %20 %16 %24 %21 - %30 = OpIAdd %6 %25 %25 OpStore %8 %25 OpReturn OpFunctionEnd @@ -122,30 +121,6 @@ TEST(TransformationPermutePhiOperandsTest, BasicTest) { return true; }); } - bool found_use_in_store = false; - bool found_use_in_add_lhs = false; - bool found_use_in_add_rhs = false; - context->get_def_use_mgr()->ForEachUse( - 25, [&found_use_in_store, &found_use_in_add_lhs, &found_use_in_add_rhs]( - opt::Instruction* inst, uint32_t operand_index) { - if (inst->opcode() == SpvOpStore) { - ASSERT_FALSE(found_use_in_store); - found_use_in_store = true; - } else { - ASSERT_EQ(SpvOpIAdd, inst->opcode()); - if (operand_index == 2) { - ASSERT_FALSE(found_use_in_add_lhs); - found_use_in_add_lhs = true; - } else { - ASSERT_EQ(3, operand_index); - ASSERT_FALSE(found_use_in_add_rhs); - found_use_in_add_rhs = true; - } - } - }); - ASSERT_TRUE(found_use_in_store); - ASSERT_TRUE(found_use_in_add_lhs); - ASSERT_TRUE(found_use_in_add_rhs); std::string after_transformation = R"( OpCapability Shader @@ -184,7 +159,6 @@ TEST(TransformationPermutePhiOperandsTest, BasicTest) { OpBranch %17 %17 = OpLabel %25 = OpPhi %6 %24 %21 %20 %16 - %30 = OpIAdd %6 %25 %25 OpStore %8 %25 OpReturn OpFunctionEnd diff --git a/test/fuzz/transformation_push_id_through_variable_test.cpp b/test/fuzz/transformation_push_id_through_variable_test.cpp index b0fff588..7487cab9 100644 --- a/test/fuzz/transformation_push_id_through_variable_test.cpp +++ b/test/fuzz/transformation_push_id_through_variable_test.cpp @@ -26,7 +26,6 @@ namespace { TEST(TransformationPushIdThroughVariableTest, IsApplicable) { std::string reference_shader = R"( OpCapability Shader - OpCapability VariablePointers %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %4 "main" %92 %52 %53 @@ -51,6 +50,7 @@ TEST(TransformationPushIdThroughVariableTest, IsApplicable) { %34 = OpTypeBool %35 = OpConstantFalse %34 %60 = OpConstantNull %50 + %61 = OpUndef %51 %52 = OpVariable %50 Private %53 = OpVariable %51 Private %80 = OpConstantComposite %8 %21 %24 @@ -257,7 +257,6 @@ TEST(TransformationPushIdThroughVariableTest, IsApplicable) { TEST(TransformationPushIdThroughVariableTest, Apply) { std::string reference_shader = R"( OpCapability Shader - OpCapability VariablePointers %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %4 "main" %92 %52 %53 @@ -282,6 +281,7 @@ TEST(TransformationPushIdThroughVariableTest, Apply) { %34 = OpTypeBool %35 = OpConstantFalse %34 %60 = OpConstantNull %50 + %61 = OpUndef %51 %52 = OpVariable %50 Private %53 = OpVariable %51 Private %80 = OpConstantComposite %8 %21 %24 @@ -419,7 +419,6 @@ TEST(TransformationPushIdThroughVariableTest, Apply) { std::string variant_shader = R"( OpCapability Shader - OpCapability VariablePointers %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %4 "main" %92 %52 %53 %109 %111 @@ -444,6 +443,7 @@ TEST(TransformationPushIdThroughVariableTest, Apply) { %34 = OpTypeBool %35 = OpConstantFalse %34 %60 = OpConstantNull %50 + %61 = OpUndef %51 %52 = OpVariable %50 Private %53 = OpVariable %51 Private %80 = OpConstantComposite %8 %21 %24 @@ -519,7 +519,6 @@ TEST(TransformationPushIdThroughVariableTest, Apply) { TEST(TransformationPushIdThroughVariableTest, AddSynonymsForRelevantIds) { std::string reference_shader = R"( OpCapability Shader - OpCapability VariablePointers %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %4 "main" %92 %52 %53 @@ -544,6 +543,7 @@ TEST(TransformationPushIdThroughVariableTest, AddSynonymsForRelevantIds) { %34 = OpTypeBool %35 = OpConstantFalse %34 %60 = OpConstantNull %50 + %61 = OpUndef %51 %52 = OpVariable %50 Private %53 = OpVariable %51 Private %80 = OpConstantComposite %8 %21 %24 @@ -620,7 +620,6 @@ TEST(TransformationPushIdThroughVariableTest, AddSynonymsForRelevantIds) { TEST(TransformationPushIdThroughVariableTest, DontAddSynonymsForIrrelevantIds) { std::string reference_shader = R"( OpCapability Shader - OpCapability VariablePointers %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %4 "main" %92 %52 %53 @@ -645,6 +644,7 @@ TEST(TransformationPushIdThroughVariableTest, DontAddSynonymsForIrrelevantIds) { %34 = OpTypeBool %35 = OpConstantFalse %34 %60 = OpConstantNull %50 + %61 = OpUndef %51 %52 = OpVariable %50 Private %53 = OpVariable %51 Private %80 = OpConstantComposite %8 %21 %24 diff --git a/test/fuzz/transformation_replace_id_with_synonym_test.cpp b/test/fuzz/transformation_replace_id_with_synonym_test.cpp index cebce8a0..629a00ee 100644 --- a/test/fuzz/transformation_replace_id_with_synonym_test.cpp +++ b/test/fuzz/transformation_replace_id_with_synonym_test.cpp @@ -1796,639 +1796,6 @@ TEST(TransformationReplaceIdWithSynonymTest, IncompatibleTypes) { .IsApplicable(context.get(), transformation_context)); } -TEST(TransformationReplaceIdWithSynonymTest, - AtomicScopeAndMemorySemanticsMustBeConstant) { - const std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 320 - OpSourceExtension "GL_KHR_memory_scope_semantics" - OpMemberDecorate %9 0 Offset 0 - OpDecorate %9 Block - OpDecorate %11 DescriptorSet 0 - OpDecorate %11 Binding 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %17 = OpTypeInt 32 0 - %7 = OpTypePointer Function %6 - %9 = OpTypeStruct %6 - %10 = OpTypePointer StorageBuffer %9 - %11 = OpVariable %10 StorageBuffer - %86 = OpTypeStruct %17 - %87 = OpTypePointer Workgroup %86 - %88 = OpVariable %87 Workgroup - %12 = OpConstant %6 0 - %13 = OpTypePointer StorageBuffer %6 - %15 = OpConstant %6 2 - %16 = OpConstant %6 64 - %89 = OpTypePointer Workgroup %17 - %18 = OpConstant %17 1 - %19 = OpConstant %17 0 - %20 = OpConstant %17 64 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %8 = OpVariable %7 Function - %100 = OpCopyObject %6 %15 ; A non-constant version of %15 - %101 = OpCopyObject %17 %20 ; A non-constant version of %20 - %14 = OpAccessChain %13 %11 %12 - %90 = OpAccessChain %89 %88 %19 - %21 = OpAtomicLoad %6 %14 %15 %20 - %22 = OpAtomicExchange %6 %14 %15 %20 %16 - %23 = OpAtomicCompareExchange %6 %14 %15 %20 %12 %16 %15 - %24 = OpAtomicIIncrement %6 %14 %15 %20 - %25 = OpAtomicIDecrement %6 %14 %15 %20 - %26 = OpAtomicIAdd %6 %14 %15 %20 %16 - %27 = OpAtomicISub %6 %14 %15 %20 %16 - %28 = OpAtomicSMin %6 %14 %15 %20 %16 - %29 = OpAtomicUMin %17 %90 %15 %20 %18 - %30 = OpAtomicSMax %6 %14 %15 %20 %15 - %31 = OpAtomicUMax %17 %90 %15 %20 %18 - %32 = OpAtomicAnd %6 %14 %15 %20 %16 - %33 = OpAtomicOr %6 %14 %15 %20 %16 - %34 = OpAtomicXor %6 %14 %15 %20 %16 - OpStore %8 %21 - OpAtomicStore %14 %15 %20 %12 - OpReturn - OpFunctionEnd - )"; - - const auto env = SPV_ENV_UNIVERSAL_1_3; - const auto consumer = nullptr; - const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - TransformationContext transformation_context( - MakeUnique(context.get()), validator_options); - - // Tell the fact manager that %100 and %15 are synonymous - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(100, {}), MakeDataDescriptor(15, {})); - - // Tell the fact manager that %101 and %20 are synonymous - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(101, {}), MakeDataDescriptor(20, {})); - // OpAtomicLoad - const auto& scope_operand = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(21), 1); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(scope_operand, 100) - .IsApplicable(context.get(), transformation_context)); - - const auto& semantics_operand = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(21), 2); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(semantics_operand, 101) - .IsApplicable(context.get(), transformation_context)); - // OpAtomicExchange. - const auto& scope_operand2 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(22), 1); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(scope_operand2, 100) - .IsApplicable(context.get(), transformation_context)); - - const auto& semantics_operand2 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(22), 2); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(semantics_operand2, 101) - .IsApplicable(context.get(), transformation_context)); - // OpAtomicCompareExchange. - const auto& scope_operand3 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(23), 1); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(scope_operand3, 100) - .IsApplicable(context.get(), transformation_context)); - - const auto& semantics_equal_operand3 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(23), 2); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(semantics_equal_operand3, 101) - .IsApplicable(context.get(), transformation_context)); - const auto& semantics_unequal_operand3 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(23), 3); - ASSERT_FALSE( - TransformationReplaceIdWithSynonym(semantics_unequal_operand3, 101) - .IsApplicable(context.get(), transformation_context)); - // OpAtomicIIncrement. - const auto& scope_operand4 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(24), 1); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(scope_operand4, 100) - .IsApplicable(context.get(), transformation_context)); - - const auto& semantics_operand4 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(24), 2); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(semantics_operand4, 101) - .IsApplicable(context.get(), transformation_context)); - - // OpAtomicIDecrement. - const auto& scope_operand5 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(25), 1); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(scope_operand5, 100) - .IsApplicable(context.get(), transformation_context)); - - const auto& semantics_operand5 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(25), 2); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(semantics_operand5, 101) - .IsApplicable(context.get(), transformation_context)); - - // OpAtomicIAdd. - const auto& scope_operand6 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(26), 1); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(scope_operand6, 100) - .IsApplicable(context.get(), transformation_context)); - - const auto& semantics_operand6 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(26), 2); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(semantics_operand6, 101) - .IsApplicable(context.get(), transformation_context)); - // OpAtomicISub - const auto& scope_operand8 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(27), 1); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(scope_operand8, 100) - .IsApplicable(context.get(), transformation_context)); - - const auto& semantics_operand8 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(27), 2); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(semantics_operand8, 101) - .IsApplicable(context.get(), transformation_context)); - - // OpAtomicSMin - const auto& scope_operand9 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(28), 1); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(scope_operand9, 100) - .IsApplicable(context.get(), transformation_context)); - - const auto& semantics_operand9 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(28), 2); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(semantics_operand9, 101) - .IsApplicable(context.get(), transformation_context)); - // OpAtomicUMin - const auto& scope_operand10 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(29), 1); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(scope_operand10, 100) - .IsApplicable(context.get(), transformation_context)); - - const auto& semantics_operand10 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(29), 2); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(semantics_operand10, 101) - .IsApplicable(context.get(), transformation_context)); - - // OpAtomicSMax - const auto& scope_operand11 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(30), 1); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(scope_operand11, 100) - .IsApplicable(context.get(), transformation_context)); - - const auto& semantics_operand11 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(30), 2); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(semantics_operand11, 101) - .IsApplicable(context.get(), transformation_context)); - // OpAtomicUMax - const auto& scope_operand12 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(31), 1); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(scope_operand12, 100) - .IsApplicable(context.get(), transformation_context)); - - const auto& semantics_operand12 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(31), 2); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(semantics_operand12, 101) - .IsApplicable(context.get(), transformation_context)); - - // OpAtomicAnd - const auto& scope_operand13 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(32), 1); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(scope_operand13, 100) - .IsApplicable(context.get(), transformation_context)); - - const auto& semantics_operand13 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(32), 2); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(semantics_operand13, 101) - .IsApplicable(context.get(), transformation_context)); - - // OpAtomicOr - const auto& scope_operand14 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(33), 1); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(scope_operand14, 100) - .IsApplicable(context.get(), transformation_context)); - - const auto& semantics_operand14 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(33), 2); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(semantics_operand14, 101) - .IsApplicable(context.get(), transformation_context)); - - // OpAtomicXor - const auto& scope_operand15 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(34), 1); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(scope_operand15, 100) - .IsApplicable(context.get(), transformation_context)); - - const auto& semantics_operand15 = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(34), 2); - ASSERT_FALSE(TransformationReplaceIdWithSynonym(semantics_operand15, 101) - .IsApplicable(context.get(), transformation_context)); -} - -// TODO(https://github.com/KhronosGroup/SPIRV-Tools/issues/4345): Improve this -// test so that it covers more atomic operations, and enable the test once the -// issue is fixed. -TEST(TransformationReplaceIdWithSynonymTest, - DISABLED_SignOfAtomicScopeAndMemorySemanticsDoesNotMatter) { - // TODO(https://github.com/KhronosGroup/SPIRV-Tools/issues/4345): both the - // GLSL comment and the corresponding SPIR-V should be updated to cover a - // larger number of atomic operations. - // The following SPIR-V came from this GLSL, edited to add some synonyms: - // - // #version 320 es - // - // #extension GL_KHR_memory_scope_semantics : enable - // - // layout(set = 0, binding = 0) buffer Buf { - // int x; - // }; - // - // void main() { - // int tmp = atomicLoad(x, - // gl_ScopeWorkgroup, - // gl_StorageSemanticsBuffer, - // gl_SemanticsRelaxed); - // } - const std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 320 - OpSourceExtension "GL_KHR_memory_scope_semantics" - OpMemberDecorate %9 0 Offset 0 - OpDecorate %9 Block - OpDecorate %11 DescriptorSet 0 - OpDecorate %11 Binding 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %7 = OpTypePointer Function %6 - %9 = OpTypeStruct %6 - %10 = OpTypePointer StorageBuffer %9 - %11 = OpVariable %10 StorageBuffer - %12 = OpConstant %6 0 - %13 = OpTypePointer StorageBuffer %6 - %15 = OpConstant %6 2 - %16 = OpConstant %6 64 - %17 = OpTypeInt 32 0 - %100 = OpConstant %17 2 ; The same as %15, but with unsigned int type - %18 = OpConstant %17 1 - %19 = OpConstant %17 0 - %20 = OpConstant %17 64 - %101 = OpConstant %6 64 ; The same as %20, but with signed int type - %4 = OpFunction %2 None %3 - %5 = OpLabel - %8 = OpVariable %7 Function - %14 = OpAccessChain %13 %11 %12 - %21 = OpAtomicLoad %6 %14 %15 %20 - OpStore %8 %21 - OpReturn - OpFunctionEnd - )"; - - const auto env = SPV_ENV_UNIVERSAL_1_3; - const auto consumer = nullptr; - const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - TransformationContext transformation_context( - MakeUnique(context.get()), validator_options); - - // Tell the fact manager that %100 and %15 are synonymous - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(100, {}), MakeDataDescriptor(15, {})); - - // Tell the fact manager that %101 and %20 are synonymous - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(101, {}), MakeDataDescriptor(20, {})); - - { - const auto& scope_operand = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(21), 1); - TransformationReplaceIdWithSynonym replace_scope(scope_operand, 100); - ASSERT_TRUE( - replace_scope.IsApplicable(context.get(), transformation_context)); - ApplyAndCheckFreshIds(replace_scope, context.get(), - &transformation_context); - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed( - context.get(), validator_options, kConsoleMessageConsumer)); - } - - { - const auto& semantics_operand = MakeIdUseDescriptorFromUse( - context.get(), context->get_def_use_mgr()->GetDef(21), 2); - TransformationReplaceIdWithSynonym replace_semantics(semantics_operand, - 101); - ASSERT_TRUE( - replace_semantics.IsApplicable(context.get(), transformation_context)); - ApplyAndCheckFreshIds(replace_semantics, context.get(), - &transformation_context); - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed( - context.get(), validator_options, kConsoleMessageConsumer)); - } - - const std::string after_transformation = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 320 - OpSourceExtension "GL_KHR_memory_scope_semantics" - OpMemberDecorate %9 0 Offset 0 - OpDecorate %9 Block - OpDecorate %11 DescriptorSet 0 - OpDecorate %11 Binding 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %7 = OpTypePointer Function %6 - %9 = OpTypeStruct %6 - %10 = OpTypePointer StorageBuffer %9 - %11 = OpVariable %10 StorageBuffer - %12 = OpConstant %6 0 - %13 = OpTypePointer StorageBuffer %6 - %15 = OpConstant %6 2 - %16 = OpConstant %6 64 - %17 = OpTypeInt 32 0 - %100 = OpConstant %17 2 - %18 = OpConstant %17 1 - %19 = OpConstant %17 0 - %20 = OpConstant %17 64 - %101 = OpConstant %6 64 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %8 = OpVariable %7 Function - %14 = OpAccessChain %13 %11 %12 - %21 = OpAtomicLoad %6 %14 %100 %101 - OpStore %8 %21 - OpReturn - OpFunctionEnd - )"; - - ASSERT_TRUE(IsEqual(env, after_transformation, context.get())); -} - -// TODO(https://github.com/KhronosGroup/SPIRV-Tools/issues/4345): Improve this -// test so that it covers more atomic operations, and enable the test once the -// issue is fixed. -TEST(TransformationReplaceIdWithSynonymTest, TypesAreCompatible) { - const std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 320 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %9 = OpTypeInt 32 0 - %8 = OpTypeStruct %6 - %10 = OpTypePointer StorageBuffer %8 - %11 = OpVariable %10 StorageBuffer - %86 = OpTypeStruct %9 - %87 = OpTypePointer Workgroup %86 - %88 = OpVariable %87 Workgroup - %89 = OpTypePointer Workgroup %9 - %19 = OpConstant %9 0 - %18 = OpConstant %9 1 - %12 = OpConstant %6 0 - %13 = OpTypePointer StorageBuffer %6 - %15 = OpConstant %6 2 - %16 = OpConstant %6 7 - %20 = OpConstant %9 64 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %14 = OpAccessChain %13 %11 %12 - %90 = OpAccessChain %89 %88 %19 - %21 = OpAtomicLoad %6 %14 %15 %20 - %22 = OpAtomicExchange %6 %14 %15 %20 %16 - %23 = OpAtomicCompareExchange %6 %14 %15 %20 %12 %16 %15 - %24 = OpAtomicIIncrement %6 %14 %15 %20 - %25 = OpAtomicIDecrement %6 %14 %15 %20 - %26 = OpAtomicIAdd %6 %14 %15 %20 %16 - %27 = OpAtomicISub %6 %14 %15 %20 %16 - %28 = OpAtomicSMin %6 %14 %15 %20 %16 - %29 = OpAtomicUMin %9 %90 %15 %20 %18 - %30 = OpAtomicSMax %6 %14 %15 %20 %15 - %31 = OpAtomicUMax %9 %90 %15 %20 %18 - %32 = OpAtomicAnd %6 %14 %15 %20 %16 - %33 = OpAtomicOr %6 %14 %15 %20 %16 - %34 = OpAtomicXor %6 %14 %15 %20 %16 - OpAtomicStore %14 %15 %20 %16 - OpReturn - OpFunctionEnd - )"; - - const auto env = SPV_ENV_UNIVERSAL_1_3; - const auto consumer = nullptr; - const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - - const uint32_t int_type = 6; // The id of OpTypeInt 32 1 - const uint32_t uint_type = 9; // The id of OpTypeInt 32 0 - - // OpAtomicLoad -#ifndef NDEBUG - ASSERT_DEATH(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicLoad, 0, int_type, uint_type), - "Signedness check should not occur on a pointer operand."); -#endif - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicLoad, 1, int_type, uint_type)); - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicLoad, 2, int_type, uint_type)); - - // OpAtomicExchange -#ifndef NDEBUG - ASSERT_DEATH(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicExchange, 0, int_type, uint_type), - "Signedness check should not occur on a pointer operand."); -#endif - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicExchange, 1, int_type, uint_type)); - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicExchange, 2, int_type, uint_type)); - ASSERT_FALSE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicExchange, 3, int_type, uint_type)); - - // OpAtomicStore -#ifndef NDEBUG - ASSERT_DEATH(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicStore, 0, int_type, uint_type), - "Signedness check should not occur on a pointer operand."); -#endif - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicStore, 1, int_type, uint_type)); - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicStore, 2, int_type, uint_type)); - ASSERT_FALSE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicStore, 3, int_type, uint_type)); - - // OpAtomicCompareExchange -#ifndef NDEBUG - ASSERT_DEATH( - TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicCompareExchange, 0, int_type, uint_type), - "Signedness check should not occur on a pointer operand."); -#endif - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicCompareExchange, 1, int_type, uint_type)); - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicCompareExchange, 2, int_type, uint_type)); - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicCompareExchange, 3, int_type, uint_type)); - ASSERT_FALSE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicCompareExchange, 4, int_type, uint_type)); - - // OpAtomicIIncrement -#ifndef NDEBUG - ASSERT_DEATH( - TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicIIncrement, 0, int_type, uint_type), - "Signedness check should not occur on a pointer operand."); -#endif - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicIIncrement, 1, int_type, uint_type)); - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicIIncrement, 2, int_type, uint_type)); - -// OpAtomicIDecrement -#ifndef NDEBUG - ASSERT_DEATH(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicStore, 0, int_type, uint_type), - "Signedness check should not occur on a pointer operand."); -#endif - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicStore, 1, int_type, uint_type)); - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicStore, 2, int_type, uint_type)); - -// OpAtomicIAdd -#ifndef NDEBUG - ASSERT_DEATH(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicIAdd, 0, int_type, uint_type), - "Signedness check should not occur on a pointer operand."); -#endif - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicIAdd, 1, int_type, uint_type)); - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicIAdd, 2, int_type, uint_type)); - ASSERT_FALSE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicIAdd, 3, int_type, uint_type)); - -// OpAtomicISub -#ifndef NDEBUG - ASSERT_DEATH(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicISub, 0, int_type, uint_type), - "Signedness check should not occur on a pointer operand."); -#endif - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicISub, 1, int_type, uint_type)); - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicISub, 2, int_type, uint_type)); - ASSERT_FALSE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicISub, 3, int_type, uint_type)); - -// OpAtomicSMin -#ifndef NDEBUG - ASSERT_DEATH(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicSMin, 0, int_type, uint_type), - "Signedness check should not occur on a pointer operand."); -#endif - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicSMin, 1, int_type, uint_type)); - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicSMin, 2, int_type, uint_type)); - ASSERT_FALSE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicSMin, 3, int_type, uint_type)); - -// OpAtomicUMin -#ifndef NDEBUG - ASSERT_DEATH(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicUMin, 0, int_type, uint_type), - "Signedness check should not occur on a pointer operand."); -#endif - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicUMin, 1, int_type, uint_type)); - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicUMin, 2, int_type, uint_type)); - ASSERT_FALSE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicUMin, 3, int_type, uint_type)); - -// OpAtomicSMax -#ifndef NDEBUG - ASSERT_DEATH(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicSMax, 0, int_type, uint_type), - "Signedness check should not occur on a pointer operand."); -#endif - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicSMax, 1, int_type, uint_type)); - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicSMax, 2, int_type, uint_type)); - ASSERT_FALSE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicSMax, 3, int_type, uint_type)); - -// OpAtomicUMax -#ifndef NDEBUG - ASSERT_DEATH(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicUMax, 0, int_type, uint_type), - "Signedness check should not occur on a pointer operand."); -#endif - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicUMax, 1, int_type, uint_type)); - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicUMax, 2, int_type, uint_type)); - ASSERT_FALSE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicUMax, 3, int_type, uint_type)); - -// OpAtomicAnd -#ifndef NDEBUG - ASSERT_DEATH(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicAnd, 0, int_type, uint_type), - "Signedness check should not occur on a pointer operand."); -#endif - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicAnd, 1, int_type, uint_type)); - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicAnd, 2, int_type, uint_type)); - ASSERT_FALSE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicAnd, 3, int_type, uint_type)); - -// OpAtomicOr -#ifndef NDEBUG - ASSERT_DEATH(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicOr, 0, int_type, uint_type), - "Signedness check should not occur on a pointer operand."); -#endif - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicOr, 1, int_type, uint_type)); - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicOr, 2, int_type, uint_type)); - ASSERT_FALSE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicOr, 3, int_type, uint_type)); - -// OpAtomicXor -#ifndef NDEBUG - ASSERT_DEATH(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicXor, 0, int_type, uint_type), - "Signedness check should not occur on a pointer operand."); -#endif - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicXor, 1, int_type, uint_type)); - ASSERT_TRUE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicXor, 2, int_type, uint_type)); - ASSERT_FALSE(TransformationReplaceIdWithSynonym::TypesAreCompatible( - context.get(), SpvOpAtomicXor, 3, int_type, uint_type)); -} - } // namespace } // namespace fuzz } // namespace spvtools diff --git a/test/fuzz/transformation_store_test.cpp b/test/fuzz/transformation_store_test.cpp index dd653e28..93257d0d 100644 --- a/test/fuzz/transformation_store_test.cpp +++ b/test/fuzz/transformation_store_test.cpp @@ -26,7 +26,6 @@ namespace { TEST(TransformationStoreTest, BasicTest) { std::string shader = R"( OpCapability Shader - OpCapability VariablePointers %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %4 "main" %92 %52 %53 @@ -51,6 +50,7 @@ TEST(TransformationStoreTest, BasicTest) { %34 = OpTypeBool %35 = OpConstantFalse %34 %60 = OpConstantNull %50 + %61 = OpUndef %51 %52 = OpVariable %50 Private %53 = OpVariable %51 Private %80 = OpConstantComposite %8 %21 %24 @@ -148,107 +148,90 @@ TEST(TransformationStoreTest, BasicTest) { // 61 - undefined // Bad: attempt to store to 11 from outside its function - ASSERT_FALSE( - TransformationStore(11, false, 0, 0, 80, - MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE(TransformationStore( + 11, 80, MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) + .IsApplicable(context.get(), transformation_context)); // Bad: pointer is not available - ASSERT_FALSE( - TransformationStore(81, false, 0, 0, 80, - MakeInstructionDescriptor(45, SpvOpCopyObject, 0)) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE(TransformationStore( + 81, 80, MakeInstructionDescriptor(45, SpvOpCopyObject, 0)) + .IsApplicable(context.get(), transformation_context)); // Bad: attempt to insert before OpVariable - ASSERT_FALSE( - TransformationStore(52, false, 0, 0, 24, - MakeInstructionDescriptor(27, SpvOpVariable, 0)) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE(TransformationStore( + 52, 24, MakeInstructionDescriptor(27, SpvOpVariable, 0)) + .IsApplicable(context.get(), transformation_context)); // Bad: pointer id does not exist - ASSERT_FALSE( - TransformationStore(1000, false, 0, 0, 24, - MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE(TransformationStore( + 1000, 24, MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) + .IsApplicable(context.get(), transformation_context)); // Bad: pointer id exists but does not have a type - ASSERT_FALSE( - TransformationStore(5, false, 0, 0, 24, - MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE(TransformationStore( + 5, 24, MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) + .IsApplicable(context.get(), transformation_context)); // Bad: pointer id exists and has a type, but is not a pointer - ASSERT_FALSE( - TransformationStore(24, false, 0, 0, 24, - MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE(TransformationStore( + 24, 24, MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) + .IsApplicable(context.get(), transformation_context)); // Bad: attempt to store to a null pointer - ASSERT_FALSE( - TransformationStore(60, false, 0, 0, 24, - MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE(TransformationStore( + 60, 24, MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) + .IsApplicable(context.get(), transformation_context)); // Bad: attempt to store to an undefined pointer - ASSERT_FALSE( - TransformationStore(61, false, 0, 0, 21, - MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE(TransformationStore( + 61, 21, MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) + .IsApplicable(context.get(), transformation_context)); // Bad: %82 is not available at the program point ASSERT_FALSE( - TransformationStore(82, false, 0, 0, 80, - MakeInstructionDescriptor(37, SpvOpReturn, 0)) + TransformationStore(82, 80, MakeInstructionDescriptor(37, SpvOpReturn, 0)) .IsApplicable(context.get(), transformation_context)); // Bad: value id does not exist - ASSERT_FALSE( - TransformationStore(27, false, 0, 0, 1000, - MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE(TransformationStore( + 27, 1000, MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) + .IsApplicable(context.get(), transformation_context)); // Bad: value id exists but does not have a type - ASSERT_FALSE( - TransformationStore(27, false, 0, 0, 15, - MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE(TransformationStore( + 27, 15, MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) + .IsApplicable(context.get(), transformation_context)); // Bad: value id exists but has the wrong type - ASSERT_FALSE( - TransformationStore(27, false, 0, 0, 14, - MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE(TransformationStore( + 27, 14, MakeInstructionDescriptor(38, SpvOpAccessChain, 0)) + .IsApplicable(context.get(), transformation_context)); // Bad: attempt to store to read-only variable - ASSERT_FALSE( - TransformationStore(92, false, 0, 0, 93, - MakeInstructionDescriptor(40, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE(TransformationStore( + 92, 93, MakeInstructionDescriptor(40, SpvOpAccessChain, 0)) + .IsApplicable(context.get(), transformation_context)); // Bad: value is not available - ASSERT_FALSE( - TransformationStore(27, false, 0, 0, 95, - MakeInstructionDescriptor(40, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE(TransformationStore( + 27, 95, MakeInstructionDescriptor(40, SpvOpAccessChain, 0)) + .IsApplicable(context.get(), transformation_context)); // Bad: variable being stored to does not have an irrelevant pointee value, // and the store is not in a dead block. - ASSERT_FALSE( - TransformationStore(20, false, 0, 0, 95, - MakeInstructionDescriptor(45, SpvOpCopyObject, 0)) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE(TransformationStore( + 20, 95, MakeInstructionDescriptor(45, SpvOpCopyObject, 0)) + .IsApplicable(context.get(), transformation_context)); // The described instruction does not exist. - ASSERT_FALSE( - TransformationStore(27, false, 0, 0, 80, - MakeInstructionDescriptor(1000, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); + ASSERT_FALSE(TransformationStore( + 27, 80, MakeInstructionDescriptor(1000, SpvOpAccessChain, 0)) + .IsApplicable(context.get(), transformation_context)); { // Store to irrelevant variable from dead block. TransformationStore transformation( - 27, false, 0, 0, 80, - MakeInstructionDescriptor(38, SpvOpAccessChain, 0)); + 27, 80, MakeInstructionDescriptor(38, SpvOpAccessChain, 0)); ASSERT_TRUE( transformation.IsApplicable(context.get(), transformation_context)); ApplyAndCheckFreshIds(transformation, context.get(), @@ -260,8 +243,7 @@ TEST(TransformationStoreTest, BasicTest) { { // Store to irrelevant variable from live block. TransformationStore transformation( - 11, false, 0, 0, 95, - MakeInstructionDescriptor(95, SpvOpReturnValue, 0)); + 11, 95, MakeInstructionDescriptor(95, SpvOpReturnValue, 0)); ASSERT_TRUE( transformation.IsApplicable(context.get(), transformation_context)); ApplyAndCheckFreshIds(transformation, context.get(), @@ -273,8 +255,7 @@ TEST(TransformationStoreTest, BasicTest) { { // Store to irrelevant variable from live block. TransformationStore transformation( - 46, false, 0, 0, 80, - MakeInstructionDescriptor(95, SpvOpReturnValue, 0)); + 46, 80, MakeInstructionDescriptor(95, SpvOpReturnValue, 0)); ASSERT_TRUE( transformation.IsApplicable(context.get(), transformation_context)); ApplyAndCheckFreshIds(transformation, context.get(), @@ -286,8 +267,7 @@ TEST(TransformationStoreTest, BasicTest) { { // Store to irrelevant variable from live block. TransformationStore transformation( - 16, false, 0, 0, 21, - MakeInstructionDescriptor(95, SpvOpReturnValue, 0)); + 16, 21, MakeInstructionDescriptor(95, SpvOpReturnValue, 0)); ASSERT_TRUE( transformation.IsApplicable(context.get(), transformation_context)); ApplyAndCheckFreshIds(transformation, context.get(), @@ -299,8 +279,7 @@ TEST(TransformationStoreTest, BasicTest) { { // Store to non-irrelevant variable from dead block. TransformationStore transformation( - 53, false, 0, 0, 21, - MakeInstructionDescriptor(38, SpvOpAccessChain, 0)); + 53, 21, MakeInstructionDescriptor(38, SpvOpAccessChain, 0)); ASSERT_TRUE( transformation.IsApplicable(context.get(), transformation_context)); ApplyAndCheckFreshIds(transformation, context.get(), @@ -311,7 +290,6 @@ TEST(TransformationStoreTest, BasicTest) { std::string after_transformation = R"( OpCapability Shader - OpCapability VariablePointers %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %4 "main" %92 %52 %53 @@ -336,6 +314,7 @@ TEST(TransformationStoreTest, BasicTest) { %34 = OpTypeBool %35 = OpConstantFalse %34 %60 = OpConstantNull %50 + %61 = OpUndef %51 %52 = OpVariable %50 Private %53 = OpVariable %51 Private %80 = OpConstantComposite %8 %21 %24 @@ -435,190 +414,16 @@ TEST(TransformationStoreTest, DoNotAllowStoresToReadOnlyMemory) { transformation_context.GetFactManager()->AddFactBlockIsDead(5); ASSERT_FALSE( - TransformationStore(15, false, 0, 0, 13, - MakeInstructionDescriptor(27, SpvOpReturn, 0)) + TransformationStore(15, 13, MakeInstructionDescriptor(27, SpvOpReturn, 0)) .IsApplicable(context.get(), transformation_context)); ASSERT_FALSE( - TransformationStore(19, false, 0, 0, 50, - MakeInstructionDescriptor(27, SpvOpReturn, 0)) + TransformationStore(19, 50, MakeInstructionDescriptor(27, SpvOpReturn, 0)) .IsApplicable(context.get(), transformation_context)); ASSERT_FALSE( - TransformationStore(27, false, 0, 0, 50, - MakeInstructionDescriptor(27, SpvOpReturn, 0)) + TransformationStore(27, 50, MakeInstructionDescriptor(27, SpvOpReturn, 0)) .IsApplicable(context.get(), transformation_context)); } -TEST(TransformationStoreTest, SupportAtomicStore) { - const std::string shader = R"( - OpCapability Shader - OpCapability Int8 - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 320 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %7 = OpTypeInt 8 1 - %9 = OpTypeInt 32 0 - %26 = OpTypeFloat 32 - %8 = OpTypeStruct %6 - %10 = OpTypePointer StorageBuffer %8 - %11 = OpVariable %10 StorageBuffer - %19 = OpConstant %26 0 - %18 = OpConstant %9 1 - %12 = OpConstant %6 0 - %13 = OpTypePointer StorageBuffer %6 - %15 = OpConstant %6 4 - %16 = OpConstant %6 7 - %17 = OpConstant %7 4 - %20 = OpConstant %9 64 - %21 = OpConstant %6 15 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %14 = OpAccessChain %13 %11 %12 - %24 = OpAccessChain %13 %11 %12 - OpReturn - OpFunctionEnd - )"; - const auto env = SPV_ENV_UNIVERSAL_1_3; - const auto consumer = nullptr; - const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - TransformationContext transformation_context( - MakeUnique(context.get()), validator_options); - - transformation_context.GetFactManager()->AddFactValueOfPointeeIsIrrelevant( - 14); - - // Bad: id 100 of memory scope instruction does not exist. - ASSERT_FALSE( - TransformationStore(14, true, 100, 20, 21, - MakeInstructionDescriptor(24, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - // Bad: id 100 of memory semantics instruction does not exist. - ASSERT_FALSE( - TransformationStore(14, true, 15, 100, 21, - MakeInstructionDescriptor(24, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - // Bad: memory scope should be |OpConstant| opcode. - ASSERT_FALSE( - TransformationStore(14, true, 5, 20, 21, - MakeInstructionDescriptor(24, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - // Bad: memory semantics should be |OpConstant| opcode. - ASSERT_FALSE( - TransformationStore(14, true, 15, 5, 21, - MakeInstructionDescriptor(24, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - - // Bad: The memory scope instruction must have an Integer operand. - ASSERT_FALSE( - TransformationStore(14, true, 15, 19, 21, - MakeInstructionDescriptor(24, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - // Bad: The memory memory semantics instruction must have an Integer operand. - ASSERT_FALSE( - TransformationStore(14, true, 19, 20, 21, - MakeInstructionDescriptor(24, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - - // Bad: Integer size of the memory scope must be equal to 32 bits. - ASSERT_FALSE( - TransformationStore(14, true, 17, 20, 21, - MakeInstructionDescriptor(24, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - - // Bad: Integer size of memory semantics must be equal to 32 bits. - ASSERT_FALSE( - TransformationStore(14, true, 15, 17, 21, - MakeInstructionDescriptor(24, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - - // Bad: memory scope value must be 4 (SpvScopeInvocation). - ASSERT_FALSE( - TransformationStore(14, true, 16, 20, 21, - MakeInstructionDescriptor(24, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - - // Bad: memory semantics value must be either: - // 64 (SpvMemorySemanticsUniformMemoryMask) - // 256 (SpvMemorySemanticsWorkgroupMemoryMask) - ASSERT_FALSE( - TransformationStore(14, true, 15, 16, 21, - MakeInstructionDescriptor(24, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - // Bad: The described instruction does not exist - ASSERT_FALSE( - TransformationStore(14, true, 15, 20, 21, - MakeInstructionDescriptor(150, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - - // Bad: Can't insert OpAccessChain before the id 15 of memory scope. - ASSERT_FALSE( - TransformationStore(14, true, 15, 20, 21, - MakeInstructionDescriptor(15, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - - // Bad: Can't insert OpAccessChain before the id 20 of memory semantics. - ASSERT_FALSE( - TransformationStore(14, true, 15, 20, 21, - MakeInstructionDescriptor(20, SpvOpAccessChain, 0)) - .IsApplicable(context.get(), transformation_context)); - - // Successful transformations. - { - TransformationStore transformation( - 14, true, 15, 20, 21, MakeInstructionDescriptor(24, SpvOpReturn, 0)); - ASSERT_TRUE( - transformation.IsApplicable(context.get(), transformation_context)); - ApplyAndCheckFreshIds(transformation, context.get(), - &transformation_context); - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed( - context.get(), validator_options, kConsoleMessageConsumer)); - } - - const std::string after_transformation = R"( - OpCapability Shader - OpCapability Int8 - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 320 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %7 = OpTypeInt 8 1 - %9 = OpTypeInt 32 0 - %26 = OpTypeFloat 32 - %8 = OpTypeStruct %6 - %10 = OpTypePointer StorageBuffer %8 - %11 = OpVariable %10 StorageBuffer - %19 = OpConstant %26 0 - %18 = OpConstant %9 1 - %12 = OpConstant %6 0 - %13 = OpTypePointer StorageBuffer %6 - %15 = OpConstant %6 4 - %16 = OpConstant %6 7 - %17 = OpConstant %7 4 - %20 = OpConstant %9 64 - %21 = OpConstant %6 15 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %14 = OpAccessChain %13 %11 %12 - %24 = OpAccessChain %13 %11 %12 - OpAtomicStore %14 %15 %20 %21 - OpReturn - OpFunctionEnd - )"; - - ASSERT_TRUE(IsEqual(env, after_transformation, context.get())); -} - } // namespace } // namespace fuzz } // namespace spvtools diff --git a/test/fuzz/transformation_swap_function_variables_test.cpp b/test/fuzz/transformation_swap_function_variables_test.cpp deleted file mode 100644 index 8132aa4b..00000000 --- a/test/fuzz/transformation_swap_function_variables_test.cpp +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright (c) 2021 Mostafa Ashraf -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/fuzz/transformation_swap_function_variables.h" - -#include "gtest/gtest.h" -#include "source/fuzz/fuzzer_util.h" -#include "source/fuzz/instruction_descriptor.h" -#include "test/fuzz/fuzz_test_util.h" - -namespace spvtools { -namespace fuzz { -namespace { - -TEST(TransformationSwapFunctionVariables, NotApplicable) { - std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 320 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %7 = OpTypePointer Function %6 - %8 = OpTypeFloat 32 - %9 = OpTypePointer Function %8 - %10 = OpTypeVector %8 2 - %11 = OpTypePointer Function %10 - %12 = OpTypeVector %8 3 - %13 = OpTypeMatrix %12 3 - %14 = OpTypePointer Function %13 - %15 = OpTypeFunction %2 %7 %9 %11 %14 %7 %7 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %24 = OpVariable %7 Function - %25 = OpVariable %9 Function - %26 = OpVariable %11 Function - %27 = OpVariable %14 Function - %28 = OpVariable %7 Function - %29 = OpVariable %7 Function - %30 = OpVariable %7 Function - %32 = OpVariable %9 Function - %34 = OpVariable %11 Function - %36 = OpVariable %14 Function - %38 = OpVariable %7 Function - %40 = OpVariable %7 Function - %31 = OpLoad %6 %24 - OpStore %30 %31 - %33 = OpLoad %8 %25 - OpStore %32 %33 - %35 = OpLoad %10 %26 - OpStore %34 %35 - %37 = OpLoad %13 %27 - OpStore %36 %37 - %39 = OpLoad %6 %28 - OpStore %38 %39 - %41 = OpLoad %6 %29 - OpStore %40 %41 - %42 = OpFunctionCall %2 %22 %30 %32 %34 %36 %38 %40 - OpReturn - OpFunctionEnd - %22 = OpFunction %2 None %15 - %16 = OpFunctionParameter %7 - %17 = OpFunctionParameter %9 - %18 = OpFunctionParameter %11 - %19 = OpFunctionParameter %14 - %20 = OpFunctionParameter %7 - %21 = OpFunctionParameter %7 - %23 = OpLabel - OpReturn - OpFunctionEnd -)"; - - const auto env = SPV_ENV_UNIVERSAL_1_5; - const auto consumer = nullptr; - const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - TransformationContext transformation_context( - MakeUnique(context.get()), validator_options); - -#ifndef NDEBUG - // Can't swap variable with itself. - ASSERT_DEATH(TransformationSwapFunctionVariables(7, 7).IsApplicable( - context.get(), transformation_context), - "Two results ids are equal"); -#endif - - // Invalid because 200 is not the id of an instruction. - ASSERT_FALSE(TransformationSwapFunctionVariables(1, 200).IsApplicable( - context.get(), transformation_context)); - // Invalid because 5 is not the id of an instruction. - ASSERT_FALSE(TransformationSwapFunctionVariables(5, 24).IsApplicable( - context.get(), transformation_context)); - // Can't swap two instructions from two different blocks. - ASSERT_FALSE(TransformationSwapFunctionVariables(16, 26).IsApplicable( - context.get(), transformation_context)); -} - -TEST(TransformationSwapFunctionVariables, IsApplicable) { - std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 320 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %7 = OpTypePointer Function %6 - %8 = OpTypeFloat 32 - %9 = OpTypePointer Function %8 - %10 = OpTypeVector %8 2 - %11 = OpTypePointer Function %10 - %12 = OpTypeVector %8 3 - %13 = OpTypeMatrix %12 3 - %14 = OpTypePointer Function %13 - %15 = OpTypeFunction %2 %7 %9 %11 %14 %7 %7 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %24 = OpVariable %7 Function - %25 = OpVariable %9 Function - %26 = OpVariable %11 Function - %27 = OpVariable %14 Function - %28 = OpVariable %7 Function - %29 = OpVariable %7 Function - %30 = OpVariable %7 Function - %32 = OpVariable %9 Function - %34 = OpVariable %11 Function - %36 = OpVariable %14 Function - %38 = OpVariable %7 Function - %40 = OpVariable %7 Function - %31 = OpLoad %6 %24 - OpStore %30 %31 - %33 = OpLoad %8 %25 - OpStore %32 %33 - %35 = OpLoad %10 %26 - OpStore %34 %35 - %37 = OpLoad %13 %27 - OpStore %36 %37 - %39 = OpLoad %6 %28 - OpStore %38 %39 - %41 = OpLoad %6 %29 - OpStore %40 %41 - %42 = OpFunctionCall %2 %22 %30 %32 %34 %36 %38 %40 - OpReturn - OpFunctionEnd - %22 = OpFunction %2 None %15 - %16 = OpFunctionParameter %7 - %17 = OpFunctionParameter %9 - %18 = OpFunctionParameter %11 - %19 = OpFunctionParameter %14 - %20 = OpFunctionParameter %7 - %21 = OpFunctionParameter %7 - %23 = OpLabel - OpReturn - OpFunctionEnd -)"; - - const auto env = SPV_ENV_UNIVERSAL_1_5; - const auto consumer = nullptr; - // Get Unique pointer of IRContext. - const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - TransformationContext transformation_context( - MakeUnique(context.get()), validator_options); - - // Successful transformations - { - auto first_instruction = context->get_def_use_mgr()->GetDef(24); - auto second_instruction = context->get_def_use_mgr()->GetDef(28); - // Swap two OpVariable instructions in the same function. - TransformationSwapFunctionVariables transformation(24, 28); - - ASSERT_TRUE( - transformation.IsApplicable(context.get(), transformation_context)); - - ApplyAndCheckFreshIds(transformation, context.get(), - &transformation_context); - - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed( - context.get(), validator_options, kConsoleMessageConsumer)); - - ASSERT_EQ(first_instruction, context->get_def_use_mgr()->GetDef(24)); - ASSERT_EQ(second_instruction, context->get_def_use_mgr()->GetDef(28)); - } - { - auto first_instruction = context->get_def_use_mgr()->GetDef(38); - auto second_instruction = context->get_def_use_mgr()->GetDef(40); - // Swap two OpVariable instructions in the same function. - TransformationSwapFunctionVariables transformation(38, 40); - - ASSERT_TRUE( - transformation.IsApplicable(context.get(), transformation_context)); - - ApplyAndCheckFreshIds(transformation, context.get(), - &transformation_context); - - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed( - context.get(), validator_options, kConsoleMessageConsumer)); - - ASSERT_EQ(first_instruction, context->get_def_use_mgr()->GetDef(38)); - ASSERT_EQ(second_instruction, context->get_def_use_mgr()->GetDef(40)); - } - std::string after_transformation = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 320 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %7 = OpTypePointer Function %6 - %8 = OpTypeFloat 32 - %9 = OpTypePointer Function %8 - %10 = OpTypeVector %8 2 - %11 = OpTypePointer Function %10 - %12 = OpTypeVector %8 3 - %13 = OpTypeMatrix %12 3 - %14 = OpTypePointer Function %13 - %15 = OpTypeFunction %2 %7 %9 %11 %14 %7 %7 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %28 = OpVariable %7 Function - %25 = OpVariable %9 Function - %26 = OpVariable %11 Function - %27 = OpVariable %14 Function - %24 = OpVariable %7 Function - %29 = OpVariable %7 Function - %30 = OpVariable %7 Function - %32 = OpVariable %9 Function - %34 = OpVariable %11 Function - %36 = OpVariable %14 Function - %40 = OpVariable %7 Function - %38 = OpVariable %7 Function - %31 = OpLoad %6 %24 - OpStore %30 %31 - %33 = OpLoad %8 %25 - OpStore %32 %33 - %35 = OpLoad %10 %26 - OpStore %34 %35 - %37 = OpLoad %13 %27 - OpStore %36 %37 - %39 = OpLoad %6 %28 - OpStore %38 %39 - %41 = OpLoad %6 %29 - OpStore %40 %41 - %42 = OpFunctionCall %2 %22 %30 %32 %34 %36 %38 %40 - OpReturn - OpFunctionEnd - %22 = OpFunction %2 None %15 - %16 = OpFunctionParameter %7 - %17 = OpFunctionParameter %9 - %18 = OpFunctionParameter %11 - %19 = OpFunctionParameter %14 - %20 = OpFunctionParameter %7 - %21 = OpFunctionParameter %7 - %23 = OpLabel - OpReturn - OpFunctionEnd -)"; - ASSERT_TRUE(IsEqual(env, after_transformation, context.get())); -} - -} // namespace -} // namespace fuzz -} // namespace spvtools diff --git a/test/fuzz/transformation_swap_two_functions_test.cpp b/test/fuzz/transformation_swap_two_functions_test.cpp deleted file mode 100644 index 20342526..00000000 --- a/test/fuzz/transformation_swap_two_functions_test.cpp +++ /dev/null @@ -1,257 +0,0 @@ -// Copyright (c) 2021 Shiyu Liu -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/fuzz/transformation_swap_two_functions.h" - -#include "gtest/gtest.h" -#include "source/fuzz/fuzzer_util.h" -#include "test/fuzz/fuzz_test_util.h" - -namespace spvtools { -namespace fuzz { -namespace { - -TEST(TransformationSwapTwoFunctionsTest, SimpleTest) { - // float multiplyBy2(in float value) { - // return value*2.0; - // } - - // float multiplyBy4(in float value) { - // return multiplyBy2(value)*2.0; - // } - - // float multiplyBy8(in float value) { - // return multiplyBy2(value)*multiplyBy4(value); - // } - - // layout(location=0) in float value; - // void main() { //4 - // multiplyBy2(3.7); //10 - // multiplyBy4(3.9); //13 - // multiplyBy8(5.0); //16 - // } - - std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %48 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %10 "multiplyBy2(f1;" - OpName %9 "value" - OpName %13 "multiplyBy4(f1;" - OpName %12 "value" - OpName %16 "multiplyBy8(f1;" - OpName %15 "value" - OpName %23 "param" - OpName %29 "param" - OpName %32 "param" - OpName %39 "param" - OpName %42 "param" - OpName %45 "param" - OpName %48 "value" - OpDecorate %48 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypePointer Function %6 - %8 = OpTypeFunction %6 %7 - %19 = OpConstant %6 2 - %38 = OpConstant %6 3.70000005 - %41 = OpConstant %6 3.9000001 - %44 = OpConstant %6 5 - %47 = OpTypePointer Input %6 - %48 = OpVariable %47 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %39 = OpVariable %7 Function - %42 = OpVariable %7 Function - %45 = OpVariable %7 Function - OpStore %39 %38 - %40 = OpFunctionCall %6 %10 %39 - OpStore %42 %41 - %43 = OpFunctionCall %6 %13 %42 - OpStore %45 %44 - %46 = OpFunctionCall %6 %16 %45 - OpReturn - OpFunctionEnd - %10 = OpFunction %6 None %8 - %9 = OpFunctionParameter %7 - %11 = OpLabel - %18 = OpLoad %6 %9 - %20 = OpFMul %6 %18 %19 - OpReturnValue %20 - OpFunctionEnd - %13 = OpFunction %6 None %8 - %12 = OpFunctionParameter %7 - %14 = OpLabel - %23 = OpVariable %7 Function - %24 = OpLoad %6 %12 - OpStore %23 %24 - %25 = OpFunctionCall %6 %10 %23 - %26 = OpFMul %6 %25 %19 - OpReturnValue %26 - OpFunctionEnd - %16 = OpFunction %6 None %8 - %15 = OpFunctionParameter %7 - %17 = OpLabel - %29 = OpVariable %7 Function - %32 = OpVariable %7 Function - %30 = OpLoad %6 %15 - OpStore %29 %30 - %31 = OpFunctionCall %6 %10 %29 - %33 = OpLoad %6 %15 - OpStore %32 %33 - %34 = OpFunctionCall %6 %13 %32 - %35 = OpFMul %6 %31 %34 - OpReturnValue %35 - OpFunctionEnd - )"; - const auto env = SPV_ENV_UNIVERSAL_1_3; - const auto consumer = nullptr; - const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - - // Check context validity. - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - - TransformationContext transformation_context( - MakeUnique(context.get()), validator_options); - -#ifndef NDEBUG - // Function should not swap with itself. - ASSERT_DEATH(TransformationSwapTwoFunctions(4, 4).IsApplicable( - context.get(), transformation_context), - "The two function ids cannot be the same."); -#endif - - // Function with id 29 does not exist. - ASSERT_FALSE(TransformationSwapTwoFunctions(10, 29).IsApplicable( - context.get(), transformation_context)); - - // Function with id 30 does not exist. - ASSERT_FALSE(TransformationSwapTwoFunctions(30, 13).IsApplicable( - context.get(), transformation_context)); - - // Both functions with id 5 and 6 do not exist. - ASSERT_FALSE(TransformationSwapTwoFunctions(5, 6).IsApplicable( - context.get(), transformation_context)); - - // Function with result_id 10 and 13 should swap successfully. - auto swap_test5 = TransformationSwapTwoFunctions(10, 13); - ASSERT_TRUE(swap_test5.IsApplicable(context.get(), transformation_context)); - - // Get the definitions of functions 10 and 13, as recorded by the def-use - // manager. - auto def_use_manager = context->get_def_use_mgr(); - auto function_10_inst = def_use_manager->GetDef(10); - auto function_13_inst = def_use_manager->GetDef(13); - - ApplyAndCheckFreshIds(swap_test5, context.get(), &transformation_context); - - // Check that def-use information for functions 10 and 13 has been preserved - // by the transformation. - ASSERT_EQ(function_10_inst, def_use_manager->GetDef(10)); - ASSERT_EQ(function_13_inst, def_use_manager->GetDef(13)); - - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - - std::string after_transformation = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %48 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - OpName %10 "multiplyBy2(f1;" - OpName %9 "value" - OpName %13 "multiplyBy4(f1;" - OpName %12 "value" - OpName %16 "multiplyBy8(f1;" - OpName %15 "value" - OpName %23 "param" - OpName %29 "param" - OpName %32 "param" - OpName %39 "param" - OpName %42 "param" - OpName %45 "param" - OpName %48 "value" - OpDecorate %48 Location 0 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypePointer Function %6 - %8 = OpTypeFunction %6 %7 - %19 = OpConstant %6 2 - %38 = OpConstant %6 3.70000005 - %41 = OpConstant %6 3.9000001 - %44 = OpConstant %6 5 - %47 = OpTypePointer Input %6 - %48 = OpVariable %47 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %39 = OpVariable %7 Function - %42 = OpVariable %7 Function - %45 = OpVariable %7 Function - OpStore %39 %38 - %40 = OpFunctionCall %6 %10 %39 - OpStore %42 %41 - %43 = OpFunctionCall %6 %13 %42 - OpStore %45 %44 - %46 = OpFunctionCall %6 %16 %45 - OpReturn - OpFunctionEnd - %13 = OpFunction %6 None %8 - %12 = OpFunctionParameter %7 - %14 = OpLabel - %23 = OpVariable %7 Function - %24 = OpLoad %6 %12 - OpStore %23 %24 - %25 = OpFunctionCall %6 %10 %23 - %26 = OpFMul %6 %25 %19 - OpReturnValue %26 - OpFunctionEnd - %10 = OpFunction %6 None %8 - %9 = OpFunctionParameter %7 - %11 = OpLabel - %18 = OpLoad %6 %9 - %20 = OpFMul %6 %18 %19 - OpReturnValue %20 - OpFunctionEnd - %16 = OpFunction %6 None %8 - %15 = OpFunctionParameter %7 - %17 = OpLabel - %29 = OpVariable %7 Function - %32 = OpVariable %7 Function - %30 = OpLoad %6 %15 - OpStore %29 %30 - %31 = OpFunctionCall %6 %10 %29 - %33 = OpLoad %6 %15 - OpStore %32 %33 - %34 = OpFunctionCall %6 %13 %32 - %35 = OpFMul %6 %31 %34 - OpReturnValue %35 - OpFunctionEnd - )"; - ASSERT_TRUE(IsEqual(env, after_transformation, context.get())); -} - -} // namespace -} // namespace fuzz -} // namespace spvtools diff --git a/test/fuzz/transformation_wrap_vector_synonym_test.cpp b/test/fuzz/transformation_wrap_vector_synonym_test.cpp deleted file mode 100644 index dae78a5d..00000000 --- a/test/fuzz/transformation_wrap_vector_synonym_test.cpp +++ /dev/null @@ -1,1394 +0,0 @@ -// Copyright (c) 2021 Shiyu Liu -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/fuzz/transformation_wrap_vector_synonym.h" - -#include "gtest/gtest.h" -#include "source/fuzz/fuzzer_util.h" -#include "source/fuzz/instruction_descriptor.h" -#include "test/fuzz/fuzz_test_util.h" - -namespace spvtools { -namespace fuzz { -namespace { - -TEST(TransformationWrapVectorSynonym, BasicTest) { - std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %97 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %7 = OpTypePointer Function %6 - %9 = OpConstant %6 10 - %11 = OpConstant %6 -5 - %12 = OpTypeVector %6 2 - %13 = OpTypePointer Function %12 - %18 = OpTypeInt 32 0 - %19 = OpTypePointer Function %18 - %21 = OpConstant %18 8 - %23 = OpConstant %18 2 - %24 = OpTypeVector %18 3 - %25 = OpTypePointer Function %24 - %31 = OpTypeFloat 32 - %32 = OpTypePointer Function %31 - %34 = OpConstant %31 3.29999995 - %36 = OpConstant %31 1.10000002 - %37 = OpTypeVector %31 4 - %38 = OpTypePointer Function %37 - %96 = OpTypePointer Input %31 - %97 = OpVariable %96 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %8 = OpVariable %7 Function - %10 = OpVariable %7 Function - %14 = OpVariable %13 Function - %20 = OpVariable %19 Function - %22 = OpVariable %19 Function - %26 = OpVariable %25 Function - %33 = OpVariable %32 Function - %35 = OpVariable %32 Function - %39 = OpVariable %38 Function - %47 = OpVariable %7 Function - %51 = OpVariable %7 Function - %55 = OpVariable %7 Function - %59 = OpVariable %7 Function - %63 = OpVariable %19 Function - %67 = OpVariable %19 Function - %71 = OpVariable %19 Function - %75 = OpVariable %19 Function - %79 = OpVariable %32 Function - %83 = OpVariable %32 Function - %87 = OpVariable %32 Function - %91 = OpVariable %32 Function - OpStore %8 %9 - OpStore %10 %11 - %15 = OpLoad %6 %8 - %16 = OpLoad %6 %10 - %17 = OpCompositeConstruct %12 %15 %16 - OpStore %14 %17 - OpStore %20 %21 - OpStore %22 %23 - %27 = OpLoad %18 %20 - %28 = OpLoad %18 %20 - %29 = OpLoad %18 %22 - %30 = OpCompositeConstruct %24 %27 %28 %29 - OpStore %26 %30 - OpStore %33 %34 - OpStore %35 %36 - %40 = OpLoad %31 %33 - %41 = OpLoad %31 %33 - %42 = OpLoad %31 %35 - %43 = OpLoad %31 %35 - %44 = OpCompositeConstruct %37 %40 %41 %42 %43 - %45 = OpLoad %37 %39 - %46 = OpVectorShuffle %37 %45 %44 5 6 7 4 - OpStore %39 %46 - %48 = OpLoad %6 %8 - %49 = OpLoad %6 %10 - %100 = OpCompositeConstruct %12 %48 %48 - %101 = OpCompositeConstruct %12 %49 %49 - %50 = OpIAdd %6 %48 %49 - OpStore %47 %50 - %52 = OpLoad %6 %8 - %53 = OpLoad %6 %10 - %54 = OpISub %6 %52 %53 - OpStore %51 %54 - %56 = OpLoad %6 %8 - %57 = OpLoad %6 %10 - %58 = OpIMul %6 %56 %57 - OpStore %55 %58 - %60 = OpLoad %6 %8 - %61 = OpLoad %6 %10 - %62 = OpSDiv %6 %60 %61 - OpStore %59 %62 - %64 = OpLoad %18 %20 - %65 = OpLoad %18 %22 - %66 = OpIAdd %18 %64 %65 - OpStore %63 %66 - %68 = OpLoad %18 %20 - %69 = OpLoad %18 %22 - %70 = OpISub %18 %68 %69 - OpStore %67 %70 - %72 = OpLoad %18 %20 - %73 = OpLoad %18 %22 - %74 = OpIMul %18 %72 %73 - OpStore %71 %74 - %76 = OpLoad %18 %20 - %77 = OpLoad %18 %22 - %78 = OpUDiv %18 %76 %77 - OpStore %75 %78 - %80 = OpLoad %31 %33 - %81 = OpLoad %31 %35 - %82 = OpFAdd %31 %80 %81 - OpStore %79 %82 - %84 = OpLoad %31 %33 - %85 = OpLoad %31 %35 - %86 = OpFSub %31 %84 %85 - OpStore %83 %86 - %88 = OpLoad %31 %33 - %89 = OpLoad %31 %35 - %90 = OpFMul %31 %88 %89 - OpStore %87 %90 - %92 = OpLoad %31 %33 - %93 = OpLoad %31 %35 - %94 = OpFDiv %31 %92 %93 - OpStore %91 %94 - OpReturn - OpFunctionEnd - )"; - const auto env = SPV_ENV_UNIVERSAL_1_3; - const auto consumer = nullptr; - const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - - // Check context validity. - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - - TransformationContext transformation_context( - MakeUnique(context.get()), validator_options); - - // Vec Type Id | Vector Type | Element Type id | Element Type | - // ------------+----------------+------------------+-----------------+ - // 12 | vec2 | 6 | int32 | - // 24 | vec3 | 18 | uint32 | - // 37 | vec4 | 31 | float | - - // Instruction Id | Opcode | Type Id | constant id 1 | constant id 2 | - // ---------------+---------+---------+---------------+---------------+ - // 50 | OpIAdd | 6 | 48 | 49 | - // 54 | OpISub | 6 | 52 | 53 | - // 58 | OpIMul | 6 | 56 | 57 | - // 62 | OpSDiv | 6 | 60 | 61 | - // 66 | OpIAdd | 18 | 64 | 65 | - // 70 | OpISub | 18 | 68 | 69 | - // 74 | OpIMul | 18 | 72 | 73 | - // 78 | OpUDiv | 18 | 76 | 77 | - // 82 | OpFAdd | 31 | 80 | 81 | - // 86 | OpFSub | 31 | 84 | 85 | - // 90 | OpFMul | 31 | 88 | 89 | - // 94 | OpFDiv | 31 | 92 | 93 | - - // Assert that the target scalar instruction result id is relevant. - ASSERT_FALSE(transformation_context.GetFactManager()->IdIsIrrelevant(50)); - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(100, {1}), MakeDataDescriptor(48, {})); - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(101, {1}), MakeDataDescriptor(49, {})); - - // The following are all invalid use. - { - // Bad: Instruction id does not exist. - TransformationWrapVectorSynonym wrap_add_int_bad1(103, 100, 101, 102, 1); - ASSERT_FALSE( - wrap_add_int_bad1.IsApplicable(context.get(), transformation_context)); - - // Bad: Instruction id given is not of a valid arithmetic operation typed - // instruction. - TransformationWrapVectorSynonym wrap_add_int_bad2(80, 100, 101, 102, 1); - ASSERT_FALSE( - wrap_add_int_bad1.IsApplicable(context.get(), transformation_context)); - - // Bad: the id for the first vector does not exist. - TransformationWrapVectorSynonym wrap_add_int_bad3(50, 105, 101, 102, 1); - ASSERT_FALSE( - wrap_add_int_bad3.IsApplicable(context.get(), transformation_context)); - - // Bad: the id for the second vector does not exist. - TransformationWrapVectorSynonym wrap_add_int_bad4(50, 100, 105, 102, 1); - ASSERT_FALSE( - wrap_add_int_bad4.IsApplicable(context.get(), transformation_context)); - - // Bad: vector id is not fresh. - TransformationWrapVectorSynonym wrap_add_int_bad6(50, 100, 101, 94, 1); - ASSERT_FALSE( - wrap_add_int_bad6.IsApplicable(context.get(), transformation_context)); - - // Bad: The position goes out of bound for the given vector type. - TransformationWrapVectorSynonym wrap_add_int_bad8(50, 100, 101, 102, 2); - ASSERT_FALSE( - wrap_add_int_bad8.IsApplicable(context.get(), transformation_context)); - - // Bad: The original instruction is not a valid scalar operation - // instruction. - TransformationWrapVectorSynonym wrap_add_int(27, 100, 101, 102, 1); - ASSERT_FALSE( - wrap_add_int.IsApplicable(context.get(), transformation_context)); - } - - // Good: The following transformation should be applicable. - TransformationWrapVectorSynonym wrap_add_int(50, 100, 101, 102, 1); - ASSERT_TRUE(wrap_add_int.IsApplicable(context.get(), transformation_context)); - // Insert an arithmetic instruction of the same type to add two vectors. - ApplyAndCheckFreshIds(wrap_add_int, context.get(), &transformation_context); - - // |instruction_id| and id at |scalar_position of the result vector should be - // synonyms. - ASSERT_TRUE(transformation_context.GetFactManager()->IsSynonymous( - MakeDataDescriptor(102, {1}), MakeDataDescriptor(50, {}))); - - // After applying transformations, the instruction: - // - // %102 = OpIAdd %12 %100 %101 - // - // should be added before: - // - // %50 = OpIAdd %6 %48 %49 - std::string after_transformation = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %97 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %7 = OpTypePointer Function %6 - %9 = OpConstant %6 10 - %11 = OpConstant %6 -5 - %12 = OpTypeVector %6 2 - %13 = OpTypePointer Function %12 - %18 = OpTypeInt 32 0 - %19 = OpTypePointer Function %18 - %21 = OpConstant %18 8 - %23 = OpConstant %18 2 - %24 = OpTypeVector %18 3 - %25 = OpTypePointer Function %24 - %31 = OpTypeFloat 32 - %32 = OpTypePointer Function %31 - %34 = OpConstant %31 3.29999995 - %36 = OpConstant %31 1.10000002 - %37 = OpTypeVector %31 4 - %38 = OpTypePointer Function %37 - %96 = OpTypePointer Input %31 - %97 = OpVariable %96 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %8 = OpVariable %7 Function - %10 = OpVariable %7 Function - %14 = OpVariable %13 Function - %20 = OpVariable %19 Function - %22 = OpVariable %19 Function - %26 = OpVariable %25 Function - %33 = OpVariable %32 Function - %35 = OpVariable %32 Function - %39 = OpVariable %38 Function - %47 = OpVariable %7 Function - %51 = OpVariable %7 Function - %55 = OpVariable %7 Function - %59 = OpVariable %7 Function - %63 = OpVariable %19 Function - %67 = OpVariable %19 Function - %71 = OpVariable %19 Function - %75 = OpVariable %19 Function - %79 = OpVariable %32 Function - %83 = OpVariable %32 Function - %87 = OpVariable %32 Function - %91 = OpVariable %32 Function - OpStore %8 %9 - OpStore %10 %11 - %15 = OpLoad %6 %8 - %16 = OpLoad %6 %10 - %17 = OpCompositeConstruct %12 %15 %16 - OpStore %14 %17 - OpStore %20 %21 - OpStore %22 %23 - %27 = OpLoad %18 %20 - %28 = OpLoad %18 %20 - %29 = OpLoad %18 %22 - %30 = OpCompositeConstruct %24 %27 %28 %29 - OpStore %26 %30 - OpStore %33 %34 - OpStore %35 %36 - %40 = OpLoad %31 %33 - %41 = OpLoad %31 %33 - %42 = OpLoad %31 %35 - %43 = OpLoad %31 %35 - %44 = OpCompositeConstruct %37 %40 %41 %42 %43 - %45 = OpLoad %37 %39 - %46 = OpVectorShuffle %37 %45 %44 5 6 7 4 - OpStore %39 %46 - %48 = OpLoad %6 %8 - %49 = OpLoad %6 %10 - %100 = OpCompositeConstruct %12 %48 %48 - %101 = OpCompositeConstruct %12 %49 %49 - %102 = OpIAdd %12 %100 %101 - %50 = OpIAdd %6 %48 %49 - OpStore %47 %50 - %52 = OpLoad %6 %8 - %53 = OpLoad %6 %10 - %54 = OpISub %6 %52 %53 - OpStore %51 %54 - %56 = OpLoad %6 %8 - %57 = OpLoad %6 %10 - %58 = OpIMul %6 %56 %57 - OpStore %55 %58 - %60 = OpLoad %6 %8 - %61 = OpLoad %6 %10 - %62 = OpSDiv %6 %60 %61 - OpStore %59 %62 - %64 = OpLoad %18 %20 - %65 = OpLoad %18 %22 - %66 = OpIAdd %18 %64 %65 - OpStore %63 %66 - %68 = OpLoad %18 %20 - %69 = OpLoad %18 %22 - %70 = OpISub %18 %68 %69 - OpStore %67 %70 - %72 = OpLoad %18 %20 - %73 = OpLoad %18 %22 - %74 = OpIMul %18 %72 %73 - OpStore %71 %74 - %76 = OpLoad %18 %20 - %77 = OpLoad %18 %22 - %78 = OpUDiv %18 %76 %77 - OpStore %75 %78 - %80 = OpLoad %31 %33 - %81 = OpLoad %31 %35 - %82 = OpFAdd %31 %80 %81 - OpStore %79 %82 - %84 = OpLoad %31 %33 - %85 = OpLoad %31 %35 - %86 = OpFSub %31 %84 %85 - OpStore %83 %86 - %88 = OpLoad %31 %33 - %89 = OpLoad %31 %35 - %90 = OpFMul %31 %88 %89 - OpStore %87 %90 - %92 = OpLoad %31 %33 - %93 = OpLoad %31 %35 - %94 = OpFDiv %31 %92 %93 - OpStore %91 %94 - OpReturn - OpFunctionEnd - )"; - ASSERT_TRUE(IsEqual(env, after_transformation, context.get())); -} - -TEST(TransformationWrapVectorSynonym, OperationSupportTest) { - std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %97 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %7 = OpTypePointer Function %6 - %9 = OpConstant %6 10 - %11 = OpConstant %6 -5 - %12 = OpTypeVector %6 2 - %13 = OpTypePointer Function %12 - %18 = OpTypeInt 32 0 - %19 = OpTypePointer Function %18 - %21 = OpConstant %18 8 - %23 = OpConstant %18 2 - %24 = OpTypeVector %18 3 - %25 = OpTypePointer Function %24 - %31 = OpTypeFloat 32 - %32 = OpTypePointer Function %31 - %34 = OpConstant %31 3.29999995 - %36 = OpConstant %31 1.10000002 - %37 = OpTypeVector %31 4 - %38 = OpTypePointer Function %37 - %96 = OpTypePointer Input %31 - %97 = OpVariable %96 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %8 = OpVariable %7 Function - %10 = OpVariable %7 Function - %14 = OpVariable %13 Function - %20 = OpVariable %19 Function - %22 = OpVariable %19 Function - %26 = OpVariable %25 Function - %33 = OpVariable %32 Function - %35 = OpVariable %32 Function - %39 = OpVariable %38 Function - %47 = OpVariable %7 Function - %51 = OpVariable %7 Function - %55 = OpVariable %7 Function - %59 = OpVariable %7 Function - %63 = OpVariable %19 Function - %67 = OpVariable %19 Function - %71 = OpVariable %19 Function - %75 = OpVariable %19 Function - %79 = OpVariable %32 Function - %83 = OpVariable %32 Function - %87 = OpVariable %32 Function - %91 = OpVariable %32 Function - OpStore %8 %9 - OpStore %10 %11 - %15 = OpLoad %6 %8 - %16 = OpLoad %6 %10 - %17 = OpCompositeConstruct %12 %15 %16 - OpStore %14 %17 - OpStore %20 %21 - OpStore %22 %23 - %27 = OpLoad %18 %20 - %28 = OpLoad %18 %20 - %29 = OpLoad %18 %22 - %30 = OpCompositeConstruct %24 %27 %28 %29 - OpStore %26 %30 - OpStore %33 %34 - OpStore %35 %36 - %40 = OpLoad %31 %33 - %41 = OpLoad %31 %33 - %42 = OpLoad %31 %35 - %43 = OpLoad %31 %35 - %44 = OpCompositeConstruct %37 %40 %41 %42 %43 - %45 = OpLoad %37 %39 - %46 = OpVectorShuffle %37 %45 %44 5 6 7 4 - OpStore %39 %46 - %48 = OpLoad %6 %8 - %49 = OpLoad %6 %10 - %50 = OpIAdd %6 %48 %49 - OpStore %47 %50 - %52 = OpLoad %6 %8 - %53 = OpLoad %6 %10 - %100 = OpCompositeConstruct %12 %52 %52 - %101 = OpCompositeConstruct %12 %53 %53 - %54 = OpISub %6 %52 %53 - OpStore %51 %54 - %56 = OpLoad %6 %8 - %57 = OpLoad %6 %10 - %103 = OpCompositeConstruct %12 %56 %56 - %104 = OpCompositeConstruct %12 %57 %57 - %58 = OpIMul %6 %56 %57 - OpStore %55 %58 - %60 = OpLoad %6 %8 - %61 = OpLoad %6 %10 - %62 = OpSDiv %6 %60 %61 - OpStore %59 %62 - %64 = OpLoad %18 %20 - %65 = OpLoad %18 %22 - %106 = OpCompositeConstruct %24 %64 %64 %64 - %107 = OpCompositeConstruct %24 %65 %65 %65 - %66 = OpIAdd %18 %64 %65 - OpStore %63 %66 - %68 = OpLoad %18 %20 - %69 = OpLoad %18 %22 - %109 = OpCompositeConstruct %24 %68 %68 %68 - %110 = OpCompositeConstruct %24 %69 %69 %69 - %70 = OpISub %18 %68 %69 - OpStore %67 %70 - %72 = OpLoad %18 %20 - %73 = OpLoad %18 %22 - %112 = OpCompositeConstruct %24 %72 %72 %72 - %113 = OpCompositeConstruct %24 %73 %73 %73 - %74 = OpIMul %18 %72 %73 - OpStore %71 %74 - %76 = OpLoad %18 %20 - %77 = OpLoad %18 %22 - %78 = OpUDiv %18 %76 %77 - OpStore %75 %78 - %80 = OpLoad %31 %33 - %81 = OpLoad %31 %35 - %115 = OpCompositeConstruct %37 %80 %80 %80 %80 - %116 = OpCompositeConstruct %37 %81 %81 %81 %81 - %82 = OpFAdd %31 %80 %81 - OpStore %79 %82 - %84 = OpLoad %31 %33 - %85 = OpLoad %31 %35 - %118 = OpCompositeConstruct %37 %84 %84 %84 %84 - %119 = OpCompositeConstruct %37 %85 %85 %85 %85 - %86 = OpFSub %31 %84 %85 - OpStore %83 %86 - %88 = OpLoad %31 %33 - %89 = OpLoad %31 %35 - %121 = OpCompositeConstruct %37 %88 %88 %88 %88 - %122 = OpCompositeConstruct %37 %89 %89 %89 %89 - %90 = OpFMul %31 %88 %89 - OpStore %87 %90 - %92 = OpLoad %31 %33 - %93 = OpLoad %31 %35 - %94 = OpFDiv %31 %92 %93 - OpStore %91 %94 - OpReturn - OpFunctionEnd - )"; - const auto env = SPV_ENV_UNIVERSAL_1_3; - const auto consumer = nullptr; - const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - - TransformationContext transformation_context( - MakeUnique(context.get()), validator_options); - - { - // Add synonym facts between the vector operands at pos and the operands to - // the scalar instruction. - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(100, {1}), MakeDataDescriptor(52, {})); - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(101, {1}), MakeDataDescriptor(53, {})); - - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(103, {0}), MakeDataDescriptor(56, {})); - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(104, {0}), MakeDataDescriptor(57, {})); - - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(106, {2}), MakeDataDescriptor(64, {})); - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(107, {2}), MakeDataDescriptor(65, {})); - - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(109, {2}), MakeDataDescriptor(68, {})); - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(110, {2}), MakeDataDescriptor(69, {})); - - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(112, {1}), MakeDataDescriptor(72, {})); - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(113, {1}), MakeDataDescriptor(73, {})); - - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(115, {2}), MakeDataDescriptor(80, {})); - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(116, {2}), MakeDataDescriptor(81, {})); - - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(118, {3}), MakeDataDescriptor(84, {})); - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(119, {3}), MakeDataDescriptor(85, {})); - - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(121, {1}), MakeDataDescriptor(88, {})); - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(122, {1}), MakeDataDescriptor(89, {})); - } - - // Test OpISub for signed integer. - { - // Good: The following transformation should be applicable. - TransformationWrapVectorSynonym wrap_sub_int(54, 100, 101, 102, 1); - ASSERT_TRUE( - wrap_sub_int.IsApplicable(context.get(), transformation_context)); - ApplyAndCheckFreshIds(wrap_sub_int, context.get(), &transformation_context); - - // |instruction_id| and id at |scalar_position of the result vector should - // be synonyms. - ASSERT_TRUE(transformation_context.GetFactManager()->IsSynonymous( - MakeDataDescriptor(102, {1}), MakeDataDescriptor(54, {}))); - } - - // Test OpIMul for signed integer. - { - // Good: The following transformation should be applicable. - TransformationWrapVectorSynonym wrap_mul_int(58, 103, 104, 105, 0); - ASSERT_TRUE( - wrap_mul_int.IsApplicable(context.get(), transformation_context)); - ApplyAndCheckFreshIds(wrap_mul_int, context.get(), &transformation_context); - - // |instruction_id| and id at |scalar_position of the result vector should - // be synonyms. - ASSERT_TRUE(transformation_context.GetFactManager()->IsSynonymous( - MakeDataDescriptor(105, {0}), MakeDataDescriptor(58, {}))); - } - - // Test OpIAdd for unsigned integer. - { - // Good: The following transformation should be applicable. - TransformationWrapVectorSynonym wrap_add_uint(66, 106, 107, 108, 2); - ASSERT_TRUE( - wrap_add_uint.IsApplicable(context.get(), transformation_context)); - ApplyAndCheckFreshIds(wrap_add_uint, context.get(), - &transformation_context); - - // |instruction_id| and id at |scalar_position of the result vector should - // be synonyms. - ASSERT_TRUE(transformation_context.GetFactManager()->IsSynonymous( - MakeDataDescriptor(108, {2}), MakeDataDescriptor(66, {}))); - } - - // Test OpISub for signed integer. - { - // Good: The following transformation should be applicable. - TransformationWrapVectorSynonym wrap_sub_uint(70, 109, 110, 111, 2); - ASSERT_TRUE( - wrap_sub_uint.IsApplicable(context.get(), transformation_context)); - ApplyAndCheckFreshIds(wrap_sub_uint, context.get(), - &transformation_context); - - // |instruction_id| and id at |scalar_position of the result vector should - // be synonyms. - ASSERT_TRUE(transformation_context.GetFactManager()->IsSynonymous( - MakeDataDescriptor(111, {2}), MakeDataDescriptor(70, {}))); - } - - // Test OpIMul for signed integer. - { - // Good: The following transformation should be applicable. - TransformationWrapVectorSynonym wrap_mul_uint(74, 112, 113, 114, 1); - ASSERT_TRUE( - wrap_mul_uint.IsApplicable(context.get(), transformation_context)); - ApplyAndCheckFreshIds(wrap_mul_uint, context.get(), - &transformation_context); - - // |instruction_id| and id at |scalar_position of the result vector should - // be synonyms. - ASSERT_TRUE(transformation_context.GetFactManager()->IsSynonymous( - MakeDataDescriptor(114, {1}), MakeDataDescriptor(74, {}))); - } - - // Test OpFAdd for float. - { - // Good: The following transformation should be applicable. - TransformationWrapVectorSynonym wrap_add_float(82, 115, 116, 117, 2); - ASSERT_TRUE( - wrap_add_float.IsApplicable(context.get(), transformation_context)); - ApplyAndCheckFreshIds(wrap_add_float, context.get(), - &transformation_context); - - // |instruction_id| and id at |scalar_position of the result vector should - // be synonyms. - ASSERT_TRUE(transformation_context.GetFactManager()->IsSynonymous( - MakeDataDescriptor(117, {2}), MakeDataDescriptor(82, {}))); - } - - // Test OpFSub for float. - { - // Good: The following transformation should be applicable. - TransformationWrapVectorSynonym wrap_add_float(86, 118, 119, 120, 3); - ASSERT_TRUE( - wrap_add_float.IsApplicable(context.get(), transformation_context)); - ApplyAndCheckFreshIds(wrap_add_float, context.get(), - &transformation_context); - - // |instruction_id| and id at |scalar_position of the result vector should - // be synonyms. - ASSERT_TRUE(transformation_context.GetFactManager()->IsSynonymous( - MakeDataDescriptor(120, {3}), MakeDataDescriptor(86, {}))); - } - - // Test OpFMul for float. - { - // Good: The following transformation should be applicable. - TransformationWrapVectorSynonym wrap_mul_float(90, 121, 122, 123, 1); - ASSERT_TRUE( - wrap_mul_float.IsApplicable(context.get(), transformation_context)); - ApplyAndCheckFreshIds(wrap_mul_float, context.get(), - &transformation_context); - - // |instruction_id| and id at |scalar_position of the result vector should - // be synonyms. - ASSERT_TRUE(transformation_context.GetFactManager()->IsSynonymous( - MakeDataDescriptor(123, {1}), MakeDataDescriptor(90, {}))); - } - - std::string after_transformation = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %97 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %7 = OpTypePointer Function %6 - %9 = OpConstant %6 10 - %11 = OpConstant %6 -5 - %12 = OpTypeVector %6 2 - %13 = OpTypePointer Function %12 - %18 = OpTypeInt 32 0 - %19 = OpTypePointer Function %18 - %21 = OpConstant %18 8 - %23 = OpConstant %18 2 - %24 = OpTypeVector %18 3 - %25 = OpTypePointer Function %24 - %31 = OpTypeFloat 32 - %32 = OpTypePointer Function %31 - %34 = OpConstant %31 3.29999995 - %36 = OpConstant %31 1.10000002 - %37 = OpTypeVector %31 4 - %38 = OpTypePointer Function %37 - %96 = OpTypePointer Input %31 - %97 = OpVariable %96 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %8 = OpVariable %7 Function - %10 = OpVariable %7 Function - %14 = OpVariable %13 Function - %20 = OpVariable %19 Function - %22 = OpVariable %19 Function - %26 = OpVariable %25 Function - %33 = OpVariable %32 Function - %35 = OpVariable %32 Function - %39 = OpVariable %38 Function - %47 = OpVariable %7 Function - %51 = OpVariable %7 Function - %55 = OpVariable %7 Function - %59 = OpVariable %7 Function - %63 = OpVariable %19 Function - %67 = OpVariable %19 Function - %71 = OpVariable %19 Function - %75 = OpVariable %19 Function - %79 = OpVariable %32 Function - %83 = OpVariable %32 Function - %87 = OpVariable %32 Function - %91 = OpVariable %32 Function - OpStore %8 %9 - OpStore %10 %11 - %15 = OpLoad %6 %8 - %16 = OpLoad %6 %10 - %17 = OpCompositeConstruct %12 %15 %16 - OpStore %14 %17 - OpStore %20 %21 - OpStore %22 %23 - %27 = OpLoad %18 %20 - %28 = OpLoad %18 %20 - %29 = OpLoad %18 %22 - %30 = OpCompositeConstruct %24 %27 %28 %29 - OpStore %26 %30 - OpStore %33 %34 - OpStore %35 %36 - %40 = OpLoad %31 %33 - %41 = OpLoad %31 %33 - %42 = OpLoad %31 %35 - %43 = OpLoad %31 %35 - %44 = OpCompositeConstruct %37 %40 %41 %42 %43 - %45 = OpLoad %37 %39 - %46 = OpVectorShuffle %37 %45 %44 5 6 7 4 - OpStore %39 %46 - %48 = OpLoad %6 %8 - %49 = OpLoad %6 %10 - %50 = OpIAdd %6 %48 %49 - OpStore %47 %50 - %52 = OpLoad %6 %8 - %53 = OpLoad %6 %10 - %100 = OpCompositeConstruct %12 %52 %52 - %101 = OpCompositeConstruct %12 %53 %53 - %102 = OpISub %12 %100 %101 - %54 = OpISub %6 %52 %53 - OpStore %51 %54 - %56 = OpLoad %6 %8 - %57 = OpLoad %6 %10 - %103 = OpCompositeConstruct %12 %56 %56 - %104 = OpCompositeConstruct %12 %57 %57 - %105 = OpIMul %12 %103 %104 - %58 = OpIMul %6 %56 %57 - OpStore %55 %58 - %60 = OpLoad %6 %8 - %61 = OpLoad %6 %10 - %62 = OpSDiv %6 %60 %61 - OpStore %59 %62 - %64 = OpLoad %18 %20 - %65 = OpLoad %18 %22 - %106 = OpCompositeConstruct %24 %64 %64 %64 - %107 = OpCompositeConstruct %24 %65 %65 %65 - %108 = OpIAdd %24 %106 %107 - %66 = OpIAdd %18 %64 %65 - OpStore %63 %66 - %68 = OpLoad %18 %20 - %69 = OpLoad %18 %22 - %109 = OpCompositeConstruct %24 %68 %68 %68 - %110 = OpCompositeConstruct %24 %69 %69 %69 - %111 = OpISub %24 %109 %110 - %70 = OpISub %18 %68 %69 - OpStore %67 %70 - %72 = OpLoad %18 %20 - %73 = OpLoad %18 %22 - %112 = OpCompositeConstruct %24 %72 %72 %72 - %113 = OpCompositeConstruct %24 %73 %73 %73 - %114 = OpIMul %24 %112 %113 - %74 = OpIMul %18 %72 %73 - OpStore %71 %74 - %76 = OpLoad %18 %20 - %77 = OpLoad %18 %22 - %78 = OpUDiv %18 %76 %77 - OpStore %75 %78 - %80 = OpLoad %31 %33 - %81 = OpLoad %31 %35 - %115 = OpCompositeConstruct %37 %80 %80 %80 %80 - %116 = OpCompositeConstruct %37 %81 %81 %81 %81 - %117 = OpFAdd %37 %115 %116 - %82 = OpFAdd %31 %80 %81 - OpStore %79 %82 - %84 = OpLoad %31 %33 - %85 = OpLoad %31 %35 - %118 = OpCompositeConstruct %37 %84 %84 %84 %84 - %119 = OpCompositeConstruct %37 %85 %85 %85 %85 - %120 = OpFSub %37 %118 %119 - %86 = OpFSub %31 %84 %85 - OpStore %83 %86 - %88 = OpLoad %31 %33 - %89 = OpLoad %31 %35 - %121 = OpCompositeConstruct %37 %88 %88 %88 %88 - %122 = OpCompositeConstruct %37 %89 %89 %89 %89 - %123 = OpFMul %37 %121 %122 - %90 = OpFMul %31 %88 %89 - OpStore %87 %90 - %92 = OpLoad %31 %33 - %93 = OpLoad %31 %35 - %94 = OpFDiv %31 %92 %93 - OpStore %91 %94 - OpReturn - OpFunctionEnd - )"; - ASSERT_TRUE(IsEqual(env, after_transformation, context.get())); -} - -TEST(TransformationWrapVectorSynonym, DivSupportTest) { - std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %97 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %7 = OpTypePointer Function %6 - %9 = OpConstant %6 10 - %11 = OpConstant %6 -5 - %12 = OpTypeVector %6 2 - %13 = OpTypePointer Function %12 - %18 = OpTypeInt 32 0 - %19 = OpTypePointer Function %18 - %21 = OpConstant %18 8 - %23 = OpConstant %18 2 - %24 = OpTypeVector %18 3 - %25 = OpTypePointer Function %24 - %31 = OpTypeFloat 32 - %32 = OpTypePointer Function %31 - %34 = OpConstant %31 3.29999995 - %36 = OpConstant %31 1.10000002 - %37 = OpTypeVector %31 4 - %38 = OpTypePointer Function %37 - %96 = OpTypePointer Input %31 - %97 = OpVariable %96 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %8 = OpVariable %7 Function - %10 = OpVariable %7 Function - %14 = OpVariable %13 Function - %20 = OpVariable %19 Function - %22 = OpVariable %19 Function - %26 = OpVariable %25 Function - %33 = OpVariable %32 Function - %35 = OpVariable %32 Function - %39 = OpVariable %38 Function - %47 = OpVariable %7 Function - %51 = OpVariable %7 Function - %55 = OpVariable %7 Function - %59 = OpVariable %7 Function - %63 = OpVariable %19 Function - %67 = OpVariable %19 Function - %71 = OpVariable %19 Function - %75 = OpVariable %19 Function - %79 = OpVariable %32 Function - %83 = OpVariable %32 Function - %87 = OpVariable %32 Function - %91 = OpVariable %32 Function - OpStore %8 %9 - OpStore %10 %11 - %15 = OpLoad %6 %8 - %16 = OpLoad %6 %10 - %17 = OpCompositeConstruct %12 %15 %16 - OpStore %14 %17 - OpStore %20 %21 - OpStore %22 %23 - %27 = OpLoad %18 %20 - %28 = OpLoad %18 %20 - %29 = OpLoad %18 %22 - %30 = OpCompositeConstruct %24 %27 %28 %29 - OpStore %26 %30 - OpStore %33 %34 - OpStore %35 %36 - %40 = OpLoad %31 %33 - %41 = OpLoad %31 %33 - %42 = OpLoad %31 %35 - %43 = OpLoad %31 %35 - %44 = OpCompositeConstruct %37 %40 %41 %42 %43 - %45 = OpLoad %37 %39 - %46 = OpVectorShuffle %37 %45 %44 5 6 7 4 - OpStore %39 %46 - %48 = OpLoad %6 %8 - %49 = OpLoad %6 %10 - %50 = OpIAdd %6 %48 %49 - OpStore %47 %50 - %52 = OpLoad %6 %8 - %53 = OpLoad %6 %10 - %54 = OpISub %6 %52 %53 - OpStore %51 %54 - %56 = OpLoad %6 %8 - %57 = OpLoad %6 %10 - %58 = OpIMul %6 %56 %57 - OpStore %55 %58 - %60 = OpLoad %6 %8 - %61 = OpLoad %6 %10 - %100 = OpCompositeConstruct %12 %60 %60 - %101 = OpCompositeConstruct %12 %61 %61 - %62 = OpSDiv %6 %60 %61 - OpStore %59 %62 - %64 = OpLoad %18 %20 - %65 = OpLoad %18 %22 - %66 = OpIAdd %18 %64 %65 - OpStore %63 %66 - %68 = OpLoad %18 %20 - %69 = OpLoad %18 %22 - %70 = OpISub %18 %68 %69 - OpStore %67 %70 - %72 = OpLoad %18 %20 - %73 = OpLoad %18 %22 - %74 = OpIMul %18 %72 %73 - OpStore %71 %74 - %76 = OpLoad %18 %20 - %77 = OpLoad %18 %22 - %102 = OpCompositeConstruct %24 %76 %76 %76 - %103 = OpCompositeConstruct %24 %77 %77 %77 - %78 = OpUDiv %18 %76 %77 - OpStore %75 %78 - %80 = OpLoad %31 %33 - %81 = OpLoad %31 %35 - %82 = OpFAdd %31 %80 %81 - OpStore %79 %82 - %84 = OpLoad %31 %33 - %85 = OpLoad %31 %35 - %86 = OpFSub %31 %84 %85 - OpStore %83 %86 - %88 = OpLoad %31 %33 - %89 = OpLoad %31 %35 - %90 = OpFMul %31 %88 %89 - OpStore %87 %90 - %92 = OpLoad %31 %33 - %93 = OpLoad %31 %35 - %104 = OpCompositeConstruct %37 %92 %92 %92 %92 - %105 = OpCompositeConstruct %37 %93 %93 %93 %93 - %94 = OpFDiv %31 %92 %93 - OpStore %91 %94 - OpReturn - OpFunctionEnd - )"; - const auto env = SPV_ENV_UNIVERSAL_1_3; - const auto consumer = nullptr; - const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - - TransformationContext transformation_context( - MakeUnique(context.get()), validator_options); - - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(100, {1}), MakeDataDescriptor(60, {})); - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(101, {1}), MakeDataDescriptor(61, {})); - - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(102, {1}), MakeDataDescriptor(76, {})); - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(103, {1}), MakeDataDescriptor(77, {})); - - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(104, {1}), MakeDataDescriptor(92, {})); - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(105, {1}), MakeDataDescriptor(93, {})); - - // Div operations are not currently supported. - { - TransformationWrapVectorSynonym wrap_div_bad1(62, 100, 101, 106, 1); - ASSERT_FALSE( - wrap_div_bad1.IsApplicable(context.get(), transformation_context)); - - TransformationWrapVectorSynonym wrap_div_bad2(78, 102, 103, 106, 1); - ASSERT_FALSE( - wrap_div_bad2.IsApplicable(context.get(), transformation_context)); - - TransformationWrapVectorSynonym wrap_div_bad3(94, 104, 105, 106, 1); - ASSERT_FALSE( - wrap_div_bad3.IsApplicable(context.get(), transformation_context)); - } -} - -TEST(TransformationWrapVectorSynonym, AdditionalWidthSupportTest) { - std::string shader = R"( - OpCapability Shader - OpCapability Int64 - OpCapability Float64 - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %97 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 64 1 - %7 = OpTypePointer Function %6 - %9 = OpConstant %6 10 - %11 = OpConstant %6 -5 - %12 = OpTypeVector %6 2 - %13 = OpTypePointer Function %12 - %18 = OpTypeInt 64 0 - %19 = OpTypePointer Function %18 - %21 = OpConstant %18 8 - %23 = OpConstant %18 2 - %24 = OpTypeVector %18 3 - %25 = OpTypePointer Function %24 - %31 = OpTypeFloat 64 - %32 = OpTypePointer Function %31 - %34 = OpConstant %31 3.29999995 - %36 = OpConstant %31 1.10000002 - %37 = OpTypeVector %31 4 - %38 = OpTypePointer Function %37 - %96 = OpTypePointer Input %31 - %97 = OpVariable %96 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %8 = OpVariable %7 Function - %10 = OpVariable %7 Function - %14 = OpVariable %13 Function - %20 = OpVariable %19 Function - %22 = OpVariable %19 Function - %26 = OpVariable %25 Function - %33 = OpVariable %32 Function - %35 = OpVariable %32 Function - %39 = OpVariable %38 Function - %47 = OpVariable %7 Function - %51 = OpVariable %7 Function - %55 = OpVariable %7 Function - %59 = OpVariable %7 Function - %63 = OpVariable %19 Function - %67 = OpVariable %19 Function - %71 = OpVariable %19 Function - %75 = OpVariable %19 Function - %79 = OpVariable %32 Function - %83 = OpVariable %32 Function - %87 = OpVariable %32 Function - %91 = OpVariable %32 Function - OpStore %8 %9 - OpStore %10 %11 - %15 = OpLoad %6 %8 - %16 = OpLoad %6 %10 - %17 = OpCompositeConstruct %12 %15 %16 - OpStore %14 %17 - OpStore %20 %21 - OpStore %22 %23 - %27 = OpLoad %18 %20 - %28 = OpLoad %18 %20 - %29 = OpLoad %18 %22 - %30 = OpCompositeConstruct %24 %27 %28 %29 - OpStore %26 %30 - OpStore %33 %34 - OpStore %35 %36 - %40 = OpLoad %31 %33 - %41 = OpLoad %31 %33 - %42 = OpLoad %31 %35 - %43 = OpLoad %31 %35 - %44 = OpCompositeConstruct %37 %40 %41 %42 %43 - %45 = OpLoad %37 %39 - %46 = OpVectorShuffle %37 %45 %44 5 6 7 4 - OpStore %39 %46 - %48 = OpLoad %6 %8 - %49 = OpLoad %6 %10 - %100 = OpCompositeConstruct %12 %48 %48 - %101 = OpCompositeConstruct %12 %49 %49 - %50 = OpIAdd %6 %48 %49 - OpStore %47 %50 - %52 = OpLoad %6 %8 - %53 = OpLoad %6 %10 - %54 = OpISub %6 %52 %53 - OpStore %51 %54 - %56 = OpLoad %6 %8 - %57 = OpLoad %6 %10 - %58 = OpIMul %6 %56 %57 - OpStore %55 %58 - %60 = OpLoad %6 %8 - %61 = OpLoad %6 %10 - %62 = OpSDiv %6 %60 %61 - OpStore %59 %62 - %64 = OpLoad %18 %20 - %65 = OpLoad %18 %22 - %66 = OpIAdd %18 %64 %65 - OpStore %63 %66 - %68 = OpLoad %18 %20 - %69 = OpLoad %18 %22 - %103 = OpCompositeConstruct %24 %68 %68 %68 - %104 = OpCompositeConstruct %24 %69 %69 %69 - %70 = OpISub %18 %68 %69 - OpStore %67 %70 - %72 = OpLoad %18 %20 - %73 = OpLoad %18 %22 - %74 = OpIMul %18 %72 %73 - OpStore %71 %74 - %76 = OpLoad %18 %20 - %77 = OpLoad %18 %22 - %78 = OpUDiv %18 %76 %77 - OpStore %75 %78 - %80 = OpLoad %31 %33 - %81 = OpLoad %31 %35 - %82 = OpFAdd %31 %80 %81 - OpStore %79 %82 - %84 = OpLoad %31 %33 - %85 = OpLoad %31 %35 - %86 = OpFSub %31 %84 %85 - OpStore %83 %86 - %88 = OpLoad %31 %33 - %89 = OpLoad %31 %35 - %106 = OpCompositeConstruct %37 %88 %88 %88 %88 - %107 = OpCompositeConstruct %37 %89 %89 %89 %89 - %90 = OpFMul %31 %88 %89 - OpStore %87 %90 - %92 = OpLoad %31 %33 - %93 = OpLoad %31 %35 - %94 = OpFDiv %31 %92 %93 - OpStore %91 %94 - OpReturn - OpFunctionEnd - )"; - const auto env = SPV_ENV_UNIVERSAL_1_3; - const auto consumer = nullptr; - const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption); - spvtools::ValidatorOptions validator_options; - - // Check context validity. - ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options, - kConsoleMessageConsumer)); - - TransformationContext transformation_context( - MakeUnique(context.get()), validator_options); - - // Vec Type Id | Vector Type | Element Type id | Element Type | - // ------------+----------------+------------------+-----------------+ - // 12 | vec2 | 6 | int64 | - // 24 | vec3 | 18 | uint64 | - // 37 | vec4 | 31 | float64 | - - // Test support for 64-bit signed int. - { - // Assert that the target scalar instruction result id is relevant. - ASSERT_FALSE(transformation_context.GetFactManager()->IdIsIrrelevant(50)); - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(100, {1}), MakeDataDescriptor(48, {})); - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(101, {1}), MakeDataDescriptor(49, {})); - - // Good: The following transformation should be applicable. - TransformationWrapVectorSynonym wrap_add_int64(50, 100, 101, 102, 1); - ASSERT_TRUE( - wrap_add_int64.IsApplicable(context.get(), transformation_context)); - // Insert an arithmetic instruction of the same type to add two vectors. - ApplyAndCheckFreshIds(wrap_add_int64, context.get(), - &transformation_context); - - // |instruction_id| and id at |scalar_position of the result vector should - // be synonyms. - ASSERT_TRUE(transformation_context.GetFactManager()->IsSynonymous( - MakeDataDescriptor(102, {1}), MakeDataDescriptor(50, {}))); - } - - // Test support for 64-bit unsigned int. - { - ASSERT_FALSE(transformation_context.GetFactManager()->IdIsIrrelevant(70)); - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(103, {2}), MakeDataDescriptor(68, {})); - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(104, {2}), MakeDataDescriptor(69, {})); - - // Good: The following transformation should be applicable. - TransformationWrapVectorSynonym wrap_sub_uint64(70, 103, 104, 105, 2); - ASSERT_TRUE( - wrap_sub_uint64.IsApplicable(context.get(), transformation_context)); - - ApplyAndCheckFreshIds(wrap_sub_uint64, context.get(), - &transformation_context); - - ASSERT_TRUE(transformation_context.GetFactManager()->IsSynonymous( - MakeDataDescriptor(105, {2}), MakeDataDescriptor(70, {}))); - } - - // Test support for 64-bit float. - { - ASSERT_FALSE(transformation_context.GetFactManager()->IdIsIrrelevant(90)); - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(106, {3}), MakeDataDescriptor(88, {})); - transformation_context.GetFactManager()->AddFactDataSynonym( - MakeDataDescriptor(107, {3}), MakeDataDescriptor(89, {})); - - // Good: The following transformation should be applicable. - TransformationWrapVectorSynonym wrap_mul_float64(90, 106, 107, 108, 3); - ASSERT_TRUE( - wrap_mul_float64.IsApplicable(context.get(), transformation_context)); - - ApplyAndCheckFreshIds(wrap_mul_float64, context.get(), - &transformation_context); - - ASSERT_TRUE(transformation_context.GetFactManager()->IsSynonymous( - MakeDataDescriptor(108, {3}), MakeDataDescriptor(90, {}))); - } - - std::string after_transformation = R"( - OpCapability Shader - OpCapability Int64 - OpCapability Float64 - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %97 - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 310 - OpName %4 "main" - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 64 1 - %7 = OpTypePointer Function %6 - %9 = OpConstant %6 10 - %11 = OpConstant %6 -5 - %12 = OpTypeVector %6 2 - %13 = OpTypePointer Function %12 - %18 = OpTypeInt 64 0 - %19 = OpTypePointer Function %18 - %21 = OpConstant %18 8 - %23 = OpConstant %18 2 - %24 = OpTypeVector %18 3 - %25 = OpTypePointer Function %24 - %31 = OpTypeFloat 64 - %32 = OpTypePointer Function %31 - %34 = OpConstant %31 3.29999995 - %36 = OpConstant %31 1.10000002 - %37 = OpTypeVector %31 4 - %38 = OpTypePointer Function %37 - %96 = OpTypePointer Input %31 - %97 = OpVariable %96 Input - %4 = OpFunction %2 None %3 - %5 = OpLabel - %8 = OpVariable %7 Function - %10 = OpVariable %7 Function - %14 = OpVariable %13 Function - %20 = OpVariable %19 Function - %22 = OpVariable %19 Function - %26 = OpVariable %25 Function - %33 = OpVariable %32 Function - %35 = OpVariable %32 Function - %39 = OpVariable %38 Function - %47 = OpVariable %7 Function - %51 = OpVariable %7 Function - %55 = OpVariable %7 Function - %59 = OpVariable %7 Function - %63 = OpVariable %19 Function - %67 = OpVariable %19 Function - %71 = OpVariable %19 Function - %75 = OpVariable %19 Function - %79 = OpVariable %32 Function - %83 = OpVariable %32 Function - %87 = OpVariable %32 Function - %91 = OpVariable %32 Function - OpStore %8 %9 - OpStore %10 %11 - %15 = OpLoad %6 %8 - %16 = OpLoad %6 %10 - %17 = OpCompositeConstruct %12 %15 %16 - OpStore %14 %17 - OpStore %20 %21 - OpStore %22 %23 - %27 = OpLoad %18 %20 - %28 = OpLoad %18 %20 - %29 = OpLoad %18 %22 - %30 = OpCompositeConstruct %24 %27 %28 %29 - OpStore %26 %30 - OpStore %33 %34 - OpStore %35 %36 - %40 = OpLoad %31 %33 - %41 = OpLoad %31 %33 - %42 = OpLoad %31 %35 - %43 = OpLoad %31 %35 - %44 = OpCompositeConstruct %37 %40 %41 %42 %43 - %45 = OpLoad %37 %39 - %46 = OpVectorShuffle %37 %45 %44 5 6 7 4 - OpStore %39 %46 - %48 = OpLoad %6 %8 - %49 = OpLoad %6 %10 - %100 = OpCompositeConstruct %12 %48 %48 - %101 = OpCompositeConstruct %12 %49 %49 - %102 = OpIAdd %12 %100 %101 - %50 = OpIAdd %6 %48 %49 - OpStore %47 %50 - %52 = OpLoad %6 %8 - %53 = OpLoad %6 %10 - %54 = OpISub %6 %52 %53 - OpStore %51 %54 - %56 = OpLoad %6 %8 - %57 = OpLoad %6 %10 - %58 = OpIMul %6 %56 %57 - OpStore %55 %58 - %60 = OpLoad %6 %8 - %61 = OpLoad %6 %10 - %62 = OpSDiv %6 %60 %61 - OpStore %59 %62 - %64 = OpLoad %18 %20 - %65 = OpLoad %18 %22 - %66 = OpIAdd %18 %64 %65 - OpStore %63 %66 - %68 = OpLoad %18 %20 - %69 = OpLoad %18 %22 - %103 = OpCompositeConstruct %24 %68 %68 %68 - %104 = OpCompositeConstruct %24 %69 %69 %69 - %105 = OpISub %24 %103 %104 - %70 = OpISub %18 %68 %69 - OpStore %67 %70 - %72 = OpLoad %18 %20 - %73 = OpLoad %18 %22 - %74 = OpIMul %18 %72 %73 - OpStore %71 %74 - %76 = OpLoad %18 %20 - %77 = OpLoad %18 %22 - %78 = OpUDiv %18 %76 %77 - OpStore %75 %78 - %80 = OpLoad %31 %33 - %81 = OpLoad %31 %35 - %82 = OpFAdd %31 %80 %81 - OpStore %79 %82 - %84 = OpLoad %31 %33 - %85 = OpLoad %31 %35 - %86 = OpFSub %31 %84 %85 - OpStore %83 %86 - %88 = OpLoad %31 %33 - %89 = OpLoad %31 %35 - %106 = OpCompositeConstruct %37 %88 %88 %88 %88 - %107 = OpCompositeConstruct %37 %89 %89 %89 %89 - %108 = OpFMul %37 %106 %107 - %90 = OpFMul %31 %88 %89 - OpStore %87 %90 - %92 = OpLoad %31 %33 - %93 = OpLoad %31 %35 - %94 = OpFDiv %31 %92 %93 - OpStore %91 %94 - OpReturn - OpFunctionEnd - )"; - ASSERT_TRUE(IsEqual(env, after_transformation, context.get())); -} - -} // namespace -} // namespace fuzz -} // namespace spvtools diff --git a/test/fuzzers/CMakeLists.txt b/test/fuzzers/CMakeLists.txt deleted file mode 100644 index 6b0926ea..00000000 --- a/test/fuzzers/CMakeLists.txt +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -function(add_spvtools_libfuzzer_target) - set(one_value_args TARGET) - set(multi_value_args SRCS LIBS) - cmake_parse_arguments( - ARG "" "${one_value_args}" "${multi_value_args}" ${ARGN}) - - add_executable(${ARG_TARGET} ${ARG_SRCS}) - spvtools_default_compile_options(${ARG_TARGET}) - target_link_libraries(${ARG_TARGET} PRIVATE ${ARG_LIBS}) - target_include_directories(${ARG_TARGET} PRIVATE - ${spirv-tools_SOURCE_DIR} - ${spirv-tools_BINARY_DIR} - ) - set_property(TARGET ${ARG_TARGET} PROPERTY FOLDER "SPIRV-Tools libFuzzer targets") - target_compile_options(${ARG_TARGET} PRIVATE "-fsanitize=fuzzer") - target_link_options(${ARG_TARGET} PRIVATE "-fsanitize=fuzzer") -endfunction() - -if (${SPIRV_BUILD_LIBFUZZER_TARGETS}) - if(NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") - message(FATAL_ERROR "The libFuzzer targets are only supported with the Clang compiler. Compiler '${CMAKE_CXX_COMPILER_ID}' is not supported!") - endif() - add_spvtools_libfuzzer_target(TARGET spvtools_as_fuzzer SRCS spvtools_as_fuzzer.cpp LIBS ${SPIRV_TOOLS_FULL_VISIBILITY}) - add_spvtools_libfuzzer_target(TARGET spvtools_binary_parser_fuzzer SRCS spvtools_binary_parser_fuzzer.cpp LIBS ${SPIRV_TOOLS_FULL_VISIBILITY}) - add_spvtools_libfuzzer_target(TARGET spvtools_dis_fuzzer SRCS spvtools_dis_fuzzer.cpp LIBS ${SPIRV_TOOLS_FULL_VISIBILITY}) - add_spvtools_libfuzzer_target(TARGET spvtools_opt_legalization_fuzzer SRCS spvtools_opt_legalization_fuzzer.cpp LIBS SPIRV-Tools-opt ${SPIRV_TOOLS_FULL_VISIBILITY}) - add_spvtools_libfuzzer_target(TARGET spvtools_opt_performance_fuzzer SRCS spvtools_opt_performance_fuzzer.cpp LIBS SPIRV-Tools-opt ${SPIRV_TOOLS_FULL_VISIBILITY}) - add_spvtools_libfuzzer_target(TARGET spvtools_opt_size_fuzzer SRCS spvtools_opt_size_fuzzer.cpp LIBS SPIRV-Tools-opt ${SPIRV_TOOLS_FULL_VISIBILITY}) - add_spvtools_libfuzzer_target(TARGET spvtools_val_fuzzer SRCS spvtools_val_fuzzer.cpp LIBS ${SPIRV_TOOLS_FULL_VISIBILITY}) -endif() diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_000.spv b/test/fuzzers/corpora/spv/graphicsfuzz_000.spv deleted file mode 100644 index c203cec416b12f15eeafbb8dfb4002356c5a707e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7968 zcmZ9R2b@;L6~*7OOA|yoR@kK|ih>OhktWKbqJr2PuCTx&%aV1CF%^wTOpht1nwV-# zH=5owy%*EF={+&cUh@Bc-#f|VdwPHOoO9>SojWt{?XI>Dn>Dhk+Nx3f)8AG#o(a`3 zl&Tt2jcEApwHwyXzhY?f{G%5h?tpPsdt;nq_Nqo!9r$5be^1{|14h-xgVZSiYH!T7 zf~4U@%kjghGn_H~y@OkO=k^`3r1@`S+z9k7g9H6Icza{6{=Ur(JPK`SKz(>M8r;a= zFfceYw>fqXw9D(fG5Ee3kHv3q;Erlf{N|pa9vriD&>M61_U~%)cKZ8Y-gxkifvXzh zCV;o~ZQYh}69F#LHBQ1eYjsqU!R7j=IIdp*RB&_s9o01OuAaf3<{TZ>-YtBe|Ksh| zzVOu84}95`TN-CGf*q3k^zGcFR^MS2wvzRc-8EyL#iMfgJ;bRkemusW;0(Jl)Ku<{5XBVa=JC zPk2|8Hn_DtANSh0HLUA1iCJdgyO^^RFP_2(^W|*~-_e-gd#2vSeR3_1wQg))oi`iJ zyvfWx2k(3b;yW=P$H@=EyhHoLxl)a})jHt^282(7XkApu9x0fYgYg^Ct9FK3q)Lp;a z+G^JGoR-$y@ylvlu75e2_sRGQy!Rw={Ys2yx%0_SXwc4;>1P$(y5T2+FDUp);3pM) zHTcGYcZ2UJ_!_X^yUceo`0j$A0xs{#sqlM?_*$?%B>yzSGJjFnkK{vfr_!Mg_ieT+R9e;(#z{CvD|y>mO4XXPCC zGuMT9pNHvQJ^UhY8+I{fzn5U{$wtimx)k%wdN9xCGR(d<^W}cy%6#ub@}CGU^RI%NuWr8FZ(^D6 zJxadcmNNfpxcTbl%a6m#eD6{6pA0sCH}}u?;VGD!XJ)=JHS>L!ynp)SKNakl+sL1T ze;TId&##AgJLJBPzKiDSo%aBI&h_baOz(U94E%1)$GX?x&DE#wwP5E+-DiT;QdfQ* z=3M5Allv^Nx#7>QdEUY2z}-XjjJY1Ho-xk_kHehHe&mjEy}R+&)F=OWU~6WdpAS}> zjb%U7%+G$f_QmYS4EzhQ(U|p@;a`ZgV@n&>{5HR+*7KcwFtk+#ZdkM>TtNE!MSudVDLmwa2%isi((Vz-sC7?O?SNF?+lf?_-a~ z-hsUnvz9nLz6)%R^Re{!Zm@cKd=FSHJ-!#LR`&QlxIG$6k81YlTC8jR^mrS%wa53P zsi()=!A-6C9k~Opb`oZfAHe(Aqp=TSAHu99PLCf3+v7qkJ$?kNo*q96R!ff`1FMxi zejIL(#?qsjJ-Qa_T0cF00^Hi;C(+c?Oo zzXn#z-hLgdR_^UL;O?!l?5&!6>sqX9{q*=vaBGj>LQ_wVcZ1c^b9lVb{ z8v8ExJ!-(`fLnX~ zDVlnE{25p+J^mc5b}D9%_uzf((bzArUt-o0r^jD`?Qt!Z9)As1PmjL=tEI=^g4N0% ze+RcmW9d=N9`C_h*ZS%4_u$qZ|A3~R9{&hdOOJm7tDT0~b$6O*PlcZ>YK6eiz{Xg-yrS@mI+@{J(2WU0YxOT)wZ4;r^@LUu$iJ z_CT!-!>{8noF(`NG4ma7d_Cqqb>NLX$~Ws+EPpQ!NAsD5En?hE{D=aNEbu6>d-4!I ze?#s8c1-w~7CyFx?^W~MfrsJNbB)d=PwbH*=DhO69tB%BzrQ^OR-27Emvz-Vi^uV< zTkr3){_)u6M)DXR1~#tG{Ow?ChIhcNcROb^2R|I{81;-90k&@VNVt2JoKbMcsNYi0 zGaBq%#(an5dtk27HHkCd7_e)~J2e*WJEfj6dxF)&{cjDfDLH$=%~8*o@nH45;}aZ% zsr!yk#QV5DW0SDSnClZ~o+)6@FlRCqu9h<~rk3&3!1j~zd&AW--k4g}z7N>7J0^4N z3s%pV{lMcGV_olo+%cZBeYj@Vp8Wm6<(dzGt7Q$w)G~fL*!|3!XTa4m-k4g}(+PIX zj>#NdVD*fd33koab>S}s;N`dEc(`NK-COxm%(<;4PVO>rIoI-i-jfsIYB?WcYUTd8_SThYd$;g?YVQ8HwnH(o>pHB)uE{;H@745T zPkQe~H+~J~WBlYguFt-n0(Oq@Q{m2^pD}CUj#2ks$WOzZ+gjq}o(^`MuF<`bTlb85 ztlo94!>`ADjGtM@^_gn}*g3+_g1fGKQ_hAvM%{JE&%vDAb%~REF4(zTmuDnT?7TV_ zem>m&$UVCN?ilrJ`5D_q>_V`5?w;qYmN_m0mutTm?wr@v`Io@w!_`w~BiKA+sdFh< z-8z}O2kt(M<)(JwFN5=Mlx@X&sK1`2ixH8fqKUDf!(+4$#%G!W36vYt-Mp7x7>Sf cO?~FO99-7i0k@{Q^BGe!KkttBI^T@{0G*KQ!T7Xf9vkj@|6!`@St2}(b|0d26856XXmES4b+um=1p~I zZenIIhrx?PQkt87pV{)h&hm?NpVEivkKnSURILmTRVQcP%+94$0gfa1k8%7DSmfYLWa*Lah7Q+B2zt!gUngjkt^-LmO9H%Xi>6 zCdXGQ`VNlgnD5{h{3p<^zvLS`iHOOgJ;1&a`V?Z%z7M&b`)Ne{d(M3($I58?2_E$i zy0Cr^VjX)l-x^=wGj4Gj zGapCn>jA%;(G!R{kA|FfUD_o=Gvt4)%Mq>kU~q1pU+~WM|n?k-&)SfBzu)VXf`F?FZ zzllAEmo@95CTOALg}~`6GkmH*%d_ckjow3BS?@{d*6j{@D-+fs_mJZRT)CYbC*fJh z-Sr3E9z0QRK-S(yj#DYT5!s%jpMAT>4$x+J7V0Et3tU~B`stwCUlzR;ZhrBJpqp2$ zJIrhjecRyXaS!^cy9Y7t?LpSxzO35;ab}&j6Cta{iG80zb|1!{gCCbXp0?dg`A7Qzx6}W45b}S^LhjxDx<~irUYuXMvpSQ#+oQc$)7`=q+%>*R=0Uz}T z0rMTkxJl%gGsaDUi64ZxX=G!?|FD-Cxcia+V19GYLeA&T9zt_av^_#LhqlL%wr}M2 z8#fPW_uKcAzH@Nxp1fANiW$9^z8mk`F#HuHreD0TD*@NP8d?1xH)$OD4_~NoBme*a diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_003.spv b/test/fuzzers/corpora/spv/graphicsfuzz_003.spv deleted file mode 100644 index c0e0a298b2dcda5e3b2b9846712745244bce77c2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13336 zcmZ9S2i#xN8OQ&bWExq-%9{is0~sV_ya^H`Ap_kK1dWEbjnJVgs8&l=bw*oN+9I^N ztEv^cTe{J`_g*&D@Atmvm!95}`+Uyt`904$&pGG*?)|^lN58%kw(E5IbhhW;iG4dw z+o{tRrqdbH8QAnomabYl?c9xPr_G#opb5h}{hB;;cIa%^=}+&_vrk!fjsc@`JA&jX z0P5Gw)y<#*MC*M00py%|-WkpO1M&228`qtEy8Qsg4;0YMcTVyT(jUk_ecOi9&+S=% z-o|x3ti&sK${aLSp7_w;O7YsgBjb@h^^i&vl4v%Y6Tr*l-p8trr@ z^md&kjCM_~dkG_4%lK`vUcamOj?a4P@p2jOy6W-zj`vKR-?a|Gb|}7U+!M38mO;I+ z!GkO87@IjmdtrlzRd{&8BUp{|caggzy?8WuC;D;N7}l{fy}s+#A5nbQw+sGAdUK3V z#y58q*6D0o5Px*zZ|#mhrt$xmzYG4YTei$keAmX`f58+^*?MC!$CzgwB-{rm!Q&?T@*4E$g2QcHKFfDd52mO_-bbRD9=1d>Z)v`|g_;{{Z}JH*cPw zefl8F#a!D#_^u^u(|6r+88;p5eT{{m0jI8FsXG&{)7i95JG1au*W82It9tg_Z0h?l zyo2c%5_7MIV0n(`u@cX5cHxH-(Vv64Z=WAymoZlUP|TR;kle$-$u%B+ZsC3ILUGuSp zleam4#xDgMcMk7^`O7eQ=MHxqSdGhFUGk0xo7-J+%faT#J&rb3(5n&qhgpyBo|TyU zQ#Y%y6EI_4^uAwxZj24WjNMMXiS#F8#>Zoiu-B95joY5UH~uV4-kRbbc+d6Om}8^0 z=M+w@UCjLEJQtH!lhN7pz@C>{HJ|-t1dt3AgWbR9nf<>6EMM<`1HSt=FZ(|iY_75FeVm6DDUZakP6eSnbZjqTNftp5b83cyccV&%yR;_}*vi)nNHi*mB;Xz7HjQh?qp0&IIY>s=1_O1fU+rqsOEazO|t}a|(df&yqf8K<7F6ty_cn#R`#*+7D zuz72-+d8}f zPTsv`UpIoUuPoYlADppThwsOiuXXqV{G6@vjK2wNtk&VpRj%>m-U2qJ&Z5IDVCPkb z#@jl)70w*@6n)(WmbZobAXv`1!hNW4wGMBG^IU2jei+~J#-hWIfX(wB=d3>pwzje8 z@MGY%4nGc;voanXegbT)*5N1d<*ns+lQsIa}iy|3$E|T8Ce%a*ZeV%V1-*4!=@z)uHjW4!;U#&Q>h?`Wjf?7Vhg{ zIoBBOzQWZyydTbU@!sVOzX5iZ?n zrw+wAmmh)KI{Y!5dsBzTllv2JTZcb|lXq{~*U!Mt5sNl{4ri>^;Vm{swHU*5PkUt~xZ{*5U8q%yCcA*YCmdws3y{%elsIe=Jrlta-uX|WzlNNV4d3Z>(`)&@eFD4;d%WVF1Rqy8=Xwh4T=rSZ(_qiT`Tv7G zgXQ~n7+BpJ^SLyZ?^_Sd_;}3k+dlZlZJv+uzL>l<#reMN2X<`q*&knS8eHB#1MuZ% z!{t5=#OG?p8qfIcz{X}0%lGZ}`0``QoIBGG!uL#!W$a+EwWq+R&JcXArjGHfX=uqa zt{#S&M9cT>aD4Y_pJ#Lju=mE6XKF_{dFM;sPGHw(%k#7|zPZNoz8wLUxBf_ao98V* z3X^jUV(+H`0k%;+y3{&G1pl3zZY2EHI1XUxqtaCOwKil>ov(||Kq`_pZ!mOldo${#Fw|$ z-t?&@zYiv7Epc5-KKFWGuxG7ia$hHbS+{I(qgXKXCF`KFwXFFzX2`o5oM;B)x~ z=oruVnP6kntK3=mTurX=|EyMUM&Q3HTyRneJlbS z^Iqlq_HcZ8Yq{RsuOqkzwzjB4cJ(%!&C6(U6bpL4o?MJ&$XFT z>rl<4{%K(AtHab;3zpvl%X|KGu)I1vgWjeN<0eIdB5!*y_6jSh_`_bhN* zhcAMYuXVT{-#KE@#@TSjY8{?~FJJ4h2cN4sTjLr3Vz9AVhcChBYI2PycLUg1t;2Ki zxf&fBZ|iU)oH_0(`Z^CRZwq&R;iSX8v~aZ!Uk2CK;mhG1Z!9`|MaipmcmbTXjYS8q z1h;i~Askn;f8)`|tH8!;9bSYl@0wh1bhrs@J=bPVtwS}F_u<9h=rHfYON?W+4ll)* zSBI~rx2Z$<%P={0D2}#X18(c^wQyXG4vi=Ga&TLRuY;4Xb@+OG=ZHlcSHKyob$BJd ze67Pb;Bz%+Ydqtx0voG!_(puLCf9g!uLc{db@(QHu11H(+d8}k&K&m?eZ3hhZwvR9 z!byjFYvF1gz74Le!?(jZ-dJ?_j*?gFa5J2>jYWsog4;TLCmdI^f8){NyTHb39ljf1 z-Zi=2=Gz>O0-KEa&OI92g!vw{raE-I zHS%}H^9hFe8q4qg=fLvTznk9X zdCPCbn5tDOnaa~J3`}z{t{c~;G z|Ce#(>-~QP-~DrK+y7T_%r%z%e+?|}n!ZkNbN}-9VREiXT(3z!`@bKY`q}?C;N$&%nm&-_f7rb2Yifllu#>vHExPm-t-G`^b3vcl1|q=D4S5@7G{?Te#m8PCDFg z3s?V+{tnJ_Q71XW--8`*EWe|F0GsDMPTn8E);1O${0Zz_=H*`f8O+t}-+1)#7qGGV zcl59L^44;_`5pZm*m|zboLYx!CYt{{*xKqan*Rq_zSiMC@#WRwzvyi~U-JLP+1dXww#qVcv4`zRvJJw;!A9V1T**ROD-ZR7eE&eZ5@08U$n z1K}KREP30NJnwPNdV4r)8;cGHf!jJ94Cgw0W{pROL%_yr9S+5pcTKK0IvfVJo@+Cw z)}fk7{o%x{uMSgZ2RQlq-Mb^cygJ;8-lh)acgEz@p*Z^;0dDJXB%FKm?<(WT9R+Ud za5S8Jt-~?+&Jl|?c7Zci>u^_m`C5l#@vZOK8qfIMz{YAF?q1~@PwpOIW3>+VEV=5? zcw2{i!I|TpqPcNkd0V)y!nww9;|phM^fdvet;30MjyIOPy-QxL!+qeaZ7e$27u?q2 zB)FWF@#teeu(4W)`{T>ICf6GsP6k`gwV6}vP|f6hI0YOX=6yI7PQKRRG<`;t;6YX(V_9=&H%S{I1^63*5NFC=ZHlc2g4bwb$AHAe67RT_&HnS z89xVXtk&V7Rj%>m9tJj6>u_$#RfopgI-Cb*j(du}=7Z&J;T9CG)?s(yOpU%4;b$ArMylZm3(c#fx>$x^_Y8|SX z+P{Nh`My1dm}j^Z&fdSR?frY!-oG{d&3_Q{o$K$gn)f|uO?7CVHS%}Hv0&0Vi!kTU z_w7=!v3%by1KZTMvEwi~^(}VITbM{+zV_wwO?eCWX3R0xGdJJ2en=32{mw6p@w99y`Rg>&9;s|si8a{iy?N%SY+INp5Y S-q-m&`@X-8JAI8v diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_004.spv b/test/fuzzers/corpora/spv/graphicsfuzz_004.spv deleted file mode 100644 index f1afc72502a33bdf4bd20ce4b46f6bd5c73efed7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12368 zcmZvi2Y_8w5r%KFn?eXBh29cE2?PR!8tR4sp#%uM6E?{vtR&g6*+7uG6lu~y1sis( z*hNIePPHp`vG=Yt1^vGJ?yqN`x$bcO`Df;wIWy;;_jY5)@F}CJYFIUz|4kfT)z7$U zI80ToU5%{AIde~#JALKAqUn3=xvLKARvopUKI>JZs!m2jmv#3p*PvByeULm0fI8~A zx(FJ9we%kWGXkGQeY5+PU(nM(Fjb$?tX@?M`Naf!@A4hY>`t1-GbYardgF1FiVlcXTyIzQ6mz6VB~k(KFQ2Hv-P4hHsQV1`E@QXm)=_OD z;IS5)GX5{VquLC8AsOhmxp+nkZz0~jg|`&%(ZXAa_Y`+llfWyw`@5Ghs!txGcT`)W zFWjqTn=-`KS#2{!@2Ixbckh<(c0+8P)%HX5j*6pIEu`|Uxx)}!XSHLSJ`MeU`|YfD zLhoL=qG#cN@gu68^=~_Kp8X|D=O5PJy<~P@U;iT1dadb<3wxFi^z^s%UC`+jM^n9{ zvI)JlZ%1WQ4KzneI;2jNb%;)Bhv<}dNY0e7>R!HNsSWi^Ql>SYNe|-+4{+Vj&T6Lm zfBQ4C+V}tBX4LulGS+c*?>npg+u{!RzqsA&xC0YcpOen&pdoRcRTuiQ-qk&=I#`LS znm=dmVe=Py6I9h4YUX?7Bc9cQH9ok&vkQDkfe$V4VFjL3;KLhyI2q^t@+|terkwZK z9J2F0^UV50_e>9~^^WQY4LrvA9{PxnY{42I)nM1lyI8I#m-T!v%k|V<&&PS^wqT8q zF7Po0KDNN~3Vd9Fk1y~E1@0I??)ZkMY zedJGT!5W`l;4=z*W`WNt@Yw~PU*K~J++E-W1zuQS&!Ug{)E8uf7uRfy_xU%#K`^y-`8-mYcoK#C^wUp7%P`Qnm)jLz{S(t?G2cC9$?R|{e zt?gva(h5d7=h4@-&Tly5d7bKbeI|29tZZ!hD%v;3kE^O)BkQh0cU}3(*e_so4*3nx zFJzpA46Db^YBi(&^3xjoMPMDw>u}?&Ej?90F zW}f(8+ETlsUsmf~U0YI<4ZzmWTrOvHpK{Kv?mOP%I;$(dlMo;0x`J^~g~#|S8TB>C z*slT)EA*?u`XrZYz&r<;i|@Lz&h-jL{p8F=-S=H?BLBUXQNQaLt*?6KydGRt_jYN& z0c1?h$&Fyw@SJLYCF3we-gVSHLvlNDj*PnrF;69H+zj^FiOSpmTM)U3e)jxUWD1hF z+rX?mEBfuVennUGJJ82GHD&+kch>et4pw)*yAX4W{Z-&6pLpVc=&wevsw)nP{u;D< z?!NoLt!CU4u?OnDZ+jK`D)8Qg z?t8UQp=+Pnrte$m`ulmC`Sthnw$%N+jjq3+v(feUb2hs6u0}tQ9qtMCeVoNUuVj23 z;yLpjI)MFnR$h9OIo;U!RF{X;ob#yUSs6E z2j7k8tId7eZ#mb~{vJe5o4r<_Nv!Y9dlB=K*Y4SnOYHl=#zw!t(Qj|oem}ZC^2U31 zl1lT={#yCp-ESwOwilUUA0+qM2soeIYhMKCURxhLs?ohS z#x=V0X}bt<&*uCkWPGE$$61Iz+4I2-mpwm%E|>U6!G6wP)zsiIus-s+Umgd$j<&=- z0nWPS@noT!$84m`U;?V0yS;4+8I`(t=xv}cZ|!I?vQ>M;jg z*5hz=xzyt)V7aXMQ?OhlYyJ%GX+--h^1hPs=g5YL{TM{jvtNLrBzZJGZ!;5E(vTX=1m|94=yyeCJ1vBV<@F!Ws9xT2p3#wr&kAI3{LFP!gO@XoM*L3q zJY(*@jllXiueiMHUTAFj9`jFhYdi+gmc7d7EFTGWp7i-Buw455FR)zpt?s@(t1lv( zAfC7E`=y3Y4*y0shjkEbxvM0#U4slV-+7F~bVN#Sc%y4eE#+qN9`xeg0Up7a{mccI z`#Bn2F8k@kUoO2Hfo`44UXOH6#QVv-MuCl!&ptll2?ypBbe zOI~B}l}lc0qnpo*wN0PLIlWYDai&>CrT>Tza$!^!8q*aK{weB$;5k8O+F3r;?F$KGIL z<;~CD$eD|G%RXSa`x<>Fx}5jSzKlNJGxGZ(a`s>BXNu>0f3RoVvnAH9U-CQv++KqN z;pF3U5V*YtU2yV)&F9K2uyOKtGbA^Ico*1+>9ml_-jmP-u|LzlA# za~OTBf&Af!oO=|f21kHX1F?4flIM|NYf!%9N5RR*XD+zC21mom=NudZHcmcq$AYav zIrls``J98}z{bj31K&Zp)ZloqTxxIvx|}sQkjd7c7p zufeHs^6@zh++Ksz;p7LKb8rUOIQhh#32v{!S#a_>2WNwgmA3}oJ94SPe6U<G#cG`z@b- z-vV}iZSH9bcDeNXR&e_5cLw$J`!=xsHb$HMmUB<;Eql5h>>OpE?tqhz&z<1*e%}Qr zAD>q>KIJ^GhLcafUjsHyKHS}4*VC4{?g6*ojjx51&-?v4u(9&i#_vdS>G$iwa_RRQ z(Bh?*_N``#o^- z@p*6KQ}+9PaPsNx{b1wd2b=f%{b1MAmbpFvZtwR8;pFpve+X=>ytVN=u3Y;4VX$2K z{SkCI`~6WyANwu;F+|SVh?BQ#0^4u- z^!t-w=hx<*cEB!|et!y_e*2wWJ^lVP*nS(M&3?BpRVyWbp7Pb$)3u^|Lfq={~PEx;UllVJ(tse0Q^m`XDRXD zLU+zvoAthpE~j7ClS}+l;4=O@=&q6Y@1o1;m-Xeup0`_&^znP}snH<3YuLB%!)wdm zEKY5>{LSJtbh-S^;!*nHcevA$TMJ%4*Y#X$^KUgjU|!!N$7fjYhm1c$e6;_#u{)ZN z^PYh?NAi9e+nVzJ3B0!C{Zp`9^8OiEE_pxE%>Q#ZZTHgyf0zCR*fr(78`Xb_n5(&q z)4yMVt$%Vo6Kt-z?|zM4F7~s)(~$h#`E0OU{C|VLT<*u;qRZU|m;3Q|=+3Ln^X}iI ze-GY-(Y?8ref$HQ{2)H+e*_yVpTAZ93CvG@ziZDLe+Fy2y_wHG%ty-H&uO^i{ulh^ zlKWrLoku>s`x|&oz56@7w)E~FV7c_}8L(V>mo=Y-)0TVXIk4->yKmp&=fU<#Tl&xq zU-sz*Y;xKEKhfpxgiFidlYW^lT3_Wq$jB~%k!QLspdwyo9i~YQ?7GggujGxK7+XwCdk73kbKkfSY z8Klj*_3H%7Wj`a(nX>-3V{Pg4Nbs8aJPKZ0`aBvemp-ormTT|x7&vVYHSg%!VAq!S zyUbWdAKzDP>mYKzuVU{O?-_OZ>}OrD`^mrIuZJ$@6K?&6bD!bHHJq;L$9NRu_1A9w uymRHt_01za?!j)4uVi1oV~Y{FyAb2G$(47f_fYbmz}&9k_Z+d`WBvn=8v%&` diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_005.spv b/test/fuzzers/corpora/spv/graphicsfuzz_005.spv deleted file mode 100644 index c6bf437de82336ad150fd0083e5ff8c0de9cf035..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2416 zcmZ9N*G?5t6ov7qOwDSg;-oR_u-HF(edYi(Z&ujENUs_!ho|kr&X% zu_h*d-9diJ z&b>QTEJ_Mhp_;{LX0g{|wfg1{J+D-27qfbVlE;%{ zuO=qPM+e8uD`4p|rwAlxmyse}^j)J9qt8g_fB9l??D@l|)jVf#&8~V$(qHa9-9J1z zHu)q;&JeS|t1aDAf-}96Ayw+f@da~xS zw-TMlE?x?IwR zy#A7^m)2hjwwC?n-Irmkp3v9hM1Av@W9F=3V$UUJU6I9&Ijg>Bqc&=<1iQj-0Kabe zxN$kE#$3EfQ8HDX!I@TJl}cqg@|y9#ef==)`K<=4@r*pP7Ix3lxO0SWEb`O)nL66e zgzDB}#+*+R2Up6)g4@S?;$8Y|F7NgiUMu@CPQ`Owhxz>8hi876S)8*ClMCH?aOgbi z&}{(Ag>GX`=N*J@6Ikvy{Wr5ahx>P`+HVV{#@V)F+pysD?IYKYAib>UD#y zDHrt)fummj4i6KTi`*k%^Nq*sN5L_>&z_&X2jAJ%#7xJ)&ZIW#9tZbeauGWLHg2yt zzYMm&+URu#tX3{!XTiqv{mZ3 z-x2jO`vtICxtRSTIA&L$pZyZPytPAr860}!dHof9dFw>at6=NMz0dBy59};*G4D07 zar;H?b+FGQ7r8gU#_bWgH^IxW^iI;>+%0_PEMn%w{I|2X@40dFqRt&~6XqNdy9+jM z?U?Hx*gA6Y8@~^>pWjRQ$bSHK7Wuf>ez3je;<*OEK8IZN@!R4%I)LTBVSW!jbC!+l zgP0nhC%!8~S*)4;Q>GgRtCjo7{{kcIF26H!53vg7cSd{!O@ZC#vA23THNll;aBBW? H3SHPg<7|(* diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_006.spv b/test/fuzzers/corpora/spv/graphicsfuzz_006.spv deleted file mode 100644 index d0d4a70056169dafa873e43f1bc8e5c54a68840c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2728 zcmZvdX;V~J5QdKoAkjozK@-#gT#~3HDi9Jy!38uyMak-hBb$T3B*PHDT2}dk{FcgZ z(4UjUq$*WD&z;-WEz3)_{r21I>2ttROaJDSHl+@JeoxJBM{0pdX=`fF^yJjc)WCXU zeqeCuOCz?WQWj`TXWE=v(JjborMjj=uiSQ!JPkmltkxJwZFr0EZS*l`X=QezURk8gJM&|fV!oXFG2eNL`P%0D>37BhnU&HmvbKPGnZX&wUEmMV%~*SNq05N1?WNs~_?f>KZLIafzYpyBW44cTyNCEsz{bj%--C81^3LY| zW48TZYs)#Cws#;Gz1)9swu5<0^e$uj*{c`r9%HZC?p!YF^?}`mwsSV$#?$j*AA;k1 zYahmV_44KDFj=12+5CJ1ud$AxojuO!S^tGUn)}s%u>tq`DdKL;`3(6Sc|l#@$uUH~ zyZxJb$I<%z{=?R)&Dx_E!yW4sODnfDUE5AiO2N9OpJokblvL*RH%#`wEpjBh;d^B1u9 zSw>>!+hF;)&pY6_&oVgT?t=Bjecl7h74P#tw)OP6$62(Wd(`&;sUXfJj<@&_>|68= zMZY<)eDs?K%N<4{Zvkvx9};f0?QTi9$}kz5Q)4hSU&QW!E)wJ6Wxh^j5voi z_4gy*Z!21#d-u$q&vV9{E8utMT!oX5ersU4;+!??cjx>SPCoK}1Ircj>e%KL_qmQO eA9)S1T=9Gx*v?^1{l)X?E1u7D{?GrcBgh-k+roMP diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_007.spv b/test/fuzzers/corpora/spv/graphicsfuzz_007.spv deleted file mode 100644 index 7f2f982d28bd2d46acd471e17f245a6d1034ca26..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2668 zcmZ9NX;W245QYaX_euip5{z3e?gS-^`;IYkT}V)I-w;I*gIo*syGvQ+U&*IbDqs9# zNhPUDRi5XZY3h_?y>$26Jw4q$bC0#oZOc;XNZtHrH6<^9MRtLz6U zy*?Ft*JC-Sb)5Gl(la(7o4{q9_D0|gH(_r=noBP7ZboN~L|*3+H5&VsURL;<=;rGu z-vH7W-;K7j)^@H<{(3Lwl0TMh-;~@IdiJi&VeEFKdE|`M_WtDb@5s9Gp0yL{S>}sg zccHtC-;L}5#)N+`bNatVcW>0DZQa#;L)kWdPu9(+y%*{Gb*AQ*9|r9;?~Wd%3-8_9 zUA}|AvA#jtn|uB7xIgUgvi%Qn-=iC^{F5ki?*qO8bL+T<-ZRxtv)4Cx7+9D4Pcj*8>v)5|4{06RzMB%X_AJ^mYo} zJ8-|fXev4xkTT+bo(yPT_j zZF%cbkGY;lcdqU~L9FlO0+5fGi|EE!U&M@|%YV$X`3c>9^1t#W@NL(3*PmK3`7sw5RUOJGw2Rx@6=wF~8@A5v-7qg#4_gf<$ z`5&OmM-5Zx)-VVn<{`R#)bI#hu3E!1cGRFhYIuyUFKU=U_l?L${#kVS%eluV=rP~u zaSqP>_ND(4y*tmR-~lj)F>lBr{|j)|`pqFX56s~k*YEkhn`fX4jPq;NUdWvB@^#Pv a&c$~rXN*1VLAHV15YVsP5B}q{!{C3NkE785 diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_008.spv b/test/fuzzers/corpora/spv/graphicsfuzz_008.spv deleted file mode 100644 index c67dc976186d3ac457a0a9bc3bbbf160699af974..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 22972 zcmZ9U1+-NKw}meus3>7#UqnPjvA`At6i`u6>_P-Y6hXmG?Cx%C#qRFH?(XjHe&2_8 zzOjCI-{XAZ(iQLmVDJF@2+I#=i}Xcu0KE8>-(AfybJK& z$jd)|9({hse7=QXo-e);?VmX~YbV~r7e@cfpZLyruN%Jz+Rq)|1?`UG7e%`hy`Q5i zFR$y*xft*MT=_Zmo=axlpK)?Y6=CvRZzZ&>Gp}54WwgAJSFX1T zS}x1=oSQt?TNOS1^;Uz)bG_BkGVkeJuNPY0$Sc?Djh4%DJ?|BHuD1qy`s?+9$#cEF zXjvCtxn4iCypdO~w4MzL(b>)@o4MEFu zy$#T^dcSOlmpAgt^@gJ5vRu#asyx@*2tEDvHipS_y-m=vdcSOnmpAgt^)^GxWx3w0 zXnC%;IePl*Z2^<#dRwApU3g`GTcPERymGy*(Q;X?*A^|$^|nDzf4yNad9JrDT2}9u z;dpr?uUv0Cv|N_!wL{CZs}bl{#g9b$otfJ7tQm!tJ;JB*8L~YuJMx@kG}`+FkX5{!3;Y+MGO@@o4XvWOhNDlP9w)+C3*T0c}p6 z%tW-i$>-Y*ElX#2v^{w`d!U_fI(wpJ>FkBJCr@W@bnD{xLD%{3i_0pxukda-I{>t$1aRC!u9Ielpq} z<-Dh$&B&8E61ccMbk0E6ot%l6rE?bAo;;ni(RC;1;LXXCIT!7`^YfgC zmgT(XqwUGlxd83_lbMV*Cr{==be;D_cv(6ZqbKu{XWo~fow>(yo=efrJN`1X--&$Q z%h9r&_X@Nfc{*33>%6DnW$9dnwkJ>LYIL3VHF#M%*P`vo)42{k3$J9ZN1Kx;a|620 z`$oJhotx11`-M+wiiS_ja^BdFFiw+L?RIzwfo@U6ym+iLSH1 z3-9c6&b!fOabluq#cv-IfB-)-lou|-sXHVnJ$&+~oU3c~@UY7Gd zhqfnA=Xta{h<^cH=lvpHmUFy>wj)pHWwi6oj$T2_(s>naPoBL9klyM=Uucco%hi8Gb z7+v@A30{`-eu}my&v)oEw0rVc&ht6CRq3oB>Cr{^F zblu5!cv(8%qwUGl`2k($`y*bK&QEB2@^pSi*ZKZ}Hz!Z#S9G24Z+LU^WPV52`Tl{I z<=TIu?a4FWztGOuV>!>?=sMqj@O8fb;?2m@X=wJp^KFKg<=V~B_T=fbK-c-U#LLo| z0c}s7PAhc1=Ud}t>CA|>Cr@W4be-?acysb(+Mw%vXTh73Co?O$&bKXImTR{|+mmO$ z?a|KIV>wR;bbDAbv*D*P-t&7xmi+AKx{o>VKBIEoIq_!X>CA<8XZfDbjhCg<5p7SN z&OB(pBgxE*Hz!YKK6KsL{CHV93!v@E(^(K*zY`1LW$84c?a9;WgswYV7;jFVOlNf6 z*&=vz@?^T8>&_O%%X00mXnXQ>7DGGl%x-bKEXS8X*Y86&ycu~iOQP#6m%^KqC(|8W zXSp<9md~~f+MYa}Wzlt(%i(3|ERVJ)Pp1dE&ax-ooIIHo&~=t8;?2pESqWWdxiVgs zYp;T~C(pgTD%u%)EazDbUFW+xUY6s%(B9vfe{Z}j*IC0XFL^qB(Di=ri&nd-8M!pxs$A1M%kM$*hg8J6Z=XOJ`lQJ$X8V&~-=a;mygDSsz_@ zG#GDAp3D$*-O&bkS+2by+MYZ+8j5yL9?N+)Lf2=`#`wCEP4KducT=<-dCsvJx_$>X z$D5NUvjw_-2e!n^a^9`b_T=eojds4tY=bu^Pi7dp&U0J5Ie9X}(RH5N;mygD8G)|z z9Eq3Z+N03+f;~=yhdCqY#x;{@1 z!OPM)6m3tQ&SB{KJUJY1PM*vW=sLS2@#f^o9EGm4I~s3Jp3E`mI=f@>=H$s7hpw|b z9xuz!a01$%Joo#FXlLrNoaZETo#)B;dM}=Wm*u>tqV33Yj?>U}o~Pqw>70SKCr{^0 zbe-o}cysb(&PMxp$eiaKyg7L?=c4P(&%>LOCv!f!&in$rIe9XZ(RJn*;?2pExd>fn zelcE_&vyyho;)+Z6z$wSmh)VOuFs6i@v-Pk_t}$pSvpUl z?a9-58tvZm_q}KEvUHwB+momB9NPOJo#*kgbY4K)lc)0{+WR7%m+-Q5UPjxKr}GNh z`y`oH@#f^oyoRpNy4Ue_hi~9zImer5JMx_4Ep*-C+jw*GWZpr$!<^?`yg7L?@1g6? z-p9+*`2cNCp3aBpy0ee)vUEO1+momB3A*m=Q@kvl&(QYd>3oi^JNp7JOXo|pJ$X7` zq3h1R#>>+A25nEC&bR2gv+wZc@#f^o{DH1}{1Y$B&;1wLo;;nu(RC;P;AQFji?%0E$NxB_?xY!B zmQHiDJ$X7U&~+y*@v?MgK--h2(+XX8(i(40o}J8yb}t@FZzgnozRrx7na%T6mV6tJ zmGAg0cv+6mimuPWws=`Sdpoopc{=UU_4iu`yg7L?v!UyEXm-3T=bZy>PoB=4=(?}D z@UnE~M%$C8(-B?wH4k2v&b(-Q@^t1y*L}^8m!-1++MYa}1<`e13*pVllW9cP?@K4V zEXNl{*IjhR%W~aC(01hMbV1ksEQ*(<(-mz`p3Y+Ex}U}I=H$sNfv&UehL`2MOQP+` z(^(2#XWbnyOJ`}cJ$X9IpzExc#mmxJ4sB1K&hqFw>mGP>@_aXXqTPYV(pv%T^C*5r ze4X7&cv-H!GTM$jomJ3vcB|se$&*@J_ zycu~q>!IuKg7xv{;1klUY7H2g0?45 zXH#_D*=BfII-8^I$QXnXQ>wno>TZG$%_Pi7dp-rL*a>nw-k&B)W) z4(%*+?Gbo$@?=J$on8J8I0`RIXM40gc{-!f-v7z$fHx;kW(>N{dq=!1ot@D3 z*Lm-Zm!&ffZBL%gcyyijE_hiwyQ1yM)0u#-^PY$|C(n0eH?({3SbDpo>vv=iyv%IA zBeLZ8MAz@gUikX_-y1K>XWa*FN1k)+i>^D|4{uJM%>L+l{~v%iCr{=;bluq`yg7L? z2chfE4#vy!`3^zblc#eiy6)^Syeyr=(e~u&9D%MoI}$HT=P0y2c{)d<>&}kBo0BJV zEV_P2j>Fe^ACH&iIwzp*$a9Vp(RJP@;mygDIT>B&eG1;3JegC`b>64p&B>EF9bM;r z240rWcP84NJe{-9b>3&=W$B!QwkJ>LTy&k?d3ba3-0$b3ovFvty8vD9_sMvf+1&54 zm*x1yX!nz6%_VqQKKrF;JMwfcL)Yir<#==QWUfHhon47HCr@Syy6)^M zyg7L?SEK9BuECp=Cvz>j?(90eEI-5bXnXQ>Za~+a-H4Z^a}(O0Je`}-^*eG4UY5?S zXnXQ>ZbR2S-;OsYPv#DE-RYfpnc3`Ami%4l`V6}pUw_ZvgEu2j=U#OE-ra|n<+I<9 zwkJ>L0kk{Jz40Jkmd-;t+00&+{HN$T`_J&Q9RD0$pIu+z z&B&Aa5?$~6ukf<`EMKGT$Gb30?Q| zGhUX@_Y2ydJe^L4|LtnpLlcfWd1_e{rruWnazG=$^V0{zmNXK z%W|Cm1o40N*92V3LK$&;B8U3WSY-kdy{ znbCEpZSdyg$;^VTJDnA8PM%C#blp!oJ+J%>?a}t+>2%PS=jd#BbMj~Lgk*CuUU1v8B-kdy{dC_%t^Wn|OlbIh~pI-~$Wx4i(XnXQ>7D7AA zJo6gyvUED3?a9+w8145Zna+4~@?;i4*ZFtB%hFjCZBL#~S9G2KVt8}%{2gv_w0rSb zdP|_|ccvR&W;Wj$S@KJw>vv`;ye!ANqwDYgrSWFu$t;7e&%I^w=H$sNhpu~F9&b*b zOb>M3Yfrp6c`_@Y>%3RQo0BKA61vWNWxOo&UIlGWp3bW1I`7r+=H$t&j&>IDz3}zt z?roNrJef7n_2=$`Hz!Y~FS`ER{qW}G$*hU4&w{n^=H$urN7wsz0A7}#dm!4LJe{@C zb)M_s&B>El7hUH$2rtWd*F)Qrr?Wn~&T}x{oILmM5VUjlSb7_v>)$^&#Mk?8DBg@b zosH0S4;$mn$&=Xx?H=;o-V`s(&#)QVo;;n+(RD9d;LXXC*%Dp%vK8K(JejT0^%=bl z-kdy{Vd%PtZSm&h$qYx=J#2@Ur86Sw3<@h9Yoz+2jGxB5(M%P&#f;T5m=1_F~U3wT^md}4U+MYa}Bhd9(bR=Gu z&QWN4@^p?yJIj1WkHO2*ITmeCp3ZS-XPeCNcysb(PC(aLo`^Rm&v)P?v@`ZtdMBgn z@5WQ`vK&7ZUFUxqUY5^tI@*proiot&9zPRrPM*wJXm^r1oQ;>|yyu|p$ELPITSZU3hcyWbQ`S zecgkX<-GTz?a9-*4_%-4_v7pD=?Cy;dc{=Z->kdA^o0BK=A-eA1BfL3zG9RPs4nD!la_vvi z_T<^YXK44}v7F~~bbbDOftQ)h^GBBam*~2)ukf-Q{~GPi@?87|FU#lp7HvnK&Ufhg z%=#WLOXml)J$X7mqTOjSKjF>Elld84clZn5oIIId(RGKv;bl4R?`V7SbpAls9sY?o zCr{=tblu_Kcysb({z2Cr{)?C8+6^uFZ+r0abeh5H^S?P>mg6nZbw4ffvYc}Uv>kam ztxve7@Py_T>3K%z<{s9?N;=MA!RwF1#$q=SJ7(O-H;Lc{1~$>+@z_yeyw( zKD0e~I`gCJ?|=pHvUCwFi%o0BKg1zqR6 zC|;J&*A;C~p7}0@cE%pdc@{_4=gks$nb|yVWXX3!*ZX}*ye!9;Lf7BP-SKAR$t;bo z_xCb*bMj=CMc3!aa(Hv{WR^$Q=SdH|Ie9WY(RC*);LXXCSrP3{@{C*wFUu@fM%$C8 zvkKZBrL!ttmdTeXvEg`GI@_V`$%$btkHOL@?>^E*Jsukye#M45p7SN&Q9pMzp;3k**u?Q$?uG= z-=A@KS&olK*In&`m*q3;inb$9X9Bv;eIj0#&TeRX@^p4b*SYV3m!-2O+MYa}z0mbp zwKv|JJehsabvOIsWjXJDXnXQ>_D9#<9Dp|`Pv$^$-OVJtEayE4ZBL%g!RWf1L+~=Q z*^MmuL(%oSbr`<>-RN++|qfyg7L?$D!+v zkH^b$-V@OFn<+A%W~dJ(e~u&T!yZ@xEwD_=L)nvc{*33>+iQIcv(7Eq3y}jxf)&fcMV>a&b4TJ z@^r34*Zp0OHz!Z#26Wxujd)qkdlTB8Je`}-^;vfdUY6sxqU-nTHoPq7yd7;vp3WWU zy3;%HvUKi3+mokrH@fch9=thuGWVkEPVd9Za^CyV_T=e2fOebG+vhD&!FqP zpT)~^o#)VY%3pZo0BK=8oGXGUdPLF z-Z#+p2g*@6h$v21O$XI3koEFfC52e7J&dtP~(X66v7aRWD)`f6%8Vaii-32-ItiG9cimTReBapGzD>Kd zHz7qahG=VHK6`VoF5tzew&voN34HMl+$xKrr>py5 z&#~cw;nPKNh!xVumDn6zc&YPjx>(sEi>_uH0wl-$#a(}xjZZ35T z;O)$9$RuQ4#Z$X>_o&^WUB0Shjr_NR&1F5>omV4_&iJo^B){=%5o4CIPy3cy@2K?Z ztW|FB^iA$N!H)2C;0sHyt)7q9`kH=&PQ`dxgEe&^eSLk`6Soom`)^mT+dr;hS+{S| zo^jQvtSI%?5w0%rJTb=j-u0Y}@tYBK)~ASL+fviTwvBt}S-UrfXa5&$E3<2Qw!UT0 zD%^Kj=f2H4_kGs6@3YQ*qjlaofzO%1=T6|h*?PS1w$6RGb?&>ZbKh>A`*!Qxw=3Vr zZS`JlL#87u5bxY>`r=t`N3`wXlBM#sgF_kmqU z+m)&xuYlc)Hhb+`RhJr0g6&^;KUkmeSHbl?pMs}GZPu8Y2EfMalbQy>uAwbChrs4c zjl*F5)LWz95Owh%0p~s}2Fr85UITl-)EnE%tS+&q!N!K40qc{RN5SqveSFS>ts(qe z#q*7M9c~X=5N+`r0~?p~JP%HG1EM}YZ-MKzUV!VTKK*?g>^j;~ z-#cK}U5;qa8slJV*M70O9~Z&ycO1!iybHE3+Op0iu)Wk~pY5r-)cPJc-weN9^4Kne zeaFV>BlnxXhuLqhbNx4BH$1WLgI((v>Rr$L0iv!0iO&_VKKa&v2v)Zd`MHYw2yCpj zKdIwmW{1B8+O8s>Al4(c)+Xl7h_&gjO`q7dOt9(mFP-0k_9oRLrCI9!}Ngx5yXg0DCFbYv|jr&H}9R(&1;J$zw%P;;IzgzwS z{p>$+tJ3m$W=^M$xk*>Q@7w2e_vv%*P-^aPFN&sO2mih+8qa~E8Ko$87j1PvHGN}x zWPM{{>J$K#>bb_*)Jim8-%6cU)~wCV ztX3BWmrh^eKiqX~_?60PWuwkZ^<1^ZC1NEyE{gS}@5EOU-i4n}csIVWzNOd$p4(ii zpP`M+a-Z7bdUa)Uqf(`N^WM{t!ELajSYDZ#tj#W8t5$0ZhU{xE{?=@5b~W*Rck%sq z@dN+krQ%+AqhGTX#mv<7$c|E6CT^nMJ{21ob1wW22V@-A6Qk=k>L*4cI0nB*tL2#L2 zbkftwq?`8?w(Gb4%TZ?t{_8K(V?E><2D`@lwbuvn)=`i3BjBRgx;jim{UOX=!;G8D zm)2a(ST8g14%N(iI_YYc68BzR8~r~5_VN6W;>!{q|X0dpXVC!3G1B) zH(~Z`J-P3Rn(+$>$A0sVCN1h+gy;SFy_>`RmlKZsa%X7#9Cz${;9j3H_9yHL-d>!s z-@kK~AI1Cr=G<>L=f2xH_uI|6-)?Z<6~6)b7#&&5JDcFQ!nuuM&fa-D(<}7g9Ij%< zzNdfrIHu-Y_pn!O0&BwjT^q;DZ|~|8>~pS4=Q>#3_0CTou_wXNgR_)J4^M&Z!9B*Jho`~z zU=4H1T^sRfaP$~;o@7^qTH>g62yCt3hZB$5Z^Nyv9<|>AtH+)r z;Jn`%xO>!N&rPuU?Q|crVDsF>qShSPefH!X$X(}*qj$aB`Fj?9^x@wc``Ds}chHNe z4PbGnYWbZy|ENC?w!Ys(^t}L9{~`6g2v&2>v2O_+`>Z2(UBs7Dd=wvf-vz5j-U?VP z&-)(SyzVov+;x%neX#M1Sma#+t4H2duv(sX4IcZO4e_|>p z@t;bEJ$8q0k R`F(pgQSUZ5>WO_1{{v*m;Wz*Q diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_011.spv b/test/fuzzers/corpora/spv/graphicsfuzz_011.spv deleted file mode 100644 index 882bfe6bf0d118c0902b5f7045e354e11facefd8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5440 zcmZvg2auN48HGPt77GS@FIiMv5yb|GA}vPNg2u!WOB7LbB_bOauotYD*n2N2#;#FG zEHSb7USroJCU#@*&iFk4euv!o$IHBP&wJi`&%N)t-w!ji^jdN5s+y~shdHu6i@~BKDp*d8!4gatngwIRMns z&>F+0R;uNC^H$dEI%AK9ejm;?cXaPQt!v7R>65!qZbhR{58c4(jwM=QJ+pJlgmK*y zJ2&j=>Yn7XR{nU82_56dP1vn#N>_JPZQNk3R@I6}tp?Tk!eB@8MZotHi=we8^WtbM#@t3M!JfsL&Fy`8YWg78Ms10jmm5*%dgEHp zUy`|vaCn~iQjM%<|I*-|wg11*GH~{s^~-|SCYFU=j@i4&dA`2*#`5MrtaI0-zc%n( zMcyB*p1t{ouJt_k``)gVw;yxA8#(JM)wt9j0H<%(S7vs7_M59Mmwwv8>Y1yv3Q<)v zN9Vo+YcBb!^G5IuO=1w zI$+;1^&#N>i+m{9H%@&R*!M}kF8KH&9}e~%Q(q6Pf63PeUtHuPz`jfB_O7SNM}lV; z`6#d+r9K+0N6E*4?Rgk3>q9TX;qT}Rva!s53;EXk-oAwYQC)Zbl&{d=n!indU+(b@ zHYBb?*YD%Ugmu0B484t*tvkLVw?2-L_gwK<{-*Ia(n0hg)YjXPtoPg5n6NgL-19f7 zxohh)HzoH>`OoWGi1{p$;M zUmKA(*#+#ISj+b}5xfhLHM@dc<4J>~++J3W>2s!uqw$|kAA$M^$*JJPIoVWFD za<}p=?LVIH4sP~*4>=Z0^853MEW@xET4W3 z0jHm(igkyAt)-vC!0wfg{!Fm?gNW!K4xULw{|IpOOTUhUw-)`Q!0wfgUq^#I*IKh* z*7Qp+?A!k1*D+xIT8+@JSF0QG`YHW70p42r zIT7q$`RJbnR(~)N{gc7+(LV(o{q|zrsbFi-KMm|&`S^7@*mJEl`(;hP^uoUFKYpD7 z?j+VA^y^G!hkjW*i#VHbpE&)T1Gb+viS%rtm&6t*th-1uRnnGYi&ZmE@5`) zm$g38JGTN_cDO=PIy!<)eQ!Sp9W~=wAbtkN&mb z=(iW^{sgub{p-N)m5*Q7gFV+;vtQQqOE2u({^QpT;7(!)pn>)8ep$PlxQB3`IQ`rUwx8id`neA* zpMLHKr=QZV2jH!xp9jJ2m5=^IVD;A{qW>^hKKhS6c#ExBbVj z*TDKUlF+YzGCTC^HRgX2|0digPCu`M?Pnm7e*OcNPe1ocO?%$q=a}H8hyR#{!nzV*LKc|&%W2!}y(z?``@&19qfv)+5k* z_Uo}e)n$(QY)DP19$pJgmnt(Fw5q!jq@Dtxx-3@@K@C`o{tb9E;8UI$EuSA;D$VX0 z>psq3ROsvIBBfG}%{83iMl30fPYw0WmBvq3t8*iWS?)FP;l;6Twn0Pew=m9NWX^F+SgVDD?pvL~0f<9|Kaoa&6f0d79^&f*!yEPKKBqRv^A zJx6s>>qc-*LEZ;;-l*LL_OsSaaQ7bPpzIl`)8D?bN0i!nBfpQ-w;%Qc;FOk69Y*Ut zu@^t@&7Vj&!|m0*xC3WXc24hq$l85>McKCzvU~O&hV0$)9TsKZVNv!SDxYK`Yj;3@ z(bGY=y~%&4mqYNwke~J=aP9IF*geamkU4%~PS5&SuG2@q_t-rv-wm0|Sh01zD^YhKx5=%05By%p&${=)jg?2;vtV;X-TT4n;(V1K zfXrpAIARCE#)kYL*coDf4}sOWzsUbE*f?!}(ElTFKWEhTD5TC>V*7RmW%W_(F|f5l zejIEsy_{VO{0Ydj*H52j_>+)&_vRZ?4*#dX`kN>Gp9ZVf-#4awjC<)j7=rwHU>&g*71}^Sp9J#oc z31suBk9-xd`lvYx*2i4dP}V1EoCn9byVohmJ|cb^Y`lKPE9>J~#?12K*?Pv2e+F#+ zxJOm6I`5JBw5c7WqIVA1-p~T_Y7EF^W6Z#dM_hbn&pEmExb8tWJiniyW7a;o*$DUsV zyJu@gUoU~xN4=N9>h?ns_X^m!ZYbhj1*?y^Ww5$p+-u0j?Smrj0$6>-y$)7q+*$q? z+6I3EvX5m*`vJ&vtcPoJ@6POe&KZ4P1h4M%O?2v`-dkXG#Xc_~ukQ2hEav~XcaYT; z~?1Fy;sgFDQG1xo01B$cx1gt*p=%?VgqeZ{Z&})ksKL@MpgyN2V0XCmD z@939sKkulvub{6X`xHkH-+-MZT``||&FAiaf~@&3b;O>_e-23+Hvj+t diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_013.spv b/test/fuzzers/corpora/spv/graphicsfuzz_013.spv deleted file mode 100644 index d7e35b4b0040bb8be1a9c4f9f440a9062b350b09..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2860 zcmZvd=~9$e5Qaa&0ha_++>)RU8h6DNLNqR@0X4WUSzHhVkz{0&0gU;RvQk=lGyd=* zEU(D5%Bnoi%xUWs#i6>o`|b7g*Jo&M+SFPU3yMYj{Zll~@}dc(D3%s2bv`(BWvF|4 zW~}>Q&t5&+isrhbKJ7(ou@K$_Js6ps(x6pr8Im{!kechcjuTYEn){ciW6VTlc%U{i zak5&ijiJ{4O7PLyd-b|4_^EqpxQJ z>K#e9-!l42xOv16C*9eItxq#BhrX-e=5a3isyi1k?W>clzkOME4aDh>KG&icANp6w z&LH%!k)2oQ-ypjXp?4yC_t4iNdw1(Qe|wL+sC!Q_{hjXyNdHdsGF)FV?e^ORc|zY< z*B&3+#TM!7e&`dVJ$%1K=6v?uj3So%MxHGR54(B7wl&4gXWN$L)1Jp|PjS|pYul0H z#OK;}CTu?2E^OAA?+&{Y9`?MK?i4qlZO@#1d7O_ukI8NOvU=jVZGX}OZ`eADGWY?= z@8BC z5o`PrbYs4Q+|3JQ_09ApOx&{o>L;)7>U+qy=I?>=`X7SCpW~x`7&3?WB{28-2T0uW zG+{@O#eJJo$q$=~oD z^cjNm^V^++&O_R~-v!86Z5JVJFUj2ozXWObH|s5Py$sjx`G~Il3M6h#W#?_)tB`d) zFH*j1$l}&}$EI9|d(5TnXGqLk%8~0AWOMoL{!96PMHX*|F0)DA^EXI5e4R(+lgB)6 zBp>@VCa-l9UArgda0^*H`o67^W8d0_Au;<_j=t|8o6ElA8;&5~f%3jb(Z$2pz9XMJ z`o5cdyo)h;tub`%)_Rs^G>$Cp|A*-59qG*dm-#?M{H~ufE2E|>bk+pkbuV;|OJ0ai6EZi86_tCB{ZY|~5Yj~^vm|AolvpV*K-=zlc^x`zM& diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_014.spv b/test/fuzzers/corpora/spv/graphicsfuzz_014.spv deleted file mode 100644 index abf5488963cde99ed26e5c56dab7c2c9e9406b10..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1772 zcmYk6Nl%nP5QdxC5J48%L{w%(aX}Fk5FOb>85a^wJa{Ao2q77r1UYydZ=U=cp1u0R zjGCDEJl}MiuT5E1Z@pFZbyYLP!gO~CUEvh}UWLvX3I&i5dP61CjqSJFb01Ik=N1;{ zW%P$)MwBxUxB-rrbGG$7_Uh}HnSJKJUCO@eQuK$JLO*s5zTcre3S$smMVxOH ze+cbe#b;yuEVgHi++lPT87DS^)_1<wZ_@+V2KppVwr#$D0uo_xO!p$uc&J7UK|o5X%|pEKs z6bFcih$!NK;?`DiqGA>I-j<~me!uVkop>KEInQ~|d(J)g+;i{!(opI)rB{|!WWD)s zX+@Tg!C5z$EbE)~%ymQK#>VP>?c1vtFIix~fUK0q88a~Jm32pVL-uZIZqcDvZV*VG z1wf@dR~?gj;7#MTdl0jA|BgI=PiAO4np<`^ZEJ6CZQ0n-+`erWe2J>cqX)>fcJA4{ zwr$JK)vc{<+x3{wHOaS7yC?r?JKCD|weHz(LgPy8x;%R1v$AY+L*v@b+gkUuwq@Cw za8bvUBCdfsa@OC#I@U6|%U8B1b=jq?Pl78G+&97f65PKFchC1`+(5)yVh?F8a#4$W zNo&!z7SGAL2cR8db2`L>$}q=+6FelrLlZnK!NU_gBEcgQJSxGX6FertV-q|s!Q&G= zA;A+9T$SLo_y6xjDNB1cHHn{=;OPmTk>HtKxH~7FWoaF=x_qTF7Mwu&qIunkC^kp*`o*7gna>KM za_s2Q+ORLi-mzmx-aGfV2Qg>(_kxcdZS3l83-;kdhgOEa6}zUUrptc`c9tFJ@?VO@ z{FQV0P2#<5Lp-mL$g>ab@S)LNb+lu9HsRk7c0``bz;YqRS$_v&KVshH;4G_K74xpZ za!(;K?@BoPZXd5gdnWcv`&DRtaYowqR4&%J8k}VZy6S&5)^m)d+&15^H936KPh-6X z?HT$;{N}`&YR@X{dOC0s_yA%re0$!{TIN|>CvpI3!FKPyJGp1be+}Ao)F;TU-*1>P zuH7HG7P*)D{2m-c^lw3)B;R#t{f=j`^=r$US9}d~&0C2$&-qdFYr#?TR&dn(Il$^)>ydk?$6mex(Qkfxc{5tS!(QsY1(7$eIC?o79J!;m zH^Nz)ynQ?iJqMAGd2_+~z5g-qO_$%SX(cb6+`M#4Li7kK8q2=S6?t0=8~- z^rHc6oO@Y|+=_&64cPhmPC@iV?!{pDV($Bj{=F6K9DVlhZD{8>?4SO(Bl6ZEj{Up? z>|Jqw>}LsBKJp&|%el{|IP1e`hq?8=6Ol8wIPTd}u=}*uSnpk6*V7m4oeD1V<+C~s z+x5Ly^4elKW4&Xso;vzwA6?J=ncrHBwHMZ=j@s<2d$u-X;*9K3#4H29u>N<$S--xh ze>u3!m+N1F?R~Ijd2O+rv3D2e_8zeLJ!|{=UbMr$>bnh*vvzURRSov;`pt~Kz7Oo( z)#qB;<`sMIUB`V!KJ}e^aeNyq5!W-P?;_Tj4|ZM$65qY|gXO)0)_gnKVa@tJfXG?1 zIC3ojyH0u+K8S72WnU@NHh0Wf2zHL^$38y%CxP;y~VofxD$0?bGTpUSd+1S zU#wBBeN$okjqzNY&>u!h$a;PstV7>XaPp1{#JYB&??ied8xiLl{}Dv~dSbNiLd+o_ z`}ru?`_!E4^8FbAmTx6bBl>Pc?mF^lf2`nkqc?DdXQS^aczsIb|2WwEdvaaQKM*V* z`R@hGMgC8K<&mfzNqh0V7ZWfMcto z+=;Xxt%$X`&(9$G+;4CX7Ph%Mi@48%t=ZUX3+{7ZdE@$VTITya;`-Hyxy@x<)b|Cj z{z}BybBZ%~2<&+}9)w$uei)Iz1o3SgK|6dK52GJJ_{P{@`|Wor{*CoruzQF%^gXa|NIv>A6fA#NarWN_n@ir`!9PHIHV)5UzqY*R zuZ~>9z@A&wG#qR$`FNv01j|QFkAbbJJ=f)TJpwErc}9ZGBOiHw1eV`G-RsalM$9em zeLRA;KDGDJn4ciqk(&|YtzDn@@o~iasL%fDi}&zTu-`=qm#+5*Z26GL|3^6UcjUT!zGJ}hk^fI%xyb)#u$=j$ zrm5Dh{Kk!4y--B~5E8^lk3@-e>2V>(s*iZYbKkk|R_dL?~Fa*E*>_B3lQ^E4_9)^OQ zEAM+4hV5B7ybt=d=Y{8u88e;Qam>Y9#ie);I_2>kLfX9hT(GZWi6@-b&5 zbL8XAjKVgLe7u>_VBds3?`+&*b-ar)_)cOUN9?2fiT5-X?0kLZioITiJr28s-i%mx zBYHfXeEd6j0=PH)#uvm*gx6=^%vA+8*H$EQO@fp6jLkh6>^%9{^Axaa>WjZ8rh?_I z-Fvf+xzoV>RxS0jV>u2p=`QJga;GA!~e&6q{MXj^3UGqFR zYq0(~*!<-G&rE;3qq$&x=i~F-jGc!qe*rk=S7Y;&|1QuUvGc+DHYKqOu=&aNtN#J= zuE$;o)^{QJ4$e$&5w^U4_quisSng`@ekAt07*1a**3d-E5_tPzjDK5qFSwIbu?%@0 D(b&?P diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_016.spv b/test/fuzzers/corpora/spv/graphicsfuzz_016.spv deleted file mode 100644 index a7cef28a15eb74ab11e3318aac5f17fbc1edc379..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4044 zcmZ9NcXO3h5Qk5=Nk9oDbOMCXo1h>dN((KC5DkjG#e`finB;0g5V4S8!`{1o2FLLq zKbdXD8K399?}jrTX4&8VwwyhC&U;gtwPAKj4QUSleopn(nr6YIG&eODy1VyW@2-i< zL%a6wyUU3AsZssuZ<4NovBI$2Y+=5mOr)>K`5( zs$K=lG?(1iKnX-uerd46nXWSiGp=Md#hflj`fEF+x$7klW+aoBBtC_ z?)KoyP0g7LH;mYKi+HBTN}7j#sqi&3my{+(2S!G!`ygE@EnY=t)W3u+rTBi%V2zJl%m!vZhK@X`z~%doR?nY+9W3%nx3D>K}dVdv#CcU2u0*x9+{SJz>IouNy9 zO&u1vJ;Q4=+>zmR8D5{^4H@2;;Y}IdoZ&4Q-kRZU8QwmF8|l>V!}p(350j4j%J-G? zop*CP-rKGI>h`VP8;kpk^DZW92l4CJ* z)KN%d+Ko0=&RF#xB&DgNk$X3m_r8Sv_oCf%AG!l^8K=D;@jF?KeGl4Na_!jeA*a~m z0koVF``!y?b;iE;VKgA&Kd6@#{zG8*TTZ>hX!moj)<1%_w!HqMX#IW<`a99qmOoh9 z-kn@KGg^o?*Vtod>&h9c?Y+fb$4eZ0oxpZ4>zRKNZ7=fn?yOEBF8y8T2E?2=Yd1Kh zYbPVV2g?}a??+oZde`<`auI*Jw2ePgV(ahcP5N%^-Q_#_3#%9H*?c?xKG?6e@5A5Q zu)Q~bE5kP4w-L7S-bvW{=l;+3d(ZuT=V6;aKeN3@zoqayOMlh*4(_C%m zd=9anWBl)#9zmR&y&7x3a>hl@qhNEUsbr1E5IMh#IGi*b*;T=E@dmXo zAl5Qh9J&7OG}k`-#A!^5ua5d_!Pbbr zUj)k?LcDYB5yV>NiX*oJY;N4~C^+s|pK*Qkyispp1#O?39Rq;a;7hX zttI~_vl>Uc>{H(aB4?lC*l#`9K4ZSx&Ld*g+Rn;cb>waUn;Y}r2$sv|FPG2XSw;RP zaDLXy*l|{Uan?z&K6{*x){YvR!PW?S3)uG(^Sc6$n);&VD`0&QcQuQ%rhCa57qz#7 ztsOO91=~;5xCV~BjJ1ZGan8W+#2Koi<~Fc3V}{$oaxp`Fa^}ak=XYZMQS@s_1?l6j z$6@sAB`5D{K#uW7j-%f|S`oix^NoKKk-tfd_I1P>^7g-=CD0 zR>a?c$>ZO`mQ(C4q=o*i_jbv(p{;Ga{db|?K`O{8#QJ_e?;`T{ul-)hb)#GO%OiIa zaUbtS{}{PD(eESr;{HAW8{>TR#U3Am^+g{af$gIQiI|VU^3lg9V7a`HPqCv9{n5u~ zV13cY=V1Hr4d{zKz5wg9kKO1m5oepv@jLgu(y~fvDc_c zOw+{lo|xVf)9mHH@AvFu_CJ^FJJ&w*%*^iW?!0@>cd%!V_4>40OSSs)-+?_^O zlbyJ|AA{R;6Eg%nwR;vLYjek2t;yrYkDXk|am?nK+r-w6P3(Ew#Gb89yj~kN*mJhY zuiu6Z_RMYa8?<4AH>~hR6{dumrvD}t-n7Ejj!mD<+OWZ!S9psG53R6uW;1rnHf(Tn zh=p%9w%~0lpKU8Vtir=9yj_L2uka2P9#P>PD?GBoJ5_k+3XiJrE)^bKVc#8_YaG*t z4c@iFyH$Ai3hzSS-%Xp?_tGZbs|_2xcZGdlZTjrfh7BHH;e9LY zJ8jc{zcy^J@3u{T|2Ay!gbGir@BtO}F0dIpsSO)^V1*B=@WB;6q{4?*_^=8eUg0Au zd}M`>s_@Yjo?PK$D%@O}=;nNE#d|l|_T>G}T~xoLa^C;rc>BGNyc2BEb6+^_)V8Ua zqq%q*zn-n>6@OfXXH>YkoQuDArOh$D^K9Z1+pxj2D(pRM(}!!UY2xk*&#mxD74}}W z>F+&f6VGqM1}~`a$rV1O!l!228HGb(&$h0m(+*%dyg!sk}_yb3R@@cAF$uIBFdbH`>L7qlUtpFLWOz=Po~q!+J> z_eJ!B5Z5pW{bKq)i2PtaH7=poS3a^?iMtfexK$YYGJ41R2>l?$rl0ypk)@Hf&_71+ z*mBNyIel+Leq_;?Eu8i%3N|Ko?|EaAhii2F=vRVm(XRsctMseEp6P1r#WnPUkky&% zT6%SD>tOSpk~5Ew7hcXh)P2wN%{s3G+w}hgy*9^79@m4rD*XnqH5mJi;P+|KKZ*Wc zrQd}9Zl!+;{hdnxH2T}gIO~z2|&0;(YqvinLnijgEd>qyKMx zx1%qG#C}KHzDx8w8~x^Iqu+)8(u?Cqse68RBfXH=?*TL42l4kddTWgNeFkiP=Inaz zqc=zQPy1)-%|+hxPVuIs*VVee;P^j)?l|??EkXCaa_-O5 zn_K)JEPCz#5Zq2k*8VWq&x`1ffW0rW7mtEltuuCy{V_D_Df;7J$Bh02_&b&UB>2@z ze+pc`BTu6*$D$Jd47zJ@Jzt=A@3NQb?z7x>oY*3I_sVu5@&?+o^zP-w^aBycitb$< z{T8tM7Tt4Qx6<9qA(if4KG&f?U-U7o$oJ}ti0_{7xqGxTdARpqLbT06x89}}ZWJpq zNA)+!{mb;O!TvRTU!eaAV$=RrdhPa(?O4+g$9SEwzD93*o63}r{&g^0-1-LMe!YnF zL|#I=kZ&T^|F@9d$jgZP@@=Fq;(2;ceHU?l$IJZF!OlO15xf(>hj>rQyFPXA7xOnC zrVXf;5zN4zY(e9J)gv%2(IIQf^NLL@#@~! zb-d@A_*vjO{-@~1%Nwum{a(jg4~d@*uH%1(ZoItl>V6*7@zzn|=YZ?@pQ9TuZ@jvn zA9cKSl=yD2@#j&0z7KN|InT^^ZF0u@E?Ix}i9ZRf&l2J4--DM!9Lx2n>tnv=?wt0CKLzZZ+2>Qia@l8Xa>i#rUO^whek`K@ z1JV!4UHM0F?#kQ2&T|d@pAc=iEB{=$?qdH7y4(bAs>SqwMQ%lIL$vkh=5n0BA>Mhz zkvkCYfXg{!WB!g9r%&?v2l&JCc@jCFp*uwQJTpin0xH`5MocY)i+q-ae zY@fmzn?33aXWk}gUg7(J&B+{`GyKwE=W~3=lfRkpWx$SQoIbu+>lEJl)~7$bocewA z%cA$B-=Dg@mfr6|a!Q)-?ENUq!wshQ42;)*1vvS{uLzb?c$#(z@%pX=;rRMwk5&fD z+rq6^{|Z#oBQ4c^B3J%Pk?syL?@++!C1BSR2#5xb|} z59@)=H+#B1x}3t(wA`Z`KzP^YOfCYShRElg+z>41{`ih;gwE5fN85yQJ{yCzDHjxO z6R`7ZGv0ID6wK4it3CW?g^%RR&#p4Bk0&9l-r9N7+WE^*FkdvJYL zJD|%cJWb14jezj1E=7#@tWHPdb5=Wo<#JXd(RrHnXv!>x9-j;eCqBHeB`p1hn8_%kG9m^VPI`a>h5r`^J`0e9RcQP z=G7kl$iiE9`lRmUv+qZN^S+y}=W{fieDa$N=4t-zN?X2H90N|x*5^G1UR&ai1@koj zW~ME5Fcs|B+MU~4oCY=@^Ygu!j-EN>oW_tHN0~< zmj0>r6Tte|lIMx&=Bh3GHVfRjZ?oa#7nVAo1C}#Baoym=c^>Ne)pc$S>TjLT1$Wl@ zNpSM1^Lb#o)cJg{+#|$W=L^6#>s;H($SH_*E_NRmV?PyK*ZFDaatcq=%*#4I9l|=l z0Wsb>KeO~OC6k9#&JE`Qs-ysS0r_QHoEg`i{Ck5zmF*4&V_pvUC9}r2gk$j zOs$sV7^h#}i-lmG=HF)Z4S#;&eP8s+`y!w7xBzVaem=Tx-^Q!AtzYo@G z)^jbmb3Gr2lh6Bb9at{!!zaLUkCCTmay{7QnP|HKxe;;i#P6^hV!6!wNpR=9H^Iqg z-cNz$GViCsa*s2Y^DYM4oLAe;$SsI-iQPBf!&|}idw3hVoWj#I^YT5s9m4nUdc=6& z!?OyX_wWvUQWd(S@t?%bD0;p9_a zkAdY@(dID^-zO+4wJcU?a;?&pE;JUt^L6=i_nr2?s*B2nHFMq?x-k)3e z)Yr54$Yn2|E91BxZK<#4!P=D6*B8OguPt@-B`{AjulDd?F1+=nPwGoP`~Ctr_lfy> zKYs;IKKXqW%)`GGwrz?18f4Bav0sOiPwY3qJk56*ZT`LO94~?$S9`{L3EVl}H{s-6 zzj5CJ%Nd`zm%)j1jq3W1U2+W8(>?n&aUo$rHf){eFx zAU{N`9dT;sN8q}4evB@s@HEZ5teu}gSUXQ4sh#r*pW68;K62ULpOtZ3kG9m#&%xT1 z)Xp!!&aW*s@=GvJ^B!vt|4QMl9eq+e^2u!>Ht&?=_A6|1`CR`sx}5v<8+x1jCI4IG zcZmBX&e{AP>{{yY3x9x<&zk=T=4t9to4GxYF7KH;m*YBq#{Cnx^UVJYC!cZu0_JJH zw`nrQ|C%AJx z|ALcG4gVV~mm2;LSng@^^i2K>ws|JnUPE3-+&i)PFUI}`xUS(h^(jKvH1o2C--57) zpFvV5=NCS8@-{wl+4pzQ9mn-(OAWsZ)~2L}-vc|pw$$qTV4h}P?crHQ!&}4pq=x0Q zwxz(X%^26(qr~h1)~26-XY~XRq0f1B6}_(0UU2eRS8uR+^+&W#WRJYV`hXqJ7OrpM z^v~~#{owS~=2*#bX|R6gs89aBTn3!K{p!5>!)wd9%Yx-T5PsKi?aRSA?oh;ia2|b= zK`Fwv^2`p!P;#LL^DRG{Qx_))NTZ{Q_X|29bcGjkMZ?K=? z!HX+=eT5fPcw&WzRd`T^2ZGIG0KN0AL7zHUrR1GGUll!jUhlzb@Y+%ftAiP)sc~)D z(*a<|w1r!vaQf%W2Eys9&9O57n&1zce=T@z8FOv0W7xv2Q#j`dw{GEdoxtzz{$4N$ z#d!U-JGN)mRc!CFvK^58e+RwbZI>Y1<99KA?+W*+a9^-{JeV=_|04Ll>JxpL4&C>u zwl81w+&Al?JD)i^mU?XKS2o90k8K06g{vFN?q z)i*)R(VWE@&%gQ2DfjoL*u1~xS#2IHxd_2RP$yQ*woQXEM`1?DR>xut1V7d5flS}SfF_-JrCu3|2mXFWY z;N{?)*E&$w$8&Za=4|eXABL^Yc{sXUa?mCh|Lwr;XL8;iEEj)ma>-{K<}zn}GR6*I z`S@%LHfQHGXLWt*oXuU`x^)fq>Zxt(MSWPY+gt0y>9<2{+P5!u`{XkMn|qz}-vOK4 z1xS2$EI!dkqSx=k2x9b+Pi^lA*NjDP?Wm7L%*i!~Gu}?b)#tD?x?J{En_T=yf$Q4Y z1zj%w+T^mwJ298%pijma4VI73&S1~Mc|8YpecU(q(46h-eReGwZw$V<%e?2*^&M4W z?LCuS=tmd%{lU(> zjV)MGHU~_U0 zT=%%LZ}!&3p7eVmHtl;CyM6X`FKmtxeQ&Vi=QCy>$3U02F4V^(j_v-56T1&S=4p=Z zjk@#hTYT-!Yd`w^5u5f2#crRm#$$7g==*}rD|gC7eD#qxFZBZu$2KocPv90Hbio{W7c*nRM~J99Y<@jKi`i2mBm$y(EvxWmD&U7K~M9@`OM*PzWBRFCaQ zuw!Yn9@R%M_agd9>~Sx8$1_g5=jqvc2KE`}C~Wl}9F6WC$j4_g*nP{M90Qiq*ZH*_ lgVZ(Ud8=FJ&S{_Vrr=x8c`Ukf$~&GmIpg#0Sl78T{tp_OuIvB+ diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_018.spv b/test/fuzzers/corpora/spv/graphicsfuzz_018.spv deleted file mode 100644 index c7bf440c2e2c42ed990850ab59aab9a8b17e737f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16524 zcmZvh1)QDLwZ(5TnTZhMu9F*gn;0QRAPEp4A-IJ&fk_5pIAm~lcXxMpcWBWH+@XcK z7m9cNzk61?f8VdC?{u%dww`nL{W9;pipG7L77C3D&Germ8yB+Gw$NBip|Dw@DwDJ4 zE|@!F?YgBSYQ~Mip;e(G^TVfgp=qIsB%!Motz3-(D_k2Pcoh(;$Z}0rP^GNVzf!hJ z`7F@}S4pl(nAlZg#$++ggcq-0p7l_r9O$gN)yuND=4Ca*ErgwKGhydzDZFaT*vx11 z;L|Gjw9b5LGM_fVr)}_QhtF90swlJ%J{^Kj$IPc(t5fjl9DKTDKIK|ngHN~M(;c6h za;+Z0r)Ti#mHCuw^$tGO!KY8=L#-x-qVU@FtJX?nXXq>G`|2m``|2O~0f8SF_(6dm z9QYxD9~$^!fgc|D5rH2WcplvSj1K&mz>f`l%_hFGFb=$I#mc(X3l9_2S*!G7g~E#3 zg|pTyS~0V(Zq3p%-=r{JK=VZjc~xaPc+Il4b+zl)DM$IPCO~Rc>OT`DQ~txtTvcI` zK;4FAYZlekE-c&1zWgQ@&YnAK;gY)AIvr?sntS5FTL84c{03Oy$z_<~Ed!pC@ErBw z-vaN*A`Xt<*=)TxzYX4;Wu19o;XAbqGdwNe=>g9OnBNzR*saPi!~E7*@H5LW!&?Wu zO~A7Po*nR?p1@C5;181O{_ zUmWly0bd&M;D9d+cu2sP2Yf}qR|b4lz*h%+O~BU%JT&0z0_NXd7WZ&{8D{u~fNu== zrhsn__?Ccg4S0CKw*@>R;M)VfBj7s&zANCn1HLEVdjlRB@O=S~3i$qj9|-utfFBC@ z;ea0r_|bqz2mDyTV*-9W;3oopGT^5IemdZ10)95&u>n69a81C^2mC_7F9!Tlz%K{< zO2DrMJZ=+iq6y-EN8o=4C=~b`WPGyqO_CXdYpl)R91|pqn`~vhkMu^Fy`u2iCR;`J zcNHo*UJv}FfZquC&4Awu`0aq-3HaSjxQRL|6nbsaD+=!=++LmkOt_DF__-vwqrBgj ztk$OQYUv+HHr0k7n(QA6v#ft4%sq6_e}635NjX1}tk&+Vm|sYu;P6Fno;Y%Sny~#plTIFV_gfNf6!ZpR-kV-Om&6yH zUVkGA=U#s+Og?z(qqj_)^M4_odnezQlH@}t-|r;hobUI-puyT!+N1nd0xri zNLc@qossjPbN6ug(|=bD^3Gr(oo%{2~K3=!O_k=!Jd|&<}Z8O=( z`+;=sk2|u?{YAY+PUl-3?VIQHRyn;*PH&sj+voHSIlWU(@0`=S=Jakky+=;(nbUjc z^y;89qs5?eUww0WzntDbrw_>K19SSIoIW_G56S66bNaBHK0K$7$mt_<`ly^fI;W4x z>0@(xO->(|(uN}Gkfb+RL;$o{_gEwssT zum1aE$u_dVeWd-Ze9+r!lZ)J7>N4Z5+b-FV)NL=>L7PS0j>(R6-N~|%!*x5!2Isoy zowdnDU9e-flpj4?pCU}I8DjZ2vx|KB4$vPypGbBU2R}oepGof~%x{of#B(M%{OFnf zsf%=-sq&-FM%Cf&re$%3LMfBwJAotKcS8T@yaV}=&Np4YoWuEM2*Z`M{kCw#`)zp# zY-I@DBz23D zeYIKC?U(FG*PSUFIb65DY;X<5vB{2f-R)%~hwIkJ2KR+F?~XoBn_ScdJ9e&o=-K)X!sPP1kC$)$ z-6x2H_q$IN=5JAQ5zm?6@S|t?r!LZUc9b7={7yRw!a$oXR?z4s4DTZ9cb0#?a=$Zbhi*%jcC2ijc9Pz#r`bXy- z$cJ>kJ><(doNrHIIOoF#N4(#bcc2!3+xh(3k?oN{Pv{}@hpX^B2-CH(txbDuf!MQH_0&Q|p7wp)5 zeBU{`ZjFQ=3KXUdfJh z?ZvW@!}q_pY;eAR^nJ9+MQ$*4JIlv)_f0k=b@!88sLi78{>hGX-6gV-!*v(Q2IucQ z`eJQzQ5WpkrShX^>&t}6<#%5q-~78T6$kHkUnbl|G2|kiGr{3U&-71Sr0Xn~A9egr zD}>=n+P)Jw;(aIdkIp-g59xdd$d_|C-%4RP=feg^yx*30pjKD$zW?PZHK-L|v^I;n$0R$_ zb=S&94%a~N!xbnlpD$YpD1~fHjCJklO5^WN61DF-~TDH!TH_MPt_(DeS@i6Eg#oCE!mLNJzeq) zZ5DOUOm?K}9w}S3w(FiH8=UK+pRG+U>Vh46l>F$~`q9GG+J5(Q;>YfjpThUl)Olrh5h1WN4mG;WFv>)=MvfA z{5?j$RGVDn2Gc`7`FJiaOEx5RFPFSRn?>C#lO5^0$IC_z*S$(MIM+qLTAN(d1v~Zx z`O&lW6NSm;H@`-{O{L?94Zlw$uN9BY_j;YM@6|rni-WJ%-4k&zq>AfBoh9lN-PY64XyFkZ}vvO|wMY_MUl%M`QS7!^um9%}AaK!sAIX61*M?R$U zog-h)?|kP9!#N)|IO07Myr27jQrP|bZk`ec?>T*17%tA~GtwPL-{|-`@3YCy>|jUt zoDLM{d3jDeXF@VB&r80b&7$WQlO5?ZpC=nRJTEWF2Io0Ne_5McSAHI zlD6*>j(FcC=SJuK$cJ>kOXSP>o$pd%IOoF#M?AAYJn!fJe=h9)eeUfstbkFHvah{it#nTg#dHF>07uqa({$;Wwedfz#BZueZSF*uT zi+Mr+wKloP4W@@7vb*l5$%drvXObmt7Ihnv9qGE4%SH~@{aiLU|31)vqfIXAf*pH> z{OH;GmBQrmoc>n6?WE&}4L|1e3-Q=|uU`st@0`^>zY_;vpXT)U!f?bo?hnF_<1Wzg zd-OU{kX`;ianeAmdA^E=3yMLeiPvYP`r+*fPi*x!H>5iigI)2Xk*JS5ggB{&-I#itJ&&$7LgKN-cPSO9ZO)heS>0y}cuKQK8A*uT{x;Bft-y}QIb+4C= z9IpGVY;dlN{+)J~OF6)fy+MBTZ2d-Ia(Pa_mv2Yu_+i73IsHLAHs9-y!bS1it9^bF z2VbA&RHX}W#5%5#ILC1p==gC~&dog`-QP_z)1T++W?{IJw(k;-c;6-GM(6#=hjhMM z2PtLm!{%56OwspCfQt@Mb9mg9qBXQCL1|CFPq5**PzXuqPNs07rDXoFhX|M-8|Wl z)NLi%TAM}PHpz~3-P>g&hwHYL4URjYE_yp{a#0uT*gNDy&(`l0CYR^5y?nb!#}6BR z%xMSl*nF=Yg^S|3SNn7l2VbA&w6icAv5xB^TugD?1v-A5m2=ZC(*4~fU;6W0-7O5~ zxxxlVyzi28qw{{`Lpt9*^5y)_cdsy<^I?M{-ZR1bx&N-hMcL!IyNQGMoOTz6i*wpT zdNIXuZgl*dw`a2dC?D+Tp3{-yJTJY(b0#G7(p$1xn?=ukk{#(Y-zOV6JTFDr;5;wr zeYMF&ZZJKJl8@{5OEx5R`%4bcW>I%wvLjvhe%Z+3x`Skc^S}G(gSE*;U9e*xkRLr; ze^8iQp3@=n?JgZZZ1^#!L&anBy$%yDisxSKGh7^eeVWq|!f?boZlrKA#c>zt_;FUw zO}|L@_mF()&vW&#Fr4QK8yxYzOU{j6o$?`_?-BWOe&>5s7|!{y!4dD7;QieHDB+^) z@!X@u!Fx`}2*brW9V@+<;y5=te$HEy>_5o|JG$p|v^dYpIPu&Ol6e^~IYFC6&l8g! z=`%kj8#z2LlVpSQoT6``O)heS>0yj~Tz7J^A*s8i

cdb*Cmf(sdt~jU28!O*Xg& zZN8`I)3wP(U9e-HkPkgue^QuSp3@of?Ij&QZ1^#!TZzZ!dz~p<6wkfdXKQir^=VGG z5r)fR#eFB=S<;Isj=Mm|kF#=a`bE0Gr{qh2o~x&Y;XGH^;E4BKa&C0qk9I(7WJkL0^Rm@wyY6nX!MQH_?%L#{F4(az$d8__zbH&D&*>iW?IRsOZ1^#! zdy2>Ad)-U8D4u(@&)(wTJ*WE!!x8JaeT9oDj=Mm|kF#=a`bE0Gm*h)-o~xII;Y!-R zOE}_vmz*1&_ah(D`CgGP=XbtWh2fkJ8yxYT3Et2B?b^+VJ!M<*RBroRcKs?Ej81+?~q#vE*vihU0$i^R6&H z{;k!?2d=5^<>nN3usC9|eXTl&NV51h1KS$ywc5-g*ty@654k;C>triRhsTHC-Fk8G z^E3mWOWz<2=RIFN;CHAvY%Ft!B~Gnw;to$7uJiQ&Dfv?J2r0zlkG;79xUVM3#&3Z$ U(Ld*~t%dxe4WA$M!nkuDk2@t{ZN5 zce~xa=H~Br=f3zob9s*EJ@uXQz32Wf54Ln4y+u`Zt9tS0$!=BsY*lr~Q&oMcp0%Dc zZ^68=Yt}9uJ8{xD6Z%&zb)Go`sx7Kkba!Ocq8051jOrT*(oX|WOMTW1ih2+&^Lr5M zLC&i2~gxRV|z|Z}!3^9Vv%%$j=U}%W_FjoLSKHpJ(E2nT(rK-ejeD_a~_}C`n=eF+|7@@7HodbTL-p(?DN6qYs>cq=r+X1`Lr)Y{QGDG z_C;vt)7OT5Fa0iLYmG4Jvx%B;t?K?WKv0r1(yTQ(@ zeu=C_=qboz#5)W|?m?d8l%?o<5#vjcm$}bh$q@XCHG0 zArB(y^AOm0`aImkQFR~V=IghQcqTKhKtF+*N_7$Ps;#Xi$` zQ}sQHtS2H5&ScDQT6qV1YI|>ct5YLio|&5PD<9T8jhw7UY#(#B zL0&+@_s7A;v)506UqF21+xQEJe*1{S_b0(!`Ti6>{o(u5;NFOLv5$P~GcVjZld*7@ zJJ{1ZJ&(4xIyLg;nW+iC@?p(q(AKEK!*sAbm@@+TED|0*2R0tQKi|YrH4nzWfav#J zv3bzo`-sE$SHWHR{u)00;rr|0K8Sa* zk9_MhFWfnkv2d3=*wZ`7i@nvUkuT3oP56}$YrcWDMjakzfaSrQk;pfZ@bE403?w{! z8*JRi_s;lt5dEGjw$FDPTb({9f$d|?_Q>~;^!Yy6cst_v1F?^M>oYIhIg_z)mpj4lYnmDTF!T6sM{hlkf&tDo_ojxak?PJa; zCkr9XUk!ybU` zUF;*@`pgS=&SWgyEI^UGj>5*iG`;gVB<>=_t6vExR3iVz6GM+bH(=Q)!6FvIgT1mgw~94K|)W zeXx!D*vGiGe*1{Sbzg7~@|@E%@^7Mk_>INx50;B7$zDd@0I)vu!jrym?Tnrmu5%}6 z@Q(7}Eb7$ApL3)pe9KSf7zlQb4b2=|f%R>oE_3M1KDRdBoM~J;`y2#z26cEogj{*H z=Wgi1=eR@e zbEGDG%TMNL13O3dISQ;V`!uF6``i)iKHY(HYG$i_M``i<} zC3(*28R2a&{KjIB1AP-RJNujfb_R8LoioNT8jjc|fW2mu@Ib+cKqtoXAu<^V%Q?QNu*vGiGe*1{C&jZ1|$#YK62yavI z8;d;+EEn15bg(}2!jr!2#u+^?yUCrL!8^)>v#3)ef6kGb@GU=?V+Pncvd@`dec7im zec9(hVE5^}?ws1$=Pa-@sKfJI^5of`W6=kr!}B3v|@Se=tI%za~Rlo`W%jJ+{Zq~we{OaoPEv%_aV{MA5#CneHx|1cEEm~l2UwqZ;YnY1xGT2PM;&Gv5z?u&=;Z8=VGw&djjc|fBdD>DIg`-WqtoXGu<`V{5!<+reT-}Cw~sjcya_yj zJm>U`@OCqPW3g`m%SHBiD_Ea-;YnY1nUHFZq*WKXSN8ZNf-@o_Z z^E_kiaJ`7wzKH(Ja4*;yHXxbdK79If&i!D0igb$;Ad}oY3f;@`2CvkowkAeM-*dzCO9H0LA o{NJSx{7-=OMKPdk z#w4bjMAH+~V|wq2Ez#tC|No92?voqmIp2I!&N(x4@4uR=&ZE0!S*NT!|9h-cR(|?t zonf-9XV$g6E?%~J*~GT?jT5I#Jxqr_SykCjpT1eQteUkm(o||})}U3cA4r}JKvm^j zwFGs+n)-Kv>4MM3miaBsI~rQs$LiCa-LtH|rD@yt_J;W_TU%PkZaRF%j!lzhKx3~e z=dCYey|ZjvOIu@mV@vrAU5MTbZezoy()O+GmH4u6_pFC}Yw4`jTT0s+#+tDrlgVt} zo|RnS>Z}*I?ab|^)`rTtd#g9Jw>LI##@>xuynV)%Esf3XW1BWj@`Uc+7h7vfd&x5` zFSWNe?yThK2jAY%w2h^_Uw_sObsNff0JyEr+*R2?@Rqt(aCJ6FpY5B<_3sL!?$h4b z#K|go1`BwM9l~0Fcm)p?PpaTy;>i^}Ts)TLf#^r~#MzDHJk$LwLN&JHN(2cnnSwl&nZSNsn` zr#{>`qw-xdb)VLTwwA5iD^p=z7_IW-#2pMO&Wy9Wd28LG*3#zrEiJ7Zb+!iMSnC^_ z+Z$Rd`gnA5Gg|6Z*#z{)vTs#(2&;j{O=L}Ld1yhmp{d;ql$tkhwW-b!ZTr77L<>1P z16S^Gbw(SLJY6$dS%{ldJ`ZiH#FgivI-@mv#8Li2+~jiH^oT3ZPIY$F9&y!~FJ)8X z&W6gpy?K_^Enc>$uHH8{%a)L35S)*F_E}8bkN)HnPt1<^6UzFyITMKTY$qbd=%+3G)_}9DwstV*ItesN zl}Ee!$z|;weJy&Y#J&z}T_WEpV4gW6skQU#U9HKftoq4$Cv|69&b?1#9fd@0^*Y4I z`1P#%nr{%O#2RGCNPJ_`TestiZQ3Nc0;_U=W{&+8J+9q--_TpH_q>GPL}Pe z4ZRty$4jGUhTc-PKR++>`6KEX!hRlXR^MyI;p z=+O1|+Z?+2{WgcL-EXt{T<)@-bqC^HI(xG?vwb)Vk?+O3q`nieuDua$ml7*~Hlocs z&!$4&T`uyR1D1UW{H=^q&?;g&lT=?Gvmeb~Js>k_m275kv?as2CvDWSu#CnB(E7&{q;xB&f zw;}d*BBHPMHpE=cz4nN`9V{369bos1T)V-MOJD72F6|L}C)ix8=#lTmU5K1daCd{{ z%o*H0Ip_CeC2!?s)_W1-_1C@%@%+`S+TJ9?kw|=ty1@Cwx9C2w-wNOLeu(e7=k#3n zBmEQo0q_9i;{4nXg56I(-tmXP_aoXO&%@v}&m#r>QS>zLW9a6UkGzkAjnfwUzYA<` zZL!xA;DN}>{CE9Huw00-_Ws?7wiA)-a_&7je;ljdApPEp*aPdSJ@P&UUXw`VeIJ}L z+9SvN!I49Iu*2Q!~a>Z{%eu&{{&cGe`i5G z{67iSe;pG3p90J4-=9@IoppQH74bP5nTDTdb-u-mS-T_t9zVw#c|Q%-Cw_xI1GbJm z5N&ZE`8ca}_pIw#KZ^`T>X69!xtx!jpGP-mZ$w+n_!q$1PC+`zw}ADFhSGP$-$LZPqd02t zUvShwtX;o2r!T)XSc}Aa+X+rSd^&@RHK>AgQG@Paxv0Tj=yKMe2dj@Yknf4ec}H>7pcgo5Al9y5oU=E$Sc5)r^5N50oxReT z?guB|k z9mP?D;ozu&Si634&Jp0^yRbK$eE94GF4kaQIQj4ynfs(Y-w#ecW@QxEIQige!0x9l za_tW;zC)wo+CA3d4_mWv+w8!Q(+ss%@n z{5@8W9?b>YBV)ALBRS9EdEy-Nz~)G6J0DIyd=`L6IQi(&60mXd z!5s~DKW&lg7;y0$v=mN0-lJt;W99A9DDEH^Jz5Tyiyj?|E@zKcu=>~|`IU&AwGqcT zR)LE>Iu1@gdbAoW7d@&WuUz!#cyRQ{zk$@FM<;;oQ4ONa9?5wQ&lBf35nSxi8aVmz zISE|s(aCV~;j=dPNqe*oPCoi^3fMULj{H4373_Z6BG+l)Vvp+Jnfb9{D$) zT=b{}mWv*3K$o*e^{hVjNPZ(CXKloBjs|eCN1Nc}qeq*;a?ztP< zdejKEN5*KgM{=IS^ThAf>EQUi5~qLr_aV+_1u~7h9n0DmF~=GB`Zv9Q^B#zFLqb2e zppQ%RrQq?2emZzUqH8}S(ak@xpdXs(`X83-)^-zkD`y+aT8Bifn&9N;QkC`a&52L? zw?+%Rw(#4Q_@(oACcL&@+af$n$g;KolPB{74?`*I+Z~l=U*iNBiZu-PLoP20s%q$5WiU#CiobIp@pwT>VPK zT;>+Xov#9W=EyY*Y_1mKoSUo5zVE#A*PzR7#b$rkvtElnm^J3vxa;8LJMdAz9&D_9 z{CAEU!2DDG&S;PC%8g)cP1s^aZ$g*%zfG9adAJ$f^J|Oq&xTLWe+xFb$bBoiTnk*B z<2H2uDW5}oocVTeGrac5KLWo!1kQNnD~9StFWu{_nH1P)UCQVS3OW4LRDzs_bilGTd2kpLSv}QWN~3-VdUNR`pD?m z6&cMTml5T(g!)i}tOjq^UcWV9R9`Eaej1?VvRVa_YKd0zYw2Uo#^&n$*4oBgskF6@ z2~TDStHp)+)t9Bs(w4p)2x0rxPAC#JuMxBWZTTmGs~EXuy(Y^$okhxA>+~PkIi@JD z4yJSFe)1cT>fPvvka^HUm%~VH_c4U6?i_pjU#64Ygk5Uio9u*jq=MIs?&>1Xx$_z< z^R!zt>wn!g?C;AvGpTMn_KVN62Youq{DXLBX7A1nvt#G%0&;}2cO#wGXO-u_2U!L5 zPet43sxS3CiXOu5RI+=^_MG|0(B-FmZENf6rBff$e%7m8$?k)BoPa#*orolT&ZF&F zxze6IV`mcML_H(V!sVI$!a9Y#O}=yGf%7cF^qKU7d;}t!?NfYS-Vx*0-iy8gbp1Zd zCT@!RIRmP|EHM6)4rh_BKj@z0Ip8eHuhjA$oCoH5Kg_v+bp2*lV}n4SdFuN}>uT$_ zzk9d{?C-O-|1$NRYY3!R@(o8HB7BQ;Ttb&?%sEDoF6S_I8Ti86SN&tGe-+&vbDhmR zIdT){T8zu9*B==$|}F4hm~#;U;?J{wJ|r?%&uH(C6ONQ_oxI9l)CIEpe1-Z?|LI{mM5#oy9b|=jBSX%%JOU z2A)L$>2elhcR&F+i+Y;HyXX6EKW8Z*WA;yp^U+(Xx&W|>EK zIg7C(&}Sd@_xL@F`@mk#k>biU$AcIzAmy4XH{ESz;yy&T{~$2WI!m0n_x=&^{gIR2 z*@fu$yOiFK$LQ{>0T}mwnEwPA^Bdy#!S75Rs0GjY_j|DzeR9*YT8e(efp0nb?2~v; eqpupd#9g=EN~X&R!MJBO%{lw-8vDzn6W|}sdw*yE diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_022.spv b/test/fuzzers/corpora/spv/graphicsfuzz_022.spv deleted file mode 100644 index cd9ab76b4d3eb64f52b36d028696e3401bc2f3f4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9436 zcmZA62h?3v5e49v1OgZcASE<0fIl^ajs>YI5sgX{#D;+ch*CpTEJ#3_ioN$%B2S$w66^dC-Y|a*|TZ(tQS2ua?Xm?=L(2!mOuHDJZRo*o+I+X z`q@3+yMAK6Kk9@NlS%Y{YvqcyE1>y9erKJ%>WsC=oV#+>MI*mlYgV6mRs%AuAK%(F zt5!t?J7F?8b=mTxPd)v-v(H;InJmj5z8!7I+9DOrkKQR>^}<_a&xX;9BhKD&sEx0( zID0mV?HhHoZ!y^R>^0@nb7gWd6N(fXq2a}v{&-6KneS=}R8?{O#f?-`8$w12Po+(rHE z*OK^f?)Q5KyQArSOXJhK?%OBW-F0969#P z?BGnB`7q0tp8X@%LDBA2AI&5GkwIql;KAq392WL${rr3IZKJIlgWc2ZBJ$DyjK2L~ z(>Elmd$~hIE_)7%+%a-p&T_YhM#Q~=zonkTqQ$L$#TGw2!tWgT$T0Hej)=xBSOMTk?zD zEpqpW{B-jy50*#Ya2B^$&-wMFcXE$lweX3v&9ZOX8|U7f*B}p0<#Es8^6-7nzgMtW zc^n(eS02X&TX={aA2}f+Kixbh2Fo+%VXr#*$2{&Gd(4A9&BM9n;jW7Hs551boU4xI z5q%xcpPt;1X*OdgMP?#qa@UC3XuWn{Cr4X&+H1!7@TBGCW7EF5Pqfu{a7wT^ZU21- zn{Lhb3-%7|xqsvVkP(p<=c+>=^>sXddeV3B@ZgzjCt6rPW~~E zXU87%U{CXKZh2fW!g|!1GDpr;hd%1-c>dPK?mKu+@Jz%^nt!#?*F?<2bE7Rh?KR_k zc+&Fnv1#8tFWTxmcz&=rZT|}fn{Lf74E7G}c~RuWk{K__n=qZs!N5@_0*d zd2Afq^WPdQRvy;{^KBB*r?*90c!<3{@{Wi)>E?N7usmZP_NtSA%;R0L$2{26Je*q| z?y6XiI#cGzx$4kIeI3uAp7b5OJ9s8yCe6RvXuZbsJ<%4P_L^}%JZX9P*tBon8*TL+ zyf0Xsw*UQuO}FL`1bYYed@yo-q%-=VVDT*@-ob~Xua8*j68}hq-#Kva_oKmj+Wftj zkHsg}Gd>=?O@tqZPefbti+wWksfhe^^M5+H`4Xshqwd%@zg{ofyKx;6hG z*gLT2hmjveI-@@h7T-4F9sDF(+)|hLPb2)!fqTC{3)a)-@4fsyKCzzhi(qrikHasc zE&0WM75Q~Ue!BU86Wsj1Z~or~i*k?l-!tWfo_d8$A#^?o6y_XGQi}j2RgWUx`4jV;Vc#GX4vLGTq-TWH| zH~;t@Y!bg%=VxIsU*~7j;N}GIevSe`Ktd)3K5=COV3 zF%R}M59gMLyDHYB&XhTFt~&HlU&r&OCw&Jy1kZ$rnKb`uqxIT6+$!3_(_S;qhbJvB zADi~gj>9*72e%&f)AlbOY`Qh?6l_lI**UUHq%(S(VDW7d_YP);c+A_K(OW!Y9r?AlSFDGKyuyfzEmj`)3Fa%0Q-Uph61#8Y zei3!j<#GRDdB!~KRVV+L#{*)Id9bH>IJZ39Rk0p*rp%FZ)uE62I-Wm0={tB}@Jx7^ zN%OBZTCdH+snHgm_L^}%JZX9P*fje=gH5-l6~VhFk3FYFP9Mcq273cytEOUSjACaF zvA3j4n`Zx6vBh@?_C8h*@tCvqia$8QuRa*3heTU_r)LjwTK(q?Hr@Kq4OXK)=S9ws zyl$xDf?#p8p^h~}+!^{Neqn@P9dKuNZLmA{y_s1r_@Tl4$0f31?1u&OS@k`9@Nw67 z(cqgKU+4A_@%dh#aDQa9r7p2YMflVO$6>$qmv<2?I)KdwVP-RrH}?|b#*W3S%^XVX2~+t;`Dz;BB^tE0>7iNWggd*F_r p6l~!o_T&loCO(aCNg7jKD!(a@?C!0PjE&zm zqBY5-fyT5YO-Tc~9(ljIwXH+1TsxLL6JX`iT5}}j@n+-m%wx`GWo2<^b#tLw-B|~w zae4IG{=0PEM&iVdosHdUWq)t0%8Yrk8*4PS)stkUR9;+pTdh=g^ykwawzk(dKCG@) zHt?5-a?Tc{4OvQ~Fc^b1MNAI1wl?FPW8lzN!^I4C-u{3)Sz$AFks2q^+CA7O(FLTJ zdd@9&FT|$;woUjt~V0%Gn^!0p%$^E=SS zTF>}1DbF9nc>C;3QDHvjcY)<2?#A}ux~SBX;d`-NQ;a){{ey)>d=6}1_HiEV8r=)m zAvRaec>B75*n1zi4{fZRe*3wII3li{$-(R}x4_s-h%r(0$Jhck<1n@eC?MI`SZ5&c z(QlpT8^o4Z%+2~P2Ts0l#CIid$N8?}i~P~NYavhmsP8(Q^P8(=d%2O}j{0tf*qEEm z8wzP}0^+&_HTiCR7Y^U?Z_quocQfXiKMgi#4DqfmQ`NUL z9yobN9WqZ{-`fP@8?_hnjlYk`eTEF8jSie}_IkjW2&#?X8IQPfU>vL?sIdU=X1-7yJ zzJxe?ls7i6)86dGZ&Y@j&iyUqm9eeuy_(_ly$_>^=j?rYiO3lj@5!sc8{dE}{>RBo GBL4wO5Mq=7 diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_024.spv b/test/fuzzers/corpora/spv/graphicsfuzz_024.spv deleted file mode 100644 index 503627f62141f71c5ee51b523fd39b3150d51484..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9256 zcmZ9S2i%wA9*6&xRHCA&%rc{-Qbbg5Q6VEFyHZp%$ll4`Wbcu^_a230oW)W%BYi7-zI&R_gSz{M0SU3~pI-7V0uJ>GP{npg_Tt5)j*ZS(|HaL6gSyWF3QR}m(gJFH%a|o=jd)E4Gajwsv z4u$o(ei*E8y?#5K>$9iZ!}?r59M-p9zXQ(o+0z|ieXbt?>szni3FrFk>CUh|*N=qt zwf-I6W#6??49|N-%R4%n+V@Xi*ECUkrghC2>d_2+T{D*2bE|81q4qj`xm~ICo<+HF z)O!0{ZalT#p4I&)P}_sLW;bfD)7Le-Q~R8C%^uWVr!O~=+V6+YS8h*gz0Xr_FKT_} z-y7Cv{(WG5=AQ)X&0qK1ms)S$a{E#1%~$W^{?z7nuAXZ$wP#Z64xrZMxlMuf`3wib z`h13iV7<>!_dl3AvmOF_oxb)wlva2Tx5{D;FngL8HNsnqto?lq0t=h2s&PCbp0 z`Hz70nSTbX&wkH@^_llbSf6>1g7ukq7HnqcD$8tY^JV5aus+|LqhWo1H;#eznRza( z&-Z2?tk36|59{+e7Qp&^j$>iH&rv--jymtZ5cXZw*EPpe=YA)^UZ<~TKapCW@54#3 zJ~NyQ>$8`qz-Duoeckus-uGg3ah$ z&;H#8 z>xVIF?d{b1%yI{;&n$Ps`pj|{Y@RzA^}gIq?K|UK?Xi^Fp62hQdtiO`^j=t>&v75D z&*!)w*5`9P0PFKP9)$Jz91p>IpQG|UOg){E=k^G!&pjT6^|{Amus-*A9M)&Ao`Buk zx!U(h>M@Mm_bFIEgi+T$O|8!?&%pZ3@+_>+EYHFE%J9_MP07pSK&GRupwKC`?8 z>od#Cus*ZA0_!u&tFS(^yat=cxq63Qr}jN^uJSFTUc%@XZaMWbMpL*qsP*~2yb0@% zW7PfLqSoj4as{kEm{Hfg-CY0wpM6&1^dsZCcc`Z^GT*zfKHul}V14F$AJ%8SFTwiE z_hne0`Mv_{Con4WSE=>ptDb(Xxo$L^tLr|XUdqVKAHw>~{B>BLnZE(+Gv7C1edhZX ztj~PkhV_~6JFpp@tIXe}_FZtUGJlWS-x+!4--q@2?*0JQXHS0!>ofC@V0~u(F|5zb zAHjMvSC)^dCo{}b?kCjx%=c4RpZR_U>od#GVSQ%#1+333zl8PKzhA*0F`TO`zoy=d zky(BN>od!5VSV=Mcd$OQ{2tb4mOsGy%<@OrJkHfw{)yW2bguIKnR+&(U%0ofBw zus$>Y71n3}{s!wa^WR~8X8s4P&$Ij#wpW?upRhi^3;%-k`Ca%otRKRtXZsJeKJ$GB z>oebfVSVQN9M)$~{TB!3cCLEb24`QLt9{#2k49zYb~t_ZZxvXdncKtq%)BbB&&(ZQ zeP-?m>$9hw;EAoWtcKHPmd>y~v#bv5Gs_yVKC^Uz_1UYguz8%TUUj3kU(Qvp)}&t6 zD&JZ-edg;9>oZ>uSfBaUhV_|m9ax{e>Iv&Jb1&G8&Q-qN)N{z!#3;8ePM`VKgZ0DW zy7ggwX4wGNXO<0NeP-DRHji_)Zy)NZt$NiLr_U@K!}|PPvI(rue4E1h%(oe=&wQK1 z`pmZlY)0oQUq5Q|^@|>CiPJZQ+X~ia=Kiog&vyW<&&*rH`pi5K)@SBzV0~sD1e@Er z$~>6*npQm>g41WdZDD=p8w%?)-!NF8S+?^UhFNOg?O}U0D%^0KK7ViQ0P8c$j<7z@ zcLc1@@4`;7et7J$Gpx^iBVm2^Y7}g4=j!`An%W*ZSI^Nz{UP_yd}DC>+;=Rj&wY1+ z_1TwQVSl&h{l?+++57RZKA(32tj~RSgY~)Z?yx?ecMsS+&egL`r2d2~x$mAheV+MV zus-+Q8`kH(`@s6#cM|O0&Q+iHrMB13RhIpz{WEL!Wq+JL^G$~JnePBtpZTW1`pkDA ztk3f}2=@0z_W58~pWnelWX1?GR^~%teLnADu=_Yy*Bws1jCJ|X^Qky}?mG?E=f2Zn zeeQb%tlyn`R!?WZ?(JN;nbh{$xyo`R^<>sHG0Gi<(`UX}us*+ovtfPqeh#e9%tyoe z%zO;2H*@Vf7oH90zVmSU+;={#&t5Hn^?ByU!us6zI9Q*(S_qrRxyo`pbw5V_ZaM+h zXTB3*eZG??!TQX1GOW*hr@;EmcPgyUe5b)?bgs_wbZXDjxypP7_4bUW=;@iTKEFq2 z!TQX6HmuLgi(q|bJ_puk=Ebl+&+=S&IXUv(I1i`K`<)N#^L`h=`s~4lu=_Yy&wCNI z|2)Yvx)`U=Gr9!U=R0&Mtj~Ox!TQX1IjqloSHSwrcO`5_=jx2EqV}AetIStZe?aCu zk0m&Lp2sz?KJ#4*>+`#H9jwpaYuCg2{JnMqytGxXZp7&`%T2I8--DZBefH%RSfBge z3hVRt-)*pYoU6XvPHk_TtG?Vp-J6l;b|GK_b4Ay7n z$6&gEmKR~Y zS!&;x;K7XC_hne0-ody=Sf5$mhRx$#eP>oudnV33)bjsAyyHBh8@=-Xh3L%ZyRg0&b#KN#{8#JM c`Fs!OTn*<&HrnxDwf{HwS)&c#?>3Du07GSqY5)KL diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_025.spv b/test/fuzzers/corpora/spv/graphicsfuzz_025.spv deleted file mode 100644 index c4e0aa359f1f5344cabd3673b23d8236581130b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7960 zcmZ{m3Ak2O6^75{GJ^<$pon@A6%}O$QDhS3f})J#EQ4GT1FvzRw5+f!t!y@%%jUGq zESt-0RPNP$H||Hx_MS~A;2Qb<&3Kvzns*QK(`MH3z&f5)$AjwF4XhvBjHhS)kUGx# zp>>?~`_ysP4{OFVn(Nzn&#Kyrx%Y7Vrd^kqVnY2Jv3N&UPxrQ6JGXW-g?_y62uU9C ze)vTV+@GkbwrpF!WXHxWi@UpbY$l{;Ks6G-tEX#QS5ME1T|3up+_81zrfpr#Ge?nI z-PN=9sw=vvwTr4+-?@Cr`ir}_b?>OErEvD;Gok6KPEL|@)}5@dpTqX#n(_EOaeK9Y zfkzj3%pTmg(Yv#B9`0!$hwRC>R|nL1B&Qw-9?y!gc=7&JAB69~xCZ#X)i}J`%1^5E z2ZL=oabtfDN_?pKg-^yE#=D=4o9{GmPkr;9hwq8&`Lt!f!(GpbiH~T;9f^-@#tRcq zY{u1S-t8!G2R4S@kH#C*Ix}g`Ue5PCrsmaSZXK(Kwa#S{z60~|9OGjfQFHxqU~Aof z6lgL&{Y(M7Z`Mr(Pshfw&osPi;4GcAvzHz$=URWbo!9UJSmnh))6EP{gN#4=ds&;G2uM6Fi}a zmx8@hIe!`W<by>|IFybg=g!@p7mOqF z-ltWVkNMSj^ZI$@-E$4*9*a0beb-_mFwaqc>%7NjVdgHc*R89$+nLB@@Y$Gq$v;eA z=iq%Fqu$)Pn4IT}?Z^I%<%ibq=)VVTnD=oCmOjq|+h^*|2V3VoweC9l@O>`8tTlga z&0Pp~Uvt^-BCz}2TKB&mY@NLQZ@~N5zqyUr2F!lN*=G~D>}xb}*?;=F7~Wd*S?llH zwcYiMyTEdb=*e&7C75^7wQ6l_jkDW;w-0zeifWGyD@qDa{eRnyRqc20h{-6U-f@3CZGHGJh1ms-d_AJT#L!4=J{Z2 z>^U_r0Lx!PFRr-`lXGp>T@TJW`!lxAnP(>Y%;1G!XOg@ABCuR}*X3OAU2>-StbZ}s z^||XefahZB70W$&37qxTsFksIHFrVpdw36DinZRum(_gk;me8T(#tErgR$J7SAx}P z8D=hhybA1E^WL8u@jmus?$y{$nC~jSA6^|_gZWOG^=rY-T0R=R4lJL42VM^zfw`{y zO}&BG-1W7VZv?wmKK;K5Z2#W>DOk>ZGuU&@=iIk|<#X=M;GFCIP2F3;=5p@az^;{F z$@gkD{_U9kn44Fdcd0MfoOi*QIUnZ~&E5fS)$E;c^3m*FV7c6vcZ26+xhwkU^d7MF z)~M4hcpr5#cPsW@%s#}K+X3L{z5txLy$|f%%x50Af#ox|_k%OHQm@ElkYeERq>IDM4*eFWZI`uHf=wer#LV_^F;*Q%d6 z^>dca&G|*YkAqwF`vjbP^!p@OF8X~6yb$Y6zfZ$kZ;krhh4)cEbDzQP#_U6!Ier%0 zAIls+2hJSLWsaW*J4f@G;}^j4nd2A1nPaKvm*CB1j$a15Rz7{)10H~-k9)!P;rGN` z`nV5lALi4?SHSY=<9=}ZDE0g*yt(x8HLz>tqvzMb_GhkDPjl+&Y@OrX_~`i!aI2o* zgp-e+-vY};&u@blVZG`39eC@lQP1z6 zqxsD7$6)!)@h9NSvDEXY@a8hdpMhN~pFVyL9)zWj2f+4m8fGqi`~qwr4`Auzmtgty z@hfopDE0g`yt(x88?bBTqvvnI_GhkDPjl+&Y@MU?jGn&(x9a(OIQi)L2e4f9{3G~e ztT#RX1aG}H>iHnvM?KB`8T$)nAL7jMui(L0=J+>o=4dW+{5#k=n$H~n0hZ4k{|U|< zOFjPuZ!UBEH`ulE>Ej{r5G;K>47QJDn7Q=v2-rT%r;kU$^6BF-aQZ0q{13dj^zk^@ zwer#P39$W{Yt_@7dOBO@=sct6f5EMK{tr$*dip|g(X)+sF>!Bt_VML0Yt*ydm`6R$ z^~L&O_94z3`-6v4mpKj~=5J$;<}$~DVCQH)a~uSg&m0GXGsjZTA@Jrh$Dv@?%BPQg z!21+^3?t@m{|KgISOol=34bMr=HH% zIXchixj(p7&(U!5(Q^z~E_xmSK81JbP0s_#S#OPcj>Y?^r@4c$ahQFGGslC$!>Eg% zhY<6(F-LQmZXg+i70Ly2Nc^K^F3Fd9w*w`zDSoP0Dq4lI}V zoD5#l@}BuW>=bg=Tcd_k@jhy3ZW=Znvk!6hoB{5nuD99EBcB$Jucyl>>KG?PL(QN_Pp3JrC zW=`Flq4RQX(QP5PRkuZO^3m;N>#@A&VzB>KlrxTQr;xMW8g)Ar@1t(!mSCNjeTcK? zQt*80$~|-EmyvUJ)?{|4f#oy1)4`ctsoQdRbD7;4VAsm$>@(%|a`p;xo^4IeUI~`Z z*{i@gyVPwpyt$mc2JBk-=(ZMYPv%;6GpBCO(0Mtx=yn#kRkw9;^3m;Vuw35r9Pr+B zJC~gG)~MTgcpr5$cRqFjW*_40c_H|8>Uz`dB67~on#^uJSU$7c0M6`6-8RCT%j`CR zT`QlnF9t8)%h{XBdA2n{7Qa@aA&%rC`^}N4KqDdotImn>lrJhR(~m zJzljnuw1FB+Lpgff1}1@@vhYyx7V@W_(9&yyxutf@6{XMRp<4_x74xT_{KWcKS6JE Gu>S*~z@Od# diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_026.spv b/test/fuzzers/corpora/spv/graphicsfuzz_026.spv deleted file mode 100644 index c5b3cedd33b9fc5f5b160c17432a9fc01c6e2e1e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9680 zcmZ9Q2Y^<^6@?$LOA!!|W>|zqr zj4i#H-V@V%Ppnb%eeZu4hBxl@o^$SX45$n@-h4 z)BI{;)#S`wxr&O_IfiEIYFldc9dp%LW?4hs`j*9;*VUb$=#JG?zhPqpsPTiUp;Zdh|mQ|sE6QPdb!KeqBWc6$BT>Et;d=h#9nF6W)`QNNney1?rJF z`TgMgDz`P&H8(c2w$wLrGk8v?ROB2_1^XVm@6+(R*U%yJy}Y1^9Z`zSfH${p%KOa( z?|zS}vRQCywl?JNRaG_{o{l>Q?xo`S^p0A+aLIzz#Q{{Ao8&KodoM)`?mc7+?)_t1 z$ojlDY+~;Qo7g+SCiXtCiM!w28eNY~uG-V2&?J z@WlzfB*B*^cuRt}Cit>lxQYsXm-yY``&Yf|o*A+$r$es!PA=sAoq`{{D^}s@o_Lqo zoV$04O?-I;=GZ&MrhY{Q=J?74UzOmi6MRjAuTAiE3BEqTHzfGR1mBe4n|I-={0*-LCt6JQG7>CeR{!r7n<=0 z3LMY!!Gb$R%;O=jXV(0O@jeIFYTPyMz_M)1tl*F2ylr;yM{~Y=yvN|~yK(3LcoKKK zCvyJEuKrKv{P}!*=lK-oT^8d%oyWK2`Nnr*t~uh*1B zA64R`OZ@N>A5-FEOMG03k1z2FB|b6Xo|{Pt_gCu9)V`)&^BGk8}n?+#hy#=jF{io zz+EtNj79&mz-he(xLR6IE%G-N`PT5P%f&tO4dV=VgnZI#w*gsY|X)FS`v zBHtRmJ96=G{6kpO`v%y0<`|3q=YZ3CO>nieo?7HL7x~s00hWtL;=N;|-Z#P4Gsjr; zZvm(ETH$JGJ+;U`x5&4K@3vg*d+i+_^zQLL`d-jyZmex~?{ELcwYm5QQ#ojwRv8eZLu=UI_7X2>uj&k?WxISv#2=@8M zT5kfYMJ;1$_J0*`fA`V;p4q=*p3~re1AES5{F`%}@!$59{J+E1t}M>{Kfv};-&$z@ z1Us%V|L?bT{)M%}dSJ$V4s-D8QTyLuHDhz}a?jE|`2S#gW9lo4I{z(n+%E04LbF!n zyqaoQS^-HXeH?zdwopuZXwd?JqZ8o@*C0+Z~v5wf0^K?h1CU@8ILx zeIKy3fR0V4wz#*mN@z@Ky$sp7lIvo4(IX#d=$s68MD4P##u~GTCWQ+>#4iXk#`i>*p6b2dx6#5U+Z;++pK4-8`d4O zo;b!inw<36ErI*&V!eBlYkl+LoT-@?V;lpn^r?L7_bB?Pn^TSNiKgy;dsgJpe<|E& zZp?EdkKguQxE{=U!h=zlys_Rx1*9(#Bo zdG4WojKz2Z(bZxP4}v>SYg$8YPVAv;k9sGNlkQs<-dm&KHs@+=G^XZU#WBul zzn5(HVxH%_@qT|f#w7Z9p4Ilp;yinP4@mgK-~kCYeqh0!pScfV@y)*$?0cjh-;9%~ zrEb2p?TgF`gE`{`}>Wlb_AHe{N6JjW6S_Q ziXImFOmxQ%>&91{Is&8Yx+wpVY zY7aAK*FP7m=G>e|d@s*K<1hbB%yU?`do>@?IXsTVGdmJZJ-*2ofYltsGikqt;OOVv z<>ontYhF~uJxAg=N6xV)X4{6vIqC)W94#g{?!|#<={Y*6#A^y3^FE5cjuZ1f8m{&P znsYR!7Wqqx{AXFyc4EiC)t&_VelG>ve7}t?!_=Io*fE{sQ&{X-9oRink3CyXuDZ`c zY=6gzd8`0Cx0uJVaJ8q=oX1MA&3PDGg{e7?*m2!&xq6Iy9N2N4r_XLD7V}&WcAn}n z&*RBgk9nK`cMNssaU$O4JdB-$saaR-JUnx9b?er^(=)vRZe8`LdosD|TiFNC$0_h< L@am2!_x$`H=G@Je diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_027.spv b/test/fuzzers/corpora/spv/graphicsfuzz_027.spv deleted file mode 100644 index 626e606f002804b8459eb902127e22989e9c9240..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9432 zcmZ{o2fUY68OQ%{FNg>Tf`EbuA}$a`0SAIyrXVWAfubOL2wY{jP2Afu&9bblEZb$; zv|-yy%N#8mmbRCbd-nal_x<7d+|P%@`+T0?GtW8CbKdj*FHIeXZr5mZXmsJ<^&J}3 z=+)?mrqS4;(YfN&XU&^6a^t3DBS()pP=_9krpiyB9UI#h z05w&)CKA*MYw54t37=()H!X%$_RjE4%h#P5*&ItYuc+qlOh#qL>h)`uFWt1db^W|^ zR&QFmir6N0(l$D=e%G>c?V@QL7O$M#+PYzx7U$a@PQFpfo%yHi*sy$K>)OpG)UT=0 zwM`8+s?k_9eb%%^OIz2rZfG>7V|U#Sv1@i5g*NLO+NP@P>fHBqGP%Y*w%Xd{AzS4p zYTq`@+pWOe3*2KXZpO=g*^jpQv!8N)b(!CNmGdh*Kkcd3Y95F4_iTd|?p5HO3f#NE zeG0sDf%_J?-&WjQ)pgKTxv9~=z`GQ9*8&eH@W2A^R^T${?uCAEfyV-hIPt{?r@j->p!37>&;4uXr zTi`=#+?&&KD0m3D4}*($rdx-@2Sc8f!N}v_o^AERYx@yk?S05G9&X$O_+ZGPpYoBA zXKx_#M7TNBC68x8d*l|dBl0A$=Q{Faa7U;wYn}oh4D}=TRJgLXLD*ccI@dp~)~g#= z%f6rbn%8wshaCDJ1=nW2%sT_zT*x!QzLT*Z4Ss_Wc^2~Pg?tS1YlVC)@~ee>9P%s3 z?qxRExy|1nc@A7%=F>J8YBaV?bUx*ImHg&@jz{hQ#ePDY{m95CR`MP9M?MMpp$BJ8 zP_{?&A@9D}PX;sJ*7#E@xzXZ!7l2(uGi3cvg*&%;>#gkC)!7^SnckcRw$|$ORrWln zGuOfz$A1yBd7Lk6Jsmu#kQakJpRq3iyWYr4!ROYpd6q$q#`#lXUygJu6nO>s-a=jp zex#6BfuAYl)nLCBiC+Wm!J;Fdf$Ujye{12^Cbd$wj_S0pgX=pH8bL>_1D~#j{g9$- z1-lPvEPlSr*3jX*{UXwtaBFN%*Js|yoocxSi|79=$aka#nhuR8ZVG$@q-{O2=frQ4 zx|hhm5$-(l=g6*o1f-91cY`)T&l9`3#;_{(Y`C%V7ufwd8W^wecAF!zeWR3(^C0(k zK4h&ffUMhvkbAiZa*uC;+~>uR``H3{)-HjZPu@brIQXTIvCcPvtjfNZ?#=o2-vW>S zW#H0Z+4s8ici#A4-p*gyd!h7qz45=Ioxk#|cK+@&{#Um1SN2{i^IMm1nl|xBv0KuART~jCTI^Z3|uUEPDRz zZPx5rw5RgB@fi=l9@4Kr^fD((+4Jmq)mQF*Z>VK?&iejf>!(i-=td}c-wM`lUeEvA z;MyI|qg`3O^N6$0o4}qk<9!d^OLs_peBKWByzArHRn{ka?@`;b_ZyI%$NAjP&9yAg zenx`z*JpR=7U-V3PVWF~p9Hxd?@R3t_oMxtkb374JI}jnS)O?g09!YG212(%soT53 z+B464YCEi&NBixNdgl>m&%1z)b)A>iXJA*bdiQmCts4OLT*gK+0?*e~rLg4DZian9DAV9%fP5eh%EJ)~BcYBCC(jJz(o^K6|RHPgxh&rhG5l zI?7XvF<{>%eTGAyhqCW4fVKPHxW_NTwL9FSc4hVE6=z*v0=q8bv-bVK>f`feu=~@; zwJYnBnz$Zq)}&m&^C{m3cV4-&cc`*=pYkoWEYIEMy*(N7Zqw&xxG}fF^IPvL;4YQi zXdDlB{ZrugLE7?L@2j=0wYGl^S>0@QJ{$gZXf8Al(&im$o^L=MAoq3xv2}o(+~K>Y?bpz6Am@@N z?zdp$7DLAU4(>2c+mq1mA>-tU`vcgxC6IAX!5zkFdm8#9WSl&4e*zn~6f*A5aEEc) z{sR3KGESbjzk!Wg4jK1%xWhPY|A77p87EKNzre<=fQo@+U$Aj2 zA>;lBcNnMbS?D>)ICRy z`Q)#1(!}cX4!jQb4CWjHt1~qY{szza_AUz_n$!Oi->yF=Qe?^Nr%);@WEI@fw*-NPJmyN>P98{^2@y41ei&}onF z_O-9>d560q=%dZJ%(nxWr&_B%@$UxSfIifX8{Yf2d+k3G>{^Z2H*@>{6!E#DUi*&d zoLAf2x-LDz>Qe{r0q+I-Y2V*qRbtOddfN+sYa#)wk#FNp=0dX?N^kpu)u*?;!Rk`K zKFB;(Z?&bjJA<`J>1|)I^J_ES{`3R$R5`Ur-@n$|TYWPBE|rhJ(VJN#zqygsdDaKO z9iDad1EJj@Yaq{>2Z4F2-&@{&*3DS`jLH4EJJ>Tj9kL#tp~2|XC)W@#5C8YtW-D`< z)89PC?E%);{Lb%s((j?*?AKc9zb88N#--oG!0O{$_S^d*{q{~tzxTp_Tm9Y}oBf^- zrQhyDed@grSY7tJFEUS67j5bHeqe1<`aK-%{Mypj5n!I`UDh7`{yz4y1Z#6- z4F}Y|u1kA-53GH4kMF43w+}k)e#@=zL16P}Pt6Yo>!U3-9}QNY^_4aEE>F$9|5NiZ z_;0J`W3gHD8Bl888>~JxKLo5UdpH!Cr>eQO)ci28HYqhf9PIqsQrmH0o~q{Bqd%h7 zTXTI<$MN9U@^`oOI~p1R=btJOymOk0X#MxzjxjYFi-WjkM{N8Rw#X$S=;@F>KpyhwcdW|lY43wxcxnK3_A6> zCyxcI^PW5o?(m*eKO33@dH>0?&$(cp>Tj{!lg8?2O#J2*e$HX9;wR4?csy8NW6kYc zIddm~-Jc`p;zVTi#^qd`1Xds4@?7{EF#UfToc_RiCb2?a?BWqY(`}RktJ^CfJ z-gognDDUG^^u}oS+$_Yl4BQ3Y0=ak3=5loEQ@a)52hdBvigJ!uqEI&qa(%|?pLMSS z>*L5eRwKI>ZRztGuzS#!KA!hn5m_W1}XeeMZXpFXb# zt4l3gk$I{lVcrpcJ6r+wK1>a+L{_K2qpZOb$f?2Owe3;3cj#mA=lIh5-d#nkd90H) zeG=|F;63J@=RG1ufu#!L$wX*O<(ku-t)GPxu3#=$H+BZTrG2|_lY!55T_I<%NTeZEu zHGQZ*fKz{_X`5y`j+f_h?qRx_Ywq(pujSs(=cT-?aekJake$fi583Rf&B|c1Y(Z98 znmanXJDbKQ`kU5oxWJ6+th|(HPE9sHo5x&+?d=^NHDFY3AxNGDK;@-gTPUg^n&#_Q zkh5!Yu++bj3Vp}$=$?VTiQ(dC_rBqYzTNQU>}qyYfLv>6q^EtXcW7I&IM#2(ey&Ns z3-v4c(|3#wj2A~HZD?LOr=A@ZrK&9J>F8|l=_`&D$FgiYTnECcUmDygdZ`^qi zHaIx=OZav8SvJ)c^@~e>meoGF$7}?Ry%tYskBAeeYS$GkTwK#?!&>LC#!# z?^Mp-XE58_`q;!&}3jeUB}rGuUf6c5J5exL?3;ZfANAjX1|o0QcV~w@H9@KVa^K9bK^4(zf7+UTH%h}7jwvRQ|hL(4M)0#efxw$pghL-!m_I7Ra?H5`e0Nc-; z(DESId-MH5%jShPhrqtIZ_t?VyTR6mg=UB0?5Ad}U5S|+Z@dR=jw85xz)=_6NY0fp zhi3PJtvBCzs##;HX4O|{b`-3B{1!vAMX>q|&E5-E$MV752bQ-1YcORjF`@!<5j`!hvf7O`r(B}i-|I_h<@WvwVp(HQW@x$=OLdTDQ zt(Es|k1{(vo3Y2R$1%?)4joT{-D8|#KUmIQ-oJgUu{L!41URjE5?^j^jkTfUr@;1h zZS(CHIz9llpE;r9r@`J^s$=uwf88^AT#fq0%knrpT%E=sr{6H4&SxHLif+Z zxxTu$r}gHBCSCxW;|T6WaMT6&QqHBie;Lkt^NrVG@mp;y)xCQBIsYAg1+3mu-M@-I ziiO5s1FLcQ;9dvITdy|WV0NetV{c+|zOy*?{uX$y?%#%!cORjdcfj(g?x*p+zZ%SV z==l)1GUscV zJ^{MKU>}(VEAMQU#s{jB1 diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_029.spv b/test/fuzzers/corpora/spv/graphicsfuzz_029.spv deleted file mode 100644 index 18e49a5ad4967f0bcf2762075ac73e6079522a81..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2404 zcmYk6YjadZ5QZn&UBX4>l7tXIIUxcfA*ftLBam>(0tOO5bKwS>7Jg`JB{AazLa{>Mt%#aT-#GGOiEkQhOFB&w`Rsy zRu{)loczp)4^krs8nZR^r6#%;`Dx+#3mtmpwt?g+0BYo1lWc0?t;cJ(hXYvkO^ot2C?;(MO=H_|5bj}_jGUhTXjrbSQ0 zyjbkKT=-$Bll@jtX}&!(J^!@3)Ll-g4P$*{w<2vUbGyXvl`v!Lxa8k2VaC>UnM=Gs zTkq_Vb-TfRmdhO0bBVW=FyrktyrYKuYj~iB2Wxm|4G-1ut{NV$;oa-FneXPK%I@c@ z?E#N)w!LWaPVk550vRIOSZ%*=fxQpy_m|gSp!Iv_`bW?`8K*Q++1|a}5o}}2yIY$u zeiYk$WzA;#xUvg$#2)~=#)vG?2NAit43g^*T!EDJo9Pplz>?OfO=vYpoLlcoQk@SiIEufqPa^uHQo+Rc9&F{gRltJZd(w%R@R_Z8ZEbf5Ou zXz#2*>{r|GFXv25pgptpDgL9*mGk3r&i=#t2JK$wsfCzddlc=P5O&N%*nU(0yLH=p z3){2$Ki57(z9Q@LEVHoA?b(VugLd^Ge{l+Z=MeqQ=vg}OY$eyo=L+8Z&Y>}$$GLh< zUz2G2Q~yi-DfD^7rT+q2zuNO1Li_%h<8P`tgBL5#*?dEc_9etz?iE|tzN7ARxkd}PxfffBF4x^Uf)g69C>{^AT2=cwiR zZz0yx_glq%2evPLci;;2ZN%R7#hLoS_WB1g_Bw#bd5;k@2=?4-Rg7=Aaq@mkXV(AZ z6n_5$-y?FyMIU!6-dQcccM;DcZ%l!{hx8%#pnV^aGuAr#+OKM%m3d6q1`D-RJl#nprK uA~)#QnR$d5;|lIESkBns<}1#4 diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_030.spv b/test/fuzzers/corpora/spv/graphicsfuzz_030.spv deleted file mode 100644 index ac4ea364a14117695fbd235c98735bdb1c29f8d8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2568 zcmZvdd2f_e6o)SzrYvPIEiMQ%ttd+^i>y|l73iQ;QC3&VbfJzJI%a5%@h|=$(Zs|L zV&doU8@Z4`e4cmiF>jjQ$;mnAch-CEz3)`|MmMFjA#LXOUFxmfsShNjfz)5{#?0-R z@h2+_}1RcsfMI0cX@MXpJLs#weZRgfw^^PP6P zx$@KD*2xL<3e{8k0n*2w!RiQVof=p z8iM4~UW3X*v50*dbZ=GeA>%#KB|aW zYde|a#MjzRWo$j$yV$I;-X2b8JnZFO&g8iDY-iWxE61J7an=(r+s@~>z{|D^CI7IG zrNQEi-^1p)c^=N)`8r4E9g8No{hnpee)%^wxtkM0hh22_y*VHfKZ;i{4cl#!&Z)_40lU%-w zDf;joPC>p+zc0q?{{bZa3qI;sph-yl5}EB!Ec~w`i~W}UuOW;1rnm7eH^($&UH!C2 z9&vjafj1!Sb;#Vl@9U8GGP?8qFk{b%QU54oqwvUc1KB)&10v51vUueA7+LIT&hrVf zxy0?wnTr{3otu!DHs`N?A;*4-T!qAc&Ddwi;@%5mJR|R$J$fH*L1Ow@!*jb0iR-^H z>o1tvdB}TXAJ%d0fzILQ{pg3hLwDeDXS@%Rx#XVjzxdpR>ns0@D)->`A(!^g;o9Y~ z_b-sG@dwq1;9o*w{s%oLhx%8Lxr|kg*sqa|{WJIf4YHWAzvp}pkj2IRrr%k(%iP)? zLQTlr%8`2x+1zm#=8=aX@i^B7WN~vl3;o61t98t2?#Q`_tk2K6-$%$|{*OkySUKK2 m5x<1&yrcfN$YN1no0##=-THF%I2-2}`C7=vyu_~TUHA_lFPC@# diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_031.spv b/test/fuzzers/corpora/spv/graphicsfuzz_031.spv deleted file mode 100644 index 2f8eff690e5c25e5253550b684c718ff89f405ff..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6084 zcmZvg2b7k@6^4Iy=|wt3Kv~3sqNqqmng|Puf?`Q*xKvjc7MBIV0xO7O#eyIxB1IGd z1rfwx0W{H6O=4nVVl;`yn3!nnkcfGnf4@1oXOrLaGVgO|zB@B_=KIcB3ky2e%jIh2 z>hoWdTDknMd9Hv+F4rhmH{TYI8at}njLM1Kdh|TO0SDy@^Wz-TG*>TIo3;Q=Eh(L5 zhrPy{;fyl@t}vf#Fb~zCH;%7Eqz+>$D@rCz>N2aedw<6iGJ7sJy?jQ#*BqtOCQh1N zGQMmQ-Y4q+PpmN4z-O}lhX1F(k^T9cb(tZTn^HDzcty#Sq2=Wj6G5`p&NZeTKXY<^ zuXS04?5|?djPkOXm8IqE()Bf|4(Fda2w!Sqey+{^k1HNEeB6Zcvhs@RyiJKsFR3V* zN?Xhb=XX8ENAOIVr!(xYm=VUTmE)c7Fyt?Br)tcza~_&;OP*?m??jH~wEEWMXhBDE9j8L&2xxxeko6WUySR(a~+BMtg)1*2ygKdcfv0WY~7Xyw#MrMACBJ= z_z3*Yz(?Yr4}27Uci=Ag7XlxR-xc^6{Pw_I@tXo4i(eb~IQ;U!-SCS8ACJE=u$Ogi z;1lt)19!()20jU25x56_X5gOqIe~lO=LPPKzddjt{F1G-1x3tWZ2HSqO#mFn%g=N=L}x9@yn z*VZraLi~w=tG~7X9q-=!=BMWu;g1gNUGkfr`rX?}fnDo>z_;N?2KL)(jnngY;5P?e zjQ?)nJMmS4y<6VN^t|61-{Hj8_N>55@P2brzwgGVz)SJI)2V+M-ghFgXW=`XcsYJ- z;1&3Rfj!Iafgivh8F(eWU10B4v%stH^#ebIF9^IE?=P)q4Ze2ZwfIJX*Wp_Sei+{= z@Ou0SfgiyS4*V$IGf4AozZe|X>>_!fbm#y1JP6W=tj-|9Ajy{komcj1o-4 zbZoA$R!7?BP!aMB4nv)h>p22>PmV%eknh|vs4Mb)GiNvCUOX?~Vegsmp6Y>mqF%@` zy-^?37xhE^k$GH;@27V*fEJ<~(M@O(x*6Sq zZbi4Dp~!Q*9eEF|hxNPzxz5GNn%TUAP4>scnWPt z?q>&j8o7S86Fr0cKI}rzB5P>9{G0K4+IpyC#xG>tn$~Zb?QX;k9FllXo~s6>Z{1$F z7E1ju=KFom>*c>uFTuu=eBQr}zej8S0_0l0PwQHY%P-TKw+-r_abXraH2d2u!Wx zyWEQQpc>pX;{o(L$4`*+jpixW^wTV6+@Jd%!o05gRpee)BcFHtYsmN_#>hWI<}f~x z%&y0nIXu&!BV&gkb6EFZAma-eBfp--tjjdUw4nWE7EgJ81)Jw!l=8fRH=gqR8gDG- z`3-D*40E-leG{46xa+lE#>{E|Z;>(ktexDKXRY1uP#t94e$UC+*Ho41MXi?yfSPhR;wWPbDMQ@%gr&6m#BeD5RUY0O{nHRt?*m~m_9 zexE~W{9p0L9OIdo^KZy_6>F3~%wm3Hwr1=8JKnkN`;xr>p!Me-?E45Aa}WA7-^cix zd-x|Y<7vz%*_c?jPl*|K51w1x!)LHD$D}=cjyFC(+rt-lWA0&dwudkA&TXG(nAU6i zIaTp|zC!NDb8x(SaliX${kdPq>_^7juRiVNU-+8){Wme=Y0THzn7H2q#EiRN?_u2U zH?T3sr2YCKF`o8Y3w9pk<*czawg7LuF)NY_Wm?}W`xa0ae#T>{tM6GP-yUKIsGV_ZXf0EH8WO8{ryCJ7p6+O4ys^DJ am#-P#nCJQqF>~6+ciDH$IbWjnd-5NcAsWX3 diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_032.spv b/test/fuzzers/corpora/spv/graphicsfuzz_032.spv deleted file mode 100644 index a5808ecf657854d05b9d94cea714b267fc2f897c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11380 zcmZ|U2ej4Il?Lz&53qo}ckCT2cJX2X3krxWQG;|)rWmVpZT{f9^@aF2(qzk#f^&=tX?*}V$SW$Rxel@{ZM8#GR6j}wPg9+ zX)EU~Id6D)-%K?pkVuN4ai=n2ML%p`=hcy0&Hu$gxAKu_28hm7fk81GI z4L+v9$2NFUgO6+Q;1Wc(7lQ-b;S(F5lNx+-gC{rmlm?&L;L{p>dV|ks@Rh;6QyYA4gU@U5`3=6H!P6Q%y}=hY_@V}1+~7+ZJfp#vHu$mz&us9l2G4Hr zf~2-a#-)^*vWH4-iCc6-w-Z_Zerwl;ocZJ{`maR$lEaTwyDW?LAbi!yE8l4dq-EX z3xkcSy(rk+#4ir#YyM?l5^Plb(qR6(#&cPtzcF|yqz5;J%VCc4E)N$&Z(d}+bnG{G zxawMCp8HMnrXLP1Ui_me$7FTZdrPOIH#a`FhI+ln`Zd>lBn;l~l2=9kRYu9HBkOy~ zw*~86$*&I9`;u=D9^c5X3HDx>{f=P$F8Q^=-s6(*4E7F}d{?l~h?4IP_U@K^Pw;-B z{nIV;sC|B2uzjM_PqI9<&w6ohD1V6v; z_deD-$==RZ_O7K0^wzq}e9ufynP29ZjcZAHjADWUl zvb$maa_|>db>11=54or6yer&Lhwa^=_k_g3Rp-6IZ5^^Zt&SZ0#Z{g61@}YdqRu1X zhB|DIhTb0%2UndB1h;j_?wvYv@E2Eg9t-Y=%tf6Kh8yZU7XG2oheP7vs`HWHwhq~S zR!0v0;;PO^gZrWRA$2|$Zm7fd@z5ti;^36pQ**l?*9Q?&qoyUXwA!}CWiEu+5 zwoiqg42grQ&ZmRhI%MyUI&$zAS9P8W?uWcd>U<{LP>1d5&}T#9;HvXXa9fA$9aBdR z{^F|6=Ysnoy;bM);f6YFUkH6MBo3}R&jz=3$ajX+k%Paus`I7be(0`{I?sh0>acw| z^p%h}xaxd0xUECJJEV>r{KZwBuLbu*D?{phJ={=-?HeIFad6f7W^h}Fd{0Q7^2gh{ z>bL8)ZgTY*C)fVs;B^8dN**gH_UqQd-LvGAMWkzhrAaFy) zot<9X6#lJ{&xo0MJFg4>cBi8^Mun#46LE3)cS2i-7KWCD8u<>OOx{L5hV*lLb?MsKdh+N?)SeO7DffRCK7zY4B? zw&&}wqi0)@^CosNNn|}X8$a>g*6k=2FA3Gd2$oo&>>fp7f{~RpdsQ&&-@TgFo0Y1aYXAl21WKCHocZ#E;%dLPlDxY_xh)i=_}XIg5`3S+1gxk+8h1) zc}QJz6{C)Kf$gP`-twuQ*gtx`G3s2}b7#Q0RLdTlH(uxM7s32ChV+Z<3^@mUak0Pb zWW3JTdBH0}e0B`|f2hvauY%2s&7#?yuTdSQmUnbyb?`b1L&4&WI$vX=%g?6s#i!2G z*kE?&sm|QE$ktUpTSewaUv;()Rwr!JncF4;J^$+Ow!!pu<|^m-PH!%ccIR+HFuilQ zUAUpI^xKDa2w5*&Z`O{%`RQF8GG~1e%a4Eg?bP^fznLHZ+LxV!`|b`7=`KDBnv^m<^_*|OjEzs{EZHDA2W)^3U6w=tv#Waq~j;EP-9?wyR+ z8qSZO+Zv)?mv8mdI&0n4!vo_-zcJ+g92D7l4LxNi z)9Wejyy(-x!TA~dPC-p)@(_xQmx7ms9~xO4J|X{t5qDTHw-Z9QbR^f*?%g~**jv}W zn@2=P|4{c%9T`k_Yy9f7?x@K0=5chm@lt+cL0|GQ!A!^IuhHR?!qqx1d`$T9;pWS) z`hG&NIUBX-Cq|~)JH+m+Tc0=dq|P=em>>Iau(N0$@~dC@PY$kLR{qJ+!dUW|2)MszkcSdJZiy!;uwe+#_pBen} zd`I4iv!ct-AU}J%zOy_3m^bxwO6RYpSU#KA)Y})c-}WHCcp3a|#<{Z}_EV4a-TbXz zPV*GwGrk|ZE?ms|a51vu%w2HSgfHrzX8p63OdtGV+N zH!JsRZEWWUvlrE8^aatq5c>n6XLBFSeOh$x1Dm-`4>!z>?ZVJSA@yP3A8v^K;^5=M z{jSA*B)f<6f-mW8^Mm>O_vE&nUX2;C8+F$&jVwQIy_a<|UhnRV_^%A{xg>mMWApj6 zu(Ms%*`DdvH!FVZ;=NO|Ba1bxk^S-zy*a@3-EQajRP6o9XC1qQ=vRbly>k+y2W+)o z|1P7i@5@&N)9HgATp8Ig2ezw1bmjo-L(Pf4^7=QLyia%QyE>Sz@?I0!keBThp;w0F zg==lQ$H#o@b5a~1zV+_!u>~K#wJ-KUZ{_AMzHIhF9X5Srvo8Ht3vc(^dMoy{_-_a~ z1LmnGY|iYp!R{NId&Q=w*M%F_&c`{UQwvv%j*M5W(-Whf`m4hE)@Q@@!7oI2PjcG- zS4F0KqU-$s&ad9W(wZ>WTcYpZI3}4dNE{m)d+oheY?$6Tb*u}d)%OZ<4tdaf35WP9Tb;kCL zPsP^#*(*Bw_Wsc$H%DYcuIs|svnqI9XLEnp^mKK&VeNdJGdi_!wdlxr)jBgV>Z$Mk z@U8oETk!MI)%|&OWV)xi`*VA+czXHkuHZG_*95yu?ks<`&G(LQ!+iO?Hgspm{NTE4 zcLmp7J1PF;Iu8>f`@E9x?r@{-)jg5r!p-efkN-@U4BZ7kVo^-_~2PXT{&Wat6#(PuSe6HwL>`Z0;4C zo<0twvF z`osRN5WP9Tbv6!(PsP@`KQub}_T0ZaF?zsO>pd)(zRvx7g6Z@@58fNuFbB5xh3L!y z)`yxCedRqoG4j^Ae7JGx6b{MTkzpq`(iKj zR&M^{%VsasVbe!8>(YO<@OHngw_>Nn-??`N%u`R;ocqUu*LAk_olQ?a7`86{0r> zxX$KL@u}FlcSlD@-`=~=B*yyK>V6y(Okelz>0r90AwBqPWWyZTo(a*J1FR16gL{Yv<#f(W!;2MMuV~ z)~Sh6Pkr}}Z|&Q2!R+*Ed^xhA2HRIcbaKLVFX-xCel>XWd%32&gI|k{9n~HDdgsq( zw0E%X8E*dW>^Fkl+dD#H)t;UF*T(kEV0NQ)-|BSKrTccL8+kLf8vOt5ccK%|pZ$CB T_j`{q;cUO`jmr1OQN3RS7h~%J diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_033.spv b/test/fuzzers/corpora/spv/graphicsfuzz_033.spv deleted file mode 100644 index 98cf02e296b9b68dcc53f5865baa83f33a4cecb4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7180 zcmZA32iTTn6$kK_jiT(OtnUL68RBA@DIa1WN*UT-h@wORpE2442WeW_-h*~(X0*$O zP1}3h-g~>V`u|>@!}VO;dam<7|8wqhpL6c}c|QgXoHeY|8PFM?|4tsz>8>%IfnhqG z5uKr3y?X6=YZva=xpCp5#m5U6*%{Q06EmtatTQ-zU}Wot&D%J5aifFqIUs0IH&q!Cc3s>(cWC0+*7l2b^l#a7^01gVo!s#99MSMov+u}YdvLXHO0c>Yq&sy@ji{Z>%^c*K7O8l5 zpzg9~1dA=ZC)j-EHG6wozL~-9N)O(FdAk=gWxE@kTzWn#(&_A8z98L-n;pTmrDBf` zZ&mD^U|fkk&OIjD?98HSp4;_xI!iJG_36*@w(g2GFItVY*ZwHKKx-eC8&AR?YV zHSuabHln98u>{sMmZ{)a$cV(XTi$6YszbY~86C!fp*M&2u6C-$QPs5!Q zjQ4J~C6{|&6v5ZN#liNeq4q5a#<%w^jg7xMy)BE@BYk^%lK13@n)Q9Z$SIM1sl(g3 ze}v!ryd!m-8qIIr6Purnmlrk4vU!7(z-&v8q zh;?H#tFwdg&hft1MqB2@_rM5Fe)zH`*MoxX^KDlCbAtOK?)Hi%?!m!$-)z;kF4%s) zn)|uI=FaCGs`tDI{`#iYhcuj8&ARHMYn~4cR<~J*SMzmw;qpB!!fz&WRNW5`?u)3q z=JJSOyf|}tWVB^2e2RnRCU^&M?c1B4V5?-v0Xj zE)LdPPsF*KqAln0JwAeSE?nns4z4#ajtm#Yj!(>_1hD1 z?yhLdxqMHK;G7HBxlai`_}x7<9KJofr^Pm7zM9?BgUybwX7`L>e9i8e!MM>8Z=!0T zYj)2HR-<0Ut4|Nlj<)n5<~b3Z9^mR>cd*&i>?($?**KkNO*><3^p%mmh?uJ)&x=%#R|oe-_^yeR&o}Y>h_m@#5aFwPePJ;F z%!uFcYoqxs_3^(bf>$4`z85z(UG=F+jbdIBd1<8P^Ri$y@Vz`zzRAJrRX^V=B79Zf zD}(K=`d-!eqq_C+zdC|fA6(z)Yl7{a-r`;xtlznjy5H9Yi{-1g_xfOOkFVa|8-nq5 zuWt;->C3(Djke5>fL%T>zco{ zZwvM=tm57tjMG!~|Bhh%j7a5wXR!TzbvM@q4~y{mw-CF|_id?hPxLj-`PT=piCh|~ zyf?JCo0`Al?+Pcj?(@cA%YE{_JA#uRHj}dH`W9~r7O#f0BVxUe_e5LriP;yy$p_cp z>h}hp6=}cQ_r>-*+Mdn(V~gdh*?b__Z20QkelQqc@AgB%IDP7&YM`r!4+pDJU*grL zhmS;CdJyx`2u=@h^>A~rS-O|H-;V_!+{4Gi>6Nc~_(ZTC_}njBp342nV0&%$-|bXzR}MG+tU}Z%(P}g*Ejn4;J%1C z+hbmQqoQw(m>1v85x#ntUkK(O9dQR=jJDhX-YaZt7+>%F`@y*CwQ8lS*B=DyMgQXUq1PWqTY44qqX>8qQtR_wdtTe7o15#kQZXdi{B@UirK~w)3inUj)m8tK7c~#y1tt~ zHZkta9`mp7=1;-5M)+=v@YQ$o=U{&K?@s>`ZMjpvzeaHG6t4UGTd*^&ea+v7zX#)c zBI>MtbiJj21k0;-@p3x%pV5|c#r!LRb1q!x{yVtNt>2^D!{N=p;_hhT+HdL3aQOC} z+!fn?zPgjUgWU;VeK+?6l@X5oLr@n^~vF)iDcxN>`y1s|Qni%(CkGaPv%9J*#bIR@VR>-X=7*!cDvIWo4KeDy}A1iKTy`W~hR zZ>>S;9h4oT-1TSX2rm_`#LJN z{e0Ee>|lNId28(Un>{+VJh+8$^Mb;PeHX+u-%n!ynhprmtgm)%CAAMhLZdv623oXln diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_034.spv b/test/fuzzers/corpora/spv/graphicsfuzz_034.spv deleted file mode 100644 index 306fd84511bc37d4a9c7729cb00c17a616da1bd1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1356 zcmYk5Nl#Q!5Jn4{QItUjMI2s>GuWa6njmUILT@@z~uQaeN6Id zAmZrFN2IqR+RfH(`*r8A(~W52@!kZO0?m|#LqBKP7mw{)*@NaRlbuA?sdEacK2P=}vH)_nl5BhSERZ{mEWjCJGe~VYGFSaH zi0EytGKKM3piktSIdsk=Ys{l~PtFQ{7m&WKe=FH?r*ARFdAFahT|L=eqQ|oY%(LEN zO44UNZTa=g(fK)Ko^uJksMzPxt!teNNc+frY1^~DJXhj*JKL9tMf9F*@}m68lSjUP zV-?74s#voQto4j7lsET5pYRNTuZh!TbmMaBeP?q=oa+_8*1M8?=Dxru$L@}PYkf|& zuA-acclwm_uA!Ujcgppyqx**Wxt{x{-+F(T=LXWblt0rPH_^RQfLmY%7<13^|3iW9 z&gPiCt^)fgz->^CHL!iV0Pel9AN20GyaSAT|9kSSq5GEK_gnJaMK{;jFF3r1w2tR5 zwsCF!&ZM3>a}MXKa%PXdS>^0Lww#%tIkR8=a@M04d2n|7bKj~w`gVt2-f`DXGP6Yk$*w#q#<_K#N|g8y>5L+$_o diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_035.spv b/test/fuzzers/corpora/spv/graphicsfuzz_035.spv deleted file mode 100644 index 7ed19e09f634ff479d37b0902e324ab101beeceb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 648 zcmY+A%}WAd5XPr{{VL1PQX&YgV;~(;0x5#Py)1O-&~cFr39N<9gGc{@{@yM@&+pwe zbYz^FXP#$f-gUuc*=)}$`gJX{rUgRGs#fwbjGm*x*K#(v8D7Jvne#+Abt_vzF_3>u z-#=;41#2h+*8*kE&w7xksO~nuCDPu>;#K#>|< zPycAS1$?|!gPn?bs0d%r-?2@7CiRgz@R(Q2Szyeg=6;MmccR_wqvjSc?rSKrkMDe? zn!G7DTaQPY#GB}0yzxg>OYu%zcJgi5N6n75ocT{uGW$5kz%llIOF{2MPM>`*!q9i* R%%pd(xAI-Uexud-ihnFzk2MthIjYy4T+OZEM}zQ4}r3M!x$+b8RVFL5gBi(O&ZLiAxg$ zOUp9@hXy~=qqAr$9rfudI*JYOR%l^reo=!~v2G-B3Lv$Wxkd=8V9ot2)G=nRHaXUq znmbvqH)c>vzY2VM?oUq|*rgx-tn-b3Gw?B1>K{OvvVqV7J$^mo2*K>GKhSK<1KX}8~g$QAmY zQd>Q~pIfA__d}l`?cw_-GV6u!TPR|=Z{&G9;bAvV*xpHT>)GDT@@dcG-b-=TTWfni z#fh)A?Mv8tw*AKG- zggiIT!?`!0J z{{hcpEp>YqX8 z5WfKC-9841yM9mDFtWJsbdg-X#p958#El>uXAcoKiaY}4aVOBlACucWCn0nB<^%g2 zSwG+X-^uS3vcB5FZwy(#Ja!!2e0l6?bbYlwO!>|ro6~>EYQoMUi|c$?6*`MyOKx8753%6D*=xwL%`iJ40|a{Yj8F3;{k%6}PIybHR>O>&=C zAo1{Z9+6KT^Y}6O*sn2pt)I}fyJ8Mkk;S9$NsTP~)^-gNvv1|-dkWcH_8n(9jVzw` zeH~pqeC<2($)oR?>}45QyDRSX3bJ@F_Qk3YaoLdyS?d{IA?NIO{jL` zzelR}=&mMWsj4Z}q?R7oxM}0!vF6a?rOOU6Vp`SF3N&UqF`ej%$d20Zhz`9o_*War zK^?6;tC`S6bROG<&-q7f+Ds&0}DRC;0p@=)Pg?^J~%o)!dA1! z9o0hga0_=<2caAFvGMJ#bI@5Wg8zSyjjpOK0~^hDdf9teVEt~eXue0g{d(ORYJ^Z^Qas9o_ITUR^&p*+7EsN+TOL<|B-0# zvG$dTdxx~?UzKot|LVle5q+!yd#8gR1@{}3g1K4}IH~afcbPuu*-?9-ckG*>q*mI%XZx61`T*e-YRMpN^!H;Y4 ziZeL5HSc)1G1?Vz_)aM7`j)dYi_z|z<6z_=*t600;Cb*paXsXoBj1wX`h81s?pu;` z-;$jBmgL;GB*IrlBex%VdLz9l*DDR^(eeM|EAIR&3vaNm+V{=kCIFSu_>9`9R{ zbKjDj`m* zKLs4$=UJ9p&vSe<67>eb)-y(5%pU^h_3ChKc|C0re`<=ihId0Q_Ff!=M7^zG>lvdj z=5GV%_55AametU(DYQ&g<=fYs>3ti};ZgZ;b=M zaEOKHOX1q`dfFnsk>af}7c3XgLk}SFePdwj8KW=eH^F(m zak#d;p03^jRj!2*mr6@ z67^mMww^KijPdPSp0Mwh_+fr8UXAv5L;WD{!fVj4MI8FiMC(^aA3MS3xPo`%aP;et zoyZ2{5pu|1kC@B3;+T6D*tz!P`zY^E@6XxbDTsFczNgw^?i;|)-G%RsXvcqe0kyvg z*&TT^(v|eoq^Bo6Ice9%xQR(mO1eAgJ(IR~^G5x*fbHp$^xfxxwH=1o)46DeYoPC~ zh&JU$TW&Aj5s^KNk7=X>DV@;_hAs>p&lmSi^XI#)R*L!e`8Xs|oD+1nyA# zZ!piB<4|M;8T-(lDe)4t=gzzzLPzf(PIiB*jrj=ToVcTMW5RzCxSg}zo7{63{*NYq zKib~q`paHD`;MhZ^yj?^ya(7`KZcIKBfSrPL;M}-eF|>xGcxYCcV}Gx%*5@>T=DjN z9BeJMZ_mZ(PaqEWR7i=fz1*8(_s6*GTq6~fQ`}azRNE`%xx}l%)J!s_Xhtg z*xYMa=~d{e*B570?iutvn$tCYH05_MBmXVnJpZk5^K17mM%=f+ z`eF~i4b~QWcpKQ^9_qUt`3_=japd_fIN!tX!Sg-*KHU1o#ap1wxXAGXaK48>ggZyO zG4A1y5bdry;_zMm#r?BUPgQPUc7V`2~e_Ne!BaK6UB zfIC-vzQ(_V>x(^<=X>ZH#~xmuVfWa$c#kfI=kMkr@F|F684_>hRIvN=D|Eb-v%r%R z??cbd_!9816SqfWmm}8x4cc64-@@Obe}_2q{~oPh9qV!j*c_Lpx9?7{HqVsjNPZV$ zF6WA4?%iPL#(w+(?3!wiJ-Y|2-Cq3;dHmk|5v5EyYJSY z(GGjn_ZLK)y^15xU%}@2A9k^Rr>^$xE@&MXlFZ%w8 z{0p&`ICB3RZ0`KrJqXwCI=R1c_spEmH&4vp1$O=lB>H~{tUcz-^ZDk9*oVQ^i1Q;i U*0W+QwLH#~d+)k=Cj6V_G5scOXaE2J diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_038.spv b/test/fuzzers/corpora/spv/graphicsfuzz_038.spv deleted file mode 100644 index 7bc54890807801c5ee9033e17bedc16344ce33ab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3648 zcmZ9NX;)Td6owyp0TqWb$218d6SYvvF&r=ptf(xrxsW*ucOEyp*|r-7KM!T!nW zaQkRy7yoeM8qpKuljAc5uN1XvBcp|H5w^+c!M&)0FTRLZQWJbS`<9>wPmdP!H&RvZ zQyZDCPMn?@uQGW9GcKJs7kC+X9C422=>L0FSa(W8g|EUot>a9MR7h!TqQ9p$Fm|L` ztqntq{1xa^1GRz4%&)kFue^k>x`Zp@d@5KPYdqc#=9>4_Gm_YR#IgRx|N!1(c(4Wb?BBt>eH2I&ske5^Q_NU zyRw>!8_+EXR{&j~u0ngh+PgCMOto#x@f*P=81FpxFn%rkYP9`aV{=}wHe*||-8ETT z?j9H$wOheH&gR~2kbTibr)M;E z=;|KrL#*K$Df;d2y7e8Vzjx5~R`Pwh->qQ3 zfedIAAJJx(fmmb|&qy-iN{3e`YOy z&mKXvbs~Q-!=q@Qzp1J3F+`ia#L??&T}m&W{<&tL*+;jKL?X8ZrPJ&%)8xngo1=fBp z?@<-3%`=U>Q{c#RjdJ6{|4jC8M@QWnSbNl+25T$Voq=1|JnPDhi@K-5`h72=?z3R+ zQTI8pwsPI);gM%uxpCImihd#c_0?zo54*k>@i%N8Hop-*>ybUg`JHMk;e}xL_eFI4 zwk-y0mmA+y;?3Y?ncLUcjYxd|Uji>he9z10^DP^;=^Wv48xA&1IXh&M5c(zK(W{YQH0Ipx;D%^q)cNS4Zu)z}5)WBl0(MX5@?H59tgRi1{nq9lMZP*_{|sE7{d2gssQ(4nyB6Qs zFTuuWch0ZSKF+D{YebuKilfdqVCVc7yI8+*F~_%H=ZJ6FcVKN>khlxlT!-gwzPfxj PJe%nEJvjP_eV_gVl_v*- diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_039.spv b/test/fuzzers/corpora/spv/graphicsfuzz_039.spv deleted file mode 100644 index 01b908defc112f3b2ebeb2fdc406415826052370..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3428 zcmZve*;mz76vq#vhK87cjdl@-M59T~QjzPxwW88&o)AHaLT_E5dBDmhhth^WqPN~# z_1c3y_u4j;8La9iOev%+F0%sp1~~?Ru!z>1Qh!~f3cIagPZf5UckREvy585ITWc9u0gSiC8sJ(*mZiu(a$bRy z_rg1nr2?(RUTbLE%x>j!!1}%i{Ypp)a8-q0y>pRn?GlZ2Q?IKbZl(4H{VKRC>a2qQ zc=_^B=-ucYKlSely~p76!`{{O(W?)5-V*w1qClYzuuox;51ORvUmh)ZMocq_nWdd^f@LMLl(U(Kf(u zzvZR^bv^)Z!d|ccU(PMqSwq`-&%QD1yL@xMquq@3Jbp80%R3t)kKAui=9WvyL7>lf z;=S!=kF{!#*C%XP2pxqwi zXW47sJ;1%r)Ym!RFkHL$!yF0JmP; z?+85Z*SkKSb5-ER>i;(Pbr7!IdA6^6kS_bucQ4RpO?mWnAKborfPF=bGVXpf$Jnd! z?r%JUXNg$9jc4`j?lVuE?|!)F`!4tV09>1I!=4{Ry6josA)w8k<<^Yvq+Q)_sb9H3 zUcZ}fz&gGOW8yuzH~Ksb-wgEGv-!jK5ZpUi?DIVx0h_XK0O>w^e;DbqcVm3x+U!kf zAKKKFQR@-7z1W*|jdhOv`|>DoUY!wVSKauSv&Z1h**Xw&`#4;?Jw1VR#hg6}x4zPT zp31s1`gt1eoEh^BcoyjMUdMoUs_!V!7jrfa*B^6sEc+3~o#>wc+U-Feb2bTgZ{wUD zN7o*6b^`A5e)Ua(=YYB7@t&vQo+0MUea09Y@9=rJ^`Px2XtSm~`g##=UomG9ql~+MDaY8W@$UCK#Tk?l>$mZ&p51-siSyOqo-gKX z7Ou^=Vb60&mp$v72iojeZq4{k+SUEm`js(fN8#4#1dZ>>z0v2(aOcc7X3ypi-z#wM zWULmW^riZaTSfF`I>L7b;HWTLf0$4)nhW1^xc;t%o7 zcbC5UfX}}AE1cHS<@epbwbnHUYSrGm&Z(+1+)h{LaBoT-sgHl(ruNvFI#E)(DfMK2 zV)E?d$Wn7=WbeL*oUuN2WfPsVA@!zid?&UrRlQ)qs9HZrodTe)EY~QDN<@qEOVlng zXS%+y*lNyJE>6{2vpeVZ9OgfAHopg7t1eWV882lyo9C;I=H*KBQoTK=k62@Nsa0cA ziF#|`)ogxOT8p2~aEX1Tw0iA2v~#VwY=1rMTkarVz1C`0>+H;&H@9VQ4=knmT4lU3 zHGi^RZ_F5SZ|m`kQ;n&GoNrjg`&aRe|KnZh7I?dFv!zs-m>jQ6*K74gN~fq0y$us{ zOwfs%XF9yHIz&{&viG@a^C-&2FZrI|{nJmJ9q&up{c0 z!N1(NaV+={eC@BpM}oJ{=I0Xw)b$MQ)ibfLyYTj<9`o-8r}W!s@Ov_z#)99Q@&2*h zyb0Is#9ZS%W7fG3ZyoPwkZRtSnlw_R%l zZY}TC{14(gFm?0G-LIN)AHCQ$k$+FF1%DWB4Y_yq2xbns>-J(PEgv`EK9I4fC$|^1 z{k#|7m$@9iu|Hw^@%HBV`>lEha^I70waERxirjZx9tE4jnER9;%Ih5i`@88HW7hDzj$`i28m^N&H+mQa+knDae9dBjeD zqX*AY9zC1{+k)iZwrbDesu zdlGDJ->kLe&J%n0-tAw!xu@{HJ^k<8^CbRh%whZ)ym7rf`tF~_%<(<-{Y^TZYkm)Z zGe>>~GnZ?{vGzHzYopJzVEa^$Gk6}X{$rm11+bdm*B|u%BHm#wV=rN9))Ggpm%-Kw z{z}fH_N#Dft4HnE!0NH)b#SrYH{h;Ok2P!7vELQi-Jg0Z?=F$81Yxo7sVf+H#xIXTo4mL-;{Y9|a zcFgxEe-|^CYsIm)0e0=R{0^7EYJ=E!XnspgOx^F(x8A}#%x&xJ%^CvnvL6kOcXXK=M0SnNs7JuTy1uP^S=y~Z9t2N(Bv1+EtL zz5x5q;&g(1oEQ$q1Gk;$f)o*!Ghf)+RMN?^q zM~;tdzc4$oy?6KBj%Y3F%Ylw*D;5?F*g9}-eCoUbqiV}w>P!HuFKZ2w)JQZRuiwa+ zQy0&c^_!Si-*4v3h065B*{KSZ8>!J$mCG8|ofw}TS862Uypz*oM`p$+4^}EO6II>n zMKLx!a%AjuWx6s`6h|2y_18OyZ&u$D<}b_ib;Hc2*i_YY)BDNZ??_TTQmVEbZEvkE{)IJun+5XVa;{^ho0wKxJ}+u z?}4B9_7A-MSobFO()Is|K9J(tU)dGU%J<^EGsm|#2!5ch=Q#w7dw#!B?*MiX`2B@% z{2)+wUb*ueO1?Jc@%=fEV|?$2LCkXmZan50PH{{*kMW~G-Ff6!>CyiE?J>{%xup3U zq;Bs+Xx@njfM?eY`sv;Cdl0B!PI>-5ndAMfq%jY{)h{u|oDpE2denXxZf)OZ)P4l6 z9<^KG_L$dx6kk1RkHXDU|DB4*uzr8T?fWs{`n5ycu`cX!;O~fgo6mnD#bVs!*|>ZU zo zSkFQmcYGz>bMSoHz$7r%iG30D0Ao`ikG+(|Ue03P?+y?({cSQY-pzE1Z^HUM&!sq~ zd^g6=19f|q#~Lee=M|y70=G{QXZ0%FvBrL6zc*uNfci$@J-vYS^EbiREKqY!x%(A8 zsK*&ygh%a|&-JT&e$m%!aQ`>uy}pjGp7-j$s(V)PTi`i(E?a_vF0^?OpgNI8oZ_|BCnEj_m=)?bY{h zJ!{AB(fe@wh`pJEtMz5trKIi4w985B$Bw4|Pgme`!12cOIbGks{8x2;`|uvG#$E;H z*^@oH)*tn2OKhNE`zPdfgV=q2| zyBFsBKf%5G6sUXG_3g#p)MI`2U{0(r*5e$Wxp|)f^Y(&cX#T!@4%GcZ`vR`EAk)4~ cS{-(j4tHR`0_Hp3_#WW-HDHbXLxsKIKZ4v3AOHXW diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_042.spv b/test/fuzzers/corpora/spv/graphicsfuzz_042.spv deleted file mode 100644 index d356cb19d70a20e3eb48131743612eb99c0b9da3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6456 zcmZvg2b5k_6@_0ilSv@G0|{X!6JQ`1Ktc$Flp&A_FcigtH3R}N8ZtUbupk%^0Tt}M zfn8C=2#OR1#e%)}h84kr6_EaY|Nr)^yWaA$&YXSrx#!$__r34WT6B!=9a~kSs&V|c za8%VAQ>)Q1RW-iqYWab|QwA4p-L_%T;zJK|!lbIBHP1PdtFculel&LW`b}F*n3bCX zl4k)>N2}K=ipG#F=Z_&bhB=!sb6xn;x1ZHotBc6kF?{CMq0QU3Z5m<~YwYU~kHh!Z zco%%TR~MP8+PHb$n&I^uR}T#hZy;p8t5nsxfx$KF&KTM}G+b2!^&ZTNcNH+i~=r!i~bx z-;cn4p6y_~b6wARdFRS|9%JuQ&io-YF8eQr^NpB46z}}h8{1nh=UD=_pRs)o!>Ve> z%It3`ks2jF9PGE8_z1A?F!3_*kwq-_TT6a9*l!{63h>EAyb|nNO@0;F_n){QyrGDX z0{f1WUk!dy5g!fqZ6|*W*!P)u4fwJm9sv7>lV1y-U&P0PuPox@z`aF$JlJ=Y`a$q@ zMSKF-_mTXGVBbyRlfd5B5>$4dzDI|9x}Qj`d<)%p@4@$GY>#n8+zs|#%&*|ao!f)` zj~-9J+e?2hwNJ#Kf;r4T32$D%oV?$wcW95D{Pny~t~s@NfH}rb!R%$NIJN%%SliFn z>NoaO%ze2Z-&(&*L*s$z2xuXOwYhOT;JR?F*(;4dzS1+KKq#f zc0ZT!*RxH;pTz@LD zoa<%Iw0h1^t<7n~a{W{;!mr1?Z)?3@?m#T> zMb7%X7qv9!yUJTS9c*vCZ|MxY->1XcGx6s2S$ihf9(hY=f#nXu)XsP#W-n{SsrBDB zYt`Wp{By7ltb9kCYCiAixx{i=?|ESR$a`;_@ebEEcQz*H+G5X6+Sqpp@361A=VNmA6{nBCU-n7t@0Ia|_1*aIv7C34`+ou0`!{Eu-_I~6pE+B> z&ar>yYy-<*KyPcdV{+D}?i_IHyl-RYsYCX!H}uyk^o3aSPW?@n&z-&)ESEcd30Q71ruOIJ9cpjxrPz6xdll!b=Yu_~cNUFa2A0q7 z)ei9g`@OmV-rS|NmKTDpl~4bdgYBPhdja?&Og{Zz0Z#uV;OygKu(|ZV1Z=JR$y6NN z%K1+GEo=YVeHdPiJL{YptA*$G{L%Q8;HJi}f|HNNuLjFSXwX;8dn4FfGlp22!-dr^J5ZGGz^#3r}{>xj|{=NAK zSU&wf3Qqr01^zKpq+I2wEftOkp*Xz*3Ad^ETn91Tj1zXoqE8hjmWt$g}_ z18o1Ju=M{XSU&x~1y27`<8Q;8OaJeHt(A|)-vzs_xu(YE)L1P%x95+>-vc)_{yv<1 zH2witE*k$3EVmj{;~(K2YHaSu*iSIm5=Vodg4N(?EE@a_EFTSi4vq$;#=n3!7Y%+1 zwpKp0tYxQ1qVxC!hW^!RcRWJPY1j`p*ViD<6$_1G}!drpD&f zSS>ua=a0s_gPR)f0Vf}g=YZv+@m#Q6G~N^JP-AoRu)Q$X5=Vn>uo|3*MdKbg`Did7 z91Tj1d*RJRg9Tt~<DUe`tJiLpZ@!T)4$ZX58hn*?+3P4J{s>2c3pE#jm@dC zT6k{H{}7K}ELZC9J(O?Ww{LtW-uZgt{I=_jZ>#fq2d^~RUivEKOHI@UkT I-j-sI0n|@3S^xk5 diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_043.spv b/test/fuzzers/corpora/spv/graphicsfuzz_043.spv deleted file mode 100644 index 49c87ed4d4350d9ab49e8dfd0357bcd8f9b6d16a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2084 zcmZ9M=}uHZ5QSS1P;miKad&WEaY5W!+yHeH5qC|9iVzcY62$)|#>7{^7tr_w{?R8G zAIG@G;P>6RHBM+#)~QpcyXsc=P+zyLDWwHz5&s^h%4$t@Fex>s#>@{EM~j^=XU02^ zb{|r)Jk@7HH7in6T8OX1oprMcVmSHdwNP^gT;ZdC#9*%7#@G0b9h|WUFJ1#)j4xpAoVNsT?02sw zwwD6NII?(Y9^=wJ^2W;ySgY8z953$~euK-{b6T?Kf80v!xz=5YcaQxR_`eNrPX2Tr zI~%#p`3&q;?JB(eIv2IZ&PC4r>Kv<&-qwJ-y1M!zZYO>}JKG!aT4Gi;zm8yHVxk(a zC;nD0_k?~!CGNG}MzFm`@5X+YT*f+Hwvj_bMdwd@UF!#CMBbmEgL;*6_W=dB?zN zoqce}!QPGf*n0x3*4$_M^S5*ov$pph+$peHxevMSG+3>XE1qZ+ks=k_cB2$dIWBMy&G_9%{hxWOCPfy1zX?wsJBk^b`xyg z-frPt_9lNDle0H*?X2Z%WAETQzrtqx9jpcOe)R5b#oY5Le@l14>g26`5AU+Jx%=1y f%-Z5!Gz; z$~-)Ba-?%$9oty4H&qKVQxG!z*QZ4eo0LOj6`?6Oh z;JH1g`>1)&sIdh1T;4}$O>pZL<~3#~u*YFH!_6D^E_kV6zXZ3xvA!E_-LXdt+y6 z()fZNVcHhtJxJON{b%O)ITIG?e z2W~FwxS4ak4p+Bt=6ZwKVJ_Et!9idy`L$eYAKYBN=j&PPhpYQu<4gl^b>Hh8IUAVE zK;62$_d}oz9HG4lF9U1+G5Za|^>yv9tR2pp@Bg=~9f9lXTKEmY)%`Ah&wj)3C;i?+ zQ`awI--fIE4gE^2Jva)~{onY7m*F{%0d@Z))FXZb?*8f#{|;Qe7=IjFJ>vh&b)G;o zx9bbsq3>)IsE=a#4#%>lF8m()>8J19wg2d!y|s__Gy3>0+&-2-^zkHIy$M7g--D~$ z$9b~)A21Ho?U~>9`&na3x3hLC>pPjf5B*L9^=1&UAHdCLzr*hgTzwaad}rb6=JS5c z_aQK+YrYk=kASfvVn5Eh|0%J@1YF%(BK8xwXDP-`VypZA6S3#u>c&Pb=i%z+t>j)! z!PO(~LSDD-@c9(3{ztBV8g8DV&qZwY==luX+{U_A?73^jp4)qE|0{e0{y)SU_zdnF zD1OVAu+>{Yyn$J`dhrd+VXH?U=izFO&?;~>dmHz(0N2;GxcAF&b+zc(B3!-Lvn6bG z?>)Y!Ww`nt5V4=bjco;S_g}!(+d#yA30E)1euZspJBZk?;p!bAVz0o}jrD)PZ}S^q qJ@%s!g#Inuy`I#+Lo-k4(ckaU%w?QDuE#g+TCtz@^?z=-2Rs0?hqV3x diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_045.spv b/test/fuzzers/corpora/spv/graphicsfuzz_045.spv deleted file mode 100644 index ad1972636e8f611cad90d6047e66dee420e14c7a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4680 zcmZ9O2a{A)5QQHsNkM`n3BoQ}K}>)s0)s>qC7BZ$M1j=>446nN=A08|Q4tXXV$M1H zSBzDbe&6gn)RcFtt52WXw{M?*Z)Ucx<-oQ@(V}R_->*gU>Qc0XDT?+*o2s8abKcC6 zYt}9qIcoF~W^^p-s)^=wD%uvU@GY@b3sro1z-(qcI4E-HtR6odIR?DHOCD#v3K+<MG1u@i?f^EgFYy6*bLHF@cf?$Y)nol`^w7D6?*eYVzg2M{ z*n6#)b6vsS(}SM7;p?%U+|eCx?DH}1QO4?3Lr=W-$&V{zXDipQoS`+$JqT|d=W4F8 zbCq+ySBcH{uHJa>ww`^8`(Q<}VPfLG)wrl6KDZiJDkG@ud7p`A%yTb!{lV0kkhs1Y z7uCAXsR6UE><_5!SN84uo}@4H2Vu^{eB;5GIuj28t2OaZu+JdzFtG26b2tQV?ab8J z+O_u`O8hTt47XUvUR~DslV~{J8T+h9VCEz~tc?F6ZzR}!{cmL1`{9`Hl{NgJ9f|GY z9^a>w&RTaA<~h$#g7bYFjoF{v1QZ&ZH=bIa8H33s zKBkPflr_heIr2F#x1rp(e`|NbYW3P*dN>yBOw?=*V{!J61G{ex_l>(?)*FXcr#|yL z9&E06jK?NmJL$*yO~l-{zVoZ#-FG=Z_a|W$%(~*t?*wpar?<&)_9mYhO##d2+|+X4 zcRJ^$fjwuznI?w^Lq+lM%MP6w;U^U-q#SU&a71k0)O51#c| zc$c-^I~$X;wm9$EIbe0#YwkN2?0xR#zVpEHiO&anzwed2u~^Pr-?7}M&)l4&_o>hN z_F}HHus3~rbFON(H*@lgoKbQv0RO-L`Ed5{Uiw`CmQTD8?E7HP^2TDh1=x=Axh(=) z-)HSy7vo*d)x9N{oV|P|>oTzKu6y2PY+bSMz4xdy_4M2M_VxQ@Ip%%V z^mCDWE(Ck70n2yY3b6bX%$_g8yX@J$i!nKS7N^!qu=muy3#*9j***I-wsy{}27AW) zqq7n08TUM6Y%gldz52Wpe%Dw-y`HfrbNzm?N4>G%RmK&(&(YtRORzd@7QX@A@t2mI zysHIfU%l{6SR1S(=6UniVDekZFlW(L>H~i%#w~;!=S73cg zes1}jer3t`!@K5`x$D8+>)H#~8GjWf-yicCUX6G84Bfj1lXD*8^m;AWUVVmn*RKQ1 zr`HW&x%9dbY`+_@^tuTwZ_h60pZoMayWaTCm^l^9GxibHit9T<(7sY)`Jt_c^e-3t)4cxo7Mzy0(MWRgd}Jyoh(H%e|K{Ictie>t(RIhG5aP11uk1 zuYl#EYbV%VT42%jDp=m!=-LIAPp-PsgFd=mD|5EtJ!5~-wHvIid>&p0yVT|08i!1BpeS9;J#*SlqoT0K+S-+RRN zHw;UE?}O#j-v?m1^!Fjynzj9XL@aM^`ui9xpWMymZ^0*U>oMoqf!~d8_)jsPV=K)4 zJ>_r2XJGg8Ir$vya_;VZfyp^{apwLdSY2JP==usQA6;LA<)Z5wu)VtSK79+8H#fSz z1Iw$=<=oSQK6C#bY>v;uGxn$6-uNFd^-jgiOAkMS-E)Qe37q_JKbM@(U^c%~J@CI^ Uo;Tn9KA8WTI8*oj;l{Dpe<~cM>i_@% diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_046.spv b/test/fuzzers/corpora/spv/graphicsfuzz_046.spv deleted file mode 100644 index 3b3678ada622f6f7fb658b8c15da3fbc154187ce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5816 zcmZ9Qca&XK6~=Goy-fNfkX{Hcq)-wAnM^`WNW{z_2@r{>s1QOLflNkc5>ZeYs(=c1 zdQ&hO1VxIyQ0!9df(=Ew3jZJoi?#gy?mK%p>)u)4+TZ^6zI*R;-o59pHMN$RLyBTh zF_ga-isrRj(SlMGBZ}72cCA{oYJT7L4f8t|9biUVQ7aS88C?u1>ev?0y>81k14h-x zz|?5~tCh8uanoR;dH!HxgURV`Z!cr5@KbhdDton(tMApbZ6onoSx;X+6x-dtu;jx^ z-cj=5@`cu`u?~4NXJpBnIiutq&78K9H*-dp+?+aVD2l!v-F+DRR;m@n=B;Zxd)I9~ zqNk^KLsPF8yFr+FfqpB0`d+;o`+BzS*uJHQopF}kn=;($MX|PPRp;9EJzINvi{i+# zLo;D!%Io4D*YAFHaff@k*Fdc4&lvD)#n_CG%lP<=PssShj8Dq=dHtojY`8LVYKRz9AI_s2GX*WBcn4?VtdAEpLy zPmJrg1NSieg>avvai|@cz6kC$fu4)84KR_+1F`znn1p{2R!x68xjt*n{CaV4($x+n zSKsH)+y?$3iJNcjL$Pw-5o;fYRWslC60C9OHNF(97PA}I~zS_A*hSl6#^J!3}!FXJn*#?|## zVeRD%?w`K1s~JB!ar51K-w)Sg>=>;3qUOE&z9VX}mSf@83x74-*}eZQDHgr;-G|7x z=W(DY`VXJS)aI=Lt|wsJT5rX=E}s?s4i zXY&0$&3{+&{XO;HoqT`K*!L6Rx9r-rH2jnBi=uzYV$L4lFZapI_w8l8wOIGjTAop^ zN8es;neQy4GT&MKW<M2*GlB2DYnTYu0b@SDdjZc3W1c<6?x2Hb!70FdJtO|hTGwNZd%c2hd;?Ior`#Df zCSMzUtZgrI{FZD2G2gy$=QB0|7>gM;!;Qxbr=~cjoWb}OpzaKEXE-hS+UT<%+;h#G zao}`tds^#OxN+C(TD!5vydM1AunBy9jP-QXpY@oiJDl4)5z`E|4>sd#CWT*L9sy_k4J@?geP-QTIalFp$?(GcT{}zD3=Sz^ipHLQ{{r7sH2xysnyg zd0l^psCx;#TKA)9>QVP&@DU)dt7cwa*WWejejHw{dnuZF)V&No66AH&%**TgoJ8GE zz^ipXiKZTPKLsBJ^15o~<#m1TqVA{R)w-WSQ;)izg|~scu9|syU7zEq`#E^E?&WCe zQTGb?Xpq-cGcT{}bFA+>>hrAa=gD7y9SeN+R{(Q71I+Q=)jvJ?+PG&N+@5jIX(`8Z z#hm@I|;i8>oo&Z$`M@tpP^ZQL^v?)et?oD4T-J=S}!OujbG zvRUwUV9qpf6^PgjxMzg1Ilx$)+gHQAcOmecy9R6A%X7~7wLsk&&+V(PM z3b-CbY&P8aj7?IZWwavRpmZ;R^<|Eusp;A@}-+zx8s>!1$q0E5AupcUK&hJd@l zQ1A_4AM3<>_f5F>xF60M-CIj?=3Gx~fN?hMsF z-$OGNeZCLR`}_c3&AjNNmiKWVqR$WE!$7sqJ!r;!xbN!!Ii4l@Hz!{k_e_R6XWVmB%GrsHIsXiI&I{6e z{uj8~Ng(D_i<(p5b3oMeJa-OlAoidESGVV_o|AvnN4G`=34_tjUUy~)+=Yd+_IJnP7J;nS@ V?PqO!L~IQ_kD2otU$le3{{gq)Io|*P diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_047.spv b/test/fuzzers/corpora/spv/graphicsfuzz_047.spv deleted file mode 100644 index 7253247b2bb01e0f285919b5de95f424ae0d34a8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3216 zcmZ9NdsmcI6o(HGf>-b^Y6W46X;!47l3b*q3khgt7mFqsks25pCPKQ1k!AnXcj!~J z`b_;_wpOj4XLvWhaaeop-~R3EIp>{2Lw#pcN_DB3zn{|j+MViQQre!j)bz;c_0cnn z)#)>5&pmI%uGCNqG^QmrrN_|q$XsD|UWZ<}R**amKn=B810*%#&Br&=sgam##X_lc zXK-PmQeM7VuFMrmvn$2v!D?Z?yKCuIcP}BtH8535OEtWuR(qjbDpUxKAnP~dpDLFt z(^<||^ula+Eq@!hkn!8mD;eH_uHIgsZzp)FIA1MR*6m%`)3b|JRBiqibYXs`RLtyF z^g^Lhn9Jv|MHwXrOA=e;mN6Tsa)&bkoLk=i_2*Q zuXUW+{@TVrfw)HS8tc+0eyV0YvO6~HhO{q-_h)!7H*)~oL9K&m@d5B5bUSj8x@~A} z@30;FFxoqo@4!BS)-SJp6s=F&_{Y)48*>UF3uFXMOSvxv3E zU_GyM87J>@&Y!chJP+3IdGwKGZ8>Y1+k?pIvyb-0EcXJ~zVeYP7r7U~=0>keU^&lv z2QP^AeNddow?hATR{JHeams^?y9_p7U-Xl+pJ(fD$#aeVePH|FAm4N8M~smlqoe2U zZ%$ruIg4jML5_DafW+@IxWSAwHn=MpXYM$sV!t6|05M*_-?4N1E$RD*ZWj>m++M!F zE`Pf{#Cg}gv)=#9Xz$zKt?y|5{?;_^OyHD>)?jil0#lH5Bn(u)(@B4i?`H1--i^=c%CY*fq{Sa)P zeDsye_qBhV+ect$yPwTH2|kX8m1g&L)o8z5wTE zTf*)_A@nzh zT+F5IT#>7e+;73=`p$^s9c=?QA+DoH4`+24-Hh1(E;{~i?gSef@9M5ic1zB-Mr&p} zgMC&J>w53n_mEZOB;p>dFBkFOf#u?@T?5x4zP0+yaR&Lw`5tVJKKpC?|JU=nk2E6k e`khxU&gciQ^}_xUY)t%*eE>E_-gDIU9RC9f9_7mb diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_048.spv b/test/fuzzers/corpora/spv/graphicsfuzz_048.spv deleted file mode 100644 index 5c05c1c068654799b74ec397bf54a5978e0edbca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4644 zcmZvehjUd`5Qi_MP^Cx{L`Vb_1W}ZZl!y|*C?$y9_>w#zkdT-nqNuT;*elq3?_fo2 z*p<oi^hx^j=SWieh9`Ytl4MX)nd;iQ z`ns82-OV#+&pFeGAxT*pXw1;0Us8_li?kJ5w(HOw)!1~j;WhwE#f~Y_%fYq81n^*dU+o3^CuhLl`s&Y|GuLbt78_hUXu($iIJEp~OS>FM5B=xix8wiZkK z568E@*tKD2M={NFJa%dSvSb8!D`K4^(ar4+tz?hF?kIE?+A{y>|Jh@(yNhi^8*hdr zX{fDR(a_Z1+TNKYwJ^@r{;hW5=?Vj?}VdvSu!?<$7Of~nNI{)vvxdMJQ{owx+<0OG>3OdZY1#&(be=? zg%-PqGKT)F#W?q_;{Vp#2a#Wt+0IOE6t;a{doozR>!)PcoaR3TEp{Fgvf0WR zduqlzZ}-x6-p0DuRCE<$ZuiojhWNSuG_UV4_$^-Bi5ts8Op^h=7Wi@iS<7CDkS_1!Aa7)bS`(pdt@(u-m5>c{E;%Z zbF&ZY4cj-AxBU$X+unR%VcXlVoNYeeeE79}_hEZ(zWuPhtG@lb?c2}WzJ2W_Ou$+_ zSFv?^rZxOldSA{#JU8!==e3yrJeS3YzU|oFk0lxRYi2LaICI*o_Fv3s8QNK?eqye+P%zu9%7EL&j(xcU~1IA0_lUSM)V!ve7wW8h->x#O)l+~hS%CCbn=0Zf?TI}01lnehwVEuj_q-6k@MZexyj|v z&Dlk*8^KX){%%|XuP^S#rC_<==-GYz4fj4pp3A_;%5yoqzQ}V0Snf!6?pK1%Z9aY0 z>^qUS=Bv>5toE*5jc!2v^k0M4uZ~&@;A7R&2(K?{X#&edEzMv#`%a&8B^ zN8Iyvuw3{%z|J)M*MjBta%YC4I}thWYTWa#jJG!DFbpjh{_f0=O7@e-x7vfax4u7E za~;~x`t|KV3AVp@BR7D3BgPryTe=aEx7Jaa9r3%cjW&pzdEMS2nY5=S4mf$b~mx*cp? z@=@0vV0rf(gVv7qyTSRn+=-o^%U#&!laG9R!1A%@-C$$PRA6UI6uQjum>UW9v=mJ=T{^8;ypeFcCCKTS=-+ve~;Wl?Tn_N_abG; zEF|W*FXQ7k>T&D=$TTD$_XM`SJ>>FUKZ(dqM-FE1>?yGM^m+fDM*CTpzGskU5$h61 zZ_k0FH|G^+`aIY()gSe~0G5wBUIfd{Mc9ZSU&Q<36?YeTK<((jeZNU5BJu;5b@5HqxE@boTYPf ze$nSR@Ui-Q8{RtfM;-5g<)e;w!E*UN-^0%L`95~^sW1B64>rI4$bSGVANfB3%jM7I zL+r?xKj)9&&8I)|eGHb5e4l{j@^kwX+dkY&e|~QI@^f>3|FHXf#D8N?#I8X6s*rii zdjh&Lhx>t@`9ZY*)}Dd>43T#hQ_zPH-_&FzYX3ar<4t{mJph@8w}B z3`bvH$F0m$6jz+=*>|L`*4w{eppTJo{RfVnK(Wr?;tcfe#O&OA_`tq?*w#94%<+@Q z_8#c%tM@btySDc*xP^V7r=BZo{b>6ggHG>b!2`Xw6yuER?(IHSk83H$H`o&z?1}fW zn~O=i`-S_{ENZPFo8MGtMDGuu!_ADd=HOxmVuqs zK2qm=usu(r$K~iYWHPZU(At9#b629xmDj%tt-l4)zZz{n^3J5~`N}!J=V-36YtYt} zGgi9|$yyhbIBTuNb}j3fe<9jl_1;{9ZO@6n6g(7ho}Fmd${A@}TW%#)XQ5r&XEt&>)-JSXO~*OqK*{Q{;9I=L9pCnBxfgAJv;Y#4g2mLIfVGRZ9VVO<%oA^C%3_Owx{IeeVUL?*7ChR zjI<%{v-!p!LFBI^M*ApY4SD;Z(H%(UKL*bHsp%OXNA%TL!}qRMa`v$i?02QL zIuZLY<_bjqG%?z}C1-B(`oPJvA8q5}?+4p&weCr5`CF*#UFPeyklTdZMvbe`KHh76 zk4EG?H*sct3^=oTRyohdg7szA$ARV2)8oPEIkP?iPCm0f5iDnJ@}2}vp0jEj=ecpP{H_m<`YJaAw~E&g@SC>&xs<1%h*i z70K*R1IuUjr-S9pP2MxW$#ZsXrx${qVLOu9Uj&xV>@Nn(nVY}8#F_Pt;LLh4IJ3S9tS_^^87!Bc-U7DgP9(Fw6)c}w z-v*X5H+gRdC(l{6jq@zhpE~jH05{J5PB{6@emz)jGve&;Li;$oz8erZXBTJocY`zg z4sd3_5v(t>zXvRro^Ap=L-jn~i!Gno-v^d6H+k;|C(qfnjdS+&r%wC_z>Txt3@4x2 zKM0n~J9rD&$JzCL2$6Gkac2K8II~{@&g>rn>&xsP1xSy8XAoMQ& zW?O~+8DhTi`qv@$<{s<2ixpQR`JK=T=Q9skMciEU;0hiBcAtNa&hLkjVEOFtFTm#H z9DWJTIp|B=ufY23#~Rx4{TghI*uMe0Mr!^RoSOO)_dBq@#QnY!XHD0VGcGxQ09X6} zBewmd#-G4h%UEm38CTuEIoLxHpZQ4kZ&(En2fKfNMrZ#&ZF&n z@h`Odq4qcAztR6eeDvRn)~`;j+rZX{eLL8B(#suSIeWRO{0zAhY@R+pH?;qYxSsXJ zsrNsy^|L>BfwMpQ5_dOPU+jCp?o-zEWj03M&#fk3ZXVayHwck)eR1kEgWbRUj%&e| ztM08_;#{m-z8uYx|vLPZO~1)0q1HqK!%XL~ynKBy72AeYwO>2HS7y zPr)3DEU>*BlNz(Z@;Mjn_~wAC_2**CRqM;8{yebtjY*C9V0r6%PTKJ; z0L$s~?r6t%HrRdF=RMN)J@7l}9I)R@=IArVyC|RhgHsj&rIU2`k8 pTy;&k#CL(Kp9|Ztt#6F=wT*EyYv*&rcRYW8-3wyPgDwC7 diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_050.spv b/test/fuzzers/corpora/spv/graphicsfuzz_050.spv deleted file mode 100644 index 8f847880b456ad1551fafe32089540deaa767b79..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4156 zcmZvdXLnUq5QYyVp_kCb#-S-lmrf)_G_gbh5xYhth*2PzAa+FoyVwiZu#4C$VyEaA z{OE77tmV?@xpxm9@A72Lo%enB?Af#D?0r(zbA0bC>yh>0?{HRrhGacavaEmBtK?f+ zSF}#=-qb#Q&fJ+s49coXfyNBZdS})6p4j?T9UB~QRIL`I&H|vSQm#fO)i7F&m)8)p zy0f#Z9bdz`=2*L~t+{K}+9gRY&Fh8Ukpi7(?yfc6vv8&HK4pGtnO9|f%bYQzv#hP9 zwYhC|=eo|Wa(q9uV!r<6_}RG9i~(hy@>OR8%lznigW&(puc9AWwi$D^+KSjAWqvf* z&@wNr)k3^`c71cmt@lLCXBZtDh967R@Dk6mk>C;F92-USNW9$M=I~K?`=jpoF?h$# z>-cCqucM^bC2kFBQ{cuPi)GoCx)Jc>K)IC1aryBjR?c?<*!7$j^R54vBS-3oQ`MNH zN1oz3V;S4Eb994sjsqJL`xp;4uX^O20QQ+mr`_K~%(c`b<|HtcH3mN!wsPgK4KZgD z+!*zUnG9yXOYF}nAlJ1P$ICwZ&pxIy_BT(APlNMpasG6G{j~4)S8ngsV!at)!W-|KfRMPTn%tXT)PkM74cPs6)rymQxFjQK>4da&m`cmvq}1aAa;|AIGxz2Ebw+`C|3 ze7q08!%oNBXV1NRbA7qzr&oc;dyR3qd4qe7-CJ<`?%spjPwOsn>nw7=6TzMDcOtm+ zz2m{{Rc!_LTTvYMTOnV}emqZ0FwfCaRL}nzNmKXnT`s2!-o-O9$9+O;2CEsjj5u?& zV8%MOBWY(P-S0p>E817JCXjtP8&mT;U~R5<4yL}J5#Rs0N%NfkMvhjz&!5CQb{=*< z<~tNe?xkRJ=UC)k23FsfaxVv~jm6A;0p7>lj;+8h#LO)=k9%E-nR_e0@{5u-5x+fY z7bkrZKKgM9SbZ|Ko?PSbmtyMn$8#ok51y;bFtzB9-;m3b9x+#>m>h3?#$1W1ZzGTV zD$IH6F|Q3=nfq!q^`FzcRbaI#*ny;712&&y5w{ww?)S`nc-GWnt#)wbT5HhMBj(x^ zljCC_Yr*QVkL$qBQ;&Ha;L63bzt*37IEvr>amYLV6~`c16VEM zJHcwxu)XBLhqspnYnU3S6kRpjditL0ea+XPlG=DP{5o+tgMw5QE* z*K&L#XTke)Gp6o)>6^IwaqJdME%>b!{IaiR3#>i|i~DjnSbZ|Kfn2ljTQGIk?U%S`VJ`R{Of7mm6MS#d z4-zBanzVU%`>wVv>GScCYdhFnIp#i$yAM;3dG{x60Y36S09H4@@5Ol!Vy@wsb@xwN zto0DQa;=Ba)FbAR|A~1NP2Kz9Iy*4usYgAJC4C`2>V6!o?tZOj0A4NDdID@c#Xdd> zSC5#dQcRAI{yYs8OI zyYg(mfT_ov7s1X6{u0>t5H-9EHby;iyaHB_IlIBdI$njF<8bQ#YvA3OdgOQ=tR8ph z4Y0MD+p*#ua;$iVyi4*{ym!j~bJj8v|0Y(0ZRJ<~R?;To<4(Pu^g4XpsdvEY#XGeJ zuI^bFgqO#Aeiy7(JPUi_>Jjr^iplZOtM|d`@s2(KJ5N34eF!#pj>Wu>!0K^^J_b8i z-TDUO)gt~Auv(n2Pr+)%^ZprJ-SZXS)z87|i!t-o;?*MW7vN&vFX3wSSe%)CVD$zp z@_q$YkGw;`YLRz8xS02AxLP9?dA|XxH(`8k6^XRxC3ae5pf5>Y7rOb`4F0Gna3E%?PoRKvEupl9RHQ|$QEG#0Pzq@ A5&!@I diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_051.spv b/test/fuzzers/corpora/spv/graphicsfuzz_051.spv deleted file mode 100644 index 727c64d2d62744b19cbc55ccee84e75f33be8417..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3200 zcmZ9NS#y+C5Qa~dNsu6mBoJKSOGZ&ZA}SyXgo$VdbyO7hErtYQG-Py=xGOZ%$iNIjNU^dpUjj^yzQt>8|#t)RorpcP+Komeh?UrGeB}%6j8W zV{B=8cI@Dx14e92J!POVn^J%3MRtP=)ANfu^lIA-)6M~~o-$XBO%=SI@#+;~&aRv< z^Y?MCx~p|=skyMSJl`a9g&citbIHv+11eZOb8ca3vNb(-ve|6S8dl-YI;QH4$*Gy< zLbH|9snV)9rD|KGI=em3n(FNEjM4vnZGEIe_pAZ12^jAgJArE}S=J#($axb|z74(} zS(NB4_gcHQA$D&l?Y=@v`?7vBT*G$sjZkB)Z)dJmTY=9Sv|InttXsdf$h8^n@~kb$ zLWQMY{gzT|=i3T*ujj@7L3qKX2k{JLyZ&up{jb$y#;I=yH?B9vW8W~kck&K9kjB_6 z>%J9f546Yr+u$z!w7`ZxBe6DE~NFw{k-EZOq6fD8~7H1CUNGwJNs^+ z8+Q-z{lmW}+fLIl>)i|7W50y{acc7{eG{DLJMII{g6H|h$Mbpj!u4&)b?t}SwZSDv5vh&;rvi%P{55islz>PTw?4NQm_u&xS z^P+!;;o8>r?;&jZ{$l?TqZo0`%GESAp}Z?=_$==J$2@ATVa_{JxRx#yG!kBHin< zU;5ty+O1C>^E(AMXUy;0aBZFQJB_YA=JzbzWo~^lK%2ScF~75L?;GV@&*mL`R9_jL2eRDvY=gRGQ+);bXuf6n+!#T#@xJTLfPVSAm-hn&6zMVCi zKYa6WYhLRc!uBp0&Auwqeb)XS(q-+&I6K;`Lunn_)Rl480^C}x&2x>7`Mm(|2hOMS zt8RSE>LT2k4!sFCCf?_LxG~xz=Lc|e?gHjiH|{!hJEJYI8(8lW(t4HFtA807;~iGO zhrpTqD04))_hY1cm2vhbaL+bJ)ch%2d(6aVaBT&!ub(4b_Ep~(K%2Sck>^Xec|yOK z^~?FUb`{+i?cUqiRp31%pE733yIJROj`5zJsf_=NFTuNjzhV19{D1Qm-2M8kTiqVo zBXcOD&adIVVSJz8z_k@1ezUYi{AIXr9P!`6wG|*{L|epPf&0c0e-*B+0P+6XjNgI$ Q4){j;db9p7w>$#=18Q3WzyJUM diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_052.spv b/test/fuzzers/corpora/spv/graphicsfuzz_052.spv deleted file mode 100644 index d9ba741800113442e9b9ff29bdbf7990e75a6c29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5572 zcmZ9P2Xxle8Hc|l1kfNumIE;n7a+J;iUA@@P*H}f#eqNo(LgW>A`XZk7*s?MK~O}7 zC;|#q+*NQ?JGHH?t*w=|T5D^obyj=Y)93l}zxp0O&U5bX_ul>9d;gpi6?SWp%N68W z^6!gW)305wkVr09l53tXD@U9?qIX?=RqsB1kFiDTTv5KEZQA5o7VOn@rNk2Qo&#ni_3#mr-$Db?eK)sCMsw5F!E3Y%|NOgUlZ>~J z;I9Rq%(S>w`Z6&9(YEe@CKc2Hzb$JNO>xxxx2DFAn}F^zz_)p;rgr z8@)F8qtWYw_i?NX{#f*y;EzME4E}iZwZZp6UlDv?^pxQHp)U@;Kl=RO2cX9Ue*$`B z@F${21wRmdPVgt8F9^OIJt_D>=y|~pMlTC~2>P+$E6^_oe=_=w;D@5$4gM7LN5P+p z{xbMs=>G*@iT*11;pk6-KMnnU@Ta5S4*m@E>%osezY_eJ=tqM;3%x0LbGtcsbNf*6 zqtTB9@7X*V{MqQ;!Fv`j1b;62nc&YuZwcPBza#kXpce)IUG#Oqk3~-n-m@Mb{DtU? zf>%!n-n(~M@Z-=+gTDm5BY4MtEqKRzEBJ}%_kyoNe;B-X@6+HXqdyMbxA8&nm!jVZ z-o3sVyla0o_{-7H2Vaf8C-`aT8-t&Yz9IM;^!(swpl=G^w|sl>wdlKouS4G%d_DT+ z;Qf|eAN-YQN&jEWLi=Wt_gm>3PkuJ~*x;|u>u>6>!TZfj?fn*Y58k`uH!;=EK_4Id zTy%Nx4d~N?ckQk*^`D2{7QDH8DtL3-5c~qPXPWviMEeGk_iRQ7--!0jrus!_-*obx zjc+1(bM2i<{uZ=vAo;~;-)Qo;q6Y=P1btlax1kRYekuBZ;FqD>2JhWy8T@i|Ver0f ze`)>|=w`vMM3)5bUFsP8Ds)-!tI@{*XLRtdnAkk z-}4x-y>IWF40ClZIL3Kk-}Axy;G1@>W8nh05Zr_1MQ|~gGxy?svhO9}_~T&$OoS?M z?UP_KOo2;bDqIGagXiR0tHGR``)M#8YO+#41I+mqVE%hSZAKlXIjx78a3#1#*XtR~ zf~#OQTn*R2wQwEGfw|BC{lRm*9=r$U!+g#I*Et`|nWf(Rc7`%=-8X>uY5{l`7Q&6t z2#d1P^>`<40^69+o54P!Hg*dvh6cD5mcVVW6qdp5upI8lSV6fG?u1pa8tww;cRbJ2 z+_+BjXTCi*QJcfN!F{iRdtfcx3y#qMvtV7udddy35v=bIuG#xi4(8FlIL3Xj349ax zgJZJzYEfsyU~jp8_WB# z67%Mo{I!ICL&DV6s+Kck1U_ABv8QOlXA@zF|Z9MjS z4R3rDWA9D*b8sx&!Ms_1N%?x_Ek7dF-I)4M! zyRI$7JjdUH@iy=|`+1YnKK{PKTmL&S?%e7$-tWlM*0cxh*w&ecKT`U0J$oqs1jbyC+PS?iaqd6kjm5d&!5g2K&HXOg zm~(H-=Kc%XxvewDX&y^+Y|h?;Jzy?u?;2d^Un%{$PTRZ>#$2b`b$XBEI{$_@7T5WA zyz#Wo574g3cnxEhQ2qmqx8i2&{|N=q46K{aevE$zexs~Uck!bvzMFCsdum1bFEF0) zJLLY;xx0^aW*?(n?@k!Q{N6k7n(=hM?CU*p@0RhtI;OdF-cMi`c!ynsc}jWy6zzA$ wI=?a2ndi?a{h4Rm_)d&Dm!)$V(>K*M&Gk7k=X3tY!M2`>IkWD+WN-ldAGoskTmS$7 diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_053.spv b/test/fuzzers/corpora/spv/graphicsfuzz_053.spv deleted file mode 100644 index d827004963e53c7d94d156630f91239cfb15d5f7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3936 zcmYk8S9g|06op@sP$WnR0Yp%PU<1Skh|~y5EKw3sv7i9~5e1?F6)VArVgq|Gh`lZ^ zU0%T7@JD#-QgpeN&+~n=!#Avxv*(&sBX)s+x#YRcke> z=DWJrcQ4qpck6&zOSH>09HCZkTxv#1|~7f%JBhVQ_pvCCMzbI&o4xmX=TCy%Yn zd>r%swxOl%uugB_jR!lXP^az=Ck*SHPpr*OtviYNAHDllW!*OB8;`6W-e+>1Kb&u` z%?DS_=fvuqg2~a;J{7NCzf}i6r{PCn#+Q}3-_=<5JOf-+gUd3XUZ1bA{!Fm^)H`== zW7FAb2HyQ#uW@8P1LjN;@?7t%LNcZv=iZeg``7RI_v4wLQ_J?8$eBBs%P}6#EO1pV zKaqL;E&OskHM7aeF`n2QuxHm6qr$h~ojZIRe=|D|zXF|}|9s4IuY>8gzo5j7J3RB@ zaxWKx&Aax261xa&yaOA@i}btA#jIP6ng5F&=HVUxf_*RZF}3J_Wi8*^#hA6eLu(e` z9si)!+$ESX>%=GVuIt>m`+EkP-u=B(_wQwWbzO!fm)PYchO2%nI<5fAHK&e+c!xU7 zEy5OK?khf2*1r;LjkRjCPLAAgmXy4_MvmM+xdU}xg}Ih%%eVeu*<&fV4U?1DGO%%D zLxr~-Y#*8nZw1(RW9>@j#{FH8dsqc-Jbx#1hvzqUHP(rFHgWd!zU^7p^lY7YIr^M! z4cNTrm2Z9S;u^5`<%pJR!N&a^W`QTEfvs%k?GSiI;DE zwA=tzi|;5}ZUh^TmTs^^E#_{*jHyMupSbsVGv;3ENM0Wu>q=g2a;=q{x2+Gi2kid7 zf9qVQhdcM(_hNHv^HcqK3v>I^-xcZ4^ERVtttV ziqm_Wz}8r+HtXcb4QF%7%WLGw%^lna-h{cfeCyL=Tfp|GoW!<*jT_7R+y=Hk&4qVA z*mz^@cIL)gvE0K0;KuXsVD9kz<{re1c{XwOd-}>CeF0l9I zh?d=8pc%Oha>)BV&Ejy_rjN?v{Pt&f&HV72&;qGd1Gc(gnU zcBsYNW0*0uh|`~sgWXFV$?KzIU&*UYuC;RWw)NpY0d{}izjdyY{(KT_|H$z>jKx2N z*`HIe^ykxH&$Sve?{|F$??`_>3-%oPoPR&q+Vtlj*x~uj9l!=L>%^YHb)6eee?A9x z{}#;s^Ua6A$tCuDiQ$I(^B`ERIkmrlcc{bMi`XH|ee1aX|MN@4tg%*Y*2$5Z{(QOQ z~}gD!2`klh|uub8lhBJexRsz73v?xu$0eN1wC3Q}UiyzV*3_cfsD5BU;`A8&6NXZ<3)Fb01*F z)FO_S55eu2`>7=yeYAX3^6HaseYAWGR*UZ_T0Q|AkCsot4z-y33^S${ar*Np*uB(| zygoWUFL|{c#jKT^x2+HN7}))N|JJ!q`tu90{Uay+`6aj)vv>11?^j^s^7FUx*I?t* zvGmb5V9!4WGw(aH=fB0w&B6RTd?tPrHWJ&w&#CzDN=$CP>Gvg$8;<=@V(t^(k0sWG c@8NGs*ZT>xUcPznb|t;pf;aacN|#{&11o81EC2ui diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_054.spv b/test/fuzzers/corpora/spv/graphicsfuzz_054.spv deleted file mode 100644 index a3aec7b62b5dfc4366332220ab8273baa8f8d10d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3024 zcmZ9OS#y+C5Qa~d2{A+#$pWG5uW= z;uqjGzeE%$s(7AnPUBZO)=R&=obEpT^?)7i!>dwiOWpkUYigbKsU1s7t5a7YYxPU@ z(Z!|N(E|tf8L=jH6oJO9O{-ETvK`!-p1-X_ueNnC?G%7@6uHK^RKZ)0ui&c?GXwN> zA+IgpC~9?~se78&7aI%9OY;q?c*ne+3K7Kta z(Skpp`3AaK10TX~9r*x!9kN=WGp$G3tG3kp;Yn4A=MB0b;h~ErP>CW*zc(lI+>@A?*TrVTd zTZXG)5V3_MOJqlkwiao9mv0+lzCx?kS|ly82E7 zZRV6)Bi^W8-8tx2-XX8Ebbc|<^0)AA^fd|J4g5a#X#Vik;P$-I=eIZm+--gCwfF4( zEYf4|#<(Ba>`iGO+SHX%>m1x(?9IByx`X~5cpg-M`{mxN8y`Dbhr6TOLG1iHaP9W= zF47Y_`X1c+O8a>~>&oco0^A)n<|4QR^f}jF;Ew9+0s3M`KY;6x9sMx-5yedOe+0DK zgFJThW4L!?M?ZmUEAQy1=-LN?Z~F}Cao+kq2inXnj~)F2?wd9O-yAW@c(d;`#-5D# ze(dOFxV<=6>s~>6tgCMdXtS=|8u3Q$>dr~OGIrGY#XQU3!n@JeRk%Cq_pwLwhi@8g z&ntZc*sg(H**Ajpp1sc?J@#&l`=QO=l=h)bT^Y4z;a7pZS=ZRu(d%$`)E#t3)s2sR zya9J_L!W~i6W`}1+!*bVa~^Ka9l)IG#@XMONc&UTpL^;5TWkgP+zq}0v6l;Q{X2nw zciuwk_c#arw}E!^%A=14+&;V?{eKPD9{cePT-#>gjGIW0x%DjqZRVCoo+Y?>LSN2$ z{9E-cx-r_Ffw9`0LF7}a`yTTvW51k(efNR#+wFkI1w0At+W-In diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_055.spv b/test/fuzzers/corpora/spv/graphicsfuzz_055.spv deleted file mode 100644 index 2da1375f5c055283ae8dd7f7e3105ce9b8776429..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1220 zcmY+D%TLo$5QT@nKtUd&AmXD1-(Yp2#)OC_By`gR5*IETA`KxaHYu36#GNbuUNwLWpFPIgi+uA{l=|L70!b+nB!CT@TtP6oaG(b37? za5y>!rW)2A^}nC@6Shi3uhZS{eH{*lqliwf15I2@H8%vDf?H#lv@=(6E%lrQFC=X> zu1)0Z^WX|s<9d#l`6}y zBBRdxH?vA^Cu4W#vEMS@dd{r=7T#L&>c!3?r~Woxz3;OHHeSIZE_b}YO60uiO8yQp z=VQTZ3104Q^GfROVscv1tP@jn&zkp$oT1Dlc3!!6)Nqf^<8iNlK=<*^@BaMlIFq={ zC;k9-FTSfg5!=JJv-SbEobO@g%A2~2-+A_C&bxyzaNciW)@))2M82KB4|&Zqg*o#s zot)3S{nc(@a;5)f=HxxzE80iIliJ5%In5s0PZWN~6UfC(u&CcxX?7qFDxzF^zMbT9B!$9&Z0BSCCEh4BDZ=T-@ z)5@Hci`TDRzM=CXV9B(hcXjREvtwUpSH-oIxi&wZFf z?74Q3!`>f-IKrM*nWb&-?WsL6)*KG;gbJ2;V#1RWwqFkCPp)8zrzAWz;r4`&)X|)3 zY%XGd<~%yhKPKU06Fx5C;}bq1Vb9WG&J!zG;u#6gO!%aPXC-`c!sX@1HmCQ)A?6yE zL(COCjJbY?v3JPfoY@sD@tlO`CVWQ1^AbKY;j&yd>fC5b9GSmIp??@qY;Fm5T| z#CSVK@`_!LZyI@?fEJHt22W+tjx?3JrMLm@?oa<`)-pa+gH-R0_e==I1xwM~xHrDmD zpNej(ZS!e2*PQvR^Jc^`lSt#9hR9_xS1+8otG%`q`)k`CMQsPbt~ZLR4%WQ$Z$TJ~ z%yTQi8eGeowC#;t)N~uTD0&xqHctn&Yclj}A3~gOzT0c;I&(QC&(xkcJmZJ4o`H5P zd+!;#4{iI^zrh}m>|U_H%VNH^e;Z`mzYVhO-v-(C_h8uj!NVHt;SKhP276?K?K_|I zjc%~VG}vPsY~O+$@3*df4juK5d#@LRyj#yiyno)g1@y~%_AEqx4RbuhXV)C+F!!9A zYf9X6YtFNY*yq)pXStdx%>R7EoaQjbIo9U6>9Y>keF0+JDo#-Qg*6vEW_cG~&v?(- zIbzS)doK2Tz3XDnHn8U!*fS06c?R|@?ad?Hu{+S-HT6T(cqjTU#G(I1X#HyU;CC|t zF-O=F!JfeZe(Ilu$oXB}3wIFxV#GLokCI3GC5Y>pUmW=+gLA$q*mCA`zurAL>w78M zc(wJv4E=J%q5lN^M+rjSVp1Rgof}PWjSgZD{5ObSL9I?~DIoDCx=330j z_oDAcyaUeDXPn>stC72rLEInh*C0)ZJ<{jf6LVh+_PqB~pL1V_$QcuNK`v^V4$d_l z-C!SsoojqOwlz9WU#$BEus*-5Ui2Fg@1XfzSKB%E*`C`Qb<}Yz*gE1~90!&=fW$e< z<#V*hvHqLD?t2i`x$ie4_Q-3yj8KH}a5jyU(F?Y!96iQrZwdN~6u z7rh(-ma~`dMtc@&zlryt--|f(zYncn9r{s3ZbbBQB% z7T8>|w-18do4j*8%MT&)asNLIj{C3g79{3=q?~u;{(lr(&KP?&2rcK{+^6-Zqn?w& z))T!u1uU0)CzpHYzGD54fnDQJeSRMYTc5n^4@S$ydZ&WzoxYK1ZFAp;wl=lrazFY3 z#G(HaX#MKQbsE?lVV@569>lx)Nw9O|Js0gyA?7xhIAUjm^BtOlEf;+l1(vgxPos@j zTkB`gpG6${KZn+@j{I}M<_P-?aK1yI$99gqwQ7F>F}JzI5jziTuDC;A1bc_%ozsK< z5+WZlXM*$kXJOmBc#FRbZbO`>FYA z`{aJqQQLg5wZ$Dg8!VT5FPD37Ut;}lfW2p7e-rGQQS-OJ&XKpCp=h~Se*rk3{W+!Y z$oiwPeRc8|$`v zbuPB&82%*<{_|>oobwN{J!j|XGp+~yBSc@=KL*>U$a_B6b>q(c1nixYkC+F+^3nI7 zg3a?F67T!Zz^l0YftU3eNaa|OTpF?ccud@cK|V7pIkmO`x*D~ z<{G<4vGX24yN){6Sq8Shz1)yJ=;er9tfNoP`1{bt-;a*?3&8nqU5G6g@ngVp#{U9s zyxP0o?fWk@s$C{}wT~xx^8B5!hUD#=ir5#`4bb zp8Ot>kC;{99PSkAd|W^(qyo>;p&>R1i7 zj<^qNz;e0Ia=Fj;AlCmYcyO}+2DYB4`R`!o$Xm})v|Oye7M#y{9kyJoKNc+K`u{*% zzuI&DXQ}zY(El&Aes$zu4>m{G7lVf(@i)lBVCTqt&f1S4<~El&VlM&bT$k2%ocp8L zo}s)kJ?MWU@?rl6Y!4#m2Cz9J$75jcj(o)Y7c3t=eH?5a`FJ1vL&vrBMXn||>#=To zukAd0^$^hgsiT(5z}6CX;c~ECJ`1^g7WT>91JUs|3`*F$5xn;zussl)>n^mlsH2uE zz@AgQA6J6qq85E}#@~T9{!VnnUj@$h>S}Dch#v=*GrkW!F<$MxYDTvp4*jjQUmf{7 z@tGs;Q5!zFn-K4jc3;F?<`zfnHO$Gibz#dzZR5dmuHCPWS6f?u^Z>-6e_-ubNB)iY z%n|k`u(d`nH-qI|FX|seym9)hUwbg(de$$Fd|Q}fzOc78*xRsOKYmXQA+`Lg@ z&O5E`Jo{|V?Sne%-9diqjql}Juv|VzxqOcHGvcqqm;1Q0!QNHd(Z{jG+DGTUh5g<8OqY40b*LjjTNdoBzxAQJ*!m)Vwv`4xS1xcL>q1eH-{OBIhCh1FMY3d;kCd diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_057.spv b/test/fuzzers/corpora/spv/graphicsfuzz_057.spv deleted file mode 100644 index 2a0f4897c3ecaa0490112d50bde4e127b23726e3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9044 zcmZvg2b2|s6^3Wof}r$Xghj9*h)NShDWWVQDu}%;3#^E4(FH7tQBX9-n3&$9#uB4O zV@cE`rklhhruS}o)l_>-@_qB>#(Un$?77_k{{_&xzHQaoRkOBi-8gIRyaOy4Tr`$-)(k277ftwnSa-+f9usEehJxf-0BS5} zEupEIY_4x+Pct>$9b5Z0U)mi|5vAMwGZ#GqS|iG#8`5Tefw#Z|>RHc`?{?9F5QCIEMJ;b8ITc)_VST&f~1d z)H2@M5;qqU#GRWq_x7|qntTftMX{-?eR*HUre(doeH&|hQ!x?1H963@g+F7DzRoSZ zUE8)Yqc(r{8qKWcVp5qe=U*c2{K@#<3p@Kdy1LqHyX8HrqG)ehwY;4Z>qTH2O8ksH z#D1gC%ZD*yqN>niVxz;-eB?nefpGuS)osgpW=5xP(_Hye8q}6JDF}2??K= z@JR`uobV|LpPKM#37?+u83~`6@L37BC%i7*uit@rog%&htgex;S0;WZ z*kd%BuEMusW2n3uZ|sb*#IMH78N2fud%q?Q{Ox}OUM~9I2)19|e&fLv zXZ@SNS7Yw?+}~W~fc)Bq+Vf(!|C*r++=01S;K9IB5*!PHB?79P76ib#E`)u8bIX~jNz@D4)K3L^Ki?P=+ z>eX;JRutP8&*ZGEy9e`p!_3d;{pb5Z9Ui_fo+J7YUY))pnlZ17@pgPmU2HDrcd3ij zob#jV;?Z^Sm=xa(9-HFr;Bj^F__}yPUFUagoj9$@N~_zz>P*cI3d)EIvRbC$hg_o^-SK3L`S?tKXV zFy`UjkK*ms$KEMmXT;u*f#qVa@y9V|*(-LhpVLmvxsOyiy?Z}_|0L#N{!@5+^|5yk zurnf_3ikZ(tIq$^U~A+(f8)@p-(x`q(=S?2L%_ z1baO~#}~lX$g9KnibI z1DyBHB+h$(KwQ7~hj8+-_eWsAKb>X2d*!Uldmkr`z59Xl-dV(X?~jS=_x=PwOn{4+Q7E zvx)QGUl7;t{Uw}y?EMvZ80IYd-79BZ-s^oHd*^`j-nqni@2`pL_x=V>KKA|=JREbD z{qB{sF7NfZioNr|dGCDUy!Us+^?QF0Cm(zN03Lxk%YOIDS(o?v9LL^+z?c%2}89K32t#;(ea=q2pk%d$;r6xEy~7CU*noJacl+^Brry z??GeV_s05|w-D@k#k@noaxu@Goc)jB?f3m||D~m`y$kI(UQ}^6mbmu)D`)@1c>DFS ze=)c}7WcLnBml=0s&XW1)O!x((*{YRD4 zyZ4{?r!f!rK7+ScAA64gJ0tc!3zmz$#?N8SvR53vM}oZueka|Ee;yl)$*axymI{x< zd#%**0^V7Ab-sxI7v^F9CA@ik>{Am@yTj{#}}7x6r?a`C0$*#99AZ;;erny@TPbGZ)%+hc_2GCV|!A{HU1>Cm;G-!E*LS-xP54 zso&VTtl#@B^q;`|tp7yftp6n9tbY%Bhrn59F0@UBHy1jlfz{#ssM!-vKJ@Pema{kd z_6A3v`i-s2`h8A9|H;hH`cEOw`cEa!`uCxCD4ccXLfdqBbD?8jusWO{H8bGkL;p;$ zoW0SvA2|BdZ){!G@ADn{Ph)=8e>!p2e+F^ZKa1XBaMqa%ZTrKU3mpf5)#3c8IS@`h z^v?#%*&BUxz|p6EW9zbh-%FwYOy+0(XAx)p?ZjFCTzZGYS!XV^&4V`=I_87b;rysM z2u?oqF96Hg8+`|Zqfh zgVo{us96RlANr2~%h?-!M}nhI{l?a1{eBM^_rv>rppWx8n|}l;^^}{jIE13=TYmP(Afo+3!UcV)cG`Co%-nS2K(D3`g_1~(Qi)9et%Qi z@9#ikf6p50V_q-V-()fGe6U>1Gbd;NlX&}|!h4-=$FJnv{B3g?7T4)$IC+1ITnoPn zygPnpUEMM8=HhxD3zoZsy5No@cAmMOqV|7u7m%0t`c42Fho05&>bVgMJ!|0PL(lQx z|EFgyyt&wY0$48VIg!|T=0Z;&yX4g~32YqKcMDiNsBv~YD`$}No|m`A-;8I%$*<-fxQ_TNuw2+0G+5UTXU-$IbrmNaTt~(E rdwMm$maoUJhqK>$^LN8}y_%|=_pIlne$OLv_mIyyYhL0dvjF=qd|OQ> diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_058.spv b/test/fuzzers/corpora/spv/graphicsfuzz_058.spv deleted file mode 100644 index 3211ec203c62b349061568e576b29ec5f9efac96..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3172 zcmZvc`EpcM5Qh($WIzd%^_uaXjx@B>uy8739pFVx3)U|VUN~_Wue&46g*_67_q_j4bGd?;t zJ~p_}o*q1S=zt#UQz>)QXG2<@y5U{W)mmdtgI0ALLFy?0DrLE<1odDo`u9-Bn3>s$ zkydTyWV6|tM$G(r;1?G!J*8acr|fCf7n-w+?M9P|Jw%r~>MX{3#ALmesjlp4%w4HZ z88UvY(Vn`T#jWX>vbcM|)3tU@l|9}IKVM(CaDBdxtR|(2(Xo+5F{Gavo!bH|FUBM%@uOXH*0V!S%%WxV|sH9#gced72cDDLj>p^%0GPkvqAA&r_Z-?t^ z{;)p`#*c0*q*nQfL{|>ly)!B=0Z7%iw$oe@e zDSF!lUIpp@DBQWmoRxh8b>Y7oT*+l??SWESI<8%LZziV|c^~qf<>jHn?4Uc~T|Dl@ zUr3L^y{oeE6`A0<8iRIIb`Sm1f*^`mj`p*-{gN1Y#sUUWY_-y zq>r`z19%$hrKYxLAm{NC$T;nPQ0EZbIL|-G+LhH?PkaNtvpx(N`y;u0 zgJ+=uNc}l<`W%7Od*+FAmd`=zV;;|gV;=5z%;P9n+f8yA_X1?B`eAf_XG4(lwU1-G zsIq=b*uA%N(B?iA=jMIx(2qX;2ly7h<+C~lcJ}J!#vO-ye|gNi3f9+L!_WyRa-0Mk zYhKCOo`UP+G3SeLbIK#<2-sNbj6$cOc*8Sb-%wtBL*LXm_11YAZk)$A)IJ8Ox1KoO z@D;GJA-@W)LO(D+-}E&|o$nHFdN$X?(ogugN9Q1OY5S9RI1l$&U)wmO&iZ2SZ;#6A z<2^5cea|Wsd+<6~efYcq*2liX=S{GBef(d13-bFe?$g`3KKAY%s))ssB z9$4L8=$HJy?}N>!&HH`;_jq4z6VN2&{lvfKaW$~_v0rCkoIaEA$bAufHy?f76X!hz znakYzPeS%F4foiGK6OZ)HN-KmOJHXj@(kGd`3Hwn*Dr(Jb$7QPivOzy*m&*UQQ2?h6l4y0?7$Up393MG&kw=s zV+Urzu>%!w_+15SiyfE)t1Iq66WM&)oc%o9V_(`nf?AM$iQ{ey;JBMJh`nxu-D~a9 z$0AsL^zkuR-99Mt^@7cJ2HFipzH4CfX^(uLfYnF7>tJ=}i?~n0#yR7N`wXl;;%LczOusY+Sk8i>D;m#G`R;XEPzsi1$!^pdm|78;rrgZ|8RZld0BhyfB$=*efIg!d6Tv1Xy12eQM47q z_;0VaqW+C5+F^=fWYJakwWTL7ov~r#${BO!9%jMlqN84C&6r|nF$CX^ox6PPdJ|^l z#)9P80Mt?M)ytwzvekOyPHI+cT3zqo#lFUV{i`Cx4o>)5`Fu})a` zT(fT3lK$muj_vE~Uul_rhv83Jwc(Tt&Raz+QxwZ;OP4G=yKh}ze^DG)XRR)ZeH*T* z(arsxvBnDboHm$i#65#?M=`vDM-1X2^_fNzkHPHY-ctwj9q8Nm#d^hIjKE~0} z^-m$T*8USf-T2JY16HG~n+BeR?ZZ0n+ck3b*$?lVk~e;88C#QnPXo7A;{CyQV4m>+ zytUr5>kq_REAP3CeW!Bf4=Qo`d#-~^ZYp`-u3Up}yoc$;&hPp|@b*i8WA~PGUi;3# zieljC%zr46^@;t#bywn<;Dwdgy-ujav%xDX@f`5^m3S_ATP23BvxohwHE`H(u){e$} zzp*{k_Y%8Ke?PCoy2Y5a_BsYT7TZnFrxtdtI81Ik=jg^i6LVkr2e{$m@qQ0cZ|+%`ocoF0-+7GXN0nzB4sOF-(^KJ>mb|s{ z7qhQ(JR5Ug^IJ>qIbi#kyQZA)xnOx~ozFMp=X~Z)#N?buocnq-xcb`D@vhZ-{)6ymU>#WXy_{L{ zc`wU|<#L9z!0svUeJscOd7iWID=<0t5<9oE7|Z8;XM;VT@51w4TWYitY=86iUxoLx zzq!?zoc+X`;r%J`hqycEtJ z)~J=S?{mgB`UWPfBco)1Hz8rI&=yN_;edMFh z1z`D0N_}1dmaAcz>y_ZVi5_tJZ3f%VeEPi#ET6xBuLgHv&f%S>?loX@*>?c!TKN;` zdH{Y4<~#$~jMBWbAz*XfnOb;m&!79a5PT@+p0Q~8S~#_|MlHAE{nXOj>#&P3dy1pM zNU$1sH-}--;9{^En9tcR0n6uXudn0()$|Q;_Vaf(21~y;g6(HM{kDPSqv@N#tu%cz zyt(ZA7O-pOqv>10&SS1wQ*&ynCZ1m%qUqbfGqLEYkEU-2tEn|=dMVydP0hUndnaa3 zaWuUQ91X^TqrtntYG6JZyc;Z^v%Lo_SHsfpz2Mx@IB@#C4{Sg4>GyuHd^G(4xRs_K zgg2LcKLmEId^Eir>^$b0H8rQEYU26TA)0;|JPT{3=@sy5YK@v+iT6`eb5~&>!R#rH z1|J1SgT2Ag;A3DlFdq#*4wlc^t_I81u=KkIY(L-Wcr5)s0k)s{^!p@OKAK(&Zl&p` z;LT;0Z6 z_#8MIOaMoN>%nSZJ{sHrme1Kf50?MR82g;Iz-bigXdtaH2n&^np&f#x8nWO)ZA^@?U+5q(e$g} zXfO#J4Za3e1M|_~4zPUAb|+Y_hNa(KVEg$_Cu8Y%H`spW({C48KAPSGZl&qh;mu{= zZ-8AZA5Fgrb{=!hnwnEnHSzrF5KX@Yo{P28^j>&1wMI?9jrUVibKk+fi`i2g4Za7C z22;S%;QL@TFdq$m0G7|$eh8LR)6DoI@I0(KV|xA=-k#Q^=TE@$(e@KWKTL4+FmA)F5l7>8@IvZZovVYK=dvc}8UmKjyq#dVs#aaZ zi~di~q2%n@sA>E^q+xPcv>Fa>rPT;{bJ=?&*tPP}Y82R+%r$FeuBw%KJd7A>qJGtP s=zBEIZ(eVFE8cp&@pWaaH@>or^~RT$vEF!V8S9NVma+a3W|@yY24Ke_Y5)KL diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_060.spv b/test/fuzzers/corpora/spv/graphicsfuzz_060.spv deleted file mode 100644 index d1fdaeccda380caa4422832fa66fea2e903e9415..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12388 zcmZvi2Y^<^)rLPh3dVvZ8buHb7EtVnQY?Uqf}+NbyXyjru#3xrB~d9VXt2g!qQ*oM zjWNa)lbFQxrs=(!W_ph`^?B}hUo-#rGr7m}p7+e0Idf*_-rXew`i~jXX!L6g<$tgA zYgBFXMt_(_V_0KwrDx2VJ8S&1zH`U#f51L=cuiwK)z3bgHik3?qWdFD+Pb=R=#|?H zB+mq(0adK23>t*D>^}%*5PjNvyE@JryJG&nlk78q*&B`JE5w7V7)#sw`Z{~NyDsi* zcCydVSNjZUYy>{MtGliDqPd-Iy&Vf@w=e4K=xbD?_1Tv8b}i|g*S&m6duQ)5>_Mzx zV|05lZtSwY-sK&ApKFyj7p)Zep_l&3&(5)UR?8AqkC(-4SGq9UyJUl@wVu!aXWBxPX;z# z2WDLpP-Hl`vcwwI(i_YUahng%vTf|s`Swl(J**w_)fqi1nXGoOKt zQ7!(_E%r_=_LvrX=N5aH7JJtgd$$&QY>T~ni@nGHv8{TeF>l7K>GSGE%!J9g!_}C< z`aNqlvFF7m_Pp3;Ql*>^*JIN!=bf2BOwWjGx5c(LHv8_`gcaVaz~c%$zQCR{n`8HG z!YZz3&hzbj`le+)P~Za#d{BW8F7U(xA5vh?yUn?{ zj#U#MTHwP9Jh{MA3Ou#I-VK{^yc;(0v?i?Z;RW{2*z9ve6IS@h0v}c2=>?uq;F$$J zy1>U2_}Bu^D)4ayKEA-S3p}U5CluIwZZrQAo3O%j3w%<6PcHB&1%7>jPc86i1wOsN zXB7C%0-sgjvkN@0z~>aWt-$RC?kKSDM4M}@UWhfGU$ISoL4g<6*t_UE&Q{(ZtO}wZHD|}voeHYv8g_Y`<(fzN*x53JrlzEf=@$k6xb zXyW*t6K@UX6VMoiY(wwmXl>Ur3VQ|GZ?*hr>^pCJ>^GtvBR7&w$6t=Nuj`Hf3b0N8m1y&g-(1!rj^C1z>(H6!D)0cr znqQ4}j5!~lTRXxuwB zIo*I|tz+K^{tqqoo3Y)u*f)U(752?w*B}2a;9-S*D|nN_z70IMux|(Zt;qO0z#|I# zPVmsez6gWYJXoMJ3%bFXIO*{SZ&eIPma z!1})x?KtCqk1cHd zyBD_pJ!*S06|)wrk(a5_188fdeu3INh<*oR)BjGie)VDay?-Yn#(0dnd;cD)InVMd z^wEA8F_vS+89Nv3*oW$|?*hx2&x_>t2-;>GeeXsdMT{d(oRh%DnZ{{%eeXfsQ{(7! zopRn`*I`^^7%MSO2A8=!hAp=iF_-tEZRVoyapZl7am0yp3b@SW{n*JxpSj3gg_w(R zjbW_B@Vj2-@&Rl)^Ea0dqHX4)?+N5Xh;hV;b1K+4smq7K$wi;J$lZjPi*b!%ti(7C zY>e#DN5FFCZ!S-wZRVoyqsYe)M;4+u*VkZ}U z<|20&VlKuthOrW(6I|xl{ND?W}V^?Q@+<)_ERSpX=Nitetf(2D?sU>B~9?(m(4g z@7y4GeOc#Vuw2$T1T6Pxz0RRv=aBbZkTt2F=LEXv8-ZQ3duxB!YfUyr+pLLwh9Scd z-zDPIWD{^|vJ3sSQt6KGPoHDPg0(a6Qn2$HtLbaby9NFA`5rNk5!mJ;Z!Y)2Z3*_S=6$*q zww%IaswEv;!{?~2dZxyQRXxn6Di z#eZ1sFY}rVCqJB##+?G@ss3F|U-+pt?_IP{YBCMHp_&|SAH*~2w{=g%`WsLC2z)$^ zV-S6*%aJvI0Gu)Gm!BPu0-J|@vZm?a)>_YilTWQ?g5?~aaYutQ&RS{PFZu4p{N}rw zdYkV!M9z0p&XSyG#dG6XQfK^le2!0@j=`5YmGwUsUSGbgv%qqXFt6Xq&=!;N%l`A(*GSzxonazKm=9tho#9+^NeVaO)nQ z2PdDOM;3$S9Gh`Vz!~Sf+V;!d??Yam)7+^EV7c5WeRAgMd3F8jjNccZeR5{I@#V~x zHR*xZmpio-ESEcVKG<0D?xptei1)-f)#mTF6%dTXEBJGBhmhuHKlul?%ew*s8} z%Cm3*yuQ@!LU8JqJ-G-@K6mP3Fi%x4$LmjB_Jc3))En^0t*YY?uG;oXoz{RiRHw_~^(D>~;Ka%N zSHj7s&)T|Ac^=lm$*-#GaTVBc@^`bB-t()$^4{||p>3WG`Sr*(h-X8b8v2d0hWVyl zi;t)Jrs;F7dqc>3MvQ9=V zKlQl*yY;Ny2q&NVycsNKoQ%5(oN?x)ZNKDjFmrfcaa@m%Du{ST1+_Hn6ee-9K&btoPM9)#mTdh2~~Hx7R+kcl!?Xorq2U zUA14G{O$%Pzw&Os1zun3b`LmpbFF?a?}d}ke%%M=sqVJp^`|bA;LE%HR(x{VtNXDX zFP|}o;xF&^+wjR{%-gXYC!aBg;kW*IA3RX`{x{}9Y{$uGZSMfL-p6;s$>)9W5LnLf z8TT+aJW|C;9quz9NQu4CG$zf(Siwl4O|Ir;?H9LqiZB%FNq{!`%WeVO;C;q~PXeg@1_{VmoQ`ZLdG!L9Rr z4o*IOJ`c9;eV?GThpY=Th-q8BK z46iTi`wEz+TAwlWXP&QuU0*rR*Wl#S=j&kCSJwI)aPnE-H^DsB`kc=g_HljsT%Y@z zzs0z>iT^Ed>sr4JC!e)`2fU%ReivR}*7`j#PqkKK=+8Xg2e;1i133Bg`60M<lS;P+V&k~U;oY}w%-ki--X{1&$w#8>Ay$+ z0kP@-W9?VxyD<%)@nRniHs<5J+t#7~L|^;J`#sS9Gh%G#5@+lY^eJN+u2cI z`^c{)zO|Z;$oo5o>v5fOi8%u-=XtR%e_=jr>H77h-^|(<`)F+IoWGs^m2viw_nrJV zY@2J+_jg3jHHj0)ztuRuXF#mqe(@h$`;*`E_>!N#^qU3N7yCGD^UMEN!T=Xm;CxGQL-u;s+#~Vl6 Uvt>NBcFvz?!+PDwIPb-O0U7KeVgLXD diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_061.spv b/test/fuzzers/corpora/spv/graphicsfuzz_061.spv deleted file mode 100644 index de10f68b28ececfd7da218fd5c0070b822e7f1aa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9564 zcmZ9Q1+k-l&aTS4Y6&^jj1;ft8e`_{6SdvkT<>&*0^qbpnEWAl>T!SXzs}pzm9gGd`@w*Y3!S z&UUbUia!eMTa52VG0Y?^}?wmOb2sSyjvT8HpnE#xmu~ zncQ9B9m(AdESKq;T{*LFRs9a%?z?!qW9^@B)ZYisukSlhZ+!2~?>fG5zp?oC&Tl%t z`F_)-Z*NN9@3ZvnrT%#K_sn}R?aAS=1F?J7oV>%koQP`Q^f;z#y-U}dzZX;fDsuG4 zGp!-NH{IiXlcPVO<_2RIk>mTC$ehr!YwGL^w)PNa>g)%W zPo4e2a%G(Z@a2zSweNEh)7tXt^*-dp-i2pQVC{ zOlz!Wuc6o}HRreZJ~{e_GOguWan>FNcCCFIhCQ6=w$O>b1laYD&H3GmeQ$oBV&7W!oC zV{-20J9aP6?>j%1sjj>m&vabPKUeqn_?mOwJJdJ<>#*0xPGridOPty#ft$5YhLgXf z?%xcsTst%CP64|vZ%|Dg%u|?`)$3-~oWEl^_bjmWjOBi3gS}s4>DL^v{EGT~bHQ?+ z&mQM2+PC;JePi>Op4Gma?>X(osaS`-FlRnf&R&SK=V@SjAFZc@<#I>H1 zXM*L+dpZl>`o?lkXM?>bW9ivBVENqBxnQ~6Q_iBzJ)H;ktoF`)&*?p#k9F7!b1q=Y z*$Z*@yb#=ocEOV+Vp8TxY^5#;pFpsbqQE*G*fMtVjXHTb{SJnZQ|6v z9NesZ1)O~JUI~`-4zlhlaP#e44JV&_x&|y)-qW@C)-#rSx(@6;8B5Qu2g~Q4ZUD>W zo^lp#?&(IbXSH|cdro_C6V_ob%(Pm)J!QQ%J-H3s?8)tL z^0}uwz;dIRYP%EbP@A#4m~v_pr}o`oYnR{CJ^1p;xwprjWWXPD12)gjKmYj>*g+Sr`; zxjIklziU@wS1}#xc^+#WZS<@LTO)7eg%+-=F<3R|zsR(fYsG39fX%)y)iJI6zKnf^ z>2Tjyv98r--`Bv_$iA>?abtS6zsW@^D(fTIpIDI zmLJ8;8+`+8J!5%$p8)&z-e9KwC&BW$$4`Of?1}gIX{^H@8v6`W&a;S9=dwAT-N^(Y<~P7fvp#fKL*R0=Xzsu$^Qx1nyc!+4}S`l%Uk^!*x_3> z_9j!#bBNQ!pM#ry{so+T{$~3nSkBt^BXzX-4gM9_ee99>Z!-O6evNgg!<^qR<-p?zg~l!C=C}_Q{xf^wpNVJ^(lM{1;9>XZjyl zu3YE;aBy9zu^XIxGTuVy?Ws{HTH&+kH)pYa^-vLgWuG+ zHk^Dk_65t88vEf}&sa3BqmM>oYSb?^u8ZH)*dI}~G04PU;z+rjwO zH!D=+7M*ULb9{5d-d&0>_ zZ-0bPWaPs-@i$lP2 zqp7E!)Y0bqnF4knHJa}pem{p|9qKUWFs7V3#L;m$xT)g^IQjgob|hG??AuiQ^ew%a z1}C5QHytcj-tAHN)-#s7JsRxY8cVHX!1DPmITkFJ-;$g~n_e6T_N?~De9vhwj>kIe zg*hiMM`R(StY4hIB0hhle=i0l3+l z3*qGRTXGRtF25zIqs{lT9PB=7G~Ye^elEsFhdGxp<J z-2s*>`*bJ1wTz`tcY*DbG4<$|-@x7YO+EL($w$we2~qw#UDT>0Lfz?UyIK8bIAW6}5& zSdGTis9$P)8efg&{wv_*v;Q+-x$?K2|wc{QAT^u7Rgt$h0MBG^6{%et4q^7-yw2FuwWzol2e4!zbWZ+GVZ0n&?A A+5i9m diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_062.spv b/test/fuzzers/corpora/spv/graphicsfuzz_062.spv deleted file mode 100644 index 503304c3ae6d78d8c60772fea61ebc2370732109..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1824 zcmYk6*-lhJ5QZBD1Vja7lSQ2ocMuf;Q3M82#)U+T7hVz+LP(HFkP9x+=&kSK3&>Mx z)WpQ^JExnRCPh{KwRCk=ohdbrw1m(QTKRh!^3xR>K|*K`Co*1Jd9yP9aerfca_WvA zXF@4+)Tbk~geG_+^kIE_SA$luP9$+IKq_UqssuG-E&4Zek1<<2Ys-7%ezA#Cq%Y#yw?+u6+QW(r}gwz9nTzP?l63!w&Lu6C#cs>K|LnazBcR5<#o zS28X4wN{UDt+|-VZ3X#cLG~Vx{-<&=lTRPZO<9c>j`b4#%a1YE=;@{-o$v}+7hJgy z`7FE)^^>I=u5Rztd!lX+%ILjt+MD6CQMVUjqv*!=K_MK@>fev#d&QIe9I|H&i}?p2 zu_E;nI|x>WQf~Dj$YU<`VaWS?sQ5g5AhZSh;C;pwPtu2oxQIbNYb-}6G2f)_%slCy z3UUKvUCy=)d9c*+djq!b>aA#ng`WQU#S^i#i=PNeN%iRm-?{QClquqkr8*}-Mm~Rf< z`He%yz5;cBZbwYqW8c1!SDPQVc6a0tdGEr_FaH_$VFKBm@XmYCB&5xGyVvf3HuqoK zcXB)XDM-6J@r&A~;o3ca(Y4=)#JyA58fKy{Pc?Y2b?EZ|dI+T&{GO~qo8P0hRKqN? z_Ef{8XoqDrXxCrd8kFs$yJt_`yU+X|g!|jzdn!;JA9rdF690;i`h3LfXNq$Vt)UpV zfG(cms>ou-t&+>xEJEh1LZ2e`7}=R=dkf~gmmq7^_65vZ{k=-PKa7~aTjJI-&xW`+ z?(HJ>e)tneOh0?zd!9n#?u&OVL*6HDO=8Z&`DjabIfwM-;!N$cx_e;1DaBcs{Fa!MunPO*` diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_063.spv b/test/fuzzers/corpora/spv/graphicsfuzz_063.spv deleted file mode 100644 index 75d9b4c47bf1939e2899b1a39d7ccc6d1554ea8d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13152 zcmZ{p2bfmH^~Nvkf`Zt4-?djP*br$pEU4JKxZt9zz~Zu4uwn1LV(-0oMP=h#MvSq?*ZR-u-2j0N!MbSnVo8!e~qBwj~+vvk4ws&-{X5L;!AG8TAV_Q2rTUR?`OuqrS<0|K# z7u!Lftlg(zsEr9gb}%7KgWw zI<(BQ1b9N*5$&B=eM@3vUzY;c_O-EC+PIdEmT_fVW3fyfU$%}f_cPv5EDw);Zvxl$ zy`g9ZceYO`Ygqw2v9o3LVOVQf5$gh7?@Hn{|H^fIm7np3VpVu;9gPK#vlumLOnE+g za$4lJw()Kg2V~bH+d4-dQqH-0%~j612KeBPHXmK-TN69!2ysuU!#8&1)*USeZ_(b~ zQN=VCYoRmOdKjX5mR#J?ItE;Jw2pJ6e^%dSb$lQ^=NnY#A6&#M^+oFvW0Qg85+hD^bWC!y+dr`xofb*-WN7??+csQ z_s_NsdE*_E>)TR56K_?6CEhyWVF_=O@U{tWm$2`t&79lUV2Ot(?7M3-W``Oq@s0`m zPTP#xsRm0tBH^7A-X-B(6W%T1-4os;;XM=HE8)Ep-Y4OG6W%Z3{S!VQ;gJa+n6P(^ z%{4ZasD{03Z0g=MHgQW0me~8-rtbZ16PGV|gnYsRm2T)mAq3BNIL< z;iD6tobWLTADi%T2_K*E2?P3{O!%&Z{ifO6=eujL#P=k8 zZ^HK_e1F0ZB>Z5)4<-C?!jB~UXu^*r{P=9#Sbi6mtN6m4t|!3F)chn?yeJXVuuXK& zRulXw>|Av9X5O=>vBs*~)ty2MXY}HMTmN-(qG1k)m_&wuuXK^nic;gxHo+n_^+_8L2WrIT@0({ zoWI8Qq^k|6_~MmjF2~KF+l+q&YrJ~+Uj=td{55c|#9s&ho96g8z^>8x9q;;nL+7>_ z8vM5e`+=_CyVJbZ z^E<5jujcyYt5=$1-P_;OZN|TgHQu`QyASWt-Rp>d9~}E(+#l#gasAL(&j*#J?m3u+ zHLj8F9Dl?*eiq%D-YYQ`u_yB9yMd--l1yd`mn;rN4+0`olEY#f2O}OW5&SX zAH&Ct8B^|^>-&U0H$D7+0lzY1`0Ty?6n^E@se{7*8N6S=euJI=bFk0bdBXn%xG1K~ zj{g!yzCmkovbw-u(S3f=W8BwhS594Wc3t1VJ&WQ07Ho?=-+|Sl8|QldN_T%^+~2@O zF=TLz`yS>RqsO=((0mTA>qo55!*$93j@37d?sJg4$7(UpPvD}MGI%4-wfBrQ*u10u z4*LhzvEDVS(%m=t3)nU4_?n473+`LT*Qw*{*75b~`1*-Ef4{`dzd;?}u#Rt3$2U&g ze48Y0zW#N5(>gw&j&GK@`TQ=${+Mr29UolBht%<*iMzj>*YPbXK9m#oF8KfG-V5G^ z-UkDDEBd7q*DC!Xy;u|8w%55)cp`)|5UzlTY`*4*Ygjc$$y zI4>_@yWvxNkNyv0{68ou^_tUla zXD@u8dXj&hD%SVq1G>3qVdui;67N# zI>uOIjP>r+@ALm0ybRdqnd@2>P5nt?d>5Akt9=3fksQl|ZN8WKn&@htadE7>89b+T zuYj&E-mweFrDlEJ#d6R6ifHE4dXKDxU72pvze?rT#yMFPJg0MVA!GE#Iav*?7UyJj zxLQ6ZYrtm`qwh;>tZPkptSjFgYoY6l=eagmEqa`jzG(cgTHZZC)V>ZlYR~V{Ma1cg z+SdiEMeXas)vP^gTpu1a=4aavU0>9=0od{CUo+lk;P=n9i~aU}Rq1~BtX+L$uw&!Q zZ3yXKi}(6sxMv~m$4kI!uhNazr{+2EOn6ST zG5%6~#>9SXf^Say(H~u3oW)JSYVk}4fa96yi~N_7Ti;#PJF*$rIn{kHXCa0 ze)SQo(eJ=exbvy|4E*k>`3&Oy*T&tlIk^6A*#b>H?v^dVYBR~@-Le(f<{s+Xny%&^ zisN|>1JCJsZiB8bp64~>QnOxvFOysEwrJ+mdbezc-JWjKKfLm5<1Fj|j^~u$&ubZ@ zFZOLmuv)yIJHgfR-7*5M9zE8zGg_=G-z~eK>x*^m3Ra8Sb^}Lk`r+g@l;sNk{>ofY%k^M=QOmwywWwu3xLVv}z8m|) zBUgSmZm4{b>j2`^BG*W`T3*+IaBFoQ{hkSbH}_eHHwAx37Z1R?58}7MKc5-#sjfSf^&V2gRVqb2Adp6@;ya}upcbz^p&!uP7bE}Q0D`imor_x|4BgG1pyibE(H%hv8R`J8dl7`PH4@ zdu|-qyUlNvd^}vuSf8IhHJ?Y^P1?Bk+QIer-UKxDxc3eRtNo2!-g_Njo6kYtM7o;K zK^*U3CwNYKF$rB??8V*WQnTKHV7c`kfo4vv_ui4%qv$sMM^}Dr%sCkxbLMA#47$FU z^H{K2oWtY5aSrvx^Sy_;^u;qd9;_Dc?g?KxR-kM#TrfrtHm15fUD&-oC&usf6vnIvl#?-ZQ{Y;@9E+p z*tm;^f*l+8&skvaAICao2;CTK>%yLmzb`iKpL5`9jx)DDwOGr2aL-7*H}`|pUZoqa zPtEh;S@Ha6WBdd7jEOxv7hmjIzW*O2Mqk`N=Ybuo?zxwHEW5nr;+>gT@s~)*8!ml3p%f)c# zQ+Gb^lS{z)ez_E`W~}?IPtE;~J3#CG@*}>>zzx`Z-Y-W}kMn*7cx_^4)WuCj*B802 z1e@!9y7f)RUWKOa`H^1@cAR>w>l(0g>a*s}iBpR;UJF(WejVI(#orXJha02rzl+?L z8^HXOe}B~w0J~0W-2yA`&zvuT?*uQ5RllA3)$T%5zk@Zqw|9fpegc0>k2&u_ z)0ey7qglkgdTr$?SXE4n!Yh{Phoo|JQvva>^}0u-(nX$4tn$iufa*c`!!ft@3AK9F+ii@0sT`XcVZ6lYH7QZp{b zYzxlyZwI%Y$nj9hVXQgSjLZAy+UKU*o}tJ7^-8!m*!_E$@v(nPpgDi=CF}T7b$sbM zzDylowvI1X@mTNnaO;TmJ(AX^FXD!S^|@Yal!tEzusQdfcGjN;p>zhtjbAEB;*@GDO zFTNRjg4Ocgszv->VB_6e&xSmFdxKqzKF^7~KX29(*e>SueRqsL_dDv*%6%5rr;VKZ z5Npn;Z(p!l)Td7^KVSDb#_xyEdSm?lV6_yIn^Tm6mSzg_VaD>nco=m%Z+hAV~tw5cYb(%sJ&unW=Mt3MNKJ@$!snWe{S2=DHaNzA4(F$=SAWEQ0oFG&#eNCr zr@Z&{yEe60+e`QsrrTbo$J!PFySA^0^}FwSSE2jekF|b{&p6MmKDqyHv+i%e?wR`I RXwLI3n)*9n>yTT=e*h4X=Sctn diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_064.spv b/test/fuzzers/corpora/spv/graphicsfuzz_064.spv deleted file mode 100644 index 0b902cb2c9ac39f910ebfcd077ed74ee4f9cb15b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6284 zcmZve2Yg*+8HZ1Dv)ZP6q*bg5MJTisf|NFtwnNGwt7kKG-)ra3HgnqDP9OMH@QbGW1YoSNkccT}U2*uI_0e zc_jG!l&?#UK=&8NiYW3LlSiS)D+7ZAmCBjpV>^qZrQ)tZR%OlQ_|6`voI5cxfZf1K zl4S2--?q`>-fZ`)agT=2&(iu3yO6YDSH_2^QAmyi$Gi6Y^!4;^>)Y*tNRsVD#JgI7 z&!>kRInPoLGx^S};S;v?eT>cL9aW{%IA^zx@6ou&O!*4Q(NnmN4oSLhsfBbs2Hi&d zO0;+}5yzrik(yN3CC8yX|ME+SU6t}l(n9QNu(ti%u#ZQ}nbV5B25qh}ZLI$Uw0?PI z6*2nK!<=m25_UUWlH4|BpOo6o-S&Je*c|t4Ih|*r;KUZ1>byYrBTEh>vUa zJhf`@=+|C{#M;+`tGN&QJK%g`)>FZU4;|VVw)g((tCnpJ`?RWmQ`j3*yLZaJ37e-g z{F_sAa?0*Z?S#8kn{e17kz08Y`n9(rt|Q`42Pc!0-QnM+O+?r|Sl)YW z_hEZxAA$Wiu*5k&q6wL;#|g`jU>rrSHzu@aq^1w&PCfV`fEFz+$o&fW6+)h zAMeUtSWiMbt7qNslk|~W_agFFai3?aL5*+Cv;Q zUjnvAyo;BDeHZe^_-%d}A|Lk4!LHjgp#K$!oN=)ya<0oY+EX1pUkSEn?Dwm{a$Awu zH@W=2IeYYfHQ4@_W&JM)%lWq<`pZT96=37NtKOH_AaXvzy%sE2ljE+;xLWiMPVO1# z*CFN`uYU_-&pNced#SJ<@$Zg%Q;+x@kE|o^ICKNzp1d9%d-8^ik9&3%ww!Bp=Bp98 z6OqVyBiLGz^Cqxdhd-O@L zdHSOFr@$K#eZhSiEWa6v`kw*k>tBy;oP5;(ELh%kIJ0L{E^2%Z>^j2!JlL}kGk*ar zm!J8I*yibr`ECF^v%cWI1ik^u&-`WV{LEj$HcsC8yeo2I?@4Edy(8i{M_&cUd(5BD zufglPp8f4Ye;w&WLIt0hWvS?}GF7zK1P$6W;-6`#xe1 z^Yl5B-xhhX-<58}wcd<&Pt^V{xCQ+K#7F-R(fZZV|3_fw4g1HL9p~XE*v805%um72 z9QMyLJ92)GZH#=}!(V`{r7zy|FTwJjHQ)2E&_2FreZNNJoLTG|T$8qZ^#2VwzlPst zcFglTY-8jj=l9_J8vc;kk@H7vW8~vr{t0X?eNpFDu=g|8`Dd_k^1h!Iv|Pmh1?;TR z=dWPzseHuz4eV?Y^LMau@)7e7u=g(d{u6ARynW4=i}>5X&Z5u$+WI_W|3Wz{}0$R81erF%SF6CIp3G(&-bN{{M*6Cgnb9ta~$7^JHgG!T4Wt!+$!{4 zh`u;KcY{yQ_-nKKau2q=vzQ+<{ts*){WtPU!FB&1kvA?Re)rxBcRON?=TZA+ez=Sc=L^M<{4-oXVy0pnT0sBIC?aL?dg0=(b^q+-&ccY zgX_`q{{GW8-#X^|uIGT8(6PsJv15-r;3IAxyuSF`Hy>=Se8emO&&btUh#j@^=W7wX fzNobrY_5F#eq92#M<@04JHMRsyEpe|zu6xEa|BRd diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_065.spv b/test/fuzzers/corpora/spv/graphicsfuzz_065.spv deleted file mode 100644 index 437e45b06e2f23399361fbf6a1d177957d8444dd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7184 zcmZvg2b|Ys9moH7$AN5+C5m|Gp~yOwJr53)qr!w}FG4`XkSm6^!%nuJy0mp4IDCckbM^sdM(6Gb|WZYpK^+GrTsS)(_hZF50kly9u+#M!<}-0Ia1x z*D{(~$(Hr{t<;>i`~3R+{prwmY~6n0=8e0y_HJKy$<|#PFCgB+uKGqR%(b>`TfcJ0 zhAk_4dv|Oy<9x2kd}r$S=RbYNj?FuJx9xU9>smN<-;fW4c7xXX47J+&p4BVYZ|vRH zyQ5ZHRgd=7cJ!HA4?XVFv-Gg0`#SkZuFr2TeD^vS3tA5(1H&;!uzq?T5aMHzoot>UHeBA@sR~Tw&0@*KDyvz3O=^tqd3tx zcsp|+hn0_okH@yv{eHFMvHG5U9J@QA^3`k_zPSmYR@<|5I!c>A5f}@`Q0JN2fEwAS ze-e0vF_AUBFV|`#*M@aHV~Z-^J2aNwcDTd2y^A&-hIxJOt_e8bB&@yebu{c0Z1#RC z{LVX8ccpJKzQexLu-?0US$7KDdDUWSmGjQ5pH}6JyKjAUvfeW~SI#&c?w*WUtM5B9 zmbGTUZ!7#xxNBvvr^9E02}J!s-KR14;s@s3#xtL_!u%|(`^wq0v%xuCJG)aq2j4fO zZ+}?yg!Me}3IRaHM|$z8Yq}g>b*+_>16+3t#THko*$(n!@jbPcHnW@J)rk z4E}<`?}lGp_{-sY3x5UthQdD!?mcAvv*GHfUMsQQW$sqryD*k_-vd{pU^*|@`(6cn zXJRffzccUI;dgf!?=e{4f$OP}cee!J^&Sgc=Uk%B_qZx%+~GZT^X*N-t_HrNcF+Nw z!@D~Nm|Iir>G4&}_*GTxT)1SkE zn|b^u)&uX^xx1K0-x~LqeyzS5I-hn=wKuhQzA2!*E6=9?9IQRs+}$X+cV~^?*#?li zI}dJtCh+byV$C}|oB2(^xbw&;rVPJHLwO-nQTy%X$~UUC+2WZpAuW%iM*) zm}|*BQ`R=Vuey)t!kx!+InOq%!+FeI1dKV4{IW{Fp>X@uFL$yXJ`kA8`|E`pPtEh- z*4Uex=fjO(%G}=d4q(h)@7A0#&yc-n_0`zDX>+&UP4-sarRTqfHT)T{6ZpN(21EGv zjqL(W!0*Vsy}Pl_uk{`H`}tzv?`Y?{1o$&EZ)7yw-^=Dk0(1FBUkL9H)Vc%Y{4au= z%U!=1ZtVK%j$Q(HUgN&4mtvjQ;XRpu88Gf%U%JM1u*U&YRqUBil6ku*RFqfaXZ-Sfm9eAH_#+rAy2lM*I-Gkh3!!=#Ubw$2K=g)fO zUhU7@ehXYZhXH$|&s*W<9ErURp87SY?3;f(P&4bzyG}IH=6&sftGD-Wk9)Azx8zy0 z`A$c`eFy4fP2Q_-NZ&VZk2XDiQ=>t8c2_mN{p|l8@QZ=xP3)ajtQmWG^)}uGx7M6L zpJrj-4O&14$eVgk70>tiUVLK*tM~LixUo6F_p}%5@Gi|=3*HYri#%`m18{%Vw1e^u ze-PhXerA3MJ`i+*?CHaB+<2+gja7}gQmfD5M<;F0|9QAM`=Zqs;L*x_ zYHxz8m3g&N2hZ%;qtzGTYPATc)y-IkTA8~A+zRZIN2@Qv8)@}r;^v~&SKw;37(}bD z!i`6(ufdJk8?C+$H(qM>jjG06snu=xY82%B-y~+vzG(F=c(gK~+S}o3WnQh+!86~A zjaGNS)oKY)t2?m{wKDf@@Eu^EJX(Dh-bkzO5jPjDz7JQcE)cDL05=}3eh4>aZ?yUm z+<2+gkE3o!K0P=)ZPVGEAwil4xZVwN2{O1)oLkFt6yLp zYGv-1;8(ytd9?a9ypdLih?|R6zkwgE)o+Ozk5<2f8#@G|)$ifPORfHZe+ZZ>wfZA| zBdz{K+?;*U>d)|KWj zt^P^eT(tTZ{AjKIP0V<-`VZWgz0vBwaO0&`|Ep@um0I0{-$<)_iJP-8THObaR_3GC zVYphES1Wb!%$_}3-49o*ZlG2VU>#~@?m_SnuumSX9)>s4>i@*eMXN{PM{DI~jYq2{ zHxKNMR?YavORZX}8gr#q{qP%U)k@r)ebK5voImy7gXW{v0JvJ2S1Wb!%$_}39Yap7 zmIJjKi0@DV1(twzF)ms%ZL)tD=_ z8in6TtI@>G*%z(G!1+_x%6zmM3s)=iYNZaI*|SHhad5R-0o3X^e1}?@8xM{L_Q|8w z3GhZ*O(1SATAc`2tFu6UwofExJX)OuH)e0NYJ(duwQ8?w%#~W5jNeGB4&vtQi&m51 z{HbeYK3bguS1a>sr4F9ivq!5_;c7JlsMTbAhgzA_KMmL?k5*IQjkKCd++4Jp23M=I zLA07q%y_h#0XJrEwCaQ#FSRkFSYXQ z57FWI)i3{UnGIK8-;cd&Q@%&vWoqZZeYbv>_BoHW`OdYeol9;2c#xQV&SPzUeri)Y zkKAE=e~;MbJl5v-k~X#T$={9d?`Qj*$J+e9*QRy>`MdD_dyjq2W9`jYbkG1=;)@oC`i2P0X2Y`LfW9?q7wc6A!Cch8=T40~^tgZg-vIO6}BeAY3W;n5> hRjirV8vYGF6}ya>{nneGK+OMV)UV1t%w5k1j{<9utUv$& diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_066.spv b/test/fuzzers/corpora/spv/graphicsfuzz_066.spv deleted file mode 100644 index 5585a6f8d47b1063b99c35aa45ffc5fb58352347..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3796 zcmZvdc~_NH6vkghE6YR>E72}mX@X?tn5hs6R+N^_6M-Pz0xn$!ZBjB#o9B6+{_KxF zM5}Mqv{tQtzsuS7uDdv_z4o)8J)FJId+wpGcKwnptI00n@26~GHD$FhS++E5tmyuM zBLiL2Gb3Hwwr??FSyopGH0JVbNmh@pMJ9%dlREUuEeFZ70jRE0tDB?-y!rSBm`$@=7%3D4^32TyU4P^ z{(-*1qowgu*_sWU1M!n1qbG)j$49~aL^*?dnSYR&=yg4|tDgut&&hauUWd5CZeK7f zw)?J4b~9N`;C5=PK#NyWqZwU5{BEnTThMauQNUh__MGM0v0D?CH-8nnfVeu6eZ_)V z$-fe8zBTo$uR>fc?6Mjid2L|(h`2RXwzJq*D>Gb;E+F=-){dUr!R}c=^m|77Jr8H{ zJZlj7J<0a$<<_P%E`W`_25nu>-B@kUJ@&fx0$zx}4%@xm&pFf^5LQpjwGqR+9rpEL z?_AiM!0s1z2Y4iBcY?hm;ol7QKG|;<+F4>YZReIV-tTn-VtgC+7PPT)`tA2d#1;0| ziZ#E#lgW&|2{9%_f5dJBvo6GL$B@g%Mx7mr55IN7w=?A}=G&F4r$3*!JLS1wweRMX zCtvOJeF?tWcMCrESZs#9i4T9imwhR3G2i~GdilKWl;?i(d0!89p3nPk&Bgzp*IfC= zz4-iYeh<&x^Yt7(FVDsK^*gIG*}FYB!uKz4``(6ayl-yU#{2Gut>528*!Jo@*WSy1_Sld3TQ~$; zKp#Zp6ju$>!yNvuZ%6#C`(Bw}K;MDLpC?B9PQ)7W`>5<*a@O!I7(nEF6RqLz>n=q8 zEHT=5CvF3Jk{I8}Ly3<%hq0~W8yR)(0n107d%<$~I!CbO53^Sb`aZ{Ss`V(?diw0g?=Kg19|Kp{ zeH>0c>OKLM%l9*gT|LK>aPpBi1eVM9GmLFLefH!1lk?1-=_q24XHx&Z%W|8Lh#3W& zH=kmTfsK=o?=S|I_ink5_gYTuotFQL-_BELe?#iu>7j^z8gc1=2CZKm`;UXI@eBK} zMo%De9mwC*(4IuBWv~@$IL<_L9GgGuZMm+bmel^ZJ9H=g=>|fg$`;R@;+ApHrQ|)(q34IcA=|6?mua5fj;HV#G_%fXQ&*@v92FrCK z&ZzwgVtwn0quv>Cb-lB2@~5fijISbcn~}&n2aY`F)Hcq(oxy$7`8nM`^3Q`KKjwH1 zPTqRU(Y=WA2hgu0a>f|H4*doqZ+v~S|KWAsh4_EQ`{-SCwIVx-^Zjo`?C(u<^z&BY z^Y`d&IQcl&cffLSkKP5lJY#+DA#&ChNA35)?%9UKtRH~oZth@ zxVq-oaPsHUJ^KbMw-$-KZ^6}beg`KXy?hUrGe7cv07stpL)$pd-+S?6^8ZV}V(-j< Dr)~`n diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_067.spv b/test/fuzzers/corpora/spv/graphicsfuzz_067.spv deleted file mode 100644 index 763fd34f600410af27dcee7ea725fc55ed17a554..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3716 zcmZ9NXLnUq5Qa~3Q)mW|s+m}n9=iEJUFV0=>ns?rrJ$rUJ=T;h5v=&7}F@@i^Mg5swG@=y6^rEG-y?ujy zo34+KY}&DNiy3W2rA#zuX3<(SVH?5K;Vah+7*(4EQ)dELrL5J(pk|_ZzJ4<~=Wkpp z>$fnkzR%dj>$TAv<5y}_Zl*>{T`p@_cVu{cSgDza^Ijeu>KPlpe6Us<8>#D7FN&ew zzMi2Awb9yGQ5+^a>aQ?~r=UEPX!f&s;W$u)WPo3mVWe?NwX98;ZyE%7+b{hWxf4a$2woc55Rq*UKc#C-;KYW z<|F@{KIwkzy{t@_v{ETM;MDbPr-fn z^XFcsTuE2+%ftCSnD}Q^mz;( zeQKl6LAZT6?m4V=V;+5bP>b~+hZn`ff$*QN`}<;^6ZmR@$UBKP?WgbehJOnG{=F%a z{%QR0+J5QW#m(}*dbU2^-#_qPz`FL>E7$iY`k55h{>rMo4e5;EwTL*HX?)aP^zyIOYm) zoO;xL8E$Rg%c%VdTs>+}hudRbdlX+iYF~vrPW^W(Uc>tQ4Y%(aaQ)hA^ym6#0(*-6 z@P4ZKJ&GLvcdQ*b{`aVv)6Ki-H{?~&0z9L99j~QW)S82@7PaQW)$&?n_)#n0@9XHs zqSidPTGW~kSF_gLbS4Yn>RllAav|Jx8jG?1_o;V-80&way5nQ)BDlKWyvSP&cO6|I z@|M8eCu1?kQn-3P$1;3%=kV^2V?85n-2H8E_tkS-4{m^nZG}f{-2<^LS!~qAaP>VPdT>wF7lG(?HM|St{jb4SxBsZO z7OtMxbN|&n)0o5a^89*${d#uxuZ&&g5OVbvzUI<~^*Bdt>Z<@By&4 z*13HD^^L{%Xaa7XJL!9L6RvhL({3g0RHl8HwA0xB^nZLC?s)T!=X2WMzePhizkPUL zcVq7W$Jx^nV6T1$2e2Q3RxlOpXN~&iTlYNHwP<7CX29c{XwGoT8NuqGO};k9_#YMD zXmie_oFT0K-Q;Vd=X>yDz?}QwV-WA(M!4^vu{K~V&g>Jo@j>8w^eNW3kLPAwU){CI zV=q2~yBCi4Kf%5G9H{%f*S8mYQ;+r8gJa?@#d@5>Gk4qLm+F|QMJgDO@V(xYy!$2j#94eOs>{%aQ-Gin-ZpJPqF zj;!}F^u^?HF^Ga~jNJf|{1tv-|zh}zoyz|+r!14#4a2SLO+!w{h7!Z5cygeIrI`Gh^f z4u)|U=N%8{AUW@-9p6I#2)1|jF8a0IkK8no?$!Ny-1B#=Bgi?T%sC2-U1lHd+ixW& zJkIr=I{JIb#UNP8&1kP(Q^8>x~T>$!>V*=@M4*82f&NuES99Pio z=A6Zzk)yPyF*V?Cu5%b~y|~9Cbp4*-9;3^7x8RmDS3s`hx-01B8?WDc&vTa+q`qHN Hm;t{5D06~Z diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_069.spv b/test/fuzzers/corpora/spv/graphicsfuzz_069.spv deleted file mode 100644 index f1e7950b63e26fee46f1746bcda1de9b8faff9c5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3740 zcmZ9NX>$}+6owmOAjrOps3d@q&8U$bNk~xQ5+Q(!3mV2`2+>I<4kHF!2u2h)aNoD` zS6F`F7x`VWO3UZz+yiay)T#5H_pJB!?Vg62>t<)!jI4>@&)L*koXv#Evbou;T=(=I z?QJ_Y}eRWtvY_NS{o@


A;yXvLU_6=uFw(lW?xCW-mvNJiJmDe7tR!TKOBgpzq z_y?-h+F;6=gB}}h&+~5vml8i0eJ_j>h%Su| zRm#a;gdQu^N+Zc$jK0x-7E@>0P^JGstu(Yhjg{9~5^?uU)m@5Rtg|fq?Nk2c)BG#K zfB%$!<^TMiM3(jU^d9IRs8*`^UK+An;Ogb^tOu`ic?RxB+xR;WR}WreUHZgpbL)oP za@}soRu%BA2`}YIuLieJ>o&A_1^9M!GqRGp_S5!GG-IzpduQZZu$$5P<+bgpPuqBB zGTxZY*y?r2o?03#xVCRZC zwcUf*?T;8+4usYD@ zdQW^Gy(3{SnP&Um75%< z*n0B%JsY{G_b}Lc`aB2i$bAHCuDpKFO)hdD1v_8ZkAbZ}nfB5PHby>T9tT?|&f_51 zIC*_sqY`U?L>T!?A3_4nvosE`TqEy>pS%<+IMIz+W%CaZM;+duZFGP|CORW zFWL4scO4RE^c>h8J`ZO&j<~OGMBi^r<#+peMBjSkPwKpYcKyvv`uY($XBGd8ZcVm) z^g98Lem?&aVn5I11mcYDN4|^R?&n2B&i@4KIOhN&A2EYqV>TiYQwGcbp7wAOY@WP( z7(%<;gT7P9FybD>QTrwE^x7}O$wy2j#S~{8fs^w&sN8i(6^W>wiT(PhHH7eYb2f3z_93`9+eg@bhvZ{6IcJM}b-_Wu$c-_7}8W8=HJV4A(KU|VBRvYo*`Um@0w|IDuw*M@cv)|ZR;Z@_Z#t^F1} z1L;Qend1!dk@Fqc9DVlJ_CMb9`W|USf0N7Ijq+ds|+1mt}=5Zjlni1u>FhdQsC% zuO>0Q$MoKN`2+GXpVF=?<-X7J44%9P=9=I9&di)S=gf27ZJ50HjG~xSOyS?3i*n2= zCc_lP)S@}*j?P`3%SXq0makfUr5@9ZhUBQvjN*)<5j`0hsPzvz;jG+DkUR^38d9z; z1T`_6`!}&p6F$TJ-TT{z4h)Sf>0hw{yNQ@)bbrE4DbGM{uxH8M6&v`U@=RgwQ2Wr( zNKcvfOzgv%eU|gXL!+qVKh^ono`$`zx4&=SSUG<-_MY**X`jukuI(7<9UVF_KGr|P z4y|i?NvE7Mzz6$##`dAz+e~zK*GR7}+Ov|~KTz5Y#W{dOX|AD|jXs=kQ!xkKKh`@^ zE0;;@%!S*Z<{OK7=tEtDy$36MK6?yG-Q_vt?7a@|#XEd)ts?a9guQQv{E`wTd})U50f#=9l`!F@8D5s*%QL(@!&hWDH6^w=S7f~X<&eLs zgbA9r|2T!h|X%J6L&zCFWtWcbbu-<4tC1czsJcL@{reQ?O%Q^JJr&G3C0zCXhcoW_kr`#a(9 zK$)xS^jt%+JHxdM@5yj?hIzu%u%`5QVu|-=yzh=fzORG{`}R8IeU}_!-#~}oyYE!Q z&*l}_kKKyT0kn879s}qWWKzFZp@+4kf-Q=HojI*7giqu^&Rq8PkHzQdiGC|IAcC%`K?ps%Savg#AQmZeGUkn`e9q(MNGE^1K3UA85P3S0Xc! zh1jn`8!PAey&CP^%X`*OqFvi~=U;=iCV9_S+g^}!{LR*XaZ`ATM`WeLG z{M*pZt2Z(~fW8|s$MfvVK6-n_dEfuSNBbR!xr`ONu6v4g-&xJ6UH4t+XAy_%z8h_< zI@Y}hY>rs>Jz%+5SNpw)xr`M@?7d)PPg1jcxDPQ-K78&6yRV7L=K-*O@@;VT*!vLg z_!wfG{q}xDKJxf3o99H8XE#{R?`o)u`2ct~avUFXd=N2@e5~~$uxlMfVyzE@6$H4ZDKF(R2{q-DjF5(#(r>(Dd z_bl4;S4W-QVC#&t?E%YKXY_`g@%DuA-lO(2m936^z2N+=_F~ILKIi0&e+q5Br_ru; z9@@7+ya;^+(eLAE{nYm4C(xfn9L_(Fc3vHI^nuM0J^3lHoNtQXg7&8oa~Ug+Sbs;2 zjWhiW*fW*aXBhoiL_X}#fvw-WbpG>*oPM!4IqS7{*Hp)v{b1LOdw38m7w6`jTz($b z9_xPr?E0sw^}h&~^No!4<--3+Cso_S`yqUY$L^vOP=h z+*!1ilk zdsXZk`BSvtmfGKppP_$_IGq0l+Ie-bMD!5EBj#!*j&y%2lp8I*T@#+B=UF8=Qn7FH9PlP zM9!MU?mzY*AM3Y)^F3^>?5L+5TOav|xfY!7;kwF>m~Ghl$Vbn0fX(Gx^wD;(yx&RW zz8-8p#@=rL>nCp?%tOnC|BYblkF`6&_N9FI+yu7X@VObRpM2DE3s^p{We2wX7`5yK z>n9&QDHrS93bwxJUG13L1-5S^*KJ_A#}WOVlk=YJS?^69@wbELA`yQFST5q7lgqyY z?>pk}1iMD``R~AT_PPD@d$hy;aqbVu9}(*iN1nUD=CS7aXzlg%hFX90h9b8=>Px# diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_071.spv b/test/fuzzers/corpora/spv/graphicsfuzz_071.spv deleted file mode 100644 index 3eac74aa43d473baa0a994b4a604603ba5610f1c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 964 zcmYk3%S(b$5XC3orTNIx%pN{^EDC8+5l9vYejA}hi$e@XjzN4{k?61&hPWy z@X9#n%$z$jcfM$(nKWCnlzvAxKLv{@VwSc<=!5=Uzx6g7wa(5@QDiL|3en^&X)*bT z>}B}$N`fr0yby6U5Q>JiZgeTG?4mxdTwI#jA$s~5;LJy?rGIu(mic;{!pwkO zs0VvwJ`Q{R5v#~wsS11G`>+EzJ+@@jzST|UtGXC*4sZWl(tu*`?Ptg^9Dvj3(kO`!edY2l8L8 a&w(&GcIV%5D9k&^b+i$7PV83|E@gkM-6`(? diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_072.spv b/test/fuzzers/corpora/spv/graphicsfuzz_072.spv deleted file mode 100644 index e24611579c4e411573a2855843c8a297d85f617a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20916 zcmZvk2e?($)kU8OqKLhBP*70Bjum)VKoNVd2nvXTC}M99d+!bG6&1V27&Xx(rf4+P z#Kbhyo9VH~bo;LW$#*n}lJ<|Uf5R7cN_?v&lIspBReN70JPEe(>V1JJ^) zwmPZQgBmqozXv(vPnx(11-&lP^2O69oH%XDNi!x-qvam7v4|v(b!?Y9tua|c-)F|; zsS_;CUsS-;gPM+d(v-0yr;nSo!?bDBkDABZQb)(wQDa7qJ#yNVY12D8b|%~L_^dOp z=om$9ImbPU8jfS_`LTI^UwqfZ`WZ{DFPHj`tJc@IzK`uY*2S@<8s9OliTOB|#pb~l z?p3gLe9Y-R54P|U1ut2!?faO&^gP(Y%M`q9!OIoAe8DReykfyC6})o6s}#Iy!K)R# zdckWHT-RZ(!uKgSYq=aN?mG8ne(r^MMQ}gLKG;gEb$?2I_eOu+#&-`^#$S)p9OEnC z51{OWEre~*_yfTb`nI*ce#c9liEq&I|35xxp5Ka_zhTSo>|B$vdCu&w4{Z&mv|qVx z8{e~+v1|nHgZbE(e(OR|THgz0u6-oFDVU+QeEH2Vp5gZG8I`l{=9Jczvu}ORsoe7X zcMHnQcL=zn)fr`|9yJ&%Y#9Iw}#>ui_&PJH`Ld<6LQ*IpYMe|!Advt|uTzdPW| z#hlZQ_|747(s#acskal@eU7F5k#HRyUBlv!n&%IXzcc>ahaQ^W|1S7)u_3J4+W6ft zALsr7-e}4Z#5@DLVvAy)!=a3Q{EP)xjfV%R#W5!&U&@wR4GzJauYK8u@yz8=uyO6;W`2i(9g{KJ^jsW{ zc^>wlP1_mUaPmI3pZZ6DjoXI%VE#Dl2+X#_jR$*Ia@VtE`m%;tl7zYOgR(dH;@hr^1`}A?IrXrRU7@U2?sX6EW|lXKxaAG-k|p)N0!@ z=J_y|u}lWnu^fXhmp)%>#(XTCvB#LJ`ZEQyUHSLOnM!H9J|E#5KMs?3tm0|#?&&nl zy015Fd+yco#E%EdmQzpMC)=2g*^aT94R>P0kD<)Hm;rWwZO?exJPB-UWZ_N* z%iCARathda=ggf7Hc#GuJs+oG?z6G9e>&Ll4KLgoV0qim_|61pe8w}Ev%uCh{ywMo zY)YSx!5dSagSoDjdo}a#0(%C1&TF`t;4aMel6NlHG5b7Ap8I(oX0EXZ*cZ9;F?svH zfYQgkmA?>^a}45~r;EVe(VXpz!E!lIS=US8jP1!CSeNorOfKd*ch0tNKUtT{z+IU0 zd9E4z)$q z@isVPnd9wXxmcZ}{bYac0B1hgpF82?>)7wYmv`)UQ~Ee|`Fk)q$1cv;?*-Sf--j>P zKKA?JjAiU|z;dxVcKgX*JOJ*(ymMLi2f_07Y(0c8@7U*3`Z#v^hcP+FF7}=epnL># zKSyH&vD|}4!N#H+kAa6^^3l4-!D@-I=*AOZ+v|lHPyHvsyJ4GQ*^{Th@}scK^=a_& zjiv5q@Xa-ryk{EDSpF7#7VMg54$p$+vfiHq%h~=Q%=W$G&tb-P!IJwt*tx{)*W4E{ zW7fH{;XdE+>r=W8=6wNk9lB%2Q~yPb%;H-sZ+V~RqCCqsKRxJgd zjAia$2FsCb*Yq)NdId`vvT@UYb&d4{x);E^CZ-LG0!jkuGuzefLS^5sx zwz{yK)M!C^<^%8?%|KYU6}e3ZTtyXzUs?Q z@#UTO&nSJIxBSmBIp-~Q9o3h&G3PTHtNQW_{I{{J#V^4_F!}7?ufWqVW7(HqgKe)D zW<2$O18&!s-@?g{!m`)D1G}bmAAXN-uCe6(q2Y{0U;YU8KID%52`rcOeg`aP+k-I2 z=K23KW^5NMxqksWmssxhU*U{dCwJ{{VEOg2XvW{cu0wascIUBXSXJ=tK=;V zXWzzhmb!y&%e7i(+!#GjYbZ7}&Wu?r^=}V%LdG%!(N+0Jfzbq!_yv45L0OHGm`Fu)WmWMQ!wO9c>ggp7|--=-M#aQ-bB`}|s zz8FvamBH=$vI?Ah)t6QAUDLV`tHGITENilQ!x@XdtO2h2vL?P<)_X0moNZTq=>uo1 z>PugI=Mu}^UK`Gsb#m9%0n1l?>4(p!bv})!et)pBsxRx}^J(Q8&v@4ZXDuw##sGNh z7>~XzL%izCKw@%fYkmA^i)Hu?;LVLiUk1VPX|1RIS>N2uc|)){?nBxd40bl@4Y+@i_rA~)x72%LQz%URkI+^#QM z!SQMBiSgXKt-;2kFWZ>J<2^IBEhgtZ6Q|$pz|O^ShZ~A7U-e}eKA->57xUDHv}+lC z84k8x@3eL8GyBmAcD}BSc~xK3g1oqAz=btG?`oFPHV+8!Tu0RbTdjGgkFwUwr2h%iZ1&&X{#_*Y*d?SA97E zpHJ(28c+QL!N#h-9E8uOm1{iXJs6y|uuL0=z+1<7^krG%RbLJzCYQDj!(WiT91d@8 zEc!AQj!$bn?a%t=X3j@|&2b;n$2hS25sSWzhcjlK=*E#?d7p4cHJo&~2@O~EWg?vG zQT1gKob`?6d>-B8b&;F1G#SpmjpZyI18&!sW8wI;_QZJfWeV6>^ku3^Jl->7$6<2b zGjaNz26irvJKXX3@>O3>z~}Qn`eL5ikajJjFVn%c>z%f)eP%yS1Up~X#=NR8YC*o= znE^hSKJ(q-N%(T!rFx%EhBKD-PXWutYWrtX_g#KH^xp@kl5;8Lh1hl2RoLy=Y-|p8 z5B3)J2DSvbJ+V$q9d!=Q*S;KcbmlZLpVn_uw*LbE7TE&-bg(hcx;l7RM>+v>u%Ez68$CU`q?Z2w&Fc}>i*^uc;##+Jv7<+p?L!F}M4#r*By z0(|2>u8;8xF?stG=ifsYf%}jby;%-C5KH`G;&M6Lm*C3{gUfxq6yJ7?E}v(dHc#(t^yxJPJTPM8s9v5`|VHc8nA0^EbU(lc6`H2 z``6*i+kVD(J(y2xe8w}E8^G2z?%BK1B%b_sa1*}kY8idI8SFXmi5|_um$$v-%?3MW zpJ>r7_~shRzcFqF%iI5Lls@jQ{Oy>WV-V;5-vO@o|4w|l_WOSqoUz>hyTNiX&#QB` zef!C}+yl;h^8Ru!oO~VoefaW@{eH@fU49NGXWQb8{Q+-OhtK@|c?3tk?$4w6?hl{&`|}u%xyG_TkAvl%;}euV?vMPFn4EJIXO2&S z>l~lPmusKnXW)!wj?aMQVs(!8ll}QDIP=N=JPRjZ$No8ddB^@7WyUW5JSOMZ#Tokx z;5zotLgcZ%%EH{j&! zyYXxI7dMu=uj89*ENk-3hBKCT<8Ogo^JwI^@#V7K-vP_netkFoF21q)Zu~ub=MuAD z|3$~xfiOHp{pWt6rEc{R5%#G#U_-Al@TI*?l);BkE{yEqj_aSY)4R$|b?z3z5 z3piueiRSzgEbkNUR}Ci}?$-@h-;I9*=X!Xbb4Gp(wtg!{zx`^p{v()AYfp^l-u($|%yaBLd&eXm_08CyF*)y|7jAxW9tsH>AGn z?wJ3E&!@HS?w9%IsSRn@GVjKJ2ixw;n04(l`|%I3^L1^^tNNlAO5n#g}*9?@{_VZ~6BzIp-~ozI*`Y^C^A#&|EBQ@ex>kk&nK73|3!^Wncac=F`#_ z>$hT!zO35hd3Tbx8k~I_%UN0-Y+L5# z9IpX~+uA?l(U&#B#-cB4fqlGZ#`<7#-ZOFf?F)7;jyv4i`0`a>*1@-5*FE}Tp4yOh zEu$~}z_#n1wyu3WW^m>j%bIN7aK@r9TY#&+48fPndT$Aqv;C?sTfrHt`m!~?bBX0{Zv$t{I=O4x zg5|5eY=`eU`2J!%^@oCuRec#&a*b!a!@*e#%e2u6Zyn>&mzC(J>dOdXa%pRO`~~UD z4)Es2qAxqbIeypE{;Y3q=DZWw9QPr8j0C$MvFOVvIAhj{ZtM(}_X)R4!`W}R(G6#6 z&fTs!u1D3EF>uyz#TtFtt;wtUvOAo88_QYR1Kh4Jd%`&m_s@9l-Ckg0(U-l!KHf89 z`(Se3GjY!FzF_C#xWny-FJJX#e|-C``eL5ikajJjF9(2a*E?-p`^Ou=_9vE1#caK@~YyLKE{zUs>~eAmJAX*~6h2OF#Uaze>9 zp7BlxXDuw##)yeK{S@n02BXXMp8>!kyW0_8ac3hBGzi?ra>_qw32!aMo|d8hz<%@~Xbf zgtKpBIZNk)+x6uvxf7dlyjVw}TtVKMTM9c5oxyIO-V7ZwEJl$2Xj9-HdNrmKn<|u)iJH z{%r6qP0a7R`eMDC*s7Gq^4r0!VB^PP{&sL%Qx~_jKE`jyybo-w{&sLbzPx>9taHG} zP(QyNJb-VWy#4kk_8{1`HkS4u0z1C?+reCXdE3wU9tLN8#xs{kz}7YH*?W}IC%+v$ zhVQysM&BL>dk%b}M^E6(+g|dX1UqJ*Xwg&n<{HbtF`fp?+y7@MeLVZ}&tP(nL7e;l zS#Z7o&*ICq-~Z3S8O!~D4lEb*ygFywx1X%b^We-U?=LUF$=9)e9$((Ee}OV%mwyqH zvu$z4{t~#3{fqc=?PLEEoUx4k%V4=!9lQNx-CqW~Kkj$-=PUT~b$`B!@BWyV{rMWc zxyG_TUkA%O$5$wQ+#mT@F*)Zb&K$o1u5)}1U#@+QufrM39KQ*ci`6;WPxj|q;LIoc z^KCf!I`;42%RBb(QfBP(-^1h_yEtQi16;@ceSEq0vHt+hSjPS)ST0t_Za>+JAA&tw z-np#%kHGTvY`ujq@7RA#nX$|N1e0^@V(+I(bk0Gg!X98~+90b@1KFcQ#Zv0PTa%t;d_;ZSde;3Z&Sl*4_gLC|@r~O&q z+|2oXusQBS+WG+Oe#E?cuGxoh#;g;~`3NlU6Yk@Nv)^$4Za7nO?moeBJ-p93BmV(g z-&peg3pUTYlRU0QhkYB%Sy~9rw#>^p?gp3rGoE|5FxXh$jk|+=)Hh>2Fgfp;IQ=dH zb}o)5Tu(Up`fj`^e%9UnGT%J4A?;e`-FPvu?RuxJYoFPVUSQ|z+L%}MMJ6t3 zt1r>U-f;3&UzWg^S6`N-^l{$uOJQ=(TO55^8ti=9^<^1&V_A!3!Rm{A_HQ|``eH2m zvOL)K)EDEazXG^jUsi;ZullkQzH6$b?#giH8q1kjrQwW4UseTIeOV1(F6+HISkAVq zzN`Uftm?~}_|7GkyS)~iG3(^6^#RLQed&vz^JzTw*9IG_`m#>RHJllx|tj>B@eOZ^7T-sU>e?j^(0N&hK^kpDi&bj?r-`vc3eXu$1L;BbN?0&?eFN5HW zStq)&Az0og+~9_@-*6i>9MhkF?ly*VJ*vKJ0%v_=IiH(0c~xIFgR^gAIZK;^+x2A& zxa^-)=aIQjbS)rl{!zKo#EyydsYhIR@;bz8E_elk=X5bN;7*or~iR zHx*yL>dSHXS@-CRd1^!2wT!+@1KX~5+Pe0c{Wu=%d|ey!s=lZNd4D+p9DT|A%XB#T zsxK$v%d0OlC^K*QlQ22wEsnmN40b;4`f>`qv8=_ZVD&{l`*#{xeK8h&IUQ_!>WlHz zKLgyZFK5EZSA97P-#w`Na5kK|#&RakX*grimo9MCmznr-S?_bfa<*Od zcP_Eq?F-gT#b9GqUoI)R#xvea!C4E-v~d}{b&N+})?~e_ zzFbaBE^S?bzaV|N65iZc^yMnJoOAoLzPXw6)nIenhxBm`*!_q_U#^8SW}WE9bzpg) zaMw4S{f4`t;h6sXb9W=0>rwUPCOGRG%lW*y$*cM@3(mfc%cff?cQWG272?2M>XbxpwN{T(FP( zW9(r}&ixTP=3B_sm#@CO>+HYrXM<;9*0Dcx^V`9y#QS2MnDuWa&-QMk%zb)KJR@nam+uBE* diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_073.spv b/test/fuzzers/corpora/spv/graphicsfuzz_073.spv deleted file mode 100644 index b7e915be4aa29f7a14fdfbbd643a026a90d7df97..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10108 zcmZvh1(;UV7KRVZ5DEf{0xH5FDhi5;?PzpL3k`tZ#j5@3r?{-#%y5sp~knOHp(vy7JFk9g6bVxabH|6y1u> zrEhAU**tvtin+r_j@rcmJ&L+=oMUeM$A2J zmhpYSb4tFx=!;+0($*5a=x45V33J>*QOs&;o-zxfwXG!PlFR@ zUQV5wsAR9UUYBc+2d#_i3j62dye-;ciMPyf{|wtpAIERi4of^B!vizikl}pY^?Rx- z*6+QZs@`AkXHlLndcS^5U8zT$PYu@BsxORPrvv65)x}4=O*<^{wi(_o!$UH>eTH|) z@X!no%kYjF-YLVwGwglvaX&k^!xEPlKk?u93I_>rndoVj|u;^48H$!am~}z-r!a_vD)U;N7p>m=t?|oK=4WHf`MU#u$GjvEM;s^G9Jk<0C%045viGBZ~-Yl@+z=)3ndmkfi0sGC5csAG`Mmz^RB#Y;QwaCu{`}->5`QS^l zcma5A7B2)plf{d`zW*_QF?d(ZejSfj%h1+XE#yY?4fkDCJ0IW84~UlF)z){d7p5M@ z6Y+l2B33K=9I<)7F%di8-#dBSH;a8|`=xj+_1&YtliK&&rMz?ex+^((AGL4fefC{x z#k_mIV@;Sf)O#6bZaU}l-kz8^`3n=*2DY}jajfV$<;0%Rnjg}O<#>Cde~zg|hlXHEsXNmpD$A0|%FrTv@*cAUKXS&jE`Kjzk8t1TB#6&%7G%ntEfkHP%Ocf1g@^bvo~Gu-r5(?u(rBm*bspFU|Qr#9cZ!<@DaA z^YG_mKF+-W?_7PXy))PvahEOx%N>TqNX;iqB5kj3ky*o6!Fnu=<;Go_FM0Og_e32X>70W6bqn`8Cvb&JCEHb7S6( z;Fzc0#*VWOv46d>T6-RS?0*#4^Tgd64VH_$WlqldaewTu^ZmBng!RHMXOG4=C+-Nm z`{|pwJyZS`;!c>n`963#&*L4r74wcXVbO=%5+8Tuc4E1>BX@x1j>Ob*E#5~h&E1LJ zg?V;y^zLr3>*s6TLo6TPzk9)(V3V=@-rh%SE^6HmR)?8b?E3+*eAIdnTvh8Kcys=4 zQ0Ip+=gO~1+#`uU8b3Y#`{biw_hIgsjDHO5Il`bU_CJNQTs{o zQJF=Jr{K&vPyPDg<-8wj@%GqW+ZXkG8mrawnZ$>l&l1app3i~hj>XjTdAyH$ntK6z z5pylEYc=Cv!fN$=Iq{*vE5ubAyb5nFYP|+l&skXL`8rrWYP|ujs`VzkxzO`1uyf_@ zqZ)q>lh5`1JhA&Qm+ScjV$Ts~4fXsYX3lw`=a;~tr}@zHZE%&IUxqj5ywFolJ?*q0>iN~gho0{c%Y~lrg5{3G)bne2AN4f%b?h6MYl%aHZ-Q&}{1%*iXz*=t zl?LB|Hy5?O3s%n-EcE;ySUzffA6!-I2k_=X&mV%FE3X#n`6Em|*Yn53?!#QJ=TC?| zN0>F#^QV|O=Y^g>1BagGL(iXstMvQ@ygBEEo^tAG-|exzwlC`WORQGUUnM^D{57#$ z==mG4+-yuee~b4~PjkP+evi49I5hYJxK__U!pVmQe*#x&@Mm~)QR^>Y^_+u+o___) zN3Fkst7`on-dyPU53qCP)j~c0iOJ`B{)^asn9KG2H?ijkvxa*92Q%lq(DT3G(9?YA z`5w4R&-dZYIWP2-Q&0PDkL|U6QO^&sT0K8ZeCYWRv0Ui+Kd{_fOg%rw`>3b6Pq0rh z*Aj;YpMh)j^lFfvfcF0dLNEp{JaB+IM?wukDL^ z_9R!UXD>MU&~sz3TS;do+y-2w=eF?XoELh^si%Fn$M)L3sONUzT0Mur$%mfXgXKcc9l&z) znXjHh!9MC~ZWy*B=33&=U?*^`p2OkfLxY{cRT}I9Z!T)>3a-_21e|=-+6`P)Yb3n6 z&~p^nx$#>bWnReAL9*a_VW{?XkVKFY0+PxK__Y;N(Nk zL&0*P=V4&Eh0Isa!@)l4Y3>N@NX)gwp}|q$T0M`3lMfA!0as~oEWEj>H4Chsi?I0j zq2u7>qgD&Js@80HbD`%Puyf_rLOth#<#Rpf5xWm_xt{YKmzg!xa{-(==Y^gN!TgkZ znh!k}fvfaf3~$bPp{JaB+IM?wukDL^9uKb7a|xV$=y?KIF7#XqmYczR^=t+EsHeGQ z*ol~Hi9>@naIK!p;p9Vu72qljR>GT$TC2e7xflyQPlA(=S|@|6YMlaaF7!MV>|A-Z zP|wrA^0}U;6T1&{xt?bbdyX(`sOOn*=A0LLo(1No)YE+Exf)!h=Nfo(&I>)|)YHD( zV|)EERmF0-)@q)=%Z(`>ig&!;eD4(NjX!3O=Jm$$@6vkX_-`e>@$+fC-gs?__3C3k z&Zc%h{6VS5=Mc;J1b1%Yq=P#zaUJ2N^Vf<4@#n)i-|^3B!?1A|=l)d0O zVLp3fyEASKzBA?-FJONBJ*5krW;_nxHH#;LH>iobXR$Rms)>7KvGaST*q*qr3t8KJ zct4CUBIc)D*PLf^Kk{PtGXWF3mr0oYzL>mc(fj|dFTr1m`Ix^f<@K)J2){XIjd))! zC)bU5GS-B}dvyi8x%eJj36^`BuI|gYtH9Qh_Zwh*HRc}Nli2;*tJv=~DW`Y8*W$0k zeBAH#DX)+HZb8l(vELiWRqgjicyqDeo4|6h-AT5IC}X6 z*nUL(WQzSh+sCJf9U~vTlZ&+nFvhjxZx;i>a-Jv7Cg~Mk!WBQ4AqXO0aEenv@wD1}QQt zQwwU9(SgwcL}XGKTV`+qtrMt!KwvFgKF|Hm4u@~`X6<#}{qEuHv+q84<*TcmKDsDs ziZT5Cr>H#Ri&~hX*u5B4u5Ilr+h=VUST*agIfv-cP}G%<`h1`mU5sF@Mb>uquG64Z zZX8IS4M25euB8Nx#G3n$Eb8HkqN{K1`oV$jj#b_Ly&F3RdN+1=oOWQ(>_wQc*HKMT zY%FnonR6HZr|14-hW$sg!+ZHR4D|P|@2+^7cei1`5uCXwP8#ef&pC=+)O~u_ozmSk z(A&3e<*B^`T_>0IjIEf;^Xvg$-`U@}meun$yic#APen0E@gq5f{aL-HV_ARa>LdI5 z`d6WrG2>X-d$#&0{?vW?yEpW$8FceXAI4W`V(N+s;I6(kC7viI+Wq$gSI$|{C!xPr zpB_cg(bm4KgW$gYO5VMUKeXaMxhj6|_r=#0`{>(T@tsoTyKj~6e)=9(@!h}5cWUOl zoXVr$)8T#EIHR2N(ni(xd>Y~tdQ(L$b$hG7{Wf3pFwZ9!`Rrw$Pu+aZw)yRoHTp~> z>HyXzYHDN^?*-Ohy%BG7Iqz~!=8PtU`l&%{;~o0dfU!KGd>PqoD? zuz5bl>KU!uGabTeE_ zJA?MhrxAGz?MPO8>3i}Xcy4ujHzCvQ$;3>b2KKuV{_2x5U4Oq3x!vzXuKS$`U4Oq5 zp_|WdMXvj;2wi`_6`||z_afK5i|UIxkG=jlVvmo3b*7F=oV-sB(#l*o`^yk#YX;(6 zo5T0ohG<(sKh3c`aq^oJcQn}C+FIDrzRHR1sWaD#uQh)H(eB-gJwBQE`|)uG+Yvcu z&>X%8IsLVN3X%ISwokMAyn{{t7(~u@EslLxfZaDg+p*~K;q#f~lh?KqPJW2m?8j#j zYBd@C%+=y=i|Y0 za}e)j#C{1}9s6ZC`G`FM?7j7_YK!;r6|l90Uk6w&WGw#=HKU)1ct+oeb(l}zc<(2I z&8crE;w&7S&VEwjScbW-#F;bvRwb^Mbp>#yDKvU`qT)%Gq``Tm`Q=tmFO ze&p|VHM)Gv-N|6NmQw1<`z#l8*9)GA+@9v}6tG;_zY6vna2sc|CuDi`&f3a+mCG&uQ~qtn6mR^IP>%-b1Y^M&7;V7ZW(x3l14-ptjC=o|B< zJ?8Cfa6WJ6pv(EhY@G|1%ja!V;_`VLf-_$KO-Md(+G5^(m(h>&!1g15Kj)*%$Glwt zmRpE;hJ9G&VxBGp=kxY;bh)r!1a{tH9yf#KV*V}$8zUbv-vGN$_*??kPu>~5l-0)> z)pi*o=ZuQue3yf(-}e=8^5Ju3^2vK}6`cG~n$d59jgyZV{T5h$0TSQStHHjf21L94 z+Lu*6X7n0xJtD7t3aebyb1k^K=Ih|(W1s86?qlDzMeG)Eb?jC+`Iy@qz z1Xss?8%{oAzXLu3@qTFYeKoOu7x5h7w=Hq{r-lw0k`gotT{S1-wK8d3zKL=OO$bE3~;d6iT$@}&TIQgM;pB?}kCm;9e zmtgq?NX+?zVBf8KYPZKzS>@wC{R&)<$ZOx9RW9mz2wYwB!*KF3uaAJ`79n$xh!AbF3UN7oj!@dDUb`TwzpdS1_Hbf3JQG3eIwB5Tz1 z5?KEERL{#`xv1wA@UH546<%A^^E<@^whrUOZ z-jMXD|BvYAiF*G8-c`M?!D|b@*E7F^!IAIJU~Lbi@7Z6##>)F$*vabScR|}g8Rp2^z**#SfFmn8V}FUT^X%Am_23^hspTBG^mt0$Rd11y{F!b?a6)XTf&{?mgOfl5UUr zZn3jaM1N&v(+ z$kef$dtOE}uX(P*tvmOjZjahF$mkqaAbXLXVRN3&#p8Vcpk0H%AkurTL&m@1MH%mo zv`HRw|44V=MAq-!#@ny^w%7N3y{~|@i9IJ*18z?FFLKzkyLXq?;T!Qi=`(&6DjWOk19TU%6+*T|0s+VlXtS2?7o{x zCNFLaGR~Uyf2U^cPau81k-RTw?7sB%!MPuIVythkxq9WHCXz!CjhcUDZgwTEyl>3w zXNIC*y8!Gv;^!D&Dz%2ca_3dU@z>yXw)#EywaK1=eO=P!oWu1<-=Tc$cLRFmo-1$C zJ%o2O59w_5n|~wH-sHU(ZSPY~|NNwzqrCuWJ^Ne0t5hxo&L&{oB5e1GeYLGA7kw^9 z{{=$Z{g;3&D>cTxOA{wABJL)1*6=+p!?-lm-W>kr*kgXWur}-!*r!j89=2CvpRfD1 zVI{B8ckVlK`R@P3x*6##Vz!?5FZfl-ul$WEc(<#8@7A0(paG0yF8bC2=eQYor{7V} z-(DjyPyg@KX+oOk`WsvSIv{U9>eg>gwleCspj+RV^`I3*eZL9TzZK-`--2zPe(P^Q zn&+~<{*6H1`syd>-7~cT-UN7`C`hs16}?oG49a;+($lYZAG`1-;}7e4P8F= z-j41$^Ly{WmXE#fL^n_V4|d#%bp3k-Hn+8vY)S zr(X7;TSs5Sb)(BK1E*4454ybhk-HaN-nx;y58Yn!H6FsYAAJ$GA6-6Q<6&%hYkW`L zS;$Ag%*0*f7JMJQiJzT(2h&?SkbFbQK8P(BZ*gq0e@wskVzPtxH+u-q`&Y(q_EB_W zeG`44AB1lJ-8%XXgYensW58bZJr44|Cvv_c$>(qT$)qF7-;k$}_M?p1J&kU@2<{nl z>xp;+&!QWvFXs6iy8H~_`!69~en<2j1tnljb!TEv+VXMt$IxT%sOLH4eHYQ!arEgR z-|Go%`FyX=N8UG3;_mB^&eQo8a-8$`KIH7pncAB&&Ug}i4)7iNX58y}AaC9z5H(&v zuLt^nNPiUZWlk?!Z-@eMzNZXa>)@1V;q&vEZ2ZbgoJFL5i8QS&Ui`Nr$d*Yte<@mJFN_TjAU z^BgeGp6uDPw(yP?Am0b0z!uQNjI@n+-&Ul1DdSD7M{fZIU`#X8m<`EpNVYO^)}XHj zk+UkrG$G@A^Z~ke=bj%XzcSA75&A-4&c|R7#9KO#Zoa-xz#xeKH(Wrk0-M2H5O3pC zbo2E4ZTSp22wc7o{ewW>^Qp(oK1X+E=KJ^78Gixf{k?13qdm*V9PG`U0?41!8omwl zz69ni1^)lSZ{uAf@Q|> zlYfN6&*%!a^Aq2tYMCp2gk8;c}P0i?1*u6lyXvF82D@hHdVa7TN4 zTUT4hiTS6GEL(f}$nv%NmeEC)o$Tl;#F^_P^X!z1d}pnDqd5c8SoZ~a-2C-mx~ zTF~ujM$#t`H5Iv<99O}WCnH}CuY#tKZyH?P{8i}F;XY?^?bpDyn^(KJwTn+AY9_pz zzN_HM#_Lm!Z#7&$u}SFmT?Kg-B|YXe_iS);TW=wKnr{vizH^aFa{4@E`wshjWcRrs z#V$y;Vm_2C+n}%dqJrAHp_YpFSPLyoq)oEt#qcV~y7pKHw?}bv$(KN$(7i;y8`0Ob zNuQ4YGGyzCMK9MOXIXE3=*tUw-^S=|1-d?xHhI`qCOvNt+p1(UCgP&TYA{ZJjWsCY zV=nFCdp&ZN{nptRhfXp8Hee2Q0!Y}W; z5j@K-_4{r@GpD$IQY~+m``!$>LwDs)oYkJ~r5-ZYXS)UNvo*$^X2EZS{Lc97w!(dO zV$pL0vL|-24OuM6dla^tkiBDr*|sM1nfwr9q z8_aeqHfszv!)*x7&TcUEVzcYCxKYZh}C-~B!4!yxa2--5l+h@8F;+56-D+7GXU>>>OQ zAeTVe?@qFJY;Ds0o@t-KH*ErZ8l>+%@KQ)jU-gLz)83S1{o}44MCNSL-i%=GsHN^V zUQGKTcm?E4=2xGbFyDp4$>zJDe@n87>#y!_ojF$W`!E%5zaD>!{zPkq>+A2sc*xy^ zJ}K$zu-oGi$liA1~+ zyO{jjk;M)|Bbmw^$06$ug|tT=@yNr!4TU_~oJoBRIi0BkGFDu>`xpC%tg9jSHWR%Z z@>D^q@N-}8Re1*7y}8emaCa~pehSj32C^4_^Ex5%@aaM}Ht*AoF8)iZ-GgkL_#f0e z4fp&_PHp!?V%Asw7d|KH;!*1ivi;13qMrwl#lz=8Wc$hcJcKSD{XC3poVfiw0{7UD zwnrf``%%vKBObLLLms%FUNG_SIg31SKaYcnhtCtqXC6G}I)^NNmL0nHCn4j+e@%OR z3b_~3<{VGMJSq;M(Qxc`^J=$Q+l`-FPcuOX2QO{cXrx#wthbJIKbWPlLY;xhwl} zesyJM-3-Nk#5nDNHC_xB-j{oR%N8g7^0pbsFwL*~@xv+jd?>{0uNP#hkFQ2V{GXo_<6YI{=wan^^wdddH&nPsrBv J9aZ)n{SWL!OyvLo diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_078.spv b/test/fuzzers/corpora/spv/graphicsfuzz_078.spv deleted file mode 100644 index 4739a9ac4eda697df919093cff9d1f4436c3cf5c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7136 zcmZA32eehy5eDE3kESTSsqlCYM5KtQfFwo*K_EzC&=gY%iV_mw8A^H~1QQZcOz*vF zG=}uvd+)uN-h1pZ@&7JoSZA?y*8KC&?AbH3_qmUr!83<>nE~Rz9_ii?*lsj}PvPSoX6gbge_SJ|=eU zJ4g$2I)a>^nZ#9$f7^Az0n>)1A7eM$}H`WDasoi&VTj zPOro4x%l-;7{)r3df8yxohLvfT|%E2&s-J3rlun-#&erD9JC zZ&mEbJk+XJ%R9R@*1Tx-Rvx)-$-eo~)*Zp_ z?v#jl`s~E3e?dfl7p4Ml;nar1Tkc_b&h=gvM!YezwO{;c5&ZtduuqT3fnOia%+845 zt*aVtQ83;c+MZnAz~TtL_ALpvPYt#2%wT+b-_qFl+tS?H)7WIpOY!FowFx?=Q@kedv4bz7kgQ> zoU~fivpnK$i#ac{BEsi8SQ(ib;X6N4K4-0pIGb;Egik+f8XVO<^PbVpq^r)g!S<`u z?B%;4;ymm6W>)Kh@y_wS?iFpB6W_ffIQikdO|A=r?dy$H{`&;W?{4=saqENezTc|t zqG0>^YVH>Yn>(L(sNVZV@YgoA-ml@*YSvX3U9-M_u)57cyqd4c3zzQ!5q>j~qw2mS zxazLCJTM$yoVh$G+AI%ACx(VrXZWS1TF+0^VRhOXJ|YGRx#-u{~1?qL1) zMV$MXXv?{LkB#7*3)i`i3qJDQJw6=1J-a8wHeU!1vNf`KAQxMQ?mBi||!_ zFAui2>U%}wkLuRP|H=qneQy6*h7!S?gjdwgB6_sCc8 z@%6#@y6ZOt%)n4cQw0r2IJQ?+MV7IY`IhZcSUf{h3jwb!Qcxb?YH*s*q21wJ-#QlSib7< zy}^3qtGD*PV0^u`_Xp$D>wc;R+PiS~ABd>YJjAO{4fyt|W@5f| zPag?BvWJg`(<@)~@UdV$@VO_pJeB+7!S>+lUOo|wZ|C`BYQiYo86aXJy1P)0zog-`eMb#h9}_=2gFQpAR-KKC|Pi_w|Kfe)r`L zz8Gz}1HLasaP9!EZ{^Fu&h)L+zXQJ#jIX<|eRSRZSA*qMyLdUB`?YAxxnjN^!8sSM zbH5SnT&uWm23IY0kKYQ1Z@=?z$Huqc`FCQ=$yaaWyTR^+uip9hg7NjvzaNaNUaMBR zdi_DLUi2?sAA0>^w53-uKZ@Y=3Re$54t6)*L-qQT;3ND0X~VgT`W}83jBoe)^Vs(D zRjtK7d2mYYv*w%qmI{2^GLdKbQ%nlWA9%^#Z>_hygz*LU-$VDsm57ku^I{5hE4 z{kzk@L|g8Z@2?S@JB921{ub;^>tOR6|My^gUqqd?kFK}$k6?M#E?!RO{xjNgu9$yC zaL$G6+deOgledzVS(UxAt+!?{?6|Oh?zhHOcJyc)+53c@;^W%kU_d19XY4@nB+9*&7^u6$<9SKq_2@$tJ?cQq>5a#wt#BRF>j z*By)rc4q!R{5_0~f$s~a&e})U8yOcYuiC}S>D=+rmUG2Sh~S(H*SQmeoof|0so~Hy z>&Y?j=3l>mQ)1)WZ{)bxa`M$1IX>8(@YVNlLNLC*hpEB1`W~uQx_X@!tQY-@*N0wv zqbqEjM4~J~>!!KDpWL+;d{f-M){xvGMKP^J2@*SGng0%grY@yZw!v5?da#%KzQB zSM#Ln8(GlAxFdVa+B@BsJ!Vf=?D@e5B3DQ3t30D)ua2y3eAh*nZ%Xiak^PNtdE={D zo|-&M!?pWe7!JQUeD!-;Z2j`p`#U`tU+?dXV4OL4Q;UKvZ;Eem1g9_9+=j$IE28H$ z(R^aqD;k@YLm$f`6-U>*UXnf2V$0hfZI2qxjBVL3W_~cvIds)9JG?Xb`RF@yb4w$4 E0lGiL-~a#s diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_079.spv b/test/fuzzers/corpora/spv/graphicsfuzz_079.spv deleted file mode 100644 index 6553ecf4f184bad2518dc20b4bf84da393e13d82..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5548 zcmZveXOvat6^1{i35xU*BjSu$PzaF(DI&}rMj4brshVOkUS|flQZ5;WFqlNgmY8Bm zQKM;UiYBJ0>86?9Fuhk(SAOPK+FB{kbMD#0msuXzYrp&5?JN77JIzfCj!S7mn#jLD zr^YiqHNm8GLTW2?Pw%$gB?pHGmMlB(TqCBW<|5FTsp+`Xf^I_gRcrfo=#`rWlBWTv zxu{hksTFS?-%6iWVh+^$_jK3y)`u3>mafKbC8rHtD{yO3XJ2*yz`~tNSM$H9GZEiN zcfCF|(5O2J`$%RVkG*@awrlrr!+!$y)rWQ#`)H%Ow$ISu!TR1q!?ij)ur=Uj;)DIe>Jr#WmCNP%0^EOc#n zaH!f?M&X|gx2N#8q&eu3zWsxTOM5Q*Ky|2UVQW1L-8ie}bQ1WQf^SLBMh{ent0>~y zh)ikM-oEui)m`ODHTH2b{IPm1Y2N?Y&FK{EgNODNz2<}CUcBqRp5FC+{a#*5J#_Hi ze8i_VV1e5++)?5URE&FAkoo1DlOE34`#5dP*RUhs9-f_#*faAHAIoV@dF|61Aw|p? z89p<^XJvR{hCOE=>!00#1@_E+Bz@Uje_m*M3Z_AY%~_lgEA@X8FY%JBJPxP_ZZDe`A>TfVm))VTmHo=wCW zbUQMk&@E{#+HZpV9AY~QKBc+DR>0bxK?imhx`LR~j=c_Tt}z|VO*guN$SaG8(RU$| z(uQ?mUsTwC9kbUL_T+AR_JGZ4Lgv%ivzN2qhLV?CUE0o~vDS7E7b8CI^%8Wu29JL2 zjmQMVdcA0K?HB${V4qm)rQoNI9$gdmW!U%Kds1iEn;ZVMVQ(qy-ZB4HY@SN^w-x5- zn7zHQkF9?P_Fp*gS*+}GuzBw53dD7X{Q|J}t?j;Ei1@9Why5aS1(9=~FGhP$@}BXP zX!mTs{+FPwE$_K%d*^ccUs_^wwENK3t00T{x~Q*0+)GHTvkK?Bw9UU7Nolkz^7>0o zUa|fF+WxT~ZPzLnb&3yq8tq)p+&SA#h>x@W53HSN_u{Pjjc~nT`)vr@v+0Yf=A=wfLLmciKn)HE8|nHTb<}zhTyRjD30k zdrHpx{ueRYdl74yE4HtDioX5^=~LU6pV3rDeC&GwtzR8|&jDK_`o0V-7k#z)IVozH zD~{YnU~_L~&F*0_VxD}&_qh*ZWSmWfo;G8jk#J%H9hFz6f`CXUGdmX`+k6zb;tt0Qf zI7{{yJ4gCgmG8_ez|Ng9`dpjy^-9E<^o-2YHrBiI9zB0`tkd5Z*BNKK3@qn5V>aZ> zcP7ktCbXSLZFSW1w<*7?<=ApjPoJFmG2_moy?i&WDzWcH%;c-U_E9^N*P*XRe5^By z)~}9rtN>dhX7UEGoZl4R1??LVYndyK+?8N+<4kV?d#3WnRM0mg@?qZscKzOE1^sG7 z&bZi{oa=S%_EbmDRbYF@J)94gi*wT_XMUWAYmfe~0o(u9vj44Mxqc-2%SHTa!NzYX z=lpeGIiKKO50;ydac?NOCiG?|@JjS;i226r_xozk7PP*9Q(-0I_qKxFiuiOPD~MZ* zZbLki+tG0*rb{AMlMG3@8erbpL5|JwIk@Spd?Egt@W8@>|i(vN>_LoXKa=wghjC{=9SHMpq`kr8JE=PYA zk@sx>&N+My?c+|k zv*`O1uyOMCHD4~`e+qUjF_YT*oSy}V^B8|4oL+KQppDlj=lMH}-iJE!&j34rk$)yw zF7oxs<@4=5M*dk~d&K^76ZmOlJEGt9%ej8f=D+3NLH`4aVEp0$ diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_080.spv b/test/fuzzers/corpora/spv/graphicsfuzz_080.spv deleted file mode 100644 index 802375b4045d8bd587d0835a94958f1ff1c61b58..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5548 zcmZ9Q37D2u8HPU?KutwuQwwdt1r-GCn)85+MifQBrV7q6|J0iYo%s6URqyGR_)OU1r9yYVByQ8af+QN?R zwmHmgVkbSLKl;@&d+zkf^IK={-PJX}-Aw;RhpL+1GG+4gwywEd^Q&rKVp(&up6OK! zvyG{>1&yvd@_)G=e?;NiYi+O|u--G+6gUR6%39bFtoZ?~d?*#xHv^6Z+pk&&Yfs~& z>-@TK^Fvr;Al7;IXa)}J^w$TjJsf`ntZNv{I)mWm;}3>A;tzqVEB;Wpdmo18Vc2G{ zA!~2gi1p+)t`<|OI*H!1nz+wFdu{}Nh-}ghrJiF)^4)<*1Zvuah z5#KX@x9~rV|4!jIQFGUbo-N^O z(lnT`kuXg zw6C(7`SHLSd+!A%fY+EivF4b@+(}sHYF}s9A2q>P%~#pmKCH0@`Rj==FKw0nkrG8qk zdVRmgvfgt}{il1?>-!s0)_WhR|4grX{bo?sdvB>f2wtAQ{)k@n-rFLoe2cz6?>1-X zTl7w~E2!~rz`?+}LEtT3l)mqIBCuAgo8XGUFb zO&e$jE9-Nb2{%6kxSv^A^A7i8el{@fx^nx>seNtwbih3~YYqd4gPhx3xcT&%SLZQ} zKIS`tar?-#=PtN&)w!g814qD(dk#zM*pYC*L+dhE9nLkEx%1)1ox4u``?dhy2aE#d z)#*OFvFg!gpGU!6Q;kQ1g&?_O;Oa7WEGTow;b-3QbuRaC0={|omDq`J*Hhb-^?jWL zx7M8Z^<}I*9Nw4tMZmba<#}6+;l4lnoo77f>^XQY zo~gh4U&T7qWc}B`*MXYknRg0YJ5x5v+ z-^<|U7XbHo3D&&BJubuQ8+ToKbX^Kpm-D0jGPv>7d>`)qtWmqZH8~UYnDb0Z{r1!M zchSCD{W-NiulCz(Uz^{yHuz95130G@>l(AL>e>Q(IcNf#1GNvsUIC2f-+5QovAmlf z;2YZ#_}yNGb$CwZt_D8@_LAoeegyXn27{c_HE`oyb?OW{ur)C?;#q00yiFwKZP5M#-G8Bl^TDJ zuSRofw7F97N-v;l`u!7Pzr!ycKS& z)OZ`d8qKNE{`RtGG_HcHaWqil?O2Bz&D{a+1kRJc&0lS~v8-_y+%>iZu5mZk;Tq=d z0rvvu$+OS<;O=ufkbT|{H=cby05_I>J_t8f?(-ph_i4_3+TULGjK+uIY8(U9_z2da zMst4we+AByN8{h%YTO<~N_+zCYE^Kj$Q_yXKmG`a{tf*J z^;^?V{Zn?GX8L^2zR%7XW?$yZbNN2E_dV}9Tk77wCCj?9t^8fjT5B-t#*<~+vc6nS z&zzYVSzBKm86A7fi0xS^4>V>+wk7L9c7x0F%c~Ny`UcSS(*UiM*Q%1#3tNourH?sF zD|1tg`K8Hvy|IXy$Mqr?HZJ9T`-szaH7>5zS2os{>vZfTyRYR&w|bV%P0vitU8t|r z8(B7u$NJmA4sbG$LSgN131UikTl+BHdiS-tmOWgs?XfS}L+r*q4pU<*Qhg8lEyyys zoqD$-wcWS2vuInV%>RC*dHQz|bsKUw{_V&za2-mvdvKXIfHcoq2kB|vAc)wV=w0AI z;)W7u{4T&6H&%OhZZ^j&RCJC#z!)LdLJ#w|X0ooi+IIj~*mt6P7BRI-%`84`IpcR~jF&52JGq?briY`Xa6vd(hDA=XUHNENkjF zPEaZe_H@Ws5*l-G$HE7X%O<{eIX_S?)omGbm&=8hy^C+=xDdvw~vGsz!( zah9VguM_v|rh3J^V=2#m`itE0lo$RYH(rPjzLE{)&#(&TbMkq3?xSD~cwU~1`;(_HxGO0c%431r%#XFYTV>J4{vQw7$!4*_1BtXFQ#J`dyw$jXB)ME5N<^oi*S1GeG}!Vzgfc z*3f?=`CdzY_uWqg<6Z~Wc2Dwuv#+yA_ouwcJkIw9@HfCcp960KIiLAkz**$p26Dg9 z)8C(WfV{r}e=zI2NO{*k*z$8gzdhBDa}u7X-zoRpk30|bSu4(L9{oJ{llTRs>tA$# z6E6VkDNj?w=e-EruPb~P(XHe9HO+hp-B>wmFCksdEB7AIXMJ_g%>LT?qxLd-oNxHv z$7es!JoeoOoN5Z(RB+3zEy z%YJeVpwE8l#eVvu-x|98N+9~Jqq`5e=(mCH{^acUG16r}xle#T`>7ZE=`Y%z^G$A+ zck5Fy2z&-g&qnFYN^1=PYuNWQq|3hMeh&26SKWJe3RwX)-j4y~7eJr)&U@wE^Dcb} zH)c6KnE^0K<^TXgHxKr_XChiANX=T~hH)G1wIs2YIdCIwsUaZ;Er=3y;@rOh= zXZDmSVTm^+C-n7An=x_B>`Bx1nl)?o{%fGtQnfeO4-x z->`-1UUq7mIClJ)i6_sRF>7{T-?*G7|5_!>*D6__*4X&VXYtTdp>f$==dK&s8XFHf zd-ywlosd=X+6%>=@1hM}tijH(?2-4HJ!xV5;SFA*!Amw+ewKWeUI=@5nFcT0;N=>; ze1lhL@QMvyslh8Zc$EgP+Thh1yn2JzXmDHOT8(~0gWKNyudf69+WxQC_^;pK4H~>* zgEwmM#tq)2!J9UCvj%V8;E@g9qQSi(jqEPAYV=z-c$)@q+u-dQynTarXz-2=-l@Sm zH+Yu@@7mzq8oYah_h|5_29Iv=o(MypB2e@CC>?dGpppY zBM%5IpZ}d3F3)qqM}#bXWWPhcx2s1!FI;|f73ch5-%zrgE(rDY&D*2o3w!dtqe{N0 zC;xB%#gTo_*qwJtV;65;Pk#2T{quYBGrjnFb7{yuR{YC)_IW*j_RB+lE6aXG&pu)_ znf=O;-4#CcZ55u&L+!? zZj=148Cek8xWl&w+xO0JIhc(_Vw)L$TWGU%T_0}`>9P4krGHoORsWCvj_CBf{44i6 zqmxVRzbn}6_4m6wI(e7hJ;Cm*{7QdsbndRd{=VqEjsE)kqccnW^$$en&im^hjLzM+ zdhhn3kT*~yANq$w-cHf>>7MV0`?P#dUXJwcaQCh6=34JxN@pGkw_XeOh8_*^$44iY z@5^H$dweT)k006n*#CIARr}u)Y(M@=_!FIszmQYi^Z1ZheD)8$H}q7_GAr*3vHK3a zn0((K&ThRLnf=KSy>sBv$!=Eo2SW0!_`Aj5dBZzfo$*v;Geob34~ARfvwbM^;gI-v z#s5ff#dp^gf2m-$$GRGx4yJR5;(s*U5})m3p^t~e$1Bd#!Q$wfn%Vj4IlZ3LoqQr# zE_Cck>yzRmUfTs}B3?{3U|fs*X3%Xb?}uZeOt#* zBe!*s``6*zs>59s)}xv!bL3ok=;L#tcK-CF-oej;7lh2DcOW-hug$~H!!334HRE*Z z#Kol}$7DxM9jNH~i?q7#5X*XH5na7&$h%{ZMpad8*w7IJ%DiQcMr z@M>2+4-6u`n#j6cd%GwxzMqb?+Lc|jc|LNTQj4ks$=nPuR7XyuzF;+ zs$+OCUDdHfWJ?`vONN#TISa2k)`*WdZ5@2&N#EA7bmX=Ua{oGI2&Sv~Sv#^NKHEC%A@T9bbG`V8qiru^=IdZN%^if~MsQJ^AdIy^Z zdk1XhUv9Wwn}^N9Ep_rW<8V0`bTVE!9}$1=fY0IKTZY$+ zZWYXadB{81Ix@Q@FZOLh^zwk~ezy(Q(~4jBvVL@Ib;fqV=9pd$+efyQTDRc{OlY|SM#$=WJ`RuT|>Kt#K$YojpHMZzNwj=ulb?ZlX?fcN0tj6 zJNdp~d#g9jt(j3%)v-r#)zQ9#4YHrD>KGMFS9OezY^j57&(K~WdE!;ahVc=nt%I*T z>DxN?j@;HkzAyXRI-FZ|xU0f?R5N9coGTA~)K@WT{`92Y!9KwY;=^YC<%a9Ec^DIJ zsgti6r&A{`E*%-SXKc7t?_gYK$NBHu$#~^_RQ$aIK1YV{7hW^Ee=xg0w|EERBePrb zVm}~6FAuox_rPF1t@w2>n?%P}XB-slF6h;8aAZq-wnIXPhQ!A!{)FI)-@b#*vzM*r z=dfV9nxDfXTjH}F5jrv?K3;i_jE^|_re=1&=7(NS>Kz;vSuS+!4dW=2g_ z$I;zheQMvqrjgmIj$?x9s*YnLTk2ptE_8fIo_N))59s)}xv!bL3ok=%c>2^QR~E4kiYB2WHaz%MI6S^KfFgrB1$PoKBs%xO8OPo=M?W zy@QiFJI?>)PR1+eW8&`}@Hsksa(K zTSUiJXG{;iE;@QOoEq5@pY62JjF9+v#h)2m@!NN>b@sB={G1+4SMxI~vL!y-8KE;n z;^UR)Ht`Wh-_*>`*Zk1yNxg&Fk>x_iPJSTR-s+8WYi86`b)41h)u;9yY)Ou->X;Ku zS9P2n*-{7F+|W58dE!;aR`C(1t%I*T>DxNajoj8j?q7#xUv9Wwn}_qmEp_rW<8SVlfJ}&;= z0iR>TFAlF6y(F0Z%8++3FEYC&FZTH%dU?Qgzn2E!YJr!{w1J z@!75jT^SM|ulQF5SN!%J?2x@|H9uDe)7AW36WJ1SB3ScX388nS04JPukHNlNxg$xg1rMXY5wJg z>$Q1!N4TXC|o~NUm8-90W`uSa) zdx9-Bv)vn_6AO0Mec@J}b$@5a_2hw0#_L`t#$Szm9t=Gcdc4cw;b3<2<*mQFvq$XZ z!Tv~yULJ7G|D(a?#(w=99R65z^m;Wj^5emDR_Wf;>8MNhM5h}NUCsV`qqG0g=+yo` z8?y9=?foG-dBN(hJn5h4YJ4(S46zVlDy)C4_Vmg=2 zeSRR=OtYC~HhDi4ZpoXEJEU_K?kqYoUT5u|J@BZm(MTXJCgNQllpxQ#<^&(q;n&Duvhf1LlvIvKB=kB`4u+n@`7vDo(VQ<_SdX^COZ0>q0a`>S*812r=u?2=Q~|HYhQ@Yet$<% z`xkA<(l53zh3Mo3tH1K3uUY$Yuoz<1tmy;2bLC^NzKDgly%e*0xl`hpHT@OSxixEF z2{vnNW{pkWUk$h9&BqIp6*8ty%k8Fni6`*CU%PdS`wk+;S${ zH$!yJfSp-0N^j4%!mXOEXFGqK|F=6CuN+T^zuDsRozQnfHCx{cX0O?LuCqtg%ZvT{ zA$obiHCsOjHe2@BZ2d4g`kI*^1=Crj`*EkEF5OQ$T{~Mpjn4jyee>d1GyliP^z)^spTC4#b=F@yJFd3BbuwPPIw}5UoX_7w{|MEL|1+4qX8d2BJ*r+F z?EenY%LA?%|4*aebh7u6*p(7qRfRmts~g_evZyuD@bBw`TnHU^C8U#@Xck zMz|$!KJJjtS-7+4$atN#clJ2X`R<2r&G?(a?Dm>Jd(BGCR>ajm@mF$$N!xOWu6k zA)T{uXVH=II%`z+IM4a+hi}c=ioxtPTPsEO-J*Bq%HftX*;WbBIRkcP%_zM+tA<-O zTdQ^cIRDi<8Lu2C#oui4StGP&sAg-eVD_4=5uH7%US8~Lhv?-6*KDm5Y_{yL*;+R` z`kJHlg6XW%t>5X=innwdbULmzTN_5OzkaJXV$9Mnwv9t{@`BZ0dD7QxZ4xYoST$Sv zK<`}n*sCvM;cYL)tX_^z9J8grVmh~GYtvw}#b&nH+}UQ~mc046Lpo>S&Y~mZb=IEQ z<2>iPAHFqPn+LPkZ}rH?eyi!ltGU7Jw|a}%eE)na{Z{*a`K>l<_B-3&EyLx4S1zZ- z@8*zr)55oEY*QlZ3EP-{wv!{9J+{R=+mqej1-DKN_FF>!zPn9iaV@=K-!?=qA6P%P z3%BYGY~R^&`R~xlc;!Di{_^0nV`!&Py@8#B+3OAL(%GZx<-xvdh+ZCWy@B0=y#f2{ z4eTBrea-tG!E{#XMs>QhyZQ!>!knuf1gd{~!l+`UAuH<8rFm zW1p9~_0KC73waOzSs@=W?7=JVshy8=`PfDT`YWb$Yfh#H zn-ey3!Y1!&;g-DlxI;Q;;m)EX<8{`!>~Ws+-4EZIsZ)a456%so89qI--=_;hY&Yip z(VrU3W|qtq-D$yk@2#;9&p%D3pV8_4dt5#bg+Clp!_3H5&E4sd<%`RIRwv_?|Ecje zcYMwWof)dRn;pzvb9Yu}kE+)v_BkPX=fE|0X9t@*`)lszMn_*Wc1|#zRl0LKT|0N@ zbvmv!cjrg2zy2(B0b`c?W4ka!Cofq2l_!18-9^D-h*fi^5A@EJkG=XL7T)$!%)KC+>$pRcSz?f+*x#Fyw2J$dz|Nd_rtg5ZeB3^oryU& ze12p)_4#I98cgTUOy;q^WtT;#@5^^S?u7s4(VIJ~zK>T#rnjg3t_-gEEZtR|E-de0 hXz$;nTphuF{_Jw_?~VqAv#Hs4TFvY{{a?Q+TZ{H diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_083.spv b/test/fuzzers/corpora/spv/graphicsfuzz_083.spv deleted file mode 100644 index fa27c33a17d62a66d52e5977ba0899798690e9a7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4328 zcmZ9O2X|Ff5QT4e2`%&_V8s_ex~OzSnkWH{ih{j_6oS!^he^P$D5BUK7O-Ijv3G3z z0{l5H%UZhpzMD62@-A!E*|TTQoH^};7&sv(-{Yf#jnY40ud z_08{?xvO*jat#W;Ko?ooTE^CD%W*9oXW5QYS5N$05 zGDf{x@IbvnHVWKc){JJ{(b|^xIwr@xt=schHET8&et~u3x3%Zm@q=R3*@QuUA*<7G zZ_Ty!gJRWL!yvzqP1G;-p&iODWZAavmUX?Y+t!v!y&brDjY*7cJ3I4p8H!HduXk%- zse5OCSBVpG4^JDQ^PJPcr~0qX&ZzLutnkkoHq*3#6xuBE-yUFyxUCK&s3FWsB< z%o2S}#rJDMA?LZPx1TAPU-*p!ZtgqB%r$3=X#=QFw=?z>uj_dWK= zOEZ86=60S7u>}hjtg<)#`Pjh&2UgBy4~xbyHS(cZ2gck;j58%Ef+Dm&RDm;dmM_Ho>dxC z^DjHI6!Xlyr~du$n}RK&W+S72Hv+ro*1eq3{hYyg1*T>?=Kffx8Iupqm0)vy%b~dn zEWfur_tjwY7ST+3EC`IxU0Y@U4NZ3A07?eh+N`OtKM zE7x)-oP5;23v8Zztfd?5oW^{k-U-(y_C6S2#?AIUZO43@YK*DzPRU0fJ>beSEy2l$ zW(T-(ukMDEk6wGh=E+B1AGq>N`{Cq6vlCpoSG(ZkqxL;u^WHYZfp?LsYxt0gv;*g1`P zM!s9uC-%)6k28H7?3t=Drp9+KAHR`%!JhLml(QJ0z~p9Qp?MN)UTF4#<>gyQg<9>b)_I}1&_yR098w<^sVDm!r6^s{&Q-!M6Q7pLz9 diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_084.spv b/test/fuzzers/corpora/spv/graphicsfuzz_084.spv deleted file mode 100644 index 14f7bfddae6539e06dd35344b0888b84201b315f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4180 zcmZ9O_j6W76ozjI2`GWkK|xFa6$P6vYxi6npQz`xBd_YdqCSb5~= zzLl%jTxrI%s=ZD$r@NX|O+-&X4h;<-HegiWbdY{F0JYb>`Y7rk+RX33(?QOmp`)Y2 z#|DRhbxtRG&)EKY&rZ5%yOK9Jc6eC3gWm4pveRUA$=TELb&^q42M!Ky9UVHbWn^S@ zU(4T7o%3JrSbWYt*gvp!aPP>$k?Iblnm%Wlj`Xvud7ibO9{Lv} zuGqaTv$maa3esK2+pBZW#@cJYraikF{;3T-t%2>~GT&KT;u$SiX1M}vuh~rD$CI8{ zfmwalT@7$gdpm=+T{2Q6de%i)bXKc;7oiASddSrbO z&){l9oY8vsH%IK=^8Xjn4QOXq|IS3cXuk>P@H~EB8Tt3MEGO1YMV>&y$&+B? z;bgSLQ8g#V&DU>Van5@L?0Kzkp7$uWv2ZsAmOJyp$x~qcImgpr&!Ruy<1w(kjQKs< zQ(yS;EcOgPIlHsUh40Im)#FUsi}qbQYif3Z&GFq?^GvbTd2i2xS0LsbN1j8%?E4FkC621OHEzCsXAp<87r}C7eK;Ej>rc)J@MNT!a}ryBcs&IkM_T^Y z@Az?S&txoII=g+sOL%a$^m+;GTeDWKPNSV$9X=L<<-@w^$jeChcm-@ce4Ht9RLzHR z^Yz;2kJrHZlk+-Q&YC%IVC&Br-UNFN{ds3^f$e3?cVyFO$#@(vR2-US<9hWPvW9@@Ce-%sQ3 zBl?|1>^>h9Tb+I8f!)WPS;&V-=AH?5ALq{AAAzkg=H4Hpt#P@xac%wXEzWPmCt!ag z>}ikO-KSt$BebHKs53D+lhI zy9#HXC+GMEoO3ky`WC;j%<~=i|MPs0Pk;U`{Q<1cTIVsQ&-?OD%aYjDl_t-Ew|x{Mg-T3z1jQhBXBwtuiSHa>Bk zh&Gq?fyA`CCf6vPk-Xd3d5;4xT!#?677)t%Tnn0%lQ)jf$(K{ijs#y``oqWlgX&&t zGk<@#wpR`QX6emZt-j^$ykKY83Lj3ehG zovW0}OO?&qZmsTIDeOmX;YOdI_;zondCW)7K@1IIu?yZx^Bj-xi3qnvn7j67n_G&X%??pbN(!ZR0Nx|hT05uGvo`M|+5Cy{0ju{Nh5tTDqHoGU)+B7R7^ zK>|M=Y$mI@D0%yY;uiDh*{Ts)|!wI1HUScv*TNXXB~1<6P)Fk z6lVWs-xen4m$0WPVL0M!PjJMO|Bi&3&Auzl8lS`Z)537X+4^wAQxo5RT+@u~xTe_< z18+6)PQY7D_9p#N|L4SW5757~#=P``gn|E_G=8-0`MxkY%w80xhM%foSo(p47~sp>DLnG6OW%aiF$a;@cmPUDan6jeQ@3Y diff --git a/test/fuzzers/corpora/spv/graphicsfuzz_086.spv b/test/fuzzers/corpora/spv/graphicsfuzz_086.spv deleted file mode 100644 index a3119927b84db29657f40034fe07ecc35f1519d7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2476 zcmZvcd2f_e6o)Tur$AZCzKJ+(SrlqTb}W=upaWQ06>#lBhtg#1n3-bulNbmlej2}( zpTGzSiO=)SJ?71%cXD#h`JLZc?tSOp-ky>5DXmKz_&rOVwLSHKq_ipZ7rHj{U}mhn zx;S>`>`570Q*S|(Gnm$=K6DTA%lz_+0i$Buu*7MA)mzk>B&kBQ%&!ou!1=Y=M)%{T zwA7fLZp|-UZ8lqrxJ6Dsdg1xgVupTr`mR>J-E2HxU2f9dTK02kZ$LK~%bpvtmsjhp zc8(38f6MkJV}&gs!Byza4E4apODC#;t37 zCwd(sKAwH|Aa*FvYOdT}XzMz^TzzYc?Z)4Yt|I21$o?K|m-&0qa$}Z#*yhBn`?0Op z!TZty>?-22p8f}g*Qs|9TfX}-uKo}qIu(4+&Ux(r5n8@IW4Cf|J=Lp+Cr_#dO?iWzqwpCGRAj~Cv{E2Hc{ z?g>Ori1FZ#Vzd6|eu^Vj=0=^dj7Qu$5&JCXtra_2s%N~M_j%5Xq{@y`V-mre{zmD$alg!=JMV6 z7w-z%JM8=5J8QnachL7SeDBQ0E`OlQ_q_|gvuw`(W$HP@B;tSn4lHM$LMF4IihDD~ z6uu8%BG&TVFkk*vMEnmp`qvO^h)+=2`8!yJ`;^jkM9jCs8s4XAMEo@o{aVI+FIM1q zrZ+O~EY`V+SjRUc>fFkB)cFcutXyXXU;HlFzGYt{))seO&sWSop6_i$Ear8VI~fno z-OPzuh*I&#rjQ$>xBmRyY{T~o(TT44~f5djS*w;_kBZzo#e#Vyb zd*0_P_F+Uk^5(G3HTEX+=CS7xxp4+!?#n$oi#qx&V7sq4&nMVoM-cOkiIvaIJw^T^ qwsZcO``59>E+OW7SH=;)^91@SA|}ro-k&8zTz+5n-*am&ApZeo`G}bS diff --git a/test/fuzzers/random_generator.cpp b/test/fuzzers/random_generator.cpp deleted file mode 100644 index 801a9ffe..00000000 --- a/test/fuzzers/random_generator.cpp +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) 2021 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "test/fuzzers/random_generator.h" - -#include -#include -#include - -namespace spvtools { -namespace fuzzers { - -namespace { -/// Generate integer from uniform distribution -/// @tparam I - integer type -/// @param engine - random number engine to use -/// @param lower - Lower bound of integer generated -/// @param upper - Upper bound of integer generated -/// @returns i, where lower <= i < upper -template -I RandomUInt(std::mt19937_64* engine, I lower, I upper) { - assert(lower < upper && "|lower| must be stictly less than |upper|"); - return std::uniform_int_distribution(lower, upper - 1)(*engine); -} - -/// Helper for obtaining a seed bias value for HashCombine with a bit-width -/// dependent on the size of size_t. -template -struct HashCombineOffset {}; -/// Specialization of HashCombineOffset for size_t == 4. -template <> -struct HashCombineOffset<4> { - /// @returns the seed bias value for HashCombine() - static constexpr inline uint32_t value() { - return 0x9e3779b9; // Fractional portion of Golden Ratio, suggested by - // Linux Kernel and Knuth's Art of Computer Programming - } -}; -/// Specialization of HashCombineOffset for size_t == 8. -template <> -struct HashCombineOffset<8> { - /// @returns the seed bias value for HashCombine() - static constexpr inline uint64_t value() { - return 0x9e3779b97f4a7c16; // Fractional portion of Golden Ratio, suggested - // by Linux Kernel and Knuth's Art of Computer - // Programming - } -}; - -/// HashCombine "hashes" together an existing hash and hashable values. -template -void HashCombine(size_t* hash, const T& value) { - constexpr size_t offset = HashCombineOffset::value(); - *hash ^= std::hash()(value) + offset + (*hash << 6) + (*hash >> 2); -} - -/// Calculate the hash for the contents of a C-style data buffer -/// @param data - pointer to buffer to be hashed -/// @param size - number of elements in buffer -/// @returns hash of the data in the buffer -size_t HashBuffer(const uint8_t* data, const size_t size) { - size_t hash = - static_cast(0xCA8945571519E991); // seed with an arbitrary prime - HashCombine(&hash, size); - for (size_t i = 0; i < size; i++) { - HashCombine(&hash, data[i]); - } - return hash; -} - -} // namespace - -RandomGenerator::RandomGenerator(uint64_t seed) : engine_(seed) {} - -RandomGenerator::RandomGenerator(const uint8_t* data, size_t size) { - RandomGenerator(RandomGenerator::CalculateSeed(data, size)); -} - -spv_target_env RandomGenerator::GetTargetEnv() { - spv_target_env result; - - // Need to check that the generated value isn't for a deprecated target env. - do { - result = static_cast( - RandomUInt(&engine_, 0u, static_cast(SPV_ENV_MAX))); - } while (!spvIsValidEnv(result)); - - return result; -} - -uint32_t RandomGenerator::GetUInt32(uint32_t lower, uint32_t upper) { - return RandomUInt(&engine_, lower, upper); -} - -uint32_t RandomGenerator::GetUInt32(uint32_t bound) { - assert(bound > 0 && "|bound| must be greater than 0"); - return RandomUInt(&engine_, 0u, bound); -} - -uint64_t RandomGenerator::CalculateSeed(const uint8_t* data, size_t size) { - assert(data != nullptr && "|data| must be !nullptr"); - - // Number of bytes we want to skip at the start of data for the hash. - // Fewer bytes may be skipped when `size` is small. - // Has lower precedence than kHashDesiredMinBytes. - static const int64_t kHashDesiredLeadingSkipBytes = 5; - // Minimum number of bytes we want to use in the hash. - // Used for short buffers. - static const int64_t kHashDesiredMinBytes = 4; - // Maximum number of bytes we want to use in the hash. - static const int64_t kHashDesiredMaxBytes = 32; - int64_t size_i64 = static_cast(size); - int64_t hash_begin_i64 = - std::min(kHashDesiredLeadingSkipBytes, - std::max(size_i64 - kHashDesiredMinBytes, 0)); - int64_t hash_end_i64 = - std::min(hash_begin_i64 + kHashDesiredMaxBytes, size_i64); - size_t hash_begin = static_cast(hash_begin_i64); - size_t hash_size = static_cast(hash_end_i64) - hash_begin; - return HashBuffer(data + hash_begin, hash_size); -} - -} // namespace fuzzers -} // namespace spvtools diff --git a/test/fuzzers/random_generator.h b/test/fuzzers/random_generator.h deleted file mode 100644 index b121fe8c..00000000 --- a/test/fuzzers/random_generator.h +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) 2021 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef TEST_FUZZERS_RANDOM_GENERATOR_H_ -#define TEST_FUZZERS_RANDOM_GENERATOR_H_ - -#include -#include - -#include "source/spirv_target_env.h" - -namespace spvtools { -namespace fuzzers { - -/// Pseudo random generator utility class for fuzzing -class RandomGenerator { - public: - /// @brief Initializes the internal engine - /// @param seed - seed value passed to engine - explicit RandomGenerator(uint64_t seed); - - /// @brief Initializes the internal engine - /// @param data - data to calculate the seed from - /// @param size - size of the data - explicit RandomGenerator(const uint8_t* data, size_t size); - - ~RandomGenerator() {} - - /// Calculate a seed value based on a blob of data. - /// Currently hashes bytes near the front of the buffer, after skipping N - /// bytes. - /// @param data - pointer to data to base calculation off of, must be !nullptr - /// @param size - number of elements in |data|, must be > 0 - static uint64_t CalculateSeed(const uint8_t* data, size_t size); - - /// Get random valid target env. - spv_target_env GetTargetEnv(); - - /// Get uint32_t value from uniform distribution. - /// @param lower - lower bound of integer generated - /// @param upper - upper bound of integer generated - /// @returns i, where lower <= i < upper - uint32_t GetUInt32(uint32_t lower, uint32_t upper); - - /// Get uint32_t value from uniform distribution. - /// @param bound - Upper bound of integer generated - /// @returns i, where 0 <= i < bound - uint32_t GetUInt32(uint32_t bound); - - private: - std::mt19937_64 engine_; -}; // class RandomGenerator - -} // namespace fuzzers -} // namespace spvtools - -#endif // TEST_FUZZERS_RANDOM_GENERATOR_UTILS_H_ diff --git a/test/fuzzers/spvtools_fuzz_fuzzer.cpp b/test/fuzzers/spvtools_fuzz_fuzzer.cpp deleted file mode 100644 index d43920cf..00000000 --- a/test/fuzzers/spvtools_fuzz_fuzzer.cpp +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include - -#include "source/fuzz/fuzzer.h" -#include "source/fuzz/pseudo_random_generator.h" -#include "spirv-tools/libspirv.hpp" -#include "test/fuzzers/random_generator.h" - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - if (size == 0 || (size % sizeof(uint32_t)) != 0) { - // An empty binary, or a binary whose size is not a multiple of word-size, - // cannot be valid, so can be rejected immediately. - return 0; - } - - std::vector initial_binary(size / sizeof(uint32_t)); - memcpy(initial_binary.data(), data, size); - - spvtools::ValidatorOptions validator_options; - - spvtools::MessageConsumer message_consumer = - [](spv_message_level_t, const char*, const spv_position_t&, const char*) { - }; - - spvtools::fuzzers::RandomGenerator random_gen(data, size); - auto target_env = random_gen.GetTargetEnv(); - std::unique_ptr ir_context; - if (!spvtools::fuzz::fuzzerutil::BuildIRContext( - target_env, message_consumer, initial_binary, validator_options, - &ir_context)) { - // The input is invalid - give up. - return 0; - } - - std::vector donor_suppliers = { - [&initial_binary, message_consumer, target_env, - &validator_options]() -> std::unique_ptr { - std::unique_ptr result; - if (!spvtools::fuzz::fuzzerutil::BuildIRContext( - target_env, message_consumer, initial_binary, validator_options, - &result)) { - // The input was successfully parsed and validated first time around, - // so something is wrong if it is now invalid. - abort(); - } - return result; - }}; - - uint32_t seed = random_gen.GetUInt32(std::numeric_limits::max()); - auto fuzzer_context = spvtools::MakeUnique( - spvtools::MakeUnique(seed), - spvtools::fuzz::FuzzerContext::GetMinFreshId(ir_context.get()), false); - - auto transformation_context = - spvtools::MakeUnique( - spvtools::MakeUnique(ir_context.get()), - validator_options); - - spvtools::fuzz::Fuzzer fuzzer( - std::move(ir_context), std::move(transformation_context), - std::move(fuzzer_context), message_consumer, donor_suppliers, false, - spvtools::fuzz::RepeatedPassStrategy::kLoopedWithRecommendations, true, - validator_options); - fuzzer.Run(0); - return 0; -} diff --git a/test/fuzzers/spvtools_opt_fuzzer_common.cpp b/test/fuzzers/spvtools_opt_fuzzer_common.cpp deleted file mode 100644 index 49785090..00000000 --- a/test/fuzzers/spvtools_opt_fuzzer_common.cpp +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "test/fuzzers/spvtools_opt_fuzzer_common.h" - -#include "source/opt/build_module.h" -#include "test/fuzzers/random_generator.h" - -namespace spvtools { -namespace fuzzers { - -int OptFuzzerTestOneInput( - const uint8_t* data, size_t size, - const std::function& register_passes) { - if (size < 1) { - return 0; - } - - spvtools::fuzzers::RandomGenerator random_gen(data, size); - auto target_env = random_gen.GetTargetEnv(); - spvtools::Optimizer optimizer(target_env); - optimizer.SetMessageConsumer([](spv_message_level_t, const char*, - const spv_position_t&, const char*) {}); - - std::vector input; - input.resize(size >> 2); - - size_t count = 0; - for (size_t i = 0; (i + 3) < size; i += 4) { - input[count++] = data[i] | (data[i + 1] << 8) | (data[i + 2] << 16) | - (data[i + 3]) << 24; - } - - // The largest possible id bound is used when running the optimizer, to avoid - // the problem of id overflows. - const size_t kFinalIdLimit = UINT32_MAX; - - // The input is scanned to check that it does not already use an id too close - // to this limit. This still gives the optimizer a large set of ids to - // consume. It is thus very unlikely that id overflow will occur during - // fuzzing. If it does, then the initial id limit should be decreased. - const size_t kInitialIdLimit = kFinalIdLimit - 1000000U; - - // Build the module and scan it to check that all used ids are below the - // initial limit. - auto ir_context = - spvtools::BuildModule(target_env, nullptr, input.data(), input.size()); - if (ir_context == nullptr) { - // It was not possible to build a valid module; that's OK - skip this input. - return 0; - } - if (ir_context->module()->id_bound() >= kInitialIdLimit) { - // The input already has a very large id bound. The input is thus abandoned, - // to avoid the possibility of ending up hitting the id bound limit. - return 0; - } - - // Set the optimizer and its validator up with the largest possible id bound - // limit. - spvtools::ValidatorOptions validator_options; - spvtools::OptimizerOptions optimizer_options; - optimizer_options.set_max_id_bound(kFinalIdLimit); - validator_options.SetUniversalLimit(spv_validator_limit_max_id_bound, - kFinalIdLimit); - optimizer_options.set_validator_options(validator_options); - register_passes(optimizer); - optimizer.Run(input.data(), input.size(), &input, optimizer_options); - - return 0; -} - -} // namespace fuzzers -} // namespace spvtools diff --git a/test/fuzzers/spvtools_opt_fuzzer_common.h b/test/fuzzers/spvtools_opt_fuzzer_common.h deleted file mode 100644 index b8d4281c..00000000 --- a/test/fuzzers/spvtools_opt_fuzzer_common.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef TEST_FUZZERS_SPVTOOLS_OPT_FUZZER_COMMON_H_ -#define TEST_FUZZERS_SPVTOOLS_OPT_FUZZER_COMMON_H_ - -#include -#include -#include - -#include "spirv-tools/optimizer.hpp" - -namespace spvtools { -namespace fuzzers { - -// Helper function capturing the common logic for the various optimizer fuzzers. -int OptFuzzerTestOneInput( - const uint8_t* data, size_t size, - const std::function& register_passes); - -} // namespace fuzzers -} // namespace spvtools - -#endif // TEST_FUZZERS_SPVTOOLS_OPT_FUZZER_COMMON_H_ diff --git a/test/lint/CMakeLists.txt b/test/lint/CMakeLists.txt deleted file mode 100644 index 09bc6d39..00000000 --- a/test/lint/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (c) 2021 Google LLC. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -add_spvtools_unittest(TARGET lint - SRCS divergence_analysis_test.cpp - LIBS SPIRV-Tools-lint SPIRV-Tools-opt -) diff --git a/test/lint/divergence_analysis_test.cpp b/test/lint/divergence_analysis_test.cpp deleted file mode 100644 index 36cd32dd..00000000 --- a/test/lint/divergence_analysis_test.cpp +++ /dev/null @@ -1,700 +0,0 @@ -// Copyright (c) 2021 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/lint/divergence_analysis.h" - -#include - -#include "gtest/gtest.h" -#include "source/opt/build_module.h" -#include "source/opt/ir_context.h" -#include "source/opt/module.h" -#include "spirv-tools/libspirv.h" - -namespace spvtools { -namespace lint { -namespace { - -void CLIMessageConsumer(spv_message_level_t level, const char*, - const spv_position_t& position, const char* message) { - switch (level) { - case SPV_MSG_FATAL: - case SPV_MSG_INTERNAL_ERROR: - case SPV_MSG_ERROR: - std::cerr << "error: line " << position.index << ": " << message - << std::endl; - break; - case SPV_MSG_WARNING: - std::cout << "warning: line " << position.index << ": " << message - << std::endl; - break; - case SPV_MSG_INFO: - std::cout << "info: line " << position.index << ": " << message - << std::endl; - break; - default: - break; - } -} - -class DivergenceTest : public ::testing::Test { - protected: - std::unique_ptr context_; - std::unique_ptr divergence_; - - void Build(std::string text, uint32_t function_id = 1) { - context_ = BuildModule(SPV_ENV_UNIVERSAL_1_0, CLIMessageConsumer, text, - SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - ASSERT_NE(nullptr, context_.get()); - opt::Module* module = context_->module(); - ASSERT_NE(nullptr, module); - // First function should have the given ID. - ASSERT_NE(module->begin(), module->end()); - opt::Function* function = &*module->begin(); - ASSERT_EQ(function->result_id(), function_id); - divergence_.reset(new DivergenceAnalysis(*context_)); - divergence_->Run(function); - } -}; - -// Makes assertions a bit shorter. -using Level = DivergenceAnalysis::DivergenceLevel; - -namespace { -std::string Preamble() { - return R"( - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %1 "main" %x %y - OpExecutionMode %1 OriginLowerLeft - OpDecorate %y Flat - %void = OpTypeVoid - %void_f = OpTypeFunction %void - %bool = OpTypeBool - %float = OpTypeFloat 32 - %false = OpConstantFalse %bool - %true = OpConstantTrue %bool - %zero = OpConstant %float 0 - %one = OpConstant %float 1 - %x_t = OpTypePointer Input %float - %x = OpVariable %x_t Input - %y = OpVariable %x_t Input - %1 = OpFunction %void None %void_f - )"; -} -} // namespace - -TEST_F(DivergenceTest, SimpleTest) { - // pseudocode: - // %10: - // %11 = load x - // if (%12 = (%11 < 0)) { - // %13: - // // do nothing - // } - // %14: - // return - ASSERT_NO_FATAL_FAILURE(Build(Preamble() + R"( - %10 = OpLabel - %11 = OpLoad %float %x - %12 = OpFOrdLessThan %bool %11 %zero - OpSelectionMerge %14 None - OpBranchConditional %12 %13 %14 - %13 = OpLabel - OpBranch %14 - %14 = OpLabel - OpReturn - OpFunctionEnd - )")); - // Control flow divergence. - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(10)); - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(13)); - EXPECT_EQ(12, divergence_->GetDivergenceSource(13)); - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(14)); - // Value divergence. - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(11)); - EXPECT_EQ(0, divergence_->GetDivergenceSource(11)); - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(12)); - EXPECT_EQ(11, divergence_->GetDivergenceSource(12)); -} - -TEST_F(DivergenceTest, FlowTypesTest) { - // pseudocode: - // %10: - // %11 = load x - // %12 = x < 0 // data -> data - // if (%12) { - // %13: // data -> control - // if (true) { - // %14: // control -> control - // } - // %15: - // %16 = 1 - // } else { - // %17: - // %18 = 2 - // } - // %19: - // %19 = phi(%16 from %15, %18 from %17) // control -> data - // return - ASSERT_NO_FATAL_FAILURE(Build(Preamble() + R"( - %10 = OpLabel - %11 = OpLoad %float %x - %12 = OpFOrdLessThan %bool %11 %zero - OpSelectionMerge %19 None - OpBranchConditional %12 %13 %17 - %13 = OpLabel - OpSelectionMerge %15 None - OpBranchConditional %true %14 %15 - %14 = OpLabel - OpBranch %15 - %15 = OpLabel - %16 = OpFAdd %float %zero %zero - OpBranch %19 - %17 = OpLabel - %18 = OpFAdd %float %zero %one - OpBranch %19 - %19 = OpLabel - %20 = OpPhi %float %16 %15 %18 %17 - OpReturn - OpFunctionEnd - )")); - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(10)); - - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(11)); - EXPECT_EQ(0, divergence_->GetDivergenceSource(11)); - - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(12)); - EXPECT_EQ(11, divergence_->GetDivergenceSource(12)); - - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(13)); - EXPECT_EQ(12, divergence_->GetDivergenceSource(13)); - EXPECT_EQ(10, divergence_->GetDivergenceDependenceSource(13)); - - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(14)); - EXPECT_EQ(13, divergence_->GetDivergenceSource(14)); - - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(15)); - EXPECT_EQ(12, divergence_->GetDivergenceSource(15)); - EXPECT_EQ(10, divergence_->GetDivergenceDependenceSource(15)); - - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(16)); - - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(17)); - EXPECT_EQ(12, divergence_->GetDivergenceSource(17)); - EXPECT_EQ(10, divergence_->GetDivergenceDependenceSource(17)); - - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(18)); - - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(19)); - - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(20)); - EXPECT_TRUE(divergence_->GetDivergenceSource(20) == 15 || - divergence_->GetDivergenceDependenceSource(20) == 17) - << "Got: " << divergence_->GetDivergenceDependenceSource(20); -} - -TEST_F(DivergenceTest, ExitDependenceTest) { - // pseudocode: - // %10: - // %11 = load x - // %12 = %11 < 0 - // %13: - // do { - // %14: - // if (%12) { - // %15: - // continue; - // } - // %16: - // %17: - // continue; - // } %18: while(false); - // %19: - // return - ASSERT_NO_FATAL_FAILURE(Build(Preamble() + R"( - %10 = OpLabel - %11 = OpLoad %float %x - %12 = OpFOrdLessThan %bool %11 %zero ; data -> data - OpBranch %13 - %13 = OpLabel - OpLoopMerge %19 %18 None - OpBranch %14 - %14 = OpLabel - OpSelectionMerge %16 None - OpBranchConditional %12 %15 %16 - %15 = OpLabel - OpBranch %18 ; continue - %16 = OpLabel - OpBranch %17 - %17 = OpLabel - OpBranch %18 ; continue - %18 = OpLabel - OpBranchConditional %false %13 %19 - %19 = OpLabel - OpReturn - OpFunctionEnd - )")); - - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(10)); - - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(11)); - EXPECT_EQ(0, divergence_->GetDivergenceSource(11)); - - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(12)); - EXPECT_EQ(11, divergence_->GetDivergenceSource(12)); - - // Since both branches continue, there's no divergent control dependence - // to 13. - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(13)); - - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(14)); - - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(15)); - EXPECT_EQ(12, divergence_->GetDivergenceSource(15)); - EXPECT_EQ(14, divergence_->GetDivergenceDependenceSource(15)); - - // These two blocks are outside the if but are still control dependent. - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(16)); - EXPECT_EQ(12, divergence_->GetDivergenceSource(16)); - EXPECT_EQ(14, divergence_->GetDivergenceDependenceSource(16)); - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(17)); - EXPECT_EQ(12, divergence_->GetDivergenceSource(17)); - EXPECT_EQ(14, divergence_->GetDivergenceDependenceSource(17)); - - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(18)); - - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(19)); -} - -TEST_F(DivergenceTest, ReconvergencePromotionTest) { - // pseudocode: - // %10: - // %11 = load y - // %12 = %11 < 0 - // if (%12) { - // %13: - // %14: - // %15: - // if (true) { - // %16: - // } - // // Reconvergence *not* guaranteed as - // // control is not uniform on the IG level - // // at %15. - // %17: - // %18: - // %19: - // %20 = load x - // } - // %21: - // %22 = phi(%11, %20) - // return - ASSERT_NO_FATAL_FAILURE(Build(Preamble() + R"( - %10 = OpLabel - %11 = OpLoad %float %y - %12 = OpFOrdLessThan %bool %11 %zero - OpSelectionMerge %21 None - OpBranchConditional %12 %13 %21 - %13 = OpLabel - OpBranch %14 - %14 = OpLabel - OpBranch %15 - %15 = OpLabel - OpSelectionMerge %17 None - OpBranchConditional %true %16 %17 - %16 = OpLabel - OpBranch %17 - %17 = OpLabel - OpBranch %18 - %18 = OpLabel - OpBranch %19 - %19 = OpLabel - %20 = OpLoad %float %y - OpBranch %21 - %21 = OpLabel - %22 = OpPhi %float %11 %10 %20 %19 - OpReturn - OpFunctionEnd - )")); - ASSERT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(10)); - ASSERT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(21)); - - ASSERT_EQ(Level::kPartiallyUniform, divergence_->GetDivergenceLevel(11)); - ASSERT_EQ(0, divergence_->GetDivergenceSource(11)); - ASSERT_EQ(Level::kPartiallyUniform, divergence_->GetDivergenceLevel(12)); - ASSERT_EQ(11, divergence_->GetDivergenceSource(12)); - ASSERT_EQ(Level::kPartiallyUniform, divergence_->GetDivergenceLevel(13)); - ASSERT_EQ(12, divergence_->GetDivergenceSource(13)); - ASSERT_EQ(10, divergence_->GetDivergenceDependenceSource(13)); - ASSERT_EQ(Level::kPartiallyUniform, divergence_->GetDivergenceLevel(14)); - ASSERT_EQ(12, divergence_->GetDivergenceSource(14)); - ASSERT_EQ(10, divergence_->GetDivergenceDependenceSource(14)); - ASSERT_EQ(Level::kPartiallyUniform, divergence_->GetDivergenceLevel(15)); - ASSERT_EQ(12, divergence_->GetDivergenceSource(15)); - ASSERT_EQ(10, divergence_->GetDivergenceDependenceSource(15)); - ASSERT_EQ(Level::kPartiallyUniform, divergence_->GetDivergenceLevel(16)); - ASSERT_EQ(15, divergence_->GetDivergenceSource(16)); - - ASSERT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(17)); - ASSERT_EQ(12, divergence_->GetDivergenceSource(17)); - ASSERT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(18)); - ASSERT_EQ(12, divergence_->GetDivergenceSource(18)); - ASSERT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(19)); - ASSERT_EQ(12, divergence_->GetDivergenceSource(19)); - - ASSERT_EQ(Level::kPartiallyUniform, divergence_->GetDivergenceLevel(20)); - ASSERT_EQ(0, divergence_->GetDivergenceSource(20)); - ASSERT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(22)); - ASSERT_EQ(19, divergence_->GetDivergenceSource(22)); - ASSERT_EQ(10, divergence_->GetDivergenceDependenceSource(15)); -} - -TEST_F(DivergenceTest, FunctionCallTest) { - // pseudocode: - // %2() { - // %20: - // %21 = load x - // %22 = %21 < 0 - // if (%22) { - // %23: - // return - // } - // %24: - // return - // } - // - // main() { - // %10: - // %11 = %2(); - // // Reconvergence *not* guaranteed. - // %12: - // return - // } - ASSERT_NO_FATAL_FAILURE(Build(Preamble() + R"( - %10 = OpLabel - %11 = OpFunctionCall %void %2 - OpBranch %12 - %12 = OpLabel - OpReturn - OpFunctionEnd - - %2 = OpFunction %void None %void_f - %20 = OpLabel - %21 = OpLoad %float %x - %22 = OpFOrdLessThan %bool %21 %zero - OpSelectionMerge %24 None - OpBranchConditional %22 %23 %24 - %23 = OpLabel - OpReturn - %24 = OpLabel - OpReturn - OpFunctionEnd - )")); - - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(10)); - // Conservatively assume function return value is uniform. - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(11)); - // TODO(dongja): blocks reachable from diverging function calls should be - // divergent. - // EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(12)); - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(12)); // Wrong! -} - -TEST_F(DivergenceTest, LateMergeTest) { - // pseudocode: - // %10: - // %11 = load y - // %12 = %11 < 0 - // [merge: %15] - // if (%12) { - // %13: - // } - // %14: // Reconvergence hasn't happened by here. - // %15: - // return - ASSERT_NO_FATAL_FAILURE(Build(Preamble() + R"( - %10 = OpLabel - %11 = OpLoad %float %x - %12 = OpFOrdLessThan %bool %11 %zero - OpSelectionMerge %15 None - OpBranchConditional %12 %13 %14 - %13 = OpLabel - OpBranch %14 - %14 = OpLabel - OpBranch %15 - %15 = OpLabel - OpReturn - OpFunctionEnd - )")); - - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(10)); - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(11)); - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(12)); - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(13)); - // TODO(dongja): - // EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(14)); - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(14)); // Wrong! - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(15)); -} - -// The following series of tests makes sure that we find the least fixpoint. -TEST_F(DivergenceTest, UniformFixpointTest) { - // pseudocode: - // %10: - // %20 = load x - // %21 = load y - // do { - // %11: - // %12: - // %13 = phi(%zero from %11, %14 from %16) - // %14 = %13 + 1 - // %15 = %13 < 1 - // } %16: while (%15) - // %17: - ASSERT_NO_FATAL_FAILURE(Build(Preamble() + R"( - %10 = OpLabel - %20 = OpLoad %float %x - %21 = OpLoad %float %y - OpBranch %11 - %11 = OpLabel - %13 = OpPhi %float %zero %10 %14 %16 - OpLoopMerge %17 %16 None - OpBranch %12 - %12 = OpLabel - %14 = OpFAdd %float %13 %one - %15 = OpFOrdLessThan %bool %13 %one - OpBranch %16 - %16 = OpLabel - OpBranchConditional %15 %11 %17 - %17 = OpLabel - OpReturn - OpFunctionEnd - )")); - - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(10)); - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(11)); - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(12)); - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(13)); - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(14)); - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(15)); - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(16)); - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(17)); -} - -TEST_F(DivergenceTest, PartiallyUniformFixpointTest) { - // pseudocode: - // %10: - // %20 = load x - // %21 = load y - // do { - // %11: - // %12: - // %13 = phi(%zero from %11, %14 from %16) - // %14 = %13 + 1 - // %15 = %13 < %21 - // } %16: while (%15) - // %17: - ASSERT_NO_FATAL_FAILURE(Build(Preamble() + R"( - %10 = OpLabel - %20 = OpLoad %float %x - %21 = OpLoad %float %y - OpBranch %11 - %11 = OpLabel - %13 = OpPhi %float %zero %10 %14 %16 - OpLoopMerge %17 %16 None - OpBranch %12 - %12 = OpLabel - %14 = OpFAdd %float %13 %one - %15 = OpFOrdLessThan %bool %13 %21 - OpBranch %16 - %16 = OpLabel - OpBranchConditional %15 %11 %17 - %17 = OpLabel - OpReturn - OpFunctionEnd - )")); - - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(10)); - EXPECT_EQ(Level::kPartiallyUniform, divergence_->GetDivergenceLevel(11)); - EXPECT_EQ(Level::kPartiallyUniform, divergence_->GetDivergenceLevel(12)); - EXPECT_EQ(Level::kPartiallyUniform, divergence_->GetDivergenceLevel(13)); - EXPECT_EQ(Level::kPartiallyUniform, divergence_->GetDivergenceLevel(14)); - EXPECT_EQ(Level::kPartiallyUniform, divergence_->GetDivergenceLevel(15)); - EXPECT_EQ(Level::kPartiallyUniform, divergence_->GetDivergenceLevel(16)); - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(17)); -} - -TEST_F(DivergenceTest, DivergentFixpointTest) { - // pseudocode: - // %10: - // %20 = load x - // %21 = load y - // do { - // %11: - // %12: - // %13 = phi(%zero from %11, %14 from %16) - // %14 = %13 + 1 - // %15 = %13 < %20 - // } %16: while (%15) - // %17: - ASSERT_NO_FATAL_FAILURE(Build(Preamble() + R"( - %10 = OpLabel - %20 = OpLoad %float %x - %21 = OpLoad %float %y - OpBranch %11 - %11 = OpLabel - %13 = OpPhi %float %zero %10 %14 %16 - OpLoopMerge %17 %16 None - OpBranch %12 - %12 = OpLabel - %14 = OpFAdd %float %13 %one - %15 = OpFOrdLessThan %bool %13 %20 - OpBranch %16 - %16 = OpLabel - OpBranchConditional %15 %11 %17 - %17 = OpLabel - OpReturn - OpFunctionEnd - )")); - - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(10)); - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(11)); - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(12)); - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(13)); - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(14)); - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(15)); - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(16)); - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(17)); -} - -TEST_F(DivergenceTest, DivergentOverridesPartiallyUniformTest) { - // pseudocode: - // %10: - // %20 = load x - // %21 = load y - // %11: - // do { - // %12: - // %13 = phi(%21 from %11, %14 from %16) - // %14 = %13 + 1 - // %15 = %13 < %20 - // } %16: while (%15) - // %17: - ASSERT_NO_FATAL_FAILURE(Build(Preamble() + R"( - %10 = OpLabel - %20 = OpLoad %float %x - %21 = OpLoad %float %y - OpBranch %11 - %11 = OpLabel - %13 = OpPhi %float %zero %10 %14 %16 - OpLoopMerge %17 %16 None - OpBranch %12 - %12 = OpLabel - %14 = OpFAdd %float %13 %one - %15 = OpFOrdLessThan %bool %13 %20 - OpBranch %16 - %16 = OpLabel - OpBranchConditional %15 %11 %17 - %17 = OpLabel - OpReturn - OpFunctionEnd - )")); - - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(10)); - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(11)); - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(12)); - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(13)); - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(14)); - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(15)); - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(16)); - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(17)); -} - -TEST_F(DivergenceTest, NestedFixpointTest) { - // pseudocode: - // %10: - // %20 = load x - // %21 = load y - // do { - // %22: - // %23: - // %24 = phi(%zero from %22, %25 from %26) - // %11: - // do { - // %12: - // %13 = phi(%zero from %11, %14 from %16) - // %14 = %13 + 1 - // %15 = %13 < %24 - // } %16: while (%15) - // %17: - // %25 = load x - // } %26: while (false) - // %27: - // return - ASSERT_NO_FATAL_FAILURE(Build(Preamble() + R"( - %10 = OpLabel - %20 = OpLoad %float %x - %21 = OpLoad %float %y - OpBranch %22 - %22 = OpLabel - %24 = OpPhi %float %zero %10 %25 %26 - OpLoopMerge %27 %26 None - OpBranch %23 - %23 = OpLabel - OpBranch %11 - %11 = OpLabel - %13 = OpPhi %float %zero %23 %14 %16 - OpLoopMerge %17 %16 None - OpBranch %12 - %12 = OpLabel - %14 = OpFAdd %float %13 %one - %15 = OpFOrdLessThan %bool %13 %24 - OpBranch %16 - %16 = OpLabel - OpBranchConditional %15 %11 %17 - %17 = OpLabel - %25 = OpLoad %float %x - OpBranch %26 - %26 = OpLabel - OpBranchConditional %false %22 %27 - %27 = OpLabel - OpReturn - OpFunctionEnd - )")); - // This test makes sure that divergent values flowing upward can influence the - // fixpoint of a loop. - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(10)); - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(11)); - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(12)); - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(13)); - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(14)); - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(15)); - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(16)); - // Control of the outer loop is still uniform. - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(17)); - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(22)); - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(23)); - // Seed divergent values. - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(24)); - EXPECT_EQ(Level::kDivergent, divergence_->GetDivergenceLevel(25)); - // Outer loop control. - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(26)); - // Merged. - EXPECT_EQ(Level::kUniform, divergence_->GetDivergenceLevel(27)); -} - -} // namespace -} // namespace lint -} // namespace spvtools diff --git a/test/operand_capabilities_test.cpp b/test/operand_capabilities_test.cpp index 6f83dfeb..0aec7918 100644 --- a/test/operand_capabilities_test.cpp +++ b/test/operand_capabilities_test.cpp @@ -199,8 +199,7 @@ INSTANTIATE_TEST_SUITE_P( CASE1(STORAGE_CLASS, StorageClassOutput, Shader), CASE0(STORAGE_CLASS, StorageClassWorkgroup), CASE0(STORAGE_CLASS, StorageClassCrossWorkgroup), - CASE2(STORAGE_CLASS, StorageClassPrivate, Shader, - VectorComputeINTEL), + CASE1(STORAGE_CLASS, StorageClassPrivate, Shader), CASE0(STORAGE_CLASS, StorageClassFunction), CASE1(STORAGE_CLASS, StorageClassGeneric, GenericPointer), // Bug 14287 diff --git a/test/opt/CMakeLists.txt b/test/opt/CMakeLists.txt index 11299755..f65d2ff3 100644 --- a/test/opt/CMakeLists.txt +++ b/test/opt/CMakeLists.txt @@ -28,11 +28,8 @@ add_spvtools_unittest(TARGET opt compact_ids_test.cpp constants_test.cpp constant_manager_test.cpp - control_dependence.cpp convert_relaxed_to_half_test.cpp - convert_to_sampled_image_test.cpp copy_prop_array_test.cpp - dataflow.cpp dead_branch_elim_test.cpp dead_insert_elim_test.cpp dead_variable_elim_test.cpp @@ -82,7 +79,6 @@ add_spvtools_unittest(TARGET opt propagator_test.cpp reduce_load_size_test.cpp redundancy_elimination_test.cpp - remove_unused_interface_variables_test.cpp register_liveness.cpp relax_float_ops_test.cpp replace_invalid_opc_test.cpp diff --git a/test/opt/control_dependence.cpp b/test/opt/control_dependence.cpp deleted file mode 100644 index 46655472..00000000 --- a/test/opt/control_dependence.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// Copyright (c) 2021 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/opt/control_dependence.h" - -#include -#include - -#include "gmock/gmock-matchers.h" -#include "gtest/gtest.h" -#include "source/opt/build_module.h" -#include "source/opt/cfg.h" -#include "test/opt/function_utils.h" - -namespace spvtools { -namespace opt { - -namespace { -void GatherEdges(const ControlDependenceAnalysis& cdg, - std::vector& ret) { - cdg.ForEachBlockLabel([&](uint32_t label) { - ret.reserve(ret.size() + cdg.GetDependenceTargets(label).size()); - ret.insert(ret.end(), cdg.GetDependenceTargets(label).begin(), - cdg.GetDependenceTargets(label).end()); - }); - std::sort(ret.begin(), ret.end()); - // Verify that reverse graph is the same. - std::vector reverse_edges; - reverse_edges.reserve(ret.size()); - cdg.ForEachBlockLabel([&](uint32_t label) { - reverse_edges.insert(reverse_edges.end(), - cdg.GetDependenceSources(label).begin(), - cdg.GetDependenceSources(label).end()); - }); - std::sort(reverse_edges.begin(), reverse_edges.end()); - ASSERT_THAT(reverse_edges, testing::ElementsAreArray(ret)); -} - -using ControlDependenceTest = ::testing::Test; - -TEST(ControlDependenceTest, DependenceSimpleCFG) { - const std::string text = R"( - OpCapability Addresses - OpCapability Kernel - OpMemoryModel Physical64 OpenCL - OpEntryPoint Kernel %1 "main" - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %4 = OpTypeBool - %5 = OpTypeInt 32 0 - %6 = OpConstant %5 0 - %7 = OpConstantFalse %4 - %8 = OpConstantTrue %4 - %9 = OpConstant %5 1 - %1 = OpFunction %2 None %3 - %10 = OpLabel - OpBranch %11 - %11 = OpLabel - OpSwitch %6 %12 1 %13 - %12 = OpLabel - OpBranch %14 - %13 = OpLabel - OpBranch %14 - %14 = OpLabel - OpBranchConditional %8 %15 %16 - %15 = OpLabel - OpBranch %19 - %16 = OpLabel - OpBranchConditional %8 %17 %18 - %17 = OpLabel - OpBranch %18 - %18 = OpLabel - OpBranch %19 - %19 = OpLabel - OpReturn - OpFunctionEnd -)"; - - // CFG: (all edges pointing downward) - // %10 - // | - // %11 - // / \ (R: %6 == 1, L: default) - // %12 %13 - // \ / - // %14 - // T/ \F - // %15 %16 - // | T/ |F - // | %17| - // | \ | - // | %18 - // | / - // %19 - - std::unique_ptr context = - BuildModule(SPV_ENV_UNIVERSAL_1_0, nullptr, text, - SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - Module* module = context->module(); - EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" - << text << std::endl; - const Function* fn = spvtest::GetFunction(module, 1); - const BasicBlock* entry = spvtest::GetBasicBlock(fn, 10); - EXPECT_EQ(entry, fn->entry().get()) - << "The entry node is not the expected one"; - - { - PostDominatorAnalysis pdom; - const CFG& cfg = *context->cfg(); - pdom.InitializeTree(cfg, fn); - ControlDependenceAnalysis cdg; - cdg.ComputeControlDependenceGraph(cfg, pdom); - - // Test HasBlock. - for (uint32_t id = 10; id <= 19; id++) { - EXPECT_TRUE(cdg.HasBlock(id)); - } - EXPECT_TRUE(cdg.HasBlock(ControlDependenceAnalysis::kPseudoEntryBlock)); - // Check blocks before/after valid range. - EXPECT_FALSE(cdg.HasBlock(5)); - EXPECT_FALSE(cdg.HasBlock(25)); - EXPECT_FALSE(cdg.HasBlock(UINT32_MAX)); - - // Test ForEachBlockLabel. - std::set block_labels; - cdg.ForEachBlockLabel([&block_labels](uint32_t id) { - bool inserted = block_labels.insert(id).second; - EXPECT_TRUE(inserted); // Should have no duplicates. - }); - EXPECT_THAT(block_labels, testing::ElementsAre(0, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19)); - - { - // Test WhileEachBlockLabel. - uint32_t iters = 0; - EXPECT_TRUE(cdg.WhileEachBlockLabel([&iters](uint32_t) { - ++iters; - return true; - })); - EXPECT_EQ((uint32_t)block_labels.size(), iters); - iters = 0; - EXPECT_FALSE(cdg.WhileEachBlockLabel([&iters](uint32_t) { - ++iters; - return false; - })); - EXPECT_EQ(1, iters); - } - - // Test IsDependent. - EXPECT_TRUE(cdg.IsDependent(12, 11)); - EXPECT_TRUE(cdg.IsDependent(13, 11)); - EXPECT_TRUE(cdg.IsDependent(15, 14)); - EXPECT_TRUE(cdg.IsDependent(16, 14)); - EXPECT_TRUE(cdg.IsDependent(18, 14)); - EXPECT_TRUE(cdg.IsDependent(17, 16)); - EXPECT_TRUE(cdg.IsDependent(10, 0)); - EXPECT_TRUE(cdg.IsDependent(11, 0)); - EXPECT_TRUE(cdg.IsDependent(14, 0)); - EXPECT_TRUE(cdg.IsDependent(19, 0)); - EXPECT_FALSE(cdg.IsDependent(14, 11)); - EXPECT_FALSE(cdg.IsDependent(17, 14)); - EXPECT_FALSE(cdg.IsDependent(19, 14)); - EXPECT_FALSE(cdg.IsDependent(12, 0)); - - // Test GetDependenceSources/Targets. - std::vector edges; - GatherEdges(cdg, edges); - EXPECT_THAT(edges, - testing::ElementsAre( - ControlDependence(0, 10), ControlDependence(0, 11, 10), - ControlDependence(0, 14, 10), ControlDependence(0, 19, 10), - ControlDependence(11, 12), ControlDependence(11, 13), - ControlDependence(14, 15), ControlDependence(14, 16), - ControlDependence(14, 18, 16), ControlDependence(16, 17))); - - const uint32_t expected_condition_ids[] = { - 0, 0, 0, 0, 6, 6, 8, 8, 8, 8, - }; - - for (uint32_t i = 0; i < edges.size(); i++) { - EXPECT_EQ(expected_condition_ids[i], edges[i].GetConditionID(cfg)); - } - } -} - -TEST(ControlDependenceTest, DependencePaperCFG) { - const std::string text = R"( - OpCapability Addresses - OpCapability Kernel - OpMemoryModel Physical64 OpenCL - OpEntryPoint Kernel %101 "main" - %102 = OpTypeVoid - %103 = OpTypeFunction %102 - %104 = OpTypeBool - %108 = OpConstantTrue %104 - %101 = OpFunction %102 None %103 - %1 = OpLabel - OpBranch %2 - %2 = OpLabel - OpBranchConditional %108 %3 %7 - %3 = OpLabel - OpBranchConditional %108 %4 %5 - %4 = OpLabel - OpBranch %6 - %5 = OpLabel - OpBranch %6 - %6 = OpLabel - OpBranch %8 - %7 = OpLabel - OpBranch %8 - %8 = OpLabel - OpBranch %9 - %9 = OpLabel - OpBranchConditional %108 %10 %11 - %10 = OpLabel - OpBranch %11 - %11 = OpLabel - OpBranchConditional %108 %12 %9 - %12 = OpLabel - OpBranchConditional %108 %13 %2 - %13 = OpLabel - OpReturn - OpFunctionEnd -)"; - - // CFG: (edges pointing downward if no arrow) - // %1 - // | - // %2 <----+ - // T/ \F | - // %3 \ | - // T/ \F \ | - // %4 %5 %7 | - // \ / / | - // %6 / | - // \ / | - // %8 | - // | | - // %9 <-+ | - // T/ | | | - // %10 | | | - // \ | | | - // %11-F+ | - // T| | - // %12-F---+ - // T| - // %13 - - std::unique_ptr context = - BuildModule(SPV_ENV_UNIVERSAL_1_0, nullptr, text, - SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - Module* module = context->module(); - EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" - << text << std::endl; - const Function* fn = spvtest::GetFunction(module, 101); - const BasicBlock* entry = spvtest::GetBasicBlock(fn, 1); - EXPECT_EQ(entry, fn->entry().get()) - << "The entry node is not the expected one"; - - { - PostDominatorAnalysis pdom; - const CFG& cfg = *context->cfg(); - pdom.InitializeTree(cfg, fn); - ControlDependenceAnalysis cdg; - cdg.ComputeControlDependenceGraph(cfg, pdom); - - std::vector edges; - GatherEdges(cdg, edges); - EXPECT_THAT( - edges, testing::ElementsAre( - ControlDependence(0, 1), ControlDependence(0, 2, 1), - ControlDependence(0, 8, 1), ControlDependence(0, 9, 1), - ControlDependence(0, 11, 1), ControlDependence(0, 12, 1), - ControlDependence(0, 13, 1), ControlDependence(2, 3), - ControlDependence(2, 6, 3), ControlDependence(2, 7), - ControlDependence(3, 4), ControlDependence(3, 5), - ControlDependence(9, 10), ControlDependence(11, 9), - ControlDependence(11, 11, 9), ControlDependence(12, 2), - ControlDependence(12, 8, 2), ControlDependence(12, 9, 2), - ControlDependence(12, 11, 2), ControlDependence(12, 12, 2))); - - const uint32_t expected_condition_ids[] = { - 0, 0, 0, 0, 0, 0, 0, 108, 108, 108, - 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, - }; - - for (uint32_t i = 0; i < edges.size(); i++) { - EXPECT_EQ(expected_condition_ids[i], edges[i].GetConditionID(cfg)); - } - } -} - -} // namespace -} // namespace opt -} // namespace spvtools diff --git a/test/opt/convert_to_sampled_image_test.cpp b/test/opt/convert_to_sampled_image_test.cpp deleted file mode 100644 index 37f65601..00000000 --- a/test/opt/convert_to_sampled_image_test.cpp +++ /dev/null @@ -1,353 +0,0 @@ -// Copyright (c) 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include - -#include "gmock/gmock.h" -#include "source/opt/convert_to_sampled_image_pass.h" -#include "test/opt/pass_fixture.h" -#include "test/opt/pass_utils.h" - -namespace spvtools { -namespace opt { -namespace { - -using testing::Eq; -using VectorOfDescriptorSetAndBindingPairs = - std::vector; - -struct DescriptorSetAndBindingStringParsingTestCase { - const char* descriptor_set_binding_str; - bool expect_success; - VectorOfDescriptorSetAndBindingPairs expected_descriptor_set_binding_pairs; -}; - -using DescriptorSetAndBindingStringParsingTest = - ::testing::TestWithParam; - -TEST_P(DescriptorSetAndBindingStringParsingTest, TestCase) { - const auto& tc = GetParam(); - auto actual_descriptor_set_binding_pairs = - ConvertToSampledImagePass::ParseDescriptorSetBindingPairsString( - tc.descriptor_set_binding_str); - if (tc.expect_success) { - EXPECT_NE(nullptr, actual_descriptor_set_binding_pairs); - if (actual_descriptor_set_binding_pairs) { - EXPECT_THAT(*actual_descriptor_set_binding_pairs, - Eq(tc.expected_descriptor_set_binding_pairs)); - } - } else { - EXPECT_EQ(nullptr, actual_descriptor_set_binding_pairs); - } -} - -INSTANTIATE_TEST_SUITE_P( - ValidString, DescriptorSetAndBindingStringParsingTest, - ::testing::ValuesIn(std::vector< - DescriptorSetAndBindingStringParsingTestCase>{ - // 0. empty vector - {"", true, VectorOfDescriptorSetAndBindingPairs({})}, - // 1. one pair - {"100:1024", true, - VectorOfDescriptorSetAndBindingPairs({DescriptorSetAndBinding{100, - 1024}})}, - // 2. two pairs - {"100:1024 200:2048", true, - VectorOfDescriptorSetAndBindingPairs( - {DescriptorSetAndBinding{100, 1024}, - DescriptorSetAndBinding{200, 2048}})}, - // 3. spaces between entries - {"100:1024 \n \r \t \v \f 200:2048", true, - VectorOfDescriptorSetAndBindingPairs( - {DescriptorSetAndBinding{100, 1024}, - DescriptorSetAndBinding{200, 2048}})}, - // 4. \t, \n, \r and spaces before spec id - {" \n \r\t \t \v \f 100:1024", true, - VectorOfDescriptorSetAndBindingPairs({DescriptorSetAndBinding{100, - 1024}})}, - // 5. \t, \n, \r and spaces after value string - {"100:1024 \n \r\t \t \v \f ", true, - VectorOfDescriptorSetAndBindingPairs({DescriptorSetAndBinding{100, - 1024}})}, - // 6. maximum spec id - {"4294967295:0", true, - VectorOfDescriptorSetAndBindingPairs({DescriptorSetAndBinding{ - 4294967295, 0}})}, - // 7. minimum spec id - {"0:100", true, - VectorOfDescriptorSetAndBindingPairs({DescriptorSetAndBinding{0, - 100}})}, - // 8. multiple entries - {"101:1 102:2 103:3 104:4 200:201 9999:1000", true, - VectorOfDescriptorSetAndBindingPairs( - {DescriptorSetAndBinding{101, 1}, DescriptorSetAndBinding{102, 2}, - DescriptorSetAndBinding{103, 3}, DescriptorSetAndBinding{104, 4}, - DescriptorSetAndBinding{200, 201}, - DescriptorSetAndBinding{9999, 1000}})}, - })); - -INSTANTIATE_TEST_SUITE_P( - InvalidString, DescriptorSetAndBindingStringParsingTest, - ::testing::ValuesIn( - std::vector{ - // 0. missing default value - {"100:", false, VectorOfDescriptorSetAndBindingPairs{}}, - // 1. descriptor set is not an integer - {"100.0:200", false, VectorOfDescriptorSetAndBindingPairs{}}, - // 2. descriptor set is not a number - {"something_not_a_number:1", false, - VectorOfDescriptorSetAndBindingPairs{}}, - // 3. only descriptor set number - {"100", false, VectorOfDescriptorSetAndBindingPairs{}}, - // 4. empty descriptor set - {":3", false, VectorOfDescriptorSetAndBindingPairs{}}, - // 5. only colon - {":", false, VectorOfDescriptorSetAndBindingPairs{}}, - // 6. descriptor set overflow - {"4294967296:200", false, VectorOfDescriptorSetAndBindingPairs{}}, - // 7. descriptor set less than 0 - {"-1:200", false, VectorOfDescriptorSetAndBindingPairs{}}, - // 8. nullptr - {nullptr, false, VectorOfDescriptorSetAndBindingPairs{}}, - // 9. only a number is invalid - {"1234", false, VectorOfDescriptorSetAndBindingPairs{}}, - // 10. invalid entry separator - {"12:34;23:14", false, VectorOfDescriptorSetAndBindingPairs{}}, - // 11. invalid descriptor set and default value separator - {"12@34", false, VectorOfDescriptorSetAndBindingPairs{}}, - // 12. spaces before colon - {"100 :1024", false, VectorOfDescriptorSetAndBindingPairs{}}, - // 13. spaces after colon - {"100: 1024", false, VectorOfDescriptorSetAndBindingPairs{}}, - // 14. descriptor set represented in hex float format is invalid - {"0x3p10:200", false, VectorOfDescriptorSetAndBindingPairs{}}, - })); - -std::string BuildShader(const char* shader_decorate_instructions, - const char* shader_image_and_sampler_variables, - const char* shader_body) { - // Base HLSL code: - // - // SamplerState sam : register(s2); - // Texture2D texture : register(t5); - // - // float4 main() : SV_TARGET { - // return texture.SampleLevel(sam, float2(1, 2), 10, 2); - // } - std::stringstream ss; - ss << R"( - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %main "main" %out_var_SV_TARGET - OpExecutionMode %main OriginUpperLeft - OpSource HLSL 600 - OpName %type_sampler "type.sampler" - OpName %type_2d_image "type.2d.image" - OpName %out_var_SV_TARGET "out.var.SV_TARGET" - OpName %main "main" - OpName %type_sampled_image "type.sampled.image" - OpDecorate %out_var_SV_TARGET Location 0 - )"; - ss << shader_decorate_instructions; - ss << R"( - %float = OpTypeFloat 32 - %float_1 = OpConstant %float 1 - %float_2 = OpConstant %float 2 - %v2float = OpTypeVector %float 2 - %12 = OpConstantComposite %v2float %float_1 %float_2 - %float_10 = OpConstant %float 10 - %int = OpTypeInt 32 1 - %int_2 = OpConstant %int 2 - %v2int = OpTypeVector %int 2 - %17 = OpConstantComposite %v2int %int_2 %int_2 -%type_sampler = OpTypeSampler -%_ptr_UniformConstant_type_sampler = OpTypePointer UniformConstant %type_sampler -%type_2d_image = OpTypeImage %float 2D 2 0 0 1 Unknown -%_ptr_UniformConstant_type_2d_image = OpTypePointer UniformConstant %type_2d_image - %v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float - %void = OpTypeVoid - %23 = OpTypeFunction %void -%type_sampled_image = OpTypeSampledImage %type_2d_image - )"; - ss << shader_image_and_sampler_variables; - ss << R"( -%out_var_SV_TARGET = OpVariable %_ptr_Output_v4float Output - %main = OpFunction %void None %23 - %24 = OpLabel - )"; - ss << shader_body; - ss << R"( - OpReturn - OpFunctionEnd - )"; - return ss.str(); -} - -using ConvertToSampledImageTest = PassTest<::testing::Test>; - -TEST_F(ConvertToSampledImageTest, Texture2DAndSamplerToSampledImage) { - const std::string shader = BuildShader( - R"( - OpDecorate %sam DescriptorSet 0 - OpDecorate %sam Binding 5 - OpDecorate %texture DescriptorSet 0 - OpDecorate %texture Binding 5 - )", - R"( - ; CHECK-NOT: OpVariable %_ptr_UniformConstant_type_2d_image - - ; CHECK: [[tex:%\w+]] = OpVariable %_ptr_UniformConstant_type_sampled_image UniformConstant - %sam = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant - %texture = OpVariable %_ptr_UniformConstant_type_2d_image UniformConstant - )", - R"( - ; CHECK: [[load:%\w+]] = OpLoad %type_sampled_image [[tex]] - ; CHECK: OpImageSampleExplicitLod %v4float [[load]] - %25 = OpLoad %type_2d_image %texture - %26 = OpLoad %type_sampler %sam - %27 = OpSampledImage %type_sampled_image %25 %26 - %28 = OpImageSampleExplicitLod %v4float %27 %12 Lod|ConstOffset %float_10 %17 - OpStore %out_var_SV_TARGET %28 - )"); - - auto result = SinglePassRunAndMatch( - shader, /* do_validate = */ true, - VectorOfDescriptorSetAndBindingPairs{DescriptorSetAndBinding{0, 5}}); - - EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithChange); -} - -TEST_F(ConvertToSampledImageTest, Texture2DToSampledImage) { - const std::string shader = BuildShader( - R"( - OpDecorate %sam DescriptorSet 0 - OpDecorate %sam Binding 2 - OpDecorate %texture DescriptorSet 0 - OpDecorate %texture Binding 5 - )", - R"( - ; CHECK: [[tex:%\w+]] = OpVariable %_ptr_UniformConstant_type_sampled_image UniformConstant - %sam = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant - %texture = OpVariable %_ptr_UniformConstant_type_2d_image UniformConstant - )", - R"( - ; CHECK: [[load:%\w+]] = OpLoad %type_sampled_image [[tex]] - ; CHECK: [[image_extraction:%\w+]] = OpImage %type_2d_image [[load]] - ; CHECK: OpSampledImage %type_sampled_image [[image_extraction]] - %25 = OpLoad %type_2d_image %texture - %26 = OpLoad %type_sampler %sam - %27 = OpSampledImage %type_sampled_image %25 %26 - %28 = OpImageSampleExplicitLod %v4float %27 %12 Lod|ConstOffset %float_10 %17 - OpStore %out_var_SV_TARGET %28 - )"); - - auto result = SinglePassRunAndMatch( - shader, /* do_validate = */ true, - VectorOfDescriptorSetAndBindingPairs{DescriptorSetAndBinding{0, 5}}); - - EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithChange); -} - -TEST_F(ConvertToSampledImageTest, SamplerToSampledImage) { - const std::string shader = BuildShader( - R"( - OpDecorate %sam DescriptorSet 0 - OpDecorate %sam Binding 2 - OpDecorate %texture DescriptorSet 0 - OpDecorate %texture Binding 5 - )", - R"( - %sam = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant - %texture = OpVariable %_ptr_UniformConstant_type_2d_image UniformConstant - )", - R"( - %25 = OpLoad %type_2d_image %texture - %26 = OpLoad %type_sampler %sam - %27 = OpSampledImage %type_sampled_image %25 %26 - %28 = OpImageSampleExplicitLod %v4float %27 %12 Lod|ConstOffset %float_10 %17 - OpStore %out_var_SV_TARGET %28 - )"); - - auto result = SinglePassRunToBinary( - shader, /* skip_nop = */ false, - VectorOfDescriptorSetAndBindingPairs{DescriptorSetAndBinding{0, 2}}); - - EXPECT_EQ(std::get<1>(result), Pass::Status::Failure); -} - -TEST_F(ConvertToSampledImageTest, TwoImagesWithDuplicatedDescriptorSetBinding) { - const std::string shader = BuildShader( - R"( - OpDecorate %sam DescriptorSet 0 - OpDecorate %sam Binding 2 - OpDecorate %texture0 DescriptorSet 0 - OpDecorate %texture0 Binding 5 - OpDecorate %texture1 DescriptorSet 0 - OpDecorate %texture1 Binding 5 - )", - R"( - %sam = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant - %texture0 = OpVariable %_ptr_UniformConstant_type_2d_image UniformConstant - %texture1 = OpVariable %_ptr_UniformConstant_type_2d_image UniformConstant - )", - R"( - %25 = OpLoad %type_2d_image %texture0 - %26 = OpLoad %type_sampler %sam - %27 = OpSampledImage %type_sampled_image %25 %26 - %28 = OpImageSampleExplicitLod %v4float %27 %12 Lod|ConstOffset %float_10 %17 - OpStore %out_var_SV_TARGET %28 - )"); - - auto result = SinglePassRunToBinary( - shader, /* skip_nop = */ false, - VectorOfDescriptorSetAndBindingPairs{DescriptorSetAndBinding{0, 5}}); - - EXPECT_EQ(std::get<1>(result), Pass::Status::Failure); -} - -TEST_F(ConvertToSampledImageTest, - TwoSamplersWithDuplicatedDescriptorSetBinding) { - const std::string shader = BuildShader( - R"( - OpDecorate %sam0 DescriptorSet 0 - OpDecorate %sam0 Binding 2 - OpDecorate %sam1 DescriptorSet 0 - OpDecorate %sam1 Binding 2 - OpDecorate %texture DescriptorSet 0 - OpDecorate %texture Binding 5 - )", - R"( - %sam0 = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant - %sam1 = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant - %texture = OpVariable %_ptr_UniformConstant_type_2d_image UniformConstant - )", - R"( - %25 = OpLoad %type_2d_image %texture - %26 = OpLoad %type_sampler %sam0 - %27 = OpSampledImage %type_sampled_image %25 %26 - %28 = OpImageSampleExplicitLod %v4float %27 %12 Lod|ConstOffset %float_10 %17 - OpStore %out_var_SV_TARGET %28 - )"); - - auto result = SinglePassRunToBinary( - shader, /* skip_nop = */ false, - VectorOfDescriptorSetAndBindingPairs{DescriptorSetAndBinding{0, 2}}); - - EXPECT_EQ(std::get<1>(result), Pass::Status::Failure); -} - -} // namespace -} // namespace opt -} // namespace spvtools diff --git a/test/opt/dataflow.cpp b/test/opt/dataflow.cpp deleted file mode 100644 index 4742015a..00000000 --- a/test/opt/dataflow.cpp +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright (c) 2021 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/opt/dataflow.h" - -#include -#include - -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#include "opt/function_utils.h" -#include "source/opt/build_module.h" - -namespace spvtools { -namespace opt { -namespace { - -using DataFlowTest = ::testing::Test; - -// Simple analyses for testing: - -// Stores the result IDs of visited instructions in visit order. -struct VisitOrder : public ForwardDataFlowAnalysis { - std::vector visited_result_ids; - - VisitOrder(IRContext& context, LabelPosition label_position) - : ForwardDataFlowAnalysis(context, label_position) {} - - VisitResult Visit(Instruction* inst) override { - if (inst->HasResultId()) { - visited_result_ids.push_back(inst->result_id()); - } - return DataFlowAnalysis::VisitResult::kResultFixed; - } -}; - -// For each block, stores the set of blocks it can be preceded by. -// For example, with the following CFG: -// V-----------. -// -> 11 -> 12 -> 13 -> 15 -// \-> 14 ---^ -// -// The answer is: -// 11: 11, 12, 13 -// 12: 11, 12, 13 -// 13: 11, 12, 13 -// 14: 11, 12, 13 -// 15: 11, 12, 13, 14 -struct BackwardReachability : public ForwardDataFlowAnalysis { - std::map> reachable_from; - - BackwardReachability(IRContext& context) - : ForwardDataFlowAnalysis( - context, ForwardDataFlowAnalysis::LabelPosition::kLabelsOnly) {} - - VisitResult Visit(Instruction* inst) override { - // Conditional branches can be enqueued from labels, so skip them. - if (inst->opcode() != SpvOpLabel) - return DataFlowAnalysis::VisitResult::kResultFixed; - uint32_t id = inst->result_id(); - VisitResult ret = DataFlowAnalysis::VisitResult::kResultFixed; - std::set& precedents = reachable_from[id]; - for (uint32_t pred : context().cfg()->preds(id)) { - bool pred_inserted = precedents.insert(pred).second; - if (pred_inserted) { - ret = DataFlowAnalysis::VisitResult::kResultChanged; - } - for (uint32_t block : reachable_from[pred]) { - bool inserted = precedents.insert(block).second; - if (inserted) { - ret = DataFlowAnalysis::VisitResult::kResultChanged; - } - } - } - return ret; - } - - void InitializeWorklist(Function* function, - bool is_first_iteration) override { - // Since successor function is exact, only need one pass. - if (is_first_iteration) { - ForwardDataFlowAnalysis::InitializeWorklist(function, true); - } - } -}; - -TEST_F(DataFlowTest, ReversePostOrder) { - // Note: labels and IDs are intentionally out of order. - // - // CFG: (order of branches is from bottom to top) - // V-----------. - // -> 50 -> 40 -> 20 -> 60 -> 70 - // \-> 30 ---^ - - // DFS tree with RPO numbering: - // -> 50[0] -> 40[1] -> 20[2] 60[4] -> 70[5] - // \-> 30[3] ---^ - - const std::string text = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %2 "main" - OpExecutionMode %2 OriginUpperLeft - OpSource GLSL 430 - %3 = OpTypeVoid - %4 = OpTypeFunction %3 - %6 = OpTypeBool - %5 = OpConstantTrue %6 - %2 = OpFunction %3 None %4 - %50 = OpLabel - %51 = OpUndef %6 - %52 = OpUndef %6 - OpBranch %40 - %70 = OpLabel - %69 = OpUndef %6 - OpReturn - %60 = OpLabel - %61 = OpUndef %6 - OpBranchConditional %5 %70 %40 - %30 = OpLabel - %29 = OpUndef %6 - OpBranch %60 - %20 = OpLabel - %21 = OpUndef %6 - OpBranch %60 - %40 = OpLabel - %39 = OpUndef %6 - OpBranchConditional %5 %30 %20 - OpFunctionEnd - )"; - - std::unique_ptr context = - BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text, - SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - ASSERT_NE(context, nullptr); - - Function* function = spvtest::GetFunction(context->module(), 2); - - std::map> - expected_order; - expected_order[ForwardDataFlowAnalysis::LabelPosition::kLabelsOnly] = { - 50, 40, 20, 30, 60, 70, - }; - expected_order[ForwardDataFlowAnalysis::LabelPosition::kLabelsAtBeginning] = { - 50, 51, 52, 40, 39, 20, 21, 30, 29, 60, 61, 70, 69, - }; - expected_order[ForwardDataFlowAnalysis::LabelPosition::kLabelsAtEnd] = { - 51, 52, 50, 39, 40, 21, 20, 29, 30, 61, 60, 69, 70, - }; - expected_order[ForwardDataFlowAnalysis::LabelPosition::kNoLabels] = { - 51, 52, 39, 21, 29, 61, 69, - }; - - for (const auto& test_case : expected_order) { - VisitOrder analysis(*context, test_case.first); - analysis.Run(function); - EXPECT_EQ(test_case.second, analysis.visited_result_ids); - } -} - -TEST_F(DataFlowTest, BackwardReachability) { - // CFG: - // V-----------. - // -> 11 -> 12 -> 13 -> 15 - // \-> 14 ---^ - - const std::string text = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %2 "main" - OpExecutionMode %2 OriginUpperLeft - OpSource GLSL 430 - %3 = OpTypeVoid - %4 = OpTypeFunction %3 - %6 = OpTypeBool - %5 = OpConstantTrue %6 - %2 = OpFunction %3 None %4 - %11 = OpLabel - OpBranch %12 - %12 = OpLabel - OpBranchConditional %5 %14 %13 - %13 = OpLabel - OpBranchConditional %5 %15 %11 - %14 = OpLabel - OpBranch %15 - %15 = OpLabel - OpReturn - OpFunctionEnd - )"; - - std::unique_ptr context = - BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text, - SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - ASSERT_NE(context, nullptr); - - Function* function = spvtest::GetFunction(context->module(), 2); - - BackwardReachability analysis(*context); - analysis.Run(function); - - std::map> expected_result; - expected_result[11] = {11, 12, 13}; - expected_result[12] = {11, 12, 13}; - expected_result[13] = {11, 12, 13}; - expected_result[14] = {11, 12, 13}; - expected_result[15] = {11, 12, 13, 14}; - EXPECT_EQ(expected_result, analysis.reachable_from); -} - -} // namespace -} // namespace opt -} // namespace spvtools diff --git a/test/opt/eliminate_dead_functions_test.cpp b/test/opt/eliminate_dead_functions_test.cpp index 96deb2a6..96ecdc60 100644 --- a/test/opt/eliminate_dead_functions_test.cpp +++ b/test/opt/eliminate_dead_functions_test.cpp @@ -439,84 +439,6 @@ OpFunctionEnd SinglePassRunAndMatch(text, true); } -TEST_F(EliminateDeadFunctionsBasicTest, NonSemanticInfoRemoveDebugPrintf) { - const std::string text = R"( -; CHECK-NOT: %foo_ = OpFunction %void None % 3 -; CHECK-NOT: % 7 = OpLabel -; CHECK-NOT: %c = OpVariable %_ptr_Function_v4float Function -; CHECK-NOT: % 22 = OpAccessChain %_ptr_UniformConstant_13 %samplers %int_0 -; CHECK-NOT: % 23 = OpLoad % 13 % 22 -; CHECK-NOT: % 27 = OpImageSampleExplicitLod %v4float % 23 % 26 Lod %float_0 -; CHECK-NOT: OpStore %c % 27 -; CHECK-NOT: % 31 = OpAccessChain %_ptr_Function_float %c %uint_0 -; CHECK-NOT: % 32 = OpLoad %float %31 -; CHECK-NOT: % 34 = OpExtInst %void %33 1 % 28 % 32 -OpCapability RayTracingKHR -OpExtension "SPV_KHR_non_semantic_info" -OpExtension "SPV_KHR_ray_tracing" -%1 = OpExtInstImport "GLSL.std.450" -%33 = OpExtInstImport "NonSemantic.DebugPrintf" -OpMemoryModel Logical GLSL450 -OpEntryPoint ClosestHitNV %main "main" %samplers -%28 = OpString "%f" -OpSource GLSL 460 -OpSourceExtension "GL_EXT_debug_printf" -OpName %main "main" -OpName %foo_ "foo(" -OpName %c "c" -OpName %samplers "samplers" -OpDecorate %samplers DescriptorSet 0 -OpDecorate %samplers Binding 0 -%void = OpTypeVoid -%3 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%12 = OpTypeImage %float 3D 0 0 0 1 Unknown -%13 = OpTypeSampledImage %12 -%uint = OpTypeInt 32 0 -%uint_1 = OpConstant %uint 1 -%_arr_13_uint_1 = OpTypeArray %13 %uint_1 -%_ptr_UniformConstant__arr_13_uint_1 = OpTypePointer UniformConstant %_arr_13_uint_1 -%samplers = OpVariable %_ptr_UniformConstant__arr_13_uint_1 UniformConstant -%int = OpTypeInt 32 1 -%int_0 = OpConstant %int 0 -%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13 -%v3float = OpTypeVector %float 3 -%float_0 = OpConstant %float 0 -%26 = OpConstantComposite %v3float %float_0 %float_0 %float_0 -%uint_0 = OpConstant %uint 0 -%_ptr_Function_float = OpTypePointer Function %float -%main = OpFunction %void None %3 -%5 = OpLabel -%36 = OpVariable %_ptr_Function_v4float Function -%38 = OpAccessChain %_ptr_UniformConstant_13 %samplers %int_0 -%39 = OpLoad %13 %38 -%40 = OpImageSampleExplicitLod %v4float %39 %26 Lod %float_0 -OpStore %36 %40 -%41 = OpAccessChain %_ptr_Function_float %36 %uint_0 -%42 = OpLoad %float %41 -%43 = OpExtInst %void %33 1 %28 %42 -OpReturn -OpFunctionEnd -%foo_ = OpFunction %void None %3 -%7 = OpLabel -%c = OpVariable %_ptr_Function_v4float Function -%22 = OpAccessChain %_ptr_UniformConstant_13 %samplers %int_0 -%23 = OpLoad %13 %22 -%27 = OpImageSampleExplicitLod %v4float %23 %26 Lod %float_0 -OpStore %c %27 -%31 = OpAccessChain %_ptr_Function_float %c %uint_0 -%32 = OpLoad %float %31 -%34 = OpExtInst %void %33 1 %28 %32 -OpReturn -OpFunctionEnd -)"; - - SetTargetEnv(SPV_ENV_VULKAN_1_2); - SinglePassRunAndMatch(text, true); -} - } // namespace } // namespace opt } // namespace spvtools diff --git a/test/opt/eliminate_dead_input_components_test.cpp b/test/opt/eliminate_dead_input_components_test.cpp deleted file mode 100644 index b0098f73..00000000 --- a/test/opt/eliminate_dead_input_components_test.cpp +++ /dev/null @@ -1,404 +0,0 @@ -// Copyright (c) 2022 The Khronos Group Inc. -// Copyright (c) 2022 LunarG Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include - -#include "gmock/gmock.h" -#include "test/opt/pass_fixture.h" -#include "test/opt/pass_utils.h" - -namespace spvtools { -namespace opt { -namespace { - -using ElimDeadInputComponentsTest = PassTest<::testing::Test>; - -TEST_F(ElimDeadInputComponentsTest, ElimOneConstantIndex) { - // Should reduce to uv[2] - // - // #version 450 - // - // layout(location = 0) in vec4 uv[8]; - // - // out gl_PerVertex { - // vec4 gl_Position; - // }; - // - // void main() - // { - // gl_Position = uv[1]; - // } - const std::string text = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %main "main" %_ %uv - OpSource GLSL 450 - OpName %main "main" - OpName %gl_PerVertex "gl_PerVertex" - OpMemberName %gl_PerVertex 0 "gl_Position" - OpName %_ "" - OpName %uv "uv" - OpMemberDecorate %gl_PerVertex 0 BuiltIn Position - OpDecorate %gl_PerVertex Block - OpDecorate %uv Location 0 - %void = OpTypeVoid - %3 = OpTypeFunction %void - %float = OpTypeFloat 32 - %v4float = OpTypeVector %float 4 -%gl_PerVertex = OpTypeStruct %v4float -%_ptr_Output_gl_PerVertex = OpTypePointer Output %gl_PerVertex - %_ = OpVariable %_ptr_Output_gl_PerVertex Output - %int = OpTypeInt 32 1 - %int_0 = OpConstant %int 0 - %uint = OpTypeInt 32 0 - %uint_8 = OpConstant %uint 8 -%_arr_v4float_uint_8 = OpTypeArray %v4float %uint_8 -%_ptr_Input__arr_v4float_uint_8 = OpTypePointer Input %_arr_v4float_uint_8 - %uv = OpVariable %_ptr_Input__arr_v4float_uint_8 Input - %int_1 = OpConstant %int 1 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%_ptr_Output_v4float = OpTypePointer Output %v4float -;CHECK-NOT: %uv = OpVariable %_ptr_Input__arr_v4float_uint_8 Input -;CHECK: %uv = OpVariable %_ptr_Input__arr_v4float_uint_2 Input - %main = OpFunction %void None %3 - %5 = OpLabel - %20 = OpAccessChain %_ptr_Input_v4float %uv %int_1 - %21 = OpLoad %v4float %20 - %23 = OpAccessChain %_ptr_Output_v4float %_ %int_0 - OpStore %23 %21 - OpReturn - OpFunctionEnd -)"; - - SetTargetEnv(SPV_ENV_VULKAN_1_3); - SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - SinglePassRunAndMatch(text, true); -} - -TEST_F(ElimDeadInputComponentsTest, ElimOneConstantIndexInBounds) { - // Same as ElimOneConstantIndex but with OpInBoundsAccessChain - const std::string text = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %main "main" %_ %uv - OpSource GLSL 450 - OpName %main "main" - OpName %gl_PerVertex "gl_PerVertex" - OpMemberName %gl_PerVertex 0 "gl_Position" - OpName %_ "" - OpName %uv "uv" - OpMemberDecorate %gl_PerVertex 0 BuiltIn Position - OpDecorate %gl_PerVertex Block - OpDecorate %uv Location 0 - %void = OpTypeVoid - %3 = OpTypeFunction %void - %float = OpTypeFloat 32 - %v4float = OpTypeVector %float 4 -%gl_PerVertex = OpTypeStruct %v4float -%_ptr_Output_gl_PerVertex = OpTypePointer Output %gl_PerVertex - %_ = OpVariable %_ptr_Output_gl_PerVertex Output - %int = OpTypeInt 32 1 - %int_0 = OpConstant %int 0 - %uint = OpTypeInt 32 0 - %uint_8 = OpConstant %uint 8 -%_arr_v4float_uint_8 = OpTypeArray %v4float %uint_8 -%_ptr_Input__arr_v4float_uint_8 = OpTypePointer Input %_arr_v4float_uint_8 - %uv = OpVariable %_ptr_Input__arr_v4float_uint_8 Input - %int_1 = OpConstant %int 1 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%_ptr_Output_v4float = OpTypePointer Output %v4float -;CHECK-NOT: %uv = OpVariable %_ptr_Input__arr_v4float_uint_8 Input -;CHECK: %uv = OpVariable %_ptr_Input__arr_v4float_uint_2 Input - %main = OpFunction %void None %3 - %5 = OpLabel - %20 = OpInBoundsAccessChain %_ptr_Input_v4float %uv %int_1 - %21 = OpLoad %v4float %20 - %23 = OpAccessChain %_ptr_Output_v4float %_ %int_0 - OpStore %23 %21 - OpReturn - OpFunctionEnd -)"; - - SetTargetEnv(SPV_ENV_VULKAN_1_3); - SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - SinglePassRunAndMatch(text, true); -} - -TEST_F(ElimDeadInputComponentsTest, ElimTwoConstantIndices) { - // Should reduce to uv[4] - // - // #version 450 - // - // layout(location = 0) in vec4 uv[8]; - // - // out gl_PerVertex { - // vec4 gl_Position; - // }; - // - // void main() - // { - // gl_Position = uv[1] + uv[3]; - // } - const std::string text = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %main "main" %_ %uv - OpSource GLSL 450 - OpName %main "main" - OpName %gl_PerVertex "gl_PerVertex" - OpMemberName %gl_PerVertex 0 "gl_Position" - OpName %_ "" - OpName %uv "uv" - OpMemberDecorate %gl_PerVertex 0 BuiltIn Position - OpDecorate %gl_PerVertex Block - OpDecorate %uv Location 0 - %void = OpTypeVoid - %3 = OpTypeFunction %void - %float = OpTypeFloat 32 - %v4float = OpTypeVector %float 4 -%gl_PerVertex = OpTypeStruct %v4float -%_ptr_Output_gl_PerVertex = OpTypePointer Output %gl_PerVertex - %_ = OpVariable %_ptr_Output_gl_PerVertex Output - %int = OpTypeInt 32 1 - %int_0 = OpConstant %int 0 - %uint = OpTypeInt 32 0 - %uint_8 = OpConstant %uint 8 -%_arr_v4float_uint_8 = OpTypeArray %v4float %uint_8 -%_ptr_Input__arr_v4float_uint_8 = OpTypePointer Input %_arr_v4float_uint_8 - %uv = OpVariable %_ptr_Input__arr_v4float_uint_8 Input - %int_1 = OpConstant %int 1 -%_ptr_Input_v4float = OpTypePointer Input %v4float - %int_3 = OpConstant %int 3 -%_ptr_Output_v4float = OpTypePointer Output %v4float -;CHECK-NOT: %uv = OpVariable %_ptr_Input__arr_v4float_uint_8 Input -;CHECK: %uv = OpVariable %_ptr_Input__arr_v4float_uint_4 Input - %main = OpFunction %void None %3 - %5 = OpLabel - %20 = OpAccessChain %_ptr_Input_v4float %uv %int_1 - %21 = OpLoad %v4float %20 - %23 = OpAccessChain %_ptr_Input_v4float %uv %int_3 - %24 = OpLoad %v4float %23 - %25 = OpFAdd %v4float %21 %24 - %27 = OpAccessChain %_ptr_Output_v4float %_ %int_0 - OpStore %27 %25 - OpReturn - OpFunctionEnd -)"; - - SetTargetEnv(SPV_ENV_VULKAN_1_3); - SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - SinglePassRunAndMatch(text, true); -} - -TEST_F(ElimDeadInputComponentsTest, NoElimMaxConstantIndex) { - // Should not reduce uv[8] because of max index of 7 - // - // #version 450 - // - // layout(location = 0) in vec4 uv[8]; - // - // out gl_PerVertex { - // vec4 gl_Position; - // }; - // - // void main() - // { - // gl_Position = uv[1] + uv[7]; - // } - const std::string text = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %main "main" %_ %uv - OpSource GLSL 450 - OpName %main "main" - OpName %gl_PerVertex "gl_PerVertex" - OpMemberName %gl_PerVertex 0 "gl_Position" - OpName %_ "" - OpName %uv "uv" - OpMemberDecorate %gl_PerVertex 0 BuiltIn Position - OpDecorate %gl_PerVertex Block - OpDecorate %uv Location 0 - %void = OpTypeVoid - %3 = OpTypeFunction %void - %float = OpTypeFloat 32 - %v4float = OpTypeVector %float 4 -%gl_PerVertex = OpTypeStruct %v4float -%_ptr_Output_gl_PerVertex = OpTypePointer Output %gl_PerVertex - %_ = OpVariable %_ptr_Output_gl_PerVertex Output - %int = OpTypeInt 32 1 - %int_0 = OpConstant %int 0 - %uint = OpTypeInt 32 0 - %uint_8 = OpConstant %uint 8 -%_arr_v4float_uint_8 = OpTypeArray %v4float %uint_8 -%_ptr_Input__arr_v4float_uint_8 = OpTypePointer Input %_arr_v4float_uint_8 - %uv = OpVariable %_ptr_Input__arr_v4float_uint_8 Input - %int_1 = OpConstant %int 1 -%_ptr_Input_v4float = OpTypePointer Input %v4float - %int_7 = OpConstant %int 7 -%_ptr_Output_v4float = OpTypePointer Output %v4float -;CHECK: %uv = OpVariable %_ptr_Input__arr_v4float_uint_8 Input - %main = OpFunction %void None %3 - %5 = OpLabel - %20 = OpAccessChain %_ptr_Input_v4float %uv %int_1 - %21 = OpLoad %v4float %20 - %23 = OpAccessChain %_ptr_Input_v4float %uv %int_7 - %24 = OpLoad %v4float %23 - %25 = OpFAdd %v4float %21 %24 - %27 = OpAccessChain %_ptr_Output_v4float %_ %int_0 - OpStore %27 %25 - OpReturn - OpFunctionEnd -)"; - - SetTargetEnv(SPV_ENV_VULKAN_1_3); - SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - SinglePassRunAndMatch(text, true); -} - -TEST_F(ElimDeadInputComponentsTest, NoElimNonConstantIndex) { - // Should not reduce uv[8] because of non-constant index of ui - // - // #version 450 - // - // layout(location = 0) in vec4 uv[8]; - // - // out gl_PerVertex { - // vec4 gl_Position; - // }; - // - // uniform ubname { - // int ui; - // } ubinst; - // - // void main() - // { - // gl_Position = uv[1] + uv[ubinst.ui]; - // } - const std::string text = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %main "main" %_ %uv %ubinst - OpSource GLSL 450 - OpName %main "main" - OpName %gl_PerVertex "gl_PerVertex" - OpMemberName %gl_PerVertex 0 "gl_Position" - OpName %_ "" - OpName %uv "uv" - OpName %ubname "ubname" - OpMemberName %ubname 0 "ui" - OpName %ubinst "ubinst" - OpMemberDecorate %gl_PerVertex 0 BuiltIn Position - OpDecorate %gl_PerVertex Block - OpDecorate %uv Location 0 - OpMemberDecorate %ubname 0 Offset 0 - OpDecorate %ubname Block - OpDecorate %ubinst DescriptorSet 0 - OpDecorate %ubinst Binding 0 - %void = OpTypeVoid - %3 = OpTypeFunction %void - %float = OpTypeFloat 32 - %v4float = OpTypeVector %float 4 -%gl_PerVertex = OpTypeStruct %v4float -%_ptr_Output_gl_PerVertex = OpTypePointer Output %gl_PerVertex - %_ = OpVariable %_ptr_Output_gl_PerVertex Output - %int = OpTypeInt 32 1 - %int_0 = OpConstant %int 0 - %uint = OpTypeInt 32 0 - %uint_8 = OpConstant %uint 8 -%_arr_v4float_uint_8 = OpTypeArray %v4float %uint_8 -%_ptr_Input__arr_v4float_uint_8 = OpTypePointer Input %_arr_v4float_uint_8 - %uv = OpVariable %_ptr_Input__arr_v4float_uint_8 Input - %int_1 = OpConstant %int 1 -%_ptr_Input_v4float = OpTypePointer Input %v4float - %ubname = OpTypeStruct %int -%_ptr_Uniform_ubname = OpTypePointer Uniform %ubname - %ubinst = OpVariable %_ptr_Uniform_ubname Uniform -%_ptr_Uniform_int = OpTypePointer Uniform %int -%_ptr_Output_v4float = OpTypePointer Output %v4float -;CHECK: %uv = OpVariable %_ptr_Input__arr_v4float_uint_8 Input - %main = OpFunction %void None %3 - %5 = OpLabel - %20 = OpAccessChain %_ptr_Input_v4float %uv %int_1 - %21 = OpLoad %v4float %20 - %26 = OpAccessChain %_ptr_Uniform_int %ubinst %int_0 - %27 = OpLoad %int %26 - %28 = OpAccessChain %_ptr_Input_v4float %uv %27 - %29 = OpLoad %v4float %28 - %30 = OpFAdd %v4float %21 %29 - %32 = OpAccessChain %_ptr_Output_v4float %_ %int_0 - OpStore %32 %30 - OpReturn - OpFunctionEnd -)"; - - SetTargetEnv(SPV_ENV_VULKAN_1_3); - SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - SinglePassRunAndMatch(text, true); -} - -TEST_F(ElimDeadInputComponentsTest, NoElimNonIndexedAccessChain) { - // Should not change due to non-indexed access chain - const std::string text = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %main "main" %_ %uv - OpSource GLSL 450 - OpName %main "main" - OpName %gl_PerVertex "gl_PerVertex" - OpMemberName %gl_PerVertex 0 "gl_Position" - OpName %_ "" - OpName %uv "uv" - OpMemberDecorate %gl_PerVertex 0 BuiltIn Position - OpDecorate %gl_PerVertex Block - OpDecorate %uv Location 0 - %void = OpTypeVoid - %3 = OpTypeFunction %void - %float = OpTypeFloat 32 - %v4float = OpTypeVector %float 4 -%gl_PerVertex = OpTypeStruct %v4float -%_ptr_Output_gl_PerVertex = OpTypePointer Output %gl_PerVertex - %_ = OpVariable %_ptr_Output_gl_PerVertex Output - %int = OpTypeInt 32 1 - %int_0 = OpConstant %int 0 - %uint = OpTypeInt 32 0 - %uint_8 = OpConstant %uint 8 -%_arr_v4float_uint_8 = OpTypeArray %v4float %uint_8 -%_ptr_Input__arr_v4float_uint_8 = OpTypePointer Input %_arr_v4float_uint_8 - %uv = OpVariable %_ptr_Input__arr_v4float_uint_8 Input - %int_1 = OpConstant %int 1 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%_ptr_Output_v4float = OpTypePointer Output %v4float -;CHECK: %uv = OpVariable %_ptr_Input__arr_v4float_uint_8 Input - %main = OpFunction %void None %3 - %5 = OpLabel - %20 = OpAccessChain %_ptr_Input__arr_v4float_uint_8 %uv - OpReturn - OpFunctionEnd -)"; - - SetTargetEnv(SPV_ENV_VULKAN_1_3); - SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - SinglePassRunAndMatch(text, true); -} - -} // namespace -} // namespace opt -} // namespace spvtools diff --git a/test/opt/eliminate_dead_member_test.cpp b/test/opt/eliminate_dead_member_test.cpp index 78874330..7728782e 100644 --- a/test/opt/eliminate_dead_member_test.cpp +++ b/test/opt/eliminate_dead_member_test.cpp @@ -576,6 +576,7 @@ TEST_F(EliminateDeadMemberTest, RemoveMembersUpdateArrayLength) { %_Globals = OpVariable %_ptr_Uniform_type__Globals Uniform %main = OpFunction %void None %9 %10 = OpLabel + %11 = OpLoad %type__Globals %_Globals %12 = OpArrayLength %uint %_Globals 2 OpReturn OpFunctionEnd diff --git a/test/opt/fix_func_call_arguments_test.cpp b/test/opt/fix_func_call_arguments_test.cpp deleted file mode 100644 index ecd13a86..00000000 --- a/test/opt/fix_func_call_arguments_test.cpp +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) 2022 Advanced Micro Devices, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "gmock/gmock.h" -#include "test/opt/pass_fixture.h" -#include "test/opt/pass_utils.h" - -namespace spvtools { -namespace opt { -namespace { - -using FixFuncCallArgumentsTest = PassTest<::testing::Test>; -TEST_F(FixFuncCallArgumentsTest, Simple) { - const std::string text = R"( -; -; CHECK: [[v0:%\w+]] = OpVariable %_ptr_Function_float Function -; CHECK: [[v1:%\w+]] = OpVariable %_ptr_Function_float Function -; CHECK: [[v2:%\w+]] = OpVariable %_ptr_Function_T Function -; CHECK: [[ac0:%\w+]] = OpAccessChain %_ptr_Function_float %t %int_0 -; CHECK: [[ac1:%\w+]] = OpAccessChain %_ptr_Uniform_float %r1 %int_0 %uint_0 -; CHECK: [[ld0:%\w+]] = OpLoad %float [[ac0]] -; CHECK: OpStore [[v1]] [[ld0]] -; CHECK: [[ld1:%\w+]] = OpLoad %float [[ac1]] -; CHECK: OpStore [[v0]] [[ld1]] -; CHECK: [[func:%\w+]] = OpFunctionCall %void %fn [[v1]] [[v0]] -; CHECK: [[ld2:%\w+]] = OpLoad %float [[v0]] -; CHECK: OpStore [[ac1]] [[ld2]] -; CHECK: [[ld3:%\w+]] = OpLoad %float [[v1]] -; CHECK: OpStore [[ac0]] [[ld3]] -; -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -OpSource HLSL 630 -OpName %type_RWStructuredBuffer_float "type.RWStructuredBuffer.float" -OpName %r1 "r1" -OpName %type_ACSBuffer_counter "type.ACSBuffer.counter" -OpMemberName %type_ACSBuffer_counter 0 "counter" -OpName %counter_var_r1 "counter.var.r1" -OpName %main "main" -OpName %bb_entry "bb.entry" -OpName %T "T" -OpMemberName %T 0 "t0" -OpName %t "t" -OpName %fn "fn" -OpName %p0 "p0" -OpName %p2 "p2" -OpName %bb_entry_0 "bb.entry" -OpDecorate %main LinkageAttributes "main" Export -OpDecorate %r1 DescriptorSet 0 -OpDecorate %r1 Binding 0 -OpDecorate %counter_var_r1 DescriptorSet 0 -OpDecorate %counter_var_r1 Binding 1 -OpDecorate %_runtimearr_float ArrayStride 4 -OpMemberDecorate %type_RWStructuredBuffer_float 0 Offset 0 -OpDecorate %type_RWStructuredBuffer_float BufferBlock -OpMemberDecorate %type_ACSBuffer_counter 0 Offset 0 -OpDecorate %type_ACSBuffer_counter BufferBlock -%int = OpTypeInt 32 1 -%int_0 = OpConstant %int 0 -%uint = OpTypeInt 32 0 -%uint_0 = OpConstant %uint 0 -%int_1 = OpConstant %int 1 -%float = OpTypeFloat 32 -%_runtimearr_float = OpTypeRuntimeArray %float -%type_RWStructuredBuffer_float = OpTypeStruct %_runtimearr_float -%_ptr_Uniform_type_RWStructuredBuffer_float = OpTypePointer Uniform %type_RWStructuredBuffer_float -%type_ACSBuffer_counter = OpTypeStruct %int -%_ptr_Uniform_type_ACSBuffer_counter = OpTypePointer Uniform %type_ACSBuffer_counter -%15 = OpTypeFunction %int -%T = OpTypeStruct %float -%_ptr_Function_T = OpTypePointer Function %T -%_ptr_Function_float = OpTypePointer Function %float -%_ptr_Uniform_float = OpTypePointer Uniform %float -%void = OpTypeVoid -%27 = OpTypeFunction %void %_ptr_Function_float %_ptr_Function_float -%r1 = OpVariable %_ptr_Uniform_type_RWStructuredBuffer_float Uniform -%counter_var_r1 = OpVariable %_ptr_Uniform_type_ACSBuffer_counter Uniform -%main = OpFunction %int None %15 -%bb_entry = OpLabel -%t = OpVariable %_ptr_Function_T Function -%21 = OpAccessChain %_ptr_Function_float %t %int_0 -%23 = OpAccessChain %_ptr_Uniform_float %r1 %int_0 %uint_0 -%25 = OpFunctionCall %void %fn %21 %23 -OpReturnValue %int_1 -OpFunctionEnd -%fn = OpFunction %void DontInline %27 -%p0 = OpFunctionParameter %_ptr_Function_float -%p2 = OpFunctionParameter %_ptr_Function_float -%bb_entry_0 = OpLabel -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndMatch(text, true); -} - -TEST_F(FixFuncCallArgumentsTest, NotAccessChainInput) { - const std::string text = R"( -; -; CHECK: [[o:%\w+]] = OpCopyObject %_ptr_Function_float %t -; CHECK: [[func:%\w+]] = OpFunctionCall %void %fn [[o]] -; -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -OpSource HLSL 630 -OpName %main "main" -OpName %bb_entry "bb.entry" -OpName %t "t" -OpName %fn "fn" -OpName %p0 "p0" -OpName %bb_entry_0 "bb.entry" -OpDecorate %main LinkageAttributes "main" Export -%int = OpTypeInt 32 1 -%int_1 = OpConstant %int 1 -%4 = OpTypeFunction %int -%float = OpTypeFloat 32 -%_ptr_Function_float = OpTypePointer Function %float -%void = OpTypeVoid -%12 = OpTypeFunction %void %_ptr_Function_float -%main = OpFunction %int None %4 -%bb_entry = OpLabel -%t = OpVariable %_ptr_Function_float Function -%t1 = OpCopyObject %_ptr_Function_float %t -%10 = OpFunctionCall %void %fn %t1 -OpReturnValue %int_1 -OpFunctionEnd -%fn = OpFunction %void DontInline %12 -%p0 = OpFunctionParameter %_ptr_Function_float -%bb_entry_0 = OpLabel -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndMatch(text, false); -} - -} // namespace -} // namespace opt -} // namespace spvtools \ No newline at end of file diff --git a/test/opt/fold_test.cpp b/test/opt/fold_test.cpp index da5b017d..bb6098cc 100644 --- a/test/opt/fold_test.cpp +++ b/test/opt/fold_test.cpp @@ -141,7 +141,6 @@ OpName %main "main" %v4int = OpTypeVector %int 4 %v4float = OpTypeVector %float 4 %v4double = OpTypeVector %double 4 -%v2uint = OpTypeVector %uint 2 %v2float = OpTypeVector %float 2 %v2double = OpTypeVector %double 2 %v2half = OpTypeVector %half 2 @@ -192,7 +191,6 @@ OpName %main "main" %v2int_2_3 = OpConstantComposite %v2int %int_2 %int_3 %v2int_3_2 = OpConstantComposite %v2int %int_3 %int_2 %v2int_4_4 = OpConstantComposite %v2int %int_4 %int_4 -%v2int_min_max = OpConstantComposite %v2int %int_min %int_max %v2bool_null = OpConstantNull %v2bool %v2bool_true_false = OpConstantComposite %v2bool %true %false %v2bool_false_true = OpConstantComposite %v2bool %false %true @@ -260,15 +258,6 @@ OpName %main "main" %v4double_1_1_1_0p5 = OpConstantComposite %v4double %double_1 %double_1 %double_1 %double_0p5 %v4double_null = OpConstantNull %v4double %v4float_n1_2_1_3 = OpConstantComposite %v4float %float_n1 %float_2 %float_1 %float_3 -%uint_0x3f800000 = OpConstant %uint 0x3f800000 -%uint_0xbf800000 = OpConstant %uint 0xbf800000 -%v2uint_0x3f800000_0xbf800000 = OpConstantComposite %v2uint %uint_0x3f800000 %uint_0xbf800000 -%long_0xbf8000003f800000 = OpConstant %long 0xbf8000003f800000 -%int_0x3FF00000 = OpConstant %int 0x3FF00000 -%int_0x00000000 = OpConstant %int 0x00000000 -%int_0xC05FD666 = OpConstant %int 0xC05FD666 -%int_0x66666666 = OpConstant %int 0x66666666 -%v4int_0x3FF00000_0x00000000_0xC05FD666_0x66666666 = OpConstantComposite %v4int %int_0x00000000 %int_0x3FF00000 %int_0x66666666 %int_0xC05FD666 )"; return header; @@ -719,31 +708,7 @@ INSTANTIATE_TEST_SUITE_P(TestCase, IntegerInstructionFoldingTest, "%2 = OpExtInst %uint %1 UClamp %uint_2 %undef %uint_1\n" + "OpReturn\n" + "OpFunctionEnd", - 2, 1), - // Test case 46: Bit-cast int 0 to unsigned int - InstructionFoldingCase( - Header() + "%main = OpFunction %void None %void_func\n" + - "%main_lab = OpLabel\n" + - "%2 = OpBitcast %uint %int_0\n" + - "OpReturn\n" + - "OpFunctionEnd", - 2, 0), - // Test case 47: Bit-cast int -24 to unsigned int - InstructionFoldingCase( - Header() + "%main = OpFunction %void None %void_func\n" + - "%main_lab = OpLabel\n" + - "%2 = OpBitcast %uint %int_n24\n" + - "OpReturn\n" + - "OpFunctionEnd", - 2, static_cast(-24)), - // Test case 48: Bit-cast float 1.0f to unsigned int - InstructionFoldingCase( - Header() + "%main = OpFunction %void None %void_func\n" + - "%main_lab = OpLabel\n" + - "%2 = OpBitcast %uint %float_1\n" + - "OpReturn\n" + - "OpFunctionEnd", - 2, static_cast(0x3f800000)) + 2, 1) )); // clang-format on @@ -825,72 +790,10 @@ INSTANTIATE_TEST_SUITE_P(TestCase, IntVectorInstructionFoldingTest, "%2 = OpVectorShuffle %v2int %v2int_null %v2int_2_3 0 4294967295 \n" + "OpReturn\n" + "OpFunctionEnd", - 2, {0,0}), - // Test case 4: fold bit-cast int -24 to unsigned int - InstructionFoldingCase>( - Header() + "%main = OpFunction %void None %void_func\n" + - "%main_lab = OpLabel\n" + - "%n = OpVariable %_ptr_int Function\n" + - "%load = OpLoad %int %n\n" + - "%2 = OpBitcast %v2uint %v2int_min_max\n" + - "OpReturn\n" + - "OpFunctionEnd", - 2, {2147483648, 2147483647}) + 2, {0,0}) )); // clang-format on -using DoubleVectorInstructionFoldingTest = - ::testing::TestWithParam>>; - -TEST_P(DoubleVectorInstructionFoldingTest, Case) { - const auto& tc = GetParam(); - - // Build module. - std::unique_ptr context = - BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, tc.test_body, - SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - ASSERT_NE(nullptr, context); - - // Fold the instruction to test. - analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); - Instruction* inst = def_use_mgr->GetDef(tc.id_to_fold); - bool succeeded = context->get_instruction_folder().FoldInstruction(inst); - - // Make sure the instruction folded as expected. - EXPECT_TRUE(succeeded); - if (succeeded && inst != nullptr) { - EXPECT_EQ(inst->opcode(), SpvOpCopyObject); - inst = def_use_mgr->GetDef(inst->GetSingleWordInOperand(0)); - std::vector opcodes = {SpvOpConstantComposite}; - EXPECT_THAT(opcodes, Contains(inst->opcode())); - analysis::ConstantManager* const_mrg = context->get_constant_mgr(); - const analysis::Constant* result = const_mrg->GetConstantFromInst(inst); - EXPECT_NE(result, nullptr); - if (result != nullptr) { - const std::vector& componenets = - result->AsVectorConstant()->GetComponents(); - EXPECT_EQ(componenets.size(), tc.expected_result.size()); - for (size_t i = 0; i < componenets.size(); i++) { - EXPECT_EQ(tc.expected_result[i], componenets[i]->GetDouble()); - } - } - } -} - -// clang-format off -INSTANTIATE_TEST_SUITE_P(TestCase, DoubleVectorInstructionFoldingTest, -::testing::Values( - // Test case 0: bit-cast int {0x3FF00000,0x00000000,0xC05FD666,0x66666666} - // to double vector - InstructionFoldingCase>( - Header() + "%main = OpFunction %void None %void_func\n" + - "%main_lab = OpLabel\n" + - "%2 = OpBitcast %v2double %v4int_0x3FF00000_0x00000000_0xC05FD666_0x66666666\n" + - "OpReturn\n" + - "OpFunctionEnd", - 2, {1.0,-127.35}) -)); - using FloatVectorInstructionFoldingTest = ::testing::TestWithParam>>; @@ -940,24 +843,7 @@ INSTANTIATE_TEST_SUITE_P(TestCase, FloatVectorInstructionFoldingTest, "%2 = OpExtInst %v2float %1 FMix %v2float_2_3 %v2float_0_0 %v2float_0p2_0p5\n" + "OpReturn\n" + "OpFunctionEnd", - 2, {1.6f,1.5f}), - // Test case 1: bit-cast unsigned int vector {0x3f800000, 0xbf800000} to - // float vector - InstructionFoldingCase>( - Header() + "%main = OpFunction %void None %void_func\n" + - "%main_lab = OpLabel\n" + - "%2 = OpBitcast %v2float %v2uint_0x3f800000_0xbf800000\n" + - "OpReturn\n" + - "OpFunctionEnd", - 2, {1.0f,-1.0f}), - // Test case 2: bit-cast long int 0xbf8000003f800000 to float vector - InstructionFoldingCase>( - Header() + "%main = OpFunction %void None %void_func\n" + - "%main_lab = OpLabel\n" + - "%2 = OpBitcast %v2float %long_0xbf8000003f800000\n" + - "OpReturn\n" + - "OpFunctionEnd", - 2, {1.0f,-1.0f}) + 2, {1.6f,1.5f}) )); // clang-format on using BooleanInstructionFoldingTest = @@ -5818,33 +5704,7 @@ INSTANTIATE_TEST_SUITE_P(MergeDivTest, MatchingInstructionFoldingTest, "%5 = OpFDiv %float %4 %2\n" + "OpReturn\n" + "OpFunctionEnd\n", - 5, true), - // Test case 16: Do not merge udiv of snegate - // (-x) / 2u - InstructionFoldingCase( - Header() + - "%main = OpFunction %void None %void_func\n" + - "%main_lab = OpLabel\n" + - "%var = OpVariable %_ptr_uint Function\n" + - "%2 = OpLoad %uint %var\n" + - "%3 = OpSNegate %uint %2\n" + - "%4 = OpUDiv %uint %3 %uint_2\n" + - "OpReturn\n" + - "OpFunctionEnd\n", - 4, false), - // Test case 17: Do not merge udiv of snegate - // 2u / (-x) - InstructionFoldingCase( - Header() + - "%main = OpFunction %void None %void_func\n" + - "%main_lab = OpLabel\n" + - "%var = OpVariable %_ptr_uint Function\n" + - "%2 = OpLoad %uint %var\n" + - "%3 = OpSNegate %uint %2\n" + - "%4 = OpUDiv %uint %uint_2 %3\n" + - "OpReturn\n" + - "OpFunctionEnd\n", - 4, false) + 5, true) )); INSTANTIATE_TEST_SUITE_P(MergeAddTest, MatchingInstructionFoldingTest, diff --git a/test/opt/graphics_robust_access_test.cpp b/test/opt/graphics_robust_access_test.cpp index 3c23347d..4b2cd447 100644 --- a/test/opt/graphics_robust_access_test.cpp +++ b/test/opt/graphics_robust_access_test.cpp @@ -1548,105 +1548,6 @@ OpFunctionEnd true); } -TEST_F(GraphicsRobustAccessTest, ReplaceIndexReportsChanged) { - // A ClusterFuzz generated shader that triggered a - // "Binary size unexpectedly changed despite the optimizer saying there was no - // change" assertion. - // See https://github.com/KhronosGroup/SPIRV-Tools/issues/4166. - std::string shader = R"( -; SPIR-V -; Version: 1.0 -; Generator: Google Shaderc over Glslang; 245 -; Bound: 41 -; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %main "else" %gl_GlobalInvocationID - OpExecutionMode %main LocalSize 1 1 3338665985 - OpSource GLSL 450 - OpSourceExtension "GL_GOOGLE_cpp_style_line_directive" - OpSourceExtension "GL_GOOGLE_include_directive" - OpName %main "main" - OpName %index "index" - OpName %gl_GlobalInvocationID "gl_GlobalInvocationID" - OpName %S "S" - OpMemberName %_struct_24 0 "" - OpMemberName %_struct_24 1 "" - OpName %Dst "Dst" - OpMemberName %Dst 0 "s" - OpName %dst "dst" - OpName %Src "Src" - OpMemberName %Src 0 "s" - OpName %src "src" - OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId - OpMemberDecorate %_struct_24 0 Offset 64 - OpMemberDecorate %_struct_24 1 Offset 8 - OpDecorate %_arr__struct_24_uint_1 ArrayStride 16 - OpMemberDecorate %Dst 0 Offset 0 - OpDecorate %Dst BufferBlock - OpDecorate %dst DescriptorSet 0 - OpDecorate %dst Binding 1 - OpDecorate %_arr__struct_24_uint_1_0 ArrayStride 16 - OpMemberDecorate %Src 0 Offset 0 - OpDecorate %Src Block - OpDecorate %src DescriptorSet 0 - OpDecorate %src Binding 0 - %void = OpTypeVoid - %3 = OpTypeFunction %void - %uint = OpTypeInt 32 0 -%_ptr_Function_uint = OpTypePointer Function %uint - %v3uint = OpTypeVector %uint 3 -%_ptr_Input_v3uint = OpTypePointer Input %v3uint -%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input - %uint_4864 = OpConstant %uint 4864 -%_ptr_Input_uint = OpTypePointer Input %uint - %uint_1 = OpConstant %uint 1 - %bool = OpTypeBool - %v2uint = OpTypeVector %uint 2 - %_struct_24 = OpTypeStruct %_ptr_Input_uint %v2uint -%_arr__struct_24_uint_1 = OpTypeArray %_struct_24 %uint_1 - %Dst = OpTypeStruct %_arr__struct_24_uint_1 -%_ptr_Uniform_Dst = OpTypePointer Uniform %Dst - %dst = OpVariable %_ptr_Uniform_Dst Uniform - %int = OpTypeInt 32 1 - %int_0 = OpConstant %int 0 -%_arr__struct_24_uint_1_0 = OpTypeArray %_struct_24 %uint_1 - %Src = OpTypeStruct %_arr__struct_24_uint_1_0 -%_ptr_Uniform_Src = OpTypePointer Uniform %Src - %src = OpVariable %_ptr_Uniform_Src Uniform -%_ptr_Uniform__struct_24 = OpTypePointer Uniform %_struct_24 - %main = OpFunction %void None %3 - %5 = OpLabel - %index = OpVariable %_ptr_Function_uint Function - %14 = OpAccessChain %_ptr_Input_uint %gl_GlobalInvocationID %uint_4864 - %15 = OpLoad %uint %14 - OpStore %index %15 - %16 = OpLoad %uint %index - %S = OpUGreaterThanEqual %bool %16 %uint_1 - OpSelectionMerge %21 None - OpBranchConditional %S %20 %21 - %20 = OpLabel - OpReturn - %21 = OpLabel - %31 = OpLoad %uint %index - %36 = OpLoad %uint %index - %38 = OpAccessChain %_ptr_Uniform__struct_24 %src %int_0 %36 - %39 = OpLoad %_struct_24 %38 - %40 = OpAccessChain %_ptr_Uniform__struct_24 %dst %int_0 %31 - OpStore %40 %39 - OpReturn - OpFunctionEnd -)"; - - std::vector optimized_bin; - auto status = spvtools::opt::Pass::Status::Failure; - std::tie(optimized_bin, status) = - SinglePassRunToBinary(shader, false); - // Check whether the pass returns the correct modification indication. - EXPECT_EQ(status, spvtools::opt::Pass::Status::SuccessWithChange); -} - // TODO(dneto): Test access chain index wider than 64 bits? // TODO(dneto): Test struct access chain index wider than 64 bits? // TODO(dneto): OpImageTexelPointer diff --git a/test/opt/interface_var_sroa_test.cpp b/test/opt/interface_var_sroa_test.cpp deleted file mode 100644 index 77624587..00000000 --- a/test/opt/interface_var_sroa_test.cpp +++ /dev/null @@ -1,410 +0,0 @@ -// Copyright (c) 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include - -#include "gmock/gmock.h" -#include "test/opt/assembly_builder.h" -#include "test/opt/pass_fixture.h" -#include "test/opt/pass_utils.h" - -namespace spvtools { -namespace opt { -namespace { - -using InterfaceVariableScalarReplacementTest = PassTest<::testing::Test>; - -TEST_F(InterfaceVariableScalarReplacementTest, - ReplaceInterfaceVarsWithScalars) { - const std::string spirv = R"( - OpCapability Shader - OpCapability Tessellation - OpMemoryModel Logical GLSL450 - OpEntryPoint TessellationControl %func "shader" %x %y %z %w %u %v - -; CHECK: OpName [[x:%\w+]] "x" -; CHECK-NOT: OpName {{%\w+}} "x" -; CHECK: OpName [[y:%\w+]] "y" -; CHECK-NOT: OpName {{%\w+}} "y" -; CHECK: OpName [[z0:%\w+]] "z" -; CHECK: OpName [[z1:%\w+]] "z" -; CHECK: OpName [[w0:%\w+]] "w" -; CHECK: OpName [[w1:%\w+]] "w" -; CHECK: OpName [[u0:%\w+]] "u" -; CHECK: OpName [[u1:%\w+]] "u" -; CHECK: OpName [[v0:%\w+]] "v" -; CHECK: OpName [[v1:%\w+]] "v" -; CHECK: OpName [[v2:%\w+]] "v" -; CHECK: OpName [[v3:%\w+]] "v" -; CHECK: OpName [[v4:%\w+]] "v" -; CHECK: OpName [[v5:%\w+]] "v" - OpName %x "x" - OpName %y "y" - OpName %z "z" - OpName %w "w" - OpName %u "u" - OpName %v "v" - -; CHECK-DAG: OpDecorate [[x]] Location 2 -; CHECK-DAG: OpDecorate [[y]] Location 0 -; CHECK-DAG: OpDecorate [[z0]] Location 0 -; CHECK-DAG: OpDecorate [[z0]] Component 0 -; CHECK-DAG: OpDecorate [[z1]] Location 1 -; CHECK-DAG: OpDecorate [[z1]] Component 0 -; CHECK-DAG: OpDecorate [[z0]] Patch -; CHECK-DAG: OpDecorate [[z1]] Patch -; CHECK-DAG: OpDecorate [[w0]] Location 2 -; CHECK-DAG: OpDecorate [[w0]] Component 0 -; CHECK-DAG: OpDecorate [[w1]] Location 3 -; CHECK-DAG: OpDecorate [[w1]] Component 0 -; CHECK-DAG: OpDecorate [[w0]] Patch -; CHECK-DAG: OpDecorate [[w1]] Patch -; CHECK-DAG: OpDecorate [[u0]] Location 3 -; CHECK-DAG: OpDecorate [[u0]] Component 2 -; CHECK-DAG: OpDecorate [[u1]] Location 4 -; CHECK-DAG: OpDecorate [[u1]] Component 2 -; CHECK-DAG: OpDecorate [[v0]] Location 3 -; CHECK-DAG: OpDecorate [[v0]] Component 3 -; CHECK-DAG: OpDecorate [[v1]] Location 4 -; CHECK-DAG: OpDecorate [[v1]] Component 3 -; CHECK-DAG: OpDecorate [[v2]] Location 5 -; CHECK-DAG: OpDecorate [[v2]] Component 3 -; CHECK-DAG: OpDecorate [[v3]] Location 6 -; CHECK-DAG: OpDecorate [[v3]] Component 3 -; CHECK-DAG: OpDecorate [[v4]] Location 7 -; CHECK-DAG: OpDecorate [[v4]] Component 3 -; CHECK-DAG: OpDecorate [[v5]] Location 8 -; CHECK-DAG: OpDecorate [[v5]] Component 3 - OpDecorate %z Patch - OpDecorate %w Patch - OpDecorate %z Location 0 - OpDecorate %x Location 2 - OpDecorate %v Location 3 - OpDecorate %v Component 3 - OpDecorate %y Location 0 - OpDecorate %w Location 2 - OpDecorate %u Location 3 - OpDecorate %u Component 2 - - %uint = OpTypeInt 32 0 - %uint_1 = OpConstant %uint 1 - %uint_2 = OpConstant %uint 2 - %uint_3 = OpConstant %uint 3 - %uint_4 = OpConstant %uint 4 -%_arr_uint_uint_2 = OpTypeArray %uint %uint_2 -%_ptr_Output__arr_uint_uint_2 = OpTypePointer Output %_arr_uint_uint_2 -%_ptr_Input__arr_uint_uint_2 = OpTypePointer Input %_arr_uint_uint_2 -%_ptr_Input_uint = OpTypePointer Input %uint -%_ptr_Output_uint = OpTypePointer Output %uint -%_arr_arr_uint_uint_2_3 = OpTypeArray %_arr_uint_uint_2 %uint_3 -%_ptr_Input__arr_arr_uint_uint_2_3 = OpTypePointer Input %_arr_arr_uint_uint_2_3 -%_arr_arr_arr_uint_uint_2_3_4 = OpTypeArray %_arr_arr_uint_uint_2_3 %uint_4 -%_ptr_Output__arr_arr_arr_uint_uint_2_3_4 = OpTypePointer Output %_arr_arr_arr_uint_uint_2_3_4 -%_ptr_Output__arr_arr_uint_uint_2_3 = OpTypePointer Output %_arr_arr_uint_uint_2_3 - %z = OpVariable %_ptr_Output__arr_uint_uint_2 Output - %x = OpVariable %_ptr_Output__arr_uint_uint_2 Output - %y = OpVariable %_ptr_Input__arr_uint_uint_2 Input - %w = OpVariable %_ptr_Input__arr_uint_uint_2 Input - %u = OpVariable %_ptr_Input__arr_arr_uint_uint_2_3 Input - %v = OpVariable %_ptr_Output__arr_arr_arr_uint_uint_2_3_4 Output - -; CHECK-DAG: [[x]] = OpVariable %_ptr_Output__arr_uint_uint_2 Output -; CHECK-DAG: [[y]] = OpVariable %_ptr_Input__arr_uint_uint_2 Input -; CHECK-DAG: [[z0]] = OpVariable %_ptr_Output_uint Output -; CHECK-DAG: [[z1]] = OpVariable %_ptr_Output_uint Output -; CHECK-DAG: [[w0]] = OpVariable %_ptr_Input_uint Input -; CHECK-DAG: [[w1]] = OpVariable %_ptr_Input_uint Input -; CHECK-DAG: [[u0]] = OpVariable %_ptr_Input__arr_uint_uint_3 Input -; CHECK-DAG: [[u1]] = OpVariable %_ptr_Input__arr_uint_uint_3 Input -; CHECK-DAG: [[v0]] = OpVariable %_ptr_Output__arr_uint_uint_4 Output -; CHECK-DAG: [[v1]] = OpVariable %_ptr_Output__arr_uint_uint_4 Output -; CHECK-DAG: [[v2]] = OpVariable %_ptr_Output__arr_uint_uint_4 Output -; CHECK-DAG: [[v3]] = OpVariable %_ptr_Output__arr_uint_uint_4 Output -; CHECK-DAG: [[v4]] = OpVariable %_ptr_Output__arr_uint_uint_4 Output -; CHECK-DAG: [[v5]] = OpVariable %_ptr_Output__arr_uint_uint_4 Output - - %void = OpTypeVoid - %void_f = OpTypeFunction %void - %func = OpFunction %void None %void_f - %label = OpLabel - -; CHECK: [[w0_value:%\w+]] = OpLoad %uint [[w0]] -; CHECK: [[w1_value:%\w+]] = OpLoad %uint [[w1]] -; CHECK: [[w_value:%\w+]] = OpCompositeConstruct %_arr_uint_uint_2 [[w0_value]] [[w1_value]] -; CHECK: [[w0:%\w+]] = OpCompositeExtract %uint [[w_value]] 0 -; CHECK: OpStore [[z0]] [[w0]] -; CHECK: [[w1:%\w+]] = OpCompositeExtract %uint [[w_value]] 1 -; CHECK: OpStore [[z1]] [[w1]] - %w_value = OpLoad %_arr_uint_uint_2 %w - OpStore %z %w_value - -; CHECK: [[u00_ptr:%\w+]] = OpAccessChain %_ptr_Input_uint [[u0]] %uint_0 -; CHECK: [[u00:%\w+]] = OpLoad %uint [[u00_ptr]] -; CHECK: [[u10_ptr:%\w+]] = OpAccessChain %_ptr_Input_uint [[u1]] %uint_0 -; CHECK: [[u10:%\w+]] = OpLoad %uint [[u10_ptr]] -; CHECK: [[u01_ptr:%\w+]] = OpAccessChain %_ptr_Input_uint [[u0]] %uint_1 -; CHECK: [[u01:%\w+]] = OpLoad %uint [[u01_ptr]] -; CHECK: [[u11_ptr:%\w+]] = OpAccessChain %_ptr_Input_uint [[u1]] %uint_1 -; CHECK: [[u11:%\w+]] = OpLoad %uint [[u11_ptr]] -; CHECK: [[u02_ptr:%\w+]] = OpAccessChain %_ptr_Input_uint [[u0]] %uint_2 -; CHECK: [[u02:%\w+]] = OpLoad %uint [[u02_ptr]] -; CHECK: [[u12_ptr:%\w+]] = OpAccessChain %_ptr_Input_uint [[u1]] %uint_2 -; CHECK: [[u12:%\w+]] = OpLoad %uint [[u12_ptr]] - -; CHECK-DAG: [[u0_val:%\w+]] = OpCompositeConstruct %_arr_uint_uint_2 [[u00]] [[u10]] -; CHECK-DAG: [[u1_val:%\w+]] = OpCompositeConstruct %_arr_uint_uint_2 [[u01]] [[u11]] -; CHECK-DAG: [[u2_val:%\w+]] = OpCompositeConstruct %_arr_uint_uint_2 [[u02]] [[u12]] - -; CHECK: [[u_val:%\w+]] = OpCompositeConstruct %_arr__arr_uint_uint_2_uint_3 [[u0_val]] [[u1_val]] [[u2_val]] - -; CHECK: [[ptr:%\w+]] = OpAccessChain %_ptr_Output_uint [[v0]] %uint_1 -; CHECK: [[val:%\w+]] = OpCompositeExtract %uint [[u_val]] 0 0 -; CHECK: OpStore [[ptr]] [[val]] -; CHECK: [[ptr:%\w+]] = OpAccessChain %_ptr_Output_uint [[v1]] %uint_1 -; CHECK: [[val:%\w+]] = OpCompositeExtract %uint [[u_val]] 0 1 -; CHECK: OpStore [[ptr]] [[val]] -; CHECK: [[ptr:%\w+]] = OpAccessChain %_ptr_Output_uint [[v2]] %uint_1 -; CHECK: [[val:%\w+]] = OpCompositeExtract %uint [[u_val]] 1 0 -; CHECK: OpStore [[ptr]] [[val]] -; CHECK: [[ptr:%\w+]] = OpAccessChain %_ptr_Output_uint [[v3]] %uint_1 -; CHECK: [[val:%\w+]] = OpCompositeExtract %uint [[u_val]] 1 1 -; CHECK: OpStore [[ptr]] [[val]] -; CHECK: [[ptr:%\w+]] = OpAccessChain %_ptr_Output_uint [[v4]] %uint_1 -; CHECK: [[val:%\w+]] = OpCompositeExtract %uint [[u_val]] 2 0 -; CHECK: OpStore [[ptr]] [[val]] -; CHECK: [[ptr:%\w+]] = OpAccessChain %_ptr_Output_uint [[v5]] %uint_1 -; CHECK: [[val:%\w+]] = OpCompositeExtract %uint [[u_val]] 2 1 -; CHECK: OpStore [[ptr]] [[val]] - %v_ptr = OpAccessChain %_ptr_Output__arr_arr_uint_uint_2_3 %v %uint_1 - %u_val = OpLoad %_arr_arr_uint_uint_2_3 %u - OpStore %v_ptr %u_val - - OpReturn - OpFunctionEnd - )"; - - SinglePassRunAndMatch(spirv, true); -} - -TEST_F(InterfaceVariableScalarReplacementTest, - CheckPatchDecorationPreservation) { - // Make sure scalars for the variables with the extra arrayness have the extra - // arrayness after running the pass while others do not have it. - // Only "y" does not have the extra arrayness in the following SPIR-V. - const std::string spirv = R"( - OpCapability Shader - OpCapability Tessellation - OpMemoryModel Logical GLSL450 - OpEntryPoint TessellationEvaluation %func "shader" %x %y %z %w - OpDecorate %z Patch - OpDecorate %w Patch - OpDecorate %z Location 0 - OpDecorate %x Location 2 - OpDecorate %y Location 0 - OpDecorate %w Location 1 - OpName %x "x" - OpName %y "y" - OpName %z "z" - OpName %w "w" - - ; CHECK: OpName [[y:%\w+]] "y" - ; CHECK-NOT: OpName {{%\w+}} "y" - ; CHECK-DAG: OpName [[z0:%\w+]] "z" - ; CHECK-DAG: OpName [[z1:%\w+]] "z" - ; CHECK-DAG: OpName [[w0:%\w+]] "w" - ; CHECK-DAG: OpName [[w1:%\w+]] "w" - ; CHECK-DAG: OpName [[x0:%\w+]] "x" - ; CHECK-DAG: OpName [[x1:%\w+]] "x" - - %uint = OpTypeInt 32 0 - %uint_2 = OpConstant %uint 2 -%_arr_uint_uint_2 = OpTypeArray %uint %uint_2 -%_ptr_Output__arr_uint_uint_2 = OpTypePointer Output %_arr_uint_uint_2 -%_ptr_Input__arr_uint_uint_2 = OpTypePointer Input %_arr_uint_uint_2 - %z = OpVariable %_ptr_Output__arr_uint_uint_2 Output - %x = OpVariable %_ptr_Output__arr_uint_uint_2 Output - %y = OpVariable %_ptr_Input__arr_uint_uint_2 Input - %w = OpVariable %_ptr_Input__arr_uint_uint_2 Input - - ; CHECK-DAG: [[y]] = OpVariable %_ptr_Input__arr_uint_uint_2 Input - ; CHECK-DAG: [[z0]] = OpVariable %_ptr_Output_uint Output - ; CHECK-DAG: [[z1]] = OpVariable %_ptr_Output_uint Output - ; CHECK-DAG: [[w0]] = OpVariable %_ptr_Input_uint Input - ; CHECK-DAG: [[w1]] = OpVariable %_ptr_Input_uint Input - ; CHECK-DAG: [[x0]] = OpVariable %_ptr_Output_uint Output - ; CHECK-DAG: [[x1]] = OpVariable %_ptr_Output_uint Output - - %void = OpTypeVoid - %void_f = OpTypeFunction %void - %func = OpFunction %void None %void_f - %label = OpLabel - OpReturn - OpFunctionEnd - )"; - - SinglePassRunAndMatch(spirv, true); -} - -TEST_F(InterfaceVariableScalarReplacementTest, - CheckEntryPointInterfaceOperands) { - const std::string spirv = R"( - OpCapability Shader - OpCapability Tessellation - OpMemoryModel Logical GLSL450 - OpEntryPoint TessellationEvaluation %tess "tess" %x %y - OpEntryPoint Vertex %vert "vert" %w - OpDecorate %z Location 0 - OpDecorate %x Location 2 - OpDecorate %y Location 0 - OpDecorate %w Location 1 - OpName %x "x" - OpName %y "y" - OpName %z "z" - OpName %w "w" - - ; CHECK: OpName [[y:%\w+]] "y" - ; CHECK-NOT: OpName {{%\w+}} "y" - ; CHECK-DAG: OpName [[x0:%\w+]] "x" - ; CHECK-DAG: OpName [[x1:%\w+]] "x" - ; CHECK-DAG: OpName [[w0:%\w+]] "w" - ; CHECK-DAG: OpName [[w1:%\w+]] "w" - ; CHECK-DAG: OpName [[z:%\w+]] "z" - ; CHECK-NOT: OpName {{%\w+}} "z" - - %uint = OpTypeInt 32 0 - %uint_2 = OpConstant %uint 2 -%_arr_uint_uint_2 = OpTypeArray %uint %uint_2 -%_ptr_Output__arr_uint_uint_2 = OpTypePointer Output %_arr_uint_uint_2 -%_ptr_Input__arr_uint_uint_2 = OpTypePointer Input %_arr_uint_uint_2 - %z = OpVariable %_ptr_Output__arr_uint_uint_2 Output - %x = OpVariable %_ptr_Output__arr_uint_uint_2 Output - %y = OpVariable %_ptr_Input__arr_uint_uint_2 Input - %w = OpVariable %_ptr_Input__arr_uint_uint_2 Input - - ; CHECK-DAG: [[y]] = OpVariable %_ptr_Input__arr_uint_uint_2 Input - ; CHECK-DAG: [[z]] = OpVariable %_ptr_Output__arr_uint_uint_2 Output - ; CHECK-DAG: [[w0]] = OpVariable %_ptr_Input_uint Input - ; CHECK-DAG: [[w1]] = OpVariable %_ptr_Input_uint Input - ; CHECK-DAG: [[x0]] = OpVariable %_ptr_Output_uint Output - ; CHECK-DAG: [[x1]] = OpVariable %_ptr_Output_uint Output - - %void = OpTypeVoid - %void_f = OpTypeFunction %void - %tess = OpFunction %void None %void_f - %bb0 = OpLabel - OpReturn - OpFunctionEnd - %vert = OpFunction %void None %void_f - %bb1 = OpLabel - OpReturn - OpFunctionEnd - )"; - - SinglePassRunAndMatch(spirv, true); -} - -class InterfaceVarSROAErrorTest : public PassTest<::testing::Test> { - public: - InterfaceVarSROAErrorTest() - : consumer_([this](spv_message_level_t level, const char*, - const spv_position_t& position, const char* message) { - if (!error_message_.empty()) error_message_ += "\n"; - switch (level) { - case SPV_MSG_FATAL: - case SPV_MSG_INTERNAL_ERROR: - case SPV_MSG_ERROR: - error_message_ += "ERROR"; - break; - case SPV_MSG_WARNING: - error_message_ += "WARNING"; - break; - case SPV_MSG_INFO: - error_message_ += "INFO"; - break; - case SPV_MSG_DEBUG: - error_message_ += "DEBUG"; - break; - } - error_message_ += - ": " + std::to_string(position.index) + ": " + message; - }) {} - - Pass::Status RunPass(const std::string& text) { - std::unique_ptr context_ = - spvtools::BuildModule(SPV_ENV_UNIVERSAL_1_2, consumer_, text); - if (!context_.get()) return Pass::Status::Failure; - - PassManager manager; - manager.SetMessageConsumer(consumer_); - manager.AddPass(); - - return manager.Run(context_.get()); - } - - std::string GetErrorMessage() const { return error_message_; } - - void TearDown() override { error_message_.clear(); } - - private: - spvtools::MessageConsumer consumer_; - std::string error_message_; -}; - -TEST_F(InterfaceVarSROAErrorTest, CheckConflictOfExtraArraynessBetweenEntries) { - const std::string spirv = R"( - OpCapability Shader - OpCapability Tessellation - OpMemoryModel Logical GLSL450 - OpEntryPoint TessellationControl %tess "tess" %x %y %z - OpEntryPoint Vertex %vert "vert" %z %w - OpDecorate %z Location 0 - OpDecorate %x Location 2 - OpDecorate %y Location 0 - OpDecorate %w Location 1 - OpName %x "x" - OpName %y "y" - OpName %z "z" - OpName %w "w" - %uint = OpTypeInt 32 0 - %uint_2 = OpConstant %uint 2 -%_arr_uint_uint_2 = OpTypeArray %uint %uint_2 -%_ptr_Output__arr_uint_uint_2 = OpTypePointer Output %_arr_uint_uint_2 -%_ptr_Input__arr_uint_uint_2 = OpTypePointer Input %_arr_uint_uint_2 - %z = OpVariable %_ptr_Output__arr_uint_uint_2 Output - %x = OpVariable %_ptr_Output__arr_uint_uint_2 Output - %y = OpVariable %_ptr_Input__arr_uint_uint_2 Input - %w = OpVariable %_ptr_Input__arr_uint_uint_2 Input - %void = OpTypeVoid - %void_f = OpTypeFunction %void - %tess = OpFunction %void None %void_f - %bb0 = OpLabel - OpReturn - OpFunctionEnd - %vert = OpFunction %void None %void_f - %bb1 = OpLabel - OpReturn - OpFunctionEnd - )"; - - EXPECT_EQ(RunPass(spirv), Pass::Status::Failure); - const char expected_error[] = - "ERROR: 0: A variable is arrayed for an entry point but it is not " - "arrayed for another entry point\n" - " %z = OpVariable %_ptr_Output__arr_uint_uint_2 Output"; - EXPECT_STREQ(GetErrorMessage().c_str(), expected_error); -} - -} // namespace -} // namespace opt -} // namespace spvtools diff --git a/test/opt/loop_optimizations/unroll_simple.cpp b/test/opt/loop_optimizations/unroll_simple.cpp index 6a3cb6ee..016316ae 100644 --- a/test/opt/loop_optimizations/unroll_simple.cpp +++ b/test/opt/loop_optimizations/unroll_simple.cpp @@ -3401,215 +3401,6 @@ OpFunctionEnd SinglePassRunAndCheck(shader, output, false); } -TEST_F(PassClassTest, UnrollWithPhiReferencesPhi) { - const std::string text = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %main "main" %color - OpExecutionMode %main OriginUpperLeft - OpSource HLSL 600 - OpName %main "main" - OpName %color "color" - OpDecorate %color Location 0 - %uint = OpTypeInt 32 0 - %float = OpTypeFloat 32 - %float_0 = OpConstant %float 0 - %float_1 = OpConstant %float 1 - %uint_1 = OpConstant %uint 1 - %uint_3 = OpConstant %uint 3 - %void = OpTypeVoid - %11 = OpTypeFunction %void - %bool = OpTypeBool - %v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float - %color = OpVariable %_ptr_Output_v4float Output - %main = OpFunction %void None %11 - %15 = OpLabel - OpBranch %16 - %16 = OpLabel - %17 = OpPhi %float %float_0 %15 %18 %19 - %18 = OpPhi %float %float_1 %15 %20 %19 - %21 = OpPhi %uint %uint_1 %15 %22 %19 - %23 = OpULessThanEqual %bool %21 %uint_3 - OpLoopMerge %24 %19 Unroll - OpBranchConditional %23 %25 %24 - %25 = OpLabel - -; First loop iteration -; CHECK: [[next_phi1_0:%\w+]] = OpFSub %float %float_1 %float_0 - -; Second loop iteration -; CHECK: [[next_phi1_1:%\w+]] = OpFSub %float [[next_phi1_0]] %float_1 - -; Third loop iteration -; CHECK: OpFSub %float [[next_phi1_1]] [[next_phi1_0]] - - %20 = OpFSub %float %18 %17 - OpBranch %19 - %19 = OpLabel - %22 = OpIAdd %uint %21 %uint_1 - OpBranch %16 - %24 = OpLabel - OpReturn - OpFunctionEnd -)"; - - std::unique_ptr context = - BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, - SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - Module* module = context->module(); - EXPECT_NE(nullptr, module) << "Assembling failed for ushader:\n" - << text << std::endl; - - LoopUnroller loop_unroller; - SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER | - SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES); - SinglePassRunAndMatch(text, true); -} - -TEST_F(PassClassTest, UnrollWithDoublePhiReferencesPhi) { - const std::string text = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %main "main" %color - OpExecutionMode %main OriginUpperLeft - OpSource HLSL 600 - OpName %main "main" - OpName %color "color" - OpDecorate %color Location 0 - %uint = OpTypeInt 32 0 - %float = OpTypeFloat 32 - %float_0 = OpConstant %float 0 - %float_1 = OpConstant %float 1 - %uint_1 = OpConstant %uint 1 - %uint_3 = OpConstant %uint 3 - %void = OpTypeVoid - %11 = OpTypeFunction %void - %bool = OpTypeBool - %v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float - %color = OpVariable %_ptr_Output_v4float Output - %main = OpFunction %void None %11 - %15 = OpLabel - OpBranch %16 - %16 = OpLabel - %17 = OpPhi %float %float_1 %15 %18 %19 - %18 = OpPhi %float %float_0 %15 %20 %19 - %20 = OpPhi %float %float_1 %15 %21 %19 - %22 = OpPhi %uint %uint_1 %15 %23 %19 - %24 = OpULessThanEqual %bool %22 %uint_3 - OpLoopMerge %25 %19 Unroll - OpBranchConditional %24 %26 %25 - %26 = OpLabel - -; First loop iteration -; CHECK: [[next_phi1_0:%\w+]] = OpFSub %float %float_1 %float_0 -; CHECK: OpFMul %float %float_1 - -; Second loop iteration -; CHECK: [[next_phi1_1:%\w+]] = OpFSub %float [[next_phi1_0]] %float_1 -; CHECK: OpFMul %float %float_0 - -; Third loop iteration -; CHECK: OpFSub %float [[next_phi1_1]] [[next_phi1_0]] -; CHECK: OpFMul %float %float_1 - - %21 = OpFSub %float %20 %18 - %27 = OpFMul %float %17 %21 - OpBranch %19 - %19 = OpLabel - %23 = OpIAdd %uint %22 %uint_1 - OpBranch %16 - %25 = OpLabel - OpReturn - OpFunctionEnd -)"; - - std::unique_ptr context = - BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, - SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - Module* module = context->module(); - EXPECT_NE(nullptr, module) << "Assembling failed for ushader:\n" - << text << std::endl; - - LoopUnroller loop_unroller; - SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER | - SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES); - SinglePassRunAndMatch(text, true); -} - -TEST_F(PassClassTest, PartialUnrollWithPhiReferencesPhi) { - // With LocalMultiStoreElimPass - const std::string text = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %main "main" %color - OpExecutionMode %main OriginUpperLeft - OpSource HLSL 600 - OpName %main "main" - OpName %color "color" - OpDecorate %color Location 0 - %uint = OpTypeInt 32 0 - %float = OpTypeFloat 32 - %float_0 = OpConstant %float 0 - %float_1 = OpConstant %float 1 - %uint_1 = OpConstant %uint 1 - %uint_3 = OpConstant %uint 3 - %void = OpTypeVoid - %11 = OpTypeFunction %void - %bool = OpTypeBool - %v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float - %color = OpVariable %_ptr_Output_v4float Output - %main = OpFunction %void None %11 - %15 = OpLabel - OpBranch %16 - %16 = OpLabel - %17 = OpPhi %float %float_0 %15 %18 %19 - %18 = OpPhi %float %float_1 %15 %20 %19 - %21 = OpPhi %uint %uint_1 %15 %22 %19 - %23 = OpULessThanEqual %bool %21 %uint_3 - OpLoopMerge %24 %19 Unroll - OpBranchConditional %23 %25 %24 - %25 = OpLabel - -; CHECK: [[phi0_0:%\w+]] = OpPhi {{%\w+}} {{%\w+}} {{%\w+}} [[phi1_0:%\w+]] -; CHECK: [[phi1_0]] = OpPhi {{%\w+}} {{%\w+}} {{%\w+}} [[sub:%\w+]] - -; CHECK: [[sub]] = OpFSub {{%\w+}} [[phi1_0]] [[phi0_0]] - -; CHECK: [[phi0_1:%\w+]] = OpPhi {{%\w+}} [[phi0_0]] -; CHECK: [[phi1_1:%\w+]] = OpPhi {{%\w+}} [[phi1_0]] - -; CHECK: [[sub:%\w+]] = OpFSub {{%\w+}} [[phi1_1]] [[phi0_1]] - -; CHECK: OpFSub {{%\w+}} [[sub]] [[phi1_1]] - - %20 = OpFSub %float %18 %17 - OpBranch %19 - %19 = OpLabel - %22 = OpIAdd %uint %21 %uint_1 - OpBranch %16 - %24 = OpLabel - OpReturn - OpFunctionEnd - )"; - - std::unique_ptr context = - BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, - SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - Module* module = context->module(); - EXPECT_NE(nullptr, module) << "Assembling failed for ushader:\n" - << text << std::endl; - - LoopUnroller loop_unroller; - SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); - SinglePassRunAndMatch>(text, true); -} - } // namespace } // namespace opt } // namespace spvtools diff --git a/test/opt/remove_dontinline_test.cpp b/test/opt/remove_dontinline_test.cpp deleted file mode 100644 index c5425e8c..00000000 --- a/test/opt/remove_dontinline_test.cpp +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) 2017 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include - -#include "test/opt/pass_fixture.h" -#include "test/opt/pass_utils.h" - -namespace spvtools { -namespace opt { -namespace { - -using StrengthReductionBasicTest = PassTest<::testing::Test>; - -TEST_F(StrengthReductionBasicTest, ClearDontInline) { - const std::vector text = { - // clang-format off - "OpCapability Shader", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Vertex %main \"main\"", - "%void = OpTypeVoid", - "%4 = OpTypeFunction %void", -"; CHECK: OpFunction %void None", - "%main = OpFunction %void DontInline %4", - "%8 = OpLabel", - "OpReturn", - "OpFunctionEnd" - // clang-format on - }; - - SinglePassRunAndMatch(JoinAllInsts(text), true); -} - -TEST_F(StrengthReductionBasicTest, LeaveUnchanged1) { - const std::vector text = { - // clang-format off - "OpCapability Shader", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Vertex %main \"main\"", - "%void = OpTypeVoid", - "%4 = OpTypeFunction %void", - "%main = OpFunction %void None %4", - "%8 = OpLabel", - "OpReturn", - "OpFunctionEnd" - // clang-format on - }; - - EXPECT_EQ(Pass::Status::SuccessWithoutChange, - std::get<1>(SinglePassRunAndDisassemble( - JoinAllInsts(text), false, true))); -} - -TEST_F(StrengthReductionBasicTest, LeaveUnchanged2) { - const std::vector text = { - // clang-format off - "OpCapability Shader", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Vertex %main \"main\"", - "%void = OpTypeVoid", - "%4 = OpTypeFunction %void", - "%main = OpFunction %void Inline %4", - "%8 = OpLabel", - "OpReturn", - "OpFunctionEnd" - // clang-format on - }; - - EXPECT_EQ(Pass::Status::SuccessWithoutChange, - std::get<1>(SinglePassRunAndDisassemble( - JoinAllInsts(text), false, true))); -} - -TEST_F(StrengthReductionBasicTest, ClearMultipleDontInline) { - const std::vector text = { - // clang-format off - "OpCapability Shader", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Vertex %main1 \"main1\"", - "OpEntryPoint Vertex %main2 \"main2\"", - "OpEntryPoint Vertex %main3 \"main3\"", - "OpEntryPoint Vertex %main4 \"main4\"", - "%void = OpTypeVoid", - "%4 = OpTypeFunction %void", - "; CHECK: OpFunction %void None", - "%main1 = OpFunction %void DontInline %4", - "%8 = OpLabel", - "OpReturn", - "OpFunctionEnd", - "; CHECK: OpFunction %void Inline", - "%main2 = OpFunction %void Inline %4", - "%9 = OpLabel", - "OpReturn", - "OpFunctionEnd", - "; CHECK: OpFunction %void Pure", - "%main3 = OpFunction %void DontInline|Pure %4", - "%10 = OpLabel", - "OpReturn", - "OpFunctionEnd", - "; CHECK: OpFunction %void None", - "%main4 = OpFunction %void None %4", - "%11 = OpLabel", - "OpReturn", - "OpFunctionEnd" - // clang-format on - }; - - SinglePassRunAndMatch(JoinAllInsts(text), true); -} -} // namespace -} // namespace opt -} // namespace spvtools diff --git a/test/opt/remove_unused_interface_variables_test.cpp b/test/opt/remove_unused_interface_variables_test.cpp deleted file mode 100644 index ddf027f1..00000000 --- a/test/opt/remove_unused_interface_variables_test.cpp +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) 2021 ZHOU He -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "gmock/gmock.h" -#include "test/opt/assembly_builder.h" -#include "test/opt/pass_fixture.h" -#include "test/opt/pass_utils.h" - -namespace spvtools { -namespace opt { -namespace { - -using RemoveUnusedInterfaceVariablesTest = PassTest<::testing::Test>; - -static const std::string expected = R"(OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %_Z5func1v "_Z5func1v" %out_var_SV_TARGET -OpEntryPoint Fragment %_Z5func2v "_Z5func2v" %out_var_SV_TARGET_0 -OpExecutionMode %_Z5func1v OriginUpperLeft -OpExecutionMode %_Z5func2v OriginUpperLeft -OpSource HLSL 630 -OpName %type_cba "type.cba" -OpMemberName %type_cba 0 "color" -OpName %cba "cba" -OpName %out_var_SV_TARGET "out.var.SV_TARGET" -OpName %out_var_SV_TARGET_0 "out.var.SV_TARGET" -OpName %_Z5func1v "_Z5func1v" -OpName %_Z5func2v "_Z5func2v" -OpDecorate %out_var_SV_TARGET Location 0 -OpDecorate %out_var_SV_TARGET_0 Location 0 -OpDecorate %cba DescriptorSet 0 -OpDecorate %cba Binding 0 -OpMemberDecorate %type_cba 0 Offset 0 -OpDecorate %type_cba Block -%int = OpTypeInt 32 1 -%int_0 = OpConstant %int 0 -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%type_cba = OpTypeStruct %v4float -%_ptr_Uniform_type_cba = OpTypePointer Uniform %type_cba -%_ptr_Output_v4float = OpTypePointer Output %v4float -%void = OpTypeVoid -%14 = OpTypeFunction %void -%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float -%cba = OpVariable %_ptr_Uniform_type_cba Uniform -%out_var_SV_TARGET = OpVariable %_ptr_Output_v4float Output -%out_var_SV_TARGET_0 = OpVariable %_ptr_Output_v4float Output -%_Z5func1v = OpFunction %void None %14 -%16 = OpLabel -%17 = OpAccessChain %_ptr_Uniform_v4float %cba %int_0 -%18 = OpLoad %v4float %17 -OpStore %out_var_SV_TARGET %18 -OpReturn -OpFunctionEnd -%_Z5func2v = OpFunction %void None %14 -%19 = OpLabel -%20 = OpAccessChain %_ptr_Uniform_v4float %cba %int_0 -%21 = OpLoad %v4float %20 -OpStore %out_var_SV_TARGET_0 %21 -OpReturn -OpFunctionEnd -)"; - -TEST_F(RemoveUnusedInterfaceVariablesTest, RemoveUnusedVariable) { - const std::string text = R"(OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %_Z5func1v "_Z5func1v" %out_var_SV_TARGET %out_var_SV_TARGET_0 -OpEntryPoint Fragment %_Z5func2v "_Z5func2v" %out_var_SV_TARGET %out_var_SV_TARGET_0 -OpExecutionMode %_Z5func1v OriginUpperLeft -OpExecutionMode %_Z5func2v OriginUpperLeft -OpSource HLSL 630 -OpName %type_cba "type.cba" -OpMemberName %type_cba 0 "color" -OpName %cba "cba" -OpName %out_var_SV_TARGET "out.var.SV_TARGET" -OpName %out_var_SV_TARGET_0 "out.var.SV_TARGET" -OpName %_Z5func1v "_Z5func1v" -OpName %_Z5func2v "_Z5func2v" -OpDecorate %out_var_SV_TARGET Location 0 -OpDecorate %out_var_SV_TARGET_0 Location 0 -OpDecorate %cba DescriptorSet 0 -OpDecorate %cba Binding 0 -OpMemberDecorate %type_cba 0 Offset 0 -OpDecorate %type_cba Block -%int = OpTypeInt 32 1 -%int_0 = OpConstant %int 0 -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%type_cba = OpTypeStruct %v4float -%_ptr_Uniform_type_cba = OpTypePointer Uniform %type_cba -%_ptr_Output_v4float = OpTypePointer Output %v4float -%void = OpTypeVoid -%14 = OpTypeFunction %void -%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float -%cba = OpVariable %_ptr_Uniform_type_cba Uniform -%out_var_SV_TARGET = OpVariable %_ptr_Output_v4float Output -%out_var_SV_TARGET_0 = OpVariable %_ptr_Output_v4float Output -%_Z5func1v = OpFunction %void None %14 -%16 = OpLabel -%17 = OpAccessChain %_ptr_Uniform_v4float %cba %int_0 -%18 = OpLoad %v4float %17 -OpStore %out_var_SV_TARGET %18 -OpReturn -OpFunctionEnd -%_Z5func2v = OpFunction %void None %14 -%19 = OpLabel -%20 = OpAccessChain %_ptr_Uniform_v4float %cba %int_0 -%21 = OpLoad %v4float %20 -OpStore %out_var_SV_TARGET_0 %21 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck(text, expected, - true, true); -} - -TEST_F(RemoveUnusedInterfaceVariablesTest, FixMissingVariable) { - const std::string text = R"(OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %_Z5func1v "_Z5func1v" -OpEntryPoint Fragment %_Z5func2v "_Z5func2v" -OpExecutionMode %_Z5func1v OriginUpperLeft -OpExecutionMode %_Z5func2v OriginUpperLeft -OpSource HLSL 630 -OpName %type_cba "type.cba" -OpMemberName %type_cba 0 "color" -OpName %cba "cba" -OpName %out_var_SV_TARGET "out.var.SV_TARGET" -OpName %out_var_SV_TARGET_0 "out.var.SV_TARGET" -OpName %_Z5func1v "_Z5func1v" -OpName %_Z5func2v "_Z5func2v" -OpDecorate %out_var_SV_TARGET Location 0 -OpDecorate %out_var_SV_TARGET_0 Location 0 -OpDecorate %cba DescriptorSet 0 -OpDecorate %cba Binding 0 -OpMemberDecorate %type_cba 0 Offset 0 -OpDecorate %type_cba Block -%int = OpTypeInt 32 1 -%int_0 = OpConstant %int 0 -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%type_cba = OpTypeStruct %v4float -%_ptr_Uniform_type_cba = OpTypePointer Uniform %type_cba -%_ptr_Output_v4float = OpTypePointer Output %v4float -%void = OpTypeVoid -%14 = OpTypeFunction %void -%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float -%cba = OpVariable %_ptr_Uniform_type_cba Uniform -%out_var_SV_TARGET = OpVariable %_ptr_Output_v4float Output -%out_var_SV_TARGET_0 = OpVariable %_ptr_Output_v4float Output -%_Z5func1v = OpFunction %void None %14 -%16 = OpLabel -%17 = OpAccessChain %_ptr_Uniform_v4float %cba %int_0 -%18 = OpLoad %v4float %17 -OpStore %out_var_SV_TARGET %18 -OpReturn -OpFunctionEnd -%_Z5func2v = OpFunction %void None %14 -%19 = OpLabel -%20 = OpAccessChain %_ptr_Uniform_v4float %cba %int_0 -%21 = OpLoad %v4float %20 -OpStore %out_var_SV_TARGET_0 %21 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck(text, expected, - true, true); -} - -} // namespace -} // namespace opt -} // namespace spvtools diff --git a/test/opt/replace_desc_array_access_using_var_index_test.cpp b/test/opt/replace_desc_array_access_using_var_index_test.cpp deleted file mode 100644 index 9ab9eb11..00000000 --- a/test/opt/replace_desc_array_access_using_var_index_test.cpp +++ /dev/null @@ -1,576 +0,0 @@ -// Copyright (c) 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include - -#include "gmock/gmock.h" -#include "test/opt/assembly_builder.h" -#include "test/opt/pass_fixture.h" -#include "test/opt/pass_utils.h" - -namespace spvtools { -namespace opt { -namespace { - -using ReplaceDescArrayAccessUsingVarIndexTest = PassTest<::testing::Test>; - -TEST_F(ReplaceDescArrayAccessUsingVarIndexTest, - ReplaceAccessChainToTextureArray) { - const std::string text = R"( - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %psmain "psmain" %gl_FragCoord %in_var_INSTANCEID %out_var_SV_TARGET - OpExecutionMode %psmain OriginUpperLeft - OpSource HLSL 600 - OpName %type_sampler "type.sampler" - OpName %Sampler0 "Sampler0" - OpName %type_2d_image "type.2d.image" - OpName %Tex0 "Tex0" - OpName %in_var_INSTANCEID "in.var.INSTANCEID" - OpName %out_var_SV_TARGET "out.var.SV_TARGET" - OpName %psmain "psmain" - OpName %type_sampled_image "type.sampled.image" - OpDecorate %gl_FragCoord BuiltIn FragCoord - OpDecorate %in_var_INSTANCEID Flat - OpDecorate %in_var_INSTANCEID Location 0 - OpDecorate %out_var_SV_TARGET Location 0 - OpDecorate %Sampler0 DescriptorSet 0 - OpDecorate %Sampler0 Binding 1 - OpDecorate %Tex0 DescriptorSet 0 - OpDecorate %Tex0 Binding 2 - %bool = OpTypeBool -%type_sampler = OpTypeSampler -%_ptr_UniformConstant_type_sampler = OpTypePointer UniformConstant %type_sampler - %uint = OpTypeInt 32 0 - %uint_3 = OpConstant %uint 3 - %float = OpTypeFloat 32 -%type_2d_image = OpTypeImage %float 2D 2 0 0 0 Unknown -%_arr_type_2d_image_uint_3 = OpTypeArray %type_2d_image %uint_3 -%_ptr_UniformConstant__arr_type_2d_image_uint_3 = OpTypePointer UniformConstant %_arr_type_2d_image_uint_3 - %v4float = OpTypeVector %float 4 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%_ptr_Input_uint = OpTypePointer Input %uint -%_ptr_Output_v4float = OpTypePointer Output %v4float - %void = OpTypeVoid - %21 = OpTypeFunction %void -%_ptr_UniformConstant_type_2d_image = OpTypePointer UniformConstant %type_2d_image - %v2float = OpTypeVector %float 2 - %v2uint = OpTypeVector %uint 2 - %uint_0 = OpConstant %uint 0 - %uint_1 = OpConstant %uint 1 - %27 = OpConstantComposite %v2uint %uint_0 %uint_1 -%type_sampled_image = OpTypeSampledImage %type_2d_image - %Sampler0 = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant - %Tex0 = OpVariable %_ptr_UniformConstant__arr_type_2d_image_uint_3 UniformConstant -%gl_FragCoord = OpVariable %_ptr_Input_v4float Input -%in_var_INSTANCEID = OpVariable %_ptr_Input_uint Input -%out_var_SV_TARGET = OpVariable %_ptr_Output_v4float Output - %uint_2 = OpConstant %uint 2 - %66 = OpConstantNull %v4float - -; CHECK: [[null_value:%\w+]] = OpConstantNull %v4float - - %psmain = OpFunction %void None %21 - %39 = OpLabel - %29 = OpLoad %v4float %gl_FragCoord - %30 = OpLoad %uint %in_var_INSTANCEID - %37 = OpIEqual %bool %30 %uint_2 - OpSelectionMerge %38 None - OpBranchConditional %37 %28 %40 - -; CHECK: [[var_index:%\w+]] = OpLoad %uint %in_var_INSTANCEID -; CHECK: OpSelectionMerge [[cond_branch_merge:%\w+]] None -; CHECK: OpBranchConditional {{%\w+}} {{%\w+}} [[bb_cond_br:%\w+]] - - %28 = OpLabel - %31 = OpAccessChain %_ptr_UniformConstant_type_2d_image %Tex0 %30 - %32 = OpLoad %type_2d_image %31 - OpImageWrite %32 %27 %29 - -; CHECK: OpSelectionMerge [[merge:%\w+]] None -; CHECK: OpSwitch [[var_index]] [[default:%\w+]] 0 [[case0:%\w+]] 1 [[case1:%\w+]] 2 [[case2:%\w+]] -; CHECK: [[case0]] = OpLabel -; CHECK: OpAccessChain -; CHECK: OpLoad -; CHECK: OpImageWrite -; CHECK: OpBranch [[merge]] -; CHECK: [[case1]] = OpLabel -; CHECK: OpAccessChain -; CHECK: OpLoad -; CHECK: OpImageWrite -; CHECK: OpBranch [[merge]] -; CHECK: [[case2]] = OpLabel -; CHECK: OpAccessChain -; CHECK: OpLoad -; CHECK: OpImageWrite -; CHECK: OpBranch [[merge]] -; CHECK: [[default]] = OpLabel -; CHECK: OpBranch [[merge]] -; CHECK: [[merge]] = OpLabel - - %33 = OpLoad %type_sampler %Sampler0 - %34 = OpVectorShuffle %v2float %29 %29 0 1 - %35 = OpSampledImage %type_sampled_image %32 %33 - %36 = OpImageSampleImplicitLod %v4float %35 %34 None - -; CHECK: OpSelectionMerge [[merge:%\w+]] None -; CHECK: OpSwitch [[var_index]] [[default:%\w+]] 0 [[case0:%\w+]] 1 [[case1:%\w+]] 2 [[case2:%\w+]] -; CHECK: [[case0]] = OpLabel -; CHECK: [[ac:%\w+]] = OpAccessChain %_ptr_UniformConstant_type_2d_image %Tex0 %uint_0 -; CHECK: [[sam:%\w+]] = OpLoad %type_sampler %Sampler0 -; CHECK: [[img:%\w+]] = OpLoad %type_2d_image [[ac]] -; CHECK: [[sampledImg:%\w+]] = OpSampledImage %type_sampled_image [[img]] [[sam]] -; CHECK: [[value0:%\w+]] = OpImageSampleImplicitLod %v4float [[sampledImg]] -; CHECK: OpBranch [[merge]] -; CHECK: [[case1]] = OpLabel -; CHECK: [[ac:%\w+]] = OpAccessChain %_ptr_UniformConstant_type_2d_image %Tex0 %uint_1 -; CHECK: [[sam:%\w+]] = OpLoad %type_sampler %Sampler0 -; CHECK: [[img:%\w+]] = OpLoad %type_2d_image [[ac]] -; CHECK: [[sampledImg:%\w+]] = OpSampledImage %type_sampled_image [[img]] [[sam]] -; CHECK: [[value1:%\w+]] = OpImageSampleImplicitLod %v4float [[sampledImg]] -; CHECK: OpBranch [[merge]] -; CHECK: [[case2]] = OpLabel -; CHECK: [[ac:%\w+]] = OpAccessChain %_ptr_UniformConstant_type_2d_image %Tex0 %uint_2 -; CHECK: [[sam:%\w+]] = OpLoad %type_sampler %Sampler0 -; CHECK: [[img:%\w+]] = OpLoad %type_2d_image [[ac]] -; CHECK: [[sampledImg:%\w+]] = OpSampledImage %type_sampled_image [[img]] [[sam]] -; CHECK: [[value2:%\w+]] = OpImageSampleImplicitLod %v4float [[sampledImg]] -; CHECK: OpBranch [[merge]] -; CHECK: [[default]] = OpLabel -; CHECK: OpBranch [[merge]] -; CHECK: [[merge]] = OpLabel -; CHECK: [[phi0:%\w+]] = OpPhi %v4float [[value0]] [[case0]] [[value1]] [[case1]] [[value2]] [[case2]] [[null_value]] [[default]] - - OpBranch %38 - %40 = OpLabel - OpBranch %38 - %38 = OpLabel - %41 = OpPhi %v4float %36 %28 %29 %40 - -; CHECK: OpBranch [[cond_branch_merge]] -; CHECK: [[bb_cond_br]] = OpLabel -; CHECK: OpBranch [[cond_branch_merge]] -; CHECK: [[cond_branch_merge]] = OpLabel -; CHECK: [[phi1:%\w+]] = OpPhi %v4float [[phi0]] [[merge]] {{%\w+}} [[bb_cond_br]] -; CHECK: OpStore {{%\w+}} [[phi1]] - - OpStore %out_var_SV_TARGET %41 - OpReturn - OpFunctionEnd - )"; - - SinglePassRunAndMatch(text, true); -} - -TEST_F(ReplaceDescArrayAccessUsingVarIndexTest, - ReplaceAccessChainToTextureArrayAndSamplerArray) { - const std::string text = R"( - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %psmain "psmain" %gl_FragCoord %in_var_INSTANCEID %out_var_SV_TARGET - OpExecutionMode %psmain OriginUpperLeft - OpSource HLSL 600 - OpName %type_sampler "type.sampler" - OpName %Sampler0 "Sampler0" - OpName %type_2d_image "type.2d.image" - OpName %Tex0 "Tex0" - OpName %in_var_INSTANCEID "in.var.INSTANCEID" - OpName %out_var_SV_TARGET "out.var.SV_TARGET" - OpName %psmain "psmain" - OpName %type_sampled_image "type.sampled.image" - OpDecorate %gl_FragCoord BuiltIn FragCoord - OpDecorate %in_var_INSTANCEID Flat - OpDecorate %in_var_INSTANCEID Location 0 - OpDecorate %out_var_SV_TARGET Location 0 - OpDecorate %Sampler0 DescriptorSet 0 - OpDecorate %Sampler0 Binding 1 - OpDecorate %Tex0 DescriptorSet 0 - OpDecorate %Tex0 Binding 2 -%type_sampler = OpTypeSampler - %uint = OpTypeInt 32 0 - %uint_2 = OpConstant %uint 2 -%_ptr_UniformConstant_type_sampler = OpTypePointer UniformConstant %type_sampler -%_arr_type_sampler_uint_2 = OpTypeArray %type_sampler %uint_2 -%_ptr_UniformConstant__arr_type_sampler_uint_2 = OpTypePointer UniformConstant %_arr_type_sampler_uint_2 - %float = OpTypeFloat 32 -%type_2d_image = OpTypeImage %float 2D 2 0 0 0 Unknown -%_arr_type_2d_image_uint_2 = OpTypeArray %type_2d_image %uint_2 -%_ptr_UniformConstant__arr_type_2d_image_uint_2 = OpTypePointer UniformConstant %_arr_type_2d_image_uint_2 - %v4float = OpTypeVector %float 4 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%_ptr_Input_uint = OpTypePointer Input %uint -%_ptr_Output_v4float = OpTypePointer Output %v4float - %void = OpTypeVoid - %21 = OpTypeFunction %void -%_ptr_UniformConstant_type_2d_image = OpTypePointer UniformConstant %type_2d_image - %v2float = OpTypeVector %float 2 - %v2uint = OpTypeVector %uint 2 - %uint_0 = OpConstant %uint 0 - %uint_1 = OpConstant %uint 1 - %27 = OpConstantComposite %v2uint %uint_0 %uint_1 -%type_sampled_image = OpTypeSampledImage %type_2d_image - %Sampler0 = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_2 UniformConstant - %Tex0 = OpVariable %_ptr_UniformConstant__arr_type_2d_image_uint_2 UniformConstant -%gl_FragCoord = OpVariable %_ptr_Input_v4float Input -%in_var_INSTANCEID = OpVariable %_ptr_Input_uint Input -%out_var_SV_TARGET = OpVariable %_ptr_Output_v4float Output - %66 = OpConstantNull %v4float - %psmain = OpFunction %void None %21 - %28 = OpLabel - %29 = OpLoad %v4float %gl_FragCoord - %30 = OpLoad %uint %in_var_INSTANCEID - %31 = OpAccessChain %_ptr_UniformConstant_type_2d_image %Tex0 %30 - %32 = OpLoad %type_2d_image %31 - OpImageWrite %32 %27 %29 - -; CHECK: [[null_value:%\w+]] = OpConstantNull %v4float - -; CHECK: [[var_index:%\w+]] = OpLoad %uint %in_var_INSTANCEID -; CHECK: OpSelectionMerge [[merge:%\w+]] None -; CHECK: OpSwitch [[var_index]] [[default:%\w+]] 0 [[case0:%\w+]] 1 [[case1:%\w+]] -; CHECK: [[case0]] = OpLabel -; CHECK: OpAccessChain -; CHECK: OpLoad -; CHECK: OpImageWrite -; CHECK: OpBranch [[merge]] -; CHECK: [[case1]] = OpLabel -; CHECK: OpAccessChain -; CHECK: OpLoad -; CHECK: OpImageWrite -; CHECK: OpBranch [[merge]] -; CHECK: [[default]] = OpLabel -; CHECK: OpBranch [[merge]] -; CHECK: [[merge]] = OpLabel - - %33 = OpAccessChain %_ptr_UniformConstant_type_sampler %Sampler0 %30 - %37 = OpLoad %type_sampler %33 - %34 = OpVectorShuffle %v2float %29 %29 0 1 - %35 = OpSampledImage %type_sampled_image %32 %37 - %36 = OpImageSampleImplicitLod %v4float %35 %34 None - -; SPIR-V instructions to be replaced (will be killed by ADCE) -; CHECK: OpSelectionMerge -; CHECK: OpSwitch - -; CHECK: OpSelectionMerge [[merge_sampler:%\w+]] None -; CHECK: OpSwitch [[var_index]] [[default_sampler:%\w+]] 0 [[case_sampler0:%\w+]] 1 [[case_sampler1:%\w+]] - -; CHECK: [[case_sampler0]] = OpLabel -; CHECK: OpSelectionMerge [[merge_texture0:%\w+]] None -; CHECK: OpSwitch [[var_index]] [[default_texture:%\w+]] 0 [[case_texture0:%\w+]] 1 [[case_texture1:%\w+]] -; CHECK: [[case_texture0]] = OpLabel -; CHECK: [[pt0:%\w+]] = OpAccessChain %_ptr_UniformConstant_type_2d_image %Tex0 %uint_0 -; CHECK: [[ps0:%\w+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %Sampler0 %uint_0 -; CHECK: [[s0:%\w+]] = OpLoad %type_sampler [[ps0]] -; CHECK: [[t0:%\w+]] = OpLoad %type_2d_image [[pt0]] -; CHECK: [[sampledImg0:%\w+]] = OpSampledImage %type_sampled_image [[t0]] [[s0]] -; CHECK: [[value0:%\w+]] = OpImageSampleImplicitLod %v4float [[sampledImg0]] -; CHECK: OpBranch [[merge_texture0]] -; CHECK: [[case_texture1]] = OpLabel -; CHECK: [[pt1:%\w+]] = OpAccessChain %_ptr_UniformConstant_type_2d_image %Tex0 %uint_1 -; CHECK: [[ps0:%\w+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %Sampler0 %uint_0 -; CHECK: [[s0:%\w+]] = OpLoad %type_sampler [[ps0]] -; CHECK: [[t1:%\w+]] = OpLoad %type_2d_image [[pt1]] -; CHECK: [[sampledImg1:%\w+]] = OpSampledImage %type_sampled_image [[t1]] [[s0]] -; CHECK: [[value1:%\w+]] = OpImageSampleImplicitLod %v4float [[sampledImg1]] -; CHECK: OpBranch [[merge_texture0]] -; CHECK: [[default_texture]] = OpLabel -; CHECK: OpBranch [[merge_texture0]] -; CHECK: [[merge_texture0]] = OpLabel -; CHECK: [[phi0:%\w+]] = OpPhi %v4float [[value0]] [[case_texture0]] [[value1]] [[case_texture1]] [[null_value]] [[default_texture]] -; CHECK: OpBranch [[merge_sampler]] - -; CHECK: [[case_sampler1]] = OpLabel -; CHECK: OpSelectionMerge [[merge_texture1:%\w+]] None -; CHECK: OpSwitch [[var_index]] [[default_texture:%\w+]] 0 [[case_texture0:%\w+]] 1 [[case_texture1:%\w+]] -; CHECK: [[case_texture0]] = OpLabel -; CHECK: [[pt0:%\w+]] = OpAccessChain %_ptr_UniformConstant_type_2d_image %Tex0 %uint_0 -; CHECK: [[ps1:%\w+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %Sampler0 %uint_1 -; CHECK: [[s1:%\w+]] = OpLoad %type_sampler [[ps1]] -; CHECK: [[t0:%\w+]] = OpLoad %type_2d_image [[pt0]] -; CHECK: [[sampledImg0:%\w+]] = OpSampledImage %type_sampled_image [[t0]] [[s1]] -; CHECK: [[value0:%\w+]] = OpImageSampleImplicitLod %v4float [[sampledImg0]] -; CHECK: OpBranch [[merge_texture1]] -; CHECK: [[case_texture1]] = OpLabel -; CHECK: [[pt1:%\w+]] = OpAccessChain %_ptr_UniformConstant_type_2d_image %Tex0 %uint_1 -; CHECK: [[ps1:%\w+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %Sampler0 %uint_1 -; CHECK: [[s1:%\w+]] = OpLoad %type_sampler [[ps1]] -; CHECK: [[t1:%\w+]] = OpLoad %type_2d_image [[pt1]] -; CHECK: [[sampledImg1:%\w+]] = OpSampledImage %type_sampled_image [[t1]] [[s1]] -; CHECK: [[value1:%\w+]] = OpImageSampleImplicitLod %v4float [[sampledImg1]] -; CHECK: OpBranch [[merge_texture1]] -; CHECK: [[default_texture]] = OpLabel -; CHECK: OpBranch [[merge_texture1]] -; CHECK: [[merge_texture1]] = OpLabel -; CHECK: [[phi1:%\w+]] = OpPhi %v4float [[value0]] [[case_texture0]] [[value1]] [[case_texture1]] [[null_value]] [[default_texture]] - -; CHECK: [[default_sampler]] = OpLabel -; CHECK: OpBranch [[merge_sampler]] -; CHECK: [[merge_sampler]] = OpLabel -; CHECK: OpPhi %v4float [[phi0]] [[merge_texture0]] [[phi1]] [[merge_texture1]] [[null_value]] [[default_sampler]] -; CHECK: OpStore - - OpStore %out_var_SV_TARGET %36 - OpReturn - OpFunctionEnd - )"; - - SinglePassRunAndMatch(text, true); -} - -TEST_F(ReplaceDescArrayAccessUsingVarIndexTest, - ReplaceAccessChainToTextureArrayWithSingleElement) { - const std::string text = R"( - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %psmain "psmain" %gl_FragCoord %in_var_INSTANCEID %out_var_SV_TARGET - OpExecutionMode %psmain OriginUpperLeft - OpSource HLSL 600 - OpName %type_sampler "type.sampler" - OpName %Sampler0 "Sampler0" - OpName %type_2d_image "type.2d.image" - OpName %Tex0 "Tex0" - OpName %in_var_INSTANCEID "in.var.INSTANCEID" - OpName %out_var_SV_TARGET "out.var.SV_TARGET" - OpName %psmain "psmain" - OpName %type_sampled_image "type.sampled.image" - OpDecorate %gl_FragCoord BuiltIn FragCoord - OpDecorate %in_var_INSTANCEID Flat - OpDecorate %in_var_INSTANCEID Location 0 - OpDecorate %out_var_SV_TARGET Location 0 - OpDecorate %Sampler0 DescriptorSet 0 - OpDecorate %Sampler0 Binding 1 - OpDecorate %Tex0 DescriptorSet 0 - OpDecorate %Tex0 Binding 2 -%type_sampler = OpTypeSampler -%_ptr_UniformConstant_type_sampler = OpTypePointer UniformConstant %type_sampler - %uint = OpTypeInt 32 0 - %uint_1 = OpConstant %uint 1 - %float = OpTypeFloat 32 -%type_2d_image = OpTypeImage %float 2D 2 0 0 0 Unknown -%_arr_type_2d_image_uint_1 = OpTypeArray %type_2d_image %uint_1 -%_ptr_UniformConstant__arr_type_2d_image_uint_1 = OpTypePointer UniformConstant %_arr_type_2d_image_uint_1 - %v4float = OpTypeVector %float 4 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%_ptr_Input_uint = OpTypePointer Input %uint -%_ptr_Output_v4float = OpTypePointer Output %v4float - %void = OpTypeVoid - %21 = OpTypeFunction %void -%_ptr_UniformConstant_type_2d_image = OpTypePointer UniformConstant %type_2d_image - %v2float = OpTypeVector %float 2 - %v2uint = OpTypeVector %uint 2 - %uint_0 = OpConstant %uint 0 - %27 = OpConstantComposite %v2uint %uint_0 %uint_1 -%type_sampled_image = OpTypeSampledImage %type_2d_image - %Sampler0 = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant - %Tex0 = OpVariable %_ptr_UniformConstant__arr_type_2d_image_uint_1 UniformConstant -%gl_FragCoord = OpVariable %_ptr_Input_v4float Input -%in_var_INSTANCEID = OpVariable %_ptr_Input_uint Input -%out_var_SV_TARGET = OpVariable %_ptr_Output_v4float Output - %uint_2 = OpConstant %uint 2 - %66 = OpConstantNull %v4float - %psmain = OpFunction %void None %21 - %28 = OpLabel - %29 = OpLoad %v4float %gl_FragCoord - %30 = OpLoad %uint %in_var_INSTANCEID - %31 = OpAccessChain %_ptr_UniformConstant_type_2d_image %Tex0 %30 - %32 = OpLoad %type_2d_image %31 - OpImageWrite %32 %27 %29 - -; CHECK: [[ac:%\w+]] = OpAccessChain %_ptr_UniformConstant_type_2d_image %Tex0 %uint_0 -; CHECK-NOT: OpAccessChain -; CHECK-NOT: OpSwitch -; CHECK-NOT: OpPhi - - %33 = OpLoad %type_sampler %Sampler0 - %34 = OpVectorShuffle %v2float %29 %29 0 1 - %35 = OpSampledImage %type_sampled_image %32 %33 - %36 = OpImageSampleImplicitLod %v4float %35 %34 None - - OpStore %out_var_SV_TARGET %36 - OpReturn - OpFunctionEnd - )"; - - SinglePassRunAndMatch(text, true); -} - -TEST_F(ReplaceDescArrayAccessUsingVarIndexTest, ReplaceMultipleAccessChains) { - const std::string text = R"( - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %1 "TestFragment" %2 - OpExecutionMode %1 OriginUpperLeft - OpName %11 "type.ConstantBuffer.TestStruct" - OpMemberName %11 0 "val1" - OpMemberName %11 1 "val2" - OpName %3 "TestResources" - OpName %13 "type.2d.image" - OpName %4 "OutBuffer" - OpName %2 "in.var.SV_INSTANCEID" - OpName %1 "TestFragment" - OpDecorate %2 Flat - OpDecorate %2 Location 0 - OpDecorate %3 DescriptorSet 0 - OpDecorate %3 Binding 0 - OpDecorate %4 DescriptorSet 0 - OpDecorate %4 Binding 1 - OpMemberDecorate %11 0 Offset 0 - OpMemberDecorate %11 1 Offset 4 - OpDecorate %11 Block - %9 = OpTypeInt 32 0 - %10 = OpConstant %9 2 - %11 = OpTypeStruct %9 %9 - %8 = OpTypeArray %11 %10 - %7 = OpTypePointer Uniform %8 - %13 = OpTypeImage %9 2D 2 0 0 2 R32ui - %12 = OpTypePointer UniformConstant %13 - %14 = OpTypePointer Input %9 - %15 = OpTypeVoid - %16 = OpTypeFunction %15 - %40 = OpTypeVector %9 2 - %3 = OpVariable %7 Uniform - %4 = OpVariable %12 UniformConstant - %2 = OpVariable %14 Input - %57 = OpTypePointer Uniform %11 - %61 = OpTypePointer Uniform %9 - %62 = OpConstant %9 0 - %1 = OpFunction %15 None %16 - %17 = OpLabel - %20 = OpLoad %9 %2 - %47 = OpAccessChain %57 %3 %20 - %63 = OpAccessChain %61 %47 %62 - %64 = OpLoad %9 %63 - -; CHECK: [[null_value:%\w+]] = OpConstantNull %uint - -; CHECK: [[var_index:%\w+]] = OpLoad %uint %in_var_SV_INSTANCEID -; CHECK: OpSelectionMerge [[merge:%\w+]] None -; CHECK: OpSwitch [[var_index]] [[default:%\w+]] 0 [[case0:%\w+]] 1 [[case1:%\w+]] -; CHECK: [[case0]] = OpLabel -; CHECK: OpAccessChain -; CHECK: OpAccessChain -; CHECK: [[result0:%\w+]] = OpLoad -; CHECK: OpBranch [[merge]] -; CHECK: [[case1]] = OpLabel -; CHECK: OpAccessChain -; CHECK: OpAccessChain -; CHECK: [[result1:%\w+]] = OpLoad -; CHECK: OpBranch [[merge]] -; CHECK: [[default]] = OpLabel -; CHECK: OpBranch [[merge]] -; CHECK: [[merge]] = OpLabel -; CHECK: OpPhi %uint [[result0]] [[case0]] [[result1]] [[case1]] [[null_value]] [[default]] - - %55 = OpCompositeConstruct %40 %20 %20 - %56 = OpLoad %13 %4 - OpImageWrite %56 %55 %64 None - OpReturn - OpFunctionEnd - )"; - - SinglePassRunAndMatch(text, true); -} - -TEST_F(ReplaceDescArrayAccessUsingVarIndexTest, - ReplaceAccessChainToTextureArrayWithNonUniformIndex) { - const std::string text = R"( - OpCapability Shader - OpCapability ShaderNonUniform - OpCapability SampledImageArrayNonUniformIndexing - OpExtension "SPV_EXT_descriptor_indexing" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %PSMain "PSMain" %in_var_TEXCOORD0 %in_var_MATERIAL_ID %out_var_SV_TARGET - OpExecutionMode %PSMain OriginUpperLeft - OpSource HLSL 610 - OpName %type_sampler "type.sampler" - OpName %sampler_ "sampler_" - OpName %type_2d_image "type.2d.image" - OpName %texture_2d "texture_2d" - OpName %in_var_TEXCOORD0 "in.var.TEXCOORD0" - OpName %in_var_MATERIAL_ID "in.var.MATERIAL_ID" - OpName %out_var_SV_TARGET "out.var.SV_TARGET" - OpName %PSMain "PSMain" - OpName %type_sampled_image "type.sampled.image" - OpDecorate %in_var_MATERIAL_ID Flat - OpDecorate %in_var_TEXCOORD0 Location 0 - OpDecorate %in_var_MATERIAL_ID Location 1 - OpDecorate %out_var_SV_TARGET Location 0 - OpDecorate %sampler_ DescriptorSet 1 - OpDecorate %sampler_ Binding 1 - OpDecorate %texture_2d DescriptorSet 0 - OpDecorate %texture_2d Binding 0 - -; CHECK: OpDecorate [[v0:%\w+]] NonUniform -; CHECK: OpDecorate [[v1:%\w+]] NonUniform -; CHECK: OpDecorate [[v2:%\w+]] NonUniform -; CHECK: OpDecorate [[v3:%\w+]] NonUniform - - OpDecorate %10 NonUniform - OpDecorate %11 NonUniform - OpDecorate %12 NonUniform - OpDecorate %13 NonUniform -%type_sampler = OpTypeSampler -%_ptr_UniformConstant_type_sampler = OpTypePointer UniformConstant %type_sampler - %uint = OpTypeInt 32 0 - %uint_4 = OpConstant %uint 4 - %float = OpTypeFloat 32 -%type_2d_image = OpTypeImage %float 2D 2 0 0 1 Unknown -%_arr_type_2d_image_uint_4 = OpTypeArray %type_2d_image %uint_4 -%_ptr_UniformConstant__arr_type_2d_image_uint_4 = OpTypePointer UniformConstant %_arr_type_2d_image_uint_4 - %v2float = OpTypeVector %float 2 -%_ptr_Input_v2float = OpTypePointer Input %v2float -%_ptr_Input_uint = OpTypePointer Input %uint - %v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float - %void = OpTypeVoid - %26 = OpTypeFunction %void -%_ptr_UniformConstant_type_2d_image = OpTypePointer UniformConstant %type_2d_image -%type_sampled_image = OpTypeSampledImage %type_2d_image - %sampler_ = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant - %texture_2d = OpVariable %_ptr_UniformConstant__arr_type_2d_image_uint_4 UniformConstant -%in_var_TEXCOORD0 = OpVariable %_ptr_Input_v2float Input -%in_var_MATERIAL_ID = OpVariable %_ptr_Input_uint Input -%out_var_SV_TARGET = OpVariable %_ptr_Output_v4float Output - -; CHECK: %uint_0 = OpConstant %uint 0 -; CHECK: %uint_1 = OpConstant %uint 1 -; CHECK: %uint_2 = OpConstant %uint 2 -; CHECK: %uint_3 = OpConstant %uint 3 - - %PSMain = OpFunction %void None %26 - %28 = OpLabel - %29 = OpLoad %v2float %in_var_TEXCOORD0 - %30 = OpLoad %uint %in_var_MATERIAL_ID -; CHECK: [[v0]] = OpCopyObject %uint {{%\w+}} - %10 = OpCopyObject %uint %30 -; CHECK: [[v1]] = OpAccessChain %_ptr_UniformConstant_type_2d_image %texture_2d [[v0]] - %11 = OpAccessChain %_ptr_UniformConstant_type_2d_image %texture_2d %10 -; CHECK: [[v2]] = OpLoad %type_2d_image [[v1]] - %12 = OpLoad %type_2d_image %11 - %31 = OpLoad %type_sampler %sampler_ -; CHECK: [[v3]] = OpSampledImage %type_sampled_image [[v2]] {{%\w+}} - %13 = OpSampledImage %type_sampled_image %12 %31 - %32 = OpImageSampleImplicitLod %v4float %13 %29 None - OpStore %out_var_SV_TARGET %32 - OpReturn - OpFunctionEnd - )"; - - SinglePassRunAndMatch(text, true); -} - -} // namespace -} // namespace opt -} // namespace spvtools diff --git a/test/opt/spread_volatile_semantics_test.cpp b/test/opt/spread_volatile_semantics_test.cpp deleted file mode 100644 index dbb889c0..00000000 --- a/test/opt/spread_volatile_semantics_test.cpp +++ /dev/null @@ -1,1267 +0,0 @@ -// Copyright (c) 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include - -#include "gmock/gmock.h" -#include "test/opt/pass_fixture.h" -#include "test/opt/pass_utils.h" - -namespace spvtools { -namespace opt { -namespace { - -struct ExecutionModelAndBuiltIn { - const char* execution_model; - const char* built_in; - const bool use_v4uint; -}; - -using AddVolatileDecorationTest = - PassTest<::testing::TestWithParam>; - -TEST_P(AddVolatileDecorationTest, InMain) { - const auto& tc = GetParam(); - const std::string execution_model(tc.execution_model); - const std::string built_in(tc.built_in); - const std::string var_type = - tc.use_v4uint ? "%_ptr_Input_v4uint" : "%_ptr_Input_uint"; - const std::string var_load_type = tc.use_v4uint ? "%v4uint" : "%uint"; - - const std::string text = - std::string(R"(OpCapability RuntimeDescriptorArray -OpCapability RayTracingKHR -OpCapability SubgroupBallotKHR -OpExtension "SPV_EXT_descriptor_indexing" -OpExtension "SPV_KHR_ray_tracing" -OpExtension "SPV_KHR_shader_ballot" -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint )") + - execution_model + std::string(R"( %main "main" %var -OpSource GLSL 460 -OpSourceExtension "GL_EXT_nonuniform_qualifier" -OpSourceExtension "GL_KHR_ray_tracing" -OpName %main "main" -OpName %fn "fn" -OpName %StorageBuffer "StorageBuffer" -OpMemberName %StorageBuffer 0 "index" -OpMemberName %StorageBuffer 1 "red" -OpName %sbo "sbo" -OpName %images "images" -OpMemberDecorate %StorageBuffer 0 Offset 0 -OpMemberDecorate %StorageBuffer 1 Offset 4 -OpDecorate %StorageBuffer BufferBlock -OpDecorate %sbo DescriptorSet 0 -OpDecorate %sbo Binding 0 -OpDecorate %images DescriptorSet 0 -OpDecorate %images Binding 1 -OpDecorate %images NonWritable -)") + std::string(R"( -; CHECK: OpDecorate [[var:%\w+]] BuiltIn )") + - built_in + std::string(R"( -; CHECK: OpDecorate [[var]] Volatile -OpDecorate %var BuiltIn )") + built_in + std::string(R"( -%void = OpTypeVoid -%3 = OpTypeFunction %void -%uint = OpTypeInt 32 0 -%float = OpTypeFloat 32 -%StorageBuffer = OpTypeStruct %uint %float -%_ptr_Uniform_StorageBuffer = OpTypePointer Uniform %StorageBuffer -%sbo = OpVariable %_ptr_Uniform_StorageBuffer Uniform -%int = OpTypeInt 32 1 -%int_1 = OpConstant %int 1 -%13 = OpTypeImage %float 2D 0 0 0 2 Rgba32f -%_runtimearr_13 = OpTypeRuntimeArray %13 -%_ptr_UniformConstant__runtimearr_13 = OpTypePointer UniformConstant %_runtimearr_13 -%images = OpVariable %_ptr_UniformConstant__runtimearr_13 UniformConstant -%_ptr_Input_uint = OpTypePointer Input %uint -%v4uint = OpTypeVector %uint 4 -%_ptr_Input_v4uint = OpTypePointer Input %v4uint -%var = OpVariable )") + - var_type + std::string(R"( Input -%int_0 = OpConstant %int 0 -%_ptr_Uniform_uint = OpTypePointer Uniform %uint -%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13 -%v2int = OpTypeVector %int 2 -%25 = OpConstantComposite %v2int %int_0 %int_0 -%v4float = OpTypeVector %float 4 -%uint_0 = OpConstant %uint 0 -%_ptr_Uniform_float = OpTypePointer Uniform %float -%main = OpFunction %void None %3 -%5 = OpLabel -%19 = OpAccessChain %_ptr_Uniform_uint %sbo %int_0 -%20 = OpLoad %uint %19 -%load = OpLoad )") + var_load_type + std::string(R"( %var -%22 = OpAccessChain %_ptr_UniformConstant_13 %images %20 -%23 = OpLoad %13 %22 -%27 = OpImageRead %v4float %23 %25 -%29 = OpCompositeExtract %float %27 0 -%31 = OpAccessChain %_ptr_Uniform_float %sbo %int_1 -OpStore %31 %29 -%32 = OpFunctionCall %void %fn -OpReturn -OpFunctionEnd -%fn = OpFunction %void None %3 -%33 = OpLabel -OpReturn -OpFunctionEnd -)"); - - SinglePassRunAndMatch(text, true); -} - -INSTANTIATE_TEST_SUITE_P( - AddVolatileDecoration, AddVolatileDecorationTest, - ::testing::ValuesIn(std::vector{ - {"RayGenerationKHR", "SubgroupSize", false}, - {"RayGenerationKHR", "SubgroupLocalInvocationId", false}, - {"RayGenerationKHR", "SubgroupEqMask", true}, - {"ClosestHitKHR", "SubgroupLocalInvocationId", true}, - {"IntersectionKHR", "SubgroupEqMask", true}, - {"MissKHR", "SubgroupGeMask", true}, - {"CallableKHR", "SubgroupGtMask", true}, - {"RayGenerationKHR", "SubgroupLeMask", true}, - })); - -using SetLoadVolatileTest = - PassTest<::testing::TestWithParam>; - -TEST_P(SetLoadVolatileTest, InMain) { - const auto& tc = GetParam(); - const std::string execution_model(tc.execution_model); - const std::string built_in(tc.built_in); - - const std::string var_type = - tc.use_v4uint ? "%_ptr_Input_v4uint" : "%_ptr_Input_uint"; - const std::string var_value = tc.use_v4uint ? std::string(R"( -; CHECK: [[ptr:%\w+]] = OpAccessChain %_ptr_Input_uint [[var]] %int_0 -; CHECK: OpLoad {{%\w+}} [[ptr]] Volatile -%ptr = OpAccessChain %_ptr_Input_uint %var %int_0 -%var_value = OpLoad %uint %ptr)") - : std::string(R"( -; CHECK: OpLoad {{%\w+}} [[var]] Volatile -%var_value = OpLoad %uint %var)"); - - const std::string text = std::string(R"(OpCapability RuntimeDescriptorArray -OpCapability RayTracingKHR -OpCapability SubgroupBallotKHR -OpCapability VulkanMemoryModel -OpExtension "SPV_KHR_vulkan_memory_model" -OpExtension "SPV_EXT_descriptor_indexing" -OpExtension "SPV_KHR_ray_tracing" -OpExtension "SPV_KHR_shader_ballot" -OpMemoryModel Logical Vulkan -OpEntryPoint )") + execution_model + - std::string(R"( %main "main" %var -OpName %main "main" -OpName %StorageBuffer "StorageBuffer" -OpMemberName %StorageBuffer 0 "index" -OpMemberName %StorageBuffer 1 "red" -OpName %sbo "sbo" -OpName %images "images" -OpMemberDecorate %StorageBuffer 0 Offset 0 -OpMemberDecorate %StorageBuffer 1 Offset 4 -OpDecorate %StorageBuffer BufferBlock -OpDecorate %sbo DescriptorSet 0 -OpDecorate %sbo Binding 0 -OpDecorate %images DescriptorSet 0 -OpDecorate %images Binding 1 -OpDecorate %images NonWritable -)") + std::string(R"( -; CHECK: OpDecorate [[var:%\w+]] BuiltIn )") + - built_in + std::string(R"( -OpDecorate %var BuiltIn )") + built_in + - std::string(R"( -%void = OpTypeVoid -%3 = OpTypeFunction %void -%uint = OpTypeInt 32 0 -%float = OpTypeFloat 32 -%StorageBuffer = OpTypeStruct %uint %float -%_ptr_Uniform_StorageBuffer = OpTypePointer Uniform %StorageBuffer -%sbo = OpVariable %_ptr_Uniform_StorageBuffer Uniform -%int = OpTypeInt 32 1 -%int_1 = OpConstant %int 1 -%13 = OpTypeImage %float 2D 0 0 0 2 Rgba32f -%_runtimearr_13 = OpTypeRuntimeArray %13 -%_ptr_UniformConstant__runtimearr_13 = OpTypePointer UniformConstant %_runtimearr_13 -%images = OpVariable %_ptr_UniformConstant__runtimearr_13 UniformConstant -%_ptr_Input_uint = OpTypePointer Input %uint -%v4uint = OpTypeVector %uint 4 -%_ptr_Input_v4uint = OpTypePointer Input %v4uint -%var = OpVariable )") + var_type + - std::string(R"( Input -%int_0 = OpConstant %int 0 -%_ptr_Uniform_uint = OpTypePointer Uniform %uint -%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13 -%v2int = OpTypeVector %int 2 -%25 = OpConstantComposite %v2int %int_0 %int_0 -%v4float = OpTypeVector %float 4 -%uint_0 = OpConstant %uint 0 -%_ptr_Uniform_float = OpTypePointer Uniform %float -%main = OpFunction %void None %3 -%5 = OpLabel -%19 = OpAccessChain %_ptr_Uniform_uint %sbo %int_0 -%20 = OpLoad %uint %19 -)") + var_value + std::string(R"( -%test = OpIAdd %uint %var_value %20 -%22 = OpAccessChain %_ptr_UniformConstant_13 %images %test -%23 = OpLoad %13 %22 -%27 = OpImageRead %v4float %23 %25 -%29 = OpCompositeExtract %float %27 0 -%31 = OpAccessChain %_ptr_Uniform_float %sbo %int_1 -OpStore %31 %29 -OpReturn -OpFunctionEnd -)"); - - SinglePassRunAndMatch(text, true); -} - -INSTANTIATE_TEST_SUITE_P( - SetLoadVolatile, SetLoadVolatileTest, - ::testing::ValuesIn(std::vector{ - {"RayGenerationKHR", "SubgroupSize", false}, - {"RayGenerationKHR", "SubgroupLocalInvocationId", false}, - {"RayGenerationKHR", "SubgroupEqMask", true}, - {"ClosestHitKHR", "SubgroupLocalInvocationId", true}, - {"IntersectionKHR", "SubgroupEqMask", true}, - {"MissKHR", "SubgroupGeMask", true}, - {"CallableKHR", "SubgroupGtMask", true}, - {"RayGenerationKHR", "SubgroupLeMask", true}, - })); - -using VolatileSpreadTest = PassTest<::testing::Test>; - -TEST_F(VolatileSpreadTest, SpreadVolatileForHelperInvocation) { - const std::string text = - R"( -OpCapability Shader -OpCapability DemoteToHelperInvocation -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %var -OpExecutionMode %main OriginUpperLeft - -; CHECK: OpDecorate [[var:%\w+]] BuiltIn HelperInvocation -; CHECK: OpDecorate [[var]] Volatile -OpDecorate %var BuiltIn HelperInvocation - -%bool = OpTypeBool -%void = OpTypeVoid -%void_fn = OpTypeFunction %void -%_ptr_Input_bool = OpTypePointer Input %bool -%var = OpVariable %_ptr_Input_bool Input -%main = OpFunction %void None %void_fn -%entry = OpLabel -%load = OpLoad %bool %var -OpDemoteToHelperInvocation -OpReturn -OpFunctionEnd -)"; - - SetTargetEnv(SPV_ENV_UNIVERSAL_1_6); - SinglePassRunAndMatch(text, true); -} - -TEST_F(VolatileSpreadTest, MultipleExecutionModel) { - const std::string text = - R"( -OpCapability RuntimeDescriptorArray -OpCapability RayTracingKHR -OpCapability SubgroupBallotKHR -OpExtension "SPV_EXT_descriptor_indexing" -OpExtension "SPV_KHR_ray_tracing" -OpExtension "SPV_KHR_shader_ballot" -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint RayGenerationKHR %RayGeneration "RayGeneration" %var -OpEntryPoint GLCompute %compute "Compute" %gl_LocalInvocationIndex -OpExecutionMode %compute LocalSize 16 16 1 -OpSource GLSL 460 -OpSourceExtension "GL_EXT_nonuniform_qualifier" -OpSourceExtension "GL_KHR_ray_tracing" -OpName %RayGeneration "RayGeneration" -OpName %StorageBuffer "StorageBuffer" -OpMemberName %StorageBuffer 0 "index" -OpMemberName %StorageBuffer 1 "red" -OpName %sbo "sbo" -OpName %images "images" -OpMemberDecorate %StorageBuffer 0 Offset 0 -OpMemberDecorate %StorageBuffer 1 Offset 4 -OpDecorate %gl_LocalInvocationIndex BuiltIn LocalInvocationIndex -OpDecorate %StorageBuffer BufferBlock -OpDecorate %sbo DescriptorSet 0 -OpDecorate %sbo Binding 0 -OpDecorate %images DescriptorSet 0 -OpDecorate %images Binding 1 -OpDecorate %images NonWritable - -; CHECK: OpEntryPoint RayGenerationNV {{%\w+}} "RayGeneration" [[var:%\w+]] -; CHECK: OpDecorate [[var]] BuiltIn SubgroupSize -; CHECK: OpDecorate [[var]] Volatile -; CHECK-NOT: OpDecorate {{%\w+}} Volatile -OpDecorate %var BuiltIn SubgroupSize - -%void = OpTypeVoid -%3 = OpTypeFunction %void -%uint = OpTypeInt 32 0 -%float = OpTypeFloat 32 -%StorageBuffer = OpTypeStruct %uint %float -%_ptr_Uniform_StorageBuffer = OpTypePointer Uniform %StorageBuffer -%sbo = OpVariable %_ptr_Uniform_StorageBuffer Uniform -%int = OpTypeInt 32 1 -%int_1 = OpConstant %int 1 -%13 = OpTypeImage %float 2D 0 0 0 2 Rgba32f -%_runtimearr_13 = OpTypeRuntimeArray %13 -%_ptr_UniformConstant__runtimearr_13 = OpTypePointer UniformConstant %_runtimearr_13 -%images = OpVariable %_ptr_UniformConstant__runtimearr_13 UniformConstant -%_ptr_Input_uint = OpTypePointer Input %uint -%var = OpVariable %_ptr_Input_uint Input -%int_0 = OpConstant %int 0 -%_ptr_Uniform_uint = OpTypePointer Uniform %uint -%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13 -%v2int = OpTypeVector %int 2 -%25 = OpConstantComposite %v2int %int_0 %int_0 -%v4float = OpTypeVector %float 4 -%uint_0 = OpConstant %uint 0 -%uint_1 = OpConstant %uint 1 -%_ptr_Uniform_float = OpTypePointer Uniform %float -%gl_LocalInvocationIndex = OpVariable %_ptr_Input_uint Input -%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint -%shared = OpVariable %_ptr_Workgroup_uint Workgroup - -%RayGeneration = OpFunction %void None %3 -%5 = OpLabel -%19 = OpAccessChain %_ptr_Uniform_uint %sbo %int_0 -%20 = OpLoad %uint %var -%22 = OpAccessChain %_ptr_UniformConstant_13 %images %20 -%23 = OpLoad %13 %22 -%27 = OpImageRead %v4float %23 %25 -%29 = OpCompositeExtract %float %27 0 -%31 = OpAccessChain %_ptr_Uniform_float %sbo %int_1 -OpStore %31 %29 -OpReturn -OpFunctionEnd - -%compute = OpFunction %void None %3 -%66 = OpLabel -%62 = OpLoad %uint %gl_LocalInvocationIndex -%61 = OpAtomicIAdd %uint %shared %uint_1 %uint_0 %62 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndMatch(text, true); -} - -TEST_F(VolatileSpreadTest, VarUsedInMultipleEntryPoints) { - const std::string text = - R"( -OpCapability RuntimeDescriptorArray -OpCapability RayTracingKHR -OpCapability SubgroupBallotKHR -OpExtension "SPV_EXT_descriptor_indexing" -OpExtension "SPV_KHR_ray_tracing" -OpExtension "SPV_KHR_shader_ballot" -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint RayGenerationKHR %RayGeneration "RayGeneration" %var -OpEntryPoint ClosestHitKHR %ClosestHit "ClosestHit" %var -OpSource GLSL 460 -OpSourceExtension "GL_EXT_nonuniform_qualifier" -OpSourceExtension "GL_KHR_ray_tracing" -OpName %RayGeneration "RayGeneration" -OpName %ClosestHit "ClosestHit" -OpName %StorageBuffer "StorageBuffer" -OpMemberName %StorageBuffer 0 "index" -OpMemberName %StorageBuffer 1 "red" -OpName %sbo "sbo" -OpName %images "images" -OpMemberDecorate %StorageBuffer 0 Offset 0 -OpMemberDecorate %StorageBuffer 1 Offset 4 -OpDecorate %gl_LocalInvocationIndex BuiltIn LocalInvocationIndex -OpDecorate %StorageBuffer BufferBlock -OpDecorate %sbo DescriptorSet 0 -OpDecorate %sbo Binding 0 -OpDecorate %images DescriptorSet 0 -OpDecorate %images Binding 1 -OpDecorate %images NonWritable - -; CHECK: OpEntryPoint RayGenerationNV {{%\w+}} "RayGeneration" [[var:%\w+]] -; CHECK: OpEntryPoint ClosestHitNV {{%\w+}} "ClosestHit" [[var]] -; CHECK: OpDecorate [[var]] BuiltIn SubgroupSize -; CHECK: OpDecorate [[var]] Volatile -; CHECK-NOT: OpDecorate {{%\w+}} Volatile -OpDecorate %var BuiltIn SubgroupSize - -%void = OpTypeVoid -%3 = OpTypeFunction %void -%uint = OpTypeInt 32 0 -%float = OpTypeFloat 32 -%StorageBuffer = OpTypeStruct %uint %float -%_ptr_Uniform_StorageBuffer = OpTypePointer Uniform %StorageBuffer -%sbo = OpVariable %_ptr_Uniform_StorageBuffer Uniform -%int = OpTypeInt 32 1 -%int_1 = OpConstant %int 1 -%13 = OpTypeImage %float 2D 0 0 0 2 Rgba32f -%_runtimearr_13 = OpTypeRuntimeArray %13 -%_ptr_UniformConstant__runtimearr_13 = OpTypePointer UniformConstant %_runtimearr_13 -%images = OpVariable %_ptr_UniformConstant__runtimearr_13 UniformConstant -%_ptr_Input_uint = OpTypePointer Input %uint -%var = OpVariable %_ptr_Input_uint Input -%int_0 = OpConstant %int 0 -%_ptr_Uniform_uint = OpTypePointer Uniform %uint -%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13 -%v2int = OpTypeVector %int 2 -%25 = OpConstantComposite %v2int %int_0 %int_0 -%v4float = OpTypeVector %float 4 -%uint_0 = OpConstant %uint 0 -%uint_1 = OpConstant %uint 1 -%_ptr_Uniform_float = OpTypePointer Uniform %float -%gl_LocalInvocationIndex = OpVariable %_ptr_Input_uint Input -%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint -%shared = OpVariable %_ptr_Workgroup_uint Workgroup - -%RayGeneration = OpFunction %void None %3 -%5 = OpLabel -%19 = OpAccessChain %_ptr_Uniform_uint %sbo %int_0 -%20 = OpLoad %uint %var -%22 = OpAccessChain %_ptr_UniformConstant_13 %images %20 -%23 = OpLoad %13 %22 -%27 = OpImageRead %v4float %23 %25 -%29 = OpCompositeExtract %float %27 0 -%31 = OpAccessChain %_ptr_Uniform_float %sbo %int_1 -OpStore %31 %29 -OpReturn -OpFunctionEnd - -%ClosestHit = OpFunction %void None %3 -%45 = OpLabel -%49 = OpAccessChain %_ptr_Uniform_uint %sbo %int_0 -%40 = OpLoad %uint %var -%42 = OpAccessChain %_ptr_UniformConstant_13 %images %40 -%43 = OpLoad %13 %42 -%47 = OpImageRead %v4float %43 %25 -%59 = OpCompositeExtract %float %47 0 -%51 = OpAccessChain %_ptr_Uniform_float %sbo %int_1 -OpStore %51 %59 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndMatch(text, true); -} - -class VolatileSpreadErrorTest : public PassTest<::testing::Test> { - public: - VolatileSpreadErrorTest() - : consumer_([this](spv_message_level_t level, const char*, - const spv_position_t& position, const char* message) { - if (!error_message_.empty()) error_message_ += "\n"; - switch (level) { - case SPV_MSG_FATAL: - case SPV_MSG_INTERNAL_ERROR: - case SPV_MSG_ERROR: - error_message_ += "ERROR"; - break; - case SPV_MSG_WARNING: - error_message_ += "WARNING"; - break; - case SPV_MSG_INFO: - error_message_ += "INFO"; - break; - case SPV_MSG_DEBUG: - error_message_ += "DEBUG"; - break; - } - error_message_ += - ": " + std::to_string(position.index) + ": " + message; - }) {} - - Pass::Status RunPass(const std::string& text) { - std::unique_ptr context_ = - spvtools::BuildModule(SPV_ENV_UNIVERSAL_1_2, consumer_, text); - if (!context_.get()) return Pass::Status::Failure; - - PassManager manager; - manager.SetMessageConsumer(consumer_); - manager.AddPass(); - - return manager.Run(context_.get()); - } - - std::string GetErrorMessage() const { return error_message_; } - - void TearDown() override { error_message_.clear(); } - - private: - spvtools::MessageConsumer consumer_; - std::string error_message_; -}; - -TEST_F(VolatileSpreadErrorTest, VarUsedInMultipleExecutionModelError) { - const std::string text = - R"( -OpCapability RuntimeDescriptorArray -OpCapability RayTracingKHR -OpCapability SubgroupBallotKHR -OpExtension "SPV_EXT_descriptor_indexing" -OpExtension "SPV_KHR_ray_tracing" -OpExtension "SPV_KHR_shader_ballot" -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint RayGenerationKHR %RayGeneration "RayGeneration" %var -OpEntryPoint GLCompute %compute "Compute" %gl_LocalInvocationIndex %var -OpExecutionMode %compute LocalSize 16 16 1 -OpSource GLSL 460 -OpSourceExtension "GL_EXT_nonuniform_qualifier" -OpSourceExtension "GL_KHR_ray_tracing" -OpName %RayGeneration "RayGeneration" -OpName %StorageBuffer "StorageBuffer" -OpMemberName %StorageBuffer 0 "index" -OpMemberName %StorageBuffer 1 "red" -OpName %sbo "sbo" -OpName %images "images" -OpMemberDecorate %StorageBuffer 0 Offset 0 -OpMemberDecorate %StorageBuffer 1 Offset 4 -OpDecorate %gl_LocalInvocationIndex BuiltIn LocalInvocationIndex -OpDecorate %StorageBuffer BufferBlock -OpDecorate %sbo DescriptorSet 0 -OpDecorate %sbo Binding 0 -OpDecorate %images DescriptorSet 0 -OpDecorate %images Binding 1 -OpDecorate %images NonWritable -OpDecorate %var BuiltIn SubgroupSize -%void = OpTypeVoid -%3 = OpTypeFunction %void -%uint = OpTypeInt 32 0 -%float = OpTypeFloat 32 -%StorageBuffer = OpTypeStruct %uint %float -%_ptr_Uniform_StorageBuffer = OpTypePointer Uniform %StorageBuffer -%sbo = OpVariable %_ptr_Uniform_StorageBuffer Uniform -%int = OpTypeInt 32 1 -%int_1 = OpConstant %int 1 -%13 = OpTypeImage %float 2D 0 0 0 2 Rgba32f -%_runtimearr_13 = OpTypeRuntimeArray %13 -%_ptr_UniformConstant__runtimearr_13 = OpTypePointer UniformConstant %_runtimearr_13 -%images = OpVariable %_ptr_UniformConstant__runtimearr_13 UniformConstant -%_ptr_Input_uint = OpTypePointer Input %uint -%var = OpVariable %_ptr_Input_uint Input -%int_0 = OpConstant %int 0 -%_ptr_Uniform_uint = OpTypePointer Uniform %uint -%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13 -%v2int = OpTypeVector %int 2 -%25 = OpConstantComposite %v2int %int_0 %int_0 -%v4float = OpTypeVector %float 4 -%uint_0 = OpConstant %uint 0 -%uint_1 = OpConstant %uint 1 -%_ptr_Uniform_float = OpTypePointer Uniform %float -%gl_LocalInvocationIndex = OpVariable %_ptr_Input_uint Input -%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint -%shared = OpVariable %_ptr_Workgroup_uint Workgroup - -%RayGeneration = OpFunction %void None %3 -%5 = OpLabel -%19 = OpAccessChain %_ptr_Uniform_uint %sbo %int_0 -%20 = OpLoad %uint %var -%22 = OpAccessChain %_ptr_UniformConstant_13 %images %20 -%23 = OpLoad %13 %22 -%27 = OpImageRead %v4float %23 %25 -%29 = OpCompositeExtract %float %27 0 -%31 = OpAccessChain %_ptr_Uniform_float %sbo %int_1 -OpStore %31 %29 -OpReturn -OpFunctionEnd - -%compute = OpFunction %void None %3 -%66 = OpLabel -%62 = OpLoad %uint %gl_LocalInvocationIndex -%63 = OpLoad %uint %var -%64 = OpIAdd %uint %62 %63 -%61 = OpAtomicIAdd %uint %shared %uint_1 %uint_0 %64 -OpReturn -OpFunctionEnd -)"; - - EXPECT_EQ(RunPass(text), Pass::Status::Failure); - const char expected_error[] = - "ERROR: 0: Variable is a target for Volatile semantics for an entry " - "point, but it is not for another entry point"; - EXPECT_STREQ(GetErrorMessage().substr(0, sizeof(expected_error) - 1).c_str(), - expected_error); -} - -TEST_F(VolatileSpreadErrorTest, - VarUsedInMultipleReverseOrderExecutionModelError) { - const std::string text = - R"( -OpCapability RuntimeDescriptorArray -OpCapability RayTracingKHR -OpCapability SubgroupBallotKHR -OpExtension "SPV_EXT_descriptor_indexing" -OpExtension "SPV_KHR_ray_tracing" -OpExtension "SPV_KHR_shader_ballot" -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint GLCompute %compute "Compute" %gl_LocalInvocationIndex %var -OpEntryPoint RayGenerationKHR %RayGeneration "RayGeneration" %var -OpExecutionMode %compute LocalSize 16 16 1 -OpSource GLSL 460 -OpSourceExtension "GL_EXT_nonuniform_qualifier" -OpSourceExtension "GL_KHR_ray_tracing" -OpName %RayGeneration "RayGeneration" -OpName %StorageBuffer "StorageBuffer" -OpMemberName %StorageBuffer 0 "index" -OpMemberName %StorageBuffer 1 "red" -OpName %sbo "sbo" -OpName %images "images" -OpMemberDecorate %StorageBuffer 0 Offset 0 -OpMemberDecorate %StorageBuffer 1 Offset 4 -OpDecorate %gl_LocalInvocationIndex BuiltIn LocalInvocationIndex -OpDecorate %StorageBuffer BufferBlock -OpDecorate %sbo DescriptorSet 0 -OpDecorate %sbo Binding 0 -OpDecorate %images DescriptorSet 0 -OpDecorate %images Binding 1 -OpDecorate %images NonWritable -OpDecorate %var BuiltIn SubgroupSize -%void = OpTypeVoid -%3 = OpTypeFunction %void -%uint = OpTypeInt 32 0 -%float = OpTypeFloat 32 -%StorageBuffer = OpTypeStruct %uint %float -%_ptr_Uniform_StorageBuffer = OpTypePointer Uniform %StorageBuffer -%sbo = OpVariable %_ptr_Uniform_StorageBuffer Uniform -%int = OpTypeInt 32 1 -%int_1 = OpConstant %int 1 -%13 = OpTypeImage %float 2D 0 0 0 2 Rgba32f -%_runtimearr_13 = OpTypeRuntimeArray %13 -%_ptr_UniformConstant__runtimearr_13 = OpTypePointer UniformConstant %_runtimearr_13 -%images = OpVariable %_ptr_UniformConstant__runtimearr_13 UniformConstant -%_ptr_Input_uint = OpTypePointer Input %uint -%var = OpVariable %_ptr_Input_uint Input -%int_0 = OpConstant %int 0 -%_ptr_Uniform_uint = OpTypePointer Uniform %uint -%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13 -%v2int = OpTypeVector %int 2 -%25 = OpConstantComposite %v2int %int_0 %int_0 -%v4float = OpTypeVector %float 4 -%uint_0 = OpConstant %uint 0 -%uint_1 = OpConstant %uint 1 -%_ptr_Uniform_float = OpTypePointer Uniform %float -%gl_LocalInvocationIndex = OpVariable %_ptr_Input_uint Input -%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint -%shared = OpVariable %_ptr_Workgroup_uint Workgroup - -%RayGeneration = OpFunction %void None %3 -%5 = OpLabel -%19 = OpAccessChain %_ptr_Uniform_uint %sbo %int_0 -%20 = OpLoad %uint %var -%22 = OpAccessChain %_ptr_UniformConstant_13 %images %20 -%23 = OpLoad %13 %22 -%27 = OpImageRead %v4float %23 %25 -%29 = OpCompositeExtract %float %27 0 -%31 = OpAccessChain %_ptr_Uniform_float %sbo %int_1 -OpStore %31 %29 -OpReturn -OpFunctionEnd - -%compute = OpFunction %void None %3 -%66 = OpLabel -%62 = OpLoad %uint %gl_LocalInvocationIndex -%63 = OpLoad %uint %var -%64 = OpIAdd %uint %62 %63 -%61 = OpAtomicIAdd %uint %shared %uint_1 %uint_0 %64 -OpReturn -OpFunctionEnd -)"; - - EXPECT_EQ(RunPass(text), Pass::Status::Failure); - const char expected_error[] = - "ERROR: 0: Variable is a target for Volatile semantics for an entry " - "point, but it is not for another entry point"; - EXPECT_STREQ(GetErrorMessage().substr(0, sizeof(expected_error) - 1).c_str(), - expected_error); -} - -TEST_F(VolatileSpreadErrorTest, FunctionNotInlined) { - const std::string text = - R"( -OpCapability RuntimeDescriptorArray -OpCapability RayTracingKHR -OpCapability SubgroupBallotKHR -OpExtension "SPV_EXT_descriptor_indexing" -OpExtension "SPV_KHR_ray_tracing" -OpExtension "SPV_KHR_shader_ballot" -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint RayGenerationKHR %RayGeneration "RayGeneration" %var -OpEntryPoint ClosestHitKHR %ClosestHit "ClosestHit" %var -OpSource GLSL 460 -OpSourceExtension "GL_EXT_nonuniform_qualifier" -OpSourceExtension "GL_KHR_ray_tracing" -OpName %RayGeneration "RayGeneration" -OpName %ClosestHit "ClosestHit" -OpName %StorageBuffer "StorageBuffer" -OpMemberName %StorageBuffer 0 "index" -OpMemberName %StorageBuffer 1 "red" -OpName %sbo "sbo" -OpName %images "images" -OpMemberDecorate %StorageBuffer 0 Offset 0 -OpMemberDecorate %StorageBuffer 1 Offset 4 -OpDecorate %gl_LocalInvocationIndex BuiltIn LocalInvocationIndex -OpDecorate %StorageBuffer BufferBlock -OpDecorate %sbo DescriptorSet 0 -OpDecorate %sbo Binding 0 -OpDecorate %images DescriptorSet 0 -OpDecorate %images Binding 1 -OpDecorate %images NonWritable -OpDecorate %var BuiltIn SubgroupSize -%void = OpTypeVoid -%3 = OpTypeFunction %void -%uint = OpTypeInt 32 0 -%float = OpTypeFloat 32 -%StorageBuffer = OpTypeStruct %uint %float -%_ptr_Uniform_StorageBuffer = OpTypePointer Uniform %StorageBuffer -%sbo = OpVariable %_ptr_Uniform_StorageBuffer Uniform -%int = OpTypeInt 32 1 -%int_1 = OpConstant %int 1 -%13 = OpTypeImage %float 2D 0 0 0 2 Rgba32f -%_runtimearr_13 = OpTypeRuntimeArray %13 -%_ptr_UniformConstant__runtimearr_13 = OpTypePointer UniformConstant %_runtimearr_13 -%images = OpVariable %_ptr_UniformConstant__runtimearr_13 UniformConstant -%_ptr_Input_uint = OpTypePointer Input %uint -%var = OpVariable %_ptr_Input_uint Input -%int_0 = OpConstant %int 0 -%_ptr_Uniform_uint = OpTypePointer Uniform %uint -%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13 -%v2int = OpTypeVector %int 2 -%25 = OpConstantComposite %v2int %int_0 %int_0 -%v4float = OpTypeVector %float 4 -%uint_0 = OpConstant %uint 0 -%uint_1 = OpConstant %uint 1 -%_ptr_Uniform_float = OpTypePointer Uniform %float -%gl_LocalInvocationIndex = OpVariable %_ptr_Input_uint Input -%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint -%shared = OpVariable %_ptr_Workgroup_uint Workgroup - -%RayGeneration = OpFunction %void None %3 -%5 = OpLabel -%19 = OpAccessChain %_ptr_Uniform_uint %sbo %int_0 -%20 = OpLoad %uint %19 -%22 = OpAccessChain %_ptr_UniformConstant_13 %images %20 -%23 = OpLoad %13 %22 -%27 = OpImageRead %v4float %23 %25 -%29 = OpCompositeExtract %float %27 0 -%31 = OpAccessChain %_ptr_Uniform_float %sbo %int_1 -OpStore %31 %29 -OpReturn -OpFunctionEnd - -%NotInlined = OpFunction %void None %3 -%32 = OpLabel -OpReturn -OpFunctionEnd - -%ClosestHit = OpFunction %void None %3 -%45 = OpLabel -%49 = OpAccessChain %_ptr_Uniform_uint %sbo %int_0 -%40 = OpLoad %uint %49 -%42 = OpAccessChain %_ptr_UniformConstant_13 %images %40 -%43 = OpLoad %13 %42 -%47 = OpImageRead %v4float %43 %25 -%59 = OpCompositeExtract %float %47 0 -%51 = OpAccessChain %_ptr_Uniform_float %sbo %int_1 -OpStore %51 %59 -OpReturn -OpFunctionEnd -)"; - - EXPECT_EQ(RunPass(text), Pass::Status::SuccessWithoutChange); -} - -TEST_F(VolatileSpreadErrorTest, VarNotUsedInEntryPointForVolatile) { - const std::string text = - R"( -OpCapability RuntimeDescriptorArray -OpCapability RayTracingKHR -OpCapability SubgroupBallotKHR -OpExtension "SPV_EXT_descriptor_indexing" -OpExtension "SPV_KHR_ray_tracing" -OpExtension "SPV_KHR_shader_ballot" -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint RayGenerationKHR %RayGeneration "RayGeneration" %var -OpEntryPoint GLCompute %compute "Compute" %gl_LocalInvocationIndex %var -OpExecutionMode %compute LocalSize 16 16 1 -OpSource GLSL 460 -OpSourceExtension "GL_EXT_nonuniform_qualifier" -OpSourceExtension "GL_KHR_ray_tracing" -OpName %RayGeneration "RayGeneration" -OpName %StorageBuffer "StorageBuffer" -OpMemberName %StorageBuffer 0 "index" -OpMemberName %StorageBuffer 1 "red" -OpName %sbo "sbo" -OpName %images "images" -OpMemberDecorate %StorageBuffer 0 Offset 0 -OpMemberDecorate %StorageBuffer 1 Offset 4 -OpDecorate %gl_LocalInvocationIndex BuiltIn LocalInvocationIndex -OpDecorate %StorageBuffer BufferBlock -OpDecorate %sbo DescriptorSet 0 -OpDecorate %sbo Binding 0 -OpDecorate %images DescriptorSet 0 -OpDecorate %images Binding 1 -OpDecorate %images NonWritable - -; CHECK-NOT: OpDecorate {{%\w+}} Volatile - -OpDecorate %var BuiltIn SubgroupSize -%void = OpTypeVoid -%3 = OpTypeFunction %void -%uint = OpTypeInt 32 0 -%float = OpTypeFloat 32 -%StorageBuffer = OpTypeStruct %uint %float -%_ptr_Uniform_StorageBuffer = OpTypePointer Uniform %StorageBuffer -%sbo = OpVariable %_ptr_Uniform_StorageBuffer Uniform -%int = OpTypeInt 32 1 -%int_1 = OpConstant %int 1 -%13 = OpTypeImage %float 2D 0 0 0 2 Rgba32f -%_runtimearr_13 = OpTypeRuntimeArray %13 -%_ptr_UniformConstant__runtimearr_13 = OpTypePointer UniformConstant %_runtimearr_13 -%images = OpVariable %_ptr_UniformConstant__runtimearr_13 UniformConstant -%_ptr_Input_uint = OpTypePointer Input %uint -%var = OpVariable %_ptr_Input_uint Input -%int_0 = OpConstant %int 0 -%_ptr_Uniform_uint = OpTypePointer Uniform %uint -%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13 -%v2int = OpTypeVector %int 2 -%25 = OpConstantComposite %v2int %int_0 %int_0 -%v4float = OpTypeVector %float 4 -%uint_0 = OpConstant %uint 0 -%uint_1 = OpConstant %uint 1 -%_ptr_Uniform_float = OpTypePointer Uniform %float -%gl_LocalInvocationIndex = OpVariable %_ptr_Input_uint Input -%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint -%shared = OpVariable %_ptr_Workgroup_uint Workgroup - -%RayGeneration = OpFunction %void None %3 -%5 = OpLabel -%19 = OpAccessChain %_ptr_Uniform_uint %sbo %int_0 -%20 = OpLoad %uint %19 -%22 = OpAccessChain %_ptr_UniformConstant_13 %images %20 -%23 = OpLoad %13 %22 -%27 = OpImageRead %v4float %23 %25 -%29 = OpCompositeExtract %float %27 0 -%31 = OpAccessChain %_ptr_Uniform_float %sbo %int_1 -OpStore %31 %29 -OpReturn -OpFunctionEnd - -%compute = OpFunction %void None %3 -%66 = OpLabel -%62 = OpLoad %uint %gl_LocalInvocationIndex -%63 = OpLoad %uint %var -%64 = OpIAdd %uint %62 %63 -%61 = OpAtomicIAdd %uint %shared %uint_1 %uint_0 %64 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndMatch(text, true); -} - -TEST_F(VolatileSpreadTest, RecursivelySpreadVolatile) { - const std::string text = - R"( -OpCapability RuntimeDescriptorArray -OpCapability RayTracingKHR -OpCapability SubgroupBallotKHR -OpCapability VulkanMemoryModel -OpExtension "SPV_KHR_vulkan_memory_model" -OpExtension "SPV_EXT_descriptor_indexing" -OpExtension "SPV_KHR_ray_tracing" -OpExtension "SPV_KHR_shader_ballot" -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical Vulkan -OpEntryPoint RayGenerationKHR %RayGeneration "RayGeneration" %var0 %var1 -OpSource GLSL 460 -OpSourceExtension "GL_EXT_nonuniform_qualifier" -OpSourceExtension "GL_KHR_ray_tracing" -OpName %RayGeneration "RayGeneration" -OpName %StorageBuffer "StorageBuffer" -OpMemberName %StorageBuffer 0 "index" -OpMemberName %StorageBuffer 1 "red" -OpName %sbo "sbo" -OpName %images "images" -OpMemberDecorate %StorageBuffer 0 Offset 0 -OpMemberDecorate %StorageBuffer 1 Offset 4 -OpDecorate %StorageBuffer BufferBlock -OpDecorate %sbo DescriptorSet 0 -OpDecorate %sbo Binding 0 -OpDecorate %images DescriptorSet 0 -OpDecorate %images Binding 1 -OpDecorate %images NonWritable - -; CHECK: OpDecorate [[var0:%\w+]] BuiltIn SubgroupEqMask -; CHECK: OpDecorate [[var1:%\w+]] BuiltIn SubgroupGeMask -OpDecorate %var0 BuiltIn SubgroupEqMask -OpDecorate %var1 BuiltIn SubgroupGeMask - -%void = OpTypeVoid -%3 = OpTypeFunction %void -%uint = OpTypeInt 32 0 -%float = OpTypeFloat 32 -%StorageBuffer = OpTypeStruct %uint %float -%_ptr_Uniform_StorageBuffer = OpTypePointer Uniform %StorageBuffer -%sbo = OpVariable %_ptr_Uniform_StorageBuffer Uniform -%int = OpTypeInt 32 1 -%int_1 = OpConstant %int 1 -%13 = OpTypeImage %float 2D 0 0 0 2 Rgba32f -%_runtimearr_13 = OpTypeRuntimeArray %13 -%_ptr_UniformConstant__runtimearr_13 = OpTypePointer UniformConstant %_runtimearr_13 -%images = OpVariable %_ptr_UniformConstant__runtimearr_13 UniformConstant -%v4uint = OpTypeVector %uint 4 -%_ptr_Input_v4uint = OpTypePointer Input %v4uint -%_ptr_Input_uint = OpTypePointer Input %uint -%var0 = OpVariable %_ptr_Input_v4uint Input -%var1 = OpVariable %_ptr_Input_v4uint Input -%int_0 = OpConstant %int 0 -%_ptr_Uniform_uint = OpTypePointer Uniform %uint -%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13 -%v2int = OpTypeVector %int 2 -%25 = OpConstantComposite %v2int %int_0 %int_0 -%v4float = OpTypeVector %float 4 -%uint_0 = OpConstant %uint 0 -%uint_1 = OpConstant %uint 1 -%_ptr_Uniform_float = OpTypePointer Uniform %float - -%RayGeneration = OpFunction %void None %3 -%5 = OpLabel - -; CHECK: [[ptr0:%\w+]] = OpAccessChain %_ptr_Input_uint [[var0]] %int_0 -; CHECK: OpLoad {{%\w+}} [[ptr0]] Volatile -%19 = OpAccessChain %_ptr_Input_uint %var0 %int_0 -%20 = OpLoad %uint %19 - -%22 = OpAccessChain %_ptr_UniformConstant_13 %images %20 -%23 = OpLoad %13 %22 -%27 = OpImageRead %v4float %23 %25 -%29 = OpCompositeExtract %float %27 0 -%31 = OpAccessChain %_ptr_Uniform_float %sbo %uint_1 - -; CHECK: OpLoad {{%\w+}} [[ptr0]] Volatile -%24 = OpLoad %uint %19 - -; CHECK: [[var2:%\w+]] = OpCopyObject %_ptr_Input_v4uint [[var0]] -; CHECK: [[ptr2:%\w+]] = OpAccessChain %_ptr_Input_uint [[var2]] %int_1 -; CHECK: OpLoad {{%\w+}} [[ptr2]] Volatile -%18 = OpCopyObject %_ptr_Input_v4uint %var0 -%21 = OpAccessChain %_ptr_Input_uint %18 %int_1 -%26 = OpLoad %uint %21 - -%28 = OpIAdd %uint %24 %26 -%30 = OpConvertUToF %float %28 - -; CHECK: [[ptr1:%\w+]] = OpAccessChain %_ptr_Input_uint [[var1]] %int_1 -; CHECK: OpLoad {{%\w+}} [[ptr1]] Volatile -%32 = OpAccessChain %_ptr_Input_uint %var1 %int_1 -%33 = OpLoad %uint %32 - -%34 = OpConvertUToF %float %33 -%35 = OpFAdd %float %34 %30 -%36 = OpFAdd %float %35 %29 -OpStore %31 %36 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndMatch(text, true); -} - -TEST_F(VolatileSpreadTest, SpreadVolatileOnlyForTargetEntryPoints) { - const std::string text = - R"( -OpCapability RuntimeDescriptorArray -OpCapability RayTracingKHR -OpCapability SubgroupBallotKHR -OpCapability VulkanMemoryModel -OpCapability VulkanMemoryModelDeviceScopeKHR -OpExtension "SPV_KHR_vulkan_memory_model" -OpExtension "SPV_EXT_descriptor_indexing" -OpExtension "SPV_KHR_ray_tracing" -OpExtension "SPV_KHR_shader_ballot" -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical Vulkan -OpEntryPoint RayGenerationKHR %RayGeneration "RayGeneration" %var0 %var1 -OpEntryPoint GLCompute %compute "Compute" %var0 %var1 -OpExecutionMode %compute LocalSize 16 16 1 -OpSource GLSL 460 -OpSourceExtension "GL_EXT_nonuniform_qualifier" -OpSourceExtension "GL_KHR_ray_tracing" -OpName %RayGeneration "RayGeneration" -OpName %StorageBuffer "StorageBuffer" -OpMemberName %StorageBuffer 0 "index" -OpMemberName %StorageBuffer 1 "red" -OpName %sbo "sbo" -OpName %images "images" -OpMemberDecorate %StorageBuffer 0 Offset 0 -OpMemberDecorate %StorageBuffer 1 Offset 4 -OpDecorate %StorageBuffer BufferBlock -OpDecorate %sbo DescriptorSet 0 -OpDecorate %sbo Binding 0 -OpDecorate %images DescriptorSet 0 -OpDecorate %images Binding 1 -OpDecorate %images NonWritable - -; CHECK: OpDecorate [[var0:%\w+]] BuiltIn SubgroupEqMask -; CHECK: OpDecorate [[var1:%\w+]] BuiltIn SubgroupGeMask -OpDecorate %var0 BuiltIn SubgroupEqMask -OpDecorate %var1 BuiltIn SubgroupGeMask - -%void = OpTypeVoid -%3 = OpTypeFunction %void -%uint = OpTypeInt 32 0 -%float = OpTypeFloat 32 -%StorageBuffer = OpTypeStruct %uint %float -%_ptr_Uniform_StorageBuffer = OpTypePointer Uniform %StorageBuffer -%sbo = OpVariable %_ptr_Uniform_StorageBuffer Uniform -%int = OpTypeInt 32 1 -%int_1 = OpConstant %int 1 -%13 = OpTypeImage %float 2D 0 0 0 2 Rgba32f -%_runtimearr_13 = OpTypeRuntimeArray %13 -%_ptr_UniformConstant__runtimearr_13 = OpTypePointer UniformConstant %_runtimearr_13 -%images = OpVariable %_ptr_UniformConstant__runtimearr_13 UniformConstant -%v4uint = OpTypeVector %uint 4 -%_ptr_Input_v4uint = OpTypePointer Input %v4uint -%_ptr_Input_uint = OpTypePointer Input %uint -%var0 = OpVariable %_ptr_Input_v4uint Input -%var1 = OpVariable %_ptr_Input_v4uint Input -%int_0 = OpConstant %int 0 -%_ptr_Uniform_uint = OpTypePointer Uniform %uint -%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13 -%v2int = OpTypeVector %int 2 -%25 = OpConstantComposite %v2int %int_0 %int_0 -%v4float = OpTypeVector %float 4 -%uint_0 = OpConstant %uint 0 -%uint_1 = OpConstant %uint 1 -%_ptr_Uniform_float = OpTypePointer Uniform %float -%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint -%shared = OpVariable %_ptr_Workgroup_uint Workgroup - -%RayGeneration = OpFunction %void None %3 -%5 = OpLabel - -; CHECK: [[ptr0:%\w+]] = OpAccessChain %_ptr_Input_uint [[var0]] %int_0 -; CHECK: OpLoad {{%\w+}} [[ptr0]] Volatile -%19 = OpAccessChain %_ptr_Input_uint %var0 %int_0 -%20 = OpLoad %uint %19 - -%22 = OpAccessChain %_ptr_UniformConstant_13 %images %20 -%23 = OpLoad %13 %22 -%27 = OpImageRead %v4float %23 %25 -%29 = OpCompositeExtract %float %27 0 -%31 = OpAccessChain %_ptr_Uniform_float %sbo %uint_1 - -; CHECK: OpLoad {{%\w+}} [[ptr0]] Volatile -%24 = OpLoad %uint %19 - -; CHECK: [[var2:%\w+]] = OpCopyObject %_ptr_Input_v4uint [[var0]] -; CHECK: [[ptr2:%\w+]] = OpAccessChain %_ptr_Input_uint [[var2]] %int_1 -; CHECK: OpLoad {{%\w+}} [[ptr2]] Volatile -%18 = OpCopyObject %_ptr_Input_v4uint %var0 -%21 = OpAccessChain %_ptr_Input_uint %18 %int_1 -%26 = OpLoad %uint %21 - -%28 = OpIAdd %uint %24 %26 -%30 = OpConvertUToF %float %28 - -; CHECK: [[ptr1:%\w+]] = OpAccessChain %_ptr_Input_uint [[var1]] %int_1 -; CHECK: OpLoad {{%\w+}} [[ptr1]] Volatile -%32 = OpAccessChain %_ptr_Input_uint %var1 %int_1 -%33 = OpLoad %uint %32 - -%34 = OpConvertUToF %float %33 -%35 = OpFAdd %float %34 %30 -%36 = OpFAdd %float %35 %29 -OpStore %31 %36 -OpReturn -OpFunctionEnd - -%compute = OpFunction %void None %3 -%66 = OpLabel - -; CHECK-NOT: OpLoad {{%\w+}} {{%\w+}} Volatile -%62 = OpLoad %v4uint %var0 -%63 = OpLoad %v4uint %var1 -%64 = OpIAdd %v4uint %62 %63 -%65 = OpCompositeExtract %uint %64 0 -%61 = OpAtomicIAdd %uint %shared %uint_1 %uint_0 %65 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndMatch(text, true); -} - -TEST_F(VolatileSpreadTest, SkipIfItHasNoExecutionModel) { - const std::string text = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -%2 = OpTypeVoid -%3 = OpTypeFunction %2 -%4 = OpFunction %2 None %3 -%5 = OpLabel -OpReturn -OpFunctionEnd -)"; - - Pass::Status status; - std::tie(std::ignore, status) = - SinglePassRunToBinary(text, - /* skip_nop = */ false); - EXPECT_EQ(status, Pass::Status::SuccessWithoutChange); -} - -TEST_F(VolatileSpreadTest, NoInlinedfuncCalls) { - const std::string text = R"( -OpCapability RayTracingNV -OpCapability VulkanMemoryModel -OpCapability GroupNonUniform -OpExtension "SPV_NV_ray_tracing" -OpExtension "SPV_KHR_vulkan_memory_model" -OpMemoryModel Logical Vulkan -OpEntryPoint RayGenerationNV %main "main" %SubgroupSize -OpSource HLSL 630 -OpName %main "main" -OpName %src_main "src.main" -OpName %bb_entry "bb.entry" -OpName %func0 "func0" -OpName %bb_entry_0 "bb.entry" -OpName %func2 "func2" -OpName %bb_entry_1 "bb.entry" -OpName %param_var_count "param.var.count" -OpName %func1 "func1" -OpName %bb_entry_2 "bb.entry" -OpName %func3 "func3" -OpName %count "count" -OpName %bb_entry_3 "bb.entry" -OpDecorate %SubgroupSize BuiltIn SubgroupSize -%uint = OpTypeInt 32 0 -%_ptr_Input_uint = OpTypePointer Input %uint -%void = OpTypeVoid -%6 = OpTypeFunction %void -%_ptr_Function_uint = OpTypePointer Function %uint -%25 = OpTypeFunction %void %_ptr_Function_uint -%SubgroupSize = OpVariable %_ptr_Input_uint Input -%main = OpFunction %void None %6 -%7 = OpLabel -%8 = OpFunctionCall %void %src_main -OpReturn -OpFunctionEnd -%src_main = OpFunction %void None %6 -%bb_entry = OpLabel -%11 = OpFunctionCall %void %func0 -OpReturn -OpFunctionEnd -%func0 = OpFunction %void DontInline %6 -%bb_entry_0 = OpLabel -%14 = OpFunctionCall %void %func2 -%16 = OpFunctionCall %void %func1 -OpReturn -OpFunctionEnd -%func2 = OpFunction %void DontInline %6 -%bb_entry_1 = OpLabel -%param_var_count = OpVariable %_ptr_Function_uint Function -; CHECK: {{%\w+}} = OpLoad %uint %SubgroupSize Volatile -%21 = OpLoad %uint %SubgroupSize -OpStore %param_var_count %21 -%22 = OpFunctionCall %void %func3 %param_var_count -OpReturn -OpFunctionEnd -%func1 = OpFunction %void DontInline %6 -%bb_entry_2 = OpLabel -OpReturn -OpFunctionEnd -%func3 = OpFunction %void DontInline %25 -%count = OpFunctionParameter %_ptr_Function_uint -%bb_entry_3 = OpLabel -OpReturn -OpFunctionEnd -)"; - SinglePassRunAndMatch(text, true); -} - -TEST_F(VolatileSpreadErrorTest, NoInlinedMultiEntryfuncCalls) { - const std::string text = R"( -OpCapability RayTracingNV -OpCapability SubgroupBallotKHR -OpExtension "SPV_NV_ray_tracing" -OpExtension "SPV_KHR_shader_ballot" -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint RayGenerationNV %main "main" %SubgroupSize -OpEntryPoint GLCompute %main2 "main2" %gl_LocalInvocationIndex %SubgroupSize -OpSource HLSL 630 -OpName %main "main" -OpName %bb_entry "bb.entry" -OpName %main2 "main2" -OpName %bb_entry_0 "bb.entry" -OpName %func "func" -OpName %count "count" -OpName %bb_entry_1 "bb.entry" -OpDecorate %gl_LocalInvocationIndex BuiltIn LocalInvocationIndex -OpDecorate %SubgroupSize BuiltIn SubgroupSize -%uint = OpTypeInt 32 0 -%uint_0 = OpConstant %uint 0 -%_ptr_Input_uint = OpTypePointer Input %uint -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%void = OpTypeVoid -%12 = OpTypeFunction %void -%_ptr_Function_uint = OpTypePointer Function %uint -%_ptr_Function_v4float = OpTypePointer Function %v4float -%29 = OpTypeFunction %void %_ptr_Function_v4float -%34 = OpTypeFunction %void %_ptr_Function_uint -%SubgroupSize = OpVariable %_ptr_Input_uint Input -%gl_LocalInvocationIndex = OpVariable %_ptr_Input_uint Input -%main = OpFunction %void None %12 -%bb_entry = OpLabel -%20 = OpFunctionCall %void %func -OpReturn -OpFunctionEnd -%main2 = OpFunction %void None %12 -%bb_entry_0 = OpLabel -%33 = OpFunctionCall %void %func -OpReturn -OpFunctionEnd -%func = OpFunction %void DontInline %12 -%bb_entry_1 = OpLabel -%count = OpVariable %_ptr_Function_uint Function -%35 = OpLoad %uint %SubgroupSize -OpStore %count %35 -OpReturn -OpFunctionEnd -)"; - EXPECT_EQ(RunPass(text), Pass::Status::Failure); - const char expected_error[] = - "ERROR: 0: Variable is a target for Volatile semantics for an entry " - "point, but it is not for another entry point"; - EXPECT_STREQ(GetErrorMessage().substr(0, sizeof(expected_error) - 1).c_str(), - expected_error); -} - -} // namespace -} // namespace opt -} // namespace spvtools diff --git a/test/opt/strip_nonsemantic_info_test.cpp b/test/opt/strip_nonsemantic_info_test.cpp deleted file mode 100644 index 3aacffa3..00000000 --- a/test/opt/strip_nonsemantic_info_test.cpp +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright (c) 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include - -#include "gmock/gmock.h" -#include "spirv-tools/optimizer.hpp" -#include "test/opt/pass_fixture.h" -#include "test/opt/pass_utils.h" - -namespace spvtools { -namespace opt { -namespace { - -using StripNonSemanticInfoTest = PassTest<::testing::Test>; - -// This test acts as an end-to-end code example on how to strip -// reflection info from a SPIR-V module. Use this code pattern -// when you have compiled HLSL code with Glslang or DXC using -// option -fhlsl_functionality1 to insert reflection information, -// but then want to filter out the extra instructions before sending -// it to a driver that does not implement VK_GOOGLE_hlsl_functionality1. -TEST_F(StripNonSemanticInfoTest, StripReflectEnd2EndExample) { - // This is a non-sensical example, but exercises the instructions. - std::string before = R"(OpCapability Shader -OpCapability Linkage -OpExtension "SPV_GOOGLE_decorate_string" -OpExtension "SPV_GOOGLE_hlsl_functionality1" -OpMemoryModel Logical Simple -OpDecorateStringGOOGLE %float HlslSemanticGOOGLE "foobar" -OpDecorateStringGOOGLE %void HlslSemanticGOOGLE "my goodness" -%void = OpTypeVoid -%float = OpTypeFloat 32 -)"; - SpirvTools tools(SPV_ENV_UNIVERSAL_1_1); - std::vector binary_in; - tools.Assemble(before, &binary_in); - - // Instantiate the optimizer, and run the strip-nonsemantic-info - // pass over the |binary_in| module, and place the modified module - // into |binary_out|. - spvtools::Optimizer optimizer(SPV_ENV_UNIVERSAL_1_1); - optimizer.RegisterPass(spvtools::CreateStripNonSemanticInfoPass()); - std::vector binary_out; - optimizer.Run(binary_in.data(), binary_in.size(), &binary_out); - - // Check results - std::string disassembly; - tools.Disassemble(binary_out.data(), binary_out.size(), &disassembly); - std::string after = R"(OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical Simple -%void = OpTypeVoid -%float = OpTypeFloat 32 -)"; - EXPECT_THAT(disassembly, testing::Eq(after)); -} - -// This test is functionally the same as the end-to-end test above, -// but uses the test SinglePassRunAndCheck test fixture instead. -TEST_F(StripNonSemanticInfoTest, StripHlslSemantic) { - // This is a non-sensical example, but exercises the instructions. - std::string before = R"(OpCapability Shader -OpCapability Linkage -OpExtension "SPV_GOOGLE_decorate_string" -OpExtension "SPV_GOOGLE_hlsl_functionality1" -OpMemoryModel Logical Simple -OpDecorateStringGOOGLE %float HlslSemanticGOOGLE "foobar" -OpDecorateStringGOOGLE %void HlslSemanticGOOGLE "my goodness" -%void = OpTypeVoid -%float = OpTypeFloat 32 -)"; - std::string after = R"(OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical Simple -%void = OpTypeVoid -%float = OpTypeFloat 32 -)"; - - SinglePassRunAndCheck(before, after, false); -} - -TEST_F(StripNonSemanticInfoTest, StripHlslCounterBuffer) { - std::string before = R"(OpCapability Shader -OpCapability Linkage -OpExtension "SPV_GOOGLE_hlsl_functionality1" -OpMemoryModel Logical Simple -OpDecorateId %void HlslCounterBufferGOOGLE %float -%void = OpTypeVoid -%float = OpTypeFloat 32 -)"; - std::string after = R"(OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical Simple -%void = OpTypeVoid -%float = OpTypeFloat 32 -)"; - - SinglePassRunAndCheck(before, after, false); -} - -TEST_F(StripNonSemanticInfoTest, StripHlslSemanticOnMember) { - // This is a non-sensical example, but exercises the instructions. - std::string before = R"(OpCapability Shader -OpCapability Linkage -OpExtension "SPV_GOOGLE_decorate_string" -OpExtension "SPV_GOOGLE_hlsl_functionality1" -OpMemoryModel Logical Simple -OpMemberDecorateStringGOOGLE %struct 0 HlslSemanticGOOGLE "foobar" -%float = OpTypeFloat 32 -%_struct_3 = OpTypeStruct %float -)"; - std::string after = R"(OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical Simple -%float = OpTypeFloat 32 -%_struct_3 = OpTypeStruct %float -)"; - - SinglePassRunAndCheck(before, after, false); -} - -TEST_F(StripNonSemanticInfoTest, StripNonSemanticImport) { - std::string text = R"( -; CHECK-NOT: OpExtension "SPV_KHR_non_semantic_info" -; CHECK-NOT: OpExtInstImport -OpCapability Shader -OpCapability Linkage -OpExtension "SPV_KHR_non_semantic_info" -%ext = OpExtInstImport "NonSemantic.Test" -OpMemoryModel Logical GLSL450 -)"; - - SinglePassRunAndMatch(text, true); -} - -TEST_F(StripNonSemanticInfoTest, StripNonSemanticGlobal) { - std::string text = R"( -; CHECK-NOT: OpExtInst -OpCapability Shader -OpCapability Linkage -OpExtension "SPV_KHR_non_semantic_info" -%ext = OpExtInstImport "NonSemantic.Test" -OpMemoryModel Logical GLSL450 -%void = OpTypeVoid -%1 = OpExtInst %void %ext 1 -)"; - - SinglePassRunAndMatch(text, true); -} - -TEST_F(StripNonSemanticInfoTest, StripNonSemanticInFunction) { - std::string text = R"( -; CHECK-NOT: OpExtInst -OpCapability Shader -OpCapability Linkage -OpExtension "SPV_KHR_non_semantic_info" -%ext = OpExtInstImport "NonSemantic.Test" -OpMemoryModel Logical GLSL450 -%void = OpTypeVoid -%void_fn = OpTypeFunction %void -%foo = OpFunction %void None %void_fn -%entry = OpLabel -%1 = OpExtInst %void %ext 1 %foo -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndMatch(text, true); -} - -TEST_F(StripNonSemanticInfoTest, StripNonSemanticAfterFunction) { - std::string text = R"( -; CHECK-NOT: OpExtInst -OpCapability Shader -OpCapability Linkage -OpExtension "SPV_KHR_non_semantic_info" -%ext = OpExtInstImport "NonSemantic.Test" -OpMemoryModel Logical GLSL450 -%void = OpTypeVoid -%void_fn = OpTypeFunction %void -%foo = OpFunction %void None %void_fn -%entry = OpLabel -OpReturn -OpFunctionEnd -%1 = OpExtInst %void %ext 1 %foo -)"; - - SinglePassRunAndMatch(text, true); -} - -TEST_F(StripNonSemanticInfoTest, StripNonSemanticBetweenFunctions) { - std::string text = R"( -; CHECK-NOT: OpExtInst -OpCapability Shader -OpCapability Linkage -OpExtension "SPV_KHR_non_semantic_info" -%ext = OpExtInstImport "NonSemantic.Test" -OpMemoryModel Logical GLSL450 -%void = OpTypeVoid -%void_fn = OpTypeFunction %void -%foo = OpFunction %void None %void_fn -%entry = OpLabel -OpReturn -OpFunctionEnd -%1 = OpExtInst %void %ext 1 %foo -%bar = OpFunction %void None %void_fn -%bar_entry = OpLabel -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndMatch(text, true); -} - -// Make sure that strip reflect does not remove the debug info (OpString and -// OpLine). -TEST_F(StripNonSemanticInfoTest, DontStripDebug) { - std::string text = R"(OpCapability Shader -OpMemoryModel Logical Simple -OpEntryPoint Fragment %1 "main" -OpExecutionMode %1 OriginUpperLeft -%2 = OpString "file" -%void = OpTypeVoid -%4 = OpTypeFunction %void -%1 = OpFunction %void None %4 -%5 = OpLabel -OpLine %2 1 1 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck(text, text, false); -} - -TEST_F(StripNonSemanticInfoTest, RemovedNonSemanticDebugInfo) { - const std::string text = R"( -;CHECK-NOT: OpExtension "SPV_KHR_non_semantic_info -;CHECK-NOT: OpExtInstImport "NonSemantic.Shader.DebugInfo.100 -;CHECK-NOT: OpExtInst %void {{%\w+}} DebugSource -;CHECK-NOT: OpExtInst %void {{%\w+}} DebugLine - OpCapability Shader - OpExtension "SPV_KHR_non_semantic_info" - %1 = OpExtInstImport "NonSemantic.Shader.DebugInfo.100" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %PSMain "PSMain" %in_var_COLOR %out_var_SV_TARGET - OpExecutionMode %PSMain OriginUpperLeft - %5 = OpString "t.hlsl" - %6 = OpString "float" - %7 = OpString "color" - %8 = OpString "PSInput" - %9 = OpString "PSMain" - %10 = OpString "" - %11 = OpString "input" - OpName %in_var_COLOR "in.var.COLOR" - OpName %out_var_SV_TARGET "out.var.SV_TARGET" - OpName %PSMain "PSMain" - OpDecorate %in_var_COLOR Location 0 - OpDecorate %out_var_SV_TARGET Location 0 - %uint = OpTypeInt 32 0 - %float = OpTypeFloat 32 - %v4float = OpTypeVector %float 4 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%_ptr_Output_v4float = OpTypePointer Output %v4float - %void = OpTypeVoid - %uint_1 = OpConstant %uint 1 - %uint_9 = OpConstant %uint 9 - %21 = OpTypeFunction %void -%in_var_COLOR = OpVariable %_ptr_Input_v4float Input -%out_var_SV_TARGET = OpVariable %_ptr_Output_v4float Output - %13 = OpExtInst %void %1 DebugSource %5 - %PSMain = OpFunction %void None %21 - %22 = OpLabel - %23 = OpLoad %v4float %in_var_COLOR - OpStore %out_var_SV_TARGET %23 - %24 = OpExtInst %void %1 DebugLine %13 %uint_9 %uint_9 %uint_1 %uint_1 - OpReturn - OpFunctionEnd -)"; - SinglePassRunAndMatch(text, true); -} - -} // namespace -} // namespace opt -} // namespace spvtools diff --git a/test/reduce/CMakeLists.txt b/test/reduce/CMakeLists.txt index 121cd4f0..652f0ab5 100644 --- a/test/reduce/CMakeLists.txt +++ b/test/reduce/CMakeLists.txt @@ -14,7 +14,6 @@ add_spvtools_unittest(TARGET reduce SRCS - conditional_branch_to_simple_conditional_branch_test.cpp merge_blocks_test.cpp operand_to_constant_test.cpp operand_to_undef_test.cpp @@ -27,10 +26,10 @@ add_spvtools_unittest(TARGET reduce remove_selection_test.cpp remove_unused_instruction_test.cpp remove_unused_struct_member_test.cpp - simple_conditional_branch_to_branch_test.cpp - structured_construct_to_block_test.cpp structured_loop_to_selection_test.cpp validation_during_reduction_test.cpp + conditional_branch_to_simple_conditional_branch_test.cpp + simple_conditional_branch_to_branch_test.cpp LIBS SPIRV-Tools-reduce ) diff --git a/test/reduce/merge_blocks_test.cpp b/test/reduce/merge_blocks_test.cpp index c472301f..8506ee08 100644 --- a/test/reduce/merge_blocks_test.cpp +++ b/test/reduce/merge_blocks_test.cpp @@ -647,64 +647,6 @@ TEST(MergeBlocksReductionPassTest, LoopReturnReverse) { MergeBlocksReductionPassTest_LoopReturn_Helper(true); } -TEST(MergeBlocksReductionPassTest, MergeUnreachable) { - std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 320 - OpName %4 "main" - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %11 = OpTypeBool - %12 = OpConstantFalse %11 - %4 = OpFunction %2 None %3 - %5 = OpLabel - OpReturn - %9 = OpLabel - OpBranch %100 - %100 = OpLabel - OpReturn - OpFunctionEnd - )"; - - const auto env = SPV_ENV_UNIVERSAL_1_3; - const auto consumer = nullptr; - const auto context = - BuildModule(env, consumer, shader, kReduceAssembleOption); - const auto ops = - MergeBlocksReductionOpportunityFinder().GetAvailableOpportunities( - context.get(), 0); - ASSERT_EQ(1, ops.size()); - - ASSERT_TRUE(ops[0]->PreconditionHolds()); - ops[0]->TryToApply(); - - std::string after = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 320 - OpName %4 "main" - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %11 = OpTypeBool - %12 = OpConstantFalse %11 - %4 = OpFunction %2 None %3 - %5 = OpLabel - OpReturn - %9 = OpLabel - OpReturn - OpFunctionEnd - )"; - - CheckEqual(env, after, context.get()); -} - } // namespace } // namespace reduce } // namespace spvtools diff --git a/test/reduce/reduce_test_util.cpp b/test/reduce/reduce_test_util.cpp index 42716600..0c234111 100644 --- a/test/reduce/reduce_test_util.cpp +++ b/test/reduce/reduce_test_util.cpp @@ -21,29 +21,6 @@ namespace spvtools { namespace reduce { -const spvtools::MessageConsumer kConsoleMessageConsumer = - [](spv_message_level_t level, const char*, const spv_position_t& position, - const char* message) -> void { - switch (level) { - case SPV_MSG_FATAL: - case SPV_MSG_INTERNAL_ERROR: - case SPV_MSG_ERROR: - std::cerr << "error: line " << position.index << ": " << message - << std::endl; - break; - case SPV_MSG_WARNING: - std::cout << "warning: line " << position.index << ": " << message - << std::endl; - break; - case SPV_MSG_INFO: - std::cout << "info: line " << position.index << ": " << message - << std::endl; - break; - default: - break; - } -}; - void CheckEqual(const spv_target_env env, const std::vector& expected_binary, const std::vector& actual_binary) { @@ -78,9 +55,8 @@ void CheckEqual(const spv_target_env env, const std::string& expected_text, void CheckValid(spv_target_env env, const opt::IRContext* ir) { std::vector binary; ir->module()->ToBinary(&binary, false); - SpirvTools tools(env); - tools.SetMessageConsumer(kConsoleMessageConsumer); - ASSERT_TRUE(tools.Validate(binary)); + SpirvTools t(env); + ASSERT_TRUE(t.Validate(binary)); } std::string ToString(spv_target_env env, const opt::IRContext* ir) { diff --git a/test/reduce/structured_construct_to_block_test.cpp b/test/reduce/structured_construct_to_block_test.cpp deleted file mode 100644 index 95009660..00000000 --- a/test/reduce/structured_construct_to_block_test.cpp +++ /dev/null @@ -1,245 +0,0 @@ -// Copyright (c) 2021 Alastair F. Donaldson -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/reduce/structured_construct_to_block_reduction_opportunity_finder.h" - -#include "source/opt/build_module.h" -#include "source/reduce/reduction_opportunity.h" -#include "test/reduce/reduce_test_util.h" - -namespace spvtools { -namespace reduce { -namespace { - -TEST(StructuredConstructToBlockReductionPassTest, SimpleTest) { - std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 320 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %7 = OpTypePointer Function %6 - %9 = OpConstant %6 0 - %10 = OpTypeBool - %11 = OpConstantTrue %10 - %19 = OpConstant %6 3 - %29 = OpConstant %6 1 - %31 = OpConstant %6 2 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %8 = OpVariable %7 Function - OpStore %8 %9 - OpSelectionMerge %13 None - OpBranchConditional %11 %12 %13 - %12 = OpLabel - OpBranch %13 - %13 = OpLabel - OpBranch %14 - %14 = OpLabel - OpLoopMerge %16 %17 None - OpBranch %15 - %15 = OpLabel - %18 = OpLoad %6 %8 - %20 = OpSGreaterThan %10 %18 %19 - OpSelectionMerge %22 None - OpBranchConditional %20 %21 %22 - %21 = OpLabel - OpBranch %16 - %22 = OpLabel - OpBranch %17 - %17 = OpLabel - OpBranch %14 - %16 = OpLabel - %24 = OpLoad %6 %8 - OpSelectionMerge %28 None - OpSwitch %24 %27 1 %25 2 %26 - %27 = OpLabel - OpStore %8 %19 - OpBranch %28 - %25 = OpLabel - OpStore %8 %29 - OpBranch %28 - %26 = OpLabel - OpStore %8 %31 - OpBranch %28 - %28 = OpLabel - OpReturn - OpFunctionEnd - )"; - - const auto env = SPV_ENV_UNIVERSAL_1_3; - const auto context = BuildModule(env, nullptr, shader, kReduceAssembleOption); - const auto ops = StructuredConstructToBlockReductionOpportunityFinder() - .GetAvailableOpportunities(context.get(), 0); - ASSERT_EQ(3, ops.size()); - - ASSERT_TRUE(ops[0]->PreconditionHolds()); - ops[0]->TryToApply(); - CheckValid(env, context.get()); - - ASSERT_TRUE(ops[1]->PreconditionHolds()); - ops[1]->TryToApply(); - CheckValid(env, context.get()); - - ASSERT_TRUE(ops[2]->PreconditionHolds()); - ops[2]->TryToApply(); - CheckValid(env, context.get()); - - std::string expected = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 320 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %7 = OpTypePointer Function %6 - %9 = OpConstant %6 0 - %10 = OpTypeBool - %11 = OpConstantTrue %10 - %19 = OpConstant %6 3 - %29 = OpConstant %6 1 - %31 = OpConstant %6 2 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %8 = OpVariable %7 Function - OpStore %8 %9 - OpBranch %13 - %13 = OpLabel - OpBranch %14 - %14 = OpLabel - OpBranch %16 - %16 = OpLabel - %24 = OpLoad %6 %8 - OpBranch %28 - %28 = OpLabel - OpReturn - OpFunctionEnd - )"; - CheckEqual(env, expected, context.get()); -} - -TEST(StructuredConstructToBlockReductionPassTest, CannotBeRemovedDueToUses) { - std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 320 - OpName %100 "temp" - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeInt 32 1 - %7 = OpTypePointer Function %6 - %9 = OpConstant %6 0 - %10 = OpTypeBool - %11 = OpConstantTrue %10 - %19 = OpConstant %6 3 - %29 = OpConstant %6 1 - %31 = OpConstant %6 2 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %8 = OpVariable %7 Function - OpStore %8 %9 - OpSelectionMerge %13 None - OpBranchConditional %11 %12 %13 - %12 = OpLabel - %100 = OpCopyObject %10 %11 - OpBranch %13 - %13 = OpLabel - OpBranch %14 - %14 = OpLabel - OpLoopMerge %16 %17 None - OpBranch %15 - %15 = OpLabel - %18 = OpLoad %6 %8 - %20 = OpSGreaterThan %10 %18 %19 - OpSelectionMerge %22 None - OpBranchConditional %20 %21 %22 - %21 = OpLabel - OpBranch %16 - %22 = OpLabel - OpBranch %17 - %17 = OpLabel - OpBranch %14 - %16 = OpLabel - %101 = OpCopyObject %6 %18 - %24 = OpLoad %6 %8 - OpSelectionMerge %28 None - OpSwitch %24 %27 1 %25 2 %26 - %27 = OpLabel - OpStore %8 %19 - %102 = OpCopyObject %10 %11 - OpBranch %28 - %25 = OpLabel - OpStore %8 %29 - OpBranch %28 - %26 = OpLabel - OpStore %8 %31 - OpBranch %28 - %28 = OpLabel - %103 = OpPhi %10 %102 %27 %11 %25 %11 %26 - OpReturn - OpFunctionEnd - )"; - - const auto env = SPV_ENV_UNIVERSAL_1_3; - const auto context = BuildModule(env, nullptr, shader, kReduceAssembleOption); - const auto ops = StructuredConstructToBlockReductionOpportunityFinder() - .GetAvailableOpportunities(context.get(), 0); - ASSERT_TRUE(ops.empty()); -} - -TEST(StructuredConstructToBlockReductionPassTest, - CannotBeRemovedDueToOpPhiAtMerge) { - std::string shader = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" - OpExecutionMode %4 OriginUpperLeft - OpSource ESSL 320 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %10 = OpTypeBool - %11 = OpConstantTrue %10 - %4 = OpFunction %2 None %3 - %5 = OpLabel - OpSelectionMerge %13 None - OpBranchConditional %11 %12 %13 - %12 = OpLabel - OpBranch %13 - %13 = OpLabel - %101 = OpPhi %10 %11 %5 %11 %12 - OpReturn - OpFunctionEnd - )"; - - const auto env = SPV_ENV_UNIVERSAL_1_3; - const auto context = BuildModule(env, nullptr, shader, kReduceAssembleOption); - const auto ops = StructuredConstructToBlockReductionOpportunityFinder() - .GetAvailableOpportunities(context.get(), 0); - ASSERT_TRUE(ops.empty()); -} - -} // namespace -} // namespace reduce -} // namespace spvtools diff --git a/test/text_to_binary.extension_test.cpp b/test/text_to_binary.extension_test.cpp index 1324206c..8c42f72c 100644 --- a/test/text_to_binary.extension_test.cpp +++ b/test/text_to_binary.extension_test.cpp @@ -935,103 +935,6 @@ INSTANTIATE_TEST_SUITE_P( MakeVector("SPV_KHR_expect_assume"))}, {"OpAssumeTrueKHR %1\n", MakeInstruction(SpvOpAssumeTrueKHR, {1})}}))); -// SPV_KHR_subgroup_uniform_control_flow - -INSTANTIATE_TEST_SUITE_P( - SPV_KHR_subgroup_uniform_control_flow, ExtensionRoundTripTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_3, - SPV_ENV_VULKAN_1_0, SPV_ENV_VULKAN_1_1, SPV_ENV_VULKAN_1_2), - ValuesIn(std::vector{ - {"OpExtension \"SPV_KHR_subgroup_uniform_control_flow\"\n", - MakeInstruction( - SpvOpExtension, - MakeVector("SPV_KHR_subgroup_uniform_control_flow"))}, - {"OpExecutionMode %1 SubgroupUniformControlFlowKHR\n", - MakeInstruction( - SpvOpExecutionMode, - {1, SpvExecutionModeSubgroupUniformControlFlowKHR})}, - }))); - -// SPV_KHR_integer_dot_product - -INSTANTIATE_TEST_SUITE_P( - SPV_KHR_integer_dot_product, ExtensionRoundTripTest, - Combine( - Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_5, SPV_ENV_VULKAN_1_0, - SPV_ENV_VULKAN_1_1, SPV_ENV_VULKAN_1_2), - ValuesIn(std::vector{ - {"OpExtension \"SPV_KHR_integer_dot_product\"\n", - MakeInstruction(SpvOpExtension, - MakeVector("SPV_KHR_integer_dot_product"))}, - {"OpCapability DotProductInputAllKHR\n", - MakeInstruction(SpvOpCapability, - {SpvCapabilityDotProductInputAllKHR})}, - {"OpCapability DotProductInput4x8BitKHR\n", - MakeInstruction(SpvOpCapability, - {SpvCapabilityDotProductInput4x8BitKHR})}, - {"OpCapability DotProductInput4x8BitPackedKHR\n", - MakeInstruction(SpvOpCapability, - {SpvCapabilityDotProductInput4x8BitPackedKHR})}, - {"OpCapability DotProductKHR\n", - MakeInstruction(SpvOpCapability, {SpvCapabilityDotProductKHR})}, - {"%2 = OpSDotKHR %1 %3 %4\n", - MakeInstruction(SpvOpSDotKHR, {1, 2, 3, 4})}, - {"%2 = OpSDotKHR %1 %3 %4 PackedVectorFormat4x8BitKHR\n", - MakeInstruction( - SpvOpSDotKHR, - {1, 2, 3, 4, - SpvPackedVectorFormatPackedVectorFormat4x8BitKHR})}, - {"%2 = OpUDotKHR %1 %3 %4\n", - MakeInstruction(SpvOpUDotKHR, {1, 2, 3, 4})}, - {"%2 = OpUDotKHR %1 %3 %4 PackedVectorFormat4x8BitKHR\n", - MakeInstruction( - SpvOpUDotKHR, - {1, 2, 3, 4, - SpvPackedVectorFormatPackedVectorFormat4x8BitKHR})}, - {"%2 = OpSUDotKHR %1 %3 %4\n", - MakeInstruction(SpvOpSUDotKHR, {1, 2, 3, 4})}, - {"%2 = OpSUDotKHR %1 %3 %4 PackedVectorFormat4x8BitKHR\n", - MakeInstruction( - SpvOpSUDotKHR, - {1, 2, 3, 4, - SpvPackedVectorFormatPackedVectorFormat4x8BitKHR})}, - {"%2 = OpSDotAccSatKHR %1 %3 %4 %5\n", - MakeInstruction(SpvOpSDotAccSatKHR, {1, 2, 3, 4, 5})}, - {"%2 = OpSDotAccSatKHR %1 %3 %4 %5 PackedVectorFormat4x8BitKHR\n", - MakeInstruction( - SpvOpSDotAccSatKHR, - {1, 2, 3, 4, 5, - SpvPackedVectorFormatPackedVectorFormat4x8BitKHR})}, - {"%2 = OpUDotAccSatKHR %1 %3 %4 %5\n", - MakeInstruction(SpvOpUDotAccSatKHR, {1, 2, 3, 4, 5})}, - {"%2 = OpUDotAccSatKHR %1 %3 %4 %5 PackedVectorFormat4x8BitKHR\n", - MakeInstruction( - SpvOpUDotAccSatKHR, - {1, 2, 3, 4, 5, - SpvPackedVectorFormatPackedVectorFormat4x8BitKHR})}, - {"%2 = OpSUDotAccSatKHR %1 %3 %4 %5\n", - MakeInstruction(SpvOpSUDotAccSatKHR, {1, 2, 3, 4, 5})}, - {"%2 = OpSUDotAccSatKHR %1 %3 %4 %5 PackedVectorFormat4x8BitKHR\n", - MakeInstruction( - SpvOpSUDotAccSatKHR, - {1, 2, 3, 4, 5, - SpvPackedVectorFormatPackedVectorFormat4x8BitKHR})}, - }))); - -// SPV_KHR_bit_instructions - -INSTANTIATE_TEST_SUITE_P( - SPV_KHR_bit_instructions, ExtensionRoundTripTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_5, - SPV_ENV_VULKAN_1_0, SPV_ENV_VULKAN_1_1, SPV_ENV_VULKAN_1_2), - ValuesIn(std::vector{ - {"OpExtension \"SPV_KHR_bit_instructions\"\n", - MakeInstruction(SpvOpExtension, - MakeVector("SPV_KHR_bit_instructions"))}, - {"OpCapability BitInstructions\n", - MakeInstruction(SpvOpCapability, - {SpvCapabilityBitInstructions})}, - }))); } // namespace } // namespace spvtools diff --git a/test/text_to_binary.mode_setting_test.cpp b/test/text_to_binary.mode_setting_test.cpp index 647bb3d9..8ddf4219 100644 --- a/test/text_to_binary.mode_setting_test.cpp +++ b/test/text_to_binary.mode_setting_test.cpp @@ -189,7 +189,6 @@ INSTANTIATE_TEST_SUITE_P( {CASE(OutputTriangleStrip), {}}, {CASE(VecTypeHint), {96}}, {CASE(ContractionOff), {}}, - {CASE(SubgroupUniformControlFlowKHR), {}}, }))); INSTANTIATE_TEST_SUITE_P( diff --git a/test/util/hash_combine_test.cpp b/test/util/hash_combine_test.cpp deleted file mode 100644 index 9cd1d870..00000000 --- a/test/util/hash_combine_test.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 2022 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include - -#include "gmock/gmock.h" -#include "source/util/hash_combine.h" - -namespace spvtools { -namespace utils { -namespace { - -using HashCombineTest = ::testing::Test; - -TEST(HashCombineTest, Identity) { EXPECT_EQ(hash_combine(0), 0); } - -TEST(HashCombineTest, Variadic) { - // Expect manual and variadic template versions be the same. - EXPECT_EQ(hash_combine(hash_combine(hash_combine(0, 1), 2), 3), - hash_combine(0, 1, 2, 3)); -} - -TEST(HashCombineTest, Vector) { - // Expect variadic and vector versions be the same. - EXPECT_EQ(hash_combine(0, std::vector({1, 2, 3})), - hash_combine(0, 1, 2, 3)); -} - -} // namespace -} // namespace utils -} // namespace spvtools diff --git a/test/util/pooled_linked_list_test.cpp b/test/util/pooled_linked_list_test.cpp deleted file mode 100644 index 82fb4acb..00000000 --- a/test/util/pooled_linked_list_test.cpp +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) 2021 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include -#include - -#include "gmock/gmock.h" -#include "source/util/pooled_linked_list.h" - -namespace spvtools { -namespace utils { -namespace { - -using PooledLinkedListTest = ::testing::Test; - -template -static std::vector ToVector(const PooledLinkedList& list) { - std::vector vec; - for (auto it = list.begin(); it != list.end(); ++it) { - vec.push_back(*it); - } - return vec; -} - -template -static void AppendVector(PooledLinkedList& list, const std::vector& vec) { - for (const T& t : vec) { - list.push_back(t); - } -} - -TEST(PooledLinkedListTest, Empty) { - PooledLinkedListNodes pool; - PooledLinkedList ll(&pool); - EXPECT_TRUE(ll.empty()); - - ll.push_back(1u); - EXPECT_TRUE(!ll.empty()); -} - -TEST(PooledLinkedListTest, Iterator) { - PooledLinkedListNodes pool; - PooledLinkedList ll(&pool); - - EXPECT_EQ(ll.begin(), ll.end()); - - ll.push_back(1); - EXPECT_NE(ll.begin(), ll.end()); - - auto it = ll.begin(); - EXPECT_EQ(*it, 1); - ++it; - EXPECT_EQ(it, ll.end()); -} - -TEST(PooledLinkedListTest, Iterator_algorithms) { - PooledLinkedListNodes pool; - PooledLinkedList ll(&pool); - - AppendVector(ll, {3, 2, 0, 1}); - EXPECT_EQ(std::distance(ll.begin(), ll.end()), 4); - EXPECT_EQ(*std::min_element(ll.begin(), ll.end()), 0); - EXPECT_EQ(*std::max_element(ll.begin(), ll.end()), 3); -} - -TEST(PooledLinkedListTest, FrontBack) { - PooledLinkedListNodes pool; - PooledLinkedList ll(&pool); - - ll.push_back(1); - EXPECT_EQ(ll.front(), 1); - EXPECT_EQ(ll.back(), 1); - - ll.push_back(2); - EXPECT_EQ(ll.front(), 1); - EXPECT_EQ(ll.back(), 2); -} - -TEST(PooledLinkedListTest, PushBack) { - const std::vector vec = {1, 2, 3, 4, 5, 6}; - - PooledLinkedListNodes pool; - PooledLinkedList ll(&pool); - - AppendVector(ll, vec); - EXPECT_EQ(vec, ToVector(ll)); -} - -TEST(PooledLinkedListTest, RemoveFirst) { - const std::vector vec = {1, 2, 3, 4, 5, 6}; - - PooledLinkedListNodes pool; - PooledLinkedList ll(&pool); - - EXPECT_FALSE(ll.remove_first(0)); - AppendVector(ll, vec); - EXPECT_FALSE(ll.remove_first(0)); - - std::vector tmp = vec; - while (!tmp.empty()) { - size_t mid = tmp.size() / 2; - uint32_t elt = tmp[mid]; - tmp.erase(tmp.begin() + mid); - - EXPECT_TRUE(ll.remove_first(elt)); - EXPECT_FALSE(ll.remove_first(elt)); - EXPECT_EQ(tmp, ToVector(ll)); - } - EXPECT_TRUE(ll.empty()); -} - -TEST(PooledLinkedListTest, RemoveFirst_Duplicates) { - const std::vector vec = {3, 1, 2, 3, 3, 3, 3, 4, 3, 5, 3, 6, 3}; - - PooledLinkedListNodes pool; - PooledLinkedList ll(&pool); - AppendVector(ll, vec); - - std::vector tmp = vec; - while (!tmp.empty()) { - size_t mid = tmp.size() / 2; - uint32_t elt = tmp[mid]; - tmp.erase(std::find(tmp.begin(), tmp.end(), elt)); - - EXPECT_TRUE(ll.remove_first(elt)); - EXPECT_EQ(tmp, ToVector(ll)); - } - EXPECT_TRUE(ll.empty()); -} - -TEST(PooledLinkedList, MoveTo) { - const std::vector vec = {1, 2, 3, 4, 5, 6}; - - PooledLinkedListNodes pool; - PooledLinkedList ll1(&pool); - PooledLinkedList ll2(&pool); - PooledLinkedList ll3(&pool); - - AppendVector(ll1, vec); - AppendVector(ll2, vec); - AppendVector(ll3, vec); - EXPECT_EQ(pool.total_nodes(), vec.size() * 3); - EXPECT_EQ(pool.total_nodes(), vec.size() * 3); - EXPECT_EQ(pool.free_nodes(), 0); - - // Move two lists to the new pool - PooledLinkedListNodes pool_new; - ll1.move_nodes(&pool_new); - ll2.move_nodes(&pool_new); - - // Moved nodes should belong to new pool - EXPECT_EQ(ll1.pool(), &pool_new); - EXPECT_EQ(ll2.pool(), &pool_new); - - // Old pool should be smaller & have free nodes. - EXPECT_EQ(pool.used_nodes(), vec.size()); - EXPECT_EQ(pool.free_nodes(), vec.size() * 2); - - // New pool should be sized exactly and no free nodes. - EXPECT_EQ(pool_new.total_nodes(), vec.size() * 2); - EXPECT_EQ(pool_new.used_nodes(), vec.size() * 2); - EXPECT_EQ(pool_new.free_nodes(), 0); - - // All lists should be preserved - EXPECT_EQ(ToVector(ll1), vec); - EXPECT_EQ(ToVector(ll2), vec); - EXPECT_EQ(ToVector(ll3), vec); -} - -} // namespace -} // namespace utils -} // namespace spvtools diff --git a/test/val/CMakeLists.txt b/test/val/CMakeLists.txt index 39f9a098..4aec2497 100644 --- a/test/val/CMakeLists.txt +++ b/test/val/CMakeLists.txt @@ -40,12 +40,8 @@ add_spvtools_unittest(TARGET val_abcde val_extensions_test.cpp val_extension_spv_khr_expect_assume.cpp val_extension_spv_khr_linkonce_odr.cpp - val_extension_spv_khr_subgroup_uniform_control_flow.cpp - val_extension_spv_khr_integer_dot_product.cpp - val_extension_spv_khr_bit_instructions.cpp val_extension_spv_khr_terminate_invocation.cpp val_ext_inst_test.cpp - val_ext_inst_debug_test.cpp ${VAL_TEST_COMMON_SRCS} LIBS ${SPIRV_TOOLS_FULL_VISIBILITY} PCH_FILE pch_test_val diff --git a/test/val/val_annotation_test.cpp b/test/val/val_annotation_test.cpp deleted file mode 100644 index bb30de0a..00000000 --- a/test/val/val_annotation_test.cpp +++ /dev/null @@ -1,955 +0,0 @@ -// Copyright (c) 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Validation tests for decorations - -#include -#include - -#include "gmock/gmock.h" -#include "test/test_fixture.h" -#include "test/unit_spirv.h" -#include "test/val/val_code_generator.h" -#include "test/val/val_fixtures.h" - -namespace spvtools { -namespace val { -namespace { - -using ::testing::Combine; -using ::testing::Eq; -using ::testing::HasSubstr; -using ::testing::Values; - -using DecorationTest = spvtest::ValidateBase; - -TEST_F(DecorationTest, WorkgroupSizeShader) { - const std::string text = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -OpDecorate %ones BuiltIn WorkgroupSize -%int = OpTypeInt 32 0 -%int3 = OpTypeVector %int 3 -%int_1 = OpConstant %int 1 -%ones = OpConstantComposite %int3 %int_1 %int_1 %int_1 -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(DecorationTest, WorkgroupSizeKernel) { - const std::string text = R"( -OpCapability Kernel -OpCapability Linkage -OpMemoryModel Logical OpenCL -OpDecorate %var BuiltIn WorkgroupSize -%int = OpTypeInt 32 0 -%int3 = OpTypeVector %int 3 -%ptr = OpTypePointer Input %int3 -%var = OpVariable %ptr Input -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -using MemberOnlyDecorations = spvtest::ValidateBase; - -TEST_P(MemberOnlyDecorations, MemberDecoration) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -OpMemberDecorate %struct 0 )" + - deco + R"( -%float = OpTypeFloat 32 -%float2 = OpTypeVector %float 2 -%float2x2 = OpTypeMatrix %float2 2 -%struct = OpTypeStruct %float2x2 -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(MemberOnlyDecorations, Decoration) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -OpDecorate %struct )" + deco + - R"( -%float = OpTypeFloat 32 -%float2 = OpTypeVector %float 2 -%float2x2 = OpTypeMatrix %float2 2 -%struct = OpTypeStruct %float2x2 -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("can only be applied to structure members")); -} - -INSTANTIATE_TEST_SUITE_P(ValidateMemberOnlyDecorations, MemberOnlyDecorations, - Values("RowMajor", "ColMajor", "MatrixStride 16" - // SPIR-V spec bug? - /*,"Offset 0"*/)); - -using NonMemberOnlyDecorations = spvtest::ValidateBase; - -TEST_P(NonMemberOnlyDecorations, MemberDecoration) { - const auto deco = GetParam(); - const auto text = R"( -OpCapability Shader -OpCapability Kernel -OpCapability Linkage -OpCapability InputAttachment -OpCapability Addresses -OpCapability PhysicalStorageBufferAddresses -OpCapability ShaderNonUniform -OpExtension "SPV_KHR_no_integer_wrap_decoration" -OpExtension "SPV_KHR_physical_storage_buffer" -OpExtension "SPV_GOOGLE_hlsl_functionality1" -OpExtension "SPV_EXT_descriptor_indexing" -OpMemoryModel Logical GLSL450 -OpMemberDecorate %struct 0 )" + - deco + R"( -%float = OpTypeFloat 32 -%float2 = OpTypeVector %float 2 -%float2x2 = OpTypeMatrix %float2 2 -%struct = OpTypeStruct %float2x2 -)"; - - CompileSuccessfully(text, SPV_ENV_UNIVERSAL_1_3); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3)); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("cannot be applied to structure members")); -} - -INSTANTIATE_TEST_SUITE_P( - ValidateNonMemberOnlyDecorations, NonMemberOnlyDecorations, - Values("SpecId 1", "Block", "BufferBlock", "ArrayStride 4", "GLSLShared", - "GLSLPacked", "CPacked", - // TODO: https://github.com/KhronosGroup/glslang/issues/703: - // glslang applies Restrict to structure members. - //"Restrict", - "Aliased", "Constant", "Uniform", "SaturatedConversion", "Index 0", - "Binding 0", "DescriptorSet 0", "FuncParamAttr Zext", - "FPRoundingMode RTE", "FPFastMathMode None", - "LinkageAttributes \"ext\" Import", "NoContraction", - "InputAttachmentIndex 0", "Alignment 4", "MaxByteOffset 4", - "AlignmentId %float", "MaxByteOffsetId %float", "NoSignedWrap", - "NoUnsignedWrap", "NonUniform", "RestrictPointer", "AliasedPointer", - "CounterBuffer %float")); - -using StructDecorations = spvtest::ValidateBase; - -TEST_P(StructDecorations, Struct) { - const std::string deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Kernel -OpCapability Linkage -OpMemoryModel Logical GLSL450 -OpDecorate %struct )" + deco + - R"( -%struct = OpTypeStruct -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(StructDecorations, OtherType) { - const std::string deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Kernel -OpCapability Linkage -OpMemoryModel Logical GLSL450 -OpDecorate %int )" + deco + R"( -%int = OpTypeInt 32 0 -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("must be a structure type")); -} - -TEST_P(StructDecorations, Variable) { - const std::string deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Kernel -OpCapability Linkage -OpMemoryModel Logical GLSL450 -OpDecorate %var )" + deco + R"( -%int = OpTypeInt 32 0 -%ptr = OpTypePointer Private %int -%var = OpVariable %ptr Private -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("must be a structure type")); -} - -TEST_P(StructDecorations, FunctionParameter) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Kernel -OpCapability Linkage -OpMemoryModel Logical GLSL450 -OpDecorate %func LinkageAttributes "import" Import -OpDecorate %param )" + deco + - R"( -%int = OpTypeInt 32 0 -%void = OpTypeVoid -%fn = OpTypeFunction %void %int -%func = OpFunction %void None %fn -%param = OpFunctionParameter %int -OpFunctionEnd -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("must be a structure type")); -} - -TEST_P(StructDecorations, Constant) { - const std::string deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Kernel -OpCapability Linkage -OpMemoryModel Logical GLSL450 -OpDecorate %int_0 )" + deco + - R"( -%int = OpTypeInt 32 0 -%int_0 = OpConstant %int 0 -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("must be a structure type")); -} - -INSTANTIATE_TEST_SUITE_P(ValidateStructDecorations, StructDecorations, - Values("Block", "BufferBlock", "GLSLShared", - "GLSLPacked", "CPacked")); - -using ArrayDecorations = spvtest::ValidateBase; - -TEST_P(ArrayDecorations, Array) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -OpDecorate %array )" + deco + - R"( -%int = OpTypeInt 32 0 -%int_4 = OpConstant %int 4 -%array = OpTypeArray %int %int_4 -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ArrayDecorations, RuntimeArray) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -OpDecorate %array )" + deco + - R"( -%int = OpTypeInt 32 0 -%array = OpTypeRuntimeArray %int -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ArrayDecorations, Pointer) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -OpDecorate %ptr )" + deco + R"( -%int = OpTypeInt 32 0 -%ptr = OpTypePointer Workgroup %int -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ArrayDecorations, Struct) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -OpDecorate %struct )" + deco + - R"( -%int = OpTypeInt 32 0 -%struct = OpTypeStruct %int -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("must be an array or pointer type")); -} - -TEST_P(ArrayDecorations, Variable) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -OpDecorate %var )" + deco + R"( -%int = OpTypeInt 32 0 -%ptr = OpTypePointer Private %int -%var = OpVariable %ptr Private -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("must be an array or pointer type")); -} - -TEST_P(ArrayDecorations, FunctionParameter) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -OpDecorate %func LinkageAttributes "import" Import -OpDecorate %param )" + deco + - R"( -%int = OpTypeInt 32 0 -%void = OpTypeVoid -%fn = OpTypeFunction %void %int -%func = OpFunction %void None %fn -%param = OpFunctionParameter %int -OpFunctionEnd -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("must be an array or pointer type")); -} - -TEST_P(ArrayDecorations, Constant) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -OpDecorate %null )" + deco + - R"( -%int = OpTypeInt 32 0 -%int_4 = OpConstant %int 4 -%array = OpTypeArray %int %int_4 -%null = OpConstantNull %array -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("must be an array or pointer type")); -} - -INSTANTIATE_TEST_SUITE_P(ValidateArrayDecorations, ArrayDecorations, - Values("ArrayStride 4")); - -using BuiltInDecorations = spvtest::ValidateBase; - -TEST_P(BuiltInDecorations, Variable) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -OpDecorate %var BuiltIn )" + - deco + R"( -%int = OpTypeInt 32 0 -%ptr = OpTypePointer Input %int -%var = OpVariable %ptr Input -)"; - - CompileSuccessfully(text); - if (deco != "WorkgroupSize") { - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); - } else { - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("must be a constant for WorkgroupSize")); - } -} - -TEST_P(BuiltInDecorations, IntegerType) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -OpDecorate %int BuiltIn )" + - deco + R"( -%int = OpTypeInt 32 0 -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("BuiltIns can only target variables, structure members " - "or constants")); -} - -TEST_P(BuiltInDecorations, FunctionParameter) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -OpDecorate %func LinkageAttributes "import" Import -OpDecorate %param BuiltIn )" + - deco + R"( -%int = OpTypeInt 32 0 -%void = OpTypeVoid -%fn = OpTypeFunction %void %int -%func = OpFunction %void None %fn -%param = OpFunctionParameter %int -OpFunctionEnd -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("BuiltIns can only target variables, structure members " - "or constants")); -} - -TEST_P(BuiltInDecorations, Constant) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -OpDecorate %const BuiltIn )" + - deco + R"( -%int = OpTypeInt 32 0 -%int3 = OpTypeVector %int 3 -%int_1 = OpConstant %int 1 -%const = OpConstantComposite %int3 %int_1 %int_1 %int_1 -)"; - - CompileSuccessfully(text); - if (deco == "WorkgroupSize") { - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); - } else { - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("must be a variable")); - } -} - -TEST_P(BuiltInDecorations, SpecConstant) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -OpDecorate %const BuiltIn )" + - deco + R"( -%int = OpTypeInt 32 0 -%int3 = OpTypeVector %int 3 -%int_1 = OpConstant %int 1 -%const = OpSpecConstantComposite %int3 %int_1 %int_1 %int_1 -)"; - - CompileSuccessfully(text); - if (deco == "WorkgroupSize") { - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); - } else { - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("must be a variable")); - } -} - -INSTANTIATE_TEST_SUITE_P(ValidateBuiltInDecorations, BuiltInDecorations, - Values("Position", "PointSize", "VertexId", - "InstanceId", "FragCoord", "FrontFacing", - "NumWorkgroups", "WorkgroupSize", - "LocalInvocationId", "GlobalInvocationId")); - -using MemoryObjectDecorations = spvtest::ValidateBase; - -TEST_P(MemoryObjectDecorations, Variable) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Linkage -OpCapability SampleRateShading -OpCapability TransformFeedback -OpCapability GeometryStreams -OpCapability Tessellation -OpCapability PhysicalStorageBufferAddresses -OpExtension "SPV_KHR_physical_storage_buffer" -OpMemoryModel Logical GLSL450 -OpDecorate %var )" + deco + R"( -%float = OpTypeFloat 32 -%ptr = OpTypePointer Input %float -%var = OpVariable %ptr Input -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(MemoryObjectDecorations, FunctionParameterGood) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Linkage -OpCapability SampleRateShading -OpCapability TransformFeedback -OpCapability GeometryStreams -OpCapability Tessellation -OpCapability PhysicalStorageBufferAddresses -OpExtension "SPV_KHR_physical_storage_buffer" -OpMemoryModel Logical GLSL450 -OpDecorate %func LinkageAttributes "import" Import -OpDecorate %param )" + deco + - R"( -%float = OpTypeFloat 32 -%ptr = OpTypePointer Input %float -%void = OpTypeVoid -%fn = OpTypeFunction %void %ptr -%func = OpFunction %void None %fn -%param = OpFunctionParameter %ptr -OpFunctionEnd -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(MemoryObjectDecorations, FunctionParameterNotAPointer) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Linkage -OpCapability SampleRateShading -OpCapability TransformFeedback -OpCapability GeometryStreams -OpCapability Tessellation -OpCapability PhysicalStorageBufferAddresses -OpExtension "SPV_KHR_physical_storage_buffer" -OpMemoryModel Logical GLSL450 -OpDecorate %func LinkageAttributes "import" Import -OpDecorate %param )" + deco + - R"( -%float = OpTypeFloat 32 -%void = OpTypeVoid -%fn = OpTypeFunction %void %float -%func = OpFunction %void None %fn -%param = OpFunctionParameter %float -OpFunctionEnd -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("must be a pointer type")); -} - -TEST_P(MemoryObjectDecorations, FloatType) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Linkage -OpCapability SampleRateShading -OpCapability TransformFeedback -OpCapability GeometryStreams -OpCapability Tessellation -OpCapability PhysicalStorageBufferAddresses -OpExtension "SPV_KHR_physical_storage_buffer" -OpMemoryModel Logical GLSL450 -OpDecorate %float )" + deco + - R"( -%float = OpTypeFloat 32 -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("must be a memory object declaration")); -} - -TEST_P(MemoryObjectDecorations, Constant) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Linkage -OpCapability SampleRateShading -OpCapability TransformFeedback -OpCapability GeometryStreams -OpCapability Tessellation -OpCapability PhysicalStorageBufferAddresses -OpExtension "SPV_KHR_physical_storage_buffer" -OpMemoryModel Logical GLSL450 -OpDecorate %const )" + deco + - R"( -%float = OpTypeFloat 32 -%const = OpConstant %float 0 -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("must be a memory object declaration")); -} - -// NonWritable and NonReadable are covered by other tests. -INSTANTIATE_TEST_SUITE_P( - ValidateMemoryObjectDecorations, MemoryObjectDecorations, - Values("NoPerspective", "Flat", "Patch", "Centroid", "Component 0", - "Sample", "Restrict", "Aliased", "Volatile", "Coherent", "Stream 0", - "XfbBuffer 1", "XfbStride 1", "AliasedPointer", "RestrictPointer")); - -using VariableDecorations = spvtest::ValidateBase; - -TEST_P(VariableDecorations, Variable) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Kernel -OpCapability Linkage -OpCapability InputAttachment -OpMemoryModel Logical GLSL450 -OpDecorate %var )" + deco + R"( -%float = OpTypeFloat 32 -%ptr = OpTypePointer Input %float -%var = OpVariable %ptr Input -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(VariableDecorations, FunctionParameter) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Kernel -OpCapability Linkage -OpCapability InputAttachment -OpMemoryModel Logical GLSL450 -OpDecorate %func LinkageAttributes "import" Import -OpDecorate %param )" + deco + - R"( -%float = OpTypeFloat 32 -%void = OpTypeVoid -%fn = OpTypeFunction %void %float -%func = OpFunction %void None %fn -%param = OpFunctionParameter %float -OpFunctionEnd -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("must be a variable")); -} - -TEST_P(VariableDecorations, FloatType) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Kernel -OpCapability Linkage -OpCapability InputAttachment -OpMemoryModel Logical GLSL450 -OpDecorate %float )" + deco + - R"( -%float = OpTypeFloat 32 -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("must be a variable")); -} - -TEST_P(VariableDecorations, Constant) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability Kernel -OpCapability Linkage -OpCapability InputAttachment -OpMemoryModel Logical GLSL450 -OpDecorate %const )" + deco + - R"( -%float = OpTypeFloat 32 -%const = OpConstant %float 0 -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("must be a variable")); -} - -INSTANTIATE_TEST_SUITE_P(ValidateVariableDecorations, VariableDecorations, - Values("Invariant", "Constant", "Location 0", - "Index 0", "Binding 0", "DescriptorSet 0")); - -using VulkanIOStorageClass = - spvtest::ValidateBase>; - -TEST_P(VulkanIOStorageClass, Invalid) { - const auto deco = std::get<0>(GetParam()); - const auto sc = std::get<1>(GetParam()); - const std::string text = R"( -OpCapability Shader -OpExtension "SPV_KHR_storage_buffer_storage_class" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" -OpExecutionMode %main OriginUpperLeft -OpDecorate %var )" + deco + R"( 0 -%void = OpTypeVoid -%float = OpTypeFloat 32 -%ptr = OpTypePointer )" + - sc + - R"( %float -%var = OpVariable %ptr )" + sc + - R"( -%void_fn = OpTypeFunction %void -%main = OpFunction %void None %void_fn -%entry = OpLabel -OpReturn -OpFunctionEnd -)"; - - CompileSuccessfully(text, SPV_ENV_VULKAN_1_0); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0)); - EXPECT_THAT(getDiagnosticString(), - AnyVUID("VUID-StandaloneSpirv-Location-06672")); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("decoration must not be applied to this storage class")); -} - -INSTANTIATE_TEST_SUITE_P(ValidateVulkanIOStorageClass, VulkanIOStorageClass, - Combine(Values("Location", "Component"), - Values("StorageBuffer", "Uniform", - "UniformConstant", "Workgroup", - "Private"))); - -using VulkanResourceStorageClass = - spvtest::ValidateBase>; - -TEST_P(VulkanResourceStorageClass, Invalid) { - const auto deco = std::get<0>(GetParam()); - const auto sc = std::get<1>(GetParam()); - const std::string text = R"( -OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" -OpExecutionMode %main OriginUpperLeft -OpDecorate %var )" + deco + R"( 0 -%void = OpTypeVoid -%float = OpTypeFloat 32 -%ptr = OpTypePointer )" + - sc + - R"( %float -%var = OpVariable %ptr )" + sc + - R"( -%void_fn = OpTypeFunction %void -%main = OpFunction %void None %void_fn -%entry = OpLabel -OpReturn -OpFunctionEnd -)"; - - CompileSuccessfully(text, SPV_ENV_VULKAN_1_0); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0)); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("VUID-StandaloneSpirv-DescriptorSet-06491")); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("must be in the StorageBuffer, Uniform, or " - "UniformConstant storage class")); -} - -INSTANTIATE_TEST_SUITE_P(ValidateVulkanResourceStorageClass, - VulkanResourceStorageClass, - Combine(Values("DescriptorSet", "Binding"), - Values("Private", "Input", "Output", - "Workgroup"))); - -using VulkanInterpolationStorageClass = spvtest::ValidateBase; - -TEST_P(VulkanInterpolationStorageClass, Input) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability SampleRateShading -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" -OpExecutionMode %main OriginUpperLeft -OpDecorate %var )" + deco + R"( -%void = OpTypeVoid -%float = OpTypeFloat 32 -%void_fn = OpTypeFunction %void -%ptr = OpTypePointer Input %float -%var = OpVariable %ptr Input -%main = OpFunction %void None %void_fn -%entry = OpLabel -OpReturn -OpFunctionEnd -)"; - - CompileSuccessfully(text, SPV_ENV_VULKAN_1_0); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); -} - -TEST_P(VulkanInterpolationStorageClass, Output) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability SampleRateShading -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %main "main" -OpDecorate %var )" + deco + R"( -%void = OpTypeVoid -%float = OpTypeFloat 32 -%void_fn = OpTypeFunction %void -%ptr = OpTypePointer Output %float -%var = OpVariable %ptr Output -%main = OpFunction %void None %void_fn -%entry = OpLabel -OpReturn -OpFunctionEnd -)"; - - CompileSuccessfully(text, SPV_ENV_VULKAN_1_0); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); -} - -TEST_P(VulkanInterpolationStorageClass, Private) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability SampleRateShading -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" -OpExecutionMode %main OriginUpperLeft -OpDecorate %var )" + deco + R"( -%void = OpTypeVoid -%float = OpTypeFloat 32 -%void_fn = OpTypeFunction %void -%ptr = OpTypePointer Private %float -%var = OpVariable %ptr Private -%main = OpFunction %void None %void_fn -%entry = OpLabel -OpReturn -OpFunctionEnd -)"; - - CompileSuccessfully(text, SPV_ENV_VULKAN_1_0); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0)); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("storage class must be Input or Output")); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("[VUID-StandaloneSpirv-Flat-04670")); -} - -TEST_P(VulkanInterpolationStorageClass, Uniform) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability SampleRateShading -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" -OpExecutionMode %main OriginUpperLeft -OpDecorate %var )" + deco + R"( -OpDecorate %var Binding 0 -OpDecorate %var DescriptorSet 0 -%void = OpTypeVoid -%float = OpTypeFloat 32 -%void_fn = OpTypeFunction %void -%ptr = OpTypePointer Uniform %float -%var = OpVariable %ptr Uniform -%main = OpFunction %void None %void_fn -%entry = OpLabel -OpReturn -OpFunctionEnd -)"; - - CompileSuccessfully(text, SPV_ENV_VULKAN_1_0); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0)); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("storage class must be Input or Output")); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("[VUID-StandaloneSpirv-Flat-04670")); -} - -TEST_P(VulkanInterpolationStorageClass, StorageBuffer) { - const auto deco = GetParam(); - const std::string text = R"( -OpCapability Shader -OpCapability SampleRateShading -OpExtension "SPV_KHR_storage_buffer_storage_class" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" -OpExecutionMode %main OriginUpperLeft -OpDecorate %var )" + deco + R"( -OpDecorate %var Binding 0 -OpDecorate %var DescriptorSet 0 -%void = OpTypeVoid -%float = OpTypeFloat 32 -%void_fn = OpTypeFunction %void -%ptr = OpTypePointer StorageBuffer %float -%var = OpVariable %ptr StorageBuffer -%main = OpFunction %void None %void_fn -%entry = OpLabel -OpReturn -OpFunctionEnd -)"; - - CompileSuccessfully(text, SPV_ENV_VULKAN_1_0); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0)); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("storage class must be Input or Output")); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("[VUID-StandaloneSpirv-Flat-04670")); -} - -INSTANTIATE_TEST_SUITE_P(ValidateVulkanInterpolationStorageClass, - VulkanInterpolationStorageClass, - Values("Flat", "NoPerspective", "Centroid", "Sample")); - -} // namespace -} // namespace val -} // namespace spvtools diff --git a/test/val/val_atomics_test.cpp b/test/val/val_atomics_test.cpp index b7f6948e..e2ca71fe 100644 --- a/test/val/val_atomics_test.cpp +++ b/test/val/val_atomics_test.cpp @@ -101,7 +101,7 @@ std::string GenerateShaderCode( OpEntryPoint Fragment %main "main" OpExecutionMode %main OriginUpperLeft )"; - const std::string definitions = R"( + const std::string defintions = R"( %u64 = OpTypeInt 64 0 %s64 = OpTypeInt 64 1 @@ -115,19 +115,19 @@ OpExecutionMode %main OriginUpperLeft )"; return GenerateShaderCodeImpl( body, "OpCapability Int64\n" + capabilities_and_extensions, - definitions + extra_defs, memory_model, execution); + defintions + extra_defs, + memory_model, execution); } std::string GenerateShaderComputeCode( const std::string& body, const std::string& capabilities_and_extensions = "", - const std::string& extra_defs = "", const std::string& memory_model = "GLSL450") { const std::string execution = R"( OpEntryPoint GLCompute %main "main" OpExecutionMode %main LocalSize 32 1 1 )"; - const std::string definitions = R"( + const std::string defintions = R"( %u64 = OpTypeInt 64 0 %s64 = OpTypeInt 64 1 @@ -140,8 +140,8 @@ OpExecutionMode %main LocalSize 32 1 1 %s64_var = OpVariable %s64_ptr Workgroup )"; return GenerateShaderCodeImpl( - body, "OpCapability Int64\n" + capabilities_and_extensions, - definitions + extra_defs, memory_model, execution); + body, "OpCapability Int64\n" + capabilities_and_extensions, defintions, + memory_model, execution); } std::string GenerateKernelCode( @@ -269,21 +269,6 @@ TEST_F(ValidateAtomics, AtomicLoadInt32VulkanSuccess) { ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); } -TEST_F(ValidateAtomics, AtomicLoadVulkanWrongStorageClass) { - const std::string body = R"( -%val1 = OpAtomicLoad %u32 %u32_var %device %relaxed -)"; - - CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0)); - EXPECT_THAT(getDiagnosticString(), - AnyVUID("VUID-StandaloneSpirv-None-04645")); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("in Vulkan evironment, Workgroup Storage Class is limited to " - "MeshNV, TaskNV, and GLCompute execution model")); -} - TEST_F(ValidateAtomics, AtomicAddIntVulkanWrongType1) { const std::string body = R"( %val1 = OpAtomicIAdd %f32 %f32_var %device %relaxed %f32_1 @@ -318,7 +303,7 @@ TEST_F(ValidateAtomics, AtomicAddFloatVulkan) { EXPECT_THAT( getDiagnosticString(), HasSubstr("Opcode AtomicFAddEXT requires one of these capabilities: " - "AtomicFloat32AddEXT AtomicFloat64AddEXT AtomicFloat16AddEXT")); + "AtomicFloat32AddEXT AtomicFloat64AddEXT")); } TEST_F(ValidateAtomics, AtomicMinFloatVulkan) { @@ -539,27 +524,6 @@ OpExtension "SPV_EXT_shader_atomic_float_min_max" "require the AtomicFloat32MinMaxEXT capability")); } -TEST_F(ValidateAtomics, AtomicAddFloat16VulkanSuccess) { - const std::string defs = R"( -%f16 = OpTypeFloat 16 -%f16_1 = OpConstant %f16 1 -%f16_ptr = OpTypePointer Workgroup %f16 -%f16_var = OpVariable %f16_ptr Workgroup -)"; - const std::string body = R"( -%val1 = OpAtomicFAddEXT %f16 %f16_var %device %relaxed %f16_1 -)"; - const std::string extra = R"( -OpCapability Float16 -OpCapability AtomicFloat16AddEXT -OpExtension "SPV_EXT_shader_atomic_float16_add" -)"; - - CompileSuccessfully(GenerateShaderComputeCode(body, extra, defs), - SPV_ENV_VULKAN_1_0); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); -} - TEST_F(ValidateAtomics, AtomicAddFloatVulkanSuccess) { const std::string body = R"( %val1 = OpAtomicFAddEXT %f32 %f32_var %device %relaxed %f32_1 @@ -570,8 +534,7 @@ OpCapability AtomicFloat32AddEXT OpExtension "SPV_EXT_shader_atomic_float_add" )"; - CompileSuccessfully(GenerateShaderComputeCode(body, extra), - SPV_ENV_VULKAN_1_0); + CompileSuccessfully(GenerateShaderCode(body, extra), SPV_ENV_VULKAN_1_0); ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); } @@ -591,8 +554,7 @@ OpCapability AtomicFloat16MinMaxEXT OpExtension "SPV_EXT_shader_atomic_float_min_max" )"; - CompileSuccessfully(GenerateShaderComputeCode(body, extra, defs), - SPV_ENV_VULKAN_1_0); + CompileSuccessfully(GenerateShaderCode(body, extra, defs), SPV_ENV_VULKAN_1_0); ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); } @@ -612,8 +574,7 @@ OpCapability AtomicFloat16MinMaxEXT OpExtension "SPV_EXT_shader_atomic_float_min_max" )"; - CompileSuccessfully(GenerateShaderComputeCode(body, extra, defs), - SPV_ENV_VULKAN_1_0); + CompileSuccessfully(GenerateShaderCode(body, extra, defs), SPV_ENV_VULKAN_1_0); ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); } @@ -626,8 +587,7 @@ OpCapability AtomicFloat32MinMaxEXT OpExtension "SPV_EXT_shader_atomic_float_min_max" )"; - CompileSuccessfully(GenerateShaderComputeCode(body, extra), - SPV_ENV_VULKAN_1_0); + CompileSuccessfully(GenerateShaderCode(body, extra), SPV_ENV_VULKAN_1_0); ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); } @@ -640,8 +600,7 @@ OpCapability AtomicFloat32MinMaxEXT OpExtension "SPV_EXT_shader_atomic_float_min_max" )"; - CompileSuccessfully(GenerateShaderComputeCode(body, extra), - SPV_ENV_VULKAN_1_0); + CompileSuccessfully(GenerateShaderCode(body, extra), SPV_ENV_VULKAN_1_0); ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); } @@ -661,8 +620,7 @@ OpCapability AtomicFloat64MinMaxEXT OpExtension "SPV_EXT_shader_atomic_float_min_max" )"; - CompileSuccessfully(GenerateShaderComputeCode(body, extra, defs), - SPV_ENV_VULKAN_1_0); + CompileSuccessfully(GenerateShaderCode(body, extra, defs), SPV_ENV_VULKAN_1_0); ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); } @@ -682,8 +640,7 @@ OpCapability AtomicFloat64MinMaxEXT OpExtension "SPV_EXT_shader_atomic_float_min_max" )"; - CompileSuccessfully(GenerateShaderComputeCode(body, extra, defs), - SPV_ENV_VULKAN_1_0); + CompileSuccessfully(GenerateShaderCode(body, extra, defs), SPV_ENV_VULKAN_1_0); ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); } @@ -697,27 +654,12 @@ TEST_F(ValidateAtomics, AtomicLoadFloatVulkan) { ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); } -TEST_F(ValidateAtomics, AtomicStoreVulkanWrongStorageClass) { - const std::string body = R"( -OpAtomicStore %f32_var %device %relaxed %f32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0)); - EXPECT_THAT(getDiagnosticString(), - AnyVUID("VUID-StandaloneSpirv-None-04645")); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("in Vulkan evironment, Workgroup Storage Class is limited to " - "MeshNV, TaskNV, and GLCompute execution model")); -} - TEST_F(ValidateAtomics, AtomicStoreFloatVulkan) { const std::string body = R"( OpAtomicStore %f32_var %device %relaxed %f32_1 )"; - CompileSuccessfully(GenerateShaderComputeCode(body), SPV_ENV_VULKAN_1_0); + CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0); ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); } @@ -726,7 +668,7 @@ TEST_F(ValidateAtomics, AtomicExchangeFloatVulkan) { %val2 = OpAtomicExchange %f32 %f32_var %device %relaxed %f32_0 )"; - CompileSuccessfully(GenerateShaderComputeCode(body), SPV_ENV_VULKAN_1_0); + CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0); ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); } @@ -961,9 +903,8 @@ OpAtomicStore %u64_var %device %relaxed %u64_1 OpAtomicStore %s64_var %device %relaxed %s64_1 )"; - CompileSuccessfully( - GenerateShaderComputeCode(body, "OpCapability Int64Atomics\n"), - SPV_ENV_VULKAN_1_0); + CompileSuccessfully(GenerateShaderCode(body, "OpCapability Int64Atomics\n"), + SPV_ENV_VULKAN_1_0); ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); } @@ -1066,7 +1007,7 @@ OpAtomicStore %u32_var %device %release %u32_1 OpAtomicStore %u32_var %invocation %relaxed %u32_1 )"; - CompileSuccessfully(GenerateShaderComputeCode(body), SPV_ENV_VULKAN_1_0); + CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0); ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); } @@ -2356,7 +2297,7 @@ OpCapability VulkanMemoryModelKHR OpExtension "SPV_KHR_vulkan_memory_model" )"; - CompileSuccessfully(GenerateShaderComputeCode(body, extra, "", "VulkanKHR"), + CompileSuccessfully(GenerateShaderCode(body, extra, "", "VulkanKHR"), SPV_ENV_VULKAN_1_1); EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_1)); } diff --git a/test/val/val_builtins_test.cpp b/test/val/val_builtins_test.cpp index 84952645..2116fff2 100644 --- a/test/val/val_builtins_test.cpp +++ b/test/val/val_builtins_test.cpp @@ -767,18 +767,18 @@ INSTANTIATE_TEST_SUITE_P( INSTANTIATE_TEST_SUITE_P( ComputeShaderInputInt32Vec3NotGLCompute, ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, - Combine(Values("GlobalInvocationId", "LocalInvocationId", "NumWorkgroups", - "WorkgroupId"), - Values("Vertex", "Fragment", "Geometry", "TessellationControl", - "TessellationEvaluation"), - Values("Input"), Values("%u32vec3"), - Values("VUID-GlobalInvocationId-GlobalInvocationId-04236 " - "VUID-LocalInvocationId-LocalInvocationId-04281 " - "VUID-NumWorkgroups-NumWorkgroups-04296 " - "VUID-WorkgroupId-WorkgroupId-04422"), - Values(TestResult(SPV_ERROR_INVALID_DATA, - "to be used only with GLCompute, MeshNV, or " - "TaskNV execution model")))); + Combine( + Values("GlobalInvocationId", "LocalInvocationId", "NumWorkgroups", + "WorkgroupId"), + Values("Vertex", "Fragment", "Geometry", "TessellationControl", + "TessellationEvaluation"), + Values("Input"), Values("%u32vec3"), + Values("VUID-GlobalInvocationId-GlobalInvocationId-04236 " + "VUID-LocalInvocationId-LocalInvocationId-04281 " + "VUID-NumWorkgroups-NumWorkgroups-04296 " + "VUID-WorkgroupId-WorkgroupId-04422"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "to be used only with GLCompute execution model")))); INSTANTIATE_TEST_SUITE_P( ComputeShaderInputInt32Vec3NotInput, @@ -2828,10 +2828,9 @@ TEST_F(ValidateBuiltIns, VulkanWorkgroupSizeFragment) { CompileSuccessfully(generator.Build(), SPV_ENV_VULKAN_1_0); ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("Vulkan spec allows BuiltIn WorkgroupSize to be used " - "only with GLCompute, MeshNV, or TaskNV execution model")); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Vulkan spec allows BuiltIn WorkgroupSize to be used " + "only with GLCompute execution model")); EXPECT_THAT(getDiagnosticString(), HasSubstr("is referencing ID <2> (OpConstantComposite) which is " "decorated with BuiltIn WorkgroupSize in function <1> " @@ -3712,13 +3711,13 @@ OpFunctionEnd INSTANTIATE_TEST_SUITE_P( SubgroupNumAndIdNotCompute, ValidateVulkanSubgroupBuiltIns, - Combine(Values("SubgroupId", "NumSubgroups"), Values("Vertex"), - Values("Input"), Values("%u32"), - Values("VUID-SubgroupId-SubgroupId-04367 " - "VUID-NumSubgroups-NumSubgroups-04293"), - Values(TestResult(SPV_ERROR_INVALID_DATA, - "to be used only with GLCompute, MeshNV, or " - "TaskNV execution model")))); + Combine( + Values("SubgroupId", "NumSubgroups"), Values("Vertex"), Values("Input"), + Values("%u32"), + Values("VUID-SubgroupId-SubgroupId-04367 " + "VUID-NumSubgroups-NumSubgroups-04293"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "to be used only with GLCompute execution model")))); INSTANTIATE_TEST_SUITE_P( SubgroupNumAndIdNotU32, ValidateVulkanSubgroupBuiltIns, diff --git a/test/val/val_cfg_test.cpp b/test/val/val_cfg_test.cpp index 6ae2ee6d..9715a5a2 100644 --- a/test/val/val_cfg_test.cpp +++ b/test/val/val_cfg_test.cpp @@ -4364,41 +4364,6 @@ TEST_F(ValidateCFG, PhiOnVoid) { HasSubstr("OpPhi must not have void result type")); } -TEST_F(ValidateCFG, InvalidExitSingleBlockLoop) { - const std::string text = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -OpName %5 "BAD" -%void = OpTypeVoid -%bool = OpTypeBool -%undef = OpUndef %bool -%void_fn = OpTypeFunction %void -%fn = OpFunction %void None %void_fn -%1 = OpLabel -OpBranch %2 -%2 = OpLabel -OpLoopMerge %3 %4 None -OpBranchConditional %undef %3 %5 -%5 = OpLabel -OpLoopMerge %6 %5 None -OpBranchConditional %undef %5 %4 -%6 = OpLabel -OpReturn -%4 = OpLabel -OpBranch %2 -%3 = OpLabel -OpReturn -OpFunctionEnd -)"; - - CompileSuccessfully(text); - EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("block 1[%BAD] exits the continue headed by " - "1[%BAD], but not via a structured exit")); -} - } // namespace } // namespace val } // namespace spvtools diff --git a/test/val/val_composites_test.cpp b/test/val/val_composites_test.cpp index 507ee889..bf7caa9f 100644 --- a/test/val/val_composites_test.cpp +++ b/test/val/val_composites_test.cpp @@ -86,10 +86,10 @@ OpCapability Float64 %f32mat23_121212 = OpConstantComposite %f32mat23 %f32vec2_12 %f32vec2_12 %f32vec2_12 %f32vec2arr3 = OpTypeArray %f32vec2 %u32_3 -%f32vec2arr2 = OpTypeArray %f32vec2 %u32_2 +%f32vec2rarr = OpTypeRuntimeArray %f32vec2 %f32u32struct = OpTypeStruct %f32 %u32 -%big_struct = OpTypeStruct %f32 %f32vec4 %f32mat23 %f32vec2arr3 %f32vec2arr2 %f32u32struct +%big_struct = OpTypeStruct %f32 %f32vec4 %f32mat23 %f32vec2arr3 %f32vec2rarr %f32u32struct %ptr_big_struct = OpTypePointer Uniform %big_struct %var_big_struct = OpVariable %ptr_big_struct Uniform @@ -150,6 +150,7 @@ OpMemoryModel Logical GLSL450 ; uniform blockName { ; S s; ; bool cond; +; RunTimeArray arr; ; } %f32arr = OpTypeRuntimeArray %float @@ -160,7 +161,7 @@ OpMemoryModel Logical GLSL450 %_ptr_Function_vec4 = OpTypePointer Function %v4float %_ptr_Uniform_vec4 = OpTypePointer Uniform %v4float %struct_s = OpTypeStruct %int %array5_vec4 %int %array5_mat4x3 -%struct_blockName = OpTypeStruct %struct_s %int +%struct_blockName = OpTypeStruct %struct_s %int %f32arr %_ptr_Uniform_blockName = OpTypePointer Uniform %struct_blockName %_ptr_Uniform_struct_s = OpTypePointer Uniform %struct_s %_ptr_Uniform_array5_mat4x3 = OpTypePointer Uniform %array5_mat4x3 @@ -643,8 +644,8 @@ TEST_F(ValidateComposites, CompositeExtractSuccess) { %val12 = OpCompositeExtract %f32 %struct 2 2 1 %val13 = OpCompositeExtract %f32vec2 %struct 3 2 %val14 = OpCompositeExtract %f32 %struct 3 2 1 -%val15 = OpCompositeExtract %f32vec2 %struct 4 1 -%val16 = OpCompositeExtract %f32 %struct 4 0 1 +%val15 = OpCompositeExtract %f32vec2 %struct 4 100 +%val16 = OpCompositeExtract %f32 %struct 4 1000 1 %val17 = OpCompositeExtract %f32 %struct 5 0 %val18 = OpCompositeExtract %u32 %struct 5 1 )"; @@ -867,8 +868,8 @@ TEST_F(ValidateComposites, CompositeInsertSuccess) { %val12 = OpCompositeInsert %big_struct %f32_3 %struct 2 2 1 %val13 = OpCompositeInsert %big_struct %f32vec2_01 %struct 3 2 %val14 = OpCompositeInsert %big_struct %f32_3 %struct 3 2 1 -%val15 = OpCompositeInsert %big_struct %f32vec2_01 %struct 4 1 -%val16 = OpCompositeInsert %big_struct %f32_3 %struct 4 0 1 +%val15 = OpCompositeInsert %big_struct %f32vec2_01 %struct 4 100 +%val16 = OpCompositeInsert %big_struct %f32_3 %struct 4 1000 1 %val17 = OpCompositeInsert %big_struct %f32_3 %struct 5 0 %val18 = OpCompositeInsert %big_struct %u32_3 %struct 5 1 )"; @@ -1381,8 +1382,8 @@ TEST_F(ValidateComposites, CompositeExtractStructIndexOutOfBoundBad) { EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); EXPECT_THAT(getDiagnosticString(), HasSubstr("Index is out of bounds, can not find index 3 in the " - "structure '25'. This structure has 2 members. " - "Largest valid index is 1.")); + "structure '25'. This structure has 3 members. " + "Largest valid index is 2.")); } // Invalid. Index into a struct is larger than the number of struct members. @@ -1402,8 +1403,8 @@ TEST_F(ValidateComposites, CompositeInsertStructIndexOutOfBoundBad) { EXPECT_THAT( getDiagnosticString(), HasSubstr("Index is out of bounds, can not find index 3 in the structure " - " '25'. This structure has 2 members. Largest valid index " - "is 1.")); + " '25'. This structure has 3 members. Largest valid index " + "is 2.")); } // #1403: Ensure that the default spec constant value is not used to check the diff --git a/test/val/val_decoration_test.cpp b/test/val/val_decoration_test.cpp index b9a413e3..096fd172 100644 --- a/test/val/val_decoration_test.cpp +++ b/test/val/val_decoration_test.cpp @@ -7648,149 +7648,6 @@ TEST_F(ValidateDecorations, WorkgroupSingleBlockVariableBadLayout) { "member 0 at offset 1 is not aligned to 4")); } -TEST_F(ValidateDecorations, BadMatrixStrideUniform) { - const std::string spirv = R"( -OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint GLCompute %main "main" -OpExecutionMode %main LocalSize 1 1 1 -OpDecorate %block Block -OpMemberDecorate %block 0 Offset 0 -OpMemberDecorate %block 0 MatrixStride 3 -OpDecorate %var DescriptorSet 0 -OpDecorate %var Binding 0 -%void = OpTypeVoid -%float = OpTypeFloat 32 -%float4 = OpTypeVector %float 4 -%matrix4x4 = OpTypeMatrix %float4 4 -%block = OpTypeStruct %matrix4x4 -%block_ptr = OpTypePointer Uniform %block -%var = OpVariable %block_ptr Uniform -%void_fn = OpTypeFunction %void -%main = OpFunction %void None %void_fn -%entry = OpLabel -OpReturn -OpFunctionEnd -)"; - - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr( - "Structure id 2 decorated as Block for variable in Uniform storage " - "class must follow standard uniform buffer layout rules: member 0 is " - "a matrix with stride 3 not satisfying alignment to 16")); -} - -TEST_F(ValidateDecorations, BadMatrixStrideStorageBuffer) { - const std::string spirv = R"( -OpCapability Shader -OpExtension "SPV_KHR_storage_buffer_storage_class" -OpMemoryModel Logical GLSL450 -OpEntryPoint GLCompute %main "main" -OpExecutionMode %main LocalSize 1 1 1 -OpDecorate %block Block -OpMemberDecorate %block 0 Offset 0 -OpMemberDecorate %block 0 MatrixStride 3 -OpDecorate %var DescriptorSet 0 -OpDecorate %var Binding 0 -%void = OpTypeVoid -%float = OpTypeFloat 32 -%float4 = OpTypeVector %float 4 -%matrix4x4 = OpTypeMatrix %float4 4 -%block = OpTypeStruct %matrix4x4 -%block_ptr = OpTypePointer StorageBuffer %block -%var = OpVariable %block_ptr StorageBuffer -%void_fn = OpTypeFunction %void -%main = OpFunction %void None %void_fn -%entry = OpLabel -OpReturn -OpFunctionEnd -)"; - - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr( - "Structure id 2 decorated as Block for variable in StorageBuffer " - "storage class must follow standard storage buffer layout rules: " - "member 0 is a matrix with stride 3 not satisfying alignment to 16")); -} - -TEST_F(ValidateDecorations, BadMatrixStridePushConstant) { - const std::string spirv = R"( -OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint GLCompute %main "main" -OpExecutionMode %main LocalSize 1 1 1 -OpDecorate %block Block -OpMemberDecorate %block 0 Offset 0 -OpMemberDecorate %block 0 MatrixStride 3 -OpDecorate %var DescriptorSet 0 -OpDecorate %var Binding 0 -%void = OpTypeVoid -%float = OpTypeFloat 32 -%float4 = OpTypeVector %float 4 -%matrix4x4 = OpTypeMatrix %float4 4 -%block = OpTypeStruct %matrix4x4 -%block_ptr = OpTypePointer PushConstant %block -%var = OpVariable %block_ptr PushConstant -%void_fn = OpTypeFunction %void -%main = OpFunction %void None %void_fn -%entry = OpLabel -OpReturn -OpFunctionEnd -)"; - - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr( - "Structure id 2 decorated as Block for variable in PushConstant " - "storage class must follow standard storage buffer layout rules: " - "member 0 is a matrix with stride 3 not satisfying alignment to 16")); -} - -TEST_F(ValidateDecorations, BadMatrixStrideStorageBufferScalarLayout) { - const std::string spirv = R"( -OpCapability Shader -OpExtension "SPV_KHR_storage_buffer_storage_class" -OpMemoryModel Logical GLSL450 -OpEntryPoint GLCompute %main "main" -OpExecutionMode %main LocalSize 1 1 1 -OpDecorate %block Block -OpMemberDecorate %block 0 Offset 0 -OpMemberDecorate %block 0 MatrixStride 3 -OpDecorate %var DescriptorSet 0 -OpDecorate %var Binding 0 -%void = OpTypeVoid -%float = OpTypeFloat 32 -%float4 = OpTypeVector %float 4 -%matrix4x4 = OpTypeMatrix %float4 4 -%block = OpTypeStruct %matrix4x4 -%block_ptr = OpTypePointer StorageBuffer %block -%var = OpVariable %block_ptr StorageBuffer -%void_fn = OpTypeFunction %void -%main = OpFunction %void None %void_fn -%entry = OpLabel -OpReturn -OpFunctionEnd -)"; - - options_->scalar_block_layout = true; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr( - "Structure id 2 decorated as Block for variable in StorageBuffer " - "storage class must follow scalar storage buffer layout rules: " - "member 0 is a matrix with stride 3 not satisfying alignment to 4")); -} - } // namespace } // namespace val } // namespace spvtools diff --git a/test/val/val_ext_inst_debug_test.cpp b/test/val/val_ext_inst_debug_test.cpp deleted file mode 100644 index d3b9f038..00000000 --- a/test/val/val_ext_inst_debug_test.cpp +++ /dev/null @@ -1,5313 +0,0 @@ -// Copyright (c) 2017 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Tests validation rules of GLSL.450.std and OpenCL.std extended instructions. -// Doesn't test OpenCL.std vector size 2, 3, 4, 8 or 16 rules (not supported -// by standard SPIR-V). - -#include -#include -#include - -#include "gmock/gmock.h" -#include "test/unit_spirv.h" -#include "test/val/val_fixtures.h" - -namespace spvtools { -namespace val { -namespace { - -using ::testing::Eq; -using ::testing::HasSubstr; -using ::testing::Not; - -using ValidateOldDebugInfo = spvtest::ValidateBase; -using ValidateOpenCL100DebugInfo = spvtest::ValidateBase; -using ValidateXDebugInfo = spvtest::ValidateBase; -using ValidateLocalDebugInfoOutOfFunction = spvtest::ValidateBase; -using ValidateOpenCL100DebugInfoDebugTypedef = - spvtest::ValidateBase>; -using ValidateVulkan100DebugInfoDebugTypedef = - spvtest::ValidateBase>; -using ValidateOpenCL100DebugInfoDebugTypeEnum = - spvtest::ValidateBase>; -using ValidateVulkan100DebugInfoDebugTypeEnum = - spvtest::ValidateBase>; -using ValidateOpenCL100DebugInfoDebugTypeComposite = - spvtest::ValidateBase>; -using ValidateVulkan100DebugInfoDebugTypeComposite = - spvtest::ValidateBase>; -using ValidateOpenCL100DebugInfoDebugTypeMember = - spvtest::ValidateBase>; -using ValidateVulkan100DebugInfoDebugTypeMember = - spvtest::ValidateBase>; -using ValidateOpenCL100DebugInfoDebugTypeInheritance = - spvtest::ValidateBase>; -using ValidateOpenCL100DebugInfoDebugFunction = - spvtest::ValidateBase>; -using ValidateVulkan100DebugInfoDebugFunction = - spvtest::ValidateBase>; -using ValidateOpenCL100DebugInfoDebugFunctionDeclaration = - spvtest::ValidateBase>; -using ValidateVulkan100DebugInfoDebugFunctionDeclaration = - spvtest::ValidateBase>; -using ValidateOpenCL100DebugInfoDebugLexicalBlock = - spvtest::ValidateBase>; -using ValidateVulkan100DebugInfoDebugLexicalBlock = - spvtest::ValidateBase>; -using ValidateOpenCL100DebugInfoDebugLocalVariable = - spvtest::ValidateBase>; -using ValidateVulkan100DebugInfoDebugLocalVariable = - spvtest::ValidateBase>; -using ValidateOpenCL100DebugInfoDebugGlobalVariable = - spvtest::ValidateBase>; -using ValidateVulkan100DebugInfoDebugGlobalVariable = - spvtest::ValidateBase>; -using ValidateOpenCL100DebugInfoDebugDeclare = - spvtest::ValidateBase>; -using ValidateVulkan100DebugInfoDebugDeclare = - spvtest::ValidateBase>; -using ValidateOpenCL100DebugInfoDebugValue = - spvtest::ValidateBase>; -using ValidateVulkan100DebugInfoDebugValue = - spvtest::ValidateBase>; -using ValidateVulkan100DebugInfo = spvtest::ValidateBase; - -std::string GenerateShaderCodeForDebugInfo( - const std::string& op_string_instructions, - const std::string& op_const_instructions, - const std::string& debug_instructions_before_main, const std::string& body, - const std::string& capabilities_and_extensions = "", - const std::string& execution_model = "Fragment") { - std::ostringstream ss; - ss << R"( -OpCapability Shader -OpCapability Float16 -OpCapability Float64 -OpCapability Int16 -OpCapability Int64 -)"; - - ss << capabilities_and_extensions; - ss << "%extinst = OpExtInstImport \"GLSL.std.450\"\n"; - ss << "OpMemoryModel Logical GLSL450\n"; - ss << "OpEntryPoint " << execution_model << " %main \"main\"" - << " %f32_output" - << " %f32vec2_output" - << " %u32_output" - << " %u32vec2_output" - << " %u64_output" - << " %f32_input" - << " %f32vec2_input" - << " %u32_input" - << " %u32vec2_input" - << " %u64_input" - << "\n"; - if (execution_model == "Fragment") { - ss << "OpExecutionMode %main OriginUpperLeft\n"; - } - - ss << op_string_instructions; - - ss << R"( -%void = OpTypeVoid -%func = OpTypeFunction %void -%bool = OpTypeBool -%f16 = OpTypeFloat 16 -%f32 = OpTypeFloat 32 -%f64 = OpTypeFloat 64 -%u32 = OpTypeInt 32 0 -%s32 = OpTypeInt 32 1 -%u64 = OpTypeInt 64 0 -%s64 = OpTypeInt 64 1 -%u16 = OpTypeInt 16 0 -%s16 = OpTypeInt 16 1 -%f32vec2 = OpTypeVector %f32 2 -%f32vec3 = OpTypeVector %f32 3 -%f32vec4 = OpTypeVector %f32 4 -%f64vec2 = OpTypeVector %f64 2 -%f64vec3 = OpTypeVector %f64 3 -%f64vec4 = OpTypeVector %f64 4 -%u32vec2 = OpTypeVector %u32 2 -%u32vec3 = OpTypeVector %u32 3 -%s32vec2 = OpTypeVector %s32 2 -%u32vec4 = OpTypeVector %u32 4 -%s32vec4 = OpTypeVector %s32 4 -%u64vec2 = OpTypeVector %u64 2 -%s64vec2 = OpTypeVector %s64 2 -%f64mat22 = OpTypeMatrix %f64vec2 2 -%f32mat22 = OpTypeMatrix %f32vec2 2 -%f32mat23 = OpTypeMatrix %f32vec2 3 -%f32mat32 = OpTypeMatrix %f32vec3 2 -%f32mat33 = OpTypeMatrix %f32vec3 3 - -%f32_0 = OpConstant %f32 0 -%f32_1 = OpConstant %f32 1 -%f32_2 = OpConstant %f32 2 -%f32_3 = OpConstant %f32 3 -%f32_4 = OpConstant %f32 4 -%f32_h = OpConstant %f32 0.5 -%f32vec2_01 = OpConstantComposite %f32vec2 %f32_0 %f32_1 -%f32vec2_12 = OpConstantComposite %f32vec2 %f32_1 %f32_2 -%f32vec3_012 = OpConstantComposite %f32vec3 %f32_0 %f32_1 %f32_2 -%f32vec3_123 = OpConstantComposite %f32vec3 %f32_1 %f32_2 %f32_3 -%f32vec4_0123 = OpConstantComposite %f32vec4 %f32_0 %f32_1 %f32_2 %f32_3 -%f32vec4_1234 = OpConstantComposite %f32vec4 %f32_1 %f32_2 %f32_3 %f32_4 - -%f64_0 = OpConstant %f64 0 -%f64_1 = OpConstant %f64 1 -%f64_2 = OpConstant %f64 2 -%f64_3 = OpConstant %f64 3 -%f64vec2_01 = OpConstantComposite %f64vec2 %f64_0 %f64_1 -%f64vec3_012 = OpConstantComposite %f64vec3 %f64_0 %f64_1 %f64_2 -%f64vec4_0123 = OpConstantComposite %f64vec4 %f64_0 %f64_1 %f64_2 %f64_3 - -%f16_0 = OpConstant %f16 0 -%f16_1 = OpConstant %f16 1 -%f16_h = OpConstant %f16 0.5 - -%u32_0 = OpConstant %u32 0 -%u32_1 = OpConstant %u32 1 -%u32_2 = OpConstant %u32 2 -%u32_3 = OpConstant %u32 3 - -%s32_0 = OpConstant %s32 0 -%s32_1 = OpConstant %s32 1 -%s32_2 = OpConstant %s32 2 -%s32_3 = OpConstant %s32 3 - -%u64_0 = OpConstant %u64 0 -%u64_1 = OpConstant %u64 1 -%u64_2 = OpConstant %u64 2 -%u64_3 = OpConstant %u64 3 - -%s64_0 = OpConstant %s64 0 -%s64_1 = OpConstant %s64 1 -%s64_2 = OpConstant %s64 2 -%s64_3 = OpConstant %s64 3 -)"; - - ss << op_const_instructions; - - ss << R"( -%s32vec2_01 = OpConstantComposite %s32vec2 %s32_0 %s32_1 -%u32vec2_01 = OpConstantComposite %u32vec2 %u32_0 %u32_1 - -%s32vec2_12 = OpConstantComposite %s32vec2 %s32_1 %s32_2 -%u32vec2_12 = OpConstantComposite %u32vec2 %u32_1 %u32_2 - -%s32vec4_0123 = OpConstantComposite %s32vec4 %s32_0 %s32_1 %s32_2 %s32_3 -%u32vec4_0123 = OpConstantComposite %u32vec4 %u32_0 %u32_1 %u32_2 %u32_3 - -%s64vec2_01 = OpConstantComposite %s64vec2 %s64_0 %s64_1 -%u64vec2_01 = OpConstantComposite %u64vec2 %u64_0 %u64_1 - -%f32mat22_1212 = OpConstantComposite %f32mat22 %f32vec2_12 %f32vec2_12 -%f32mat23_121212 = OpConstantComposite %f32mat23 %f32vec2_12 %f32vec2_12 %f32vec2_12 - -%f32_ptr_output = OpTypePointer Output %f32 -%f32vec2_ptr_output = OpTypePointer Output %f32vec2 - -%u32_ptr_output = OpTypePointer Output %u32 -%u32vec2_ptr_output = OpTypePointer Output %u32vec2 - -%u64_ptr_output = OpTypePointer Output %u64 - -%f32_output = OpVariable %f32_ptr_output Output -%f32vec2_output = OpVariable %f32vec2_ptr_output Output - -%u32_output = OpVariable %u32_ptr_output Output -%u32vec2_output = OpVariable %u32vec2_ptr_output Output - -%u64_output = OpVariable %u64_ptr_output Output - -%f32_ptr_input = OpTypePointer Input %f32 -%f32vec2_ptr_input = OpTypePointer Input %f32vec2 - -%u32_ptr_input = OpTypePointer Input %u32 -%u32vec2_ptr_input = OpTypePointer Input %u32vec2 - -%u64_ptr_input = OpTypePointer Input %u64 - -%f32_ptr_function = OpTypePointer Function %f32 - -%f32_input = OpVariable %f32_ptr_input Input -%f32vec2_input = OpVariable %f32vec2_ptr_input Input - -%u32_input = OpVariable %u32_ptr_input Input -%u32vec2_input = OpVariable %u32vec2_ptr_input Input - -%u64_input = OpVariable %u64_ptr_input Input - -%u32_ptr_function = OpTypePointer Function %u32 - -%struct_f16_u16 = OpTypeStruct %f16 %u16 -%struct_f32_f32 = OpTypeStruct %f32 %f32 -%struct_f32_f32_f32 = OpTypeStruct %f32 %f32 %f32 -%struct_f32_u32 = OpTypeStruct %f32 %u32 -%struct_f32_u32_f32 = OpTypeStruct %f32 %u32 %f32 -%struct_u32_f32 = OpTypeStruct %u32 %f32 -%struct_u32_u32 = OpTypeStruct %u32 %u32 -%struct_f32_f64 = OpTypeStruct %f32 %f64 -%struct_f32vec2_f32vec2 = OpTypeStruct %f32vec2 %f32vec2 -%struct_f32vec2_u32vec2 = OpTypeStruct %f32vec2 %u32vec2 -)"; - - ss << debug_instructions_before_main; - - ss << R"( -%main = OpFunction %void None %func -%main_entry = OpLabel -)"; - - ss << body; - - ss << R"( -OpReturn -OpFunctionEnd)"; - - return ss.str(); -} - -TEST_F(ValidateOldDebugInfo, UseDebugInstructionOutOfFunction) { - const std::string src = R"( -%code = OpString "main() {}" -)"; - - const std::string dbg_inst = R"( -%cu = OpExtInst %void %DbgExt DebugCompilationUnit %code 1 1 -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "DebugInfo" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst, "", - extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateOpenCL100DebugInfo, UseDebugInstructionOutOfFunction) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -)"; - - const std::string dbg_inst = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst, "", - extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugSourceInFunction) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -)"; - - const std::string dbg_inst = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", "", dbg_inst, - extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("Debug info extension instructions other than DebugScope, " - "DebugNoScope, DebugDeclare, DebugValue must appear between " - "section 9 (types, constants, global variables) and section 10 " - "(function declarations)")); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugSourceInFunction) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -)"; - - const std::string dbg_inst = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", "", dbg_inst, - extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("Debug info extension instructions other than DebugScope, " - "DebugNoScope, DebugDeclare, DebugValue must appear between " - "section 9 (types, constants, global variables) and section 10 " - "(function declarations)")); -} - -TEST_P(ValidateLocalDebugInfoOutOfFunction, OpenCLDebugInfo100DebugScope) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() {}" -%void_name = OpString "void" -%main_name = OpString "main" -%main_linkage_name = OpString "v_main" -%int_name = OpString "int" -%foo_name = OpString "foo" -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%int_info = OpExtInst %void %DbgExt DebugTypeBasic %int_name %u32_0 Signed -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void -%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_linkage_name FlagIsPublic 1 %main -%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %int_info %dbg_src 1 1 %main_info FlagIsLocal -%expr = OpExtInst %void %DbgExt DebugExpression -)"; - - const std::string body = R"( -%foo = OpVariable %u32_ptr_function Function -%foo_val = OpLoad %u32 %foo -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, "", dbg_inst_header + GetParam(), body, extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("DebugScope, DebugNoScope, DebugDeclare, DebugValue " - "of debug info extension must appear in a function " - "body")); -} - -TEST_P(ValidateLocalDebugInfoOutOfFunction, VulkanDebugInfo100DebugScope) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() {}" -%void_name = OpString "void" -%main_name = OpString "main" -%main_linkage_name = OpString "v_main" -%int_name = OpString "int" -%foo_name = OpString "foo" -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%int_info = OpExtInst %void %DbgExt DebugTypeBasic %int_name %u32_0 %u32_1 %u32_0 -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %void -%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src %u32_1 %u32_1 %comp_unit %main_linkage_name %u32_3 %u32_1 -%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %int_info %dbg_src %u32_1 %u32_1 %main_info %u32_4 -%expr = OpExtInst %void %DbgExt DebugExpression -)"; - - const std::string body = R"( -%foo = OpVariable %u32_ptr_function Function -%main_def = OpExtInst %void %DbgExt DebugFunctionDefinition %main_info %main -%foo_val = OpLoad %u32 %foo -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header + GetParam(), body, extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("DebugScope, DebugNoScope, DebugDeclare, DebugValue " - "of debug info extension must appear in a function " - "body")); -} - -INSTANTIATE_TEST_SUITE_P( - AllLocalDebugInfo, ValidateLocalDebugInfoOutOfFunction, - ::testing::ValuesIn(std::vector{ - "%main_scope = OpExtInst %void %DbgExt DebugScope %main_info", - "%no_scope = OpExtInst %void %DbgExt DebugNoScope", - })); - -TEST_F(ValidateOpenCL100DebugInfo, DebugFunctionForwardReference) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() {}" -%void_name = OpString "void" -%main_name = OpString "main" -%main_linkage_name = OpString "v_main" -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void -%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_linkage_name FlagIsPublic 1 %main -)"; - - const std::string body = R"( -%main_scope = OpExtInst %void %DbgExt DebugScope %main_info -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, "", dbg_inst_header, body, extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugFunctionMissingOpFunction) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() {}" -%void_name = OpString "void" -%main_name = OpString "main" -%main_linkage_name = OpString "v_main" -)"; - - const std::string dbg_inst_header = R"( -%dbgNone = OpExtInst %void %DbgExt DebugInfoNone -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void -%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_linkage_name FlagIsPublic 1 %dbgNone -)"; - - const std::string body = R"( -%main_scope = OpExtInst %void %DbgExt DebugScope %main_info -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, "", dbg_inst_header, body, extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugScopeBeforeOpVariableInFunction) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "float4 main(float arg) { - float foo; - return float4(0, 0, 0, 0); -} -" -%float_name = OpString "float" -%main_name = OpString "main" -%main_linkage_name = OpString "v4f_main_f" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%v4float_info = OpExtInst %void %DbgExt DebugTypeVector %float_info 4 -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %v4float_info %float_info -%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %main -)"; - - const std::string body = R"( -%main_scope = OpExtInst %void %DbgExt DebugScope %main_info -%foo = OpVariable %f32_ptr_function Function -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, body, extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeCompositeSizeDebugInfoNone) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "OpaqueType foo; -main() {} -" -%ty_name = OpString "struct VS_OUTPUT" -)"; - - const std::string dbg_inst_header = R"( -%dbg_none = OpExtInst %void %DbgExt DebugInfoNone -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%opaque = OpExtInst %void %DbgExt DebugTypeComposite %ty_name Class %dbg_src 1 1 %comp_unit %ty_name %dbg_none FlagIsPublic -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst_header, - "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeCompositeForwardReference) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "struct VS_OUTPUT { - float4 pos : SV_POSITION; - float4 color : COLOR; -}; -main() {} -" -%VS_OUTPUT_name = OpString "struct VS_OUTPUT" -%float_name = OpString "float" -%VS_OUTPUT_pos_name = OpString "pos : SV_POSITION" -%VS_OUTPUT_color_name = OpString "color : COLOR" -%VS_OUTPUT_linkage_name = OpString "VS_OUTPUT" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -%int_128 = OpConstant %u32 128 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%VS_OUTPUT_info = OpExtInst %void %DbgExt DebugTypeComposite %VS_OUTPUT_name Structure %dbg_src 1 1 %comp_unit %VS_OUTPUT_linkage_name %int_128 FlagIsPublic %VS_OUTPUT_pos_info %VS_OUTPUT_color_info -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%v4float_info = OpExtInst %void %DbgExt DebugTypeVector %float_info 4 -%VS_OUTPUT_pos_info = OpExtInst %void %DbgExt DebugTypeMember %VS_OUTPUT_pos_name %v4float_info %dbg_src 2 3 %VS_OUTPUT_info %u32_0 %int_128 FlagIsPublic -%VS_OUTPUT_color_info = OpExtInst %void %DbgExt DebugTypeMember %VS_OUTPUT_color_name %v4float_info %dbg_src 3 3 %VS_OUTPUT_info %int_128 %int_128 FlagIsPublic -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeCompositeMissingReference) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "struct VS_OUTPUT { - float4 pos : SV_POSITION; - float4 color : COLOR; -}; -main() {} -" -%VS_OUTPUT_name = OpString "struct VS_OUTPUT" -%float_name = OpString "float" -%VS_OUTPUT_pos_name = OpString "pos : SV_POSITION" -%VS_OUTPUT_color_name = OpString "color : COLOR" -%VS_OUTPUT_linkage_name = OpString "VS_OUTPUT" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -%int_128 = OpConstant %u32 128 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%VS_OUTPUT_info = OpExtInst %void %DbgExt DebugTypeComposite %VS_OUTPUT_name Structure %dbg_src 1 1 %comp_unit %VS_OUTPUT_linkage_name %int_128 FlagIsPublic %VS_OUTPUT_pos_info %VS_OUTPUT_color_info -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%v4float_info = OpExtInst %void %DbgExt DebugTypeVector %float_info 4 -%VS_OUTPUT_pos_info = OpExtInst %void %DbgExt DebugTypeMember %VS_OUTPUT_pos_name %v4float_info %dbg_src 2 3 %VS_OUTPUT_info %u32_0 %int_128 FlagIsPublic -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("forward referenced IDs have not been defined")); -} - -TEST_P(ValidateXDebugInfo, DebugSourceWrongResultType) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -)"; - - const std::string dbg_inst = R"( -%dbg_src = OpExtInst %bool %DbgExt DebugSource %src %code -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst, "", - GetParam(), "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected result type must be a result id of " - "OpTypeVoid")); -} - -TEST_P(ValidateXDebugInfo, DebugSourceFailFile) { - const std::string src = R"( -%code = OpString "main() {}" -)"; - - const std::string dbg_inst = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %DbgExt %code -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst, "", - GetParam(), "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand File must be a result id of " - "OpString")); -} - -TEST_P(ValidateXDebugInfo, DebugSourceFailSource) { - const std::string src = R"( -%src = OpString "simple.hlsl" -)"; - - const std::string dbg_inst = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %DbgExt -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst, "", - GetParam(), "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand Text must be a result id of " - "OpString")); -} - -TEST_P(ValidateXDebugInfo, DebugSourceNoText) { - const std::string src = R"( -%src = OpString "simple.hlsl" -)"; - - const std::string dbg_inst = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst, "", - GetParam(), "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -INSTANTIATE_TEST_SUITE_P(OpenCLAndVkDebugInfo100, ValidateXDebugInfo, - ::testing::ValuesIn(std::vector{ - R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)", - R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)", - })); - -TEST_F(ValidateOpenCL100DebugInfo, DebugCompilationUnit) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -)"; - - const std::string dbg_inst = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst, "", - extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugCompilationUnitFail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -)"; - - const std::string dbg_inst = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %src HLSL -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst, "", - extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand Source must be a result id of " - "DebugSource")); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugCompilationUnitFail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -)"; - - const std::string dbg_inst = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %src %u32_5 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, constants, dbg_inst, - "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand Source must be a result id of " - "DebugSource")); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeBasicFailName) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "float4 main(float arg) { - float foo; - return float4(0, 0, 0, 0); -} -" -%float_name = OpString "float" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %int_32 %int_32 Float -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand Name must be a result id of " - "OpString")); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugTypeBasicFailName) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "float4 main(float arg) { - float foo; - return float4(0, 0, 0, 0); -} -" -%float_name = OpString "float" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %u32_32 %u32_32 %u32_3 %u32_0 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand Name must be a result id of " - "OpString")); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeBasicFailSize) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "float4 main(float arg) { - float foo; - return float4(0, 0, 0, 0); -} -" -%float_name = OpString "float" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %float_name Float -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand Size must be a result id of " - "OpConstant")); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugTypeBasicFailSize) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "float4 main(float arg) { - float foo; - return float4(0, 0, 0, 0); -} -" -%float_name = OpString "float" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %float_name %u32_3 %u32_0 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand Size must be a result id of " - "OpConstant")); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypePointer) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "float4 main(float arg) { - float foo; - return float4(0, 0, 0, 0); -} -" -%float_name = OpString "float" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%pfloat_info = OpExtInst %void %DbgExt DebugTypePointer %float_info Function FlagIsLocal -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypePointerFail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "float4 main(float arg) { - float foo; - return float4(0, 0, 0, 0); -} -" -%float_name = OpString "float" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%pfloat_info = OpExtInst %void %DbgExt DebugTypePointer %dbg_src Function FlagIsLocal -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand Base Type must be a result id of " - "DebugTypeBasic")); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeQualifier) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "float4 main(float arg) { - float foo; - return float4(0, 0, 0, 0); -} -" -%float_name = OpString "float" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%cfloat_info = OpExtInst %void %DbgExt DebugTypeQualifier %float_info ConstType -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeQualifierFail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "float4 main(float arg) { - float foo; - return float4(0, 0, 0, 0); -} -" -%float_name = OpString "float" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%cfloat_info = OpExtInst %void %DbgExt DebugTypeQualifier %comp_unit ConstType -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand Base Type must be a result id of " - "DebugTypeBasic")); -} -TEST_F(ValidateVulkan100DebugInfo, DebugTypeQualifier) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "float4 main(float arg) { - float foo; - return float4(0, 0, 0, 0); -} -" -%float_name = OpString "float" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%cfloat_info = OpExtInst %void %DbgExt DebugTypeQualifier %float_info %u32_0 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugTypeQualifierFail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "float4 main(float arg) { - float foo; - return float4(0, 0, 0, 0); -} -" -%float_name = OpString "float" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%cfloat_info = OpExtInst %void %DbgExt DebugTypeQualifier %comp_unit %u32_0 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand Base Type must be a result id of " - "DebugTypeBasic")); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeArray) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %int_32 -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeArrayWithVariableSize) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -%int_name = OpString "int" -%main_name = OpString "main" -%foo_name = OpString "foo" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%uint_info = OpExtInst %void %DbgExt DebugTypeBasic %int_name %int_32 Unsigned -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void -%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_name FlagIsPublic 1 %main -%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %uint_info %dbg_src 1 1 %main_info FlagIsLocal -%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %foo_info -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeArrayFailBaseType) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %comp_unit %int_32 -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand Base Type is not a valid debug " - "type")); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeArrayFailComponentCount) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %float_info -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Component Count must be OpConstant with a 32- or " - "64-bits integer scalar type or DebugGlobalVariable or " - "DebugLocalVariable with a 32- or 64-bits unsigned " - "integer scalar type")); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeArrayFailComponentCountFloat) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %f32_4 -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Component Count must be OpConstant with a 32- or " - "64-bits integer scalar type or DebugGlobalVariable or " - "DebugLocalVariable with a 32- or 64-bits unsigned " - "integer scalar type")); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeArrayFailComponentCountZero) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %u32_0 -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Component Count must be OpConstant with a 32- or " - "64-bits integer scalar type or DebugGlobalVariable or " - "DebugLocalVariable with a 32- or 64-bits unsigned " - "integer scalar type")); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeArrayFailVariableSizeTypeFloat) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -%main_name = OpString "main" -%foo_name = OpString "foo" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void -%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_name FlagIsPublic 1 %main -%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %float_info %dbg_src 1 1 %main_info FlagIsLocal -%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %foo_info -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Component Count must be OpConstant with a 32- or " - "64-bits integer scalar type or DebugGlobalVariable or " - "DebugLocalVariable with a 32- or 64-bits unsigned " - "integer scalar type")); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugTypeArray) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %u32_32 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugTypeArrayWithVariableSize) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -%uint_name = OpString "uint" -%main_name = OpString "main" -%foo_name = OpString "foo" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_6 = OpConstant %u32 6 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%uint_info = OpExtInst %void %DbgExt DebugTypeBasic %uint_name %u32_32 %u32_6 %u32_0 -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %void -%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src %u32_1 %u32_1 %comp_unit %main_name %u32_3 %u32_1 -%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %uint_info %dbg_src %u32_1 %u32_1 %main_info %u32_4 -%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %foo_info -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugTypeArrayFailBaseType) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %comp_unit %u32_32 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand Base Type is not a valid debug " - "type")); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugTypeArrayFailComponentCount) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %float_info -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Component Count must be OpConstant with a 32- or " - "64-bits integer scalar type or DebugGlobalVariable or " - "DebugLocalVariable with a 32- or 64-bits unsigned " - "integer scalar type")); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugTypeArrayFailComponentCountFloat) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %f32_4 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Component Count must be OpConstant with a 32- or " - "64-bits integer scalar type or DebugGlobalVariable or " - "DebugLocalVariable with a 32- or 64-bits unsigned " - "integer scalar type")); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugTypeArrayFailComponentCountZero) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %u32_0 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Component Count must be OpConstant with a 32- or " - "64-bits integer scalar type or DebugGlobalVariable or " - "DebugLocalVariable with a 32- or 64-bits unsigned " - "integer scalar type")); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugTypeArrayFailVariableSizeTypeFloat) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -%main_name = OpString "main" -%foo_name = OpString "foo" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_6 = OpConstant %u32 6 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %void -%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src %u32_1 %u32_1 %comp_unit %main_name %u32_3 %u32_1 -%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %float_info %dbg_src %u32_1 %u32_1 %main_info %u32_4 -%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %foo_info -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Component Count must be OpConstant with a 32- or " - "64-bits integer scalar type or DebugGlobalVariable or " - "DebugLocalVariable with a 32- or 64-bits unsigned " - "integer scalar type")); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeVector) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%vfloat_info = OpExtInst %void %DbgExt DebugTypeVector %float_info 4 -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeVectorFail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%vfloat_info = OpExtInst %void %DbgExt DebugTypeVector %dbg_src 4 -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand Base Type must be a result id of " - "DebugTypeBasic")); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeVectorFailComponentZero) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%vfloat_info = OpExtInst %void %DbgExt DebugTypeVector %dbg_src 0 -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand Base Type must be a result id of " - "DebugTypeBasic")); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeVectorFailComponentFive) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%vfloat_info = OpExtInst %void %DbgExt DebugTypeVector %dbg_src 5 -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand Base Type must be a result id of " - "DebugTypeBasic")); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugTypeVector) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%vfloat_info = OpExtInst %void %DbgExt DebugTypeVector %float_info %u32_4 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugTypeVectorFail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%vfloat_info = OpExtInst %void %DbgExt DebugTypeVector %dbg_src %u32_4 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand Base Type must be a result id of " - "DebugTypeBasic")); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugTypeVectorFailComponentZero) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%vfloat_info = OpExtInst %void %DbgExt DebugTypeVector %float_info %u32_0 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Component Count must be positive " - "integer less than or equal to 4")); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugTypeVectorFailComponentFive) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%vfloat_info = OpExtInst %void %DbgExt DebugTypeVector %float_info %u32_5 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Component Count must be positive " - "integer less than or equal to 4")); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypedef) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%foo_info = OpExtInst %void %DbgExt DebugTypedef %foo_name %float_info %dbg_src 1 1 %comp_unit -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateOpenCL100DebugInfoDebugTypedef, Fail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const auto& param = GetParam(); - - std::ostringstream ss; - ss << R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%foo_info = OpExtInst %void %DbgExt DebugTypedef )"; - ss << param.first; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, size_const, ss.str(), - "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand " + param.second + - " must be a result id of ")); -} - -INSTANTIATE_TEST_SUITE_P( - AllOpenCL100DebugInfoFail, ValidateOpenCL100DebugInfoDebugTypedef, - ::testing::ValuesIn(std::vector>{ - std::make_pair(R"(%dbg_src %float_info %dbg_src 1 1 %comp_unit)", - "Name"), - std::make_pair(R"(%foo_name %dbg_src %dbg_src 1 1 %comp_unit)", - "Base Type"), - std::make_pair(R"(%foo_name %float_info %comp_unit 1 1 %comp_unit)", - "Source"), - std::make_pair(R"(%foo_name %float_info %dbg_src 1 1 %dbg_src)", - "Parent"), - })); - -TEST_F(ValidateVulkan100DebugInfo, DebugTypedef) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%foo_info = OpExtInst %void %DbgExt DebugTypedef %foo_name %float_info %dbg_src %u32_1 %u32_1 %comp_unit -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateVulkan100DebugInfoDebugTypedef, Fail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const auto& param = GetParam(); - - std::ostringstream ss; - ss << R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%foo_info = OpExtInst %void %DbgExt DebugTypedef )"; - ss << param.first; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, constants, ss.str(), - "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand " + param.second + - " must be a result id of ")); -} - -INSTANTIATE_TEST_SUITE_P( - AllVulkan100DebugInfoFail, ValidateVulkan100DebugInfoDebugTypedef, - ::testing::ValuesIn(std::vector>{ - std::make_pair( - R"(%dbg_src %float_info %dbg_src %u32_1 %u32_1 %comp_unit)", - "Name"), - std::make_pair( - R"(%foo_name %dbg_src %dbg_src %u32_1 %u32_1 %comp_unit)", - "Base Type"), - std::make_pair( - R"(%foo_name %float_info %comp_unit %u32_1 %u32_1 %comp_unit)", - "Source"), - std::make_pair( - R"(%foo_name %float_info %dbg_src %u32_1 %u32_1 %dbg_src)", - "Parent"), - })); - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeFunction) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%main_name = OpString "main" -%main_linkage_name = OpString "v_main" -%float_name = OpString "float" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%main_type_info1 = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void -%main_type_info2 = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %float_info -%main_type_info3 = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %float_info %float_info -%main_type_info4 = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void %float_info %float_info -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeFunctionFailReturn) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%main_name = OpString "main" -%main_linkage_name = OpString "v_main" -%float_name = OpString "float" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %dbg_src %float_info -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("expected operand Return Type is not a valid debug type")); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeFunctionFailParam) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%main_name = OpString "main" -%main_linkage_name = OpString "v_main" -%float_name = OpString "float" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %float_info %void -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("expected operand Parameter Types is not a valid debug type")); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugTypeFunctionAndParams) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%main_name = OpString "main" -%main_linkage_name = OpString "v_main" -%float_name = OpString "float" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%main_type_info1 = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %void -%main_type_info2 = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %float_info -%main_type_info3 = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %float_info %float_info -%main_type_info4 = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %void %float_info %float_info -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugTypeFunctionFailReturn) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%main_name = OpString "main" -%main_linkage_name = OpString "v_main" -%float_name = OpString "float" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %dbg_src %float_info -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("expected operand Return Type is not a valid debug type")); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugTypeFunctionFailParam) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%main_name = OpString "main" -%main_linkage_name = OpString "v_main" -%float_name = OpString "float" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %float_info %void -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("expected operand Parameter Types is not a valid debug type")); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeEnum) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%none = OpExtInst %void %DbgExt DebugInfoNone -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%foo_info1 = OpExtInst %void %DbgExt DebugTypeEnum %foo_name %float_info %dbg_src 1 1 %comp_unit %int_32 FlagIsPublic %u32_0 %foo_name %u32_1 %foo_name -%foo_info2 = OpExtInst %void %DbgExt DebugTypeEnum %foo_name %none %dbg_src 1 1 %comp_unit %int_32 FlagIsPublic %u32_0 %foo_name %u32_1 %foo_name -%foo_info3 = OpExtInst %void %DbgExt DebugTypeEnum %foo_name %none %dbg_src 1 1 %comp_unit %int_32 FlagIsPublic -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateOpenCL100DebugInfoDebugTypeEnum, Fail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const auto& param = GetParam(); - - std::ostringstream ss; - ss << R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%foo_info = OpExtInst %void %DbgExt DebugTypeEnum )"; - ss << param.first; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, size_const, ss.str(), - "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand " + param.second)); -} - -INSTANTIATE_TEST_SUITE_P( - AllOpenCL100DebugInfoFail, ValidateOpenCL100DebugInfoDebugTypeEnum, - ::testing::ValuesIn(std::vector>{ - std::make_pair( - R"(%dbg_src %float_info %dbg_src 1 1 %comp_unit %int_32 FlagIsPublic %u32_0 %foo_name)", - "Name"), - std::make_pair( - R"(%foo_name %dbg_src %dbg_src 1 1 %comp_unit %int_32 FlagIsPublic %u32_0 %foo_name)", - "Underlying Types"), - std::make_pair( - R"(%foo_name %float_info %comp_unit 1 1 %comp_unit %int_32 FlagIsPublic %u32_0 %foo_name)", - "Source"), - std::make_pair( - R"(%foo_name %float_info %dbg_src 1 1 %dbg_src %int_32 FlagIsPublic %u32_0 %foo_name)", - "Parent"), - std::make_pair( - R"(%foo_name %float_info %dbg_src 1 1 %comp_unit %void FlagIsPublic %u32_0 %foo_name)", - "Size"), - std::make_pair( - R"(%foo_name %float_info %dbg_src 1 1 %comp_unit %u32_0 FlagIsPublic %u32_0 %foo_name)", - "Size"), - std::make_pair( - R"(%foo_name %float_info %dbg_src 1 1 %comp_unit %int_32 FlagIsPublic %foo_name %foo_name)", - "Value"), - std::make_pair( - R"(%foo_name %float_info %dbg_src 1 1 %comp_unit %int_32 FlagIsPublic %u32_0 %u32_1)", - "Name"), - })); - -TEST_F(ValidateVulkan100DebugInfo, DebugTypeEnum) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%none = OpExtInst %void %DbgExt DebugInfoNone -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%foo_info1 = OpExtInst %void %DbgExt DebugTypeEnum %foo_name %float_info %dbg_src %u32_1 %u32_1 %comp_unit %u32_32 %u32_3 %u32_0 %foo_name %u32_1 %foo_name -%foo_info2 = OpExtInst %void %DbgExt DebugTypeEnum %foo_name %none %dbg_src %u32_1 %u32_1 %comp_unit %u32_32 %u32_3 %u32_0 %foo_name %u32_1 %foo_name -%foo_info3 = OpExtInst %void %DbgExt DebugTypeEnum %foo_name %none %dbg_src %u32_1 %u32_1 %comp_unit %u32_32 %u32_3 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateVulkan100DebugInfoDebugTypeEnum, Fail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const auto& param = GetParam(); - - std::ostringstream ss; - ss << R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%foo_info = OpExtInst %void %DbgExt DebugTypeEnum )"; - ss << param.first; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, constants, ss.str(), - "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand " + param.second)); -} - -INSTANTIATE_TEST_SUITE_P( - AllVulkan100DebugInfoFail, ValidateVulkan100DebugInfoDebugTypeEnum, - ::testing::ValuesIn(std::vector>{ - std::make_pair( - R"(%dbg_src %float_info %dbg_src %u32_1 %u32_1 %comp_unit %u32_32 %u32_3 %u32_0 %foo_name)", - "Name"), - std::make_pair( - R"(%foo_name %dbg_src %dbg_src %u32_1 %u32_1 %comp_unit %u32_32 %u32_3 %u32_0 %foo_name)", - "Underlying Types"), - std::make_pair( - R"(%foo_name %float_info %comp_unit %u32_1 %u32_1 %comp_unit %u32_32 %u32_3 %u32_0 %foo_name)", - "Source"), - std::make_pair( - R"(%foo_name %float_info %dbg_src %u32_1 %u32_1 %dbg_src %u32_32 %u32_3 %u32_0 %foo_name)", - "Parent"), - std::make_pair( - R"(%foo_name %float_info %dbg_src %u32_1 %u32_1 %comp_unit %void %u32_3 %u32_0 %foo_name)", - "Size"), - std::make_pair( - R"(%foo_name %float_info %dbg_src %u32_1 %u32_1 %comp_unit %u32_0 %u32_3 %u32_0 %foo_name)", - "Size"), - std::make_pair( - R"(%foo_name %float_info %dbg_src %u32_1 %u32_1 %comp_unit %u32_32 %u32_3 %foo_name %foo_name)", - "Value"), - std::make_pair( - R"(%foo_name %float_info %dbg_src %u32_1 %u32_1 %comp_unit %u32_32 %u32_3 %u32_0 %u32_1)", - "Name"), - })); - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeCompositeFunctionAndInheritance) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "struct VS_OUTPUT { - float4 pos : SV_POSITION; -}; -struct foo : VS_OUTPUT { -}; -main() {} -" -%VS_OUTPUT_name = OpString "struct VS_OUTPUT" -%float_name = OpString "float" -%foo_name = OpString "foo" -%VS_OUTPUT_pos_name = OpString "pos : SV_POSITION" -%VS_OUTPUT_linkage_name = OpString "VS_OUTPUT" -%main_name = OpString "main" -%main_linkage_name = OpString "v4f_main_f" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -%int_128 = OpConstant %u32 128 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%VS_OUTPUT_info = OpExtInst %void %DbgExt DebugTypeComposite %VS_OUTPUT_name Structure %dbg_src 1 1 %comp_unit %VS_OUTPUT_linkage_name %int_128 FlagIsPublic %VS_OUTPUT_pos_info %main_info %child -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%v4float_info = OpExtInst %void %DbgExt DebugTypeVector %float_info 4 -%VS_OUTPUT_pos_info = OpExtInst %void %DbgExt DebugTypeMember %VS_OUTPUT_pos_name %v4float_info %dbg_src 2 3 %VS_OUTPUT_info %u32_0 %int_128 FlagIsPublic -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %v4float_info %float_info -%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %main -%foo_info = OpExtInst %void %DbgExt DebugTypeComposite %foo_name Structure %dbg_src 1 1 %comp_unit %foo_name %u32_0 FlagIsPublic -%child = OpExtInst %void %DbgExt DebugTypeInheritance %foo_info %VS_OUTPUT_info %int_128 %int_128 FlagIsPublic -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateOpenCL100DebugInfoDebugTypeComposite, Fail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "struct VS_OUTPUT { - float4 pos : SV_POSITION; -}; -struct foo : VS_OUTPUT { -}; -main() {} -" -%VS_OUTPUT_name = OpString "struct VS_OUTPUT" -%float_name = OpString "float" -%foo_name = OpString "foo" -%VS_OUTPUT_pos_name = OpString "pos : SV_POSITION" -%VS_OUTPUT_linkage_name = OpString "VS_OUTPUT" -%main_name = OpString "main" -%main_linkage_name = OpString "v4f_main_f" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -%int_128 = OpConstant %u32 128 -)"; - - const auto& param = GetParam(); - - std::ostringstream ss; - ss << R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%VS_OUTPUT_info = OpExtInst %void %DbgExt DebugTypeComposite )"; - ss << param.first; - ss << R"( -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%v4float_info = OpExtInst %void %DbgExt DebugTypeVector %float_info 4 -%VS_OUTPUT_pos_info = OpExtInst %void %DbgExt DebugTypeMember %VS_OUTPUT_pos_name %v4float_info %dbg_src 2 3 %VS_OUTPUT_info %u32_0 %int_128 FlagIsPublic -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %v4float_info %float_info -%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %main -%foo_info = OpExtInst %void %DbgExt DebugTypeComposite %foo_name Structure %dbg_src 1 1 %comp_unit %foo_name %u32_0 FlagIsPublic -%child = OpExtInst %void %DbgExt DebugTypeInheritance %foo_info %VS_OUTPUT_info %int_128 %int_128 FlagIsPublic -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, size_const, ss.str(), - "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand " + param.second + " must be ")); -} - -INSTANTIATE_TEST_SUITE_P( - AllOpenCL100DebugInfoFail, ValidateOpenCL100DebugInfoDebugTypeComposite, - ::testing::ValuesIn(std::vector>{ - std::make_pair( - R"(%dbg_src Structure %dbg_src 1 1 %comp_unit %VS_OUTPUT_linkage_name %int_128 FlagIsPublic %VS_OUTPUT_pos_info %main_info %child)", - "Name"), - std::make_pair( - R"(%VS_OUTPUT_name Structure %comp_unit 1 1 %comp_unit %VS_OUTPUT_linkage_name %int_128 FlagIsPublic %VS_OUTPUT_pos_info %main_info %child)", - "Source"), - std::make_pair( - R"(%VS_OUTPUT_name Structure %dbg_src 1 1 %dbg_src %VS_OUTPUT_linkage_name %int_128 FlagIsPublic %VS_OUTPUT_pos_info %main_info %child)", - "Parent"), - std::make_pair( - R"(%VS_OUTPUT_name Structure %dbg_src 1 1 %comp_unit %int_128 %int_128 FlagIsPublic %VS_OUTPUT_pos_info %main_info %child)", - "Linkage Name"), - std::make_pair( - R"(%VS_OUTPUT_name Structure %dbg_src 1 1 %comp_unit %VS_OUTPUT_linkage_name %dbg_src FlagIsPublic %VS_OUTPUT_pos_info %main_info %child)", - "Size"), - std::make_pair( - R"(%VS_OUTPUT_name Structure %dbg_src 1 1 %comp_unit %VS_OUTPUT_linkage_name %int_128 FlagIsPublic %dbg_src %main_info %child)", - "Members"), - std::make_pair( - R"(%VS_OUTPUT_name Structure %dbg_src 1 1 %comp_unit %VS_OUTPUT_linkage_name %int_128 FlagIsPublic %VS_OUTPUT_pos_info %dbg_src %child)", - "Members"), - std::make_pair( - R"(%VS_OUTPUT_name Structure %dbg_src 1 1 %comp_unit %VS_OUTPUT_linkage_name %int_128 FlagIsPublic %VS_OUTPUT_pos_info %main_info %dbg_src)", - "Members"), - })); - -TEST_P(ValidateOpenCL100DebugInfoDebugTypeMember, Fail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "struct VS_OUTPUT { - float pos : SV_POSITION; -}; -main() {} -" -%VS_OUTPUT_name = OpString "struct VS_OUTPUT" -%float_name = OpString "float" -%VS_OUTPUT_pos_name = OpString "pos : SV_POSITION" -%VS_OUTPUT_linkage_name = OpString "VS_OUTPUT" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const auto& param = GetParam(); - - std::ostringstream ss; - ss << R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%VS_OUTPUT_info = OpExtInst %void %DbgExt DebugTypeComposite %VS_OUTPUT_name Structure %dbg_src 1 1 %comp_unit %VS_OUTPUT_linkage_name %int_32 FlagIsPublic %VS_OUTPUT_pos_info -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%VS_OUTPUT_pos_info = OpExtInst %void %DbgExt DebugTypeMember )"; - ss << param.first; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, size_const, ss.str(), - "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - if (!param.second.empty()) { - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand " + param.second + - " must be a result id of ")); - } -} - -INSTANTIATE_TEST_SUITE_P( - AllOpenCL100DebugInfoFail, ValidateOpenCL100DebugInfoDebugTypeMember, - ::testing::ValuesIn(std::vector>{ - std::make_pair( - R"(%dbg_src %float_info %dbg_src 2 3 %VS_OUTPUT_info %u32_0 %int_32 FlagIsPublic)", - "Name"), - std::make_pair( - R"(%VS_OUTPUT_pos_name %dbg_src %dbg_src 2 3 %VS_OUTPUT_info %u32_0 %int_32 FlagIsPublic)", - ""), - std::make_pair( - R"(%VS_OUTPUT_pos_name %float_info %float_info 2 3 %VS_OUTPUT_info %u32_0 %int_32 FlagIsPublic)", - "Source"), - std::make_pair( - R"(%VS_OUTPUT_pos_name %float_info %dbg_src 2 3 %float_info %u32_0 %int_32 FlagIsPublic)", - "Parent"), - std::make_pair( - R"(%VS_OUTPUT_pos_name %float_info %dbg_src 2 3 %VS_OUTPUT_info %void %int_32 FlagIsPublic)", - "Offset"), - std::make_pair( - R"(%VS_OUTPUT_pos_name %float_info %dbg_src 2 3 %VS_OUTPUT_info %u32_0 %void FlagIsPublic)", - "Size"), - })); - -TEST_P(ValidateOpenCL100DebugInfoDebugTypeInheritance, Fail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "struct VS_OUTPUT {}; -struct foo : VS_OUTPUT {}; -" -%VS_OUTPUT_name = OpString "struct VS_OUTPUT" -%foo_name = OpString "foo" -)"; - - const auto& param = GetParam(); - - std::ostringstream ss; - ss << R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%VS_OUTPUT_info = OpExtInst %void %DbgExt DebugTypeComposite %VS_OUTPUT_name Structure %dbg_src 1 1 %comp_unit %VS_OUTPUT_name %u32_0 FlagIsPublic %child -%foo_info = OpExtInst %void %DbgExt DebugTypeComposite %foo_name Structure %dbg_src 1 1 %comp_unit %foo_name %u32_0 FlagIsPublic -%bar_info = OpExtInst %void %DbgExt DebugTypeComposite %foo_name Union %dbg_src 1 1 %comp_unit %foo_name %u32_0 FlagIsPublic -%child = OpExtInst %void %DbgExt DebugTypeInheritance )" - << param.first; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", ss.str(), "", - extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand " + param.second)); -} - -INSTANTIATE_TEST_SUITE_P( - AllOpenCL100DebugInfoFail, ValidateOpenCL100DebugInfoDebugTypeInheritance, - ::testing::ValuesIn(std::vector>{ - std::make_pair(R"(%dbg_src %VS_OUTPUT_info %u32_0 %u32_0 FlagIsPublic)", - "Child must be a result id of"), - std::make_pair(R"(%foo_info %dbg_src %u32_0 %u32_0 FlagIsPublic)", - "Parent must be a result id of"), - std::make_pair( - R"(%bar_info %VS_OUTPUT_info %u32_0 %u32_0 FlagIsPublic)", - "Child must be class or struct debug type"), - std::make_pair(R"(%foo_info %bar_info %u32_0 %u32_0 FlagIsPublic)", - "Parent must be class or struct debug type"), - std::make_pair(R"(%foo_info %VS_OUTPUT_info %void %u32_0 FlagIsPublic)", - "Offset"), - std::make_pair(R"(%foo_info %VS_OUTPUT_info %u32_0 %void FlagIsPublic)", - "Size"), - })); - -TEST_F(ValidateVulkan100DebugInfo, DebugTypeComposite) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "struct VS_OUTPUT { - float4 pos : SV_POSITION; -}; -struct foo : VS_OUTPUT { -}; -main() {} -" -%VS_OUTPUT_name = OpString "struct VS_OUTPUT" -%float_name = OpString "float" -%foo_name = OpString "foo" -%VS_OUTPUT_pos_name = OpString "pos : SV_POSITION" -%VS_OUTPUT_linkage_name = OpString "VS_OUTPUT" -%main_name = OpString "main" -%main_linkage_name = OpString "v4f_main_f" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -%u32_128 = OpConstant %u32 128 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%v4float_info = OpExtInst %void %DbgExt DebugTypeVector %float_info %u32_4 -%VS_OUTPUT_pos_info = OpExtInst %void %DbgExt DebugTypeMember %VS_OUTPUT_pos_name %v4float_info %dbg_src %u32_2 %u32_3 %u32_0 %u32_128 %u32_3 -%VS_OUTPUT_info = OpExtInst %void %DbgExt DebugTypeComposite %VS_OUTPUT_name %u32_1 %dbg_src %u32_1 %u32_1 %comp_unit %VS_OUTPUT_linkage_name %u32_128 %u32_3 %VS_OUTPUT_pos_info -%foo_info = OpExtInst %void %DbgExt DebugTypeComposite %foo_name %u32_1 %dbg_src %u32_1 %u32_1 %comp_unit %foo_name %u32_0 %u32_3 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateVulkan100DebugInfoDebugTypeComposite, Fail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "struct VS_OUTPUT { - float4 pos : SV_POSITION; -}; -struct foo : VS_OUTPUT { -}; -main() {} -" -%VS_OUTPUT_name = OpString "struct VS_OUTPUT" -%float_name = OpString "float" -%foo_name = OpString "foo" -%VS_OUTPUT_pos_name = OpString "pos : SV_POSITION" -%VS_OUTPUT_linkage_name = OpString "VS_OUTPUT" -%main_name = OpString "main" -%main_linkage_name = OpString "v4f_main_f" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -%u32_128 = OpConstant %u32 128 -)"; - - const auto& param = GetParam(); - - std::ostringstream ss; - ss << R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%v4float_info = OpExtInst %void %DbgExt DebugTypeVector %float_info %u32_4 -%VS_OUTPUT_pos_info = OpExtInst %void %DbgExt DebugTypeMember %VS_OUTPUT_pos_name %v4float_info %dbg_src %u32_2 %u32_3 %u32_0 %u32_128 %u32_3 -%VS_OUTPUT_info = OpExtInst %void %DbgExt DebugTypeComposite )"; - ss << param.first; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, constants, ss.str(), - "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand " + param.second + " must be ")); -} - -INSTANTIATE_TEST_SUITE_P( - AllVulkan100DebugInfoFail, ValidateVulkan100DebugInfoDebugTypeComposite, - ::testing::ValuesIn(std::vector>{ - std::make_pair( - R"(%dbg_src %u32_1 %dbg_src %u32_1 %u32_1 %comp_unit %VS_OUTPUT_linkage_name %u32_128 %u32_3 %VS_OUTPUT_pos_info)", - "Name"), - std::make_pair( - R"(%VS_OUTPUT_name %u32_1 %comp_unit %u32_1 %u32_1 %comp_unit %VS_OUTPUT_linkage_name %u32_128 %u32_3 %VS_OUTPUT_pos_info)", - "Source"), - std::make_pair( - R"(%VS_OUTPUT_name %u32_1 %dbg_src %u32_1 %u32_1 %dbg_src %VS_OUTPUT_linkage_name %u32_128 %u32_3 %VS_OUTPUT_pos_info)", - "Parent"), - std::make_pair( - R"(%VS_OUTPUT_name %u32_1 %dbg_src %u32_1 %u32_1 %comp_unit %u32_128 %u32_128 %u32_3 %VS_OUTPUT_pos_info)", - "Linkage Name"), - std::make_pair( - R"(%VS_OUTPUT_name %u32_1 %dbg_src %u32_1 %u32_1 %comp_unit %VS_OUTPUT_linkage_name %dbg_src %u32_3 %VS_OUTPUT_pos_info)", - "Size"), - std::make_pair( - R"(%VS_OUTPUT_name %u32_1 %dbg_src %u32_1 %u32_1 %comp_unit %VS_OUTPUT_linkage_name %u32_128 %dbg_src %VS_OUTPUT_pos_info)", - "Flags"), - std::make_pair( - R"(%VS_OUTPUT_name %u32_1 %dbg_src %u32_1 %u32_1 %comp_unit %VS_OUTPUT_linkage_name %u32_128 %u32_3 %dbg_src)", - "Members"), - })); - -TEST_P(ValidateVulkan100DebugInfoDebugTypeMember, Fail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "struct VS_OUTPUT { - float pos : SV_POSITION; -}; -main() {} -" -%VS_OUTPUT_name = OpString "struct VS_OUTPUT" -%float_name = OpString "float" -%VS_OUTPUT_pos_name = OpString "pos : SV_POSITION" -%VS_OUTPUT_linkage_name = OpString "VS_OUTPUT" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -%u32_128 = OpConstant %u32 128 -)"; - - const auto& param = GetParam(); - - std::ostringstream ss; - ss << R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%VS_OUTPUT_pos_info = OpExtInst %void %DbgExt DebugTypeMember )"; - ss << param.first; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, constants, ss.str(), - "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - if (!param.second.empty()) { - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand " + param.second + - " must be a result id of ")); - } -} - -INSTANTIATE_TEST_SUITE_P( - AllVulkan100DebugInfoFail, ValidateVulkan100DebugInfoDebugTypeMember, - ::testing::ValuesIn(std::vector>{ - std::make_pair( - R"(%dbg_src %float_info %dbg_src %u32_2 %u32_3 %u32_0 %u32_32 %u32_3)", - "Name"), - std::make_pair( - R"(%VS_OUTPUT_pos_name %dbg_src %dbg_src %u32_2 %u32_3 %u32_0 %u32_32 %u32_3)", - ""), - std::make_pair( - R"(%VS_OUTPUT_pos_name %float_info %float_info %u32_2 %u32_3 %u32_0 %u32_32 %u32_3)", - "Source"), - std::make_pair( - R"(%VS_OUTPUT_pos_name %float_info %dbg_src %u32_2 %u32_3 %void %u32_32 %u32_3)", - "Offset"), - std::make_pair( - R"(%VS_OUTPUT_pos_name %float_info %dbg_src %u32_2 %u32_3 %u32_0 %void %u32_3)", - "Size"), - std::make_pair( - R"(%VS_OUTPUT_pos_name %float_info %dbg_src %u32_2 %u32_3 %u32_0 %u32_32 %void)", - "Flags"), - })); - -TEST_F(ValidateOpenCL100DebugInfo, DebugFunctionDeclaration) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "struct VS_OUTPUT { - float4 pos : SV_POSITION; -}; -main() {} -" -%main_name = OpString "main" -%main_linkage_name = OpString "v4f_main_f" -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void -%main_decl = OpExtInst %void %DbgExt DebugFunctionDeclaration %main_name %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic -%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %main)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst_header, - "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateOpenCL100DebugInfoDebugFunction, Fail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "struct VS_OUTPUT { - float4 pos : SV_POSITION; -}; -main() {} -" -%main_name = OpString "main" -%main_linkage_name = OpString "v4f_main_f" -)"; - - const auto& param = GetParam(); - - std::ostringstream ss; - ss << R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void -%main_decl = OpExtInst %void %DbgExt DebugFunctionDeclaration %main_name %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic -%main_info = OpExtInst %void %DbgExt DebugFunction )" - << param.first; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", ss.str(), "", - extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand " + param.second)); -} - -INSTANTIATE_TEST_SUITE_P( - AllOpenCL100DebugInfoFail, ValidateOpenCL100DebugInfoDebugFunction, - ::testing::ValuesIn(std::vector>{ - std::make_pair( - R"(%u32_0 %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %main)", - "Name"), - std::make_pair( - R"(%main_name %dbg_src %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %main)", - "Type"), - std::make_pair( - R"(%main_name %main_type_info %comp_unit 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %main)", - "Source"), - std::make_pair( - R"(%main_name %main_type_info %dbg_src 12 1 %dbg_src %main_linkage_name FlagIsPublic 13 %main)", - "Parent"), - std::make_pair( - R"(%main_name %main_type_info %dbg_src 12 1 %comp_unit %void FlagIsPublic 13 %main)", - "Linkage Name"), - std::make_pair( - R"(%main_name %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %void)", - "Function"), - std::make_pair( - R"(%main_name %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %main %dbg_src)", - "Declaration"), - })); - -TEST_P(ValidateOpenCL100DebugInfoDebugFunctionDeclaration, Fail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "struct VS_OUTPUT { - float4 pos : SV_POSITION; -}; -main() {} -" -%main_name = OpString "main" -%main_linkage_name = OpString "v4f_main_f" -)"; - - const auto& param = GetParam(); - - std::ostringstream ss; - ss << R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void -%main_decl = OpExtInst %void %DbgExt DebugFunctionDeclaration )" - << param.first; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", ss.str(), "", - extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand " + param.second)); -} - -INSTANTIATE_TEST_SUITE_P( - AllOpenCL100DebugInfoFail, - ValidateOpenCL100DebugInfoDebugFunctionDeclaration, - ::testing::ValuesIn(std::vector>{ - std::make_pair( - R"(%u32_0 %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic)", - "Name"), - std::make_pair( - R"(%main_name %dbg_src %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic)", - "Type"), - std::make_pair( - R"(%main_name %main_type_info %comp_unit 12 1 %comp_unit %main_linkage_name FlagIsPublic)", - "Source"), - std::make_pair( - R"(%main_name %main_type_info %dbg_src 12 1 %dbg_src %main_linkage_name FlagIsPublic)", - "Parent"), - std::make_pair( - R"(%main_name %main_type_info %dbg_src 12 1 %comp_unit %void FlagIsPublic)", - "Linkage Name"), - })); - -TEST_F(ValidateVulkan100DebugInfo, DebugFunctionDeclaration) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "struct VS_OUTPUT { - float4 pos : SV_POSITION; -}; -main() {} -" -%main_name = OpString "main" -%main_linkage_name = OpString "v4f_main_f" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_12 = OpConstant %u32 12 -%u32_13 = OpConstant %u32 13 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %void -%main_decl = OpExtInst %void %DbgExt DebugFunctionDeclaration %main_name %main_type_info %dbg_src %u32_12 %u32_1 %comp_unit %main_linkage_name %u32_3 -%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src %u32_12 %u32_1 %comp_unit %main_linkage_name %u32_3 %u32_13 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateVulkan100DebugInfoDebugFunction, Fail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "struct VS_OUTPUT { - float4 pos : SV_POSITION; -}; -main() {} -" -%main_name = OpString "main" -%main_linkage_name = OpString "v4f_main_f" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_12 = OpConstant %u32 12 -%u32_13 = OpConstant %u32 13 -)"; - - const auto& param = GetParam(); - - std::ostringstream ss; - ss << R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %void -%main_decl = OpExtInst %void %DbgExt DebugFunctionDeclaration %main_name %main_type_info %dbg_src %u32_12 %u32_1 %comp_unit %main_linkage_name %u32_3 -%main_info = OpExtInst %void %DbgExt DebugFunction )" - << param.first; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, constants, ss.str(), - "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand " + param.second)); -} - -INSTANTIATE_TEST_SUITE_P( - AllVulkan100DebugInfoFail, ValidateVulkan100DebugInfoDebugFunction, - ::testing::ValuesIn(std::vector>{ - std::make_pair( - R"(%u32_0 %main_type_info %dbg_src %u32_12 %u32_1 %comp_unit %main_linkage_name %u32_3 %u32_13)", - "Name"), - std::make_pair( - R"(%main_name %dbg_src %dbg_src %u32_12 %u32_1 %comp_unit %main_linkage_name %u32_3 %u32_13)", - "Type"), - std::make_pair( - R"(%main_name %main_type_info %comp_unit %u32_12 %u32_1 %comp_unit %main_linkage_name %u32_3 %u32_13)", - "Source"), - std::make_pair( - R"(%main_name %main_type_info %dbg_src %u32_12 %u32_1 %dbg_src %main_linkage_name %u32_3 %u32_13)", - "Parent"), - std::make_pair( - R"(%main_name %main_type_info %dbg_src %u32_12 %u32_1 %comp_unit %void %u32_3 %u32_13)", - "Linkage Name"), - std::make_pair( - R"(%main_name %main_type_info %dbg_src %u32_12 %u32_1 %comp_unit %main_linkage_name %u32_3 %u32_13 %dbg_src)", - "Declaration"), - })); - -TEST_P(ValidateVulkan100DebugInfoDebugFunctionDeclaration, Fail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "struct VS_OUTPUT { - float4 pos : SV_POSITION; -}; -main() {} -" -%main_name = OpString "main" -%main_linkage_name = OpString "v4f_main_f" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_12 = OpConstant %u32 12 -%u32_13 = OpConstant %u32 13 -)"; - - const auto& param = GetParam(); - - std::ostringstream ss; - ss << R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %void -%main_decl = OpExtInst %void %DbgExt DebugFunctionDeclaration )" - << param.first; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, constants, ss.str(), - "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand " + param.second)); -} - -INSTANTIATE_TEST_SUITE_P( - AllVulkan100DebugInfoFail, - ValidateVulkan100DebugInfoDebugFunctionDeclaration, - ::testing::ValuesIn(std::vector>{ - std::make_pair( - R"(%u32_0 %main_type_info %dbg_src %u32_12 %u32_1 %comp_unit %main_linkage_name %u32_3)", - "Name"), - std::make_pair( - R"(%main_name %dbg_src %dbg_src %u32_12 %u32_1 %comp_unit %main_linkage_name %u32_3)", - "Type"), - std::make_pair( - R"(%main_name %main_type_info %comp_unit %u32_12 %u32_1 %comp_unit %main_linkage_name %u32_3)", - "Source"), - std::make_pair( - R"(%main_name %main_type_info %dbg_src %u32_12 %u32_1 %dbg_src %main_linkage_name %u32_3)", - "Parent"), - std::make_pair( - R"(%main_name %main_type_info %dbg_src %u32_12 %u32_1 %comp_unit %void %u32_3)", - "Linkage Name"), - })); - -TEST_F(ValidateOpenCL100DebugInfo, DebugLexicalBlock) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%main_name = OpString "main" -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%main_block = OpExtInst %void %DbgExt DebugLexicalBlock %dbg_src 1 1 %comp_unit %main_name)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst_header, - "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateOpenCL100DebugInfoDebugLexicalBlock, Fail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%main_name = OpString "main" -)"; - - const auto& param = GetParam(); - - std::ostringstream ss; - ss << R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%main_block = OpExtInst %void %DbgExt DebugLexicalBlock )" - << param.first; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", ss.str(), "", - extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand " + param.second)); -} - -INSTANTIATE_TEST_SUITE_P( - AllOpenCL100DebugInfoFail, ValidateOpenCL100DebugInfoDebugLexicalBlock, - ::testing::ValuesIn(std::vector>{ - std::make_pair(R"(%comp_unit 1 1 %comp_unit %main_name)", "Source"), - std::make_pair(R"(%dbg_src 1 1 %dbg_src %main_name)", "Parent"), - std::make_pair(R"(%dbg_src 1 1 %comp_unit %void)", "Name"), - })); - -TEST_F(ValidateOpenCL100DebugInfo, DebugScopeFailScope) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() {}" -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -)"; - - const std::string body = R"( -%main_scope = OpExtInst %void %DbgExt DebugScope %dbg_src -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, "", dbg_inst_header, body, extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("expected operand Scope")); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugScopeFailInlinedAt) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() {}" -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -)"; - - const std::string body = R"( -%main_scope = OpExtInst %void %DbgExt DebugScope %comp_unit %dbg_src -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, "", dbg_inst_header, body, extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("expected operand Inlined At")); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugLexicalBlock) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%main_name = OpString "main" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%main_block = OpExtInst %void %DbgExt DebugLexicalBlock %dbg_src %u32_1 %u32_1 %comp_unit %main_name -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateVulkan100DebugInfoDebugLexicalBlock, Fail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "main() {}" -%main_name = OpString "main" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -)"; - - const auto& param = GetParam(); - - std::ostringstream ss; - ss << R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%main_block = OpExtInst %void %DbgExt DebugLexicalBlock )" - << param.first; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, constants, ss.str(), - "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand " + param.second)); -} - -INSTANTIATE_TEST_SUITE_P( - AllVulkan100DebugInfoFail, ValidateVulkan100DebugInfoDebugLexicalBlock, - ::testing::ValuesIn(std::vector>{ - std::make_pair(R"(%comp_unit %u32_1 %u32_1 %comp_unit %main_name)", - "Source"), - std::make_pair(R"(%dbg_src %u32_1 %u32_1 %dbg_src %main_name)", - "Parent"), - std::make_pair(R"(%dbg_src %u32_1 %u32_1 %comp_unit %void)", "Name"), - })); - -TEST_F(ValidateVulkan100DebugInfo, DebugScopeFailScope) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() {}" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -)"; - - const std::string body = R"( -%main_scope = OpExtInst %void %DbgExt DebugScope %dbg_src -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, body, extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("expected operand Scope")); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugScopeFailInlinedAt) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() {}" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -)"; - - const std::string body = R"( -%main_scope = OpExtInst %void %DbgExt DebugScope %comp_unit %dbg_src -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, body, extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("expected operand Inlined At")); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugLocalVariable) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() { float foo; }" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%foo = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %float_info %dbg_src 1 10 %comp_unit FlagIsLocal 0 -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateOpenCL100DebugInfoDebugLocalVariable, Fail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() { float foo; }" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const auto& param = GetParam(); - - std::ostringstream ss; - ss << R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%foo = OpExtInst %void %DbgExt DebugLocalVariable )" - << param.first; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, size_const, ss.str(), - "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand " + param.second)); -} - -INSTANTIATE_TEST_SUITE_P( - AllOpenCL100DebugInfoFail, ValidateOpenCL100DebugInfoDebugLocalVariable, - ::testing::ValuesIn(std::vector>{ - std::make_pair( - R"(%void %float_info %dbg_src 1 10 %comp_unit FlagIsLocal 0)", - "Name"), - std::make_pair( - R"(%foo_name %dbg_src %dbg_src 1 10 %comp_unit FlagIsLocal 0)", - "Type"), - std::make_pair( - R"(%foo_name %float_info %comp_unit 1 10 %comp_unit FlagIsLocal 0)", - "Source"), - std::make_pair( - R"(%foo_name %float_info %dbg_src 1 10 %dbg_src FlagIsLocal 0)", - "Parent"), - })); - -TEST_F(ValidateVulkan100DebugInfo, DebugLocalVariable) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() { float foo; }" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_10 = OpConstant %u32 10 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%foo = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %float_info %dbg_src %u32_1 %u32_10 %comp_unit %u32_4 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateVulkan100DebugInfoDebugLocalVariable, Fail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() { float foo; }" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_10 = OpConstant %u32 10 -%u32_32 = OpConstant %u32 32 -)"; - - const auto& param = GetParam(); - - std::ostringstream ss; - ss << R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%foo = OpExtInst %void %DbgExt DebugLocalVariable )" - << param.first; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, constants, ss.str(), - "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand " + param.second)); -} - -INSTANTIATE_TEST_SUITE_P( - AllVulkan100DebugInfoFail, ValidateVulkan100DebugInfoDebugLocalVariable, - ::testing::ValuesIn(std::vector>{ - std::make_pair( - R"(%void %float_info %dbg_src %u32_1 %u32_10 %comp_unit %u32_3 %u32_0)", - "Name"), - std::make_pair( - R"(%foo_name %dbg_src %dbg_src %u32_1 %u32_10 %comp_unit %u32_3 %u32_0)", - "Type"), - std::make_pair( - R"(%foo_name %float_info %comp_unit %u32_1 %u32_10 %comp_unit %u32_3 %u32_0)", - "Source"), - std::make_pair( - R"(%foo_name %float_info %dbg_src %u32_1 %u32_10 %dbg_src %u32_3 %u32_0)", - "Parent"), - })); - -TEST_F(ValidateOpenCL100DebugInfo, DebugDeclare) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() { float foo; }" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%null_expr = OpExtInst %void %DbgExt DebugExpression -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %float_info %dbg_src 1 10 %comp_unit FlagIsLocal 0 -)"; - - const std::string body = R"( -%foo = OpVariable %f32_ptr_function Function -%decl = OpExtInst %void %DbgExt DebugDeclare %foo_info %foo %null_expr -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, body, extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugDeclareParam) { - CompileSuccessfully(R"( - OpCapability Shader - %1 = OpExtInstImport "OpenCL.DebugInfo.100" - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %main "main" %in_var_COLOR - %4 = OpString "test.hlsl" - OpSource HLSL 620 %4 "#line 1 \"test.hlsl\" -void main(float foo:COLOR) {} -" - %11 = OpString "#line 1 \"test.hlsl\" -void main(float foo:COLOR) {} -" - %14 = OpString "float" - %17 = OpString "src.main" - %20 = OpString "foo" - OpName %in_var_COLOR "in.var.COLOR" - OpName %main "main" - OpName %param_var_foo "param.var.foo" - OpName %src_main "src.main" - OpName %foo "foo" - OpName %bb_entry "bb.entry" - OpDecorate %in_var_COLOR Location 0 - %uint = OpTypeInt 32 0 - %uint_32 = OpConstant %uint 32 - %float = OpTypeFloat 32 -%_ptr_Input_float = OpTypePointer Input %float - %void = OpTypeVoid - %23 = OpTypeFunction %void -%_ptr_Function_float = OpTypePointer Function %float - %29 = OpTypeFunction %void %_ptr_Function_float - OpLine %4 1 21 -%in_var_COLOR = OpVariable %_ptr_Input_float Input - %10 = OpExtInst %void %1 DebugExpression - %12 = OpExtInst %void %1 DebugSource %4 %11 - %13 = OpExtInst %void %1 DebugCompilationUnit 1 4 %12 HLSL - %15 = OpExtInst %void %1 DebugTypeBasic %14 %uint_32 Float - %16 = OpExtInst %void %1 DebugTypeFunction FlagIsProtected|FlagIsPrivate %void %15 - %18 = OpExtInst %void %1 DebugFunction %17 %16 %12 1 1 %13 %17 FlagIsProtected|FlagIsPrivate 1 %src_main - %21 = OpExtInst %void %1 DebugLocalVariable %20 %15 %12 1 17 %18 FlagIsLocal 0 - %22 = OpExtInst %void %1 DebugLexicalBlock %12 1 28 %18 - OpLine %4 1 1 - %main = OpFunction %void None %23 - %24 = OpLabel - OpLine %4 1 17 -%param_var_foo = OpVariable %_ptr_Function_float Function - %27 = OpLoad %float %in_var_COLOR - OpLine %4 1 1 - %28 = OpFunctionCall %void %src_main %param_var_foo - OpReturn - OpFunctionEnd - %src_main = OpFunction %void None %29 - OpLine %4 1 17 - %foo = OpFunctionParameter %_ptr_Function_float - %31 = OpExtInst %void %1 DebugDeclare %21 %foo %10 - %bb_entry = OpLabel - OpLine %4 1 29 - OpReturn - OpFunctionEnd -)"); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateOpenCL100DebugInfoDebugDeclare, Fail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() { float foo; }" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%null_expr = OpExtInst %void %DbgExt DebugExpression -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %float_info %dbg_src 1 10 %comp_unit FlagIsLocal 0 -)"; - - const auto& param = GetParam(); - - std::ostringstream ss; - ss << R"( -%foo = OpVariable %f32_ptr_function Function -%decl = OpExtInst %void %DbgExt DebugDeclare )" - << param.first; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, ss.str(), extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand " + param.second)); -} - -INSTANTIATE_TEST_SUITE_P( - AllOpenCL100DebugInfoFail, ValidateOpenCL100DebugInfoDebugDeclare, - ::testing::ValuesIn(std::vector>{ - std::make_pair(R"(%dbg_src %foo %null_expr)", "Local Variable"), - std::make_pair(R"(%foo_info %void %null_expr)", "Variable"), - std::make_pair(R"(%foo_info %foo %dbg_src)", "Expression"), - })); - -TEST_F(ValidateVulkan100DebugInfo, DebugDeclare) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() { float foo; }" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_10 = OpConstant %u32 10 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%null_expr = OpExtInst %void %DbgExt DebugExpression -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %float_info %dbg_src %u32_1 %u32_10 %comp_unit %u32_4 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - const std::string body = R"( -%foo = OpVariable %f32_ptr_function Function -%decl = OpExtInst %void %DbgExt DebugDeclare %foo_info %foo %null_expr -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, body, extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugDeclareParam) { - CompileSuccessfully(R"( - OpCapability Shader - OpExtension "SPV_KHR_non_semantic_info" - %1 = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %main "main" %in_var_COLOR - %4 = OpString "test.hlsl" - OpSource HLSL 620 %4 "#line 1 \"test.hlsl\" -void main(float foo:COLOR) {} -" - %11 = OpString "#line 1 \"test.hlsl\" -void main(float foo:COLOR) {} -" - %14 = OpString "float" - %17 = OpString "src.main" - %20 = OpString "foo" - OpName %in_var_COLOR "in.var.COLOR" - OpName %main "main" - OpName %param_var_foo "param.var.foo" - OpName %src_main "src.main" - OpName %foo "foo" - OpName %bb_entry "bb.entry" - OpDecorate %in_var_COLOR Location 0 - %uint = OpTypeInt 32 0 - %u32_0 = OpConstant %uint 0 - %u32_1 = OpConstant %uint 1 - %u32_2 = OpConstant %uint 2 - %u32_3 = OpConstant %uint 3 - %u32_4 = OpConstant %uint 4 - %u32_5 = OpConstant %uint 5 - %u32_10 = OpConstant %uint 10 - %u32_17 = OpConstant %uint 17 - %u32_28 = OpConstant %uint 28 - %u32_32 = OpConstant %uint 32 - %uint_32 = OpConstant %uint 32 - %float = OpTypeFloat 32 -%_ptr_Input_float = OpTypePointer Input %float - %void = OpTypeVoid - %23 = OpTypeFunction %void -%_ptr_Function_float = OpTypePointer Function %float - %29 = OpTypeFunction %void %_ptr_Function_float - OpLine %4 1 21 -%in_var_COLOR = OpVariable %_ptr_Input_float Input - %10 = OpExtInst %void %1 DebugExpression - %12 = OpExtInst %void %1 DebugSource %4 %11 - %13 = OpExtInst %void %1 DebugCompilationUnit %u32_1 %u32_4 %12 %u32_5 - %15 = OpExtInst %void %1 DebugTypeBasic %14 %uint_32 %u32_3 %u32_0 - %16 = OpExtInst %void %1 DebugTypeFunction %u32_3 %void %15 - %18 = OpExtInst %void %1 DebugFunction %17 %16 %12 %u32_1 %u32_1 %13 %17 %u32_3 %u32_1 - %21 = OpExtInst %void %1 DebugLocalVariable %20 %15 %12 %u32_1 %u32_17 %18 %u32_4 %u32_0 - %22 = OpExtInst %void %1 DebugLexicalBlock %12 %u32_1 %u32_28 %18 - %main = OpFunction %void None %23 - %24 = OpLabel -%param_var_foo = OpVariable %_ptr_Function_float Function - %27 = OpLoad %float %in_var_COLOR - %28 = OpFunctionCall %void %src_main %param_var_foo - OpReturn - OpFunctionEnd - %src_main = OpFunction %void None %29 - %foo = OpFunctionParameter %_ptr_Function_float - %31 = OpExtInst %void %1 DebugDeclare %21 %foo %10 - %bb_entry = OpLabel - OpReturn - OpFunctionEnd -)"); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateVulkan100DebugInfoDebugDeclare, Fail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() { float foo; }" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_10 = OpConstant %u32 10 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%null_expr = OpExtInst %void %DbgExt DebugExpression -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %float_info %dbg_src %u32_1 %u32_10 %comp_unit %u32_4 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - const auto& param = GetParam(); - - std::ostringstream ss; - ss << R"( -%foo = OpVariable %f32_ptr_function Function -%decl = OpExtInst %void %DbgExt DebugDeclare )" - << param.first; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, ss.str(), extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand " + param.second)); -} - -INSTANTIATE_TEST_SUITE_P( - AllVulkan100DebugInfoFail, ValidateVulkan100DebugInfoDebugDeclare, - ::testing::ValuesIn(std::vector>{ - std::make_pair(R"(%dbg_src %foo %null_expr)", "Local Variable"), - std::make_pair(R"(%foo_info %void %null_expr)", "Variable"), - std::make_pair(R"(%foo_info %foo %dbg_src)", "Expression"), - })); - -TEST_F(ValidateOpenCL100DebugInfo, DebugExpression) { - const std::string dbg_inst_header = R"( -%op0 = OpExtInst %void %DbgExt DebugOperation Deref -%op1 = OpExtInst %void %DbgExt DebugOperation Plus -%null_expr = OpExtInst %void %DbgExt DebugExpression %op0 %op1 -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo("", "", dbg_inst_header, - "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugExpressionFail) { - const std::string dbg_inst_header = R"( -%op = OpExtInst %void %DbgExt DebugOperation Deref -%null_expr = OpExtInst %void %DbgExt DebugExpression %op %void -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo("", "", dbg_inst_header, - "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr( - "expected operand Operation must be a result id of DebugOperation")); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugExpression) { - const std::string dbg_inst_header = R"( -%op0 = OpExtInst %void %DbgExt DebugOperation %u32_0 -%op1 = OpExtInst %void %DbgExt DebugOperation %u32_1 -%null_expr = OpExtInst %void %DbgExt DebugExpression %op0 %op1 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo("", "", dbg_inst_header, - "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugExpressionFail) { - const std::string dbg_inst_header = R"( -%op = OpExtInst %void %DbgExt DebugOperation %u32_0 -%null_expr = OpExtInst %void %DbgExt DebugExpression %op %void -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo("", "", dbg_inst_header, - "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr( - "expected operand Operation must be a result id of DebugOperation")); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeTemplate) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "OpaqueType foo; -main() {} -" -%float_name = OpString "float" -%ty_name = OpString "Texture" -%t_name = OpString "T" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -%int_128 = OpConstant %u32 128 -)"; - - const std::string dbg_inst_header = R"( -%dbg_none = OpExtInst %void %DbgExt DebugInfoNone -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%opaque = OpExtInst %void %DbgExt DebugTypeComposite %ty_name Class %dbg_src 1 1 %comp_unit %ty_name %dbg_none FlagIsPublic -%param = OpExtInst %void %DbgExt DebugTypeTemplateParameter %t_name %float_info %dbg_none %dbg_src 0 0 -%temp = OpExtInst %void %DbgExt DebugTypeTemplate %opaque %param -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeTemplateUsedForVariableType) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "OpaqueType foo; -main() {} -" -%float_name = OpString "float" -%ty_name = OpString "Texture" -%t_name = OpString "T" -%foo_name = OpString "foo" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -%int_128 = OpConstant %u32 128 -)"; - - const std::string dbg_inst_header = R"( -%dbg_none = OpExtInst %void %DbgExt DebugInfoNone -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%opaque = OpExtInst %void %DbgExt DebugTypeComposite %ty_name Class %dbg_src 1 1 %comp_unit %ty_name %dbg_none FlagIsPublic -%param = OpExtInst %void %DbgExt DebugTypeTemplateParameter %t_name %float_info %dbg_none %dbg_src 0 0 -%temp = OpExtInst %void %DbgExt DebugTypeTemplate %opaque %param -%foo = OpExtInst %void %DbgExt DebugGlobalVariable %foo_name %temp %dbg_src 0 0 %comp_unit %foo_name %f32_input FlagIsProtected|FlagIsPrivate -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeTemplateFunction) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "OpaqueType foo; -main() {} -" -%float_name = OpString "float" -%ty_name = OpString "Texture" -%t_name = OpString "T" -%main_name = OpString "main" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -%int_128 = OpConstant %u32 128 -)"; - - const std::string dbg_inst_header = R"( -%dbg_none = OpExtInst %void %DbgExt DebugInfoNone -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%param = OpExtInst %void %DbgExt DebugTypeTemplateParameter %t_name %float_info %dbg_none %dbg_src 0 0 -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %param %param -%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_name FlagIsPublic 1 %main -%temp = OpExtInst %void %DbgExt DebugTypeTemplate %main_info %param -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeTemplateFailTarget) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "OpaqueType foo; -main() {} -" -%float_name = OpString "float" -%ty_name = OpString "Texture" -%t_name = OpString "T" -%main_name = OpString "main" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -%int_128 = OpConstant %u32 128 -)"; - - const std::string dbg_inst_header = R"( -%dbg_none = OpExtInst %void %DbgExt DebugInfoNone -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%param = OpExtInst %void %DbgExt DebugTypeTemplateParameter %t_name %float_info %dbg_none %dbg_src 0 0 -%temp = OpExtInst %void %DbgExt DebugTypeTemplate %float_info %param -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand Target must be DebugTypeComposite or " - "DebugFunction")); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugTypeTemplateFailParam) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "OpaqueType foo; -main() {} -" -%float_name = OpString "float" -%ty_name = OpString "Texture" -%t_name = OpString "T" -%main_name = OpString "main" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -%int_128 = OpConstant %u32 128 -)"; - - const std::string dbg_inst_header = R"( -%dbg_none = OpExtInst %void %DbgExt DebugInfoNone -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%param = OpExtInst %void %DbgExt DebugTypeTemplateParameter %t_name %float_info %dbg_none %dbg_src 0 0 -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %param %param -%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_name FlagIsPublic 1 %main -%temp = OpExtInst %void %DbgExt DebugTypeTemplate %main_info %float_info -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr( - "expected operand Parameters must be DebugTypeTemplateParameter or " - "DebugTypeTemplateTemplateParameter")); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugTypeTemplate) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "OpaqueType foo; -main() {} -" -%float_name = OpString "float" -%ty_name = OpString "Texture" -%t_name = OpString "T" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_none = OpExtInst %void %DbgExt DebugInfoNone -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%opaque = OpExtInst %void %DbgExt DebugTypeComposite %ty_name %u32_1 %dbg_src %u32_1 %u32_1 %comp_unit %ty_name %dbg_none %u32_3 -%param = OpExtInst %void %DbgExt DebugTypeTemplateParameter %t_name %float_info %dbg_none %dbg_src %u32_0 %u32_0 -%temp = OpExtInst %void %DbgExt DebugTypeTemplate %opaque %param -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugTypeTemplateUsedForVariableType) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "OpaqueType foo; -main() {} -" -%float_name = OpString "float" -%ty_name = OpString "Texture" -%t_name = OpString "T" -%foo_name = OpString "foo" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_none = OpExtInst %void %DbgExt DebugInfoNone -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%opaque = OpExtInst %void %DbgExt DebugTypeComposite %ty_name %u32_1 %dbg_src %u32_1 %u32_1 %comp_unit %ty_name %dbg_none %u32_3 -%param = OpExtInst %void %DbgExt DebugTypeTemplateParameter %t_name %float_info %dbg_none %dbg_src %u32_0 %u32_0 -%temp = OpExtInst %void %DbgExt DebugTypeTemplate %opaque %param -%foo = OpExtInst %void %DbgExt DebugGlobalVariable %foo_name %temp %dbg_src %u32_0 %u32_0 %comp_unit %foo_name %f32_input %u32_3 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugTypeTemplateFunction) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "OpaqueType foo; -main() {} -" -%float_name = OpString "float" -%ty_name = OpString "Texture" -%t_name = OpString "T" -%main_name = OpString "main" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_none = OpExtInst %void %DbgExt DebugInfoNone -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%param = OpExtInst %void %DbgExt DebugTypeTemplateParameter %t_name %float_info %dbg_none %dbg_src %u32_0 %u32_0 -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %param %param -%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src %u32_1 %u32_1 %comp_unit %main_name %u32_3 %u32_1 -%temp = OpExtInst %void %DbgExt DebugTypeTemplate %main_info %param -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugTypeTemplateFailTarget) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "OpaqueType foo; -main() {} -" -%float_name = OpString "float" -%ty_name = OpString "Texture" -%t_name = OpString "T" -%main_name = OpString "main" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_none = OpExtInst %void %DbgExt DebugInfoNone -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%param = OpExtInst %void %DbgExt DebugTypeTemplateParameter %t_name %float_info %dbg_none %dbg_src %u32_0 %u32_0 -%temp = OpExtInst %void %DbgExt DebugTypeTemplate %float_info %param -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand Target must be DebugTypeComposite or " - "DebugFunction")); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugTypeTemplateFailParam) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "OpaqueType foo; -main() {} -" -%float_name = OpString "float" -%ty_name = OpString "Texture" -%t_name = OpString "T" -%main_name = OpString "main" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_none = OpExtInst %void %DbgExt DebugInfoNone -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%opaque = OpExtInst %void %DbgExt DebugTypeComposite %ty_name %u32_1 %dbg_src %u32_1 %u32_1 %comp_unit %ty_name %dbg_none %u32_3 -%param = OpExtInst %void %DbgExt DebugTypeTemplateParameter %t_name %float_info %dbg_none %dbg_src %u32_0 %u32_0 -%temp = OpExtInst %void %DbgExt DebugTypeTemplate %opaque %float_info -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr( - "expected operand Parameters must be DebugTypeTemplateParameter or " - "DebugTypeTemplateTemplateParameter")); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugGlobalVariable) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "float foo; void main() {}" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%foo = OpExtInst %void %DbgExt DebugGlobalVariable %foo_name %float_info %dbg_src 0 0 %comp_unit %foo_name %f32_input FlagIsProtected|FlagIsPrivate -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugGlobalVariableStaticMember) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "float foo; void main() {}" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%t = OpExtInst %void %DbgExt DebugTypeComposite %foo_name Class %dbg_src 0 0 %comp_unit %foo_name %int_32 FlagIsPublic %a -%a = OpExtInst %void %DbgExt DebugTypeMember %foo_name %float_info %dbg_src 0 0 %t %u32_0 %int_32 FlagIsPublic -%foo = OpExtInst %void %DbgExt DebugGlobalVariable %foo_name %float_info %dbg_src 0 0 %comp_unit %foo_name %f32_input FlagIsProtected|FlagIsPrivate %a -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugGlobalVariableDebugInfoNone) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "float foo; void main() {}" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbgNone = OpExtInst %void %DbgExt DebugInfoNone -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%foo = OpExtInst %void %DbgExt DebugGlobalVariable %foo_name %float_info %dbg_src 0 0 %comp_unit %foo_name %dbgNone FlagIsProtected|FlagIsPrivate -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugGlobalVariableConst) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "float foo; void main() {}" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%foo = OpExtInst %void %DbgExt DebugGlobalVariable %foo_name %float_info %dbg_src 0 0 %comp_unit %foo_name %int_32 FlagIsProtected|FlagIsPrivate -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateOpenCL100DebugInfoDebugGlobalVariable, Fail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "float foo; void main() {}" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const auto& param = GetParam(); - - std::ostringstream ss; - ss << R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%foo = OpExtInst %void %DbgExt DebugGlobalVariable )" - << param.first; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, size_const, ss.str(), - "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand " + param.second)); -} - -INSTANTIATE_TEST_SUITE_P( - AllOpenCL100DebugInfoFail, ValidateOpenCL100DebugInfoDebugGlobalVariable, - ::testing::ValuesIn(std::vector>{ - std::make_pair( - R"(%void %float_info %dbg_src 0 0 %comp_unit %foo_name %f32_input FlagIsProtected|FlagIsPrivate)", - "Name"), - std::make_pair( - R"(%foo_name %dbg_src %dbg_src 0 0 %comp_unit %foo_name %f32_input FlagIsProtected|FlagIsPrivate)", - "Type"), - std::make_pair( - R"(%foo_name %float_info %comp_unit 0 0 %comp_unit %foo_name %f32_input FlagIsProtected|FlagIsPrivate)", - "Source"), - std::make_pair( - R"(%foo_name %float_info %dbg_src 0 0 %dbg_src %foo_name %f32_input FlagIsProtected|FlagIsPrivate)", - "Scope"), - std::make_pair( - R"(%foo_name %float_info %dbg_src 0 0 %comp_unit %void %f32_input FlagIsProtected|FlagIsPrivate)", - "Linkage Name"), - std::make_pair( - R"(%foo_name %float_info %dbg_src 0 0 %comp_unit %foo_name %void FlagIsProtected|FlagIsPrivate)", - "Variable"), - })); - -TEST_F(ValidateVulkan100DebugInfo, DebugGlobalVariable) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "float foo; void main() {}" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%foo = OpExtInst %void %DbgExt DebugGlobalVariable %foo_name %float_info %dbg_src %u32_0 %u32_0 %comp_unit %foo_name %f32_input %u32_3 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugGlobalVariableStaticMember) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "float foo; void main() {}" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%a = OpExtInst %void %DbgExt DebugTypeMember %foo_name %float_info %dbg_src %u32_0 %u32_0 %u32_0 %u32_32 %u32_3 -%t = OpExtInst %void %DbgExt DebugTypeComposite %foo_name %u32_1 %dbg_src %u32_0 %u32_0 %comp_unit %foo_name %u32_32 %u32_3 %a -%foo = OpExtInst %void %DbgExt DebugGlobalVariable %foo_name %t %dbg_src %u32_0 %u32_0 %comp_unit %foo_name %f32_input %u32_3 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugGlobalVariableDebugInfoNone) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "float foo; void main() {}" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbgNone = OpExtInst %void %DbgExt DebugInfoNone -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%foo = OpExtInst %void %DbgExt DebugGlobalVariable %foo_name %float_info %dbg_src %u32_0 %u32_0 %comp_unit %foo_name %dbgNone %u32_3 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugGlobalVariableConst) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "float foo; void main() {}" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%foo = OpExtInst %void %DbgExt DebugGlobalVariable %foo_name %float_info %dbg_src %u32_0 %u32_0 %comp_unit %foo_name %u32_32 %u32_3 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, "", extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateVulkan100DebugInfoDebugGlobalVariable, Fail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "float foo; void main() {}" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const auto& param = GetParam(); - - std::ostringstream ss; - ss << R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%foo = OpExtInst %void %DbgExt DebugGlobalVariable )" - << param.first; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, constants, ss.str(), - "", extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand " + param.second)); -} - -INSTANTIATE_TEST_SUITE_P( - AllOpenCL100DebugInfoFail, ValidateVulkan100DebugInfoDebugGlobalVariable, - ::testing::ValuesIn(std::vector>{ - std::make_pair( - R"(%void %float_info %dbg_src %u32_0 %u32_0 %comp_unit %foo_name %f32_input %u32_3)", - "Name"), - std::make_pair( - R"(%foo_name %dbg_src %dbg_src %u32_0 %u32_0 %comp_unit %foo_name %f32_input %u32_3)", - "Type"), - std::make_pair( - R"(%foo_name %float_info %comp_unit %u32_0 %u32_0 %comp_unit %foo_name %f32_input %u32_3)", - "Source"), - std::make_pair( - R"(%foo_name %float_info %dbg_src %u32_0 %u32_0 %dbg_src %foo_name %f32_input %u32_3)", - "Scope"), - std::make_pair( - R"(%foo_name %float_info %dbg_src %u32_0 %u32_0 %comp_unit %void %f32_input %u32_3)", - "Linkage Name"), - std::make_pair( - R"(%foo_name %float_info %dbg_src %u32_0 %u32_0 %comp_unit %foo_name %void %u32_3)", - "Variable"), - })); - -TEST_F(ValidateOpenCL100DebugInfo, DebugInlinedAt) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() {}" -%void_name = OpString "void" -%main_name = OpString "main" -%main_linkage_name = OpString "v_main" -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void -%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_linkage_name FlagIsPublic 1 %main -%inlined_at = OpExtInst %void %DbgExt DebugInlinedAt 0 %main_info -%inlined_at_recursive = OpExtInst %void %DbgExt DebugInlinedAt 0 %main_info %inlined_at -)"; - - const std::string body = R"( -%main_scope = OpExtInst %void %DbgExt DebugScope %main_info %inlined_at -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, "", dbg_inst_header, body, extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugInlinedAtFail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() {}" -%void_name = OpString "void" -%main_name = OpString "main" -%main_linkage_name = OpString "v_main" -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void -%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_linkage_name FlagIsPublic 1 %main -%inlined_at = OpExtInst %void %DbgExt DebugInlinedAt 0 %main_info -%inlined_at_recursive = OpExtInst %void %DbgExt DebugInlinedAt 0 %inlined_at -)"; - - const std::string body = R"( -%main_scope = OpExtInst %void %DbgExt DebugScope %main_info %inlined_at -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, "", dbg_inst_header, body, extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("expected operand Scope")); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugInlinedAtFail2) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() {}" -%void_name = OpString "void" -%main_name = OpString "main" -%main_linkage_name = OpString "v_main" -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void -%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_linkage_name FlagIsPublic 1 %main -%inlined_at = OpExtInst %void %DbgExt DebugInlinedAt 0 %main_info -%inlined_at_recursive = OpExtInst %void %DbgExt DebugInlinedAt 0 %main_info %main_info -)"; - - const std::string body = R"( -%main_scope = OpExtInst %void %DbgExt DebugScope %main_info %inlined_at -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, "", dbg_inst_header, body, extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("expected operand Inlined")); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugInlinedAt) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() {}" -%void_name = OpString "void" -%main_name = OpString "main" -%main_linkage_name = OpString "v_main" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %void -%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src %u32_1 %u32_1 %comp_unit %main_name %u32_3 %u32_1 -%inlined_at = OpExtInst %void %DbgExt DebugInlinedAt %u32_0 %main_info -%inlined_at_recursive = OpExtInst %void %DbgExt DebugInlinedAt %u32_0 %main_info %inlined_at -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - const std::string body = R"( -%main_scope = OpExtInst %void %DbgExt DebugScope %main_info %inlined_at -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, body, extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugInlinedAtFail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() {}" -%void_name = OpString "void" -%main_name = OpString "main" -%main_linkage_name = OpString "v_main" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %void -%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src %u32_1 %u32_1 %comp_unit %main_name %u32_3 %u32_1 -%inlined_at = OpExtInst %void %DbgExt DebugInlinedAt %u32_0 %main_info -%inlined_at_recursive = OpExtInst %void %DbgExt DebugInlinedAt %u32_0 %inlined_at %inlined_at -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - const std::string body = R"( -%main_scope = OpExtInst %void %DbgExt DebugScope %main_info %inlined_at -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, body, extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("expected operand Scope")); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugInlinedAtFail2) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() {}" -%void_name = OpString "void" -%main_name = OpString "main" -%main_linkage_name = OpString "v_main" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %void -%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src %u32_1 %u32_1 %comp_unit %main_name %u32_3 %u32_1 -%inlined_at = OpExtInst %void %DbgExt DebugInlinedAt %u32_0 %main_info -%inlined_at_recursive = OpExtInst %void %DbgExt DebugInlinedAt %u32_0 %main_info %main_info -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - const std::string body = R"( -%main_scope = OpExtInst %void %DbgExt DebugScope %main_info %inlined_at -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, body, extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("expected operand Inlined")); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugValue) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() { float foo; }" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string size_const = R"( -%int_3 = OpConstant %u32 3 -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%null_expr = OpExtInst %void %DbgExt DebugExpression -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%v4float_info = OpExtInst %void %DbgExt DebugTypeVector %float_info 4 -%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %v4float_info %dbg_src 1 10 %comp_unit FlagIsLocal 0 -)"; - - const std::string body = R"( -%value = OpExtInst %void %DbgExt DebugValue %foo_info %int_32 %null_expr %int_3 -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, body, extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateOpenCL100DebugInfo, DebugValueWithVariableIndex) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() { float foo; }" -%float_name = OpString "float" -%int_name = OpString "int" -%foo_name = OpString "foo" -%len_name = OpString "length" -)"; - - const std::string size_const = R"( -%int_3 = OpConstant %u32 3 -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%null_expr = OpExtInst %void %DbgExt DebugExpression -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%int_info = OpExtInst %void %DbgExt DebugTypeBasic %int_name %int_32 Signed -%v4float_info = OpExtInst %void %DbgExt DebugTypeVector %float_info 4 -%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %v4float_info %dbg_src 1 10 %comp_unit FlagIsLocal -%len_info = OpExtInst %void %DbgExt DebugLocalVariable %len_name %int_info %dbg_src 0 0 %comp_unit FlagIsLocal -)"; - - const std::string body = R"( -%value = OpExtInst %void %DbgExt DebugValue %foo_info %int_32 %null_expr %len_info -)"; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, body, extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateOpenCL100DebugInfoDebugValue, Fail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() { float foo; }" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string size_const = R"( -%int_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL -%null_expr = OpExtInst %void %DbgExt DebugExpression -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float -%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %float_info %dbg_src 1 10 %comp_unit FlagIsLocal 0 -)"; - - const auto& param = GetParam(); - - std::ostringstream ss; - ss << R"( -%decl = OpExtInst %void %DbgExt DebugValue )" - << param.first; - - const std::string extension = R"( -%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, size_const, dbg_inst_header, ss.str(), extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand " + param.second)); -} - -INSTANTIATE_TEST_SUITE_P( - AllOpenCL100DebugInfoFail, ValidateOpenCL100DebugInfoDebugValue, - ::testing::ValuesIn(std::vector>{ - std::make_pair(R"(%dbg_src %int_32 %null_expr)", "Local Variable"), - std::make_pair(R"(%foo_info %int_32 %dbg_src)", "Expression"), - std::make_pair(R"(%foo_info %int_32 %null_expr %dbg_src)", "Indexes"), - })); - -TEST_F(ValidateVulkan100DebugInfo, DebugValue) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() { float foo; }" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_10 = OpConstant %u32 10 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%null_expr = OpExtInst %void %DbgExt DebugExpression -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%v4float_info = OpExtInst %void %DbgExt DebugTypeVector %float_info %u32_4 -%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %v4float_info %dbg_src %u32_1 %u32_10 %comp_unit %u32_4 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - const std::string body = R"( -%value = OpExtInst %void %DbgExt DebugValue %foo_info %u32_32 %null_expr %u32_3 -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, body, extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateVulkan100DebugInfo, DebugValueWithVariableIndex) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() { float foo; }" -%float_name = OpString "float" -%int_name = OpString "int" -%foo_name = OpString "foo" -%len_name = OpString "length" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_10 = OpConstant %u32 10 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%null_expr = OpExtInst %void %DbgExt DebugExpression -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%int_info = OpExtInst %void %DbgExt DebugTypeBasic %int_name %u32_32 %u32_4 %u32_0 -%v4float_info = OpExtInst %void %DbgExt DebugTypeVector %float_info %u32_4 -%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %v4float_info %dbg_src %u32_1 %u32_10 %comp_unit %u32_4 %u32_0 -%len_info = OpExtInst %void %DbgExt DebugLocalVariable %len_name %int_info %dbg_src %u32_0 %u32_0 %comp_unit %u32_4 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - const std::string body = R"( -%value = OpExtInst %void %DbgExt DebugValue %foo_info %u32_32 %null_expr %len_info -)"; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, body, extension, "Vertex")); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateVulkan100DebugInfoDebugValue, Fail) { - const std::string src = R"( -%src = OpString "simple.hlsl" -%code = OpString "void main() { float foo; }" -%float_name = OpString "float" -%foo_name = OpString "foo" -)"; - - const std::string constants = R"( -%u32_4 = OpConstant %u32 4 -%u32_5 = OpConstant %u32 5 -%u32_10 = OpConstant %u32 10 -%u32_32 = OpConstant %u32 32 -)"; - - const std::string dbg_inst_header = R"( -%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code -%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5 -%null_expr = OpExtInst %void %DbgExt DebugExpression -%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0 -%v4float_info = OpExtInst %void %DbgExt DebugTypeVector %float_info %u32_4 -%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %v4float_info %dbg_src %u32_1 %u32_10 %comp_unit %u32_4 %u32_0 -)"; - - const std::string extension = R"( -OpExtension "SPV_KHR_non_semantic_info" -%DbgExt = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" -)"; - - const auto& param = GetParam(); - - std::ostringstream ss; - ss << R"( -%decl = OpExtInst %void %DbgExt DebugValue )" - << param.first; - - CompileSuccessfully(GenerateShaderCodeForDebugInfo( - src, constants, dbg_inst_header, ss.str(), extension, "Vertex")); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("expected operand " + param.second)); -} - -INSTANTIATE_TEST_SUITE_P( - AllOpenCL100DebugInfoFail, ValidateVulkan100DebugInfoDebugValue, - ::testing::ValuesIn(std::vector>{ - std::make_pair(R"(%dbg_src %u32_32 %null_expr %u32_3)", - "Local Variable"), - std::make_pair(R"(%foo_info %u32_32 %dbg_src %u32_3)", "Expression"), - std::make_pair(R"(%foo_info %u32_32 %null_expr %dbg_src)", "Indexes"), - })); - -TEST_F(ValidateVulkan100DebugInfo, VulkanDebugInfoSample) { - std::ostringstream ss; - ss << R"( - OpCapability Shader - OpExtension "SPV_KHR_non_semantic_info" - %id_1 = OpExtInstImport "NonSemantic.Vulkan.DebugInfo.100" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %id_MainPs "MainPs" %id_in_var_TEXCOORD2 %id_out_var_SV_Target0 - OpExecutionMode %id_MainPs OriginUpperLeft - %id_7 = OpString "foo.frag" - %id_27 = OpString "float" - %id_32 = OpString "vColor" - %id_36 = OpString "PS_OUTPUT" - %id_42 = OpString "vTextureCoords" - %id_46 = OpString "PS_INPUT" - %id_49 = OpString "MainPs" - %id_50 = OpString "" - %id_55 = OpString "ps_output" - %id_59 = OpString "i" - %id_63 = OpString "@type.sampler" - %id_64 = OpString "type.sampler" - %id_66 = OpString "g_sAniso" - %id_69 = OpString "@type.2d.image" - %id_70 = OpString "type.2d.image" - %id_72 = OpString "TemplateParam" - %id_75 = OpString "g_tColor" - OpName %id_type_2d_image "type.2d.image" - OpName %id_g_tColor "g_tColor" - OpName %id_type_sampler "type.sampler" - OpName %id_g_sAniso "g_sAniso" - OpName %id_in_var_TEXCOORD2 "in.var.TEXCOORD2" - OpName %id_out_var_SV_Target0 "out.var.SV_Target0" - OpName %id_MainPs "MainPs" - OpName %id_PS_INPUT "PS_INPUT" - OpMemberName %id_PS_INPUT 0 "vTextureCoords" - OpName %id_param_var_i "param.var.i" - OpName %id_PS_OUTPUT "PS_OUTPUT" - OpMemberName %id_PS_OUTPUT 0 "vColor" - OpName %id_src_MainPs "src.MainPs" - OpName %id_i "i" - OpName %id_bb_entry "bb.entry" - OpName %id_ps_output "ps_output" - OpName %id_type_sampled_image "type.sampled.image" - OpDecorate %id_in_var_TEXCOORD2 Location 0 - OpDecorate %id_out_var_SV_Target0 Location 0 - OpDecorate %id_g_tColor DescriptorSet 0 - OpDecorate %id_g_tColor Binding 0 - OpDecorate %id_g_sAniso DescriptorSet 0 - OpDecorate %id_g_sAniso Binding 1 - %id_int = OpTypeInt 32 1 - %id_int_0 = OpConstant %id_int 0 - %id_uint = OpTypeInt 32 0 - %id_uint_32 = OpConstant %id_uint 32 - %id_float = OpTypeFloat 32 -%id_type_2d_image = OpTypeImage %id_float 2D 2 0 0 1 Unknown -%id__ptr_UniformConstant_type_2d_image = OpTypePointer UniformConstant %id_type_2d_image -%id_type_sampler = OpTypeSampler -%id__ptr_UniformConstant_type_sampler = OpTypePointer UniformConstant %id_type_sampler - %id_v2float = OpTypeVector %id_float 2 -%id__ptr_Input_v2float = OpTypePointer Input %id_v2float - %id_v4float = OpTypeVector %id_float 4 -%id__ptr_Output_v4float = OpTypePointer Output %id_v4float - %id_void = OpTypeVoid - %id_uint_1 = OpConstant %id_uint 1 - %id_uint_4 = OpConstant %id_uint 4 - %id_uint_5 = OpConstant %id_uint 5 - %id_uint_3 = OpConstant %id_uint 3 - %id_uint_0 = OpConstant %id_uint 0 - %id_uint_128 = OpConstant %id_uint 128 - %id_uint_12 = OpConstant %id_uint 12 - %id_uint_10 = OpConstant %id_uint 10 - %id_uint_8 = OpConstant %id_uint 8 - %id_uint_2 = OpConstant %id_uint 2 - %id_uint_64 = OpConstant %id_uint 64 - %id_uint_7 = OpConstant %id_uint 7 - %id_uint_15 = OpConstant %id_uint 15 - %id_uint_16 = OpConstant %id_uint 16 - %id_uint_17 = OpConstant %id_uint 17 - %id_uint_29 = OpConstant %id_uint 29 - %id_uint_14 = OpConstant %id_uint 14 - %id_uint_11 = OpConstant %id_uint 11 - %id_78 = OpTypeFunction %id_void - %id_PS_INPUT = OpTypeStruct %id_v2float -%id__ptr_Function_PS_INPUT = OpTypePointer Function %id_PS_INPUT - %id_PS_OUTPUT = OpTypeStruct %id_v4float - %id_89 = OpTypeFunction %id_PS_OUTPUT %id__ptr_Function_PS_INPUT -%id__ptr_Function_PS_OUTPUT = OpTypePointer Function %id_PS_OUTPUT - %id_uint_20 = OpConstant %id_uint 20 - %id_uint_19 = OpConstant %id_uint 19 - %id_uint_26 = OpConstant %id_uint 26 - %id_uint_46 = OpConstant %id_uint 46 -%id__ptr_Function_v2float = OpTypePointer Function %id_v2float - %id_uint_57 = OpConstant %id_uint 57 - %id_uint_78 = OpConstant %id_uint 78 -%id_type_sampled_image = OpTypeSampledImage %id_type_2d_image - %id_uint_81 = OpConstant %id_uint 81 -%id__ptr_Function_v4float = OpTypePointer Function %id_v4float - %id_g_tColor = OpVariable %id__ptr_UniformConstant_type_2d_image UniformConstant - %id_g_sAniso = OpVariable %id__ptr_UniformConstant_type_sampler UniformConstant -%id_in_var_TEXCOORD2 = OpVariable %id__ptr_Input_v2float Input -%id_out_var_SV_Target0 = OpVariable %id__ptr_Output_v4float Output - %id_22 = OpExtInst %id_void %id_1 DebugSource %id_7 - %id_23 = OpExtInst %id_void %id_1 DebugCompilationUnit %id_uint_1 %id_uint_4 %id_22 %id_uint_5 - %id_28 = OpExtInst %id_void %id_1 DebugTypeBasic %id_27 %id_uint_32 %id_uint_3 %id_uint_0 - %id_31 = OpExtInst %id_void %id_1 DebugTypeVector %id_28 %id_uint_4 - %id_34 = OpExtInst %id_void %id_1 DebugTypeMember %id_32 %id_31 %id_22 %id_uint_12 %id_uint_12 %id_uint_0 %id_uint_128 %id_uint_3 - %id_37 = OpExtInst %id_void %id_1 DebugTypeComposite %id_36 %id_uint_1 %id_22 %id_uint_10 %id_uint_8 %id_23 %id_36 %id_uint_128 %id_uint_3 %id_34 - %id_40 = OpExtInst %id_void %id_1 DebugTypeVector %id_28 %id_uint_2 - %id_44 = OpExtInst %id_void %id_1 DebugTypeMember %id_42 %id_40 %id_22 %id_uint_7 %id_uint_12 %id_uint_0 %id_uint_64 %id_uint_3 - %id_47 = OpExtInst %id_void %id_1 DebugTypeComposite %id_46 %id_uint_1 %id_22 %id_uint_5 %id_uint_8 %id_23 %id_46 %id_uint_64 %id_uint_3 %id_44 - %id_48 = OpExtInst %id_void %id_1 DebugTypeFunction %id_uint_3 %id_37 %id_47 - %id_51 = OpExtInst %id_void %id_1 DebugFunction %id_49 %id_48 %id_22 %id_uint_15 %id_uint_1 %id_23 %id_50 %id_uint_3 %id_uint_16 - %id_54 = OpExtInst %id_void %id_1 DebugLexicalBlock %id_22 %id_uint_16 %id_uint_1 %id_51 - %id_56 = OpExtInst %id_void %id_1 DebugLocalVariable %id_55 %id_37 %id_22 %id_uint_17 %id_uint_15 %id_54 %id_uint_4 - %id_58 = OpExtInst %id_void %id_1 DebugExpression - %id_60 = OpExtInst %id_void %id_1 DebugLocalVariable %id_59 %id_47 %id_22 %id_uint_15 %id_uint_29 %id_51 %id_uint_4 %id_uint_1 - %id_62 = OpExtInst %id_void %id_1 DebugInfoNone - %id_65 = OpExtInst %id_void %id_1 DebugTypeComposite %id_63 %id_uint_1 %id_22 %id_uint_0 %id_uint_0 %id_23 %id_64 %id_62 %id_uint_3 - %id_67 = OpExtInst %id_void %id_1 DebugGlobalVariable %id_66 %id_65 %id_22 %id_uint_3 %id_uint_14 %id_23 %id_66 %id_g_sAniso %id_uint_8 - %id_71 = OpExtInst %id_void %id_1 DebugTypeComposite %id_69 %id_uint_0 %id_22 %id_uint_0 %id_uint_0 %id_23 %id_70 %id_62 %id_uint_3 - %id_73 = OpExtInst %id_void %id_1 DebugTypeTemplateParameter %id_72 %id_31 %id_62 %id_22 %id_uint_0 %id_uint_0 - %id_74 = OpExtInst %id_void %id_1 DebugTypeTemplate %id_71 %id_73 - %id_76 = OpExtInst %id_void %id_1 DebugGlobalVariable %id_75 %id_74 %id_22 %id_uint_1 %id_uint_11 %id_23 %id_75 %id_g_tColor %id_uint_8 - %id_MainPs = OpFunction %id_void None %id_78 - %id_79 = OpLabel -%id_param_var_i = OpVariable %id__ptr_Function_PS_INPUT Function - %id_83 = OpLoad %id_v2float %id_in_var_TEXCOORD2 - %id_84 = OpCompositeConstruct %id_PS_INPUT %id_83 - OpStore %id_param_var_i %id_84 - %id_86 = OpFunctionCall %id_PS_OUTPUT %id_src_MainPs %id_param_var_i - %id_88 = OpCompositeExtract %id_v4float %id_86 0 - OpStore %id_out_var_SV_Target0 %id_88 - OpReturn - OpFunctionEnd - %id_src_MainPs = OpFunction %id_PS_OUTPUT None %id_89 - %id_i = OpFunctionParameter %id__ptr_Function_PS_INPUT - %id_bb_entry = OpLabel - %id_ps_output = OpVariable %id__ptr_Function_PS_OUTPUT Function - %id_94 = OpExtInst %id_void %id_1 DebugScope %id_51 - %id_97 = OpExtInst %id_void %id_1 DebugDeclare %id_60 %id_i %id_58 - %id_99 = OpExtInst %id_void %id_1 DebugFunctionDefinition %id_51 %id_src_MainPs - %id_100 = OpExtInst %id_void %id_1 DebugScope %id_54 - %id_102 = OpExtInst %id_void %id_1 DebugDeclare %id_56 %id_ps_output %id_58 - %id_106 = OpLoad %id_type_2d_image %id_g_tColor - %id_109 = OpLoad %id_type_sampler %id_g_sAniso - %id_114 = OpAccessChain %id__ptr_Function_v2float %id_i %id_int_0 - %id_115 = OpLoad %id_v2float %id_114 - %id_119 = OpSampledImage %id_type_sampled_image %id_106 %id_109 - %id_120 = OpImageSampleImplicitLod %id_v4float %id_119 %id_115 None - %id_123 = OpAccessChain %id__ptr_Function_v4float %id_ps_output %id_int_0 - OpStore %id_123 %id_120 - %id_125 = OpLoad %id_PS_OUTPUT %id_ps_output - OpReturnValue %id_125 - OpFunctionEnd -)"; - - CompileSuccessfully(ss.str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -} // namespace -} // namespace val -} // namespace spvtools diff --git a/test/val/val_ext_inst_test.cpp b/test/val/val_ext_inst_test.cpp index b014ad62..b73ec341 100644 --- a/test/val/val_ext_inst_test.cpp +++ b/test/val/val_ext_inst_test.cpp @@ -33,6 +33,33 @@ using ::testing::HasSubstr; using ::testing::Not; using ValidateExtInst = spvtest::ValidateBase; +using ValidateOldDebugInfo = spvtest::ValidateBase; +using ValidateOpenCL100DebugInfo = spvtest::ValidateBase; +using ValidateLocalDebugInfoOutOfFunction = spvtest::ValidateBase; +using ValidateOpenCL100DebugInfoDebugTypedef = + spvtest::ValidateBase>; +using ValidateOpenCL100DebugInfoDebugTypeEnum = + spvtest::ValidateBase>; +using ValidateOpenCL100DebugInfoDebugTypeComposite = + spvtest::ValidateBase>; +using ValidateOpenCL100DebugInfoDebugTypeMember = + spvtest::ValidateBase>; +using ValidateOpenCL100DebugInfoDebugTypeInheritance = + spvtest::ValidateBase>; +using ValidateOpenCL100DebugInfoDebugFunction = + spvtest::ValidateBase>; +using ValidateOpenCL100DebugInfoDebugFunctionDeclaration = + spvtest::ValidateBase>; +using ValidateOpenCL100DebugInfoDebugLexicalBlock = + spvtest::ValidateBase>; +using ValidateOpenCL100DebugInfoDebugLocalVariable = + spvtest::ValidateBase>; +using ValidateOpenCL100DebugInfoDebugGlobalVariable = + spvtest::ValidateBase>; +using ValidateOpenCL100DebugInfoDebugDeclare = + spvtest::ValidateBase>; +using ValidateOpenCL100DebugInfoDebugValue = + spvtest::ValidateBase>; using ValidateGlslStd450SqrtLike = spvtest::ValidateBase; using ValidateGlslStd450FMinLike = spvtest::ValidateBase; using ValidateGlslStd450FClampLike = spvtest::ValidateBase; @@ -461,6 +488,1685 @@ OpFunctionEnd)"; return ss.str(); } +std::string GenerateShaderCodeForDebugInfo( + const std::string& op_string_instructions, + const std::string& op_const_instructions, + const std::string& debug_instructions_before_main, const std::string& body, + const std::string& capabilities_and_extensions = "", + const std::string& execution_model = "Fragment") { + std::ostringstream ss; + ss << R"( +OpCapability Shader +OpCapability Float16 +OpCapability Float64 +OpCapability Int16 +OpCapability Int64 +)"; + + ss << capabilities_and_extensions; + ss << "%extinst = OpExtInstImport \"GLSL.std.450\"\n"; + ss << "OpMemoryModel Logical GLSL450\n"; + ss << "OpEntryPoint " << execution_model << " %main \"main\"" + << " %f32_output" + << " %f32vec2_output" + << " %u32_output" + << " %u32vec2_output" + << " %u64_output" + << " %f32_input" + << " %f32vec2_input" + << " %u32_input" + << " %u32vec2_input" + << " %u64_input" + << "\n"; + if (execution_model == "Fragment") { + ss << "OpExecutionMode %main OriginUpperLeft\n"; + } + + ss << op_string_instructions; + + ss << R"( +%void = OpTypeVoid +%func = OpTypeFunction %void +%bool = OpTypeBool +%f16 = OpTypeFloat 16 +%f32 = OpTypeFloat 32 +%f64 = OpTypeFloat 64 +%u32 = OpTypeInt 32 0 +%s32 = OpTypeInt 32 1 +%u64 = OpTypeInt 64 0 +%s64 = OpTypeInt 64 1 +%u16 = OpTypeInt 16 0 +%s16 = OpTypeInt 16 1 +%f32vec2 = OpTypeVector %f32 2 +%f32vec3 = OpTypeVector %f32 3 +%f32vec4 = OpTypeVector %f32 4 +%f64vec2 = OpTypeVector %f64 2 +%f64vec3 = OpTypeVector %f64 3 +%f64vec4 = OpTypeVector %f64 4 +%u32vec2 = OpTypeVector %u32 2 +%u32vec3 = OpTypeVector %u32 3 +%s32vec2 = OpTypeVector %s32 2 +%u32vec4 = OpTypeVector %u32 4 +%s32vec4 = OpTypeVector %s32 4 +%u64vec2 = OpTypeVector %u64 2 +%s64vec2 = OpTypeVector %s64 2 +%f64mat22 = OpTypeMatrix %f64vec2 2 +%f32mat22 = OpTypeMatrix %f32vec2 2 +%f32mat23 = OpTypeMatrix %f32vec2 3 +%f32mat32 = OpTypeMatrix %f32vec3 2 +%f32mat33 = OpTypeMatrix %f32vec3 3 + +%f32_0 = OpConstant %f32 0 +%f32_1 = OpConstant %f32 1 +%f32_2 = OpConstant %f32 2 +%f32_3 = OpConstant %f32 3 +%f32_4 = OpConstant %f32 4 +%f32_h = OpConstant %f32 0.5 +%f32vec2_01 = OpConstantComposite %f32vec2 %f32_0 %f32_1 +%f32vec2_12 = OpConstantComposite %f32vec2 %f32_1 %f32_2 +%f32vec3_012 = OpConstantComposite %f32vec3 %f32_0 %f32_1 %f32_2 +%f32vec3_123 = OpConstantComposite %f32vec3 %f32_1 %f32_2 %f32_3 +%f32vec4_0123 = OpConstantComposite %f32vec4 %f32_0 %f32_1 %f32_2 %f32_3 +%f32vec4_1234 = OpConstantComposite %f32vec4 %f32_1 %f32_2 %f32_3 %f32_4 + +%f64_0 = OpConstant %f64 0 +%f64_1 = OpConstant %f64 1 +%f64_2 = OpConstant %f64 2 +%f64_3 = OpConstant %f64 3 +%f64vec2_01 = OpConstantComposite %f64vec2 %f64_0 %f64_1 +%f64vec3_012 = OpConstantComposite %f64vec3 %f64_0 %f64_1 %f64_2 +%f64vec4_0123 = OpConstantComposite %f64vec4 %f64_0 %f64_1 %f64_2 %f64_3 + +%f16_0 = OpConstant %f16 0 +%f16_1 = OpConstant %f16 1 +%f16_h = OpConstant %f16 0.5 + +%u32_0 = OpConstant %u32 0 +%u32_1 = OpConstant %u32 1 +%u32_2 = OpConstant %u32 2 +%u32_3 = OpConstant %u32 3 + +%s32_0 = OpConstant %s32 0 +%s32_1 = OpConstant %s32 1 +%s32_2 = OpConstant %s32 2 +%s32_3 = OpConstant %s32 3 + +%u64_0 = OpConstant %u64 0 +%u64_1 = OpConstant %u64 1 +%u64_2 = OpConstant %u64 2 +%u64_3 = OpConstant %u64 3 + +%s64_0 = OpConstant %s64 0 +%s64_1 = OpConstant %s64 1 +%s64_2 = OpConstant %s64 2 +%s64_3 = OpConstant %s64 3 +)"; + + ss << op_const_instructions; + + ss << R"( +%s32vec2_01 = OpConstantComposite %s32vec2 %s32_0 %s32_1 +%u32vec2_01 = OpConstantComposite %u32vec2 %u32_0 %u32_1 + +%s32vec2_12 = OpConstantComposite %s32vec2 %s32_1 %s32_2 +%u32vec2_12 = OpConstantComposite %u32vec2 %u32_1 %u32_2 + +%s32vec4_0123 = OpConstantComposite %s32vec4 %s32_0 %s32_1 %s32_2 %s32_3 +%u32vec4_0123 = OpConstantComposite %u32vec4 %u32_0 %u32_1 %u32_2 %u32_3 + +%s64vec2_01 = OpConstantComposite %s64vec2 %s64_0 %s64_1 +%u64vec2_01 = OpConstantComposite %u64vec2 %u64_0 %u64_1 + +%f32mat22_1212 = OpConstantComposite %f32mat22 %f32vec2_12 %f32vec2_12 +%f32mat23_121212 = OpConstantComposite %f32mat23 %f32vec2_12 %f32vec2_12 %f32vec2_12 + +%f32_ptr_output = OpTypePointer Output %f32 +%f32vec2_ptr_output = OpTypePointer Output %f32vec2 + +%u32_ptr_output = OpTypePointer Output %u32 +%u32vec2_ptr_output = OpTypePointer Output %u32vec2 + +%u64_ptr_output = OpTypePointer Output %u64 + +%f32_output = OpVariable %f32_ptr_output Output +%f32vec2_output = OpVariable %f32vec2_ptr_output Output + +%u32_output = OpVariable %u32_ptr_output Output +%u32vec2_output = OpVariable %u32vec2_ptr_output Output + +%u64_output = OpVariable %u64_ptr_output Output + +%f32_ptr_input = OpTypePointer Input %f32 +%f32vec2_ptr_input = OpTypePointer Input %f32vec2 + +%u32_ptr_input = OpTypePointer Input %u32 +%u32vec2_ptr_input = OpTypePointer Input %u32vec2 + +%u64_ptr_input = OpTypePointer Input %u64 + +%f32_ptr_function = OpTypePointer Function %f32 + +%f32_input = OpVariable %f32_ptr_input Input +%f32vec2_input = OpVariable %f32vec2_ptr_input Input + +%u32_input = OpVariable %u32_ptr_input Input +%u32vec2_input = OpVariable %u32vec2_ptr_input Input + +%u64_input = OpVariable %u64_ptr_input Input + +%u32_ptr_function = OpTypePointer Function %u32 + +%struct_f16_u16 = OpTypeStruct %f16 %u16 +%struct_f32_f32 = OpTypeStruct %f32 %f32 +%struct_f32_f32_f32 = OpTypeStruct %f32 %f32 %f32 +%struct_f32_u32 = OpTypeStruct %f32 %u32 +%struct_f32_u32_f32 = OpTypeStruct %f32 %u32 %f32 +%struct_u32_f32 = OpTypeStruct %u32 %f32 +%struct_u32_u32 = OpTypeStruct %u32 %u32 +%struct_f32_f64 = OpTypeStruct %f32 %f64 +%struct_f32vec2_f32vec2 = OpTypeStruct %f32vec2 %f32vec2 +%struct_f32vec2_u32vec2 = OpTypeStruct %f32vec2 %u32vec2 +)"; + + ss << debug_instructions_before_main; + + ss << R"( +%main = OpFunction %void None %func +%main_entry = OpLabel +)"; + + ss << body; + + ss << R"( +OpReturn +OpFunctionEnd)"; + + return ss.str(); +} + +TEST_F(ValidateOldDebugInfo, UseDebugInstructionOutOfFunction) { + const std::string src = R"( +%code = OpString "main() {}" +)"; + + const std::string dbg_inst = R"( +%cu = OpExtInst %void %DbgExt DebugCompilationUnit %code 1 1 +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "DebugInfo" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst, "", + extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateOpenCL100DebugInfo, UseDebugInstructionOutOfFunction) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "main() {}" +)"; + + const std::string dbg_inst = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst, "", + extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugSourceInFunction) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "main() {}" +)"; + + const std::string dbg_inst = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", "", dbg_inst, + extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Debug info extension instructions other than DebugScope, " + "DebugNoScope, DebugDeclare, DebugValue must appear between " + "section 9 (types, constants, global variables) and section 10 " + "(function declarations)")); +} + +TEST_P(ValidateLocalDebugInfoOutOfFunction, OpenCLDebugInfo100DebugScope) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "void main() {}" +%void_name = OpString "void" +%main_name = OpString "main" +%main_linkage_name = OpString "v_main" +%int_name = OpString "int" +%foo_name = OpString "foo" +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%int_info = OpExtInst %void %DbgExt DebugTypeBasic %int_name %u32_0 Signed +%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void +%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_linkage_name FlagIsPublic 1 %main +%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %int_info %dbg_src 1 1 %main_info FlagIsLocal +%expr = OpExtInst %void %DbgExt DebugExpression +)"; + + const std::string body = R"( +%foo = OpVariable %u32_ptr_function Function +%foo_val = OpLoad %u32 %foo +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, "", dbg_inst_header + GetParam(), body, extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("DebugScope, DebugNoScope, DebugDeclare, DebugValue " + "of debug info extension must appear in a function " + "body")); +} + +INSTANTIATE_TEST_SUITE_P( + AllLocalDebugInfo, ValidateLocalDebugInfoOutOfFunction, + ::testing::ValuesIn(std::vector{ + "%main_scope = OpExtInst %void %DbgExt DebugScope %main_info", + "%no_scope = OpExtInst %void %DbgExt DebugNoScope", + })); + +TEST_F(ValidateOpenCL100DebugInfo, DebugFunctionForwardReference) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "void main() {}" +%void_name = OpString "void" +%main_name = OpString "main" +%main_linkage_name = OpString "v_main" +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void +%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_linkage_name FlagIsPublic 1 %main +)"; + + const std::string body = R"( +%main_scope = OpExtInst %void %DbgExt DebugScope %main_info +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, "", dbg_inst_header, body, extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugFunctionMissingOpFunction) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "void main() {}" +%void_name = OpString "void" +%main_name = OpString "main" +%main_linkage_name = OpString "v_main" +)"; + + const std::string dbg_inst_header = R"( +%dbgNone = OpExtInst %void %DbgExt DebugInfoNone +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void +%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_linkage_name FlagIsPublic 1 %dbgNone +)"; + + const std::string body = R"( +%main_scope = OpExtInst %void %DbgExt DebugScope %main_info +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, "", dbg_inst_header, body, extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugScopeBeforeOpVariableInFunction) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "float4 main(float arg) { + float foo; + return float4(0, 0, 0, 0); +} +" +%float_name = OpString "float" +%main_name = OpString "main" +%main_linkage_name = OpString "v4f_main_f" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%v4float_info = OpExtInst %void %DbgExt DebugTypeVector %float_info 4 +%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %v4float_info %float_info +%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %main +)"; + + const std::string body = R"( +%main_scope = OpExtInst %void %DbgExt DebugScope %main_info +%foo = OpVariable %f32_ptr_function Function +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, body, extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeCompositeSizeDebugInfoNone) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "OpaqueType foo; +main() {} +" +%ty_name = OpString "struct VS_OUTPUT" +)"; + + const std::string dbg_inst_header = R"( +%dbg_none = OpExtInst %void %DbgExt DebugInfoNone +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%opaque = OpExtInst %void %DbgExt DebugTypeComposite %ty_name Class %dbg_src 1 1 %comp_unit %ty_name %dbg_none FlagIsPublic +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst_header, + "", extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeCompositeForwardReference) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "struct VS_OUTPUT { + float4 pos : SV_POSITION; + float4 color : COLOR; +}; +main() {} +" +%VS_OUTPUT_name = OpString "struct VS_OUTPUT" +%float_name = OpString "float" +%VS_OUTPUT_pos_name = OpString "pos : SV_POSITION" +%VS_OUTPUT_color_name = OpString "color : COLOR" +%VS_OUTPUT_linkage_name = OpString "VS_OUTPUT" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +%int_128 = OpConstant %u32 128 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%VS_OUTPUT_info = OpExtInst %void %DbgExt DebugTypeComposite %VS_OUTPUT_name Structure %dbg_src 1 1 %comp_unit %VS_OUTPUT_linkage_name %int_128 FlagIsPublic %VS_OUTPUT_pos_info %VS_OUTPUT_color_info +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%v4float_info = OpExtInst %void %DbgExt DebugTypeVector %float_info 4 +%VS_OUTPUT_pos_info = OpExtInst %void %DbgExt DebugTypeMember %VS_OUTPUT_pos_name %v4float_info %dbg_src 2 3 %VS_OUTPUT_info %u32_0 %int_128 FlagIsPublic +%VS_OUTPUT_color_info = OpExtInst %void %DbgExt DebugTypeMember %VS_OUTPUT_color_name %v4float_info %dbg_src 3 3 %VS_OUTPUT_info %int_128 %int_128 FlagIsPublic +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeCompositeMissingReference) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "struct VS_OUTPUT { + float4 pos : SV_POSITION; + float4 color : COLOR; +}; +main() {} +" +%VS_OUTPUT_name = OpString "struct VS_OUTPUT" +%float_name = OpString "float" +%VS_OUTPUT_pos_name = OpString "pos : SV_POSITION" +%VS_OUTPUT_color_name = OpString "color : COLOR" +%VS_OUTPUT_linkage_name = OpString "VS_OUTPUT" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +%int_128 = OpConstant %u32 128 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%VS_OUTPUT_info = OpExtInst %void %DbgExt DebugTypeComposite %VS_OUTPUT_name Structure %dbg_src 1 1 %comp_unit %VS_OUTPUT_linkage_name %int_128 FlagIsPublic %VS_OUTPUT_pos_info %VS_OUTPUT_color_info +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%v4float_info = OpExtInst %void %DbgExt DebugTypeVector %float_info 4 +%VS_OUTPUT_pos_info = OpExtInst %void %DbgExt DebugTypeMember %VS_OUTPUT_pos_name %v4float_info %dbg_src 2 3 %VS_OUTPUT_info %u32_0 %int_128 FlagIsPublic +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("forward referenced IDs have not been defined")); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugInstructionWrongResultType) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "main() {}" +)"; + + const std::string dbg_inst = R"( +%dbg_src = OpExtInst %bool %DbgExt DebugSource %src %code +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst, "", + extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("expected result type must be a result id of " + "OpTypeVoid")); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugCompilationUnit) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "main() {}" +)"; + + const std::string dbg_inst = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst, "", + extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugCompilationUnitFail) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "main() {}" +)"; + + const std::string dbg_inst = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %src HLSL +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst, "", + extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("expected operand Source must be a result id of " + "DebugSource")); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugSourceFailFile) { + const std::string src = R"( +%code = OpString "main() {}" +)"; + + const std::string dbg_inst = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %DbgExt %code +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst, "", + extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("expected operand File must be a result id of " + "OpString")); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugSourceFailSource) { + const std::string src = R"( +%src = OpString "simple.hlsl" +)"; + + const std::string dbg_inst = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %DbgExt +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst, "", + extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("expected operand Text must be a result id of " + "OpString")); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugSourceNoText) { + const std::string src = R"( +%src = OpString "simple.hlsl" +)"; + + const std::string dbg_inst = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst, "", + extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeBasicFailName) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "float4 main(float arg) { + float foo; + return float4(0, 0, 0, 0); +} +" +%float_name = OpString "float" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %int_32 %int_32 Float +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("expected operand Name must be a result id of " + "OpString")); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeBasicFailSize) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "float4 main(float arg) { + float foo; + return float4(0, 0, 0, 0); +} +" +%float_name = OpString "float" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %float_name Float +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("expected operand Size must be a result id of " + "OpConstant")); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypePointer) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "float4 main(float arg) { + float foo; + return float4(0, 0, 0, 0); +} +" +%float_name = OpString "float" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%pfloat_info = OpExtInst %void %DbgExt DebugTypePointer %float_info Function FlagIsLocal +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypePointerFail) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "float4 main(float arg) { + float foo; + return float4(0, 0, 0, 0); +} +" +%float_name = OpString "float" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%pfloat_info = OpExtInst %void %DbgExt DebugTypePointer %dbg_src Function FlagIsLocal +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("expected operand Base Type must be a result id of " + "DebugTypeBasic")); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeQualifier) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "float4 main(float arg) { + float foo; + return float4(0, 0, 0, 0); +} +" +%float_name = OpString "float" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%cfloat_info = OpExtInst %void %DbgExt DebugTypeQualifier %float_info ConstType +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeQualifierFail) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "float4 main(float arg) { + float foo; + return float4(0, 0, 0, 0); +} +" +%float_name = OpString "float" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%cfloat_info = OpExtInst %void %DbgExt DebugTypeQualifier %comp_unit ConstType +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("expected operand Base Type must be a result id of " + "DebugTypeBasic")); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeArray) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "main() {}" +%float_name = OpString "float" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %int_32 +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeArrayWithVariableSize) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "main() {}" +%float_name = OpString "float" +%int_name = OpString "int" +%main_name = OpString "main" +%foo_name = OpString "foo" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%uint_info = OpExtInst %void %DbgExt DebugTypeBasic %int_name %int_32 Unsigned +%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void +%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_name FlagIsPublic 1 %main +%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %uint_info %dbg_src 1 1 %main_info FlagIsLocal +%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %foo_info +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeArrayFailBaseType) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "main() {}" +%float_name = OpString "float" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %comp_unit %int_32 +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("expected operand Base Type is not a valid debug " + "type")); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeArrayFailComponentCount) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "main() {}" +%float_name = OpString "float" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %float_info +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Component Count must be OpConstant with a 32- or " + "64-bits integer scalar type or DebugGlobalVariable or " + "DebugLocalVariable with a 32- or 64-bits unsigned " + "integer scalar type")); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeArrayFailComponentCountFloat) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "main() {}" +%float_name = OpString "float" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %f32_4 +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Component Count must be OpConstant with a 32- or " + "64-bits integer scalar type or DebugGlobalVariable or " + "DebugLocalVariable with a 32- or 64-bits unsigned " + "integer scalar type")); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeArrayFailComponentCountZero) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "main() {}" +%float_name = OpString "float" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %u32_0 +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Component Count must be OpConstant with a 32- or " + "64-bits integer scalar type or DebugGlobalVariable or " + "DebugLocalVariable with a 32- or 64-bits unsigned " + "integer scalar type")); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeArrayFailVariableSizeTypeFloat) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "main() {}" +%float_name = OpString "float" +%main_name = OpString "main" +%foo_name = OpString "foo" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void +%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_name FlagIsPublic 1 %main +%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %float_info %dbg_src 1 1 %main_info FlagIsLocal +%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %foo_info +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Component Count must be OpConstant with a 32- or " + "64-bits integer scalar type or DebugGlobalVariable or " + "DebugLocalVariable with a 32- or 64-bits unsigned " + "integer scalar type")); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeVector) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "main() {}" +%float_name = OpString "float" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%vfloat_info = OpExtInst %void %DbgExt DebugTypeVector %float_info 4 +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeVectorFail) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "main() {}" +%float_name = OpString "float" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%vfloat_info = OpExtInst %void %DbgExt DebugTypeVector %dbg_src 4 +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("expected operand Base Type must be a result id of " + "DebugTypeBasic")); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeVectorFailComponentZero) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "main() {}" +%float_name = OpString "float" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%vfloat_info = OpExtInst %void %DbgExt DebugTypeVector %dbg_src 0 +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("expected operand Base Type must be a result id of " + "DebugTypeBasic")); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeVectorFailComponentFive) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "main() {}" +%float_name = OpString "float" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%vfloat_info = OpExtInst %void %DbgExt DebugTypeVector %dbg_src 5 +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("expected operand Base Type must be a result id of " + "DebugTypeBasic")); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypedef) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "main() {}" +%float_name = OpString "float" +%foo_name = OpString "foo" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%foo_info = OpExtInst %void %DbgExt DebugTypedef %foo_name %float_info %dbg_src 1 1 %comp_unit +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCL100DebugInfoDebugTypedef, Fail) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "main() {}" +%float_name = OpString "float" +%foo_name = OpString "foo" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const auto& param = GetParam(); + + std::ostringstream ss; + ss << R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%foo_info = OpExtInst %void %DbgExt DebugTypedef )"; + ss << param.first; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, size_const, ss.str(), + "", extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("expected operand " + param.second + + " must be a result id of ")); +} + +INSTANTIATE_TEST_SUITE_P( + AllOpenCL100DebugInfoFail, ValidateOpenCL100DebugInfoDebugTypedef, + ::testing::ValuesIn(std::vector>{ + std::make_pair(R"(%dbg_src %float_info %dbg_src 1 1 %comp_unit)", + "Name"), + std::make_pair(R"(%foo_name %dbg_src %dbg_src 1 1 %comp_unit)", + "Base Type"), + std::make_pair(R"(%foo_name %float_info %comp_unit 1 1 %comp_unit)", + "Source"), + std::make_pair(R"(%foo_name %float_info %dbg_src 1 1 %dbg_src)", + "Parent"), + })); + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeFunction) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "main() {}" +%main_name = OpString "main" +%main_linkage_name = OpString "v_main" +%float_name = OpString "float" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%main_type_info1 = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void +%main_type_info2 = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %float_info +%main_type_info3 = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %float_info %float_info +%main_type_info4 = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void %float_info %float_info +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeFunctionFailReturn) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "main() {}" +%main_name = OpString "main" +%main_linkage_name = OpString "v_main" +%float_name = OpString "float" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %dbg_src %float_info +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("expected operand Return Type is not a valid debug type")); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeFunctionFailParam) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "main() {}" +%main_name = OpString "main" +%main_linkage_name = OpString "v_main" +%float_name = OpString "float" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %float_info %void +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("expected operand Parameter Types is not a valid debug type")); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeEnum) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "main() {}" +%float_name = OpString "float" +%foo_name = OpString "foo" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%none = OpExtInst %void %DbgExt DebugInfoNone +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%foo_info1 = OpExtInst %void %DbgExt DebugTypeEnum %foo_name %float_info %dbg_src 1 1 %comp_unit %int_32 FlagIsPublic %u32_0 %foo_name %u32_1 %foo_name +%foo_info2 = OpExtInst %void %DbgExt DebugTypeEnum %foo_name %none %dbg_src 1 1 %comp_unit %int_32 FlagIsPublic %u32_0 %foo_name %u32_1 %foo_name +%foo_info3 = OpExtInst %void %DbgExt DebugTypeEnum %foo_name %none %dbg_src 1 1 %comp_unit %int_32 FlagIsPublic +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCL100DebugInfoDebugTypeEnum, Fail) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "main() {}" +%float_name = OpString "float" +%foo_name = OpString "foo" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const auto& param = GetParam(); + + std::ostringstream ss; + ss << R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%foo_info = OpExtInst %void %DbgExt DebugTypeEnum )"; + ss << param.first; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, size_const, ss.str(), + "", extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("expected operand " + param.second)); +} + +INSTANTIATE_TEST_SUITE_P( + AllOpenCL100DebugInfoFail, ValidateOpenCL100DebugInfoDebugTypeEnum, + ::testing::ValuesIn(std::vector>{ + std::make_pair( + R"(%dbg_src %float_info %dbg_src 1 1 %comp_unit %int_32 FlagIsPublic %u32_0 %foo_name)", + "Name"), + std::make_pair( + R"(%foo_name %dbg_src %dbg_src 1 1 %comp_unit %int_32 FlagIsPublic %u32_0 %foo_name)", + "Underlying Types"), + std::make_pair( + R"(%foo_name %float_info %comp_unit 1 1 %comp_unit %int_32 FlagIsPublic %u32_0 %foo_name)", + "Source"), + std::make_pair( + R"(%foo_name %float_info %dbg_src 1 1 %dbg_src %int_32 FlagIsPublic %u32_0 %foo_name)", + "Parent"), + std::make_pair( + R"(%foo_name %float_info %dbg_src 1 1 %comp_unit %void FlagIsPublic %u32_0 %foo_name)", + "Size"), + std::make_pair( + R"(%foo_name %float_info %dbg_src 1 1 %comp_unit %u32_0 FlagIsPublic %u32_0 %foo_name)", + "Size"), + std::make_pair( + R"(%foo_name %float_info %dbg_src 1 1 %comp_unit %int_32 FlagIsPublic %foo_name %foo_name)", + "Value"), + std::make_pair( + R"(%foo_name %float_info %dbg_src 1 1 %comp_unit %int_32 FlagIsPublic %u32_0 %u32_1)", + "Name"), + })); + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeCompositeFunctionAndInheritance) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "struct VS_OUTPUT { + float4 pos : SV_POSITION; +}; +struct foo : VS_OUTPUT { +}; +main() {} +" +%VS_OUTPUT_name = OpString "struct VS_OUTPUT" +%float_name = OpString "float" +%foo_name = OpString "foo" +%VS_OUTPUT_pos_name = OpString "pos : SV_POSITION" +%VS_OUTPUT_linkage_name = OpString "VS_OUTPUT" +%main_name = OpString "main" +%main_linkage_name = OpString "v4f_main_f" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +%int_128 = OpConstant %u32 128 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%VS_OUTPUT_info = OpExtInst %void %DbgExt DebugTypeComposite %VS_OUTPUT_name Structure %dbg_src 1 1 %comp_unit %VS_OUTPUT_linkage_name %int_128 FlagIsPublic %VS_OUTPUT_pos_info %main_info %child +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%v4float_info = OpExtInst %void %DbgExt DebugTypeVector %float_info 4 +%VS_OUTPUT_pos_info = OpExtInst %void %DbgExt DebugTypeMember %VS_OUTPUT_pos_name %v4float_info %dbg_src 2 3 %VS_OUTPUT_info %u32_0 %int_128 FlagIsPublic +%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %v4float_info %float_info +%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %main +%foo_info = OpExtInst %void %DbgExt DebugTypeComposite %foo_name Structure %dbg_src 1 1 %comp_unit %foo_name %u32_0 FlagIsPublic +%child = OpExtInst %void %DbgExt DebugTypeInheritance %foo_info %VS_OUTPUT_info %int_128 %int_128 FlagIsPublic +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCL100DebugInfoDebugTypeComposite, Fail) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "struct VS_OUTPUT { + float4 pos : SV_POSITION; +}; +struct foo : VS_OUTPUT { +}; +main() {} +" +%VS_OUTPUT_name = OpString "struct VS_OUTPUT" +%float_name = OpString "float" +%foo_name = OpString "foo" +%VS_OUTPUT_pos_name = OpString "pos : SV_POSITION" +%VS_OUTPUT_linkage_name = OpString "VS_OUTPUT" +%main_name = OpString "main" +%main_linkage_name = OpString "v4f_main_f" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +%int_128 = OpConstant %u32 128 +)"; + + const auto& param = GetParam(); + + std::ostringstream ss; + ss << R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%VS_OUTPUT_info = OpExtInst %void %DbgExt DebugTypeComposite )"; + ss << param.first; + ss << R"( +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%v4float_info = OpExtInst %void %DbgExt DebugTypeVector %float_info 4 +%VS_OUTPUT_pos_info = OpExtInst %void %DbgExt DebugTypeMember %VS_OUTPUT_pos_name %v4float_info %dbg_src 2 3 %VS_OUTPUT_info %u32_0 %int_128 FlagIsPublic +%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %v4float_info %float_info +%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %main +%foo_info = OpExtInst %void %DbgExt DebugTypeComposite %foo_name Structure %dbg_src 1 1 %comp_unit %foo_name %u32_0 FlagIsPublic +%child = OpExtInst %void %DbgExt DebugTypeInheritance %foo_info %VS_OUTPUT_info %int_128 %int_128 FlagIsPublic +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, size_const, ss.str(), + "", extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("expected operand " + param.second + " must be ")); +} + +INSTANTIATE_TEST_SUITE_P( + AllOpenCL100DebugInfoFail, ValidateOpenCL100DebugInfoDebugTypeComposite, + ::testing::ValuesIn(std::vector>{ + std::make_pair( + R"(%dbg_src Structure %dbg_src 1 1 %comp_unit %VS_OUTPUT_linkage_name %int_128 FlagIsPublic %VS_OUTPUT_pos_info %main_info %child)", + "Name"), + std::make_pair( + R"(%VS_OUTPUT_name Structure %comp_unit 1 1 %comp_unit %VS_OUTPUT_linkage_name %int_128 FlagIsPublic %VS_OUTPUT_pos_info %main_info %child)", + "Source"), + std::make_pair( + R"(%VS_OUTPUT_name Structure %dbg_src 1 1 %dbg_src %VS_OUTPUT_linkage_name %int_128 FlagIsPublic %VS_OUTPUT_pos_info %main_info %child)", + "Parent"), + std::make_pair( + R"(%VS_OUTPUT_name Structure %dbg_src 1 1 %comp_unit %int_128 %int_128 FlagIsPublic %VS_OUTPUT_pos_info %main_info %child)", + "Linkage Name"), + std::make_pair( + R"(%VS_OUTPUT_name Structure %dbg_src 1 1 %comp_unit %VS_OUTPUT_linkage_name %dbg_src FlagIsPublic %VS_OUTPUT_pos_info %main_info %child)", + "Size"), + std::make_pair( + R"(%VS_OUTPUT_name Structure %dbg_src 1 1 %comp_unit %VS_OUTPUT_linkage_name %int_128 FlagIsPublic %dbg_src %main_info %child)", + "Members"), + std::make_pair( + R"(%VS_OUTPUT_name Structure %dbg_src 1 1 %comp_unit %VS_OUTPUT_linkage_name %int_128 FlagIsPublic %VS_OUTPUT_pos_info %dbg_src %child)", + "Members"), + std::make_pair( + R"(%VS_OUTPUT_name Structure %dbg_src 1 1 %comp_unit %VS_OUTPUT_linkage_name %int_128 FlagIsPublic %VS_OUTPUT_pos_info %main_info %dbg_src)", + "Members"), + })); + +TEST_P(ValidateOpenCL100DebugInfoDebugTypeMember, Fail) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "struct VS_OUTPUT { + float pos : SV_POSITION; +}; +main() {} +" +%VS_OUTPUT_name = OpString "struct VS_OUTPUT" +%float_name = OpString "float" +%VS_OUTPUT_pos_name = OpString "pos : SV_POSITION" +%VS_OUTPUT_linkage_name = OpString "VS_OUTPUT" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const auto& param = GetParam(); + + std::ostringstream ss; + ss << R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%VS_OUTPUT_info = OpExtInst %void %DbgExt DebugTypeComposite %VS_OUTPUT_name Structure %dbg_src 1 1 %comp_unit %VS_OUTPUT_linkage_name %int_32 FlagIsPublic %VS_OUTPUT_pos_info +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%VS_OUTPUT_pos_info = OpExtInst %void %DbgExt DebugTypeMember )"; + ss << param.first; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, size_const, ss.str(), + "", extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + if (!param.second.empty()) { + EXPECT_THAT(getDiagnosticString(), + HasSubstr("expected operand " + param.second + + " must be a result id of ")); + } +} + +INSTANTIATE_TEST_SUITE_P( + AllOpenCL100DebugInfoFail, ValidateOpenCL100DebugInfoDebugTypeMember, + ::testing::ValuesIn(std::vector>{ + std::make_pair( + R"(%dbg_src %float_info %dbg_src 2 3 %VS_OUTPUT_info %u32_0 %int_32 FlagIsPublic)", + "Name"), + std::make_pair( + R"(%VS_OUTPUT_pos_name %dbg_src %dbg_src 2 3 %VS_OUTPUT_info %u32_0 %int_32 FlagIsPublic)", + ""), + std::make_pair( + R"(%VS_OUTPUT_pos_name %float_info %float_info 2 3 %VS_OUTPUT_info %u32_0 %int_32 FlagIsPublic)", + "Source"), + std::make_pair( + R"(%VS_OUTPUT_pos_name %float_info %dbg_src 2 3 %float_info %u32_0 %int_32 FlagIsPublic)", + "Parent"), + std::make_pair( + R"(%VS_OUTPUT_pos_name %float_info %dbg_src 2 3 %VS_OUTPUT_info %void %int_32 FlagIsPublic)", + "Offset"), + std::make_pair( + R"(%VS_OUTPUT_pos_name %float_info %dbg_src 2 3 %VS_OUTPUT_info %u32_0 %void FlagIsPublic)", + "Size"), + })); + +TEST_P(ValidateOpenCL100DebugInfoDebugTypeInheritance, Fail) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "struct VS_OUTPUT {}; +struct foo : VS_OUTPUT {}; +" +%VS_OUTPUT_name = OpString "struct VS_OUTPUT" +%foo_name = OpString "foo" +)"; + + const auto& param = GetParam(); + + std::ostringstream ss; + ss << R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%VS_OUTPUT_info = OpExtInst %void %DbgExt DebugTypeComposite %VS_OUTPUT_name Structure %dbg_src 1 1 %comp_unit %VS_OUTPUT_name %u32_0 FlagIsPublic %child +%foo_info = OpExtInst %void %DbgExt DebugTypeComposite %foo_name Structure %dbg_src 1 1 %comp_unit %foo_name %u32_0 FlagIsPublic +%bar_info = OpExtInst %void %DbgExt DebugTypeComposite %foo_name Union %dbg_src 1 1 %comp_unit %foo_name %u32_0 FlagIsPublic +%child = OpExtInst %void %DbgExt DebugTypeInheritance )" + << param.first; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", ss.str(), "", + extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("expected operand " + param.second)); +} + +INSTANTIATE_TEST_SUITE_P( + AllOpenCL100DebugInfoFail, ValidateOpenCL100DebugInfoDebugTypeInheritance, + ::testing::ValuesIn(std::vector>{ + std::make_pair(R"(%dbg_src %VS_OUTPUT_info %u32_0 %u32_0 FlagIsPublic)", + "Child must be a result id of"), + std::make_pair(R"(%foo_info %dbg_src %u32_0 %u32_0 FlagIsPublic)", + "Parent must be a result id of"), + std::make_pair( + R"(%bar_info %VS_OUTPUT_info %u32_0 %u32_0 FlagIsPublic)", + "Child must be class or struct debug type"), + std::make_pair(R"(%foo_info %bar_info %u32_0 %u32_0 FlagIsPublic)", + "Parent must be class or struct debug type"), + std::make_pair(R"(%foo_info %VS_OUTPUT_info %void %u32_0 FlagIsPublic)", + "Offset"), + std::make_pair(R"(%foo_info %VS_OUTPUT_info %u32_0 %void FlagIsPublic)", + "Size"), + })); TEST_P(ValidateGlslStd450SqrtLike, Success) { const std::string ext_inst_name = GetParam(); std::ostringstream ss; @@ -472,6 +2178,1086 @@ TEST_P(ValidateGlslStd450SqrtLike, Success) { ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); } +TEST_F(ValidateOpenCL100DebugInfo, DebugFunctionDeclaration) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "struct VS_OUTPUT { + float4 pos : SV_POSITION; +}; +main() {} +" +%main_name = OpString "main" +%main_linkage_name = OpString "v4f_main_f" +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void +%main_decl = OpExtInst %void %DbgExt DebugFunctionDeclaration %main_name %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic +%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %main)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst_header, + "", extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCL100DebugInfoDebugFunction, Fail) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "struct VS_OUTPUT { + float4 pos : SV_POSITION; +}; +main() {} +" +%main_name = OpString "main" +%main_linkage_name = OpString "v4f_main_f" +)"; + + const auto& param = GetParam(); + + std::ostringstream ss; + ss << R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void +%main_decl = OpExtInst %void %DbgExt DebugFunctionDeclaration %main_name %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic +%main_info = OpExtInst %void %DbgExt DebugFunction )" + << param.first; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", ss.str(), "", + extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("expected operand " + param.second)); +} + +INSTANTIATE_TEST_SUITE_P( + AllOpenCL100DebugInfoFail, ValidateOpenCL100DebugInfoDebugFunction, + ::testing::ValuesIn(std::vector>{ + std::make_pair( + R"(%u32_0 %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %main)", + "Name"), + std::make_pair( + R"(%main_name %dbg_src %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %main)", + "Type"), + std::make_pair( + R"(%main_name %main_type_info %comp_unit 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %main)", + "Source"), + std::make_pair( + R"(%main_name %main_type_info %dbg_src 12 1 %dbg_src %main_linkage_name FlagIsPublic 13 %main)", + "Parent"), + std::make_pair( + R"(%main_name %main_type_info %dbg_src 12 1 %comp_unit %void FlagIsPublic 13 %main)", + "Linkage Name"), + std::make_pair( + R"(%main_name %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %void)", + "Function"), + std::make_pair( + R"(%main_name %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %main %dbg_src)", + "Declaration"), + })); + +TEST_P(ValidateOpenCL100DebugInfoDebugFunctionDeclaration, Fail) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "struct VS_OUTPUT { + float4 pos : SV_POSITION; +}; +main() {} +" +%main_name = OpString "main" +%main_linkage_name = OpString "v4f_main_f" +)"; + + const auto& param = GetParam(); + + std::ostringstream ss; + ss << R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void +%main_decl = OpExtInst %void %DbgExt DebugFunctionDeclaration )" + << param.first; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", ss.str(), "", + extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("expected operand " + param.second)); +} + +INSTANTIATE_TEST_SUITE_P( + AllOpenCL100DebugInfoFail, + ValidateOpenCL100DebugInfoDebugFunctionDeclaration, + ::testing::ValuesIn(std::vector>{ + std::make_pair( + R"(%u32_0 %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic)", + "Name"), + std::make_pair( + R"(%main_name %dbg_src %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic)", + "Type"), + std::make_pair( + R"(%main_name %main_type_info %comp_unit 12 1 %comp_unit %main_linkage_name FlagIsPublic)", + "Source"), + std::make_pair( + R"(%main_name %main_type_info %dbg_src 12 1 %dbg_src %main_linkage_name FlagIsPublic)", + "Parent"), + std::make_pair( + R"(%main_name %main_type_info %dbg_src 12 1 %comp_unit %void FlagIsPublic)", + "Linkage Name"), + })); + +TEST_F(ValidateOpenCL100DebugInfo, DebugLexicalBlock) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "main() {}" +%main_name = OpString "main" +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%main_block = OpExtInst %void %DbgExt DebugLexicalBlock %dbg_src 1 1 %comp_unit %main_name)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst_header, + "", extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCL100DebugInfoDebugLexicalBlock, Fail) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "main() {}" +%main_name = OpString "main" +)"; + + const auto& param = GetParam(); + + std::ostringstream ss; + ss << R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%main_block = OpExtInst %void %DbgExt DebugLexicalBlock )" + << param.first; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", ss.str(), "", + extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("expected operand " + param.second)); +} + +INSTANTIATE_TEST_SUITE_P( + AllOpenCL100DebugInfoFail, ValidateOpenCL100DebugInfoDebugLexicalBlock, + ::testing::ValuesIn(std::vector>{ + std::make_pair(R"(%comp_unit 1 1 %comp_unit %main_name)", "Source"), + std::make_pair(R"(%dbg_src 1 1 %dbg_src %main_name)", "Parent"), + std::make_pair(R"(%dbg_src 1 1 %comp_unit %void)", "Name"), + })); + +TEST_F(ValidateOpenCL100DebugInfo, DebugScopeFailScope) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "void main() {}" +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +)"; + + const std::string body = R"( +%main_scope = OpExtInst %void %DbgExt DebugScope %dbg_src +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, "", dbg_inst_header, body, extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("expected operand Scope")); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugScopeFailInlinedAt) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "void main() {}" +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +)"; + + const std::string body = R"( +%main_scope = OpExtInst %void %DbgExt DebugScope %comp_unit %dbg_src +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, "", dbg_inst_header, body, extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("expected operand Inlined At")); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugLocalVariable) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "void main() { float foo; }" +%float_name = OpString "float" +%foo_name = OpString "foo" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%foo = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %float_info %dbg_src 1 10 %comp_unit FlagIsLocal 0 +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCL100DebugInfoDebugLocalVariable, Fail) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "void main() { float foo; }" +%float_name = OpString "float" +%foo_name = OpString "foo" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const auto& param = GetParam(); + + std::ostringstream ss; + ss << R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%foo = OpExtInst %void %DbgExt DebugLocalVariable )" + << param.first; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, size_const, ss.str(), + "", extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("expected operand " + param.second)); +} + +INSTANTIATE_TEST_SUITE_P( + AllOpenCL100DebugInfoFail, ValidateOpenCL100DebugInfoDebugLocalVariable, + ::testing::ValuesIn(std::vector>{ + std::make_pair( + R"(%void %float_info %dbg_src 1 10 %comp_unit FlagIsLocal 0)", + "Name"), + std::make_pair( + R"(%foo_name %dbg_src %dbg_src 1 10 %comp_unit FlagIsLocal 0)", + "Type"), + std::make_pair( + R"(%foo_name %float_info %comp_unit 1 10 %comp_unit FlagIsLocal 0)", + "Source"), + std::make_pair( + R"(%foo_name %float_info %dbg_src 1 10 %dbg_src FlagIsLocal 0)", + "Parent"), + })); + +TEST_F(ValidateOpenCL100DebugInfo, DebugDeclare) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "void main() { float foo; }" +%float_name = OpString "float" +%foo_name = OpString "foo" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%null_expr = OpExtInst %void %DbgExt DebugExpression +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %float_info %dbg_src 1 10 %comp_unit FlagIsLocal 0 +)"; + + const std::string body = R"( +%foo = OpVariable %f32_ptr_function Function +%decl = OpExtInst %void %DbgExt DebugDeclare %foo_info %foo %null_expr +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, body, extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugDeclareParam) { + CompileSuccessfully(R"( + OpCapability Shader + %1 = OpExtInstImport "OpenCL.DebugInfo.100" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %main "main" %in_var_COLOR + %4 = OpString "test.hlsl" + OpSource HLSL 620 %4 "#line 1 \"test.hlsl\" +void main(float foo:COLOR) {} +" + %11 = OpString "#line 1 \"test.hlsl\" +void main(float foo:COLOR) {} +" + %14 = OpString "float" + %17 = OpString "src.main" + %20 = OpString "foo" + OpName %in_var_COLOR "in.var.COLOR" + OpName %main "main" + OpName %param_var_foo "param.var.foo" + OpName %src_main "src.main" + OpName %foo "foo" + OpName %bb_entry "bb.entry" + OpDecorate %in_var_COLOR Location 0 + %uint = OpTypeInt 32 0 + %uint_32 = OpConstant %uint 32 + %float = OpTypeFloat 32 +%_ptr_Input_float = OpTypePointer Input %float + %void = OpTypeVoid + %23 = OpTypeFunction %void +%_ptr_Function_float = OpTypePointer Function %float + %29 = OpTypeFunction %void %_ptr_Function_float + OpLine %4 1 21 +%in_var_COLOR = OpVariable %_ptr_Input_float Input + %10 = OpExtInst %void %1 DebugExpression + %12 = OpExtInst %void %1 DebugSource %4 %11 + %13 = OpExtInst %void %1 DebugCompilationUnit 1 4 %12 HLSL + %15 = OpExtInst %void %1 DebugTypeBasic %14 %uint_32 Float + %16 = OpExtInst %void %1 DebugTypeFunction FlagIsProtected|FlagIsPrivate %void %15 + %18 = OpExtInst %void %1 DebugFunction %17 %16 %12 1 1 %13 %17 FlagIsProtected|FlagIsPrivate 1 %src_main + %21 = OpExtInst %void %1 DebugLocalVariable %20 %15 %12 1 17 %18 FlagIsLocal 0 + %22 = OpExtInst %void %1 DebugLexicalBlock %12 1 28 %18 + OpLine %4 1 1 + %main = OpFunction %void None %23 + %24 = OpLabel + OpLine %4 1 17 +%param_var_foo = OpVariable %_ptr_Function_float Function + %27 = OpLoad %float %in_var_COLOR + OpLine %4 1 1 + %28 = OpFunctionCall %void %src_main %param_var_foo + OpReturn + OpFunctionEnd + %src_main = OpFunction %void None %29 + OpLine %4 1 17 + %foo = OpFunctionParameter %_ptr_Function_float + %31 = OpExtInst %void %1 DebugDeclare %21 %foo %10 + %bb_entry = OpLabel + OpLine %4 1 29 + OpReturn + OpFunctionEnd +)"); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCL100DebugInfoDebugDeclare, Fail) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "void main() { float foo; }" +%float_name = OpString "float" +%foo_name = OpString "foo" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%null_expr = OpExtInst %void %DbgExt DebugExpression +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %float_info %dbg_src 1 10 %comp_unit FlagIsLocal 0 +)"; + + const auto& param = GetParam(); + + std::ostringstream ss; + ss << R"( +%foo = OpVariable %f32_ptr_function Function +%decl = OpExtInst %void %DbgExt DebugDeclare )" + << param.first; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, ss.str(), extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("expected operand " + param.second)); +} + +INSTANTIATE_TEST_SUITE_P( + AllOpenCL100DebugInfoFail, ValidateOpenCL100DebugInfoDebugDeclare, + ::testing::ValuesIn(std::vector>{ + std::make_pair(R"(%dbg_src %foo %null_expr)", "Local Variable"), + std::make_pair(R"(%foo_info %void %null_expr)", "Variable"), + std::make_pair(R"(%foo_info %foo %dbg_src)", "Expression"), + })); + +TEST_F(ValidateOpenCL100DebugInfo, DebugExpression) { + const std::string dbg_inst_header = R"( +%op0 = OpExtInst %void %DbgExt DebugOperation Deref +%op1 = OpExtInst %void %DbgExt DebugOperation Plus +%null_expr = OpExtInst %void %DbgExt DebugExpression %op0 %op1 +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo("", "", dbg_inst_header, + "", extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugExpressionFail) { + const std::string dbg_inst_header = R"( +%op = OpExtInst %void %DbgExt DebugOperation Deref +%null_expr = OpExtInst %void %DbgExt DebugExpression %op %void +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo("", "", dbg_inst_header, + "", extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "expected operand Operation must be a result id of DebugOperation")); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeTemplate) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "OpaqueType foo; +main() {} +" +%float_name = OpString "float" +%ty_name = OpString "Texture" +%t_name = OpString "T" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +%int_128 = OpConstant %u32 128 +)"; + + const std::string dbg_inst_header = R"( +%dbg_none = OpExtInst %void %DbgExt DebugInfoNone +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%opaque = OpExtInst %void %DbgExt DebugTypeComposite %ty_name Class %dbg_src 1 1 %comp_unit %ty_name %dbg_none FlagIsPublic +%param = OpExtInst %void %DbgExt DebugTypeTemplateParameter %t_name %float_info %dbg_none %dbg_src 0 0 +%temp = OpExtInst %void %DbgExt DebugTypeTemplate %opaque %param +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeTemplateUsedForVariableType) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "OpaqueType foo; +main() {} +" +%float_name = OpString "float" +%ty_name = OpString "Texture" +%t_name = OpString "T" +%foo_name = OpString "foo" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +%int_128 = OpConstant %u32 128 +)"; + + const std::string dbg_inst_header = R"( +%dbg_none = OpExtInst %void %DbgExt DebugInfoNone +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%opaque = OpExtInst %void %DbgExt DebugTypeComposite %ty_name Class %dbg_src 1 1 %comp_unit %ty_name %dbg_none FlagIsPublic +%param = OpExtInst %void %DbgExt DebugTypeTemplateParameter %t_name %float_info %dbg_none %dbg_src 0 0 +%temp = OpExtInst %void %DbgExt DebugTypeTemplate %opaque %param +%foo = OpExtInst %void %DbgExt DebugGlobalVariable %foo_name %temp %dbg_src 0 0 %comp_unit %foo_name %f32_input FlagIsProtected|FlagIsPrivate +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeTemplateFunction) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "OpaqueType foo; +main() {} +" +%float_name = OpString "float" +%ty_name = OpString "Texture" +%t_name = OpString "T" +%main_name = OpString "main" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +%int_128 = OpConstant %u32 128 +)"; + + const std::string dbg_inst_header = R"( +%dbg_none = OpExtInst %void %DbgExt DebugInfoNone +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%param = OpExtInst %void %DbgExt DebugTypeTemplateParameter %t_name %float_info %dbg_none %dbg_src 0 0 +%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %param %param +%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_name FlagIsPublic 1 %main +%temp = OpExtInst %void %DbgExt DebugTypeTemplate %main_info %param +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeTemplateFailTarget) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "OpaqueType foo; +main() {} +" +%float_name = OpString "float" +%ty_name = OpString "Texture" +%t_name = OpString "T" +%main_name = OpString "main" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +%int_128 = OpConstant %u32 128 +)"; + + const std::string dbg_inst_header = R"( +%dbg_none = OpExtInst %void %DbgExt DebugInfoNone +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%param = OpExtInst %void %DbgExt DebugTypeTemplateParameter %t_name %float_info %dbg_none %dbg_src 0 0 +%temp = OpExtInst %void %DbgExt DebugTypeTemplate %float_info %param +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("expected operand Target must be DebugTypeComposite or " + "DebugFunction")); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugTypeTemplateFailParam) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "OpaqueType foo; +main() {} +" +%float_name = OpString "float" +%ty_name = OpString "Texture" +%t_name = OpString "T" +%main_name = OpString "main" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +%int_128 = OpConstant %u32 128 +)"; + + const std::string dbg_inst_header = R"( +%dbg_none = OpExtInst %void %DbgExt DebugInfoNone +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%param = OpExtInst %void %DbgExt DebugTypeTemplateParameter %t_name %float_info %dbg_none %dbg_src 0 0 +%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %param %param +%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_name FlagIsPublic 1 %main +%temp = OpExtInst %void %DbgExt DebugTypeTemplate %main_info %float_info +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "expected operand Parameters must be DebugTypeTemplateParameter or " + "DebugTypeTemplateTemplateParameter")); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugGlobalVariable) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "float foo; void main() {}" +%float_name = OpString "float" +%foo_name = OpString "foo" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%foo = OpExtInst %void %DbgExt DebugGlobalVariable %foo_name %float_info %dbg_src 0 0 %comp_unit %foo_name %f32_input FlagIsProtected|FlagIsPrivate +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugGlobalVariableStaticMember) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "float foo; void main() {}" +%float_name = OpString "float" +%foo_name = OpString "foo" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%t = OpExtInst %void %DbgExt DebugTypeComposite %foo_name Class %dbg_src 0 0 %comp_unit %foo_name %int_32 FlagIsPublic %a +%a = OpExtInst %void %DbgExt DebugTypeMember %foo_name %float_info %dbg_src 0 0 %t %u32_0 %int_32 FlagIsPublic +%foo = OpExtInst %void %DbgExt DebugGlobalVariable %foo_name %float_info %dbg_src 0 0 %comp_unit %foo_name %f32_input FlagIsProtected|FlagIsPrivate %a +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugGlobalVariableDebugInfoNone) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "float foo; void main() {}" +%float_name = OpString "float" +%foo_name = OpString "foo" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbgNone = OpExtInst %void %DbgExt DebugInfoNone +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%foo = OpExtInst %void %DbgExt DebugGlobalVariable %foo_name %float_info %dbg_src 0 0 %comp_unit %foo_name %dbgNone FlagIsProtected|FlagIsPrivate +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugGlobalVariableConst) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "float foo; void main() {}" +%float_name = OpString "float" +%foo_name = OpString "foo" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%foo = OpExtInst %void %DbgExt DebugGlobalVariable %foo_name %float_info %dbg_src 0 0 %comp_unit %foo_name %int_32 FlagIsProtected|FlagIsPrivate +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, "", extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCL100DebugInfoDebugGlobalVariable, Fail) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "float foo; void main() {}" +%float_name = OpString "float" +%foo_name = OpString "foo" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const auto& param = GetParam(); + + std::ostringstream ss; + ss << R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%foo = OpExtInst %void %DbgExt DebugGlobalVariable )" + << param.first; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, size_const, ss.str(), + "", extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("expected operand " + param.second)); +} + +INSTANTIATE_TEST_SUITE_P( + AllOpenCL100DebugInfoFail, ValidateOpenCL100DebugInfoDebugGlobalVariable, + ::testing::ValuesIn(std::vector>{ + std::make_pair( + R"(%void %float_info %dbg_src 0 0 %comp_unit %foo_name %f32_input FlagIsProtected|FlagIsPrivate)", + "Name"), + std::make_pair( + R"(%foo_name %dbg_src %dbg_src 0 0 %comp_unit %foo_name %f32_input FlagIsProtected|FlagIsPrivate)", + "Type"), + std::make_pair( + R"(%foo_name %float_info %comp_unit 0 0 %comp_unit %foo_name %f32_input FlagIsProtected|FlagIsPrivate)", + "Source"), + std::make_pair( + R"(%foo_name %float_info %dbg_src 0 0 %dbg_src %foo_name %f32_input FlagIsProtected|FlagIsPrivate)", + "Scope"), + std::make_pair( + R"(%foo_name %float_info %dbg_src 0 0 %comp_unit %void %f32_input FlagIsProtected|FlagIsPrivate)", + "Linkage Name"), + std::make_pair( + R"(%foo_name %float_info %dbg_src 0 0 %comp_unit %foo_name %void FlagIsProtected|FlagIsPrivate)", + "Variable"), + })); + +TEST_F(ValidateOpenCL100DebugInfo, DebugInlinedAt) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "void main() {}" +%void_name = OpString "void" +%main_name = OpString "main" +%main_linkage_name = OpString "v_main" +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void +%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_linkage_name FlagIsPublic 1 %main +%inlined_at = OpExtInst %void %DbgExt DebugInlinedAt 0 %main_info +%inlined_at_recursive = OpExtInst %void %DbgExt DebugInlinedAt 0 %main_info %inlined_at +)"; + + const std::string body = R"( +%main_scope = OpExtInst %void %DbgExt DebugScope %main_info %inlined_at +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, "", dbg_inst_header, body, extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugInlinedAtFail) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "void main() {}" +%void_name = OpString "void" +%main_name = OpString "main" +%main_linkage_name = OpString "v_main" +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void +%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_linkage_name FlagIsPublic 1 %main +%inlined_at = OpExtInst %void %DbgExt DebugInlinedAt 0 %main_info +%inlined_at_recursive = OpExtInst %void %DbgExt DebugInlinedAt 0 %inlined_at +)"; + + const std::string body = R"( +%main_scope = OpExtInst %void %DbgExt DebugScope %main_info %inlined_at +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, "", dbg_inst_header, body, extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("expected operand Scope")); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugInlinedAtFail2) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "void main() {}" +%void_name = OpString "void" +%main_name = OpString "main" +%main_linkage_name = OpString "v_main" +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void +%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_linkage_name FlagIsPublic 1 %main +%inlined_at = OpExtInst %void %DbgExt DebugInlinedAt 0 %main_info +%inlined_at_recursive = OpExtInst %void %DbgExt DebugInlinedAt 0 %main_info %main_info +)"; + + const std::string body = R"( +%main_scope = OpExtInst %void %DbgExt DebugScope %main_info %inlined_at +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, "", dbg_inst_header, body, extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("expected operand Inlined")); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugValue) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "void main() { float foo; }" +%float_name = OpString "float" +%foo_name = OpString "foo" +)"; + + const std::string size_const = R"( +%int_3 = OpConstant %u32 3 +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%null_expr = OpExtInst %void %DbgExt DebugExpression +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%v4float_info = OpExtInst %void %DbgExt DebugTypeVector %float_info 4 +%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %v4float_info %dbg_src 1 10 %comp_unit FlagIsLocal 0 +)"; + + const std::string body = R"( +%value = OpExtInst %void %DbgExt DebugValue %foo_info %int_32 %null_expr %int_3 +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, body, extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateOpenCL100DebugInfo, DebugValueWithVariableIndex) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "void main() { float foo; }" +%float_name = OpString "float" +%int_name = OpString "int" +%foo_name = OpString "foo" +%len_name = OpString "length" +)"; + + const std::string size_const = R"( +%int_3 = OpConstant %u32 3 +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%null_expr = OpExtInst %void %DbgExt DebugExpression +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%int_info = OpExtInst %void %DbgExt DebugTypeBasic %int_name %int_32 Signed +%v4float_info = OpExtInst %void %DbgExt DebugTypeVector %float_info 4 +%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %v4float_info %dbg_src 1 10 %comp_unit FlagIsLocal +%len_info = OpExtInst %void %DbgExt DebugLocalVariable %len_name %int_info %dbg_src 0 0 %comp_unit FlagIsLocal +)"; + + const std::string body = R"( +%value = OpExtInst %void %DbgExt DebugValue %foo_info %int_32 %null_expr %len_info +)"; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, body, extension, "Vertex")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCL100DebugInfoDebugValue, Fail) { + const std::string src = R"( +%src = OpString "simple.hlsl" +%code = OpString "void main() { float foo; }" +%float_name = OpString "float" +%foo_name = OpString "foo" +)"; + + const std::string size_const = R"( +%int_32 = OpConstant %u32 32 +)"; + + const std::string dbg_inst_header = R"( +%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code +%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL +%null_expr = OpExtInst %void %DbgExt DebugExpression +%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float +%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %float_info %dbg_src 1 10 %comp_unit FlagIsLocal 0 +)"; + + const auto& param = GetParam(); + + std::ostringstream ss; + ss << R"( +%decl = OpExtInst %void %DbgExt DebugValue )" + << param.first; + + const std::string extension = R"( +%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100" +)"; + + CompileSuccessfully(GenerateShaderCodeForDebugInfo( + src, size_const, dbg_inst_header, ss.str(), extension, "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("expected operand " + param.second)); +} + +INSTANTIATE_TEST_SUITE_P( + AllOpenCL100DebugInfoFail, ValidateOpenCL100DebugInfoDebugValue, + ::testing::ValuesIn(std::vector>{ + std::make_pair(R"(%dbg_src %int_32 %null_expr)", "Local Variable"), + std::make_pair(R"(%foo_info %int_32 %dbg_src)", "Expression"), + std::make_pair(R"(%foo_info %int_32 %null_expr %dbg_src)", "Indexes"), + })); + TEST_P(ValidateGlslStd450SqrtLike, IntResultType) { const std::string ext_inst_name = GetParam(); const std::string body = @@ -721,19 +3507,6 @@ TEST_P(ValidateGlslStd450SAbsLike, WrongBitWidthOperand) { "Result Type")); } -TEST_P(ValidateGlslStd450SAbsLike, TypelessOperand) { - const std::string ext_inst_name = GetParam(); - const std::string body = - "%val1 = OpExtInst %s64 %extinst " + ext_inst_name + " %main_entry\n"; - - CompileSuccessfully(GenerateShaderCode(body)); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("GLSL.std.450 " + ext_inst_name + - ": expected all operands to be int scalars or vectors")); -} - INSTANTIATE_TEST_SUITE_P(AllSAbsLike, ValidateGlslStd450SAbsLike, ::testing::ValuesIn(std::vector{ "SAbs", @@ -883,19 +3656,6 @@ TEST_P(ValidateGlslStd450UMinLike, WrongBitWidthOperand2) { "Result Type")); } -TEST_P(ValidateGlslStd450UMinLike, TypelessOperand) { - const std::string ext_inst_name = GetParam(); - const std::string body = "%val1 = OpExtInst %s64 %extinst " + ext_inst_name + - " %s64_0 %main_entry\n"; - - CompileSuccessfully(GenerateShaderCode(body)); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("GLSL.std.450 " + ext_inst_name + - ": expected all operands to be int scalars or vectors")); -} - INSTANTIATE_TEST_SUITE_P(AllUMinLike, ValidateGlslStd450UMinLike, ::testing::ValuesIn(std::vector{ "UMin", @@ -1059,19 +3819,6 @@ TEST_P(ValidateGlslStd450UClampLike, WrongBitWidthOperand3) { "Result Type")); } -TEST_P(ValidateGlslStd450UClampLike, TypelessOperand) { - const std::string ext_inst_name = GetParam(); - const std::string body = "%val1 = OpExtInst %s64 %extinst " + ext_inst_name + - " %main_entry %s64_0 %s64_0\n"; - - CompileSuccessfully(GenerateShaderCode(body)); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("GLSL.std.450 " + ext_inst_name + - ": expected all operands to be int scalars or vectors")); -} - INSTANTIATE_TEST_SUITE_P(AllUClampLike, ValidateGlslStd450UClampLike, ::testing::ValuesIn(std::vector{ "UClamp", @@ -2805,8 +5552,7 @@ TEST_F(ValidateExtInst, GlslStd450InterpolateAtOffsetInternalInvalidDataF32) { "expected Interpolant to be a pointer")); } -TEST_F(ValidateExtInst, - GlslStd450InterpolateAtOffsetInternalInvalidDataF32Vec2) { +TEST_F(ValidateExtInst, GlslStd450InterpolateAtOffsetInternalInvalidDataF32Vec2) { const std::string body = R"( %ld2 = OpLoad %f32vec2 %f32vec2_input %val2 = OpExtInst %f32vec2 %extinst InterpolateAtOffset %ld2 %f32vec2_01 diff --git a/test/val/val_extension_spv_khr_bit_instructions.cpp b/test/val/val_extension_spv_khr_bit_instructions.cpp deleted file mode 100644 index 0e926716..00000000 --- a/test/val/val_extension_spv_khr_bit_instructions.cpp +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) 2021 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Tests for OpExtension validator rules. - -#include -#include - -#include "gmock/gmock.h" -#include "source/enum_string_mapping.h" -#include "source/extensions.h" -#include "source/spirv_target_env.h" -#include "test/test_fixture.h" -#include "test/unit_spirv.h" -#include "test/val/val_fixtures.h" - -namespace spvtools { -namespace val { -namespace { - -using ::testing::HasSubstr; -using ::testing::Values; -using ::testing::ValuesIn; - -using ValidateSpvKHRBitInstructions = spvtest::ValidateBase; - -TEST_F(ValidateSpvKHRBitInstructions, Valid) { - const std::string str = R"( - OpCapability Kernel - OpCapability Addresses - OpCapability BitInstructions - OpExtension "SPV_KHR_bit_instructions" - OpMemoryModel Physical32 OpenCL - OpEntryPoint Kernel %main "main" - - %void = OpTypeVoid - %void_fn = OpTypeFunction %void - %u32 = OpTypeInt 32 0 - %u32_1 = OpConstant %u32 1 - - %main = OpFunction %void None %void_fn - %entry = OpLabel - %unused = OpBitReverse %u32 %u32_1 - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(str.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateSpvKHRBitInstructions, RequiresExtension) { - const std::string str = R"( - OpCapability Kernel - OpCapability Addresses - OpCapability BitInstructions - OpMemoryModel Physical32 OpenCL - OpEntryPoint Kernel %main "main" - - %void = OpTypeVoid - %void_fn = OpTypeFunction %void - %u32 = OpTypeInt 32 0 - %u32_1 = OpConstant %u32 1 - - %main = OpFunction %void None %void_fn - %entry = OpLabel - %unused = OpBitReverse %u32 %u32_1 - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(str.c_str()); - EXPECT_NE(SPV_SUCCESS, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("1st operand of Capability: operand BitInstructions(6025) " - "requires one of these extensions: SPV_KHR_bit_instructions")); -} - -TEST_F(ValidateSpvKHRBitInstructions, RequiresCapability) { - const std::string str = R"( - OpCapability Kernel - OpCapability Addresses - OpExtension "SPV_KHR_bit_instructions" - OpMemoryModel Physical32 OpenCL - OpEntryPoint Kernel %main "main" - - %void = OpTypeVoid - %void_fn = OpTypeFunction %void - %u32 = OpTypeInt 32 0 - %u32_1 = OpConstant %u32 1 - - %main = OpFunction %void None %void_fn - %entry = OpLabel - %unused = OpBitReverse %u32 %u32_1 - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(str.c_str()); - EXPECT_NE(SPV_SUCCESS, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Opcode BitReverse requires one of these capabilities: " - "Shader BitInstructions")); -} - -} // namespace -} // namespace val -} // namespace spvtools diff --git a/test/val/val_extension_spv_khr_integer_dot_product.cpp b/test/val/val_extension_spv_khr_integer_dot_product.cpp deleted file mode 100644 index e0e6896c..00000000 --- a/test/val/val_extension_spv_khr_integer_dot_product.cpp +++ /dev/null @@ -1,1330 +0,0 @@ -// Copyright (c) 2020 Google Inc. -// Copyright (c) 2021 Arm Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include -#include - -#include "gmock/gmock.h" -#include "source/enum_string_mapping.h" -#include "source/extensions.h" -#include "source/spirv_target_env.h" -#include "test/test_fixture.h" -#include "test/unit_spirv.h" -#include "test/val/val_fixtures.h" - -namespace spvtools { -namespace val { -namespace { - -using ::testing::HasSubstr; -using ::testing::Values; - -struct Case { - std::vector caps; - std::string inst; - std::string result_type; - std::string op0_type; - std::string op1_type; - std::string acc_type; // can be empty - bool packed; - std::string expected_error; // empty for no error. -}; - -inline std::ostream& operator<<(std::ostream& out, Case c) { - out << "\nSPV_KHR_integer_dot_product Case{{"; - bool first = true; - for (const auto& cap : c.caps) { - if (!first) { - out << " "; - } - first = false; - out << cap; - } - out << "} "; - out << c.inst << " "; - out << c.result_type << " "; - out << c.op0_type << " "; - out << c.op1_type << " "; - out << "'" << c.acc_type << "' "; - out << (c.packed ? "packed " : "unpacked "); - out << "err'" << c.expected_error << "'"; - return out; -} - -std::string AssemblyForCase(const Case& c) { - std::ostringstream ss; - ss << "OpCapability Shader\n"; - for (auto& cap : c.caps) { - ss << "OpCapability " << cap << "\n"; - } - ss << R"( - OpExtension "SPV_KHR_integer_dot_product" - OpMemoryModel Logical Simple - OpEntryPoint GLCompute %main "main" - OpExecutionMode %main LocalSize 1 1 1 - - %void = OpTypeVoid - %voidfn = OpTypeFunction %void - %uint = OpTypeInt 32 0 - %int = OpTypeInt 32 1 - - %v2uint = OpTypeVector %uint 2 - %v3uint = OpTypeVector %uint 3 - %v4uint = OpTypeVector %uint 4 - %v2int = OpTypeVector %int 2 - %v3int = OpTypeVector %int 3 - %v4int = OpTypeVector %int 4 - - %uint_0 = OpConstant %uint 0 - %uint_1 = OpConstant %uint 1 - %int_0 = OpConstant %int 0 - %int_1 = OpConstant %int 1 - - %v2uint_0 = OpConstantComposite %v2uint %uint_0 %uint_0 - %v2uint_1 = OpConstantComposite %v2uint %uint_1 %uint_1 - %v3uint_0 = OpConstantComposite %v3uint %uint_0 %uint_0 %uint_0 - %v3uint_1 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1 - %v4uint_0 = OpConstantComposite %v4uint %uint_0 %uint_0 %uint_0 %uint_0 - %v4uint_1 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1 - - %v2int_0 = OpConstantComposite %v2int %int_0 %int_0 - %v2int_1 = OpConstantComposite %v2int %int_1 %int_1 - %v3int_0 = OpConstantComposite %v3int %int_0 %int_0 %int_0 - %v3int_1 = OpConstantComposite %v3int %int_1 %int_1 %int_1 - %v4int_0 = OpConstantComposite %v4int %int_0 %int_0 %int_0 %int_0 - %v4int_1 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1 -)"; - - bool use8bit = false; - for (auto& cap : c.caps) { - if (cap == "DotProductInput4x8BitKHR") { - use8bit = true; - } - if (cap == "Int8") { - use8bit = true; - } - } - if (use8bit) { - ss << R"( - %uchar = OpTypeInt 8 0 - %char = OpTypeInt 8 1 - - %v4uchar = OpTypeVector %uchar 4 - %v4char = OpTypeVector %char 4 - - %uchar_0 = OpConstant %uchar 0 - %uchar_1 = OpConstant %uchar 1 - %char_0 = OpConstant %char 0 - %char_1 = OpConstant %char 1 - - %v4uchar_0 = OpConstantComposite %v4uchar %uchar_0 %uint_0 %uchar_0 %uchar_0 - %v4uchar_1 = OpConstantComposite %v4uchar %uchar_1 %uchar_1 %uchar_1 %uchar_1 - %v4char_0 = OpConstantComposite %v4char %char_0 %char_0 %char_0 %char_0 - %v4char_1 = OpConstantComposite %v4char %char_1 %char_1 %char_1 %char_1 - - )"; - } - - ss << R"( - - %main = OpFunction %void None %voidfn - %entry = OpLabel - %result = )" - << c.inst << " " << c.result_type << " "; - ss << c.op0_type << "_0 "; - ss << c.op1_type << "_1 "; - if (!c.acc_type.empty()) { - ss << c.acc_type << "_0 "; - } - if (c.packed) { - ss << "PackedVectorFormat4x8BitKHR"; - } - ss << "\nOpReturn\nOpFunctionEnd\n\n"; - return ss.str(); -} - -using ValidateSpvKHRIntegerDotProduct = spvtest::ValidateBase; - -TEST_P(ValidateSpvKHRIntegerDotProduct, Valid) { - const auto& c = GetParam(); - const auto& assembly = AssemblyForCase(c); - CompileSuccessfully(assembly); - if (c.expected_error.empty()) { - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()) << getDiagnosticString(); - } else { - EXPECT_NE(SPV_SUCCESS, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(c.expected_error)); - } -} - -// UDot -INSTANTIATE_TEST_SUITE_P( - Valid_UDot, ValidateSpvKHRIntegerDotProduct, - ::testing::Values(Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpUDotKHR", - "%uint", - "%v2uint", - "%v2uint", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpUDotKHR", - "%uint", - "%v3uint", - "%v3uint", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpUDotKHR", - "%uint", - "%v4uint", - "%v4uint", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpUDotKHR", - "%uchar", // match width - "%v4uchar", - "%v4uchar", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpUDotKHR", - "%uint", // wider width - "%v4uchar", - "%v4uchar", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpUDotKHR", - "%uchar", // match width - "%v4uchar", - "%v4uchar", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpUDotKHR", - "%uint", // wider width - "%v4uchar", - "%v4uchar", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR", - "Int8"}, - "OpUDotKHR", - "%uchar", // matches packed component type - "%uint", - "%uint", - "", - true, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR"}, - "OpUDotKHR", - "%uint", - "%uint", - "%uint", - "", - true, - ""})); - -// SDot result signed args signed signed -INSTANTIATE_TEST_SUITE_P( - Valid_SDot_signed_signed_signed, ValidateSpvKHRIntegerDotProduct, - ::testing::Values(Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSDotKHR", - "%int", - "%v2int", - "%v2int", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSDotKHR", - "%int", - "%v3int", - "%v3int", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSDotKHR", - "%int", - "%v4int", - "%v4int", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpSDotKHR", - "%char", // match width - "%v4char", - "%v4char", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpSDotKHR", - "%int", // wider width - "%v4char", - "%v4char", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpSDotKHR", - "%char", // match width - "%v4char", - "%v4char", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpSDotKHR", - "%int", // wider width - "%v4char", - "%v4char", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR", - "Int8"}, - "OpSDotKHR", - "%char", // matches packed component type - "%int", - "%int", - "", - true, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR"}, - "OpSDotKHR", - "%int", - "%int", - "%int", - "", - true, - ""})); - -// SDot result unsigned args signed unsigned -INSTANTIATE_TEST_SUITE_P( - Valid_SDot_unsigned_signed_unsigned, ValidateSpvKHRIntegerDotProduct, - ::testing::Values(Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSDotKHR", - "%uint", - "%v2int", - "%v2uint", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSDotKHR", - "%uint", - "%v3int", - "%v3uint", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSDotKHR", - "%uint", - "%v4int", - "%v4uint", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpSDotKHR", - "%uchar", // match width - "%v4char", - "%v4uchar", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpSDotKHR", - "%uint", // wider width - "%v4char", - "%v4uchar", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpSDotKHR", - "%uchar", // match width - "%v4char", - "%v4uchar", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpSDotKHR", - "%uint", // wider width - "%v4char", - "%v4uchar", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR", - "Int8"}, - "OpSDotKHR", - "%uchar", // matches packed component type - "%int", - "%uint", - "", - true, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR"}, - "OpSDotKHR", - "%uint", - "%int", - "%uint", - "", - true, - ""})); - -// SDot result signed args signed unsigned -INSTANTIATE_TEST_SUITE_P( - Valid_SDot_signed_signed_unsigned, ValidateSpvKHRIntegerDotProduct, - ::testing::Values(Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSDotKHR", - "%int", - "%v2int", - "%v2uint", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSDotKHR", - "%int", - "%v3int", - "%v3uint", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSDotKHR", - "%int", - "%v4int", - "%v4uint", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpSDotKHR", - "%char", // match width - "%v4char", - "%v4uchar", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpSDotKHR", - "%int", // wider width - "%v4char", - "%v4uchar", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpSDotKHR", - "%char", // match width - "%v4char", - "%v4uchar", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpSDotKHR", - "%int", // wider width - "%v4char", - "%v4uchar", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR", - "Int8"}, - "OpSDotKHR", - "%char", // matches packed component type - "%int", - "%uint", - "", - true, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR"}, - "OpSDotKHR", - "%int", - "%int", - "%uint", - "", - true, - ""})); - -// SUDot result signed args unsigned unsigned -INSTANTIATE_TEST_SUITE_P( - Valid_SUDot_signed_unsigned_unsigned, ValidateSpvKHRIntegerDotProduct, - ::testing::Values(Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSUDotKHR", - "%int", - "%v2uint", - "%v2uint", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSUDotKHR", - "%int", - "%v3uint", - "%v3uint", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSUDotKHR", - "%int", - "%v4uint", - "%v4uint", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpSUDotKHR", - "%char", // match width - "%v4uchar", - "%v4uchar", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpSUDotKHR", - "%int", // wider width - "%v4uchar", - "%v4uchar", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpSUDotKHR", - "%char", // match width - "%v4uchar", - "%v4uchar", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpSUDotKHR", - "%int", // wider width - "%v4uchar", - "%v4uchar", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR", - "Int8"}, - "OpSUDotKHR", - "%char", // matches packed component type - "%uint", - "%uint", - "", - true, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR"}, - "OpSUDotKHR", - "%int", - "%uint", - "%uint", - "", - true, - ""})); - -// SUDot result signed args signed unsigned -INSTANTIATE_TEST_SUITE_P( - Valid_SUDot_signed_signed_unsigned, ValidateSpvKHRIntegerDotProduct, - ::testing::Values(Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSUDotKHR", - "%int", - "%v2int", - "%v2uint", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSUDotKHR", - "%int", - "%v3int", - "%v3uint", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSUDotKHR", - "%int", - "%v4int", - "%v4uint", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpSUDotKHR", - "%char", // match width - "%v4char", - "%v4uchar", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpSUDotKHR", - "%int", // wider width - "%v4char", - "%v4uchar", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpSUDotKHR", - "%char", // match width - "%v4char", - "%v4uchar", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpSUDotKHR", - "%int", // wider width - "%v4char", - "%v4uchar", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR", - "Int8"}, - "OpSUDotKHR", - "%char", // matches packed component type - "%int", - "%uint", - "", - true, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR"}, - "OpSUDotKHR", - "%int", - "%int", - "%uint", - "", - true, - ""})); - -// SUDot result unsigned args unsigned unsigned -INSTANTIATE_TEST_SUITE_P( - Valid_SUDot_unsigned_unsigned_unsigned, ValidateSpvKHRIntegerDotProduct, - ::testing::Values(Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSUDotKHR", - "%uint", - "%v2uint", - "%v2uint", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSUDotKHR", - "%uint", - "%v3uint", - "%v3uint", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSUDotKHR", - "%uint", - "%v4uint", - "%v4uint", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpSUDotKHR", - "%uchar", // match width - "%v4uchar", - "%v4uchar", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpSUDotKHR", - "%uint", // wider width - "%v4uchar", - "%v4uchar", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpSUDotKHR", - "%uchar", // match width - "%v4uchar", - "%v4uchar", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpSUDotKHR", - "%uint", // wider width - "%v4uchar", - "%v4uchar", - "", - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR", - "Int8"}, - "OpSUDotKHR", - "%uchar", // matches packed component type - "%uint", - "%uint", - "", - true, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR"}, - "OpSUDotKHR", - "%uint", - "%uint", - "%uint", - "", - true, - ""})); - -// UDotAccSat -INSTANTIATE_TEST_SUITE_P( - Valid_UDotAccSat, ValidateSpvKHRIntegerDotProduct, - ::testing::Values(Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpUDotAccSatKHR", - "%uint", - "%v2uint", - "%v2uint", - "%uint", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpUDotAccSatKHR", - "%uint", - "%v3uint", - "%v3uint", - "%uint", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpUDotAccSatKHR", - "%uint", - "%v4uint", - "%v4uint", - "%uint", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpUDotAccSatKHR", - "%uchar", // match width - "%v4uchar", - "%v4uchar", - "%uint", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpUDotAccSatKHR", - "%uint", // wider width - "%v4uchar", - "%v4uchar", - "%uint", - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpUDotAccSatKHR", - "%uchar", // match width - "%v4uchar", - "%v4uchar", - "%uchar", - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpUDotAccSatKHR", - "%uint", // wider width - "%v4uchar", - "%v4uchar", - "%uint", - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR", - "Int8"}, - "OpUDotAccSatKHR", - "%uchar", // matches packed component type - "%uint", - "%uint", - "%uchar", - true, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR"}, - "OpUDotAccSatKHR", - "%uint", - "%uint", - "%uint", - "%uint", - true, - ""})); - -// SDotAccSat result signed args signed signed -INSTANTIATE_TEST_SUITE_P( - Valid_SDotAccSat_signed_signed_signed, ValidateSpvKHRIntegerDotProduct, - ::testing::Values(Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSDotAccSatKHR", - "%int", - "%v2int", - "%v2int", - "%int", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSDotAccSatKHR", - "%int", - "%v3int", - "%v3int", - "%int", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSDotAccSatKHR", - "%int", - "%v4int", - "%v4int", - "%int", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpSDotAccSatKHR", - "%char", // match width - "%v4char", - "%v4char", - "%char", // match width - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpSDotAccSatKHR", - "%int", // wider width - "%v4char", - "%v4char", - "%int", // wider width - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpSDotAccSatKHR", - "%char", // match width - "%v4char", - "%v4char", - "%char", // match width - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpSDotAccSatKHR", - "%int", // wider width - "%v4char", - "%v4char", - "%int", // wider width - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR", - "Int8"}, - "OpSDotAccSatKHR", - "%char", // matches packed component type - "%int", - "%int", - "%char", // matches packed component type - true, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR"}, - "OpSDotAccSatKHR", - "%int", - "%int", - "%int", - "%int", - true, - ""})); - -// SDotAccSat result unsigned args signed unsigned -INSTANTIATE_TEST_SUITE_P( - Valid_SDotAccSat_unsigned_signed_unsigned, ValidateSpvKHRIntegerDotProduct, - ::testing::Values(Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSDotAccSatKHR", - "%uint", - "%v2int", - "%v2uint", - "%uint", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSDotAccSatKHR", - "%uint", - "%v3int", - "%v3uint", - "%uint", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSDotAccSatKHR", - "%uint", - "%v4int", - "%v4uint", - "%uint", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpSDotAccSatKHR", - "%uchar", // match width - "%v4char", - "%v4uchar", - "%uchar", // match width - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpSDotAccSatKHR", - "%uint", // wider width - "%v4char", - "%v4uchar", - "%uint", // wider width - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpSDotAccSatKHR", - "%uchar", // match width - "%v4char", - "%v4uchar", - "%uchar", // match width - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpSDotAccSatKHR", - "%uint", // wider width - "%v4char", - "%v4uchar", - "%uint", // wider width - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR", - "Int8"}, - "OpSDotAccSatKHR", - "%uchar", // matches packed component type - "%int", - "%uint", - "%uchar", // matches packed component type - true, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR"}, - "OpSDotAccSatKHR", - "%uint", - "%int", - "%uint", - "%uint", - true, - ""})); - -// SDotAccSat result signed args signed unsigned -INSTANTIATE_TEST_SUITE_P( - Valid_SDotAccSat_signed_signed_unsigned, ValidateSpvKHRIntegerDotProduct, - ::testing::Values(Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSDotAccSatKHR", - "%int", - "%v2int", - "%v2uint", - "%int", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSDotAccSatKHR", - "%int", - "%v3int", - "%v3uint", - "%int", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSDotAccSatKHR", - "%int", - "%v4int", - "%v4uint", - "%int", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpSDotAccSatKHR", - "%char", // match width - "%v4char", - "%v4uchar", - "%char", // match width - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpSDotAccSatKHR", - "%int", // wider width - "%v4char", - "%v4uchar", - "%int", // wider width - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpSDotAccSatKHR", - "%char", // match width - "%v4char", - "%v4uchar", - "%char", // match width - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpSDotAccSatKHR", - "%int", // wider width - "%v4char", - "%v4uchar", - "%int", // wider width - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR", - "Int8"}, - "OpSDotAccSatKHR", - "%char", // matches packed component type - "%int", - "%uint", - "%char", // matches packed component type - true, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR"}, - "OpSDotAccSatKHR", - "%int", - "%int", - "%uint", - "%int", - true, - ""})); - -// SUDotAccSat result signed args unsigned unsigned -INSTANTIATE_TEST_SUITE_P( - Valid_SUDotAccSat_signed_unsigned_unsigned, ValidateSpvKHRIntegerDotProduct, - ::testing::Values(Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSUDotAccSatKHR", - "%int", - "%v2uint", - "%v2uint", - "%int", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSUDotAccSatKHR", - "%int", - "%v3uint", - "%v3uint", - "%int", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSUDotAccSatKHR", - "%int", - "%v4uint", - "%v4uint", - "%int", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpSUDotAccSatKHR", - "%char", // match width - "%v4uchar", - "%v4uchar", - "%char", // match width - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpSUDotAccSatKHR", - "%int", // wider width - "%v4uchar", - "%v4uchar", - "%int", // wider width - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpSUDotAccSatKHR", - "%char", // match width - "%v4uchar", - "%v4uchar", - "%char", // match width - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpSUDotAccSatKHR", - "%int", // wider width - "%v4uchar", - "%v4uchar", - "%int", // wider width - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR", - "Int8"}, - "OpSUDotAccSatKHR", - "%char", // matches packed component type - "%uint", - "%uint", - "%char", // matches packed component type - true, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR"}, - "OpSUDotAccSatKHR", - "%int", - "%uint", - "%uint", - "%int", - true, - ""})); - -// SUDotAccSat result signed args signed unsigned -INSTANTIATE_TEST_SUITE_P( - Valid_SUDotAccSat_signed_signed_unsigned, ValidateSpvKHRIntegerDotProduct, - ::testing::Values(Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSUDotAccSatKHR", - "%int", - "%v2int", - "%v2uint", - "%int", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSUDotAccSatKHR", - "%int", - "%v3int", - "%v3uint", - "%int", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSUDotAccSatKHR", - "%int", - "%v4int", - "%v4uint", - "%int", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpSUDotAccSatKHR", - "%char", // match width - "%v4char", - "%v4uchar", - "%char", // match width - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpSUDotAccSatKHR", - "%int", // wider width - "%v4char", - "%v4uchar", - "%int", // wider width - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpSUDotAccSatKHR", - "%char", // match width - "%v4char", - "%v4uchar", - "%char", // match width - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpSUDotAccSatKHR", - "%int", // wider width - "%v4char", - "%v4uchar", - "%int", // wider width - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR", - "Int8"}, - "OpSUDotAccSatKHR", - "%char", // matches packed component type - "%int", - "%uint", - "%char", // matches packed component type - true, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR"}, - "OpSUDotAccSatKHR", - "%int", - "%int", - "%uint", - "%int", - true, - ""})); - -// SUDotAccSat result unsigned args unsigned unsigned -INSTANTIATE_TEST_SUITE_P( - Valid_SUDotAccSat_unsigned_unsigned_unsigned, - ValidateSpvKHRIntegerDotProduct, - ::testing::Values(Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSUDotAccSatKHR", - "%uint", - "%v2uint", - "%v2uint", - "%uint", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSUDotAccSatKHR", - "%uint", - "%v3uint", - "%v3uint", - "%uint", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR"}, - "OpSUDotAccSatKHR", - "%uint", - "%v4uint", - "%v4uint", - "%uint", - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpSUDotAccSatKHR", - "%uchar", // match width - "%v4uchar", - "%v4uchar", - "%uchar", // match width - false, - ""}, - Case{{"DotProductKHR", "DotProductInputAllKHR", "Int8"}, - "OpSUDotAccSatKHR", - "%uint", // wider width - "%v4uchar", - "%v4uchar", - "%uint", // wider width - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpSUDotAccSatKHR", - "%uchar", // match width - "%v4uchar", - "%v4uchar", - "%uchar", // match width - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitKHR"}, - "OpSUDotAccSatKHR", - "%uint", // wider width - "%v4uchar", - "%v4uchar", - "%uint", // wider width - false, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR", - "Int8"}, - "OpSUDotAccSatKHR", - "%uchar", // matches packed component type - "%uint", - "%uint", - "%uchar", // matches packed component type - true, - ""}, - Case{{"DotProductKHR", "DotProductInput4x8BitPackedKHR"}, - "OpSUDotAccSatKHR", - "%uint", - "%uint", - "%uint", - "%uint", - true, - ""})); - -using ValidateSpvKHRIntegerDotProductSimple = ::testing::Test; - -TEST(ValidateSpvKHRIntegerDotProductSimple, DISABLED_RequiresExtension) { - FAIL(); -} - -TEST(ValidateSpvKHRIntegerDotProductSimple, DISABLED_Invalid_ResultTooNarrow) { - // Test across all the instructions. - FAIL(); -} - -TEST(ValidateSpvKHRIntegerDotProductSimple, - DISABLED_Invalid_UDot_OperandTypesMatch) { - FAIL(); -} - -TEST(ValidateSpvKHRIntegerDotProductSimple, - DISABLED_Invalid_SDot_OperandTypesMatchExceptSignedness) { - FAIL(); -} - -TEST(ValidateSpvKHRIntegerDotProductSimple, - DISABLED_Invalid_SUDot_OperandTypesMatchExceptSignedness) { - FAIL(); -} - -TEST(ValidateSpvKHRIntegerDotProductSimple, - DISABLED_Invalid_UDotAccSat_OperandTypesMatch) { - FAIL(); -} - -TEST(ValidateSpvKHRIntegerDotProductSimple, - DISABLED_Invalid_SDotAccSat_OperandTypesMatchExceptSignedness) { - FAIL(); -} - -TEST(ValidateSpvKHRIntegerDotProductSimple, - DISABLED_Invalid_SUDotAccSat_OperandTypesMatchExceptSignedness) { - FAIL(); -} - -TEST(ValidateSpvKHRIntegerDotProductSimple, - DISABLED_Invalid_UDot_RequiresUnsigned) { - FAIL(); -} - -TEST(ValidateSpvKHRIntegerDotProductSimple, - DISABLED_Invalid_SUDot_RequiresUnsignedSecondArg) { - FAIL(); -} - -TEST(ValidateSpvKHRIntegerDotProductSimple, - DISABLED_Invalid_UDotAccSat_RequiresUnsigned) { - FAIL(); -} - -TEST(ValidateSpvKHRIntegerDotProductSimple, - DISABLED_Invalid_SUDotAccSat_RequiresUnsignedSecondArg) { - FAIL(); -} - -TEST(ValidateSpvKHRIntegerDotProductSimple, - DISABLED_Invalid_VectorOperandsDisallowPackedFormat) { - FAIL(); -} - -TEST(ValidateSpvKHRIntegerDotProductSimple, - DISABLED_Invalid_ScalarOperandsRequirePackedFormat) { - FAIL(); -} - -// TODO(dneto): Test valid cases with other scalar integer types -// TODO(dneto): Test valid cases of length-8 vectors -// TODO(dneto): Test valid cases of length-16 vectors - -} // namespace -} // namespace val -} // namespace spvtools diff --git a/test/val/val_extension_spv_khr_subgroup_rotate.cpp b/test/val/val_extension_spv_khr_subgroup_rotate.cpp deleted file mode 100644 index 4f156e8b..00000000 --- a/test/val/val_extension_spv_khr_subgroup_rotate.cpp +++ /dev/null @@ -1,352 +0,0 @@ -// Copyright (c) 2022 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include - -#include "gmock/gmock.h" -#include "test/val/val_fixtures.h" - -namespace spvtools { -namespace val { -namespace { - -using ::testing::HasSubstr; -using ::testing::Values; -using ::testing::ValuesIn; - -struct Case { - std::vector caps; - bool shader; - std::string result_type; - std::string scope; - std::string delta; - std::string cluster_size; - std::string expected_error; // empty for no error. -}; - -inline std::ostream& operator<<(std::ostream& out, Case c) { - out << "\nSPV_KHR_subgroup_rotate Case{{"; - for (auto& cap : c.caps) { - out << cap; - } - out << "} "; - out << (c.shader ? "shader " : "kernel "); - out << c.result_type + " "; - out << c.scope + " "; - out << c.delta + " "; - out << c.cluster_size + " "; - out << "err'" << c.expected_error << "'"; - out << "}"; - return out; -} - -std::string AssemblyForCase(const Case& c) { - std::ostringstream ss; - - if (c.shader) { - ss << "OpCapability Shader\n"; - } else { - ss << "OpCapability Kernel\n"; - ss << "OpCapability Addresses\n"; - } - for (auto& cap : c.caps) { - ss << "OpCapability " << cap << "\n"; - } - ss << "OpExtension \"SPV_KHR_subgroup_rotate\"\n"; - - if (c.shader) { - ss << "OpMemoryModel Logical GLSL450\n"; - ss << "OpEntryPoint GLCompute %main \"main\"\n"; - } else { - ss << "OpMemoryModel Physical32 OpenCL\n"; - ss << "OpEntryPoint Kernel %main \"main\"\n"; - } - - ss << R"( - %void = OpTypeVoid - %void_fn = OpTypeFunction %void - %u32 = OpTypeInt 32 0 - %float = OpTypeFloat 32 - %ptr = OpTypePointer Function %u32 - )"; - - if (c.shader) { - ss << "%i32 = OpTypeInt 32 1\n"; - } - - ss << R"( - %u32_0 = OpConstant %u32 0 - %u32_1 = OpConstant %u32 1 - %u32_15 = OpConstant %u32 15 - %u32_16 = OpConstant %u32 16 - %u32_undef = OpUndef %u32 - %u32_spec_1 = OpSpecConstant %u32 1 - %u32_spec_16 = OpSpecConstant %u32 16 - %f32_1 = OpConstant %float 1.0 - %subgroup = OpConstant %u32 3 - %workgroup = OpConstant %u32 2 - %invalid_scope = OpConstant %u32 1 - %val = OpConstant %u32 42 - )"; - - if (c.shader) { - ss << "%i32_1 = OpConstant %i32 1\n"; - } - - ss << R"( - %main = OpFunction %void None %void_fn - %entry = OpLabel - )"; - - ss << "%unused = OpGroupNonUniformRotateKHR "; - ss << c.result_type + " "; - ss << c.scope; - ss << " %val "; - ss << c.delta; - ss << " " + c.cluster_size; - ss << "\n"; - - ss << R"( - OpReturn - OpFunctionEnd - )"; - - return ss.str(); -} - -using ValidateSpvKHRSubgroupRotate = spvtest::ValidateBase; - -TEST_P(ValidateSpvKHRSubgroupRotate, Base) { - const auto& c = GetParam(); - const auto& assembly = AssemblyForCase(c); - CompileSuccessfully(assembly); - if (c.expected_error.empty()) { - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()) << getDiagnosticString(); - } else { - EXPECT_NE(SPV_SUCCESS, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(c.expected_error)); - } -} - -INSTANTIATE_TEST_SUITE_P( - Valid, ValidateSpvKHRSubgroupRotate, - ::testing::Values( - Case{ - {"GroupNonUniformRotateKHR"}, false, "%u32", "%subgroup", "%u32_1"}, - Case{{"GroupNonUniformRotateKHR"}, true, "%u32", "%subgroup", "%u32_1"}, - Case{{"GroupNonUniformRotateKHR"}, - false, - "%u32", - "%subgroup", - "%u32_1", - "%u32_16"}, - Case{{"GroupNonUniformRotateKHR"}, - true, - "%u32", - "%subgroup", - "%u32_1", - "%u32_16"}, - Case{{"GroupNonUniformRotateKHR"}, - false, - "%u32", - "%subgroup", - "%u32_spec_1", - "%u32_16"}, - Case{{"GroupNonUniformRotateKHR"}, - true, - "%u32", - "%subgroup", - "%u32_1", - "%u32_spec_16"}, - Case{{"GroupNonUniformRotateKHR"}, - false, - "%u32", - "%workgroup", - "%u32_1"}, - Case{ - {"GroupNonUniformRotateKHR"}, true, "%u32", "%workgroup", "%u32_1"}, - Case{{"GroupNonUniformRotateKHR"}, - false, - "%u32", - "%workgroup", - "%u32_spec_1"}, - Case{{"GroupNonUniformRotateKHR"}, - true, - "%u32", - "%workgroup", - "%u32_spec_1"})); - -INSTANTIATE_TEST_SUITE_P( - RequiresCapability, ValidateSpvKHRSubgroupRotate, - ::testing::Values(Case{{}, - false, - "%u32", - "%subgroup", - "%u32_1", - "", - "Opcode GroupNonUniformRotateKHR requires one of " - "these capabilities: " - "GroupNonUniformRotateKHR"}, - Case{{}, - true, - "%u32", - "%subgroup", - "%u32_1", - "", - "Opcode GroupNonUniformRotateKHR requires one of " - "these capabilities: " - "GroupNonUniformRotateKHR"})); - -TEST_F(ValidateSpvKHRSubgroupRotate, RequiresExtension) { - const std::string str = R"( - OpCapability GroupNonUniformRotateKHR -)"; - CompileSuccessfully(str.c_str()); - EXPECT_NE(SPV_SUCCESS, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr( - "1st operand of Capability: operand GroupNonUniformRotateKHR(6026) " - "requires one of these extensions: SPV_KHR_subgroup_rotate")); -} - -INSTANTIATE_TEST_SUITE_P( - InvalidExecutionScope, ValidateSpvKHRSubgroupRotate, - ::testing::Values( - Case{{"GroupNonUniformRotateKHR"}, - false, - "%u32", - "%invalid_scope", - "%u32_1", - "", - "Execution scope is limited to Subgroup or Workgroup"}, - Case{{"GroupNonUniformRotateKHR"}, - true, - "%u32", - "%invalid_scope", - "%u32_1", - "", - "Execution scope is limited to Subgroup or Workgroup"})); - -INSTANTIATE_TEST_SUITE_P( - InvalidResultType, ValidateSpvKHRSubgroupRotate, - ::testing::Values(Case{{"GroupNonUniformRotateKHR"}, - false, - "%ptr", - "%subgroup", - "%u32_1", - "", - "Expected Result Type to be a scalar or vector of " - "floating-point, integer or boolean type"}, - Case{{"GroupNonUniformRotateKHR"}, - true, - "%ptr", - "%subgroup", - "%u32_1", - "", - "Expected Result Type to be a scalar or vector of " - "floating-point, integer or boolean type"})); - -INSTANTIATE_TEST_SUITE_P( - MismatchedResultAndValueTypes, ValidateSpvKHRSubgroupRotate, - ::testing::Values( - Case{{"GroupNonUniformRotateKHR"}, - false, - "%float", - "%subgroup", - "%u32_1", - "", - "Result Type must be the same as the type of Value"}, - Case{{"GroupNonUniformRotateKHR"}, - true, - "%float", - "%subgroup", - "%u32_1", - "", - "Result Type must be the same as the type of Value"})); - -INSTANTIATE_TEST_SUITE_P( - InvalidDelta, ValidateSpvKHRSubgroupRotate, - ::testing::Values(Case{{"GroupNonUniformRotateKHR"}, - false, - "%u32", - "%subgroup", - "%f32_1", - "", - "Delta must be a scalar of integer type, whose " - "Signedness operand is 0"}, - Case{{"GroupNonUniformRotateKHR"}, - true, - "%u32", - "%subgroup", - "%f32_1", - "", - "Delta must be a scalar of integer type, whose " - "Signedness operand is 0"}, - Case{{"GroupNonUniformRotateKHR"}, - true, - "%u32", - "%subgroup", - "%i32_1", - "", - "Delta must be a scalar of integer type, whose " - "Signedness operand is 0"})); - -INSTANTIATE_TEST_SUITE_P( - InvalidClusterSize, ValidateSpvKHRSubgroupRotate, - ::testing::Values( - Case{{"GroupNonUniformRotateKHR"}, - false, - "%u32", - "%subgroup", - "%u32_1", - "%f32_1", - "ClusterSize must be a scalar of integer type, whose Signedness " - "operand is 0"}, - Case{{"GroupNonUniformRotateKHR"}, - true, - "%u32", - "%subgroup", - "%u32_1", - "%i32_1", - "ClusterSize must be a scalar of integer type, whose Signedness " - "operand is 0"}, - Case{{"GroupNonUniformRotateKHR"}, - true, - "%u32", - "%subgroup", - "%u32_1", - "%u32_0", - "Behavior is undefined unless ClusterSize is at least 1 and a " - "power of 2"}, - Case{{"GroupNonUniformRotateKHR"}, - true, - "%u32", - "%subgroup", - "%u32_1", - "%u32_15", - "Behavior is undefined unless ClusterSize is at least 1 and a " - "power of 2"}, - Case{{"GroupNonUniformRotateKHR"}, - true, - "%u32", - "%subgroup", - "%u32_1", - "%u32_undef", - "ClusterSize must come from a constant instruction"})); - -} // namespace -} // namespace val -} // namespace spvtools diff --git a/test/val/val_extension_spv_khr_subgroup_uniform_control_flow.cpp b/test/val/val_extension_spv_khr_subgroup_uniform_control_flow.cpp deleted file mode 100644 index f528cb9e..00000000 --- a/test/val/val_extension_spv_khr_subgroup_uniform_control_flow.cpp +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) 2021 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Tests for OpExtension validator rules. - -#include -#include - -#include "gmock/gmock.h" -#include "source/enum_string_mapping.h" -#include "source/extensions.h" -#include "source/spirv_target_env.h" -#include "test/test_fixture.h" -#include "test/unit_spirv.h" -#include "test/val/val_fixtures.h" - -namespace spvtools { -namespace val { -namespace { - -using ::testing::HasSubstr; -using ::testing::Values; -using ::testing::ValuesIn; - -using ValidateSpvKHRSubgroupUniformControlFlow = spvtest::ValidateBase; - -TEST_F(ValidateSpvKHRSubgroupUniformControlFlow, Valid) { - const std::string str = R"( - OpCapability Shader - OpExtension "SPV_KHR_subgroup_uniform_control_flow" - OpMemoryModel Logical Simple - OpEntryPoint GLCompute %main "main" - OpExecutionMode %main LocalSize 1 1 1 - OpExecutionMode %main SubgroupUniformControlFlowKHR - - %void = OpTypeVoid - %void_fn = OpTypeFunction %void - - %main = OpFunction %void None %void_fn - %entry = OpLabel - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(str.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateSpvKHRSubgroupUniformControlFlow, RequiresExtension) { - const std::string str = R"( - OpCapability Shader - OpMemoryModel Logical Simple - OpEntryPoint GLCompute %main "main" - OpExecutionMode %main LocalSize 1 1 1 - OpExecutionMode %main SubgroupUniformControlFlowKHR - - %void = OpTypeVoid - %void_fn = OpTypeFunction %void - - %main = OpFunction %void None %void_fn - %entry = OpLabel - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(str.c_str()); - EXPECT_NE(SPV_SUCCESS, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("2nd operand of ExecutionMode: operand " - "SubgroupUniformControlFlowKHR(4421) " - "requires one of these extensions: " - "SPV_KHR_subgroup_uniform_control_flow")); -} - -TEST_F(ValidateSpvKHRSubgroupUniformControlFlow, RequiresShaderCapability) { - const std::string str = R"( - OpCapability Kernel - OpCapability Addresses - OpExtension "SPV_KHR_subgroup_uniform_control_flow" - OpMemoryModel Physical32 OpenCL - OpEntryPoint Kernel %main "main" - OpExecutionMode %main SubgroupUniformControlFlowKHR - - %void = OpTypeVoid - %void_fn = OpTypeFunction %void - - %main = OpFunction %void None %void_fn - %entry = OpLabel - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(str.c_str()); - EXPECT_NE(SPV_SUCCESS, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Operand 2 of ExecutionMode requires one of these " - "capabilities: Shader")); -} - -} // namespace -} // namespace val -} // namespace spvtools diff --git a/test/val/val_image_test.cpp b/test/val/val_image_test.cpp index 701e35e1..1d3b1a7d 100644 --- a/test/val/val_image_test.cpp +++ b/test/val/val_image_test.cpp @@ -1791,20 +1791,6 @@ TEST_F(ValidateImage, SampleImplicitLodVulkanOffsetWrongSize) { "OpImage*Gather operations")); } -TEST_F(ValidateImage, SampleImplicitLodVulkanOffsetWrongBeforeLegalization) { - const std::string body = R"( -%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 -%sampler = OpLoad %type_sampler %uniform_sampler -%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler -%res4 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec4_0000 Offset %s32vec2_01 -)"; - - CompileSuccessfully( - GenerateShaderCode(body, "", "Fragment", "", SPV_ENV_VULKAN_1_0).c_str()); - getValidatorOptions()->before_hlsl_legalization = true; - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); -} - TEST_F(ValidateImage, SampleImplicitLodMoreThanOneOffset) { const std::string body = R"( %img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 @@ -3388,8 +3374,6 @@ TEST_F(ValidateImage, ReadWrongNumComponentsResultType_Vulkan) { GenerateShaderCode(body, extra, "Fragment", "", SPV_ENV_VULKAN_1_0) .c_str()); ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); - EXPECT_THAT(getDiagnosticString(), - AnyVUID("VUID-StandaloneSpirv-Result-04780")); EXPECT_THAT(getDiagnosticString(), HasSubstr("Expected Result Type to have 4 components")); } diff --git a/test/val/val_interfaces_test.cpp b/test/val/val_interfaces_test.cpp index be13cd71..6869e794 100644 --- a/test/val/val_interfaces_test.cpp +++ b/test/val/val_interfaces_test.cpp @@ -1410,31 +1410,6 @@ OpFunctionEnd EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_2)); } -TEST_F(ValidateInterfacesTest, DuplicateInterfaceVariableSuccess) { - const std::string text = R"( -OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %in %out %in -OpExecutionMode %main OriginUpperLeft -OpDecorate %in Location 0 -OpDecorate %out Location 0 -%void = OpTypeVoid -%float = OpTypeFloat 32 -%in_ptr = OpTypePointer Input %float -%out_ptr = OpTypePointer Output %float -%in = OpVariable %in_ptr Input -%out = OpVariable %out_ptr Output -%void_fn = OpTypeFunction %void -%main = OpFunction %void None %void_fn -%entry = OpLabel -OpReturn -OpFunctionEnd -)"; - - CompileSuccessfully(text, SPV_ENV_VULKAN_1_0); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); -} - } // namespace } // namespace val } // namespace spvtools diff --git a/test/val/val_memory_test.cpp b/test/val/val_memory_test.cpp index 616a88f6..9799b404 100644 --- a/test/val/val_memory_test.cpp +++ b/test/val/val_memory_test.cpp @@ -746,7 +746,7 @@ TEST_F(ValidateMemory, ArrayLenIndexNotPointerToStruct) { %float = OpTypeFloat 32 %uint = OpTypeInt 32 0 %_runtimearr_float = OpTypeRuntimeArray %float - %_struct_7 = OpTypeStruct %float + %_struct_7 = OpTypeStruct %float %_runtimearr_float %_ptr_Function__struct_7 = OpTypePointer Function %_struct_7 %1 = OpFunction %void None %3 %9 = OpLabel @@ -4284,94 +4284,6 @@ OpFunctionEnd EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); } -TEST_F(ValidateMemory, LoadRuntimeArray) { - const std::string spirv = R"( -OpCapability Shader -OpExtension "SPV_KHR_storage_buffer_storage_class" -OpMemoryModel Logical GLSL450 -OpEntryPoint GLCompute %main "main" -%void = OpTypeVoid -%int = OpTypeInt 32 0 -%int_0 = OpConstant %int 0 -%rta = OpTypeRuntimeArray %int -%block = OpTypeStruct %rta -%ptr_rta = OpTypePointer StorageBuffer %rta -%ptr_block = OpTypePointer StorageBuffer %block -%var = OpVariable %ptr_block StorageBuffer -%void_fn = OpTypeFunction %void -%main = OpFunction %void None %void_fn -%entry = OpLabel -%gep = OpAccessChain %ptr_rta %var %int_0 -%ld = OpLoad %rta %gep -OpReturn -OpFunctionEnd -)"; - - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Cannot load a runtime-sized array")); -} - -TEST_F(ValidateMemory, LoadRuntimeArrayInStruct) { - const std::string spirv = R"( -OpCapability Shader -OpExtension "SPV_KHR_storage_buffer_storage_class" -OpMemoryModel Logical GLSL450 -OpEntryPoint GLCompute %main "main" -%void = OpTypeVoid -%int = OpTypeInt 32 0 -%int_0 = OpConstant %int 0 -%rta = OpTypeRuntimeArray %int -%block = OpTypeStruct %rta -%ptr_rta = OpTypePointer StorageBuffer %rta -%ptr_block = OpTypePointer StorageBuffer %block -%var = OpVariable %ptr_block StorageBuffer -%void_fn = OpTypeFunction %void -%main = OpFunction %void None %void_fn -%entry = OpLabel -%ld = OpLoad %block %var -OpReturn -OpFunctionEnd -)"; - - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Cannot load a runtime-sized array")); -} - -TEST_F(ValidateMemory, LoadRuntimeArrayInArray) { - const std::string spirv = R"( -OpCapability Shader -OpExtension "SPV_KHR_storage_buffer_storage_class" -OpMemoryModel Logical GLSL450 -OpEntryPoint GLCompute %main "main" -%void = OpTypeVoid -%int = OpTypeInt 32 0 -%int_0 = OpConstant %int 0 -%int_4 = OpConstant %int 4 -%rta = OpTypeRuntimeArray %int -%block = OpTypeStruct %rta -%array = OpTypeArray %block %int_4 -%ptr_rta = OpTypePointer StorageBuffer %rta -%ptr_block = OpTypePointer StorageBuffer %block -%ptr_array = OpTypePointer StorageBuffer %array -%var = OpVariable %ptr_array StorageBuffer -%void_fn = OpTypeFunction %void -%main = OpFunction %void None %void_fn -%entry = OpLabel -%ld = OpLoad %array %var -OpReturn -OpFunctionEnd -)"; - - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Cannot load a runtime-sized array")); -} - } // namespace } // namespace val } // namespace spvtools diff --git a/test/val/val_modes_test.cpp b/test/val/val_modes_test.cpp index d060bb79..99f5c9cf 100644 --- a/test/val/val_modes_test.cpp +++ b/test/val/val_modes_test.cpp @@ -672,7 +672,7 @@ INSTANTIATE_TEST_SUITE_P(ValidateModeKernelOnlyGoodSpv13, ValidateModeExecution, Values("Kernel"), Values("LocalSizeHint 1 1 1", "VecTypeHint 4", "ContractionOff", - "LocalSizeHintId %int1 %int1 %int1"), + "LocalSizeHintId %int1"), Values(SPV_ENV_UNIVERSAL_1_3))); INSTANTIATE_TEST_SUITE_P( @@ -684,7 +684,7 @@ INSTANTIATE_TEST_SUITE_P( Values("Geometry", "TessellationControl", "TessellationEvaluation", "GLCompute", "Vertex", "Fragment"), Values("LocalSizeHint 1 1 1", "VecTypeHint 4", "ContractionOff", - "LocalSizeHintId %int1 %int1 %int1"), + "LocalSizeHintId %int1"), Values(SPV_ENV_UNIVERSAL_1_3))); INSTANTIATE_TEST_SUITE_P( @@ -863,7 +863,7 @@ OpCapability Kernel OpCapability Shader OpMemoryModel Logical GLSL450 OpEntryPoint Kernel %main "main" -OpExecutionMode %main LocalSizeHintId %int_1 %int_1 %int_1 +OpExecutionMode %main LocalSizeHintId %int_1 %int = OpTypeInt 32 0 %int_1 = OpConstant %int 1 )" + kVoidFunction; @@ -882,7 +882,7 @@ OpCapability Kernel OpCapability Shader OpMemoryModel Logical GLSL450 OpEntryPoint Kernel %main "main" -OpExecutionModeId %main LocalSizeHintId %int_1 %int_1 %int_1 +OpExecutionModeId %main LocalSizeHintId %int_1 %int = OpTypeInt 32 0 %int_1 = OpConstant %int 1 )" + kVoidFunction; @@ -898,7 +898,7 @@ OpCapability Kernel OpCapability Shader OpMemoryModel Logical GLSL450 OpEntryPoint Vertex %main "main" -OpExecutionModeId %main LocalSizeHintId %int_1 %int_1 %int_1 +OpExecutionModeId %main LocalSizeHintId %int_1 %int = OpTypeInt 32 0 %int_ptr = OpTypePointer Private %int %int_1 = OpVariable %int_ptr Private diff --git a/test/val/val_storage_test.cpp b/test/val/val_storage_test.cpp index 35f6a8d5..e6f98bff 100644 --- a/test/val/val_storage_test.cpp +++ b/test/val/val_storage_test.cpp @@ -30,7 +30,6 @@ using ::testing::Values; using ValidateStorage = spvtest::ValidateBase; using ValidateStorageClass = spvtest::ValidateBase>; -using ValidateStorageExecutionModel = spvtest::ValidateBase; TEST_F(ValidateStorage, FunctionStorageInsideFunction) { char str[] = R"( @@ -251,46 +250,6 @@ TEST_F(ValidateStorage, RelaxedLogicalPointerFunctionParamBad) { HasSubstr("OpFunctionCall Argument '")); } -TEST_P(ValidateStorageExecutionModel, VulkanOutsideStoreFailure) { - std::stringstream ss; - ss << R"( - OpCapability Shader - OpCapability RayTracingKHR - OpExtension "SPV_KHR_ray_tracing" - OpMemoryModel Logical GLSL450 - OpEntryPoint )" - << GetParam() << R"( %func "func" %output - OpDecorate %output Location 0 -%intt = OpTypeInt 32 0 -%int0 = OpConstant %intt 0 -%voidt = OpTypeVoid -%vfunct = OpTypeFunction %voidt -%outputptrt = OpTypePointer Output %intt -%output = OpVariable %outputptrt Output -%func = OpFunction %voidt None %vfunct -%funcl = OpLabel - OpStore %output %int0 - OpReturn - OpFunctionEnd -)"; - - CompileSuccessfully(ss.str(), SPV_ENV_VULKAN_1_0); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0)); - EXPECT_THAT(getDiagnosticString(), - AnyVUID("VUID-StandaloneSpirv-None-04644")); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("in Vulkan evironment, Output Storage Class must not be used " - "in GLCompute, RayGenerationKHR, IntersectionKHR, AnyHitKHR, " - "ClosestHitKHR, MissKHR, or CallableKHR execution models")); -} - -INSTANTIATE_TEST_SUITE_P(MatrixExecutionModel, ValidateStorageExecutionModel, - ::testing::Values("RayGenerationKHR", - "IntersectionKHR", "AnyHitKHR", - "ClosestHitKHR", "MissKHR", - "CallableKHR")); - } // namespace } // namespace val } // namespace spvtools diff --git a/test/wasm/test.js b/test/wasm/test.js deleted file mode 100644 index 7f0d8f3c..00000000 --- a/test/wasm/test.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) 2020 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const spirvTools = require("../../out/web/spirv-tools"); -const fs = require("fs"); -const util = require("util"); -const readFile = util.promisify(fs.readFile); - -const SPV_PATH = "./test/fuzzers/corpora/spv/simple.spv"; - -const test = async () => { - const spv = await spirvTools(); - - // disassemble from file - const buffer = await readFile(SPV_PATH); - const disFileResult = spv.dis( - buffer, - spv.SPV_ENV_UNIVERSAL_1_3, - spv.SPV_BINARY_TO_TEXT_OPTION_INDENT | - spv.SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES | - spv.SPV_BINARY_TO_TEXT_OPTION_COLOR - ); - console.log("dis from file:\n", disFileResult); - - // assemble - const source = ` - OpCapability Linkage - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpSource GLSL 450 - OpDecorate %spec SpecId 1 - %int = OpTypeInt 32 1 - %spec = OpSpecConstant %int 0 - %const = OpConstant %int 42`; - const asResult = spv.as( - source, - spv.SPV_ENV_UNIVERSAL_1_3, - spv.SPV_TEXT_TO_BINARY_OPTION_NONE - ); - console.log(`as returned ${asResult.byteLength} bytes`); - - // re-disassemble - const disResult = spv.dis( - asResult, - spv.SPV_ENV_UNIVERSAL_1_3, - spv.SPV_BINARY_TO_TEXT_OPTION_INDENT | - spv.SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES | - spv.SPV_BINARY_TO_TEXT_OPTION_COLOR - ); - console.log("dis:\n", disResult); -}; - -test(); diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 6039089a..124a3328 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -48,7 +48,6 @@ if (NOT ${SPIRV_SKIP_EXECUTABLES}) add_spvtools_tool(TARGET spirv-reduce SRCS reduce/reduce.cpp util/cli_consumer.cpp LIBS SPIRV-Tools-reduce ${SPIRV_TOOLS_FULL_VISIBILITY}) endif() add_spvtools_tool(TARGET spirv-link SRCS link/linker.cpp LIBS SPIRV-Tools-link ${SPIRV_TOOLS_FULL_VISIBILITY}) - add_spvtools_tool(TARGET spirv-lint SRCS lint/lint.cpp util/cli_consumer.cpp LIBS SPIRV-Tools-lint SPIRV-Tools-opt ${SPIRV_TOOLS_FULL_VISIBILITY}) add_spvtools_tool(TARGET spirv-cfg SRCS cfg/cfg.cpp cfg/bin_to_dot.h @@ -57,7 +56,7 @@ if (NOT ${SPIRV_SKIP_EXECUTABLES}) target_include_directories(spirv-cfg PRIVATE ${spirv-tools_SOURCE_DIR} ${SPIRV_HEADER_INCLUDE_DIR}) set(SPIRV_INSTALL_TARGETS spirv-as spirv-dis spirv-val spirv-opt - spirv-cfg spirv-link spirv-lint) + spirv-cfg spirv-link) if(NOT DEFINED IOS_PLATFORM) set(SPIRV_INSTALL_TARGETS ${SPIRV_INSTALL_TARGETS} spirv-reduce) endif() diff --git a/tools/buildHeaders/CMakeLists.txt b/tools/buildHeaders/CMakeLists.txt deleted file mode 100644 index fa7ef50f..00000000 --- a/tools/buildHeaders/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -cmake_minimum_required(VERSION 3.0) - -set(CMAKE_INSTALL_PREFIX "install" CACHE STRING "prefix" FORCE) - -project(buildSpvHeaders) - -set(SOURCES - main.cpp - jsonToSpirv.cpp - header.cpp - jsoncpp/dist/jsoncpp.cpp) - -set(HEADERS - jsonToSpirv.h - header.h - jsoncpp/dist/json/json.h) - -if(CMAKE_COMPILER_IS_GNUCXX) - add_definitions(-std=c++11) -elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_definitions(-std=c++11) -endif() - -add_executable(buildSpvHeaders ${SOURCES} ${HEADERS}) - -install(TARGETS buildSpvHeaders RUNTIME DESTINATION bin) diff --git a/tools/buildHeaders/bin/generate_language_headers.py b/tools/buildHeaders/bin/generate_language_headers.py deleted file mode 100755 index c56780c1..00000000 --- a/tools/buildHeaders/bin/generate_language_headers.py +++ /dev/null @@ -1,242 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) 2017-2020 Google LLC -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and/or associated documentation files (the -# "Materials"), to deal in the Materials without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Materials, and to -# permit persons to whom the Materials are furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Materials. -# -# MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS -# KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS -# SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT -# https://www.khronos.org/registry/ -# -# THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. - -"""Generates a C language headers from a SPIR-V JSON grammar file""" - -import errno -import json -import os.path -import re - -DEFAULT_COPYRIGHT="""Copyright (c) 2020 The Khronos Group Inc. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and/or associated documentation files (the -"Materials"), to deal in the Materials without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Materials, and to -permit persons to whom the Materials are furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Materials. - -MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS -KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS -SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT - https://www.khronos.org/registry/ - -THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -""".split('\n') - -def make_path_to_file(f): - """Makes all ancestor directories to the given file, if they - don't yet exist. - - Arguments: - f: The file whose ancestor directories are to be created. - """ - dir = os.path.dirname(os.path.abspath(f)) - try: - os.makedirs(dir) - except OSError as e: - if e.errno == errno.EEXIST and os.path.isdir(dir): - pass - else: - raise - -class ExtInstGrammar: - """The grammar for an extended instruction set""" - - def __init__(self, name, copyright, instructions, operand_kinds, version = None, revision = None): - self.name = name - self.copyright = copyright - self.instructions = instructions - self.operand_kinds = operand_kinds - self.version = version - self.revision = revision - - -class LangGenerator: - """A language-specific generator""" - - def __init__(self): - self.upper_case_initial = re.compile('^[A-Z]') - pass - - def comment_prefix(self): - return "" - - def namespace_prefix(self): - return "" - - def uses_guards(self): - return False - - def cpp_guard_preamble(self): - return "" - - def cpp_guard_postamble(self): - return "" - - def enum_value(self, prefix, name, value): - if self.upper_case_initial.match(name): - use_name = name - else: - use_name = '_' + name - - return " {}{} = {},".format(prefix, use_name, value) - - def generate(self, grammar): - """Returns a string that is the language-specific header for the given grammar""" - - parts = [] - if grammar.copyright: - parts.extend(["{}{}".format(self.comment_prefix(), f) for f in grammar.copyright]) - parts.append('') - - guard = 'SPIRV_UNIFIED1_{}_H_'.format(grammar.name) - if self.uses_guards: - parts.append('#ifndef {}'.format(guard)) - parts.append('#define {}'.format(guard)) - parts.append('') - - parts.append(self.cpp_guard_preamble()) - - if grammar.version: - parts.append(self.const_definition(grammar.name, 'Version', grammar.version)) - - if grammar.revision is not None: - parts.append(self.const_definition(grammar.name, 'Revision', grammar.revision)) - - parts.append('') - - if grammar.instructions: - parts.append(self.enum_prefix(grammar.name, 'Instructions')) - for inst in grammar.instructions: - parts.append(self.enum_value(grammar.name, inst['opname'], inst['opcode'])) - parts.append(self.enum_end(grammar.name, 'Instructions')) - parts.append('') - - if grammar.operand_kinds: - for kind in grammar.operand_kinds: - parts.append(self.enum_prefix(grammar.name, kind['kind'])) - for e in kind['enumerants']: - parts.append(self.enum_value(grammar.name, e['enumerant'], e['value'])) - parts.append(self.enum_end(grammar.name, kind['kind'])) - parts.append('') - - parts.append(self.cpp_guard_postamble()) - - if self.uses_guards: - parts.append('#endif // {}'.format(guard)) - - # Ensre the file ends in an end of line - parts.append('') - - return '\n'.join(parts) - - -class CLikeGenerator(LangGenerator): - def uses_guards(self): - return True - - def comment_prefix(self): - return "// " - - def const_definition(self, prefix, var, value): - # Use an anonymous enum. Don't use a static const int variable because - # that can bloat binary size. - return 'enum {0}{1}{2}{3} = {4},{1}{2}{3}_BitWidthPadding = 0x7fffffff{5};'.format( - '{', '\n ', prefix, var, value, '\n}') - - def enum_prefix(self, prefix, name): - return 'enum {}{} {}'.format(prefix, name, '{') - - def enum_end(self, prefix, enum): - return ' {}{}Max = 0x7fffffff\n{};\n'.format(prefix, enum, '}') - - def cpp_guard_preamble(self): - return '#ifdef __cplusplus\nextern "C" {\n#endif\n' - - def cpp_guard_postamble(self): - return '#ifdef __cplusplus\n}\n#endif\n' - - -class CGenerator(CLikeGenerator): - pass - - -def main(): - import argparse - parser = argparse.ArgumentParser(description='Generate language headers from a JSON grammar') - - parser.add_argument('--extinst-name', - type=str, required=True, - help='The name to use in tokens') - parser.add_argument('--extinst-grammar', metavar='', - type=str, required=True, - help='input JSON grammar file for extended instruction set') - parser.add_argument('--extinst-output-base', metavar='', - type=str, required=True, - help='Basename of the language-specific output file.') - args = parser.parse_args() - - with open(args.extinst_grammar) as json_file: - grammar_json = json.loads(json_file.read()) - if 'copyright' in grammar_json: - copyright = grammar_json['copyright'] - else: - copyright = DEFAULT_COPYRIGHT - if 'version' in grammar_json: - version = grammar_json['version'] - else: - version = 0 - if 'operand_kinds' in grammar_json: - operand_kinds = grammar_json['operand_kinds'] - else: - operand_kinds = [] - - grammar = ExtInstGrammar(name = args.extinst_name, - copyright = copyright, - instructions = grammar_json['instructions'], - operand_kinds = operand_kinds, - version = version, - revision = grammar_json['revision']) - make_path_to_file(args.extinst_output_base) - with open(args.extinst_output_base + '.h', 'w') as f: - f.write(CGenerator().generate(grammar)) - - -if __name__ == '__main__': - main() diff --git a/tools/buildHeaders/bin/makeExtinstHeaders.py b/tools/buildHeaders/bin/makeExtinstHeaders.py deleted file mode 100755 index 9359747c..00000000 --- a/tools/buildHeaders/bin/makeExtinstHeaders.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env python3 -"""Generate C headers for certain extended instruction sets""" - -import subprocess -import os - -# Assume we are running from the tools/buildHeaders directory -os.chdir('../../include/spirv/unified1') - -def mk_extinst(name, grammar_file): - """Generate one C header from a grammar""" - script = '../../../tools/buildHeaders/bin/generate_language_headers.py' - subprocess.check_call(['python3', - script, - '--extinst-name=' + name, - '--extinst-grammar=' + grammar_file, - '--extinst-output-base=' + name]) - subprocess.check_call(['dos2unix', name + '.h']) - - -mk_extinst('DebugInfo', 'extinst.debuginfo.grammar.json') -mk_extinst('OpenCLDebugInfo100', 'extinst.opencl.debuginfo.100.grammar.json') -mk_extinst('AMD_gcn_shader', 'extinst.spv-amd-gcn-shader.grammar.json') -mk_extinst('AMD_shader_ballot', 'extinst.spv-amd-shader-ballot.grammar.json') -mk_extinst('AMD_shader_explicit_vertex_parameter', 'extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json') -mk_extinst('AMD_shader_trinary_minmax', 'extinst.spv-amd-shader-trinary-minmax.grammar.json') -mk_extinst('NonSemanticDebugPrintf', 'extinst.nonsemantic.debugprintf.grammar.json') -mk_extinst('NonSemanticClspvReflection', 'extinst.nonsemantic.clspvreflection.grammar.json') diff --git a/tools/buildHeaders/bin/makeHeaders b/tools/buildHeaders/bin/makeHeaders deleted file mode 100755 index 7b4959ea..00000000 --- a/tools/buildHeaders/bin/makeHeaders +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -python3 bin/makeExtinstHeaders.py - -cd ../../include/spirv/unified1 -../../../tools/buildHeaders/build/install/bin/buildSpvHeaders -H spirv.core.grammar.json -dos2unix spirv.* spv.* diff --git a/tools/buildHeaders/header.cpp b/tools/buildHeaders/header.cpp deleted file mode 100644 index dc780ef3..00000000 --- a/tools/buildHeaders/header.cpp +++ /dev/null @@ -1,835 +0,0 @@ -// Copyright (c) 2014-2020 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -// -// Print headers for SPIR-V in several languages. -// -// To change the header information, change the C++-built database in doc.*. -// -// Then, use "spriv -h " - e.g, spriv.{h,hpp,lua,py,etc}: -// replace the auto-generated header, or "spirv -H" to generate all -// supported language headers to predefined names in the current directory. -// - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "jsoncpp/dist/json/json.h" - -#include "header.h" -#include "jsonToSpirv.h" - -// snprintf and _snprintf are not quite the same, but close enough -// for our use. -#ifdef _MSC_VER -#pragma warning(disable:4996) -#define snprintf _snprintf -#endif - -// This file converts SPIR-V definitions to an internal JSON -// representation, and then generates language specific -// data from that single internal form. - -// Initially, the internal form is created from C++ data, -// though this can be changed to a JSON master in time. - -namespace { - class TPrinter { - protected: - TPrinter(); - - static const int DocMagicNumber = 0x07230203; - static const int DocVersion = 0x00010500; - static const int DocRevision = 4; - #define DocRevisionString "4" - static const std::string DocCopyright; - static const std::string DocComment1; - static const std::string DocComment2; - - enum enumStyle_t { - enumNoMask, - enumCount, - enumShift, - enumMask, - enumHex, - }; - - static std::string styleStr(enumStyle_t s) { - return s == enumShift ? "Shift" : - s == enumMask ? "Mask" : ""; - } - - friend std::ostream& operator<<(std::ostream&, const TPrinter&); - - virtual void printAll(std::ostream&) const; - virtual void printComments(std::ostream&) const; - virtual void printPrologue(std::ostream&) const { } - virtual void printDefs(std::ostream&) const; - virtual void printEpilogue(std::ostream&) const { } - virtual void printMeta(std::ostream&) const; - virtual void printTypes(std::ostream&) const { } - virtual void printHasResultType(std::ostream&) const { }; - - virtual std::string escapeComment(const std::string& s) const; - - // Default printComments() uses these comment strings - virtual std::string commentBeg() const { return ""; } - virtual std::string commentEnd(bool isLast) const { return ""; } - virtual std::string commentBOL() const { return ""; } - virtual std::string commentEOL(bool isLast) const { return ""; } - - typedef std::pair valpair_t; - - // for printing enum values - virtual std::string enumBeg(const std::string&, enumStyle_t) const { return ""; } - virtual std::string enumEnd(const std::string&, enumStyle_t, bool isLast = false) const { - return ""; - } - virtual std::string enumFmt(const std::string&, const valpair_t&, - enumStyle_t, bool isLast = false) const { - return ""; - } - virtual std::string maxEnumFmt(const std::string&, const valpair_t&, - enumStyle_t) const { - return ""; - } - - virtual std::string fmtConstInt(unsigned val, const std::string& name, - const char* fmt, bool isLast = false) const { - return ""; - } - - std::vector getSortedVals(const Json::Value&) const; - - virtual std::string indent(int count = 1) const { - return std::string(count * 4, ' '); // default indent level = 4 - } - - static std::string fmtNum(const char* fmt, unsigned val) { - char buff[16]; // ample for 8 hex digits + 0x - snprintf(buff, sizeof(buff), fmt, val); - buff[sizeof(buff)-1] = '\0'; // MSVC doesn't promise null termination - return buff; - } - - static std::string fmtStyleVal(unsigned v, enumStyle_t style); - - // If the enum value name would start with a sigit, prepend the enum name. - // E.g, "3D" -> "Dim3D". - static std::string prependIfDigit(const std::string& ename, const std::string& vname) { - return (std::isdigit(vname[0]) ? ename : std::string("")) + vname; - } - - void addComment(Json::Value& node, const std::string& str); - - Json::Value spvRoot; // JSON SPIR-V data - }; - - // Format value as mask or value - std::string TPrinter::fmtStyleVal(unsigned v, enumStyle_t style) - { - switch (style) { - case enumMask: - return fmtNum("0x%08x", 1< - TPrinter::getSortedVals(const Json::Value& p) const - { - std::vector values; - - for (auto e = p.begin(); e != p.end(); ++e) - values.push_back(valpair_t(e->asUInt(), e.name())); - - // Use a stable sort because we might have aliases, e.g. - // SubgropuBallot (might be in future core) vs. SubgroupBallotKHR. - std::stable_sort(values.begin(), values.end()); - - return values; - } - - // Escape comment characters if needed - std::string TPrinter::escapeComment(const std::string& s) const { return s; } - - // Format comments in language specific way - void TPrinter::printComments(std::ostream& out) const - { - const int commentCount = spvRoot["spv"]["meta"]["Comment"].size(); - int commentNum = 0; - - for (const auto& comment : spvRoot["spv"]["meta"]["Comment"]) { - out << commentBeg(); - - for (int line = 0; line < int(comment.size()); ++line) - out << commentBOL() << escapeComment(comment[line].asString()) << - commentEOL((line+1) == comment.size()) << std::endl; - - out << commentEnd(++commentNum == commentCount) << std::endl; - } - } - - // Format header metadata - void TPrinter::printMeta(std::ostream& out) const - { - const Json::Value& meta = spvRoot["spv"]["meta"]; - - const auto print = [&](const char* name, const char* fmt, bool isLast) { - out << fmtConstInt(meta[name].asUInt(), name, fmt, isLast); - }; - - print("MagicNumber", "0x%08lx", false); - print("Version", "0x%08lx", false); - print("Revision", "%d", false); - print("OpCodeMask", "0x%04x", false); - print("WordCountShift", "%d", true); - } - - // Format value definitions in language specific way - void TPrinter::printDefs(std::ostream& out) const - { - const Json::Value& enums = spvRoot["spv"]["enum"]; - - for (auto opClass = enums.begin(); opClass != enums.end(); ++opClass) { - const bool isMask = (*opClass)["Type"].asString() == "Bit"; - const auto opName = (*opClass)["Name"].asString(); - const auto opPrefix = opName == "Op" ? "" : opName; - - for (enumStyle_t style = (isMask ? enumShift : enumCount); - style <= (isMask ? enumMask : enumCount); style = enumStyle_t(int(style)+1)) { - - out << enumBeg(opName, style); - - if (style == enumMask) - out << enumFmt(opPrefix, valpair_t(0, "MaskNone"), enumNoMask); - - const auto sorted = getSortedVals((*opClass)["Values"]); - - std::string maxEnum = maxEnumFmt(opName, valpair_t(0x7FFFFFFF, "Max"), enumHex); - - bool printMax = (style != enumMask && maxEnum.size() > 0); - - for (const auto& v : sorted) - out << enumFmt(opPrefix, v, style, !printMax && v.second == sorted.back().second); - - if (printMax) - out << maxEnum; - - auto nextOpClass = opClass; - out << enumEnd(opName, style, ++nextOpClass == enums.end()); - } - } - } - - void TPrinter::printAll(std::ostream& out) const - { - printComments(out); - printPrologue(out); - printTypes(out); - printMeta(out); - printDefs(out); - printHasResultType(out); - printEpilogue(out); - } - - // Stream entire header to output - std::ostream& operator<<(std::ostream& out, const TPrinter &p) - { - p.printAll(out); - return out; - } - - // JSON printer. Rather than use the default printer, we supply our own so - // we can control the printing order within various containers. - class TPrinterJSON final : public TPrinter { - private: - void printPrologue(std::ostream& out) const override { out << "{\n" + indent() + "\"spv\":\n" + indent() + "{\n"; } - void printEpilogue(std::ostream& out) const override { out << indent() + "}\n}\n"; } - - std::string escapeComment(const std::string& s) const override { - std::string newStr; - for (auto c : s) { - if (c == '"') { - newStr += '\\'; - newStr += c; - } else { - newStr += c; - } - } - return newStr; - } - - std::string fmtConstInt(unsigned val, const std::string& name, - const char* fmt, bool isLast) const override { - return indent(3) + '"' + name + "\": " + fmtNum("%d", val) + (isLast ? "\n" : ",\n"); - } - - void printMeta(std::ostream& out) const override - { - out << indent(2) + "\"meta\":\n" + indent(2) + "{\n"; - printComments(out); - TPrinter::printMeta(out); - out << indent(2) + "},\n"; - } - - std::string commentBeg() const override { return indent(4) + "[\n"; } - std::string commentEnd(bool isLast) const override { return indent(4) + (isLast ? "]" : "],"); } - std::string commentBOL() const override { return indent(5) + '"'; } - std::string commentEOL(bool isLast) const override { return (isLast ? "\"" : "\","); } - - void printComments(std::ostream& out) const override - { - out << indent(3) + "\"Comment\":\n" + indent(3) + "[\n"; - TPrinter::printComments(out); - out << indent(3) + "],\n"; - } - - void printDefs(std::ostream& out) const override - { - out << indent(2) + "\"enum\":\n" + indent(2) + "[\n"; - TPrinter::printDefs(out); - out << indent(2) + "]\n"; - } - - void printAll(std::ostream& out) const override - { - printPrologue(out); - printMeta(out); - printDefs(out); - printEpilogue(out); - } - - std::string enumBeg(const std::string& s, enumStyle_t style) const override { - if (style == enumMask) - return ""; - return indent(3) + "{\n" + - indent(4) + "\"Name\": \"" + s + "\",\n" + - indent(4) + "\"Type\": " + (style == enumShift ? "\"Bit\"" : "\"Value\"") + ",\n" + - indent(4) + "\"Values\":\n" + - indent(4) + "{\n"; - } - - std::string enumEnd(const std::string& s, enumStyle_t style, bool isLast) const override { - if (style == enumMask) - return ""; - return indent(4) + "}\n" + - indent(3) + "}" + (isLast ? "" : ",") + "\n"; - } - - std::string enumFmt(const std::string& s, const valpair_t& v, - enumStyle_t style, bool isLast) const override { - if (style == enumMask || style == enumNoMask) - return ""; - return indent(5) + '"' + prependIfDigit(s, v.second) + "\": " + fmtNum("%d", v.first) + - (isLast ? "\n" : ",\n"); - } - }; - - // base for C and C++ - class TPrinterCBase : public TPrinter { - protected: - virtual void printPrologue(std::ostream& out) const override { - out << "#ifndef spirv_" << headerGuardSuffix() << std::endl - << "#define spirv_" << headerGuardSuffix() << std::endl - << std::endl; - } - - void printMeta(std::ostream& out) const override { - out << "#define SPV_VERSION 0x" << std::hex << DocVersion << std::dec << "\n"; - out << "#define SPV_REVISION " << DocRevision << "\n"; - out << "\n"; - - return TPrinter::printMeta(out); - } - - virtual void printEpilogue(std::ostream& out) const override { - out << "#endif" << std::endl; - } - - virtual void printTypes(std::ostream& out) const override { - out << "typedef unsigned int " << pre() << "Id;\n\n"; - } - - virtual std::string fmtConstInt(unsigned val, const std::string& name, - const char* fmt, bool isLast) const override - { - return std::string("static const unsigned int ") + pre() + name + - " = " + fmtNum(fmt, val) + (isLast ? ";\n\n" : ";\n"); - } - - virtual std::string pre() const { return ""; } // C name prefix - virtual std::string headerGuardSuffix() const = 0; - - virtual std::string fmtEnumUse(const std::string& opPrefix, const std::string& name) const { return pre() + name; } - - virtual void printHasResultType(std::ostream& out) const override - { - const Json::Value& enums = spvRoot["spv"]["enum"]; - - std::set seenValues; - - for (auto opClass = enums.begin(); opClass != enums.end(); ++opClass) { - const auto opName = (*opClass)["Name"].asString(); - if (opName != "Op") { - continue; - } - - out << "#ifdef SPV_ENABLE_UTILITY_CODE" << std::endl; - out << "inline void " << pre() << "HasResultAndType(" << pre() << opName << " opcode, bool *hasResult, bool *hasResultType) {" << std::endl; - out << " *hasResult = *hasResultType = false;" << std::endl; - out << " switch (opcode) {" << std::endl; - out << " default: /* unknown opcode */ break;" << std::endl; - - for (auto& inst : spv::InstructionDesc) { - - // Filter out duplicate enum values, which would break the switch statement. - // These are probably just extension enums promoted to core. - if (seenValues.find(inst.value) != seenValues.end()) { - continue; - } - seenValues.insert(inst.value); - - std::string name = inst.name; - out << " case " << fmtEnumUse("Op", name) << ": *hasResult = " << (inst.hasResult() ? "true" : "false") << "; *hasResultType = " << (inst.hasType() ? "true" : "false") << "; break;" << std::endl; - } - - out << " }" << std::endl; - out << "}" << std::endl; - out << "#endif /* SPV_ENABLE_UTILITY_CODE */" << std::endl << std::endl; - } - } - }; - - // C printer - class TPrinterC final : public TPrinterCBase { - private: - std::string commentBeg() const override { return "/*\n"; } - std::string commentEnd(bool isLast) const override { return "*/\n"; } - std::string commentBOL() const override { return "** "; } - - std::string enumBeg(const std::string& s, enumStyle_t style) const override { - return std::string("typedef enum ") + pre() + s + styleStr(style) + "_ {\n"; - } - - std::string enumEnd(const std::string& s, enumStyle_t style, bool isLast) const override { - return "} " + pre() + s + styleStr(style) + ";\n\n"; - } - - std::string enumFmt(const std::string& s, const valpair_t& v, - enumStyle_t style, bool isLast) const override { - return indent() + pre() + s + v.second + styleStr(style) + " = " + fmtStyleVal(v.first, style) + ",\n"; - } - - std::string maxEnumFmt(const std::string& s, const valpair_t& v, - enumStyle_t style) const override { - return enumFmt(s, v, style, true); - } - - std::string pre() const override { return "Spv"; } // C name prefix - std::string headerGuardSuffix() const override { return "H"; } - }; - - // C++ printer - class TPrinterCPP : public TPrinterCBase { - private: - void printPrologue(std::ostream& out) const override { - TPrinterCBase::printPrologue(out); - out << "namespace spv {\n\n"; - } - - void printEpilogue(std::ostream& out) const override { - const Json::Value& enums = spvRoot["spv"]["enum"]; - - // Create overloaded operator| for mask types - out << "// Overload operator| for mask bit combining\n\n"; - - for (auto opClass = enums.begin(); opClass != enums.end(); ++opClass) { - const bool isMask = (*opClass)["Type"].asString() == "Bit"; - const auto opName = (*opClass)["Name"].asString(); - - if (isMask) { - const auto typeName = opName + styleStr(enumMask); - - out << "inline " + typeName + " operator|(" + typeName + " a, " + typeName + " b) { return " + - typeName + "(unsigned(a) | unsigned(b)); }\n"; - } - } - - out << "\n} // end namespace spv\n\n"; - out << "#endif // #ifndef spirv_" << headerGuardSuffix() << std::endl; - } - - std::string commentBOL() const override { return "// "; } - - - virtual std::string enumBeg(const std::string& s, enumStyle_t style) const override { - return std::string("enum ") + s + styleStr(style) + " {\n"; - } - - std::string enumEnd(const std::string& s, enumStyle_t style, bool isLast) const override { - return "};\n\n"; - } - - virtual std::string enumFmt(const std::string& s, const valpair_t& v, - enumStyle_t style, bool isLast) const override { - return indent() + s + v.second + styleStr(style) + " = " + fmtStyleVal(v.first, style) + ",\n"; - } - - virtual std::string maxEnumFmt(const std::string& s, const valpair_t& v, - enumStyle_t style) const override { - return enumFmt(s, v, style, true); - } - - // The C++ and C++11 headers define types with the same name. So they - // should use the same header guard. - std::string headerGuardSuffix() const override { return "HPP"; } - - std::string operators; - }; - - // C++11 printer (uses enum classes) - class TPrinterCPP11 final : public TPrinterCPP { - private: - std::string enumBeg(const std::string& s, enumStyle_t style) const override { - return std::string("enum class ") + s + styleStr(style) + " : unsigned {\n"; - } - - std::string enumFmt(const std::string& s, const valpair_t& v, - enumStyle_t style, bool isLast) const override { - return indent() + prependIfDigit(s, v.second) + " = " + fmtStyleVal(v.first, style) + ",\n"; - } - - std::string maxEnumFmt(const std::string& s, const valpair_t& v, - enumStyle_t style) const override { - return enumFmt(s, v, style, true); - } - - // Add type prefix for scoped enum - virtual std::string fmtEnumUse(const std::string& opPrefix, const std::string& name) const override { return opPrefix + "::" + name; } - - std::string headerGuardSuffix() const override { return "HPP"; } - }; - - // LUA printer - class TPrinterLua final : public TPrinter { - private: - void printPrologue(std::ostream& out) const override { out << "spv = {\n"; } - - void printEpilogue(std::ostream& out) const override { out << "}\n"; } - - std::string commentBOL() const override { return "-- "; } - - std::string enumBeg(const std::string& s, enumStyle_t style) const override { - return indent() + s + styleStr(style) + " = {\n"; - } - - std::string enumEnd(const std::string& s, enumStyle_t style, bool isLast) const override { - return indent() + "},\n\n"; - } - - std::string enumFmt(const std::string& s, const valpair_t& v, - enumStyle_t style, bool isLast) const override { - return indent(2) + prependIfDigit(s, v.second) + " = " + fmtStyleVal(v.first, style) + ",\n"; - } - - virtual std::string fmtConstInt(unsigned val, const std::string& name, - const char* fmt, bool isLast) const override - { - return indent() + name + " = " + fmtNum(fmt, val) + (isLast ? ",\n\n" : ",\n"); - } - }; - - // Python printer - class TPrinterPython final : public TPrinter { - private: - void printPrologue(std::ostream& out) const override { out << "spv = {\n"; } - - void printEpilogue(std::ostream& out) const override { out << "}\n"; } - - std::string commentBOL() const override { return "# "; } - - std::string enumBeg(const std::string& s, enumStyle_t style) const override { - return indent() + "'" + s + styleStr(style) + "'" + " : {\n"; - } - - std::string enumEnd(const std::string& s, enumStyle_t style, bool isLast) const override { - return indent() + "},\n\n"; - } - - std::string enumFmt(const std::string& s, const valpair_t& v, - enumStyle_t style, bool isLast) const override { - return indent(2) + "'" + prependIfDigit(s, v.second) + "'" + " : " + fmtStyleVal(v.first, style) + ",\n"; - } - - std::string fmtConstInt(unsigned val, const std::string& name, - const char* fmt, bool isLast) const override - { - return indent() + "'" + name + "'" + " : " + fmtNum(fmt, val) + (isLast ? ",\n\n" : ",\n"); - } - }; - - // C# printer - class TPrinterCSharp final : public TPrinter { - private: - std::string commentBOL() const override { return "// "; } - - void printPrologue(std::ostream& out) const override { - out << "namespace Spv\n{\n\n"; - out << indent() << "public static class Specification\n"; - out << indent() << "{\n"; - } - - void printEpilogue(std::ostream& out) const override { - out << indent() << "}\n"; - out << "}\n"; - } - - std::string enumBeg(const std::string& s, enumStyle_t style) const override { - return indent(2) + "public enum " + s + styleStr(style) + "\n" + indent(2) + "{\n"; - } - - std::string enumEnd(const std::string& s, enumStyle_t style, bool isLast) const override { - return indent(2) + "}" + + (isLast ? "\n" : "\n\n"); - } - - std::string enumFmt(const std::string& s, const valpair_t& v, - enumStyle_t style, bool isLast) const override { - return indent(3) + prependIfDigit(s, v.second) + " = " + fmtStyleVal(v.first, style) + ",\n"; - } - - std::string fmtConstInt(unsigned val, const std::string& name, - const char* fmt, bool isLast) const override { - return indent(2) + std::string("public const uint ") + name + - " = " + fmtNum(fmt, val) + (isLast ? ";\n\n" : ";\n"); - } - }; - - // D printer - class TPrinterD final : public TPrinter { - private: - std::string commentBeg() const override { return "/+\n"; } - std::string commentBOL() const override { return " + "; } - std::string commentEnd(bool isLast) const override { return " +/\n"; } - - void printPrologue(std::ostream& out) const override { - out << "module spv;\n\n"; - } - - void printEpilogue(std::ostream& out) const override { - } - - std::string enumBeg(const std::string& s, enumStyle_t style) const override { - return "enum " + s + styleStr(style) + " : uint\n{\n"; - } - - std::string enumEnd(const std::string& s, enumStyle_t style, bool isLast) const override { - return std::string("}\n\n"); - } - - std::string enumFmt(const std::string& s, const valpair_t& v, - enumStyle_t style, bool isLast) const override { - return indent() + prependIfDigit("_", v.second) + " = " + fmtStyleVal(v.first, style) + ",\n"; - } - - std::string fmtConstInt(unsigned val, const std::string& name, - const char* fmt, bool isLast) const override { - return std::string("enum uint ") + name + - " = " + fmtNum(fmt, val) + (isLast ? ";\n\n" : ";\n"); - } - }; - -} // namespace - -namespace spv { - void PrintAllHeaders() - { - // TODO: Once MSVC 2012 is no longer a factor, use brace initializers here - std::vector> langInfo; - - langInfo.push_back(std::make_pair(ELangC, "spirv.h")); - langInfo.push_back(std::make_pair(ELangCPP, "spirv.hpp")); - langInfo.push_back(std::make_pair(ELangCPP11, "spirv.hpp11")); - langInfo.push_back(std::make_pair(ELangJSON, "spirv.json")); - langInfo.push_back(std::make_pair(ELangLua, "spirv.lua")); - langInfo.push_back(std::make_pair(ELangPython, "spirv.py")); - langInfo.push_back(std::make_pair(ELangCSharp, "spirv.cs")); - langInfo.push_back(std::make_pair(ELangD, "spv.d")); - - for (const auto& lang : langInfo) { - std::ofstream out(lang.second, std::ios::out); - - if ((out.rdstate() & std::ifstream::failbit)) { - std::cerr << "Unable to open file: " << lang.second << std::endl; - } else { - PrintHeader(lang.first, out); - } - } - } - - // Print header for given language to given output stream - void PrintHeader(TLanguage lang, std::ostream& out) - { - typedef std::unique_ptr TPrinterPtr; - TPrinterPtr p; - - switch (lang) { - case ELangC: p = TPrinterPtr(new TPrinterC); break; - case ELangCPP: p = TPrinterPtr(new TPrinterCPP); break; - case ELangCPP11: p = TPrinterPtr(new TPrinterCPP11); break; - case ELangJSON: p = TPrinterPtr(new TPrinterJSON); break; - case ELangLua: p = TPrinterPtr(new TPrinterLua); break; - case ELangPython: p = TPrinterPtr(new TPrinterPython); break; - case ELangCSharp: p = TPrinterPtr(new TPrinterCSharp); break; - case ELangD: p = TPrinterPtr(new TPrinterD); break; - case ELangAll: PrintAllHeaders(); break; - default: - std::cerr << "Unknown language." << std::endl; - return; - } - - // Print the data in the requested format - if (p) - out << *p << std::endl; - - // object is auto-deleted - } - -} // namespace spv diff --git a/tools/buildHeaders/header.h b/tools/buildHeaders/header.h deleted file mode 100644 index 9c34b211..00000000 --- a/tools/buildHeaders/header.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) 2014-2019 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -// -// Print headers for SPIR-V in several languages. -// - -#pragma once -#ifndef header -#define header - -#include - -namespace spv { - // Languages supported - enum TLanguage { - ELangC, // C - ELangCPP, // C++03 - ELangCPP11, // C++11 - ELangJSON, // JSON - ELangLua, // Lua - ELangPython, // Python - ELangCSharp, // CSharp - ELangD, // D - - ELangAll, // print headers in all languages to files - }; - - // Generate header for requested language - void PrintHeader(TLanguage, std::ostream&); -} // namespace spv - -#endif // header diff --git a/tools/buildHeaders/jsonToSpirv.cpp b/tools/buildHeaders/jsonToSpirv.cpp deleted file mode 100644 index 67b5bce5..00000000 --- a/tools/buildHeaders/jsonToSpirv.cpp +++ /dev/null @@ -1,551 +0,0 @@ -// Copyright (c) 2014-2020 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "jsoncpp/dist/json/json.h" - -#include "jsonToSpirv.h" - -namespace spv { - -// The set of objects that hold all the instruction/operand -// parameterization information. -InstructionValues InstructionDesc; - -// The ordered list (in printing order) of printing classes -// (specification subsections). -PrintingClasses InstructionPrintingClasses; - -// Note: There is no entry for OperandOpcode. Use InstructionDesc instead. -EnumDefinition OperandClassParams[OperandOpcode]; -EnumValues SourceLanguageParams; -EnumValues ExecutionModelParams; -EnumValues AddressingParams; -EnumValues MemoryParams; -EnumValues ExecutionModeParams; -EnumValues StorageParams; -EnumValues SamplerAddressingModeParams; -EnumValues SamplerFilterModeParams; -EnumValues ImageFormatParams; -EnumValues ImageChannelOrderParams; -EnumValues ImageChannelDataTypeParams; -EnumValues ImageOperandsParams; -EnumValues FPFastMathParams; -EnumValues FPRoundingModeParams; -EnumValues FPDenormModeParams; -EnumValues FPOperationModeParams; -EnumValues QuantizationModesParams; -EnumValues OverflowModesParams; -EnumValues LinkageTypeParams; -EnumValues DecorationParams; -EnumValues BuiltInParams; -EnumValues DimensionalityParams; -EnumValues FuncParamAttrParams; -EnumValues AccessQualifierParams; -EnumValues GroupOperationParams; -EnumValues LoopControlParams; -EnumValues SelectionControlParams; -EnumValues FunctionControlParams; -EnumValues MemorySemanticsParams; -EnumValues MemoryAccessParams; -EnumValues ScopeParams; -EnumValues KernelEnqueueFlagsParams; -EnumValues KernelProfilingInfoParams; -EnumValues CapabilityParams; -EnumValues RayFlagsParams; -EnumValues RayQueryIntersectionParams; -EnumValues RayQueryCommittedIntersectionTypeParams; -EnumValues RayQueryCandidateIntersectionTypeParams; -EnumValues FragmentShadingRateParams; -EnumValues PackedVectorFormatParams; - -std::pair ReadFile(const std::string& path) -{ - std::ifstream fstream(path, std::ios::in); - if (fstream) { - std::string contents; - fstream.seekg(0, std::ios::end); - contents.reserve((unsigned int)fstream.tellg()); - fstream.seekg(0, std::ios::beg); - contents.assign((std::istreambuf_iterator(fstream)), - std::istreambuf_iterator()); - return std::make_pair(true, contents); - } - return std::make_pair(false, ""); -} - -struct ClassOptionality { - OperandClass type; - bool optional; -}; - -// Converts the |operandKind| and |quantifier| pair used to describe operands -// in the JSON grammar to OperandClass and optionality used in this repo. -ClassOptionality ToOperandClassAndOptionality(const std::string& operandKind, const std::string& quantifier) -{ - assert(quantifier.empty() || quantifier == "?" || quantifier == "*"); - - if (operandKind == "IdRef") { - if (quantifier.empty()) - return {OperandId, false}; - else if (quantifier == "?") - return {OperandId, true}; - else - return {OperandVariableIds, false}; - } else if (operandKind == "LiteralInteger") { - if (quantifier.empty()) - return {OperandLiteralNumber, false}; - if (quantifier == "?") - return {OperandOptionalLiteral, true}; - else - return {OperandVariableLiterals, false}; - } else if (operandKind == "LiteralString") { - if (quantifier.empty()) - return {OperandLiteralString, false}; - else if (quantifier == "?") - return {OperandLiteralString, true}; - else { - return {OperandOptionalLiteralStrings, false}; - } - } else if (operandKind == "PairLiteralIntegerIdRef") { - // Used by OpSwitch in the grammar - return {OperandVariableLiteralId, false}; - } else if (operandKind == "PairIdRefLiteralInteger") { - // Used by OpGroupMemberDecorate in the grammar - return {OperandVariableIdLiteral, false}; - } else if (operandKind == "PairIdRefIdRef") { - // Used by OpPhi in the grammar - return {OperandVariableIds, false}; - } else { - OperandClass type = OperandNone; - if (operandKind == "IdMemorySemantics" || operandKind == "MemorySemantics") { - type = OperandMemorySemantics; - } else if (operandKind == "IdScope" || operandKind == "Scope") { - type = OperandScope; - } else if (operandKind == "LiteralExtInstInteger") { - type = OperandLiteralNumber; - } else if (operandKind == "LiteralSpecConstantOpInteger") { - type = OperandLiteralNumber; - } else if (operandKind == "LiteralContextDependentNumber") { - type = OperandAnySizeLiteralNumber; - } else if (operandKind == "SourceLanguage") { - type = OperandSource; - } else if (operandKind == "ExecutionModel") { - type = OperandExecutionModel; - } else if (operandKind == "AddressingModel") { - type = OperandAddressing; - } else if (operandKind == "MemoryModel") { - type = OperandMemory; - } else if (operandKind == "ExecutionMode") { - type = OperandExecutionMode; - } else if (operandKind == "StorageClass") { - type = OperandStorage; - } else if (operandKind == "Dim") { - type = OperandDimensionality; - } else if (operandKind == "SamplerAddressingMode") { - type = OperandSamplerAddressingMode; - } else if (operandKind == "SamplerFilterMode") { - type = OperandSamplerFilterMode; - } else if (operandKind == "ImageFormat") { - type = OperandSamplerImageFormat; - } else if (operandKind == "ImageChannelOrder") { - type = OperandImageChannelOrder; - } else if (operandKind == "ImageChannelDataType") { - type = OperandImageChannelDataType; - } else if (operandKind == "FPRoundingMode") { - type = OperandFPRoundingMode; - } else if (operandKind == "FPDenormMode") { - type = OperandFPDenormMode; - } else if (operandKind == "FPOperationMode") { - type = OperandFPOperationMode; - } else if (operandKind == "QuantizationModes") { - type = OperandQuantizationModes; - } else if (operandKind == "OverflowModes") { - type = OperandOverflowModes; - } else if (operandKind == "LinkageType") { - type = OperandLinkageType; - } else if (operandKind == "AccessQualifier") { - type = OperandAccessQualifier; - } else if (operandKind == "FunctionParameterAttribute") { - type = OperandFuncParamAttr; - } else if (operandKind == "Decoration") { - type = OperandDecoration; - } else if (operandKind == "BuiltIn") { - type = OperandBuiltIn; - } else if (operandKind == "GroupOperation") { - type = OperandGroupOperation; - } else if (operandKind == "KernelEnqueueFlags") { - type = OperandKernelEnqueueFlags; - } else if (operandKind == "KernelProfilingInfo") { - type = OperandKernelProfilingInfo; - } else if (operandKind == "Capability") { - type = OperandCapability; - } else if (operandKind == "ImageOperands") { - type = OperandImageOperands; - } else if (operandKind == "FPFastMathMode") { - type = OperandFPFastMath; - } else if (operandKind == "SelectionControl") { - type = OperandSelect; - } else if (operandKind == "LoopControl") { - type = OperandLoop; - } else if (operandKind == "FunctionControl") { - type = OperandFunction; - } else if (operandKind == "MemoryAccess") { - type = OperandMemoryOperands; - } else if (operandKind == "RayFlags") { - type = OperandRayFlags; - } else if (operandKind == "RayQueryIntersection") { - type = OperandRayQueryIntersection; - } else if (operandKind == "RayQueryCommittedIntersectionType") { - type = OperandRayQueryCommittedIntersectionType; - } else if (operandKind == "RayQueryCandidateIntersectionType") { - type = OperandRayQueryCandidateIntersectionType; - } else if (operandKind == "FragmentShadingRate") { - type = OperandFragmentShadingRate; - } else if (operandKind == "PackedVectorFormat") { - type = OperandPackedVectorFormat; - } - - if (type == OperandNone) { - std::cerr << "Unhandled operand kind found: " << operandKind << std::endl; - exit(1); - } - return {type, !quantifier.empty()}; - } -} - -bool IsTypeOrResultId(const std::string& str, bool* isType, bool* isResult) -{ - if (str == "IdResultType") - return *isType = true; - if (str == "IdResult") - return *isResult = true; - return false; -} - -// Given a number string, returns the position of the only bits set in the number. -// So it requires the number is a power of two. -unsigned int NumberStringToBit(const std::string& str) -{ - char* parseEnd; - unsigned int value = (unsigned int)std::strtol(str.c_str(), &parseEnd, 16); - assert(!(value & (value - 1)) && "input number is not a power of 2"); - unsigned int bit = 0; - for (; value; value >>= 1) ++bit; - return bit; -} - -void jsonToSpirv(const std::string& jsonPath, bool buildingHeaders) -{ - // only do this once. - static bool initialized = false; - if (initialized) - return; - initialized = true; - - // Read the JSON grammar file. - bool fileReadOk = false; - std::string content; - std::tie(fileReadOk, content) = ReadFile(jsonPath); - if (!fileReadOk) { - std::cerr << "Failed to read JSON grammar file: " - << jsonPath << std::endl; - exit(1); - } - - // Decode the JSON grammar file. - Json::Reader reader; - Json::Value root; - if (!reader.parse(content, root)) { - std::cerr << "Failed to parse JSON grammar:\n" - << reader.getFormattedErrorMessages(); - exit(1); - } - - // Layouts for all instructions. - - // A lambda for returning capabilities from a JSON object as strings. - const auto getCaps = [](const Json::Value& object) { - EnumCaps result; - const auto& caps = object["capabilities"]; - if (!caps.empty()) { - assert(caps.isArray()); - for (const auto& cap : caps) { - result.emplace_back(cap.asString()); - } - } - return result; - }; - - // A lambda for returning extensions from a JSON object as strings. - const auto getExts = [](const Json::Value& object) { - Extensions result; - const auto& exts = object["extensions"]; - if (!exts.empty()) { - assert(exts.isArray()); - for (const auto& ext : exts) { - result.emplace_back(ext.asString()); - } - } - return result; - }; - - // set up the printing classes - std::unordered_set tags; // short-lived local for error checking below - const Json::Value printingClasses = root["instruction_printing_class"]; - for (const auto& printingClass : printingClasses) { - if (printingClass["tag"].asString().size() > 0) - tags.insert(printingClass["tag"].asString()); // just for error checking - else - std::cerr << "Error: each instruction_printing_class requires a non-empty \"tag\"" << std::endl; - if (buildingHeaders || printingClass["tag"].asString() != "@exclude") { - InstructionPrintingClasses.push_back({printingClass["tag"].asString(), - printingClass["heading"].asString()}); - } - } - - // process the instructions - const Json::Value insts = root["instructions"]; - unsigned maxOpcode = 0; - bool firstOpcode = true; - for (const auto& inst : insts) { - const auto printingClass = inst["class"].asString(); - if (printingClass.size() == 0) { - std::cerr << "Error: " << inst["opname"].asString() - << " requires a non-empty printing \"class\" tag" << std::endl; - } - if (!buildingHeaders && printingClass == "@exclude") - continue; - if (tags.find(printingClass) == tags.end()) { - std::cerr << "Error: " << inst["opname"].asString() - << " requires a \"class\" declared as a \"tag\" in \"instruction printing_class\"" - << std::endl; - } - const auto opcode = inst["opcode"].asUInt(); - const std::string name = inst["opname"].asString(); - if (firstOpcode) { - maxOpcode = opcode; - firstOpcode = false; - } else { - if (maxOpcode > opcode) { - std::cerr << "Error: " << name - << " is out of order. It follows the instruction with opcode " << maxOpcode - << std::endl; - std::exit(1); - } else { - maxOpcode = opcode; - } - } - EnumCaps caps = getCaps(inst); - std::string version = inst["version"].asString(); - std::string lastVersion = inst["lastVersion"].asString(); - Extensions exts = getExts(inst); - OperandParameters operands; - bool defResultId = false; - bool defTypeId = false; - for (const auto& operand : inst["operands"]) { - const std::string kind = operand["kind"].asString(); - const std::string quantifier = operand.get("quantifier", "").asString(); - const std::string doc = operand.get("name", "").asString(); - if (!IsTypeOrResultId(kind, &defTypeId, &defResultId)) { - const auto p = ToOperandClassAndOptionality(kind, quantifier); - operands.push(p.type, doc, p.optional); - } - } - InstructionDesc.emplace_back( - std::move(EnumValue(opcode, name, - std::move(caps), std::move(version), std::move(lastVersion), std::move(exts), - std::move(operands))), - printingClass, defTypeId, defResultId); - } - - // Specific additional context-dependent operands - - // Populate dest with EnumValue objects constructed from source. - const auto populateEnumValues = [&getCaps,&getExts](EnumValues* dest, const Json::Value& source, bool bitEnum) { - // A lambda for determining the numeric value to be used for a given - // enumerant in JSON form, and whether that value is a 0 in a bitfield. - auto getValue = [&bitEnum](const Json::Value& enumerant) { - std::pair result{0u,false}; - if (!bitEnum) { - result.first = enumerant["value"].asUInt(); - } else { - const unsigned int bit = NumberStringToBit(enumerant["value"].asString()); - if (bit == 0) - result.second = true; - else - result.first = bit - 1; // This is the *shift* amount. - } - return result; - }; - - unsigned maxValue = 0; - bool firstValue = true; - for (const auto& enumerant : source["enumerants"]) { - unsigned value; - bool skip_zero_in_bitfield; - std::tie(value, skip_zero_in_bitfield) = getValue(enumerant); - if (skip_zero_in_bitfield) - continue; - if (firstValue) { - maxValue = value; - firstValue = false; - } else { - if (maxValue > value) { - std::cerr << "Error: " << source["kind"] << " enumerant " << enumerant["enumerant"] - << " is out of order. It has value " << value - << " but follows the enumerant with value " << maxValue << std::endl; - std::exit(1); - } else { - maxValue = value; - } - } - EnumCaps caps(getCaps(enumerant)); - std::string version = enumerant["version"].asString(); - std::string lastVersion = enumerant["lastVersion"].asString(); - Extensions exts(getExts(enumerant)); - OperandParameters params; - const Json::Value& paramsJson = enumerant["parameters"]; - if (!paramsJson.empty()) { // This enumerant has parameters. - assert(paramsJson.isArray()); - for (const auto& param : paramsJson) { - const std::string kind = param["kind"].asString(); - const std::string doc = param.get("name", "").asString(); - const auto p = ToOperandClassAndOptionality(kind, ""); // All parameters are required! - params.push(p.type, doc); - } - } - dest->emplace_back( - value, enumerant["enumerant"].asString(), - std::move(caps), std::move(version), std::move(lastVersion), std::move(exts), std::move(params)); - } - }; - - const auto establishOperandClass = [&populateEnumValues]( - const std::string& enumName, spv::OperandClass operandClass, - spv::EnumValues* enumValues, const Json::Value& operandEnum, const std::string& category) { - assert(category == "BitEnum" || category == "ValueEnum"); - bool bitEnum = (category == "BitEnum"); - populateEnumValues(enumValues, operandEnum, bitEnum); - OperandClassParams[operandClass].set(enumName, enumValues, bitEnum); - }; - - const Json::Value operandEnums = root["operand_kinds"]; - for (const auto& operandEnum : operandEnums) { - const std::string enumName = operandEnum["kind"].asString(); - const std::string category = operandEnum["category"].asString(); - if (enumName == "SourceLanguage") { - establishOperandClass(enumName, OperandSource, &SourceLanguageParams, operandEnum, category); - } else if (enumName == "Decoration") { - establishOperandClass(enumName, OperandDecoration, &DecorationParams, operandEnum, category); - } else if (enumName == "ExecutionMode") { - establishOperandClass(enumName, OperandExecutionMode, &ExecutionModeParams, operandEnum, category); - } else if (enumName == "Capability") { - establishOperandClass(enumName, OperandCapability, &CapabilityParams, operandEnum, category); - } else if (enumName == "AddressingModel") { - establishOperandClass(enumName, OperandAddressing, &AddressingParams, operandEnum, category); - } else if (enumName == "MemoryModel") { - establishOperandClass(enumName, OperandMemory, &MemoryParams, operandEnum, category); - } else if (enumName == "MemorySemantics") { - establishOperandClass(enumName, OperandMemorySemantics, &MemorySemanticsParams, operandEnum, category); - } else if (enumName == "ExecutionModel") { - establishOperandClass(enumName, OperandExecutionModel, &ExecutionModelParams, operandEnum, category); - } else if (enumName == "StorageClass") { - establishOperandClass(enumName, OperandStorage, &StorageParams, operandEnum, category); - } else if (enumName == "SamplerAddressingMode") { - establishOperandClass(enumName, OperandSamplerAddressingMode, &SamplerAddressingModeParams, operandEnum, category); - } else if (enumName == "SamplerFilterMode") { - establishOperandClass(enumName, OperandSamplerFilterMode, &SamplerFilterModeParams, operandEnum, category); - } else if (enumName == "ImageFormat") { - establishOperandClass(enumName, OperandSamplerImageFormat, &ImageFormatParams, operandEnum, category); - } else if (enumName == "ImageChannelOrder") { - establishOperandClass(enumName, OperandImageChannelOrder, &ImageChannelOrderParams, operandEnum, category); - } else if (enumName == "ImageChannelDataType") { - establishOperandClass(enumName, OperandImageChannelDataType, &ImageChannelDataTypeParams, operandEnum, category); - } else if (enumName == "ImageOperands") { - establishOperandClass(enumName, OperandImageOperands, &ImageOperandsParams, operandEnum, category); - } else if (enumName == "FPFastMathMode") { - establishOperandClass(enumName, OperandFPFastMath, &FPFastMathParams, operandEnum, category); - } else if (enumName == "FPRoundingMode") { - establishOperandClass(enumName, OperandFPRoundingMode, &FPRoundingModeParams, operandEnum, category); - } else if (enumName == "FPDenormMode") { - establishOperandClass(enumName, OperandFPDenormMode, &FPDenormModeParams, operandEnum, category); - } else if (enumName == "FPOperationMode") { - establishOperandClass(enumName, OperandFPOperationMode, &FPOperationModeParams, operandEnum, category); - } else if (enumName == "QuantizationModes") { - establishOperandClass(enumName, OperandQuantizationModes, &QuantizationModesParams, operandEnum, category); - } else if (enumName == "OverflowModes") { - establishOperandClass(enumName, OperandOverflowModes, &OverflowModesParams, operandEnum, category); - } else if (enumName == "LinkageType") { - establishOperandClass(enumName, OperandLinkageType, &LinkageTypeParams, operandEnum, category); - } else if (enumName == "FunctionParameterAttribute") { - establishOperandClass(enumName, OperandFuncParamAttr, &FuncParamAttrParams, operandEnum, category); - } else if (enumName == "AccessQualifier") { - establishOperandClass(enumName, OperandAccessQualifier, &AccessQualifierParams, operandEnum, category); - } else if (enumName == "BuiltIn") { - establishOperandClass(enumName, OperandBuiltIn, &BuiltInParams, operandEnum, category); - } else if (enumName == "SelectionControl") { - establishOperandClass(enumName, OperandSelect, &SelectionControlParams, operandEnum, category); - } else if (enumName == "LoopControl") { - establishOperandClass(enumName, OperandLoop, &LoopControlParams, operandEnum, category); - } else if (enumName == "FunctionControl") { - establishOperandClass(enumName, OperandFunction, &FunctionControlParams, operandEnum, category); - } else if (enumName == "Dim") { - establishOperandClass(enumName, OperandDimensionality, &DimensionalityParams, operandEnum, category); - } else if (enumName == "MemoryAccess") { - establishOperandClass(enumName, OperandMemoryOperands, &MemoryAccessParams, operandEnum, category); - } else if (enumName == "Scope") { - establishOperandClass(enumName, OperandScope, &ScopeParams, operandEnum, category); - } else if (enumName == "GroupOperation") { - establishOperandClass(enumName, OperandGroupOperation, &GroupOperationParams, operandEnum, category); - } else if (enumName == "KernelEnqueueFlags") { - establishOperandClass(enumName, OperandKernelEnqueueFlags, &KernelEnqueueFlagsParams, operandEnum, category); - } else if (enumName == "KernelProfilingInfo") { - establishOperandClass(enumName, OperandKernelProfilingInfo, &KernelProfilingInfoParams, operandEnum, category); - } else if (enumName == "RayFlags") { - establishOperandClass(enumName, OperandRayFlags, &RayFlagsParams, operandEnum, category); - } else if (enumName == "RayQueryIntersection") { - establishOperandClass(enumName, OperandRayQueryIntersection, &RayQueryIntersectionParams, operandEnum, category); - } else if (enumName == "RayQueryCommittedIntersectionType") { - establishOperandClass(enumName, OperandRayQueryCommittedIntersectionType, &RayQueryCommittedIntersectionTypeParams, operandEnum, category); - } else if (enumName == "RayQueryCandidateIntersectionType") { - establishOperandClass(enumName, OperandRayQueryCandidateIntersectionType, &RayQueryCandidateIntersectionTypeParams, operandEnum, category); - } else if (enumName == "FragmentShadingRate") { - establishOperandClass(enumName, OperandFragmentShadingRate, &FragmentShadingRateParams, operandEnum, category); - } else if (enumName == "PackedVectorFormat") { - establishOperandClass(enumName, OperandPackedVectorFormat, &PackedVectorFormatParams, operandEnum, category); - } - } -} - -}; // end namespace spv diff --git a/tools/buildHeaders/jsonToSpirv.h b/tools/buildHeaders/jsonToSpirv.h deleted file mode 100644 index 3be64568..00000000 --- a/tools/buildHeaders/jsonToSpirv.h +++ /dev/null @@ -1,301 +0,0 @@ -// Copyright (c) 2014-2020 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -#pragma once -#ifndef JSON_TO_SPIRV -#define JSON_TO_SPIRV - -#include -#include -#include -#include - -namespace spv { - - // Reads the file in the given |path|. Returns true and the contents of the -// file on success; otherwise, returns false and an empty string. -std::pair ReadFile(const std::string& path); - -// Fill in all the parameters -void jsonToSpirv(const std::string& jsonPath, bool buildingHeaders); - -// For parameterizing operands. -// The ordering here affects the printing order in the SPIR-V specification. -// Please add new operand classes at the end. -enum OperandClass { - OperandNone, - OperandId, - OperandVariableIds, - OperandOptionalLiteral, - OperandOptionalLiteralString, - OperandOptionalLiteralStrings, - OperandVariableLiterals, - OperandVariableIdLiteral, - OperandVariableLiteralId, - OperandAnySizeLiteralNumber, - OperandLiteralNumber, - OperandLiteralString, - OperandSource, - OperandExecutionModel, - OperandAddressing, - OperandMemory, - OperandExecutionMode, - OperandStorage, - OperandDimensionality, - OperandSamplerAddressingMode, - OperandSamplerFilterMode, - OperandSamplerImageFormat, - OperandImageChannelOrder, - OperandImageChannelDataType, - OperandImageOperands, - OperandFPFastMath, - OperandFPRoundingMode, - OperandLinkageType, - OperandAccessQualifier, - OperandFuncParamAttr, - OperandDecoration, - OperandBuiltIn, - OperandSelect, - OperandLoop, - OperandFunction, - OperandMemorySemantics, - OperandMemoryOperands, - OperandScope, - OperandGroupOperation, - OperandKernelEnqueueFlags, - OperandKernelProfilingInfo, - OperandCapability, - OperandRayFlags, - OperandRayQueryIntersection, - OperandRayQueryCommittedIntersectionType, - OperandRayQueryCandidateIntersectionType, - OperandFragmentShadingRate, - OperandFPDenormMode, - OperandFPOperationMode, - OperandQuantizationModes, - OperandOverflowModes, - OperandPackedVectorFormat, - - OperandOpcode, - - OperandCount -}; - -// For direct representation of the JSON grammar "instruction_printing_class". -struct PrintingClass { - std::string tag; - std::string heading; -}; -using PrintingClasses = std::vector; - -// Any specific enum can have a set of capabilities that allow it: -typedef std::vector EnumCaps; - -// A set of extensions. -typedef std::vector Extensions; - -// Parameterize a set of operands with their OperandClass(es) and descriptions. -class OperandParameters { -public: - OperandParameters() { } - void push(OperandClass oc, const std::string& d, bool opt = false) - { - opClass.push_back(oc); - desc.push_back(d); - optional.push_back(opt); - } - void setOptional(); - OperandClass getClass(int op) const { return opClass[op]; } - const char* getDesc(int op) const { return desc[op].c_str(); } - bool isOptional(int op) const { return optional[op]; } - int getNum() const { return (int)opClass.size(); } - -protected: - std::vector opClass; - std::vector desc; - std::vector optional; -}; - -// An ordered sequence of EValue. We'll preserve the order found in the -// JSON file. You can look up a value by enum or by name. If there are -// duplicate values, then take the first. We assume names are unique. -// The EValue must have an unsigned |value| field and a string |name| field. -template -class EnumValuesContainer { -public: - using ContainerType = std::vector; - using iterator = typename ContainerType::iterator; - using const_iterator = typename ContainerType::const_iterator; - - EnumValuesContainer() {} - - // Constructs an EValue in place as a new element at the end of the - // sequence. - template - void emplace_back(Args&&... args) { - values.emplace_back(std::forward(args)...); - } - - // Returns the first EValue in the sequence with the given value. - // More than one EValue might have the same value. - EValue& operator[](unsigned value) { - auto where = std::find_if(begin(), end(), [&value](const EValue& e) { - return value == e.value; - }); - assert((where != end()) && "Could not find enum in the enum list"); - return *where; - } - // gets *all* entries for the value, including the first one - void gatherAliases(unsigned value, std::vector& aliases) { - std::for_each(begin(), end(), [&](EValue& e) { - if (value == e.value) - aliases.push_back(&e);}); - } - // Returns the EValue with the given name. We assume uniqueness - // by name. - EValue& at(std::string name) { - auto where = std::find_if(begin(), end(), [&name](const EValue& e) { - return name == e.name; - }); - assert((where != end()) && "Could not find name in the enum list"); - return *where; - } - - iterator begin() { return values.begin(); } - iterator end() { return values.end(); } - -private: - ContainerType values; -}; - -// A single enumerant value. Corresponds to a row in an enumeration table -// in the spec. -class EnumValue { -public: - EnumValue() : value(0), desc(nullptr) {} - EnumValue(unsigned int the_value, const std::string& the_name, EnumCaps&& the_caps, - const std::string& the_firstVersion, const std::string& the_lastVersion, - Extensions&& the_extensions, OperandParameters&& the_operands) : - value(the_value), name(the_name), capabilities(std::move(the_caps)), - firstVersion(std::move(the_firstVersion)), lastVersion(std::move(the_lastVersion)), - extensions(std::move(the_extensions)), operands(std::move(the_operands)), desc(nullptr) { } - - // For ValueEnum, the value from the JSON file. - // For BitEnum, the index of the bit position represented by this mask. - // (That is, what you shift 1 by to get the mask.) - unsigned value; - std::string name; - EnumCaps capabilities; - std::string firstVersion; - std::string lastVersion; - // A feature only be enabled by certain extensions. - // An empty list means the feature does not require an extension. - // Normally, only Capability enums are enabled by extension. In turn, - // other enums and instructions are enabled by those capabilities. - Extensions extensions; - OperandParameters operands; - const char* desc; -}; - -using EnumValues = EnumValuesContainer; - -// Parameterize a set of enumerants that form an enum -class EnumDefinition { -public: - EnumDefinition() : - desc(0), bitmask(false), enumValues(nullptr) { } - void set(const std::string& enumName, EnumValues* enumValuesArg, bool mask = false) - { - codeName = enumName; - bitmask = mask; - enumValues = enumValuesArg; - } - // Returns the first EnumValue in the sequence with the given value. - // More than one EnumValue might have the same value. Only valid - // if enumValues has been populated. - EnumValue& operator[](unsigned value) { - assert(enumValues != nullptr); - return (*enumValues)[value]; - } - // Returns the name of the first EnumValue with the given value. - // Assumes enumValues has been populated. - const char* getName(unsigned value) { - return (*this)[value].name.c_str(); - } - - using iterator = EnumValues::iterator; - iterator begin() { return enumValues->begin(); } - iterator end() { return enumValues->end(); } - - std::string codeName; // name to use when declaring headers for code - const char* desc; - bool bitmask; // true if these enumerants combine into a bitmask - EnumValues* enumValues; // parameters for each individual enumerant -}; - -// Parameterize an instruction's logical format, including its known set of operands, -// per OperandParameters above. -class InstructionValue : public EnumValue { -public: - InstructionValue(EnumValue&& e, const std::string& printClass, bool has_type, bool has_result) - : EnumValue(std::move(e)), - printingClass(printClass), - opDesc("TBD"), - typePresent(has_type), - resultPresent(has_result), - alias(this) { } - InstructionValue(const InstructionValue& v) - { - *this = v; - alias = this; - } - - bool hasResult() const { return resultPresent != 0; } - bool hasType() const { return typePresent != 0; } - void setAlias(const InstructionValue& a) { alias = &a; } - const InstructionValue& getAlias() const { return *alias; } - bool isAlias() const { return alias != this; } - - std::string printingClass; - const char* opDesc; - -protected: - int typePresent : 1; - int resultPresent : 1; - const InstructionValue* alias; // correct only after discovering the aliases; otherwise points to this -}; - -using InstructionValues = EnumValuesContainer; - -// Parameterization info for all instructions. -extern InstructionValues InstructionDesc; -extern PrintingClasses InstructionPrintingClasses; - -// These hold definitions of the enumerants used for operands. -// This is indexed by OperandClass, but not including OperandOpcode. -extern EnumDefinition OperandClassParams[]; - -}; // end namespace spv - -#endif // JSON_TO_SPIRV diff --git a/tools/buildHeaders/jsoncpp/dist/json/json-forwards.h b/tools/buildHeaders/jsoncpp/dist/json/json-forwards.h deleted file mode 100644 index ccbdb2b1..00000000 --- a/tools/buildHeaders/jsoncpp/dist/json/json-forwards.h +++ /dev/null @@ -1,255 +0,0 @@ -/// Json-cpp amalgated forward header (http://jsoncpp.sourceforge.net/). -/// It is intended to be used with #include "json/json-forwards.h" -/// This header provides forward declaration for all JsonCpp types. - -// ////////////////////////////////////////////////////////////////////// -// Beginning of content of file: LICENSE -// ////////////////////////////////////////////////////////////////////// - -/* -The JsonCpp library's source code, including accompanying documentation, -tests and demonstration applications, are licensed under the following -conditions... - -The author (Baptiste Lepilleur) explicitly disclaims copyright in all -jurisdictions which recognize such a disclaimer. In such jurisdictions, -this software is released into the Public Domain. - -In jurisdictions which do not recognize Public Domain property (e.g. Germany as of -2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is -released under the terms of the MIT License (see below). - -In jurisdictions which recognize Public Domain property, the user of this -software may choose to accept it either as 1) Public Domain, 2) under the -conditions of the MIT License (see below), or 3) under the terms of dual -Public Domain/MIT License conditions described here, as they choose. - -The MIT License is about as close to Public Domain as a license can get, and is -described in clear, concise terms at: - - http://en.wikipedia.org/wiki/MIT_License - -The full text of the MIT License follows: - -======================================================================== -Copyright (c) 2007-2010 Baptiste Lepilleur - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, copy, -modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -======================================================================== -(END LICENSE TEXT) - -The MIT license is compatible with both the GPL and commercial -software, affording one all of the rights of Public Domain with the -minor nuisance of being required to keep the above copyright notice -and license text in the source code. Note also that by accepting the -Public Domain "license" you can re-license your copy using whatever -license you like. - -*/ - -// ////////////////////////////////////////////////////////////////////// -// End of content of file: LICENSE -// ////////////////////////////////////////////////////////////////////// - - - - - -#ifndef JSON_FORWARD_AMALGATED_H_INCLUDED -# define JSON_FORWARD_AMALGATED_H_INCLUDED -/// If defined, indicates that the source file is amalgated -/// to prevent private header inclusion. -#define JSON_IS_AMALGAMATION - -// ////////////////////////////////////////////////////////////////////// -// Beginning of content of file: include/json/config.h -// ////////////////////////////////////////////////////////////////////// - -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef JSON_CONFIG_H_INCLUDED -#define JSON_CONFIG_H_INCLUDED - -/// If defined, indicates that json library is embedded in CppTL library. -//# define JSON_IN_CPPTL 1 - -/// If defined, indicates that json may leverage CppTL library -//# define JSON_USE_CPPTL 1 -/// If defined, indicates that cpptl vector based map should be used instead of -/// std::map -/// as Value container. -//# define JSON_USE_CPPTL_SMALLMAP 1 - -// If non-zero, the library uses exceptions to report bad input instead of C -// assertion macros. The default is to use exceptions. -#ifndef JSON_USE_EXCEPTION -#define JSON_USE_EXCEPTION 1 -#endif - -/// If defined, indicates that the source file is amalgated -/// to prevent private header inclusion. -/// Remarks: it is automatically defined in the generated amalgated header. -// #define JSON_IS_AMALGAMATION - -#ifdef JSON_IN_CPPTL -#include -#ifndef JSON_USE_CPPTL -#define JSON_USE_CPPTL 1 -#endif -#endif - -#ifdef JSON_IN_CPPTL -#define JSON_API CPPTL_API -#elif defined(JSON_DLL_BUILD) -#if defined(_MSC_VER) -#define JSON_API __declspec(dllexport) -#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING -#endif // if defined(_MSC_VER) -#elif defined(JSON_DLL) -#if defined(_MSC_VER) -#define JSON_API __declspec(dllimport) -#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING -#endif // if defined(_MSC_VER) -#endif // ifdef JSON_IN_CPPTL -#if !defined(JSON_API) -#define JSON_API -#endif - -// If JSON_NO_INT64 is defined, then Json only support C++ "int" type for -// integer -// Storages, and 64 bits integer support is disabled. -// #define JSON_NO_INT64 1 - -#if defined(_MSC_VER) && _MSC_VER <= 1200 // MSVC 6 -// Microsoft Visual Studio 6 only support conversion from __int64 to double -// (no conversion from unsigned __int64). -#define JSON_USE_INT64_DOUBLE_CONVERSION 1 -// Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255' -// characters in the debug information) -// All projects I've ever seen with VS6 were using this globally (not bothering -// with pragma push/pop). -#pragma warning(disable : 4786) -#endif // if defined(_MSC_VER) && _MSC_VER < 1200 // MSVC 6 - -#if defined(_MSC_VER) && _MSC_VER >= 1500 // MSVC 2008 -/// Indicates that the following function is deprecated. -#define JSONCPP_DEPRECATED(message) __declspec(deprecated(message)) -#elif defined(__clang__) && defined(__has_feature) -#if __has_feature(attribute_deprecated_with_message) -#define JSONCPP_DEPRECATED(message) __attribute__ ((deprecated(message))) -#endif -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)) -#define JSONCPP_DEPRECATED(message) __attribute__ ((deprecated(message))) -#elif defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) -#define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__)) -#endif - -#if !defined(JSONCPP_DEPRECATED) -#define JSONCPP_DEPRECATED(message) -#endif // if !defined(JSONCPP_DEPRECATED) - -namespace Json { -typedef int Int; -typedef unsigned int UInt; -#if defined(JSON_NO_INT64) -typedef int LargestInt; -typedef unsigned int LargestUInt; -#undef JSON_HAS_INT64 -#else // if defined(JSON_NO_INT64) -// For Microsoft Visual use specific types as long long is not supported -#if defined(_MSC_VER) // Microsoft Visual Studio -typedef __int64 Int64; -typedef unsigned __int64 UInt64; -#else // if defined(_MSC_VER) // Other platforms, use long long -typedef long long int Int64; -typedef unsigned long long int UInt64; -#endif // if defined(_MSC_VER) -typedef Int64 LargestInt; -typedef UInt64 LargestUInt; -#define JSON_HAS_INT64 -#endif // if defined(JSON_NO_INT64) -} // end namespace Json - -#endif // JSON_CONFIG_H_INCLUDED - -// ////////////////////////////////////////////////////////////////////// -// End of content of file: include/json/config.h -// ////////////////////////////////////////////////////////////////////// - - - - - - -// ////////////////////////////////////////////////////////////////////// -// Beginning of content of file: include/json/forwards.h -// ////////////////////////////////////////////////////////////////////// - -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef JSON_FORWARDS_H_INCLUDED -#define JSON_FORWARDS_H_INCLUDED - -#if !defined(JSON_IS_AMALGAMATION) -#include "config.h" -#endif // if !defined(JSON_IS_AMALGAMATION) - -namespace Json { - -// writer.h -class FastWriter; -class StyledWriter; - -// reader.h -class Reader; - -// features.h -class Features; - -// value.h -typedef unsigned int ArrayIndex; -class StaticString; -class Path; -class PathArgument; -class Value; -class ValueIteratorBase; -class ValueIterator; -class ValueConstIterator; - -} // namespace Json - -#endif // JSON_FORWARDS_H_INCLUDED - -// ////////////////////////////////////////////////////////////////////// -// End of content of file: include/json/forwards.h -// ////////////////////////////////////////////////////////////////////// - - - - - -#endif //ifndef JSON_FORWARD_AMALGATED_H_INCLUDED diff --git a/tools/buildHeaders/jsoncpp/dist/json/json.h b/tools/buildHeaders/jsoncpp/dist/json/json.h deleted file mode 100644 index e01991e0..00000000 --- a/tools/buildHeaders/jsoncpp/dist/json/json.h +++ /dev/null @@ -1,2017 +0,0 @@ -/// Json-cpp amalgated header (http://jsoncpp.sourceforge.net/). -/// It is intended to be used with #include "json/json.h" - -// ////////////////////////////////////////////////////////////////////// -// Beginning of content of file: LICENSE -// ////////////////////////////////////////////////////////////////////// - -/* -The JsonCpp library's source code, including accompanying documentation, -tests and demonstration applications, are licensed under the following -conditions... - -The author (Baptiste Lepilleur) explicitly disclaims copyright in all -jurisdictions which recognize such a disclaimer. In such jurisdictions, -this software is released into the Public Domain. - -In jurisdictions which do not recognize Public Domain property (e.g. Germany as of -2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is -released under the terms of the MIT License (see below). - -In jurisdictions which recognize Public Domain property, the user of this -software may choose to accept it either as 1) Public Domain, 2) under the -conditions of the MIT License (see below), or 3) under the terms of dual -Public Domain/MIT License conditions described here, as they choose. - -The MIT License is about as close to Public Domain as a license can get, and is -described in clear, concise terms at: - - http://en.wikipedia.org/wiki/MIT_License - -The full text of the MIT License follows: - -======================================================================== -Copyright (c) 2007-2010 Baptiste Lepilleur - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, copy, -modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -======================================================================== -(END LICENSE TEXT) - -The MIT license is compatible with both the GPL and commercial -software, affording one all of the rights of Public Domain with the -minor nuisance of being required to keep the above copyright notice -and license text in the source code. Note also that by accepting the -Public Domain "license" you can re-license your copy using whatever -license you like. - -*/ - -// ////////////////////////////////////////////////////////////////////// -// End of content of file: LICENSE -// ////////////////////////////////////////////////////////////////////// - - - - - -#ifndef JSON_AMALGATED_H_INCLUDED -# define JSON_AMALGATED_H_INCLUDED -/// If defined, indicates that the source file is amalgated -/// to prevent private header inclusion. -#define JSON_IS_AMALGAMATION - -// ////////////////////////////////////////////////////////////////////// -// Beginning of content of file: include/json/version.h -// ////////////////////////////////////////////////////////////////////// - -// DO NOT EDIT. This file is generated by CMake from "version" -// and "version.h.in" files. -// Run CMake configure step to update it. -#ifndef JSON_VERSION_H_INCLUDED -# define JSON_VERSION_H_INCLUDED - -# define JSONCPP_VERSION_STRING "1.6.2" -# define JSONCPP_VERSION_MAJOR 1 -# define JSONCPP_VERSION_MINOR 6 -# define JSONCPP_VERSION_PATCH 2 -# define JSONCPP_VERSION_QUALIFIER -# define JSONCPP_VERSION_HEXA ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | (JSONCPP_VERSION_PATCH << 8)) - -#endif // JSON_VERSION_H_INCLUDED - -// ////////////////////////////////////////////////////////////////////// -// End of content of file: include/json/version.h -// ////////////////////////////////////////////////////////////////////// - - - - - - -// ////////////////////////////////////////////////////////////////////// -// Beginning of content of file: include/json/config.h -// ////////////////////////////////////////////////////////////////////// - -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef JSON_CONFIG_H_INCLUDED -#define JSON_CONFIG_H_INCLUDED - -/// If defined, indicates that json library is embedded in CppTL library. -//# define JSON_IN_CPPTL 1 - -/// If defined, indicates that json may leverage CppTL library -//# define JSON_USE_CPPTL 1 -/// If defined, indicates that cpptl vector based map should be used instead of -/// std::map -/// as Value container. -//# define JSON_USE_CPPTL_SMALLMAP 1 - -// If non-zero, the library uses exceptions to report bad input instead of C -// assertion macros. The default is to use exceptions. -#ifndef JSON_USE_EXCEPTION -#define JSON_USE_EXCEPTION 1 -#endif - -/// If defined, indicates that the source file is amalgated -/// to prevent private header inclusion. -/// Remarks: it is automatically defined in the generated amalgated header. -// #define JSON_IS_AMALGAMATION - -#ifdef JSON_IN_CPPTL -#include -#ifndef JSON_USE_CPPTL -#define JSON_USE_CPPTL 1 -#endif -#endif - -#ifdef JSON_IN_CPPTL -#define JSON_API CPPTL_API -#elif defined(JSON_DLL_BUILD) -#if defined(_MSC_VER) -#define JSON_API __declspec(dllexport) -#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING -#endif // if defined(_MSC_VER) -#elif defined(JSON_DLL) -#if defined(_MSC_VER) -#define JSON_API __declspec(dllimport) -#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING -#endif // if defined(_MSC_VER) -#endif // ifdef JSON_IN_CPPTL -#if !defined(JSON_API) -#define JSON_API -#endif - -// If JSON_NO_INT64 is defined, then Json only support C++ "int" type for -// integer -// Storages, and 64 bits integer support is disabled. -// #define JSON_NO_INT64 1 - -#if defined(_MSC_VER) && _MSC_VER <= 1200 // MSVC 6 -// Microsoft Visual Studio 6 only support conversion from __int64 to double -// (no conversion from unsigned __int64). -#define JSON_USE_INT64_DOUBLE_CONVERSION 1 -// Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255' -// characters in the debug information) -// All projects I've ever seen with VS6 were using this globally (not bothering -// with pragma push/pop). -#pragma warning(disable : 4786) -#endif // if defined(_MSC_VER) && _MSC_VER < 1200 // MSVC 6 - -#if defined(_MSC_VER) && _MSC_VER >= 1500 // MSVC 2008 -/// Indicates that the following function is deprecated. -#define JSONCPP_DEPRECATED(message) __declspec(deprecated(message)) -#elif defined(__clang__) && defined(__has_feature) -#if __has_feature(attribute_deprecated_with_message) -#define JSONCPP_DEPRECATED(message) __attribute__ ((deprecated(message))) -#endif -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)) -#define JSONCPP_DEPRECATED(message) __attribute__ ((deprecated(message))) -#elif defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) -#define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__)) -#endif - -#if !defined(JSONCPP_DEPRECATED) -#define JSONCPP_DEPRECATED(message) -#endif // if !defined(JSONCPP_DEPRECATED) - -namespace Json { -typedef int Int; -typedef unsigned int UInt; -#if defined(JSON_NO_INT64) -typedef int LargestInt; -typedef unsigned int LargestUInt; -#undef JSON_HAS_INT64 -#else // if defined(JSON_NO_INT64) -// For Microsoft Visual use specific types as long long is not supported -#if defined(_MSC_VER) // Microsoft Visual Studio -typedef __int64 Int64; -typedef unsigned __int64 UInt64; -#else // if defined(_MSC_VER) // Other platforms, use long long -typedef long long int Int64; -typedef unsigned long long int UInt64; -#endif // if defined(_MSC_VER) -typedef Int64 LargestInt; -typedef UInt64 LargestUInt; -#define JSON_HAS_INT64 -#endif // if defined(JSON_NO_INT64) -} // end namespace Json - -#endif // JSON_CONFIG_H_INCLUDED - -// ////////////////////////////////////////////////////////////////////// -// End of content of file: include/json/config.h -// ////////////////////////////////////////////////////////////////////// - - - - - - -// ////////////////////////////////////////////////////////////////////// -// Beginning of content of file: include/json/forwards.h -// ////////////////////////////////////////////////////////////////////// - -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef JSON_FORWARDS_H_INCLUDED -#define JSON_FORWARDS_H_INCLUDED - -#if !defined(JSON_IS_AMALGAMATION) -#include "config.h" -#endif // if !defined(JSON_IS_AMALGAMATION) - -namespace Json { - -// writer.h -class FastWriter; -class StyledWriter; - -// reader.h -class Reader; - -// features.h -class Features; - -// value.h -typedef unsigned int ArrayIndex; -class StaticString; -class Path; -class PathArgument; -class Value; -class ValueIteratorBase; -class ValueIterator; -class ValueConstIterator; - -} // namespace Json - -#endif // JSON_FORWARDS_H_INCLUDED - -// ////////////////////////////////////////////////////////////////////// -// End of content of file: include/json/forwards.h -// ////////////////////////////////////////////////////////////////////// - - - - - - -// ////////////////////////////////////////////////////////////////////// -// Beginning of content of file: include/json/features.h -// ////////////////////////////////////////////////////////////////////// - -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef CPPTL_JSON_FEATURES_H_INCLUDED -#define CPPTL_JSON_FEATURES_H_INCLUDED - -#if !defined(JSON_IS_AMALGAMATION) -#include "forwards.h" -#endif // if !defined(JSON_IS_AMALGAMATION) - -namespace Json { - -/** \brief Configuration passed to reader and writer. - * This configuration object can be used to force the Reader or Writer - * to behave in a standard conforming way. - */ -class JSON_API Features { -public: - /** \brief A configuration that allows all features and assumes all strings - * are UTF-8. - * - C & C++ comments are allowed - * - Root object can be any JSON value - * - Assumes Value strings are encoded in UTF-8 - */ - static Features all(); - - /** \brief A configuration that is strictly compatible with the JSON - * specification. - * - Comments are forbidden. - * - Root object must be either an array or an object value. - * - Assumes Value strings are encoded in UTF-8 - */ - static Features strictMode(); - - /** \brief Initialize the configuration like JsonConfig::allFeatures; - */ - Features(); - - /// \c true if comments are allowed. Default: \c true. - bool allowComments_; - - /// \c true if root must be either an array or an object value. Default: \c - /// false. - bool strictRoot_; - - /// \c true if dropped null placeholders are allowed. Default: \c false. - bool allowDroppedNullPlaceholders_; - - /// \c true if numeric object key are allowed. Default: \c false. - bool allowNumericKeys_; -}; - -} // namespace Json - -#endif // CPPTL_JSON_FEATURES_H_INCLUDED - -// ////////////////////////////////////////////////////////////////////// -// End of content of file: include/json/features.h -// ////////////////////////////////////////////////////////////////////// - - - - - - -// ////////////////////////////////////////////////////////////////////// -// Beginning of content of file: include/json/value.h -// ////////////////////////////////////////////////////////////////////// - -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef CPPTL_JSON_H_INCLUDED -#define CPPTL_JSON_H_INCLUDED - -#if !defined(JSON_IS_AMALGAMATION) -#include "forwards.h" -#endif // if !defined(JSON_IS_AMALGAMATION) -#include -#include -#include - -#ifndef JSON_USE_CPPTL_SMALLMAP -#include -#else -#include -#endif -#ifdef JSON_USE_CPPTL -#include -#endif - -// Disable warning C4251: : needs to have dll-interface to -// be used by... -#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) -#pragma warning(push) -#pragma warning(disable : 4251) -#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) - -/** \brief JSON (JavaScript Object Notation). - */ -namespace Json { - -/** Base class for all exceptions we throw. - * - * We use nothing but these internally. Of course, STL can throw others. - */ -class JSON_API Exception; -/** Exceptions which the user cannot easily avoid. - * - * E.g. out-of-memory (when we use malloc), stack-overflow, malicious input - * - * \remark derived from Json::Exception - */ -class JSON_API RuntimeError; -/** Exceptions thrown by JSON_ASSERT/JSON_FAIL macros. - * - * These are precondition-violations (user bugs) and internal errors (our bugs). - * - * \remark derived from Json::Exception - */ -class JSON_API LogicError; - -/// used internally -void throwRuntimeError(std::string const& msg); -/// used internally -void throwLogicError(std::string const& msg); - -/** \brief Type of the value held by a Value object. - */ -enum ValueType { - nullValue = 0, ///< 'null' value - intValue, ///< signed integer value - uintValue, ///< unsigned integer value - realValue, ///< double value - stringValue, ///< UTF-8 string value - booleanValue, ///< bool value - arrayValue, ///< array value (ordered list) - objectValue ///< object value (collection of name/value pairs). -}; - -enum CommentPlacement { - commentBefore = 0, ///< a comment placed on the line before a value - commentAfterOnSameLine, ///< a comment just after a value on the same line - commentAfter, ///< a comment on the line after a value (only make sense for - /// root value) - numberOfCommentPlacement -}; - -//# ifdef JSON_USE_CPPTL -// typedef CppTL::AnyEnumerator EnumMemberNames; -// typedef CppTL::AnyEnumerator EnumValues; -//# endif - -/** \brief Lightweight wrapper to tag static string. - * - * Value constructor and objectValue member assignement takes advantage of the - * StaticString and avoid the cost of string duplication when storing the - * string or the member name. - * - * Example of usage: - * \code - * Json::Value aValue( StaticString("some text") ); - * Json::Value object; - * static const StaticString code("code"); - * object[code] = 1234; - * \endcode - */ -class JSON_API StaticString { -public: - explicit StaticString(const char* czstring) : c_str_(czstring) {} - - operator const char*() const { return c_str_; } - - const char* c_str() const { return c_str_; } - -private: - const char* c_str_; -}; - -/** \brief Represents a JSON value. - * - * This class is a discriminated union wrapper that can represents a: - * - signed integer [range: Value::minInt - Value::maxInt] - * - unsigned integer (range: 0 - Value::maxUInt) - * - double - * - UTF-8 string - * - boolean - * - 'null' - * - an ordered list of Value - * - collection of name/value pairs (javascript object) - * - * The type of the held value is represented by a #ValueType and - * can be obtained using type(). - * - * Values of an #objectValue or #arrayValue can be accessed using operator[]() - * methods. - * Non-const methods will automatically create the a #nullValue element - * if it does not exist. - * The sequence of an #arrayValue will be automatically resized and initialized - * with #nullValue. resize() can be used to enlarge or truncate an #arrayValue. - * - * The get() methods can be used to obtain default value in the case the - * required element does not exist. - * - * It is possible to iterate over the list of a #objectValue values using - * the getMemberNames() method. - * - * \note #Value string-length fit in size_t, but keys must be < 2^30. - * (The reason is an implementation detail.) A #CharReader will raise an - * exception if a bound is exceeded to avoid security holes in your app, - * but the Value API does *not* check bounds. That is the responsibility - * of the caller. - */ -class JSON_API Value { - friend class ValueIteratorBase; -public: - typedef std::vector Members; - typedef ValueIterator iterator; - typedef ValueConstIterator const_iterator; - typedef Json::UInt UInt; - typedef Json::Int Int; -#if defined(JSON_HAS_INT64) - typedef Json::UInt64 UInt64; - typedef Json::Int64 Int64; -#endif // defined(JSON_HAS_INT64) - typedef Json::LargestInt LargestInt; - typedef Json::LargestUInt LargestUInt; - typedef Json::ArrayIndex ArrayIndex; - - static const Value& null; ///< We regret this reference to a global instance; prefer the simpler Value(). - static const Value& nullRef; ///< just a kludge for binary-compatibility; same as null - /// Minimum signed integer value that can be stored in a Json::Value. - static const LargestInt minLargestInt; - /// Maximum signed integer value that can be stored in a Json::Value. - static const LargestInt maxLargestInt; - /// Maximum unsigned integer value that can be stored in a Json::Value. - static const LargestUInt maxLargestUInt; - - /// Minimum signed int value that can be stored in a Json::Value. - static const Int minInt; - /// Maximum signed int value that can be stored in a Json::Value. - static const Int maxInt; - /// Maximum unsigned int value that can be stored in a Json::Value. - static const UInt maxUInt; - -#if defined(JSON_HAS_INT64) - /// Minimum signed 64 bits int value that can be stored in a Json::Value. - static const Int64 minInt64; - /// Maximum signed 64 bits int value that can be stored in a Json::Value. - static const Int64 maxInt64; - /// Maximum unsigned 64 bits int value that can be stored in a Json::Value. - static const UInt64 maxUInt64; -#endif // defined(JSON_HAS_INT64) - -private: -#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION - class CZString { - public: - enum DuplicationPolicy { - noDuplication = 0, - duplicate, - duplicateOnCopy - }; - CZString(ArrayIndex index); - CZString(char const* str, unsigned length, DuplicationPolicy allocate); - CZString(CZString const& other); - ~CZString(); - CZString& operator=(CZString other); - bool operator<(CZString const& other) const; - bool operator==(CZString const& other) const; - ArrayIndex index() const; - //const char* c_str() const; ///< \deprecated - char const* data() const; - unsigned length() const; - bool isStaticString() const; - - private: - void swap(CZString& other); - - struct StringStorage { - unsigned policy_: 2; - unsigned length_: 30; // 1GB max - }; - - char const* cstr_; // actually, a prefixed string, unless policy is noDup - union { - ArrayIndex index_; - StringStorage storage_; - }; - }; - -public: -#ifndef JSON_USE_CPPTL_SMALLMAP - typedef std::map ObjectValues; -#else - typedef CppTL::SmallMap ObjectValues; -#endif // ifndef JSON_USE_CPPTL_SMALLMAP -#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION - -public: - /** \brief Create a default Value of the given type. - - This is a very useful constructor. - To create an empty array, pass arrayValue. - To create an empty object, pass objectValue. - Another Value can then be set to this one by assignment. -This is useful since clear() and resize() will not alter types. - - Examples: -\code -Json::Value null_value; // null -Json::Value arr_value(Json::arrayValue); // [] -Json::Value obj_value(Json::objectValue); // {} -\endcode - */ - Value(ValueType type = nullValue); - Value(Int value); - Value(UInt value); -#if defined(JSON_HAS_INT64) - Value(Int64 value); - Value(UInt64 value); -#endif // if defined(JSON_HAS_INT64) - Value(double value); - Value(const char* value); ///< Copy til first 0. (NULL causes to seg-fault.) - Value(const char* beginValue, const char* endValue); ///< Copy all, incl zeroes. - /** \brief Constructs a value from a static string. - - * Like other value string constructor but do not duplicate the string for - * internal storage. The given string must remain alive after the call to this - * constructor. - * \note This works only for null-terminated strings. (We cannot change the - * size of this class, so we have nowhere to store the length, - * which might be computed later for various operations.) - * - * Example of usage: - * \code - * static StaticString foo("some text"); - * Json::Value aValue(foo); - * \endcode - */ - Value(const StaticString& value); - Value(const std::string& value); ///< Copy data() til size(). Embedded zeroes too. -#ifdef JSON_USE_CPPTL - Value(const CppTL::ConstString& value); -#endif - Value(bool value); - /// Deep copy. - Value(const Value& other); - ~Value(); - - /// Deep copy, then swap(other). - /// \note Over-write existing comments. To preserve comments, use #swapPayload(). - Value& operator=(Value other); - /// Swap everything. - void swap(Value& other); - /// Swap values but leave comments and source offsets in place. - void swapPayload(Value& other); - - ValueType type() const; - - /// Compare payload only, not comments etc. - bool operator<(const Value& other) const; - bool operator<=(const Value& other) const; - bool operator>=(const Value& other) const; - bool operator>(const Value& other) const; - bool operator==(const Value& other) const; - bool operator!=(const Value& other) const; - int compare(const Value& other) const; - - const char* asCString() const; ///< Embedded zeroes could cause you trouble! - std::string asString() const; ///< Embedded zeroes are possible. - /** Get raw char* of string-value. - * \return false if !string. (Seg-fault if str or end are NULL.) - */ - bool getString( - char const** str, char const** end) const; -#ifdef JSON_USE_CPPTL - CppTL::ConstString asConstString() const; -#endif - Int asInt() const; - UInt asUInt() const; -#if defined(JSON_HAS_INT64) - Int64 asInt64() const; - UInt64 asUInt64() const; -#endif // if defined(JSON_HAS_INT64) - LargestInt asLargestInt() const; - LargestUInt asLargestUInt() const; - float asFloat() const; - double asDouble() const; - bool asBool() const; - - bool isNull() const; - bool isBool() const; - bool isInt() const; - bool isInt64() const; - bool isUInt() const; - bool isUInt64() const; - bool isIntegral() const; - bool isDouble() const; - bool isNumeric() const; - bool isString() const; - bool isArray() const; - bool isObject() const; - - bool isConvertibleTo(ValueType other) const; - - /// Number of values in array or object - ArrayIndex size() const; - - /// \brief Return true if empty array, empty object, or null; - /// otherwise, false. - bool empty() const; - - /// Return isNull() - bool operator!() const; - - /// Remove all object members and array elements. - /// \pre type() is arrayValue, objectValue, or nullValue - /// \post type() is unchanged - void clear(); - - /// Resize the array to size elements. - /// New elements are initialized to null. - /// May only be called on nullValue or arrayValue. - /// \pre type() is arrayValue or nullValue - /// \post type() is arrayValue - void resize(ArrayIndex size); - - /// Access an array element (zero based index ). - /// If the array contains less than index element, then null value are - /// inserted - /// in the array so that its size is index+1. - /// (You may need to say 'value[0u]' to get your compiler to distinguish - /// this from the operator[] which takes a string.) - Value& operator[](ArrayIndex index); - - /// Access an array element (zero based index ). - /// If the array contains less than index element, then null value are - /// inserted - /// in the array so that its size is index+1. - /// (You may need to say 'value[0u]' to get your compiler to distinguish - /// this from the operator[] which takes a string.) - Value& operator[](int index); - - /// Access an array element (zero based index ) - /// (You may need to say 'value[0u]' to get your compiler to distinguish - /// this from the operator[] which takes a string.) - const Value& operator[](ArrayIndex index) const; - - /// Access an array element (zero based index ) - /// (You may need to say 'value[0u]' to get your compiler to distinguish - /// this from the operator[] which takes a string.) - const Value& operator[](int index) const; - - /// If the array contains at least index+1 elements, returns the element - /// value, - /// otherwise returns defaultValue. - Value get(ArrayIndex index, const Value& defaultValue) const; - /// Return true if index < size(). - bool isValidIndex(ArrayIndex index) const; - /// \brief Append value to array at the end. - /// - /// Equivalent to jsonvalue[jsonvalue.size()] = value; - Value& append(const Value& value); - - /// Access an object value by name, create a null member if it does not exist. - /// \note Because of our implementation, keys are limited to 2^30 -1 chars. - /// Exceeding that will cause an exception. - Value& operator[](const char* key); - /// Access an object value by name, returns null if there is no member with - /// that name. - const Value& operator[](const char* key) const; - /// Access an object value by name, create a null member if it does not exist. - /// \param key may contain embedded nulls. - Value& operator[](const std::string& key); - /// Access an object value by name, returns null if there is no member with - /// that name. - /// \param key may contain embedded nulls. - const Value& operator[](const std::string& key) const; - /** \brief Access an object value by name, create a null member if it does not - exist. - - * If the object has no entry for that name, then the member name used to store - * the new entry is not duplicated. - * Example of use: - * \code - * Json::Value object; - * static const StaticString code("code"); - * object[code] = 1234; - * \endcode - */ - Value& operator[](const StaticString& key); -#ifdef JSON_USE_CPPTL - /// Access an object value by name, create a null member if it does not exist. - Value& operator[](const CppTL::ConstString& key); - /// Access an object value by name, returns null if there is no member with - /// that name. - const Value& operator[](const CppTL::ConstString& key) const; -#endif - /// Return the member named key if it exist, defaultValue otherwise. - /// \note deep copy - Value get(const char* key, const Value& defaultValue) const; - /// Return the member named key if it exist, defaultValue otherwise. - /// \note deep copy - /// \param key may contain embedded nulls. - Value get(const char* key, const char* end, const Value& defaultValue) const; - /// Return the member named key if it exist, defaultValue otherwise. - /// \note deep copy - /// \param key may contain embedded nulls. - Value get(const std::string& key, const Value& defaultValue) const; -#ifdef JSON_USE_CPPTL - /// Return the member named key if it exist, defaultValue otherwise. - /// \note deep copy - Value get(const CppTL::ConstString& key, const Value& defaultValue) const; -#endif - /// Most general and efficient version of isMember()const, get()const, - /// and operator[]const - /// \note As stated elsewhere, behavior is undefined if (end-key) >= 2^30 - Value const* find(char const* key, char const* end) const; - /// Most general and efficient version of object-mutators. - /// \note As stated elsewhere, behavior is undefined if (end-key) >= 2^30 - /// \return non-zero, but JSON_ASSERT if this is neither object nor nullValue. - Value const* demand(char const* key, char const* end); - /// \brief Remove and return the named member. - /// - /// Do nothing if it did not exist. - /// \return the removed Value, or null. - /// \pre type() is objectValue or nullValue - /// \post type() is unchanged - /// \deprecated - Value removeMember(const char* key); - /// Same as removeMember(const char*) - /// \param key may contain embedded nulls. - /// \deprecated - Value removeMember(const std::string& key); - /// Same as removeMember(const char* key, const char* end, Value* removed), - /// but 'key' is null-terminated. - bool removeMember(const char* key, Value* removed); - /** \brief Remove the named map member. - - Update 'removed' iff removed. - \param key may contain embedded nulls. - \return true iff removed (no exceptions) - */ - bool removeMember(std::string const& key, Value* removed); - /// Same as removeMember(std::string const& key, Value* removed) - bool removeMember(const char* key, const char* end, Value* removed); - /** \brief Remove the indexed array element. - - O(n) expensive operations. - Update 'removed' iff removed. - \return true iff removed (no exceptions) - */ - bool removeIndex(ArrayIndex i, Value* removed); - - /// Return true if the object has a member named key. - /// \note 'key' must be null-terminated. - bool isMember(const char* key) const; - /// Return true if the object has a member named key. - /// \param key may contain embedded nulls. - bool isMember(const std::string& key) const; - /// Same as isMember(std::string const& key)const - bool isMember(const char* key, const char* end) const; -#ifdef JSON_USE_CPPTL - /// Return true if the object has a member named key. - bool isMember(const CppTL::ConstString& key) const; -#endif - - /// \brief Return a list of the member names. - /// - /// If null, return an empty list. - /// \pre type() is objectValue or nullValue - /// \post if type() was nullValue, it remains nullValue - Members getMemberNames() const; - - //# ifdef JSON_USE_CPPTL - // EnumMemberNames enumMemberNames() const; - // EnumValues enumValues() const; - //# endif - - /// \deprecated Always pass len. - JSONCPP_DEPRECATED("Use setComment(std::string const&) instead.") - void setComment(const char* comment, CommentPlacement placement); - /// Comments must be //... or /* ... */ - void setComment(const char* comment, size_t len, CommentPlacement placement); - /// Comments must be //... or /* ... */ - void setComment(const std::string& comment, CommentPlacement placement); - bool hasComment(CommentPlacement placement) const; - /// Include delimiters and embedded newlines. - std::string getComment(CommentPlacement placement) const; - - std::string toStyledString() const; - - const_iterator begin() const; - const_iterator end() const; - - iterator begin(); - iterator end(); - - // Accessors for the [start, limit) range of bytes within the JSON text from - // which this value was parsed, if any. - void setOffsetStart(size_t start); - void setOffsetLimit(size_t limit); - size_t getOffsetStart() const; - size_t getOffsetLimit() const; - -private: - void initBasic(ValueType type, bool allocated = false); - - Value& resolveReference(const char* key); - Value& resolveReference(const char* key, const char* end); - - struct CommentInfo { - CommentInfo(); - ~CommentInfo(); - - void setComment(const char* text, size_t len); - - char* comment_; - }; - - // struct MemberNamesTransform - //{ - // typedef const char *result_type; - // const char *operator()( const CZString &name ) const - // { - // return name.c_str(); - // } - //}; - - union ValueHolder { - LargestInt int_; - LargestUInt uint_; - double real_; - bool bool_; - char* string_; // actually ptr to unsigned, followed by str, unless !allocated_ - ObjectValues* map_; - } value_; - ValueType type_ : 8; - unsigned int allocated_ : 1; // Notes: if declared as bool, bitfield is useless. - // If not allocated_, string_ must be null-terminated. - CommentInfo* comments_; - - // [start, limit) byte offsets in the source JSON text from which this Value - // was extracted. - size_t start_; - size_t limit_; -}; - -/** \brief Experimental and untested: represents an element of the "path" to - * access a node. - */ -class JSON_API PathArgument { -public: - friend class Path; - - PathArgument(); - PathArgument(ArrayIndex index); - PathArgument(const char* key); - PathArgument(const std::string& key); - -private: - enum Kind { - kindNone = 0, - kindIndex, - kindKey - }; - std::string key_; - ArrayIndex index_; - Kind kind_; -}; - -/** \brief Experimental and untested: represents a "path" to access a node. - * - * Syntax: - * - "." => root node - * - ".[n]" => elements at index 'n' of root node (an array value) - * - ".name" => member named 'name' of root node (an object value) - * - ".name1.name2.name3" - * - ".[0][1][2].name1[3]" - * - ".%" => member name is provided as parameter - * - ".[%]" => index is provied as parameter - */ -class JSON_API Path { -public: - Path(const std::string& path, - const PathArgument& a1 = PathArgument(), - const PathArgument& a2 = PathArgument(), - const PathArgument& a3 = PathArgument(), - const PathArgument& a4 = PathArgument(), - const PathArgument& a5 = PathArgument()); - - const Value& resolve(const Value& root) const; - Value resolve(const Value& root, const Value& defaultValue) const; - /// Creates the "path" to access the specified node and returns a reference on - /// the node. - Value& make(Value& root) const; - -private: - typedef std::vector InArgs; - typedef std::vector Args; - - void makePath(const std::string& path, const InArgs& in); - void addPathInArg(const std::string& path, - const InArgs& in, - InArgs::const_iterator& itInArg, - PathArgument::Kind kind); - void invalidPath(const std::string& path, int location); - - Args args_; -}; - -/** \brief base class for Value iterators. - * - */ -class JSON_API ValueIteratorBase { -public: - typedef std::bidirectional_iterator_tag iterator_category; - typedef unsigned int size_t; - typedef int difference_type; - typedef ValueIteratorBase SelfType; - - bool operator==(const SelfType& other) const { return isEqual(other); } - - bool operator!=(const SelfType& other) const { return !isEqual(other); } - - difference_type operator-(const SelfType& other) const { - return other.computeDistance(*this); - } - - /// Return either the index or the member name of the referenced value as a - /// Value. - Value key() const; - - /// Return the index of the referenced Value, or -1 if it is not an arrayValue. - UInt index() const; - - /// Return the member name of the referenced Value, or "" if it is not an - /// objectValue. - /// \note Avoid `c_str()` on result, as embedded zeroes are possible. - std::string name() const; - - /// Return the member name of the referenced Value. "" if it is not an - /// objectValue. - /// \deprecated This cannot be used for UTF-8 strings, since there can be embedded nulls. - JSONCPP_DEPRECATED("Use `key = name();` instead.") - char const* memberName() const; - /// Return the member name of the referenced Value, or NULL if it is not an - /// objectValue. - /// \note Better version than memberName(). Allows embedded nulls. - char const* memberName(char const** end) const; - -protected: - Value& deref() const; - - void increment(); - - void decrement(); - - difference_type computeDistance(const SelfType& other) const; - - bool isEqual(const SelfType& other) const; - - void copy(const SelfType& other); - -private: - Value::ObjectValues::iterator current_; - // Indicates that iterator is for a null value. - bool isNull_; - -public: - // For some reason, BORLAND needs these at the end, rather - // than earlier. No idea why. - ValueIteratorBase(); - explicit ValueIteratorBase(const Value::ObjectValues::iterator& current); -}; - -/** \brief const iterator for object and array value. - * - */ -class JSON_API ValueConstIterator : public ValueIteratorBase { - friend class Value; - -public: - typedef const Value value_type; - //typedef unsigned int size_t; - //typedef int difference_type; - typedef const Value& reference; - typedef const Value* pointer; - typedef ValueConstIterator SelfType; - - ValueConstIterator(); - -private: -/*! \internal Use by Value to create an iterator. - */ - explicit ValueConstIterator(const Value::ObjectValues::iterator& current); -public: - SelfType& operator=(const ValueIteratorBase& other); - - SelfType operator++(int) { - SelfType temp(*this); - ++*this; - return temp; - } - - SelfType operator--(int) { - SelfType temp(*this); - --*this; - return temp; - } - - SelfType& operator--() { - decrement(); - return *this; - } - - SelfType& operator++() { - increment(); - return *this; - } - - reference operator*() const { return deref(); } - - pointer operator->() const { return &deref(); } -}; - -/** \brief Iterator for object and array value. - */ -class JSON_API ValueIterator : public ValueIteratorBase { - friend class Value; - -public: - typedef Value value_type; - typedef unsigned int size_t; - typedef int difference_type; - typedef Value& reference; - typedef Value* pointer; - typedef ValueIterator SelfType; - - ValueIterator(); - ValueIterator(const ValueConstIterator& other); - ValueIterator(const ValueIterator& other); - -private: -/*! \internal Use by Value to create an iterator. - */ - explicit ValueIterator(const Value::ObjectValues::iterator& current); -public: - SelfType& operator=(const SelfType& other); - - SelfType operator++(int) { - SelfType temp(*this); - ++*this; - return temp; - } - - SelfType operator--(int) { - SelfType temp(*this); - --*this; - return temp; - } - - SelfType& operator--() { - decrement(); - return *this; - } - - SelfType& operator++() { - increment(); - return *this; - } - - reference operator*() const { return deref(); } - - pointer operator->() const { return &deref(); } -}; - -} // namespace Json - - -namespace std { -/// Specialize std::swap() for Json::Value. -template<> -inline void swap(Json::Value& a, Json::Value& b) { a.swap(b); } -} - - -#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) -#pragma warning(pop) -#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) - -#endif // CPPTL_JSON_H_INCLUDED - -// ////////////////////////////////////////////////////////////////////// -// End of content of file: include/json/value.h -// ////////////////////////////////////////////////////////////////////// - - - - - - -// ////////////////////////////////////////////////////////////////////// -// Beginning of content of file: include/json/reader.h -// ////////////////////////////////////////////////////////////////////// - -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef CPPTL_JSON_READER_H_INCLUDED -#define CPPTL_JSON_READER_H_INCLUDED - -#if !defined(JSON_IS_AMALGAMATION) -#include "features.h" -#include "value.h" -#endif // if !defined(JSON_IS_AMALGAMATION) -#include -#include -#include -#include -#include - -// Disable warning C4251: : needs to have dll-interface to -// be used by... -#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) -#pragma warning(push) -#pragma warning(disable : 4251) -#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) - -namespace Json { - -/** \brief Unserialize a JSON document into a - *Value. - * - * \deprecated Use CharReader and CharReaderBuilder. - */ -class JSON_API Reader { -public: - typedef char Char; - typedef const Char* Location; - - /** \brief An error tagged with where in the JSON text it was encountered. - * - * The offsets give the [start, limit) range of bytes within the text. Note - * that this is bytes, not codepoints. - * - */ - struct StructuredError { - size_t offset_start; - size_t offset_limit; - std::string message; - }; - - /** \brief Constructs a Reader allowing all features - * for parsing. - */ - Reader(); - - /** \brief Constructs a Reader allowing the specified feature set - * for parsing. - */ - Reader(const Features& features); - - /** \brief Read a Value from a JSON - * document. - * \param document UTF-8 encoded string containing the document to read. - * \param root [out] Contains the root value of the document if it was - * successfully parsed. - * \param collectComments \c true to collect comment and allow writing them - * back during - * serialization, \c false to discard comments. - * This parameter is ignored if - * Features::allowComments_ - * is \c false. - * \return \c true if the document was successfully parsed, \c false if an - * error occurred. - */ - bool - parse(const std::string& document, Value& root, bool collectComments = true); - - /** \brief Read a Value from a JSON - document. - * \param beginDoc Pointer on the beginning of the UTF-8 encoded string of the - document to read. - * \param endDoc Pointer on the end of the UTF-8 encoded string of the - document to read. - * Must be >= beginDoc. - * \param root [out] Contains the root value of the document if it was - * successfully parsed. - * \param collectComments \c true to collect comment and allow writing them - back during - * serialization, \c false to discard comments. - * This parameter is ignored if - Features::allowComments_ - * is \c false. - * \return \c true if the document was successfully parsed, \c false if an - error occurred. - */ - bool parse(const char* beginDoc, - const char* endDoc, - Value& root, - bool collectComments = true); - - /// \brief Parse from input stream. - /// \see Json::operator>>(std::istream&, Json::Value&). - bool parse(std::istream& is, Value& root, bool collectComments = true); - - /** \brief Returns a user friendly string that list errors in the parsed - * document. - * \return Formatted error message with the list of errors with their location - * in - * the parsed document. An empty string is returned if no error - * occurred - * during parsing. - * \deprecated Use getFormattedErrorMessages() instead (typo fix). - */ - JSONCPP_DEPRECATED("Use getFormattedErrorMessages() instead.") - std::string getFormatedErrorMessages() const; - - /** \brief Returns a user friendly string that list errors in the parsed - * document. - * \return Formatted error message with the list of errors with their location - * in - * the parsed document. An empty string is returned if no error - * occurred - * during parsing. - */ - std::string getFormattedErrorMessages() const; - - /** \brief Returns a vector of structured erros encounted while parsing. - * \return A (possibly empty) vector of StructuredError objects. Currently - * only one error can be returned, but the caller should tolerate - * multiple - * errors. This can occur if the parser recovers from a non-fatal - * parse error and then encounters additional errors. - */ - std::vector getStructuredErrors() const; - - /** \brief Add a semantic error message. - * \param value JSON Value location associated with the error - * \param message The error message. - * \return \c true if the error was successfully added, \c false if the - * Value offset exceeds the document size. - */ - bool pushError(const Value& value, const std::string& message); - - /** \brief Add a semantic error message with extra context. - * \param value JSON Value location associated with the error - * \param message The error message. - * \param extra Additional JSON Value location to contextualize the error - * \return \c true if the error was successfully added, \c false if either - * Value offset exceeds the document size. - */ - bool pushError(const Value& value, const std::string& message, const Value& extra); - - /** \brief Return whether there are any errors. - * \return \c true if there are no errors to report \c false if - * errors have occurred. - */ - bool good() const; - -private: - enum TokenType { - tokenEndOfStream = 0, - tokenObjectBegin, - tokenObjectEnd, - tokenArrayBegin, - tokenArrayEnd, - tokenString, - tokenNumber, - tokenTrue, - tokenFalse, - tokenNull, - tokenArraySeparator, - tokenMemberSeparator, - tokenComment, - tokenError - }; - - class Token { - public: - TokenType type_; - Location start_; - Location end_; - }; - - class ErrorInfo { - public: - Token token_; - std::string message_; - Location extra_; - }; - - typedef std::deque Errors; - - bool readToken(Token& token); - void skipSpaces(); - bool match(Location pattern, int patternLength); - bool readComment(); - bool readCStyleComment(); - bool readCppStyleComment(); - bool readString(); - void readNumber(); - bool readValue(); - bool readObject(Token& token); - bool readArray(Token& token); - bool decodeNumber(Token& token); - bool decodeNumber(Token& token, Value& decoded); - bool decodeString(Token& token); - bool decodeString(Token& token, std::string& decoded); - bool decodeDouble(Token& token); - bool decodeDouble(Token& token, Value& decoded); - bool decodeUnicodeCodePoint(Token& token, - Location& current, - Location end, - unsigned int& unicode); - bool decodeUnicodeEscapeSequence(Token& token, - Location& current, - Location end, - unsigned int& unicode); - bool addError(const std::string& message, Token& token, Location extra = 0); - bool recoverFromError(TokenType skipUntilToken); - bool addErrorAndRecover(const std::string& message, - Token& token, - TokenType skipUntilToken); - void skipUntilSpace(); - Value& currentValue(); - Char getNextChar(); - void - getLocationLineAndColumn(Location location, int& line, int& column) const; - std::string getLocationLineAndColumn(Location location) const; - void addComment(Location begin, Location end, CommentPlacement placement); - void skipCommentTokens(Token& token); - - typedef std::stack Nodes; - Nodes nodes_; - Errors errors_; - std::string document_; - Location begin_; - Location end_; - Location current_; - Location lastValueEnd_; - Value* lastValue_; - std::string commentsBefore_; - Features features_; - bool collectComments_; -}; // Reader - -/** Interface for reading JSON from a char array. - */ -class JSON_API CharReader { -public: - virtual ~CharReader() {} - /** \brief Read a Value from a JSON - document. - * The document must be a UTF-8 encoded string containing the document to read. - * - * \param beginDoc Pointer on the beginning of the UTF-8 encoded string of the - document to read. - * \param endDoc Pointer on the end of the UTF-8 encoded string of the - document to read. - * Must be >= beginDoc. - * \param root [out] Contains the root value of the document if it was - * successfully parsed. - * \param errs [out] Formatted error messages (if not NULL) - * a user friendly string that lists errors in the parsed - * document. - * \return \c true if the document was successfully parsed, \c false if an - error occurred. - */ - virtual bool parse( - char const* beginDoc, char const* endDoc, - Value* root, std::string* errs) = 0; - - class Factory { - public: - virtual ~Factory() {} - /** \brief Allocate a CharReader via operator new(). - * \throw std::exception if something goes wrong (e.g. invalid settings) - */ - virtual CharReader* newCharReader() const = 0; - }; // Factory -}; // CharReader - -/** \brief Build a CharReader implementation. - -Usage: -\code - using namespace Json; - CharReaderBuilder builder; - builder["collectComments"] = false; - Value value; - std::string errs; - bool ok = parseFromStream(builder, std::cin, &value, &errs); -\endcode -*/ -class JSON_API CharReaderBuilder : public CharReader::Factory { -public: - // Note: We use a Json::Value so that we can add data-members to this class - // without a major version bump. - /** Configuration of this builder. - These are case-sensitive. - Available settings (case-sensitive): - - `"collectComments": false or true` - - true to collect comment and allow writing them - back during serialization, false to discard comments. - This parameter is ignored if allowComments is false. - - `"allowComments": false or true` - - true if comments are allowed. - - `"strictRoot": false or true` - - true if root must be either an array or an object value - - `"allowDroppedNullPlaceholders": false or true` - - true if dropped null placeholders are allowed. (See StreamWriterBuilder.) - - `"allowNumericKeys": false or true` - - true if numeric object keys are allowed. - - `"allowSingleQuotes": false or true` - - true if '' are allowed for strings (both keys and values) - - `"stackLimit": integer` - - Exceeding stackLimit (recursive depth of `readValue()`) will - cause an exception. - - This is a security issue (seg-faults caused by deeply nested JSON), - so the default is low. - - `"failIfExtra": false or true` - - If true, `parse()` returns false when extra non-whitespace trails - the JSON value in the input string. - - `"rejectDupKeys": false or true` - - If true, `parse()` returns false when a key is duplicated within an object. - - You can examine 'settings_` yourself - to see the defaults. You can also write and read them just like any - JSON Value. - \sa setDefaults() - */ - Json::Value settings_; - - CharReaderBuilder(); - virtual ~CharReaderBuilder(); - - virtual CharReader* newCharReader() const; - - /** \return true if 'settings' are legal and consistent; - * otherwise, indicate bad settings via 'invalid'. - */ - bool validate(Json::Value* invalid) const; - - /** A simple way to update a specific setting. - */ - Value& operator[](std::string key); - - /** Called by ctor, but you can use this to reset settings_. - * \pre 'settings' != NULL (but Json::null is fine) - * \remark Defaults: - * \snippet src/lib_json/json_reader.cpp CharReaderBuilderDefaults - */ - static void setDefaults(Json::Value* settings); - /** Same as old Features::strictMode(). - * \pre 'settings' != NULL (but Json::null is fine) - * \remark Defaults: - * \snippet src/lib_json/json_reader.cpp CharReaderBuilderStrictMode - */ - static void strictMode(Json::Value* settings); -}; - -/** Consume entire stream and use its begin/end. - * Someday we might have a real StreamReader, but for now this - * is convenient. - */ -bool JSON_API parseFromStream( - CharReader::Factory const&, - std::istream&, - Value* root, std::string* errs); - -/** \brief Read from 'sin' into 'root'. - - Always keep comments from the input JSON. - - This can be used to read a file into a particular sub-object. - For example: - \code - Json::Value root; - cin >> root["dir"]["file"]; - cout << root; - \endcode - Result: - \verbatim - { - "dir": { - "file": { - // The input stream JSON would be nested here. - } - } - } - \endverbatim - \throw std::exception on parse error. - \see Json::operator<<() -*/ -JSON_API std::istream& operator>>(std::istream&, Value&); - -} // namespace Json - -#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) -#pragma warning(pop) -#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) - -#endif // CPPTL_JSON_READER_H_INCLUDED - -// ////////////////////////////////////////////////////////////////////// -// End of content of file: include/json/reader.h -// ////////////////////////////////////////////////////////////////////// - - - - - - -// ////////////////////////////////////////////////////////////////////// -// Beginning of content of file: include/json/writer.h -// ////////////////////////////////////////////////////////////////////// - -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef JSON_WRITER_H_INCLUDED -#define JSON_WRITER_H_INCLUDED - -#if !defined(JSON_IS_AMALGAMATION) -#include "value.h" -#endif // if !defined(JSON_IS_AMALGAMATION) -#include -#include -#include - -// Disable warning C4251: : needs to have dll-interface to -// be used by... -#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) -#pragma warning(push) -#pragma warning(disable : 4251) -#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) - -namespace Json { - -class Value; - -/** - -Usage: -\code - using namespace Json; - void writeToStdout(StreamWriter::Factory const& factory, Value const& value) { - std::unique_ptr const writer( - factory.newStreamWriter()); - writer->write(value, &std::cout); - std::cout << std::endl; // add lf and flush - } -\endcode -*/ -class JSON_API StreamWriter { -protected: - std::ostream* sout_; // not owned; will not delete -public: - StreamWriter(); - virtual ~StreamWriter(); - /** Write Value into document as configured in sub-class. - Do not take ownership of sout, but maintain a reference during function. - \pre sout != NULL - \return zero on success (For now, we always return zero, so check the stream instead.) - \throw std::exception possibly, depending on configuration - */ - virtual int write(Value const& root, std::ostream* sout) = 0; - - /** \brief A simple abstract factory. - */ - class JSON_API Factory { - public: - virtual ~Factory(); - /** \brief Allocate a CharReader via operator new(). - * \throw std::exception if something goes wrong (e.g. invalid settings) - */ - virtual StreamWriter* newStreamWriter() const = 0; - }; // Factory -}; // StreamWriter - -/** \brief Write into stringstream, then return string, for convenience. - * A StreamWriter will be created from the factory, used, and then deleted. - */ -std::string JSON_API writeString(StreamWriter::Factory const& factory, Value const& root); - - -/** \brief Build a StreamWriter implementation. - -Usage: -\code - using namespace Json; - Value value = ...; - StreamWriterBuilder builder; - builder["commentStyle"] = "None"; - builder["indentation"] = " "; // or whatever you like - std::unique_ptr writer( - builder.newStreamWriter()); - writer->write(value, &std::cout); - std::cout << std::endl; // add lf and flush -\endcode -*/ -class JSON_API StreamWriterBuilder : public StreamWriter::Factory { -public: - // Note: We use a Json::Value so that we can add data-members to this class - // without a major version bump. - /** Configuration of this builder. - Available settings (case-sensitive): - - "commentStyle": "None" or "All" - - "indentation": "" - - "enableYAMLCompatibility": false or true - - slightly change the whitespace around colons - - "dropNullPlaceholders": false or true - - Drop the "null" string from the writer's output for nullValues. - Strictly speaking, this is not valid JSON. But when the output is being - fed to a browser's Javascript, it makes for smaller output and the - browser can handle the output just fine. - - You can examine 'settings_` yourself - to see the defaults. You can also write and read them just like any - JSON Value. - \sa setDefaults() - */ - Json::Value settings_; - - StreamWriterBuilder(); - virtual ~StreamWriterBuilder(); - - /** - * \throw std::exception if something goes wrong (e.g. invalid settings) - */ - virtual StreamWriter* newStreamWriter() const; - - /** \return true if 'settings' are legal and consistent; - * otherwise, indicate bad settings via 'invalid'. - */ - bool validate(Json::Value* invalid) const; - /** A simple way to update a specific setting. - */ - Value& operator[](std::string key); - - /** Called by ctor, but you can use this to reset settings_. - * \pre 'settings' != NULL (but Json::null is fine) - * \remark Defaults: - * \snippet src/lib_json/json_writer.cpp StreamWriterBuilderDefaults - */ - static void setDefaults(Json::Value* settings); -}; - -/** \brief Abstract class for writers. - * \deprecated Use StreamWriter. (And really, this is an implementation detail.) - */ -class JSON_API Writer { -public: - virtual ~Writer(); - - virtual std::string write(const Value& root) = 0; -}; - -/** \brief Outputs a Value in JSON format - *without formatting (not human friendly). - * - * The JSON document is written in a single line. It is not intended for 'human' - *consumption, - * but may be usefull to support feature such as RPC where bandwith is limited. - * \sa Reader, Value - * \deprecated Use StreamWriterBuilder. - */ -class JSON_API FastWriter : public Writer { - -public: - FastWriter(); - virtual ~FastWriter() {} - - void enableYAMLCompatibility(); - - /** \brief Drop the "null" string from the writer's output for nullValues. - * Strictly speaking, this is not valid JSON. But when the output is being - * fed to a browser's Javascript, it makes for smaller output and the - * browser can handle the output just fine. - */ - void dropNullPlaceholders(); - - void omitEndingLineFeed(); - -public: // overridden from Writer - virtual std::string write(const Value& root); - -private: - void writeValue(const Value& value); - - std::string document_; - bool yamlCompatiblityEnabled_; - bool dropNullPlaceholders_; - bool omitEndingLineFeed_; -}; - -/** \brief Writes a Value in JSON format in a - *human friendly way. - * - * The rules for line break and indent are as follow: - * - Object value: - * - if empty then print {} without indent and line break - * - if not empty the print '{', line break & indent, print one value per - *line - * and then unindent and line break and print '}'. - * - Array value: - * - if empty then print [] without indent and line break - * - if the array contains no object value, empty array or some other value - *types, - * and all the values fit on one lines, then print the array on a single - *line. - * - otherwise, it the values do not fit on one line, or the array contains - * object or non empty array, then print one value per line. - * - * If the Value have comments then they are outputed according to their - *#CommentPlacement. - * - * \sa Reader, Value, Value::setComment() - * \deprecated Use StreamWriterBuilder. - */ -class JSON_API StyledWriter : public Writer { -public: - StyledWriter(); - virtual ~StyledWriter() {} - -public: // overridden from Writer - /** \brief Serialize a Value in JSON format. - * \param root Value to serialize. - * \return String containing the JSON document that represents the root value. - */ - virtual std::string write(const Value& root); - -private: - void writeValue(const Value& value); - void writeArrayValue(const Value& value); - bool isMultineArray(const Value& value); - void pushValue(const std::string& value); - void writeIndent(); - void writeWithIndent(const std::string& value); - void indent(); - void unindent(); - void writeCommentBeforeValue(const Value& root); - void writeCommentAfterValueOnSameLine(const Value& root); - bool hasCommentForValue(const Value& value); - static std::string normalizeEOL(const std::string& text); - - typedef std::vector ChildValues; - - ChildValues childValues_; - std::string document_; - std::string indentString_; - int rightMargin_; - int indentSize_; - bool addChildValues_; -}; - -/** \brief Writes a Value in JSON format in a - human friendly way, - to a stream rather than to a string. - * - * The rules for line break and indent are as follow: - * - Object value: - * - if empty then print {} without indent and line break - * - if not empty the print '{', line break & indent, print one value per - line - * and then unindent and line break and print '}'. - * - Array value: - * - if empty then print [] without indent and line break - * - if the array contains no object value, empty array or some other value - types, - * and all the values fit on one lines, then print the array on a single - line. - * - otherwise, it the values do not fit on one line, or the array contains - * object or non empty array, then print one value per line. - * - * If the Value have comments then they are outputed according to their - #CommentPlacement. - * - * \param indentation Each level will be indented by this amount extra. - * \sa Reader, Value, Value::setComment() - * \deprecated Use StreamWriterBuilder. - */ -class JSON_API StyledStreamWriter { -public: - StyledStreamWriter(std::string indentation = "\t"); - ~StyledStreamWriter() {} - -public: - /** \brief Serialize a Value in JSON format. - * \param out Stream to write to. (Can be ostringstream, e.g.) - * \param root Value to serialize. - * \note There is no point in deriving from Writer, since write() should not - * return a value. - */ - void write(std::ostream& out, const Value& root); - -private: - void writeValue(const Value& value); - void writeArrayValue(const Value& value); - bool isMultineArray(const Value& value); - void pushValue(const std::string& value); - void writeIndent(); - void writeWithIndent(const std::string& value); - void indent(); - void unindent(); - void writeCommentBeforeValue(const Value& root); - void writeCommentAfterValueOnSameLine(const Value& root); - bool hasCommentForValue(const Value& value); - static std::string normalizeEOL(const std::string& text); - - typedef std::vector ChildValues; - - ChildValues childValues_; - std::ostream* document_; - std::string indentString_; - int rightMargin_; - std::string indentation_; - bool addChildValues_ : 1; - bool indented_ : 1; -}; - -#if defined(JSON_HAS_INT64) -std::string JSON_API valueToString(Int value); -std::string JSON_API valueToString(UInt value); -#endif // if defined(JSON_HAS_INT64) -std::string JSON_API valueToString(LargestInt value); -std::string JSON_API valueToString(LargestUInt value); -std::string JSON_API valueToString(double value); -std::string JSON_API valueToString(bool value); -std::string JSON_API valueToQuotedString(const char* value); - -/// \brief Output using the StyledStreamWriter. -/// \see Json::operator>>() -JSON_API std::ostream& operator<<(std::ostream&, const Value& root); - -} // namespace Json - -#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) -#pragma warning(pop) -#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) - -#endif // JSON_WRITER_H_INCLUDED - -// ////////////////////////////////////////////////////////////////////// -// End of content of file: include/json/writer.h -// ////////////////////////////////////////////////////////////////////// - - - - - - -// ////////////////////////////////////////////////////////////////////// -// Beginning of content of file: include/json/assertions.h -// ////////////////////////////////////////////////////////////////////// - -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED -#define CPPTL_JSON_ASSERTIONS_H_INCLUDED - -#include -#include - -#if !defined(JSON_IS_AMALGAMATION) -#include "config.h" -#endif // if !defined(JSON_IS_AMALGAMATION) - -/** It should not be possible for a maliciously designed file to - * cause an abort() or seg-fault, so these macros are used only - * for pre-condition violations and internal logic errors. - */ -#if JSON_USE_EXCEPTION - -// @todo <= add detail about condition in exception -# define JSON_ASSERT(condition) \ - {if (!(condition)) {Json::throwLogicError( "assert json failed" );}} - -# define JSON_FAIL_MESSAGE(message) \ - { \ - std::ostringstream oss; oss << message; \ - Json::throwLogicError(oss.str()); \ - abort(); \ - } - -#else // JSON_USE_EXCEPTION - -# define JSON_ASSERT(condition) assert(condition) - -// The call to assert() will show the failure message in debug builds. In -// release builds we abort, for a core-dump or debugger. -# define JSON_FAIL_MESSAGE(message) \ - { \ - std::ostringstream oss; oss << message; \ - assert(false && oss.str().c_str()); \ - abort(); \ - } - - -#endif - -#define JSON_ASSERT_MESSAGE(condition, message) \ - if (!(condition)) { \ - JSON_FAIL_MESSAGE(message); \ - } - -#endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED - -// ////////////////////////////////////////////////////////////////////// -// End of content of file: include/json/assertions.h -// ////////////////////////////////////////////////////////////////////// - - - - - -#endif //ifndef JSON_AMALGATED_H_INCLUDED diff --git a/tools/buildHeaders/jsoncpp/dist/jsoncpp.cpp b/tools/buildHeaders/jsoncpp/dist/jsoncpp.cpp deleted file mode 100644 index 13049140..00000000 --- a/tools/buildHeaders/jsoncpp/dist/jsoncpp.cpp +++ /dev/null @@ -1,5124 +0,0 @@ -/// Json-cpp amalgated source (http://jsoncpp.sourceforge.net/). -/// It is intended to be used with #include "json/json.h" - -// ////////////////////////////////////////////////////////////////////// -// Beginning of content of file: LICENSE -// ////////////////////////////////////////////////////////////////////// - -/* -The JsonCpp library's source code, including accompanying documentation, -tests and demonstration applications, are licensed under the following -conditions... - -The author (Baptiste Lepilleur) explicitly disclaims copyright in all -jurisdictions which recognize such a disclaimer. In such jurisdictions, -this software is released into the Public Domain. - -In jurisdictions which do not recognize Public Domain property (e.g. Germany as of -2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is -released under the terms of the MIT License (see below). - -In jurisdictions which recognize Public Domain property, the user of this -software may choose to accept it either as 1) Public Domain, 2) under the -conditions of the MIT License (see below), or 3) under the terms of dual -Public Domain/MIT License conditions described here, as they choose. - -The MIT License is about as close to Public Domain as a license can get, and is -described in clear, concise terms at: - - http://en.wikipedia.org/wiki/MIT_License - -The full text of the MIT License follows: - -======================================================================== -Copyright (c) 2007-2010 Baptiste Lepilleur - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, copy, -modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -======================================================================== -(END LICENSE TEXT) - -The MIT license is compatible with both the GPL and commercial -software, affording one all of the rights of Public Domain with the -minor nuisance of being required to keep the above copyright notice -and license text in the source code. Note also that by accepting the -Public Domain "license" you can re-license your copy using whatever -license you like. - -*/ - -// ////////////////////////////////////////////////////////////////////// -// End of content of file: LICENSE -// ////////////////////////////////////////////////////////////////////// - - - - - - -#include "json/json.h" - -#ifndef JSON_IS_AMALGAMATION -#error "Compile with -I PATH_TO_JSON_DIRECTORY" -#endif - - -// ////////////////////////////////////////////////////////////////////// -// Beginning of content of file: src/lib_json/json_tool.h -// ////////////////////////////////////////////////////////////////////// - -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef LIB_JSONCPP_JSON_TOOL_H_INCLUDED -#define LIB_JSONCPP_JSON_TOOL_H_INCLUDED - -/* This header provides common string manipulation support, such as UTF-8, - * portable conversion from/to string... - * - * It is an internal header that must not be exposed. - */ - -namespace Json { - -/// Converts a unicode code-point to UTF-8. -static inline std::string codePointToUTF8(unsigned int cp) { - std::string result; - - // based on description from http://en.wikipedia.org/wiki/UTF-8 - - if (cp <= 0x7f) { - result.resize(1); - result[0] = static_cast(cp); - } else if (cp <= 0x7FF) { - result.resize(2); - result[1] = static_cast(0x80 | (0x3f & cp)); - result[0] = static_cast(0xC0 | (0x1f & (cp >> 6))); - } else if (cp <= 0xFFFF) { - result.resize(3); - result[2] = static_cast(0x80 | (0x3f & cp)); - result[1] = 0x80 | static_cast((0x3f & (cp >> 6))); - result[0] = 0xE0 | static_cast((0xf & (cp >> 12))); - } else if (cp <= 0x10FFFF) { - result.resize(4); - result[3] = static_cast(0x80 | (0x3f & cp)); - result[2] = static_cast(0x80 | (0x3f & (cp >> 6))); - result[1] = static_cast(0x80 | (0x3f & (cp >> 12))); - result[0] = static_cast(0xF0 | (0x7 & (cp >> 18))); - } - - return result; -} - -/// Returns true if ch is a control character (in range [0,32[). -static inline bool isControlCharacter(char ch) { return ch > 0 && ch <= 0x1F; } - -enum { - /// Constant that specify the size of the buffer that must be passed to - /// uintToString. - uintToStringBufferSize = 3 * sizeof(LargestUInt) + 1 -}; - -// Defines a char buffer for use with uintToString(). -typedef char UIntToStringBuffer[uintToStringBufferSize]; - -/** Converts an unsigned integer to string. - * @param value Unsigned interger to convert to string - * @param current Input/Output string buffer. - * Must have at least uintToStringBufferSize chars free. - */ -static inline void uintToString(LargestUInt value, char*& current) { - *--current = 0; - do { - *--current = char(value % 10) + '0'; - value /= 10; - } while (value != 0); -} - -/** Change ',' to '.' everywhere in buffer. - * - * We had a sophisticated way, but it did not work in WinCE. - * @see https://github.com/open-source-parsers/jsoncpp/pull/9 - */ -static inline void fixNumericLocale(char* begin, char* end) { - while (begin < end) { - if (*begin == ',') { - *begin = '.'; - } - ++begin; - } -} - -} // namespace Json { - -#endif // LIB_JSONCPP_JSON_TOOL_H_INCLUDED - -// ////////////////////////////////////////////////////////////////////// -// End of content of file: src/lib_json/json_tool.h -// ////////////////////////////////////////////////////////////////////// - - - - - - -// ////////////////////////////////////////////////////////////////////// -// Beginning of content of file: src/lib_json/json_reader.cpp -// ////////////////////////////////////////////////////////////////////// - -// Copyright 2007-2011 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#if !defined(JSON_IS_AMALGAMATION) -#include -#include -#include -#include "json_tool.h" -#endif // if !defined(JSON_IS_AMALGAMATION) -#include -#include -#include -#include -#include -#include -#include -#include - -#if defined(_MSC_VER) && _MSC_VER < 1500 // VC++ 8.0 and below -#define snprintf _snprintf -#endif - -#if defined(_MSC_VER) && _MSC_VER >= 1400 // VC++ 8.0 -// Disable warning about strdup being deprecated. -#pragma warning(disable : 4996) -#endif - -static int const stackLimit_g = 1000; -static int stackDepth_g = 0; // see readValue() - -namespace Json { - -#if __cplusplus >= 201103L -typedef std::unique_ptr CharReaderPtr; -#else -typedef std::auto_ptr CharReaderPtr; -#endif - -// Implementation of class Features -// //////////////////////////////// - -Features::Features() - : allowComments_(true), strictRoot_(false), - allowDroppedNullPlaceholders_(false), allowNumericKeys_(false) {} - -Features Features::all() { return Features(); } - -Features Features::strictMode() { - Features features; - features.allowComments_ = false; - features.strictRoot_ = true; - features.allowDroppedNullPlaceholders_ = false; - features.allowNumericKeys_ = false; - return features; -} - -// Implementation of class Reader -// //////////////////////////////// - -static bool containsNewLine(Reader::Location begin, Reader::Location end) { - for (; begin < end; ++begin) - if (*begin == '\n' || *begin == '\r') - return true; - return false; -} - -// Class Reader -// ////////////////////////////////////////////////////////////////// - -Reader::Reader() - : errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(), - lastValue_(), commentsBefore_(), features_(Features::all()), - collectComments_() {} - -Reader::Reader(const Features& features) - : errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(), - lastValue_(), commentsBefore_(), features_(features), collectComments_() { -} - -bool -Reader::parse(const std::string& document, Value& root, bool collectComments) { - document_ = document; - const char* begin = document_.c_str(); - const char* end = begin + document_.length(); - return parse(begin, end, root, collectComments); -} - -bool Reader::parse(std::istream& sin, Value& root, bool collectComments) { - // std::istream_iterator begin(sin); - // std::istream_iterator end; - // Those would allow streamed input from a file, if parse() were a - // template function. - - // Since std::string is reference-counted, this at least does not - // create an extra copy. - std::string doc; - std::getline(sin, doc, (char)EOF); - return parse(doc, root, collectComments); -} - -bool Reader::parse(const char* beginDoc, - const char* endDoc, - Value& root, - bool collectComments) { - if (!features_.allowComments_) { - collectComments = false; - } - - begin_ = beginDoc; - end_ = endDoc; - collectComments_ = collectComments; - current_ = begin_; - lastValueEnd_ = 0; - lastValue_ = 0; - commentsBefore_ = ""; - errors_.clear(); - while (!nodes_.empty()) - nodes_.pop(); - nodes_.push(&root); - - stackDepth_g = 0; // Yes, this is bad coding, but options are limited. - bool successful = readValue(); - Token token; - skipCommentTokens(token); - if (collectComments_ && !commentsBefore_.empty()) - root.setComment(commentsBefore_, commentAfter); - if (features_.strictRoot_) { - if (!root.isArray() && !root.isObject()) { - // Set error location to start of doc, ideally should be first token found - // in doc - token.type_ = tokenError; - token.start_ = beginDoc; - token.end_ = endDoc; - addError( - "A valid JSON document must be either an array or an object value.", - token); - return false; - } - } - return successful; -} - -bool Reader::readValue() { - // This is a non-reentrant way to support a stackLimit. Terrible! - // But this deprecated class has a security problem: Bad input can - // cause a seg-fault. This seems like a fair, binary-compatible way - // to prevent the problem. - if (stackDepth_g >= stackLimit_g) throwRuntimeError("Exceeded stackLimit in readValue()."); - ++stackDepth_g; - - Token token; - skipCommentTokens(token); - bool successful = true; - - if (collectComments_ && !commentsBefore_.empty()) { - currentValue().setComment(commentsBefore_, commentBefore); - commentsBefore_ = ""; - } - - switch (token.type_) { - case tokenObjectBegin: - successful = readObject(token); - currentValue().setOffsetLimit(current_ - begin_); - break; - case tokenArrayBegin: - successful = readArray(token); - currentValue().setOffsetLimit(current_ - begin_); - break; - case tokenNumber: - successful = decodeNumber(token); - break; - case tokenString: - successful = decodeString(token); - break; - case tokenTrue: - { - Value v(true); - currentValue().swapPayload(v); - currentValue().setOffsetStart(token.start_ - begin_); - currentValue().setOffsetLimit(token.end_ - begin_); - } - break; - case tokenFalse: - { - Value v(false); - currentValue().swapPayload(v); - currentValue().setOffsetStart(token.start_ - begin_); - currentValue().setOffsetLimit(token.end_ - begin_); - } - break; - case tokenNull: - { - Value v; - currentValue().swapPayload(v); - currentValue().setOffsetStart(token.start_ - begin_); - currentValue().setOffsetLimit(token.end_ - begin_); - } - break; - case tokenArraySeparator: - case tokenObjectEnd: - case tokenArrayEnd: - if (features_.allowDroppedNullPlaceholders_) { - // "Un-read" the current token and mark the current value as a null - // token. - current_--; - Value v; - currentValue().swapPayload(v); - currentValue().setOffsetStart(current_ - begin_ - 1); - currentValue().setOffsetLimit(current_ - begin_); - break; - } // Else, fall through... - default: - currentValue().setOffsetStart(token.start_ - begin_); - currentValue().setOffsetLimit(token.end_ - begin_); - return addError("Syntax error: value, object or array expected.", token); - } - - if (collectComments_) { - lastValueEnd_ = current_; - lastValue_ = ¤tValue(); - } - - --stackDepth_g; - return successful; -} - -void Reader::skipCommentTokens(Token& token) { - if (features_.allowComments_) { - do { - readToken(token); - } while (token.type_ == tokenComment); - } else { - readToken(token); - } -} - -bool Reader::readToken(Token& token) { - skipSpaces(); - token.start_ = current_; - Char c = getNextChar(); - bool ok = true; - switch (c) { - case '{': - token.type_ = tokenObjectBegin; - break; - case '}': - token.type_ = tokenObjectEnd; - break; - case '[': - token.type_ = tokenArrayBegin; - break; - case ']': - token.type_ = tokenArrayEnd; - break; - case '"': - token.type_ = tokenString; - ok = readString(); - break; - case '/': - token.type_ = tokenComment; - ok = readComment(); - break; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case '-': - token.type_ = tokenNumber; - readNumber(); - break; - case 't': - token.type_ = tokenTrue; - ok = match("rue", 3); - break; - case 'f': - token.type_ = tokenFalse; - ok = match("alse", 4); - break; - case 'n': - token.type_ = tokenNull; - ok = match("ull", 3); - break; - case ',': - token.type_ = tokenArraySeparator; - break; - case ':': - token.type_ = tokenMemberSeparator; - break; - case 0: - token.type_ = tokenEndOfStream; - break; - default: - ok = false; - break; - } - if (!ok) - token.type_ = tokenError; - token.end_ = current_; - return true; -} - -void Reader::skipSpaces() { - while (current_ != end_) { - Char c = *current_; - if (c == ' ' || c == '\t' || c == '\r' || c == '\n') - ++current_; - else - break; - } -} - -bool Reader::match(Location pattern, int patternLength) { - if (end_ - current_ < patternLength) - return false; - int index = patternLength; - while (index--) - if (current_[index] != pattern[index]) - return false; - current_ += patternLength; - return true; -} - -bool Reader::readComment() { - Location commentBegin = current_ - 1; - Char c = getNextChar(); - bool successful = false; - if (c == '*') - successful = readCStyleComment(); - else if (c == '/') - successful = readCppStyleComment(); - if (!successful) - return false; - - if (collectComments_) { - CommentPlacement placement = commentBefore; - if (lastValueEnd_ && !containsNewLine(lastValueEnd_, commentBegin)) { - if (c != '*' || !containsNewLine(commentBegin, current_)) - placement = commentAfterOnSameLine; - } - - addComment(commentBegin, current_, placement); - } - return true; -} - -static std::string normalizeEOL(Reader::Location begin, Reader::Location end) { - std::string normalized; - normalized.reserve(end - begin); - Reader::Location current = begin; - while (current != end) { - char c = *current++; - if (c == '\r') { - if (current != end && *current == '\n') - // convert dos EOL - ++current; - // convert Mac EOL - normalized += '\n'; - } else { - normalized += c; - } - } - return normalized; -} - -void -Reader::addComment(Location begin, Location end, CommentPlacement placement) { - assert(collectComments_); - const std::string& normalized = normalizeEOL(begin, end); - if (placement == commentAfterOnSameLine) { - assert(lastValue_ != 0); - lastValue_->setComment(normalized, placement); - } else { - commentsBefore_ += normalized; - } -} - -bool Reader::readCStyleComment() { - while (current_ != end_) { - Char c = getNextChar(); - if (c == '*' && *current_ == '/') - break; - } - return getNextChar() == '/'; -} - -bool Reader::readCppStyleComment() { - while (current_ != end_) { - Char c = getNextChar(); - if (c == '\n') - break; - if (c == '\r') { - // Consume DOS EOL. It will be normalized in addComment. - if (current_ != end_ && *current_ == '\n') - getNextChar(); - // Break on Moc OS 9 EOL. - break; - } - } - return true; -} - -void Reader::readNumber() { - const char *p = current_; - char c = '0'; // stopgap for already consumed character - // integral part - while (c >= '0' && c <= '9') - c = (current_ = p) < end_ ? *p++ : 0; - // fractional part - if (c == '.') { - c = (current_ = p) < end_ ? *p++ : 0; - while (c >= '0' && c <= '9') - c = (current_ = p) < end_ ? *p++ : 0; - } - // exponential part - if (c == 'e' || c == 'E') { - c = (current_ = p) < end_ ? *p++ : 0; - if (c == '+' || c == '-') - c = (current_ = p) < end_ ? *p++ : 0; - while (c >= '0' && c <= '9') - c = (current_ = p) < end_ ? *p++ : 0; - } -} - -bool Reader::readString() { - Char c = 0; - while (current_ != end_) { - c = getNextChar(); - if (c == '\\') - getNextChar(); - else if (c == '"') - break; - } - return c == '"'; -} - -bool Reader::readObject(Token& tokenStart) { - Token tokenName; - std::string name; - Value init(objectValue); - currentValue().swapPayload(init); - currentValue().setOffsetStart(tokenStart.start_ - begin_); - while (readToken(tokenName)) { - bool initialTokenOk = true; - while (tokenName.type_ == tokenComment && initialTokenOk) - initialTokenOk = readToken(tokenName); - if (!initialTokenOk) - break; - if (tokenName.type_ == tokenObjectEnd && name.empty()) // empty object - return true; - name = ""; - if (tokenName.type_ == tokenString) { - if (!decodeString(tokenName, name)) - return recoverFromError(tokenObjectEnd); - } else if (tokenName.type_ == tokenNumber && features_.allowNumericKeys_) { - Value numberName; - if (!decodeNumber(tokenName, numberName)) - return recoverFromError(tokenObjectEnd); - name = numberName.asString(); - } else { - break; - } - - Token colon; - if (!readToken(colon) || colon.type_ != tokenMemberSeparator) { - return addErrorAndRecover( - "Missing ':' after object member name", colon, tokenObjectEnd); - } - Value& value = currentValue()[name]; - nodes_.push(&value); - bool ok = readValue(); - nodes_.pop(); - if (!ok) // error already set - return recoverFromError(tokenObjectEnd); - - Token comma; - if (!readToken(comma) || - (comma.type_ != tokenObjectEnd && comma.type_ != tokenArraySeparator && - comma.type_ != tokenComment)) { - return addErrorAndRecover( - "Missing ',' or '}' in object declaration", comma, tokenObjectEnd); - } - bool finalizeTokenOk = true; - while (comma.type_ == tokenComment && finalizeTokenOk) - finalizeTokenOk = readToken(comma); - if (comma.type_ == tokenObjectEnd) - return true; - } - return addErrorAndRecover( - "Missing '}' or object member name", tokenName, tokenObjectEnd); -} - -bool Reader::readArray(Token& tokenStart) { - Value init(arrayValue); - currentValue().swapPayload(init); - currentValue().setOffsetStart(tokenStart.start_ - begin_); - skipSpaces(); - if (*current_ == ']') // empty array - { - Token endArray; - readToken(endArray); - return true; - } - int index = 0; - for (;;) { - Value& value = currentValue()[index++]; - nodes_.push(&value); - bool ok = readValue(); - nodes_.pop(); - if (!ok) // error already set - return recoverFromError(tokenArrayEnd); - - Token token; - // Accept Comment after last item in the array. - ok = readToken(token); - while (token.type_ == tokenComment && ok) { - ok = readToken(token); - } - bool badTokenType = - (token.type_ != tokenArraySeparator && token.type_ != tokenArrayEnd); - if (!ok || badTokenType) { - return addErrorAndRecover( - "Missing ',' or ']' in array declaration", token, tokenArrayEnd); - } - if (token.type_ == tokenArrayEnd) - break; - } - return true; -} - -bool Reader::decodeNumber(Token& token) { - Value decoded; - if (!decodeNumber(token, decoded)) - return false; - currentValue().swapPayload(decoded); - currentValue().setOffsetStart(token.start_ - begin_); - currentValue().setOffsetLimit(token.end_ - begin_); - return true; -} - -bool Reader::decodeNumber(Token& token, Value& decoded) { - // Attempts to parse the number as an integer. If the number is - // larger than the maximum supported value of an integer then - // we decode the number as a double. - Location current = token.start_; - bool isNegative = *current == '-'; - if (isNegative) - ++current; - // TODO: Help the compiler do the div and mod at compile time or get rid of them. - Value::LargestUInt maxIntegerValue = - isNegative ? Value::LargestUInt(-Value::minLargestInt) - : Value::maxLargestUInt; - Value::LargestUInt threshold = maxIntegerValue / 10; - Value::LargestUInt value = 0; - while (current < token.end_) { - Char c = *current++; - if (c < '0' || c > '9') - return decodeDouble(token, decoded); - Value::UInt digit(c - '0'); - if (value >= threshold) { - // We've hit or exceeded the max value divided by 10 (rounded down). If - // a) we've only just touched the limit, b) this is the last digit, and - // c) it's small enough to fit in that rounding delta, we're okay. - // Otherwise treat this number as a double to avoid overflow. - if (value > threshold || current != token.end_ || - digit > maxIntegerValue % 10) { - return decodeDouble(token, decoded); - } - } - value = value * 10 + digit; - } - if (isNegative) - decoded = -Value::LargestInt(value); - else if (value <= Value::LargestUInt(Value::maxInt)) - decoded = Value::LargestInt(value); - else - decoded = value; - return true; -} - -bool Reader::decodeDouble(Token& token) { - Value decoded; - if (!decodeDouble(token, decoded)) - return false; - currentValue().swapPayload(decoded); - currentValue().setOffsetStart(token.start_ - begin_); - currentValue().setOffsetLimit(token.end_ - begin_); - return true; -} - -bool Reader::decodeDouble(Token& token, Value& decoded) { - double value = 0; - const int bufferSize = 32; - int count; - int length = int(token.end_ - token.start_); - - // Sanity check to avoid buffer overflow exploits. - if (length < 0) { - return addError("Unable to parse token length", token); - } - - // Avoid using a string constant for the format control string given to - // sscanf, as this can cause hard to debug crashes on OS X. See here for more - // info: - // - // http://developer.apple.com/library/mac/#DOCUMENTATION/DeveloperTools/gcc-4.0.1/gcc/Incompatibilities.html - char format[] = "%lf"; - - if (length <= bufferSize) { - Char buffer[bufferSize + 1]; - memcpy(buffer, token.start_, length); - buffer[length] = 0; - count = sscanf(buffer, format, &value); - } else { - std::string buffer(token.start_, token.end_); - count = sscanf(buffer.c_str(), format, &value); - } - - if (count != 1) - return addError("'" + std::string(token.start_, token.end_) + - "' is not a number.", - token); - decoded = value; - return true; -} - -bool Reader::decodeString(Token& token) { - std::string decoded_string; - if (!decodeString(token, decoded_string)) - return false; - Value decoded(decoded_string); - currentValue().swapPayload(decoded); - currentValue().setOffsetStart(token.start_ - begin_); - currentValue().setOffsetLimit(token.end_ - begin_); - return true; -} - -bool Reader::decodeString(Token& token, std::string& decoded) { - decoded.reserve(token.end_ - token.start_ - 2); - Location current = token.start_ + 1; // skip '"' - Location end = token.end_ - 1; // do not include '"' - while (current != end) { - Char c = *current++; - if (c == '"') - break; - else if (c == '\\') { - if (current == end) - return addError("Empty escape sequence in string", token, current); - Char escape = *current++; - switch (escape) { - case '"': - decoded += '"'; - break; - case '/': - decoded += '/'; - break; - case '\\': - decoded += '\\'; - break; - case 'b': - decoded += '\b'; - break; - case 'f': - decoded += '\f'; - break; - case 'n': - decoded += '\n'; - break; - case 'r': - decoded += '\r'; - break; - case 't': - decoded += '\t'; - break; - case 'u': { - unsigned int unicode; - if (!decodeUnicodeCodePoint(token, current, end, unicode)) - return false; - decoded += codePointToUTF8(unicode); - } break; - default: - return addError("Bad escape sequence in string", token, current); - } - } else { - decoded += c; - } - } - return true; -} - -bool Reader::decodeUnicodeCodePoint(Token& token, - Location& current, - Location end, - unsigned int& unicode) { - - if (!decodeUnicodeEscapeSequence(token, current, end, unicode)) - return false; - if (unicode >= 0xD800 && unicode <= 0xDBFF) { - // surrogate pairs - if (end - current < 6) - return addError( - "additional six characters expected to parse unicode surrogate pair.", - token, - current); - unsigned int surrogatePair; - if (*(current++) == '\\' && *(current++) == 'u') { - if (decodeUnicodeEscapeSequence(token, current, end, surrogatePair)) { - unicode = 0x10000 + ((unicode & 0x3FF) << 10) + (surrogatePair & 0x3FF); - } else - return false; - } else - return addError("expecting another \\u token to begin the second half of " - "a unicode surrogate pair", - token, - current); - } - return true; -} - -bool Reader::decodeUnicodeEscapeSequence(Token& token, - Location& current, - Location end, - unsigned int& unicode) { - if (end - current < 4) - return addError( - "Bad unicode escape sequence in string: four digits expected.", - token, - current); - unicode = 0; - for (int index = 0; index < 4; ++index) { - Char c = *current++; - unicode *= 16; - if (c >= '0' && c <= '9') - unicode += c - '0'; - else if (c >= 'a' && c <= 'f') - unicode += c - 'a' + 10; - else if (c >= 'A' && c <= 'F') - unicode += c - 'A' + 10; - else - return addError( - "Bad unicode escape sequence in string: hexadecimal digit expected.", - token, - current); - } - return true; -} - -bool -Reader::addError(const std::string& message, Token& token, Location extra) { - ErrorInfo info; - info.token_ = token; - info.message_ = message; - info.extra_ = extra; - errors_.push_back(info); - return false; -} - -bool Reader::recoverFromError(TokenType skipUntilToken) { - int errorCount = int(errors_.size()); - Token skip; - for (;;) { - if (!readToken(skip)) - errors_.resize(errorCount); // discard errors caused by recovery - if (skip.type_ == skipUntilToken || skip.type_ == tokenEndOfStream) - break; - } - errors_.resize(errorCount); - return false; -} - -bool Reader::addErrorAndRecover(const std::string& message, - Token& token, - TokenType skipUntilToken) { - addError(message, token); - return recoverFromError(skipUntilToken); -} - -Value& Reader::currentValue() { return *(nodes_.top()); } - -Reader::Char Reader::getNextChar() { - if (current_ == end_) - return 0; - return *current_++; -} - -void Reader::getLocationLineAndColumn(Location location, - int& line, - int& column) const { - Location current = begin_; - Location lastLineStart = current; - line = 0; - while (current < location && current != end_) { - Char c = *current++; - if (c == '\r') { - if (*current == '\n') - ++current; - lastLineStart = current; - ++line; - } else if (c == '\n') { - lastLineStart = current; - ++line; - } - } - // column & line start at 1 - column = int(location - lastLineStart) + 1; - ++line; -} - -std::string Reader::getLocationLineAndColumn(Location location) const { - int line, column; - getLocationLineAndColumn(location, line, column); - char buffer[18 + 16 + 16 + 1]; -#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) -#if defined(WINCE) - _snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column); -#else - sprintf_s(buffer, sizeof(buffer), "Line %d, Column %d", line, column); -#endif -#else - snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column); -#endif - return buffer; -} - -// Deprecated. Preserved for backward compatibility -std::string Reader::getFormatedErrorMessages() const { - return getFormattedErrorMessages(); -} - -std::string Reader::getFormattedErrorMessages() const { - std::string formattedMessage; - for (Errors::const_iterator itError = errors_.begin(); - itError != errors_.end(); - ++itError) { - const ErrorInfo& error = *itError; - formattedMessage += - "* " + getLocationLineAndColumn(error.token_.start_) + "\n"; - formattedMessage += " " + error.message_ + "\n"; - if (error.extra_) - formattedMessage += - "See " + getLocationLineAndColumn(error.extra_) + " for detail.\n"; - } - return formattedMessage; -} - -std::vector Reader::getStructuredErrors() const { - std::vector allErrors; - for (Errors::const_iterator itError = errors_.begin(); - itError != errors_.end(); - ++itError) { - const ErrorInfo& error = *itError; - Reader::StructuredError structured; - structured.offset_start = error.token_.start_ - begin_; - structured.offset_limit = error.token_.end_ - begin_; - structured.message = error.message_; - allErrors.push_back(structured); - } - return allErrors; -} - -bool Reader::pushError(const Value& value, const std::string& message) { - size_t length = end_ - begin_; - if(value.getOffsetStart() > length - || value.getOffsetLimit() > length) - return false; - Token token; - token.type_ = tokenError; - token.start_ = begin_ + value.getOffsetStart(); - token.end_ = end_ + value.getOffsetLimit(); - ErrorInfo info; - info.token_ = token; - info.message_ = message; - info.extra_ = 0; - errors_.push_back(info); - return true; -} - -bool Reader::pushError(const Value& value, const std::string& message, const Value& extra) { - size_t length = end_ - begin_; - if(value.getOffsetStart() > length - || value.getOffsetLimit() > length - || extra.getOffsetLimit() > length) - return false; - Token token; - token.type_ = tokenError; - token.start_ = begin_ + value.getOffsetStart(); - token.end_ = begin_ + value.getOffsetLimit(); - ErrorInfo info; - info.token_ = token; - info.message_ = message; - info.extra_ = begin_ + extra.getOffsetStart(); - errors_.push_back(info); - return true; -} - -bool Reader::good() const { - return !errors_.size(); -} - -// exact copy of Features -class OurFeatures { -public: - static OurFeatures all(); - OurFeatures(); - bool allowComments_; - bool strictRoot_; - bool allowDroppedNullPlaceholders_; - bool allowNumericKeys_; - bool allowSingleQuotes_; - bool failIfExtra_; - bool rejectDupKeys_; - int stackLimit_; -}; // OurFeatures - -// exact copy of Implementation of class Features -// //////////////////////////////// - -OurFeatures::OurFeatures() - : allowComments_(true), strictRoot_(false) - , allowDroppedNullPlaceholders_(false), allowNumericKeys_(false) - , allowSingleQuotes_(false) - , failIfExtra_(false) -{ -} - -OurFeatures OurFeatures::all() { return OurFeatures(); } - -// Implementation of class Reader -// //////////////////////////////// - -// exact copy of Reader, renamed to OurReader -class OurReader { -public: - typedef char Char; - typedef const Char* Location; - struct StructuredError { - size_t offset_start; - size_t offset_limit; - std::string message; - }; - - OurReader(OurFeatures const& features); - bool parse(const char* beginDoc, - const char* endDoc, - Value& root, - bool collectComments = true); - std::string getFormattedErrorMessages() const; - std::vector getStructuredErrors() const; - bool pushError(const Value& value, const std::string& message); - bool pushError(const Value& value, const std::string& message, const Value& extra); - bool good() const; - -private: - OurReader(OurReader const&); // no impl - void operator=(OurReader const&); // no impl - - enum TokenType { - tokenEndOfStream = 0, - tokenObjectBegin, - tokenObjectEnd, - tokenArrayBegin, - tokenArrayEnd, - tokenString, - tokenNumber, - tokenTrue, - tokenFalse, - tokenNull, - tokenArraySeparator, - tokenMemberSeparator, - tokenComment, - tokenError - }; - - class Token { - public: - TokenType type_; - Location start_; - Location end_; - }; - - class ErrorInfo { - public: - Token token_; - std::string message_; - Location extra_; - }; - - typedef std::deque Errors; - - bool readToken(Token& token); - void skipSpaces(); - bool match(Location pattern, int patternLength); - bool readComment(); - bool readCStyleComment(); - bool readCppStyleComment(); - bool readString(); - bool readStringSingleQuote(); - void readNumber(); - bool readValue(); - bool readObject(Token& token); - bool readArray(Token& token); - bool decodeNumber(Token& token); - bool decodeNumber(Token& token, Value& decoded); - bool decodeString(Token& token); - bool decodeString(Token& token, std::string& decoded); - bool decodeDouble(Token& token); - bool decodeDouble(Token& token, Value& decoded); - bool decodeUnicodeCodePoint(Token& token, - Location& current, - Location end, - unsigned int& unicode); - bool decodeUnicodeEscapeSequence(Token& token, - Location& current, - Location end, - unsigned int& unicode); - bool addError(const std::string& message, Token& token, Location extra = 0); - bool recoverFromError(TokenType skipUntilToken); - bool addErrorAndRecover(const std::string& message, - Token& token, - TokenType skipUntilToken); - void skipUntilSpace(); - Value& currentValue(); - Char getNextChar(); - void - getLocationLineAndColumn(Location location, int& line, int& column) const; - std::string getLocationLineAndColumn(Location location) const; - void addComment(Location begin, Location end, CommentPlacement placement); - void skipCommentTokens(Token& token); - - typedef std::stack Nodes; - Nodes nodes_; - Errors errors_; - std::string document_; - Location begin_; - Location end_; - Location current_; - Location lastValueEnd_; - Value* lastValue_; - std::string commentsBefore_; - int stackDepth_; - - OurFeatures const features_; - bool collectComments_; -}; // OurReader - -// complete copy of Read impl, for OurReader - -OurReader::OurReader(OurFeatures const& features) - : errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(), - lastValue_(), commentsBefore_(), features_(features), collectComments_() { -} - -bool OurReader::parse(const char* beginDoc, - const char* endDoc, - Value& root, - bool collectComments) { - if (!features_.allowComments_) { - collectComments = false; - } - - begin_ = beginDoc; - end_ = endDoc; - collectComments_ = collectComments; - current_ = begin_; - lastValueEnd_ = 0; - lastValue_ = 0; - commentsBefore_ = ""; - errors_.clear(); - while (!nodes_.empty()) - nodes_.pop(); - nodes_.push(&root); - - stackDepth_ = 0; - bool successful = readValue(); - Token token; - skipCommentTokens(token); - if (features_.failIfExtra_) { - if (token.type_ != tokenError && token.type_ != tokenEndOfStream) { - addError("Extra non-whitespace after JSON value.", token); - return false; - } - } - if (collectComments_ && !commentsBefore_.empty()) - root.setComment(commentsBefore_, commentAfter); - if (features_.strictRoot_) { - if (!root.isArray() && !root.isObject()) { - // Set error location to start of doc, ideally should be first token found - // in doc - token.type_ = tokenError; - token.start_ = beginDoc; - token.end_ = endDoc; - addError( - "A valid JSON document must be either an array or an object value.", - token); - return false; - } - } - return successful; -} - -bool OurReader::readValue() { - if (stackDepth_ >= features_.stackLimit_) throwRuntimeError("Exceeded stackLimit in readValue()."); - ++stackDepth_; - Token token; - skipCommentTokens(token); - bool successful = true; - - if (collectComments_ && !commentsBefore_.empty()) { - currentValue().setComment(commentsBefore_, commentBefore); - commentsBefore_ = ""; - } - - switch (token.type_) { - case tokenObjectBegin: - successful = readObject(token); - currentValue().setOffsetLimit(current_ - begin_); - break; - case tokenArrayBegin: - successful = readArray(token); - currentValue().setOffsetLimit(current_ - begin_); - break; - case tokenNumber: - successful = decodeNumber(token); - break; - case tokenString: - successful = decodeString(token); - break; - case tokenTrue: - { - Value v(true); - currentValue().swapPayload(v); - currentValue().setOffsetStart(token.start_ - begin_); - currentValue().setOffsetLimit(token.end_ - begin_); - } - break; - case tokenFalse: - { - Value v(false); - currentValue().swapPayload(v); - currentValue().setOffsetStart(token.start_ - begin_); - currentValue().setOffsetLimit(token.end_ - begin_); - } - break; - case tokenNull: - { - Value v; - currentValue().swapPayload(v); - currentValue().setOffsetStart(token.start_ - begin_); - currentValue().setOffsetLimit(token.end_ - begin_); - } - break; - case tokenArraySeparator: - case tokenObjectEnd: - case tokenArrayEnd: - if (features_.allowDroppedNullPlaceholders_) { - // "Un-read" the current token and mark the current value as a null - // token. - current_--; - Value v; - currentValue().swapPayload(v); - currentValue().setOffsetStart(current_ - begin_ - 1); - currentValue().setOffsetLimit(current_ - begin_); - break; - } // else, fall through ... - default: - currentValue().setOffsetStart(token.start_ - begin_); - currentValue().setOffsetLimit(token.end_ - begin_); - return addError("Syntax error: value, object or array expected.", token); - } - - if (collectComments_) { - lastValueEnd_ = current_; - lastValue_ = ¤tValue(); - } - - --stackDepth_; - return successful; -} - -void OurReader::skipCommentTokens(Token& token) { - if (features_.allowComments_) { - do { - readToken(token); - } while (token.type_ == tokenComment); - } else { - readToken(token); - } -} - -bool OurReader::readToken(Token& token) { - skipSpaces(); - token.start_ = current_; - Char c = getNextChar(); - bool ok = true; - switch (c) { - case '{': - token.type_ = tokenObjectBegin; - break; - case '}': - token.type_ = tokenObjectEnd; - break; - case '[': - token.type_ = tokenArrayBegin; - break; - case ']': - token.type_ = tokenArrayEnd; - break; - case '"': - token.type_ = tokenString; - ok = readString(); - break; - case '\'': - if (features_.allowSingleQuotes_) { - token.type_ = tokenString; - ok = readStringSingleQuote(); - break; - } // else continue - case '/': - token.type_ = tokenComment; - ok = readComment(); - break; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case '-': - token.type_ = tokenNumber; - readNumber(); - break; - case 't': - token.type_ = tokenTrue; - ok = match("rue", 3); - break; - case 'f': - token.type_ = tokenFalse; - ok = match("alse", 4); - break; - case 'n': - token.type_ = tokenNull; - ok = match("ull", 3); - break; - case ',': - token.type_ = tokenArraySeparator; - break; - case ':': - token.type_ = tokenMemberSeparator; - break; - case 0: - token.type_ = tokenEndOfStream; - break; - default: - ok = false; - break; - } - if (!ok) - token.type_ = tokenError; - token.end_ = current_; - return true; -} - -void OurReader::skipSpaces() { - while (current_ != end_) { - Char c = *current_; - if (c == ' ' || c == '\t' || c == '\r' || c == '\n') - ++current_; - else - break; - } -} - -bool OurReader::match(Location pattern, int patternLength) { - if (end_ - current_ < patternLength) - return false; - int index = patternLength; - while (index--) - if (current_[index] != pattern[index]) - return false; - current_ += patternLength; - return true; -} - -bool OurReader::readComment() { - Location commentBegin = current_ - 1; - Char c = getNextChar(); - bool successful = false; - if (c == '*') - successful = readCStyleComment(); - else if (c == '/') - successful = readCppStyleComment(); - if (!successful) - return false; - - if (collectComments_) { - CommentPlacement placement = commentBefore; - if (lastValueEnd_ && !containsNewLine(lastValueEnd_, commentBegin)) { - if (c != '*' || !containsNewLine(commentBegin, current_)) - placement = commentAfterOnSameLine; - } - - addComment(commentBegin, current_, placement); - } - return true; -} - -void -OurReader::addComment(Location begin, Location end, CommentPlacement placement) { - assert(collectComments_); - const std::string& normalized = normalizeEOL(begin, end); - if (placement == commentAfterOnSameLine) { - assert(lastValue_ != 0); - lastValue_->setComment(normalized, placement); - } else { - commentsBefore_ += normalized; - } -} - -bool OurReader::readCStyleComment() { - while (current_ != end_) { - Char c = getNextChar(); - if (c == '*' && *current_ == '/') - break; - } - return getNextChar() == '/'; -} - -bool OurReader::readCppStyleComment() { - while (current_ != end_) { - Char c = getNextChar(); - if (c == '\n') - break; - if (c == '\r') { - // Consume DOS EOL. It will be normalized in addComment. - if (current_ != end_ && *current_ == '\n') - getNextChar(); - // Break on Moc OS 9 EOL. - break; - } - } - return true; -} - -void OurReader::readNumber() { - const char *p = current_; - char c = '0'; // stopgap for already consumed character - // integral part - while (c >= '0' && c <= '9') - c = (current_ = p) < end_ ? *p++ : 0; - // fractional part - if (c == '.') { - c = (current_ = p) < end_ ? *p++ : 0; - while (c >= '0' && c <= '9') - c = (current_ = p) < end_ ? *p++ : 0; - } - // exponential part - if (c == 'e' || c == 'E') { - c = (current_ = p) < end_ ? *p++ : 0; - if (c == '+' || c == '-') - c = (current_ = p) < end_ ? *p++ : 0; - while (c >= '0' && c <= '9') - c = (current_ = p) < end_ ? *p++ : 0; - } -} -bool OurReader::readString() { - Char c = 0; - while (current_ != end_) { - c = getNextChar(); - if (c == '\\') - getNextChar(); - else if (c == '"') - break; - } - return c == '"'; -} - - -bool OurReader::readStringSingleQuote() { - Char c = 0; - while (current_ != end_) { - c = getNextChar(); - if (c == '\\') - getNextChar(); - else if (c == '\'') - break; - } - return c == '\''; -} - -bool OurReader::readObject(Token& tokenStart) { - Token tokenName; - std::string name; - Value init(objectValue); - currentValue().swapPayload(init); - currentValue().setOffsetStart(tokenStart.start_ - begin_); - while (readToken(tokenName)) { - bool initialTokenOk = true; - while (tokenName.type_ == tokenComment && initialTokenOk) - initialTokenOk = readToken(tokenName); - if (!initialTokenOk) - break; - if (tokenName.type_ == tokenObjectEnd && name.empty()) // empty object - return true; - name = ""; - if (tokenName.type_ == tokenString) { - if (!decodeString(tokenName, name)) - return recoverFromError(tokenObjectEnd); - } else if (tokenName.type_ == tokenNumber && features_.allowNumericKeys_) { - Value numberName; - if (!decodeNumber(tokenName, numberName)) - return recoverFromError(tokenObjectEnd); - name = numberName.asString(); - } else { - break; - } - - Token colon; - if (!readToken(colon) || colon.type_ != tokenMemberSeparator) { - return addErrorAndRecover( - "Missing ':' after object member name", colon, tokenObjectEnd); - } - if (name.length() >= (1U<<30)) throwRuntimeError("keylength >= 2^30"); - if (features_.rejectDupKeys_ && currentValue().isMember(name)) { - std::string msg = "Duplicate key: '" + name + "'"; - return addErrorAndRecover( - msg, tokenName, tokenObjectEnd); - } - Value& value = currentValue()[name]; - nodes_.push(&value); - bool ok = readValue(); - nodes_.pop(); - if (!ok) // error already set - return recoverFromError(tokenObjectEnd); - - Token comma; - if (!readToken(comma) || - (comma.type_ != tokenObjectEnd && comma.type_ != tokenArraySeparator && - comma.type_ != tokenComment)) { - return addErrorAndRecover( - "Missing ',' or '}' in object declaration", comma, tokenObjectEnd); - } - bool finalizeTokenOk = true; - while (comma.type_ == tokenComment && finalizeTokenOk) - finalizeTokenOk = readToken(comma); - if (comma.type_ == tokenObjectEnd) - return true; - } - return addErrorAndRecover( - "Missing '}' or object member name", tokenName, tokenObjectEnd); -} - -bool OurReader::readArray(Token& tokenStart) { - Value init(arrayValue); - currentValue().swapPayload(init); - currentValue().setOffsetStart(tokenStart.start_ - begin_); - skipSpaces(); - if (*current_ == ']') // empty array - { - Token endArray; - readToken(endArray); - return true; - } - int index = 0; - for (;;) { - Value& value = currentValue()[index++]; - nodes_.push(&value); - bool ok = readValue(); - nodes_.pop(); - if (!ok) // error already set - return recoverFromError(tokenArrayEnd); - - Token token; - // Accept Comment after last item in the array. - ok = readToken(token); - while (token.type_ == tokenComment && ok) { - ok = readToken(token); - } - bool badTokenType = - (token.type_ != tokenArraySeparator && token.type_ != tokenArrayEnd); - if (!ok || badTokenType) { - return addErrorAndRecover( - "Missing ',' or ']' in array declaration", token, tokenArrayEnd); - } - if (token.type_ == tokenArrayEnd) - break; - } - return true; -} - -bool OurReader::decodeNumber(Token& token) { - Value decoded; - if (!decodeNumber(token, decoded)) - return false; - currentValue().swapPayload(decoded); - currentValue().setOffsetStart(token.start_ - begin_); - currentValue().setOffsetLimit(token.end_ - begin_); - return true; -} - -bool OurReader::decodeNumber(Token& token, Value& decoded) { - // Attempts to parse the number as an integer. If the number is - // larger than the maximum supported value of an integer then - // we decode the number as a double. - Location current = token.start_; - bool isNegative = *current == '-'; - if (isNegative) - ++current; - // TODO: Help the compiler do the div and mod at compile time or get rid of them. - Value::LargestUInt maxIntegerValue = - isNegative ? Value::LargestUInt(-Value::minLargestInt) - : Value::maxLargestUInt; - Value::LargestUInt threshold = maxIntegerValue / 10; - Value::LargestUInt value = 0; - while (current < token.end_) { - Char c = *current++; - if (c < '0' || c > '9') - return decodeDouble(token, decoded); - Value::UInt digit(c - '0'); - if (value >= threshold) { - // We've hit or exceeded the max value divided by 10 (rounded down). If - // a) we've only just touched the limit, b) this is the last digit, and - // c) it's small enough to fit in that rounding delta, we're okay. - // Otherwise treat this number as a double to avoid overflow. - if (value > threshold || current != token.end_ || - digit > maxIntegerValue % 10) { - return decodeDouble(token, decoded); - } - } - value = value * 10 + digit; - } - if (isNegative) - decoded = -Value::LargestInt(value); - else if (value <= Value::LargestUInt(Value::maxInt)) - decoded = Value::LargestInt(value); - else - decoded = value; - return true; -} - -bool OurReader::decodeDouble(Token& token) { - Value decoded; - if (!decodeDouble(token, decoded)) - return false; - currentValue().swapPayload(decoded); - currentValue().setOffsetStart(token.start_ - begin_); - currentValue().setOffsetLimit(token.end_ - begin_); - return true; -} - -bool OurReader::decodeDouble(Token& token, Value& decoded) { - double value = 0; - const int bufferSize = 32; - int count; - int length = int(token.end_ - token.start_); - - // Sanity check to avoid buffer overflow exploits. - if (length < 0) { - return addError("Unable to parse token length", token); - } - - // Avoid using a string constant for the format control string given to - // sscanf, as this can cause hard to debug crashes on OS X. See here for more - // info: - // - // http://developer.apple.com/library/mac/#DOCUMENTATION/DeveloperTools/gcc-4.0.1/gcc/Incompatibilities.html - char format[] = "%lf"; - - if (length <= bufferSize) { - Char buffer[bufferSize + 1]; - memcpy(buffer, token.start_, length); - buffer[length] = 0; - count = sscanf(buffer, format, &value); - } else { - std::string buffer(token.start_, token.end_); - count = sscanf(buffer.c_str(), format, &value); - } - - if (count != 1) - return addError("'" + std::string(token.start_, token.end_) + - "' is not a number.", - token); - decoded = value; - return true; -} - -bool OurReader::decodeString(Token& token) { - std::string decoded_string; - if (!decodeString(token, decoded_string)) - return false; - Value decoded(decoded_string); - currentValue().swapPayload(decoded); - currentValue().setOffsetStart(token.start_ - begin_); - currentValue().setOffsetLimit(token.end_ - begin_); - return true; -} - -bool OurReader::decodeString(Token& token, std::string& decoded) { - decoded.reserve(token.end_ - token.start_ - 2); - Location current = token.start_ + 1; // skip '"' - Location end = token.end_ - 1; // do not include '"' - while (current != end) { - Char c = *current++; - if (c == '"') - break; - else if (c == '\\') { - if (current == end) - return addError("Empty escape sequence in string", token, current); - Char escape = *current++; - switch (escape) { - case '"': - decoded += '"'; - break; - case '/': - decoded += '/'; - break; - case '\\': - decoded += '\\'; - break; - case 'b': - decoded += '\b'; - break; - case 'f': - decoded += '\f'; - break; - case 'n': - decoded += '\n'; - break; - case 'r': - decoded += '\r'; - break; - case 't': - decoded += '\t'; - break; - case 'u': { - unsigned int unicode; - if (!decodeUnicodeCodePoint(token, current, end, unicode)) - return false; - decoded += codePointToUTF8(unicode); - } break; - default: - return addError("Bad escape sequence in string", token, current); - } - } else { - decoded += c; - } - } - return true; -} - -bool OurReader::decodeUnicodeCodePoint(Token& token, - Location& current, - Location end, - unsigned int& unicode) { - - if (!decodeUnicodeEscapeSequence(token, current, end, unicode)) - return false; - if (unicode >= 0xD800 && unicode <= 0xDBFF) { - // surrogate pairs - if (end - current < 6) - return addError( - "additional six characters expected to parse unicode surrogate pair.", - token, - current); - unsigned int surrogatePair; - if (*(current++) == '\\' && *(current++) == 'u') { - if (decodeUnicodeEscapeSequence(token, current, end, surrogatePair)) { - unicode = 0x10000 + ((unicode & 0x3FF) << 10) + (surrogatePair & 0x3FF); - } else - return false; - } else - return addError("expecting another \\u token to begin the second half of " - "a unicode surrogate pair", - token, - current); - } - return true; -} - -bool OurReader::decodeUnicodeEscapeSequence(Token& token, - Location& current, - Location end, - unsigned int& unicode) { - if (end - current < 4) - return addError( - "Bad unicode escape sequence in string: four digits expected.", - token, - current); - unicode = 0; - for (int index = 0; index < 4; ++index) { - Char c = *current++; - unicode *= 16; - if (c >= '0' && c <= '9') - unicode += c - '0'; - else if (c >= 'a' && c <= 'f') - unicode += c - 'a' + 10; - else if (c >= 'A' && c <= 'F') - unicode += c - 'A' + 10; - else - return addError( - "Bad unicode escape sequence in string: hexadecimal digit expected.", - token, - current); - } - return true; -} - -bool -OurReader::addError(const std::string& message, Token& token, Location extra) { - ErrorInfo info; - info.token_ = token; - info.message_ = message; - info.extra_ = extra; - errors_.push_back(info); - return false; -} - -bool OurReader::recoverFromError(TokenType skipUntilToken) { - int errorCount = int(errors_.size()); - Token skip; - for (;;) { - if (!readToken(skip)) - errors_.resize(errorCount); // discard errors caused by recovery - if (skip.type_ == skipUntilToken || skip.type_ == tokenEndOfStream) - break; - } - errors_.resize(errorCount); - return false; -} - -bool OurReader::addErrorAndRecover(const std::string& message, - Token& token, - TokenType skipUntilToken) { - addError(message, token); - return recoverFromError(skipUntilToken); -} - -Value& OurReader::currentValue() { return *(nodes_.top()); } - -OurReader::Char OurReader::getNextChar() { - if (current_ == end_) - return 0; - return *current_++; -} - -void OurReader::getLocationLineAndColumn(Location location, - int& line, - int& column) const { - Location current = begin_; - Location lastLineStart = current; - line = 0; - while (current < location && current != end_) { - Char c = *current++; - if (c == '\r') { - if (*current == '\n') - ++current; - lastLineStart = current; - ++line; - } else if (c == '\n') { - lastLineStart = current; - ++line; - } - } - // column & line start at 1 - column = int(location - lastLineStart) + 1; - ++line; -} - -std::string OurReader::getLocationLineAndColumn(Location location) const { - int line, column; - getLocationLineAndColumn(location, line, column); - char buffer[18 + 16 + 16 + 1]; -#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) -#if defined(WINCE) - _snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column); -#else - sprintf_s(buffer, sizeof(buffer), "Line %d, Column %d", line, column); -#endif -#else - snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column); -#endif - return buffer; -} - -std::string OurReader::getFormattedErrorMessages() const { - std::string formattedMessage; - for (Errors::const_iterator itError = errors_.begin(); - itError != errors_.end(); - ++itError) { - const ErrorInfo& error = *itError; - formattedMessage += - "* " + getLocationLineAndColumn(error.token_.start_) + "\n"; - formattedMessage += " " + error.message_ + "\n"; - if (error.extra_) - formattedMessage += - "See " + getLocationLineAndColumn(error.extra_) + " for detail.\n"; - } - return formattedMessage; -} - -std::vector OurReader::getStructuredErrors() const { - std::vector allErrors; - for (Errors::const_iterator itError = errors_.begin(); - itError != errors_.end(); - ++itError) { - const ErrorInfo& error = *itError; - OurReader::StructuredError structured; - structured.offset_start = error.token_.start_ - begin_; - structured.offset_limit = error.token_.end_ - begin_; - structured.message = error.message_; - allErrors.push_back(structured); - } - return allErrors; -} - -bool OurReader::pushError(const Value& value, const std::string& message) { - size_t length = end_ - begin_; - if(value.getOffsetStart() > length - || value.getOffsetLimit() > length) - return false; - Token token; - token.type_ = tokenError; - token.start_ = begin_ + value.getOffsetStart(); - token.end_ = end_ + value.getOffsetLimit(); - ErrorInfo info; - info.token_ = token; - info.message_ = message; - info.extra_ = 0; - errors_.push_back(info); - return true; -} - -bool OurReader::pushError(const Value& value, const std::string& message, const Value& extra) { - size_t length = end_ - begin_; - if(value.getOffsetStart() > length - || value.getOffsetLimit() > length - || extra.getOffsetLimit() > length) - return false; - Token token; - token.type_ = tokenError; - token.start_ = begin_ + value.getOffsetStart(); - token.end_ = begin_ + value.getOffsetLimit(); - ErrorInfo info; - info.token_ = token; - info.message_ = message; - info.extra_ = begin_ + extra.getOffsetStart(); - errors_.push_back(info); - return true; -} - -bool OurReader::good() const { - return !errors_.size(); -} - - -class OurCharReader : public CharReader { - bool const collectComments_; - OurReader reader_; -public: - OurCharReader( - bool collectComments, - OurFeatures const& features) - : collectComments_(collectComments) - , reader_(features) - {} - virtual bool parse( - char const* beginDoc, char const* endDoc, - Value* root, std::string* errs) { - bool ok = reader_.parse(beginDoc, endDoc, *root, collectComments_); - if (errs) { - *errs = reader_.getFormattedErrorMessages(); - } - return ok; - } -}; - -CharReaderBuilder::CharReaderBuilder() -{ - setDefaults(&settings_); -} -CharReaderBuilder::~CharReaderBuilder() -{} -CharReader* CharReaderBuilder::newCharReader() const -{ - bool collectComments = settings_["collectComments"].asBool(); - OurFeatures features = OurFeatures::all(); - features.allowComments_ = settings_["allowComments"].asBool(); - features.strictRoot_ = settings_["strictRoot"].asBool(); - features.allowDroppedNullPlaceholders_ = settings_["allowDroppedNullPlaceholders"].asBool(); - features.allowNumericKeys_ = settings_["allowNumericKeys"].asBool(); - features.allowSingleQuotes_ = settings_["allowSingleQuotes"].asBool(); - features.stackLimit_ = settings_["stackLimit"].asInt(); - features.failIfExtra_ = settings_["failIfExtra"].asBool(); - features.rejectDupKeys_ = settings_["rejectDupKeys"].asBool(); - return new OurCharReader(collectComments, features); -} -static void getValidReaderKeys(std::set* valid_keys) -{ - valid_keys->clear(); - valid_keys->insert("collectComments"); - valid_keys->insert("allowComments"); - valid_keys->insert("strictRoot"); - valid_keys->insert("allowDroppedNullPlaceholders"); - valid_keys->insert("allowNumericKeys"); - valid_keys->insert("allowSingleQuotes"); - valid_keys->insert("stackLimit"); - valid_keys->insert("failIfExtra"); - valid_keys->insert("rejectDupKeys"); -} -bool CharReaderBuilder::validate(Json::Value* invalid) const -{ - Json::Value my_invalid; - if (!invalid) invalid = &my_invalid; // so we do not need to test for NULL - Json::Value& inv = *invalid; - std::set valid_keys; - getValidReaderKeys(&valid_keys); - Value::Members keys = settings_.getMemberNames(); - size_t n = keys.size(); - for (size_t i = 0; i < n; ++i) { - std::string const& key = keys[i]; - if (valid_keys.find(key) == valid_keys.end()) { - inv[key] = settings_[key]; - } - } - return 0u == inv.size(); -} -Value& CharReaderBuilder::operator[](std::string key) -{ - return settings_[key]; -} -// static -void CharReaderBuilder::strictMode(Json::Value* settings) -{ -//! [CharReaderBuilderStrictMode] - (*settings)["allowComments"] = false; - (*settings)["strictRoot"] = true; - (*settings)["allowDroppedNullPlaceholders"] = false; - (*settings)["allowNumericKeys"] = false; - (*settings)["allowSingleQuotes"] = false; - (*settings)["failIfExtra"] = true; - (*settings)["rejectDupKeys"] = true; -//! [CharReaderBuilderStrictMode] -} -// static -void CharReaderBuilder::setDefaults(Json::Value* settings) -{ -//! [CharReaderBuilderDefaults] - (*settings)["collectComments"] = true; - (*settings)["allowComments"] = true; - (*settings)["strictRoot"] = false; - (*settings)["allowDroppedNullPlaceholders"] = false; - (*settings)["allowNumericKeys"] = false; - (*settings)["allowSingleQuotes"] = false; - (*settings)["stackLimit"] = 1000; - (*settings)["failIfExtra"] = false; - (*settings)["rejectDupKeys"] = false; -//! [CharReaderBuilderDefaults] -} - -////////////////////////////////// -// global functions - -bool parseFromStream( - CharReader::Factory const& fact, std::istream& sin, - Value* root, std::string* errs) -{ - std::ostringstream ssin; - ssin << sin.rdbuf(); - std::string doc = ssin.str(); - char const* begin = doc.data(); - char const* end = begin + doc.size(); - // Note that we do not actually need a null-terminator. - CharReaderPtr const reader(fact.newCharReader()); - return reader->parse(begin, end, root, errs); -} - -std::istream& operator>>(std::istream& sin, Value& root) { - CharReaderBuilder b; - std::string errs; - bool ok = parseFromStream(b, sin, &root, &errs); - if (!ok) { - fprintf(stderr, - "Error from reader: %s", - errs.c_str()); - - throwRuntimeError("reader error"); - } - return sin; -} - -} // namespace Json - -// ////////////////////////////////////////////////////////////////////// -// End of content of file: src/lib_json/json_reader.cpp -// ////////////////////////////////////////////////////////////////////// - - - - - - -// ////////////////////////////////////////////////////////////////////// -// Beginning of content of file: src/lib_json/json_valueiterator.inl -// ////////////////////////////////////////////////////////////////////// - -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -// included by json_value.cpp - -namespace Json { - -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// -// class ValueIteratorBase -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// - -ValueIteratorBase::ValueIteratorBase() - : current_(), isNull_(true) { -} - -ValueIteratorBase::ValueIteratorBase( - const Value::ObjectValues::iterator& current) - : current_(current), isNull_(false) {} - -Value& ValueIteratorBase::deref() const { - return current_->second; -} - -void ValueIteratorBase::increment() { - ++current_; -} - -void ValueIteratorBase::decrement() { - --current_; -} - -ValueIteratorBase::difference_type -ValueIteratorBase::computeDistance(const SelfType& other) const { -#ifdef JSON_USE_CPPTL_SMALLMAP - return other.current_ - current_; -#else - // Iterator for null value are initialized using the default - // constructor, which initialize current_ to the default - // std::map::iterator. As begin() and end() are two instance - // of the default std::map::iterator, they can not be compared. - // To allow this, we handle this comparison specifically. - if (isNull_ && other.isNull_) { - return 0; - } - - // Usage of std::distance is not portable (does not compile with Sun Studio 12 - // RogueWave STL, - // which is the one used by default). - // Using a portable hand-made version for non random iterator instead: - // return difference_type( std::distance( current_, other.current_ ) ); - difference_type myDistance = 0; - for (Value::ObjectValues::iterator it = current_; it != other.current_; - ++it) { - ++myDistance; - } - return myDistance; -#endif -} - -bool ValueIteratorBase::isEqual(const SelfType& other) const { - if (isNull_) { - return other.isNull_; - } - return current_ == other.current_; -} - -void ValueIteratorBase::copy(const SelfType& other) { - current_ = other.current_; - isNull_ = other.isNull_; -} - -Value ValueIteratorBase::key() const { - const Value::CZString czstring = (*current_).first; - if (czstring.data()) { - if (czstring.isStaticString()) - return Value(StaticString(czstring.data())); - return Value(czstring.data(), czstring.data() + czstring.length()); - } - return Value(czstring.index()); -} - -UInt ValueIteratorBase::index() const { - const Value::CZString czstring = (*current_).first; - if (!czstring.data()) - return czstring.index(); - return Value::UInt(-1); -} - -std::string ValueIteratorBase::name() const { - char const* key; - char const* end; - key = memberName(&end); - if (!key) return std::string(); - return std::string(key, end); -} - -char const* ValueIteratorBase::memberName() const { - const char* name = (*current_).first.data(); - return name ? name : ""; -} - -char const* ValueIteratorBase::memberName(char const** end) const { - const char* name = (*current_).first.data(); - if (!name) { - *end = NULL; - return NULL; - } - *end = name + (*current_).first.length(); - return name; -} - -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// -// class ValueConstIterator -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// - -ValueConstIterator::ValueConstIterator() {} - -ValueConstIterator::ValueConstIterator( - const Value::ObjectValues::iterator& current) - : ValueIteratorBase(current) {} - -ValueConstIterator& ValueConstIterator:: -operator=(const ValueIteratorBase& other) { - copy(other); - return *this; -} - -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// -// class ValueIterator -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// - -ValueIterator::ValueIterator() {} - -ValueIterator::ValueIterator(const Value::ObjectValues::iterator& current) - : ValueIteratorBase(current) {} - -ValueIterator::ValueIterator(const ValueConstIterator& other) - : ValueIteratorBase(other) {} - -ValueIterator::ValueIterator(const ValueIterator& other) - : ValueIteratorBase(other) {} - -ValueIterator& ValueIterator::operator=(const SelfType& other) { - copy(other); - return *this; -} - -} // namespace Json - -// ////////////////////////////////////////////////////////////////////// -// End of content of file: src/lib_json/json_valueiterator.inl -// ////////////////////////////////////////////////////////////////////// - - - - - - -// ////////////////////////////////////////////////////////////////////// -// Beginning of content of file: src/lib_json/json_value.cpp -// ////////////////////////////////////////////////////////////////////// - -// Copyright 2011 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#if !defined(JSON_IS_AMALGAMATION) -#include -#include -#include -#endif // if !defined(JSON_IS_AMALGAMATION) -#include -#include -#include -#include -#include -#ifdef JSON_USE_CPPTL -#include -#endif -#include // size_t -#include // min() - -#define JSON_ASSERT_UNREACHABLE assert(false) - -namespace Json { - -// This is a walkaround to avoid the static initialization of Value::null. -// kNull must be word-aligned to avoid crashing on ARM. We use an alignment of -// 8 (instead of 4) as a bit of future-proofing. -#if defined(__ARMEL__) -#define ALIGNAS(byte_alignment) __attribute__((aligned(byte_alignment))) -#else -#define ALIGNAS(byte_alignment) -#endif -static const unsigned char ALIGNAS(8) kNull[sizeof(Value)] = { 0 }; -const unsigned char& kNullRef = kNull[0]; -const Value& Value::null = reinterpret_cast(kNullRef); -const Value& Value::nullRef = null; - -const Int Value::minInt = Int(~(UInt(-1) / 2)); -const Int Value::maxInt = Int(UInt(-1) / 2); -const UInt Value::maxUInt = UInt(-1); -#if defined(JSON_HAS_INT64) -const Int64 Value::minInt64 = Int64(~(UInt64(-1) / 2)); -const Int64 Value::maxInt64 = Int64(UInt64(-1) / 2); -const UInt64 Value::maxUInt64 = UInt64(-1); -// The constant is hard-coded because some compiler have trouble -// converting Value::maxUInt64 to a double correctly (AIX/xlC). -// Assumes that UInt64 is a 64 bits integer. -static const double maxUInt64AsDouble = 18446744073709551615.0; -#endif // defined(JSON_HAS_INT64) -const LargestInt Value::minLargestInt = LargestInt(~(LargestUInt(-1) / 2)); -const LargestInt Value::maxLargestInt = LargestInt(LargestUInt(-1) / 2); -const LargestUInt Value::maxLargestUInt = LargestUInt(-1); - -#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) -template -static inline bool InRange(double d, T min, U max) { - return d >= min && d <= max; -} -#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) -static inline double integerToDouble(Json::UInt64 value) { - return static_cast(Int64(value / 2)) * 2.0 + Int64(value & 1); -} - -template static inline double integerToDouble(T value) { - return static_cast(value); -} - -template -static inline bool InRange(double d, T min, U max) { - return d >= integerToDouble(min) && d <= integerToDouble(max); -} -#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) - -/** Duplicates the specified string value. - * @param value Pointer to the string to duplicate. Must be zero-terminated if - * length is "unknown". - * @param length Length of the value. if equals to unknown, then it will be - * computed using strlen(value). - * @return Pointer on the duplicate instance of string. - */ -static inline char* duplicateStringValue(const char* value, - size_t length) { - // Avoid an integer overflow in the call to malloc below by limiting length - // to a sane value. - if (length >= (size_t)Value::maxInt) - length = Value::maxInt - 1; - - char* newString = static_cast(malloc(length + 1)); - if (newString == NULL) { - throwRuntimeError( - "in Json::Value::duplicateStringValue(): " - "Failed to allocate string value buffer"); - } - memcpy(newString, value, length); - newString[length] = 0; - return newString; -} - -/* Record the length as a prefix. - */ -static inline char* duplicateAndPrefixStringValue( - const char* value, - unsigned int length) -{ - // Avoid an integer overflow in the call to malloc below by limiting length - // to a sane value. - JSON_ASSERT_MESSAGE(length <= (unsigned)Value::maxInt - sizeof(unsigned) - 1U, - "in Json::Value::duplicateAndPrefixStringValue(): " - "length too big for prefixing"); - unsigned actualLength = length + sizeof(unsigned) + 1U; - char* newString = static_cast(malloc(actualLength)); - if (newString == 0) { - throwRuntimeError( - "in Json::Value::duplicateAndPrefixStringValue(): " - "Failed to allocate string value buffer"); - } - *reinterpret_cast(newString) = length; - memcpy(newString + sizeof(unsigned), value, length); - newString[actualLength - 1U] = 0; // to avoid buffer over-run accidents by users later - return newString; -} -inline static void decodePrefixedString( - bool isPrefixed, char const* prefixed, - unsigned* length, char const** value) -{ - if (!isPrefixed) { - *length = strlen(prefixed); - *value = prefixed; - } else { - *length = *reinterpret_cast(prefixed); - *value = prefixed + sizeof(unsigned); - } -} -/** Free the string duplicated by duplicateStringValue()/duplicateAndPrefixStringValue(). - */ -static inline void releaseStringValue(char* value) { free(value); } - -} // namespace Json - -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// -// ValueInternals... -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// -#if !defined(JSON_IS_AMALGAMATION) - -#include "json_valueiterator.inl" -#endif // if !defined(JSON_IS_AMALGAMATION) - -namespace Json { - -class JSON_API Exception : public std::exception { -public: - Exception(std::string const& msg); - virtual ~Exception() throw(); - virtual char const* what() const throw(); -protected: - std::string const msg_; -}; -class JSON_API RuntimeError : public Exception { -public: - RuntimeError(std::string const& msg); -}; -class JSON_API LogicError : public Exception { -public: - LogicError(std::string const& msg); -}; - -Exception::Exception(std::string const& msg) - : msg_(msg) -{} -Exception::~Exception() throw() -{} -char const* Exception::what() const throw() -{ - return msg_.c_str(); -} -RuntimeError::RuntimeError(std::string const& msg) - : Exception(msg) -{} -LogicError::LogicError(std::string const& msg) - : Exception(msg) -{} -void throwRuntimeError(std::string const& msg) -{ - throw RuntimeError(msg); -} -void throwLogicError(std::string const& msg) -{ - throw LogicError(msg); -} - -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// -// class Value::CommentInfo -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// - -Value::CommentInfo::CommentInfo() : comment_(0) {} - -Value::CommentInfo::~CommentInfo() { - if (comment_) - releaseStringValue(comment_); -} - -void Value::CommentInfo::setComment(const char* text, size_t len) { - if (comment_) { - releaseStringValue(comment_); - comment_ = 0; - } - JSON_ASSERT(text != 0); - JSON_ASSERT_MESSAGE( - text[0] == '\0' || text[0] == '/', - "in Json::Value::setComment(): Comments must start with /"); - // It seems that /**/ style comments are acceptable as well. - comment_ = duplicateStringValue(text, len); -} - -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// -// class Value::CZString -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// - -// Notes: policy_ indicates if the string was allocated when -// a string is stored. - -Value::CZString::CZString(ArrayIndex index) : cstr_(0), index_(index) {} - -Value::CZString::CZString(char const* str, unsigned length, DuplicationPolicy allocate) - : cstr_(str) -{ - // allocate != duplicate - storage_.policy_ = allocate; - storage_.length_ = length; -} - -Value::CZString::CZString(const CZString& other) - : cstr_(other.storage_.policy_ != noDuplication && other.cstr_ != 0 - ? duplicateStringValue(other.cstr_, other.storage_.length_) - : other.cstr_) -{ - storage_.policy_ = (other.cstr_ - ? (other.storage_.policy_ == noDuplication - ? noDuplication : duplicate) - : other.storage_.policy_); - storage_.length_ = other.storage_.length_; -} - -Value::CZString::~CZString() { - if (cstr_ && storage_.policy_ == duplicate) - releaseStringValue(const_cast(cstr_)); -} - -void Value::CZString::swap(CZString& other) { - std::swap(cstr_, other.cstr_); - std::swap(index_, other.index_); -} - -Value::CZString& Value::CZString::operator=(CZString other) { - swap(other); - return *this; -} - -bool Value::CZString::operator<(const CZString& other) const { - if (!cstr_) return index_ < other.index_; - //return strcmp(cstr_, other.cstr_) < 0; - // Assume both are strings. - unsigned this_len = this->storage_.length_; - unsigned other_len = other.storage_.length_; - unsigned min_len = std::min(this_len, other_len); - int comp = memcmp(this->cstr_, other.cstr_, min_len); - if (comp < 0) return true; - if (comp > 0) return false; - return (this_len < other_len); -} - -bool Value::CZString::operator==(const CZString& other) const { - if (!cstr_) return index_ == other.index_; - //return strcmp(cstr_, other.cstr_) == 0; - // Assume both are strings. - unsigned this_len = this->storage_.length_; - unsigned other_len = other.storage_.length_; - if (this_len != other_len) return false; - int comp = memcmp(this->cstr_, other.cstr_, this_len); - return comp == 0; -} - -ArrayIndex Value::CZString::index() const { return index_; } - -//const char* Value::CZString::c_str() const { return cstr_; } -const char* Value::CZString::data() const { return cstr_; } -unsigned Value::CZString::length() const { return storage_.length_; } -bool Value::CZString::isStaticString() const { return storage_.policy_ == noDuplication; } - -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// -// class Value::Value -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// -// ////////////////////////////////////////////////////////////////// - -/*! \internal Default constructor initialization must be equivalent to: - * memset( this, 0, sizeof(Value) ) - * This optimization is used in ValueInternalMap fast allocator. - */ -Value::Value(ValueType type) { - initBasic(type); - switch (type) { - case nullValue: - break; - case intValue: - case uintValue: - value_.int_ = 0; - break; - case realValue: - value_.real_ = 0.0; - break; - case stringValue: - value_.string_ = 0; - break; - case arrayValue: - case objectValue: - value_.map_ = new ObjectValues(); - break; - case booleanValue: - value_.bool_ = false; - break; - default: - JSON_ASSERT_UNREACHABLE; - } -} - -Value::Value(Int value) { - initBasic(intValue); - value_.int_ = value; -} - -Value::Value(UInt value) { - initBasic(uintValue); - value_.uint_ = value; -} -#if defined(JSON_HAS_INT64) -Value::Value(Int64 value) { - initBasic(intValue); - value_.int_ = value; -} -Value::Value(UInt64 value) { - initBasic(uintValue); - value_.uint_ = value; -} -#endif // defined(JSON_HAS_INT64) - -Value::Value(double value) { - initBasic(realValue); - value_.real_ = value; -} - -Value::Value(const char* value) { - initBasic(stringValue, true); - value_.string_ = duplicateAndPrefixStringValue(value, static_cast(strlen(value))); -} - -Value::Value(const char* beginValue, const char* endValue) { - initBasic(stringValue, true); - value_.string_ = - duplicateAndPrefixStringValue(beginValue, static_cast(endValue - beginValue)); -} - -Value::Value(const std::string& value) { - initBasic(stringValue, true); - value_.string_ = - duplicateAndPrefixStringValue(value.data(), static_cast(value.length())); -} - -Value::Value(const StaticString& value) { - initBasic(stringValue); - value_.string_ = const_cast(value.c_str()); -} - -#ifdef JSON_USE_CPPTL -Value::Value(const CppTL::ConstString& value) { - initBasic(stringValue, true); - value_.string_ = duplicateAndPrefixStringValue(value, static_cast(value.length())); -} -#endif - -Value::Value(bool value) { - initBasic(booleanValue); - value_.bool_ = value; -} - -Value::Value(Value const& other) - : type_(other.type_), allocated_(false) - , - comments_(0), start_(other.start_), limit_(other.limit_) -{ - switch (type_) { - case nullValue: - case intValue: - case uintValue: - case realValue: - case booleanValue: - value_ = other.value_; - break; - case stringValue: - if (other.value_.string_ && other.allocated_) { - unsigned len; - char const* str; - decodePrefixedString(other.allocated_, other.value_.string_, - &len, &str); - value_.string_ = duplicateAndPrefixStringValue(str, len); - allocated_ = true; - } else { - value_.string_ = other.value_.string_; - allocated_ = false; - } - break; - case arrayValue: - case objectValue: - value_.map_ = new ObjectValues(*other.value_.map_); - break; - default: - JSON_ASSERT_UNREACHABLE; - } - if (other.comments_) { - comments_ = new CommentInfo[numberOfCommentPlacement]; - for (int comment = 0; comment < numberOfCommentPlacement; ++comment) { - const CommentInfo& otherComment = other.comments_[comment]; - if (otherComment.comment_) - comments_[comment].setComment( - otherComment.comment_, strlen(otherComment.comment_)); - } - } -} - -Value::~Value() { - switch (type_) { - case nullValue: - case intValue: - case uintValue: - case realValue: - case booleanValue: - break; - case stringValue: - if (allocated_) - releaseStringValue(value_.string_); - break; - case arrayValue: - case objectValue: - delete value_.map_; - break; - default: - JSON_ASSERT_UNREACHABLE; - } - - if (comments_) - delete[] comments_; -} - -Value& Value::operator=(Value other) { - swap(other); - return *this; -} - -void Value::swapPayload(Value& other) { - ValueType temp = type_; - type_ = other.type_; - other.type_ = temp; - std::swap(value_, other.value_); - int temp2 = allocated_; - allocated_ = other.allocated_; - other.allocated_ = temp2; -} - -void Value::swap(Value& other) { - swapPayload(other); - std::swap(comments_, other.comments_); - std::swap(start_, other.start_); - std::swap(limit_, other.limit_); -} - -ValueType Value::type() const { return type_; } - -int Value::compare(const Value& other) const { - if (*this < other) - return -1; - if (*this > other) - return 1; - return 0; -} - -bool Value::operator<(const Value& other) const { - int typeDelta = type_ - other.type_; - if (typeDelta) - return typeDelta < 0 ? true : false; - switch (type_) { - case nullValue: - return false; - case intValue: - return value_.int_ < other.value_.int_; - case uintValue: - return value_.uint_ < other.value_.uint_; - case realValue: - return value_.real_ < other.value_.real_; - case booleanValue: - return value_.bool_ < other.value_.bool_; - case stringValue: - { - if ((value_.string_ == 0) || (other.value_.string_ == 0)) { - if (other.value_.string_) return true; - else return false; - } - unsigned this_len; - unsigned other_len; - char const* this_str; - char const* other_str; - decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str); - decodePrefixedString(other.allocated_, other.value_.string_, &other_len, &other_str); - unsigned min_len = std::min(this_len, other_len); - int comp = memcmp(this_str, other_str, min_len); - if (comp < 0) return true; - if (comp > 0) return false; - return (this_len < other_len); - } - case arrayValue: - case objectValue: { - int delta = int(value_.map_->size() - other.value_.map_->size()); - if (delta) - return delta < 0; - return (*value_.map_) < (*other.value_.map_); - } - default: - JSON_ASSERT_UNREACHABLE; - } - return false; // unreachable -} - -bool Value::operator<=(const Value& other) const { return !(other < *this); } - -bool Value::operator>=(const Value& other) const { return !(*this < other); } - -bool Value::operator>(const Value& other) const { return other < *this; } - -bool Value::operator==(const Value& other) const { - // if ( type_ != other.type_ ) - // GCC 2.95.3 says: - // attempt to take address of bit-field structure member `Json::Value::type_' - // Beats me, but a temp solves the problem. - int temp = other.type_; - if (type_ != temp) - return false; - switch (type_) { - case nullValue: - return true; - case intValue: - return value_.int_ == other.value_.int_; - case uintValue: - return value_.uint_ == other.value_.uint_; - case realValue: - return value_.real_ == other.value_.real_; - case booleanValue: - return value_.bool_ == other.value_.bool_; - case stringValue: - { - if ((value_.string_ == 0) || (other.value_.string_ == 0)) { - return (value_.string_ == other.value_.string_); - } - unsigned this_len; - unsigned other_len; - char const* this_str; - char const* other_str; - decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str); - decodePrefixedString(other.allocated_, other.value_.string_, &other_len, &other_str); - if (this_len != other_len) return false; - int comp = memcmp(this_str, other_str, this_len); - return comp == 0; - } - case arrayValue: - case objectValue: - return value_.map_->size() == other.value_.map_->size() && - (*value_.map_) == (*other.value_.map_); - default: - JSON_ASSERT_UNREACHABLE; - } - return false; // unreachable -} - -bool Value::operator!=(const Value& other) const { return !(*this == other); } - -const char* Value::asCString() const { - JSON_ASSERT_MESSAGE(type_ == stringValue, - "in Json::Value::asCString(): requires stringValue"); - if (value_.string_ == 0) return 0; - unsigned this_len; - char const* this_str; - decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str); - return this_str; -} - -bool Value::getString(char const** str, char const** end) const { - if (type_ != stringValue) return false; - if (value_.string_ == 0) return false; - unsigned length; - decodePrefixedString(this->allocated_, this->value_.string_, &length, str); - *end = *str + length; - return true; -} - -std::string Value::asString() const { - switch (type_) { - case nullValue: - return ""; - case stringValue: - { - if (value_.string_ == 0) return ""; - unsigned this_len; - char const* this_str; - decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str); - return std::string(this_str, this_len); - } - case booleanValue: - return value_.bool_ ? "true" : "false"; - case intValue: - return valueToString(value_.int_); - case uintValue: - return valueToString(value_.uint_); - case realValue: - return valueToString(value_.real_); - default: - JSON_FAIL_MESSAGE("Type is not convertible to string"); - } -} - -#ifdef JSON_USE_CPPTL -CppTL::ConstString Value::asConstString() const { - unsigned len; - char const* str; - decodePrefixedString(allocated_, value_.string_, - &len, &str); - return CppTL::ConstString(str, len); -} -#endif - -Value::Int Value::asInt() const { - switch (type_) { - case intValue: - JSON_ASSERT_MESSAGE(isInt(), "LargestInt out of Int range"); - return Int(value_.int_); - case uintValue: - JSON_ASSERT_MESSAGE(isInt(), "LargestUInt out of Int range"); - return Int(value_.uint_); - case realValue: - JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt, maxInt), - "double out of Int range"); - return Int(value_.real_); - case nullValue: - return 0; - case booleanValue: - return value_.bool_ ? 1 : 0; - default: - break; - } - JSON_FAIL_MESSAGE("Value is not convertible to Int."); -} - -Value::UInt Value::asUInt() const { - switch (type_) { - case intValue: - JSON_ASSERT_MESSAGE(isUInt(), "LargestInt out of UInt range"); - return UInt(value_.int_); - case uintValue: - JSON_ASSERT_MESSAGE(isUInt(), "LargestUInt out of UInt range"); - return UInt(value_.uint_); - case realValue: - JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt), - "double out of UInt range"); - return UInt(value_.real_); - case nullValue: - return 0; - case booleanValue: - return value_.bool_ ? 1 : 0; - default: - break; - } - JSON_FAIL_MESSAGE("Value is not convertible to UInt."); -} - -#if defined(JSON_HAS_INT64) - -Value::Int64 Value::asInt64() const { - switch (type_) { - case intValue: - return Int64(value_.int_); - case uintValue: - JSON_ASSERT_MESSAGE(isInt64(), "LargestUInt out of Int64 range"); - return Int64(value_.uint_); - case realValue: - JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt64, maxInt64), - "double out of Int64 range"); - return Int64(value_.real_); - case nullValue: - return 0; - case booleanValue: - return value_.bool_ ? 1 : 0; - default: - break; - } - JSON_FAIL_MESSAGE("Value is not convertible to Int64."); -} - -Value::UInt64 Value::asUInt64() const { - switch (type_) { - case intValue: - JSON_ASSERT_MESSAGE(isUInt64(), "LargestInt out of UInt64 range"); - return UInt64(value_.int_); - case uintValue: - return UInt64(value_.uint_); - case realValue: - JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt64), - "double out of UInt64 range"); - return UInt64(value_.real_); - case nullValue: - return 0; - case booleanValue: - return value_.bool_ ? 1 : 0; - default: - break; - } - JSON_FAIL_MESSAGE("Value is not convertible to UInt64."); -} -#endif // if defined(JSON_HAS_INT64) - -LargestInt Value::asLargestInt() const { -#if defined(JSON_NO_INT64) - return asInt(); -#else - return asInt64(); -#endif -} - -LargestUInt Value::asLargestUInt() const { -#if defined(JSON_NO_INT64) - return asUInt(); -#else - return asUInt64(); -#endif -} - -double Value::asDouble() const { - switch (type_) { - case intValue: - return static_cast(value_.int_); - case uintValue: -#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) - return static_cast(value_.uint_); -#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) - return integerToDouble(value_.uint_); -#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) - case realValue: - return value_.real_; - case nullValue: - return 0.0; - case booleanValue: - return value_.bool_ ? 1.0 : 0.0; - default: - break; - } - JSON_FAIL_MESSAGE("Value is not convertible to double."); -} - -float Value::asFloat() const { - switch (type_) { - case intValue: - return static_cast(value_.int_); - case uintValue: -#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) - return static_cast(value_.uint_); -#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) - return integerToDouble(value_.uint_); -#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) - case realValue: - return static_cast(value_.real_); - case nullValue: - return 0.0; - case booleanValue: - return value_.bool_ ? 1.0f : 0.0f; - default: - break; - } - JSON_FAIL_MESSAGE("Value is not convertible to float."); -} - -bool Value::asBool() const { - switch (type_) { - case booleanValue: - return value_.bool_; - case nullValue: - return false; - case intValue: - return value_.int_ ? true : false; - case uintValue: - return value_.uint_ ? true : false; - case realValue: - return value_.real_ ? true : false; - default: - break; - } - JSON_FAIL_MESSAGE("Value is not convertible to bool."); -} - -bool Value::isConvertibleTo(ValueType other) const { - switch (other) { - case nullValue: - return (isNumeric() && asDouble() == 0.0) || - (type_ == booleanValue && value_.bool_ == false) || - (type_ == stringValue && asString() == "") || - (type_ == arrayValue && value_.map_->size() == 0) || - (type_ == objectValue && value_.map_->size() == 0) || - type_ == nullValue; - case intValue: - return isInt() || - (type_ == realValue && InRange(value_.real_, minInt, maxInt)) || - type_ == booleanValue || type_ == nullValue; - case uintValue: - return isUInt() || - (type_ == realValue && InRange(value_.real_, 0, maxUInt)) || - type_ == booleanValue || type_ == nullValue; - case realValue: - return isNumeric() || type_ == booleanValue || type_ == nullValue; - case booleanValue: - return isNumeric() || type_ == booleanValue || type_ == nullValue; - case stringValue: - return isNumeric() || type_ == booleanValue || type_ == stringValue || - type_ == nullValue; - case arrayValue: - return type_ == arrayValue || type_ == nullValue; - case objectValue: - return type_ == objectValue || type_ == nullValue; - } - JSON_ASSERT_UNREACHABLE; - return false; -} - -/// Number of values in array or object -ArrayIndex Value::size() const { - switch (type_) { - case nullValue: - case intValue: - case uintValue: - case realValue: - case booleanValue: - case stringValue: - return 0; - case arrayValue: // size of the array is highest index + 1 - if (!value_.map_->empty()) { - ObjectValues::const_iterator itLast = value_.map_->end(); - --itLast; - return (*itLast).first.index() + 1; - } - return 0; - case objectValue: - return ArrayIndex(value_.map_->size()); - } - JSON_ASSERT_UNREACHABLE; - return 0; // unreachable; -} - -bool Value::empty() const { - if (isNull() || isArray() || isObject()) - return size() == 0u; - else - return false; -} - -bool Value::operator!() const { return isNull(); } - -void Value::clear() { - JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == arrayValue || - type_ == objectValue, - "in Json::Value::clear(): requires complex value"); - start_ = 0; - limit_ = 0; - switch (type_) { - case arrayValue: - case objectValue: - value_.map_->clear(); - break; - default: - break; - } -} - -void Value::resize(ArrayIndex newSize) { - JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == arrayValue, - "in Json::Value::resize(): requires arrayValue"); - if (type_ == nullValue) - *this = Value(arrayValue); - ArrayIndex oldSize = size(); - if (newSize == 0) - clear(); - else if (newSize > oldSize) - (*this)[newSize - 1]; - else { - for (ArrayIndex index = newSize; index < oldSize; ++index) { - value_.map_->erase(index); - } - assert(size() == newSize); - } -} - -Value& Value::operator[](ArrayIndex index) { - JSON_ASSERT_MESSAGE( - type_ == nullValue || type_ == arrayValue, - "in Json::Value::operator[](ArrayIndex): requires arrayValue"); - if (type_ == nullValue) - *this = Value(arrayValue); - CZString key(index); - ObjectValues::iterator it = value_.map_->lower_bound(key); - if (it != value_.map_->end() && (*it).first == key) - return (*it).second; - - ObjectValues::value_type defaultValue(key, nullRef); - it = value_.map_->insert(it, defaultValue); - return (*it).second; -} - -Value& Value::operator[](int index) { - JSON_ASSERT_MESSAGE( - index >= 0, - "in Json::Value::operator[](int index): index cannot be negative"); - return (*this)[ArrayIndex(index)]; -} - -const Value& Value::operator[](ArrayIndex index) const { - JSON_ASSERT_MESSAGE( - type_ == nullValue || type_ == arrayValue, - "in Json::Value::operator[](ArrayIndex)const: requires arrayValue"); - if (type_ == nullValue) - return nullRef; - CZString key(index); - ObjectValues::const_iterator it = value_.map_->find(key); - if (it == value_.map_->end()) - return nullRef; - return (*it).second; -} - -const Value& Value::operator[](int index) const { - JSON_ASSERT_MESSAGE( - index >= 0, - "in Json::Value::operator[](int index) const: index cannot be negative"); - return (*this)[ArrayIndex(index)]; -} - -void Value::initBasic(ValueType type, bool allocated) { - type_ = type; - allocated_ = allocated; - comments_ = 0; - start_ = 0; - limit_ = 0; -} - -// Access an object value by name, create a null member if it does not exist. -// @pre Type of '*this' is object or null. -// @param key is null-terminated. -Value& Value::resolveReference(const char* key) { - JSON_ASSERT_MESSAGE( - type_ == nullValue || type_ == objectValue, - "in Json::Value::resolveReference(): requires objectValue"); - if (type_ == nullValue) - *this = Value(objectValue); - CZString actualKey( - key, static_cast(strlen(key)), CZString::noDuplication); // NOTE! - ObjectValues::iterator it = value_.map_->lower_bound(actualKey); - if (it != value_.map_->end() && (*it).first == actualKey) - return (*it).second; - - ObjectValues::value_type defaultValue(actualKey, nullRef); - it = value_.map_->insert(it, defaultValue); - Value& value = (*it).second; - return value; -} - -// @param key is not null-terminated. -Value& Value::resolveReference(char const* key, char const* end) -{ - JSON_ASSERT_MESSAGE( - type_ == nullValue || type_ == objectValue, - "in Json::Value::resolveReference(key, end): requires objectValue"); - if (type_ == nullValue) - *this = Value(objectValue); - CZString actualKey( - key, static_cast(end-key), CZString::duplicateOnCopy); - ObjectValues::iterator it = value_.map_->lower_bound(actualKey); - if (it != value_.map_->end() && (*it).first == actualKey) - return (*it).second; - - ObjectValues::value_type defaultValue(actualKey, nullRef); - it = value_.map_->insert(it, defaultValue); - Value& value = (*it).second; - return value; -} - -Value Value::get(ArrayIndex index, const Value& defaultValue) const { - const Value* value = &((*this)[index]); - return value == &nullRef ? defaultValue : *value; -} - -bool Value::isValidIndex(ArrayIndex index) const { return index < size(); } - -Value const* Value::find(char const* key, char const* end) const -{ - JSON_ASSERT_MESSAGE( - type_ == nullValue || type_ == objectValue, - "in Json::Value::find(key, end, found): requires objectValue or nullValue"); - if (type_ == nullValue) return NULL; - CZString actualKey(key, static_cast(end-key), CZString::noDuplication); - ObjectValues::const_iterator it = value_.map_->find(actualKey); - if (it == value_.map_->end()) return NULL; - return &(*it).second; -} -const Value& Value::operator[](const char* key) const -{ - Value const* found = find(key, key + strlen(key)); - if (!found) return nullRef; - return *found; -} -Value const& Value::operator[](std::string const& key) const -{ - Value const* found = find(key.data(), key.data() + key.length()); - if (!found) return nullRef; - return *found; -} - -Value& Value::operator[](const char* key) { - return resolveReference(key, key + strlen(key)); -} - -Value& Value::operator[](const std::string& key) { - return resolveReference(key.data(), key.data() + key.length()); -} - -Value& Value::operator[](const StaticString& key) { - return resolveReference(key.c_str()); -} - -#ifdef JSON_USE_CPPTL -Value& Value::operator[](const CppTL::ConstString& key) { - return resolveReference(key.c_str(), key.end_c_str()); -} -Value const& Value::operator[](CppTL::ConstString const& key) const -{ - Value const* found = find(key.c_str(), key.end_c_str()); - if (!found) return nullRef; - return *found; -} -#endif - -Value& Value::append(const Value& value) { return (*this)[size()] = value; } - -Value Value::get(char const* key, char const* end, Value const& defaultValue) const -{ - Value const* found = find(key, end); - return !found ? defaultValue : *found; -} -Value Value::get(char const* key, Value const& defaultValue) const -{ - return get(key, key + strlen(key), defaultValue); -} -Value Value::get(std::string const& key, Value const& defaultValue) const -{ - return get(key.data(), key.data() + key.length(), defaultValue); -} - - -bool Value::removeMember(const char* key, const char* end, Value* removed) -{ - if (type_ != objectValue) { - return false; - } - CZString actualKey(key, static_cast(end-key), CZString::noDuplication); - ObjectValues::iterator it = value_.map_->find(actualKey); - if (it == value_.map_->end()) - return false; - *removed = it->second; - value_.map_->erase(it); - return true; -} -bool Value::removeMember(const char* key, Value* removed) -{ - return removeMember(key, key + strlen(key), removed); -} -bool Value::removeMember(std::string const& key, Value* removed) -{ - return removeMember(key.data(), key.data() + key.length(), removed); -} -Value Value::removeMember(const char* key) -{ - JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == objectValue, - "in Json::Value::removeMember(): requires objectValue"); - if (type_ == nullValue) - return nullRef; - - Value removed; // null - removeMember(key, key + strlen(key), &removed); - return removed; // still null if removeMember() did nothing -} -Value Value::removeMember(const std::string& key) -{ - return removeMember(key.c_str()); -} - -bool Value::removeIndex(ArrayIndex index, Value* removed) { - if (type_ != arrayValue) { - return false; - } - CZString key(index); - ObjectValues::iterator it = value_.map_->find(key); - if (it == value_.map_->end()) { - return false; - } - *removed = it->second; - ArrayIndex oldSize = size(); - // shift left all items left, into the place of the "removed" - for (ArrayIndex i = index; i < (oldSize - 1); ++i){ - CZString key(i); - (*value_.map_)[key] = (*this)[i + 1]; - } - // erase the last one ("leftover") - CZString keyLast(oldSize - 1); - ObjectValues::iterator itLast = value_.map_->find(keyLast); - value_.map_->erase(itLast); - return true; -} - -#ifdef JSON_USE_CPPTL -Value Value::get(const CppTL::ConstString& key, - const Value& defaultValue) const { - return get(key.c_str(), key.end_c_str(), defaultValue); -} -#endif - -bool Value::isMember(char const* key, char const* end) const -{ - Value const* value = find(key, end); - return NULL != value; -} -bool Value::isMember(char const* key) const -{ - return isMember(key, key + strlen(key)); -} -bool Value::isMember(std::string const& key) const -{ - return isMember(key.data(), key.data() + key.length()); -} - -#ifdef JSON_USE_CPPTL -bool Value::isMember(const CppTL::ConstString& key) const { - return isMember(key.c_str(), key.end_c_str()); -} -#endif - -Value::Members Value::getMemberNames() const { - JSON_ASSERT_MESSAGE( - type_ == nullValue || type_ == objectValue, - "in Json::Value::getMemberNames(), value must be objectValue"); - if (type_ == nullValue) - return Value::Members(); - Members members; - members.reserve(value_.map_->size()); - ObjectValues::const_iterator it = value_.map_->begin(); - ObjectValues::const_iterator itEnd = value_.map_->end(); - for (; it != itEnd; ++it) { - members.push_back(std::string((*it).first.data(), - (*it).first.length())); - } - return members; -} -// -//# ifdef JSON_USE_CPPTL -// EnumMemberNames -// Value::enumMemberNames() const -//{ -// if ( type_ == objectValue ) -// { -// return CppTL::Enum::any( CppTL::Enum::transform( -// CppTL::Enum::keys( *(value_.map_), CppTL::Type() ), -// MemberNamesTransform() ) ); -// } -// return EnumMemberNames(); -//} -// -// -// EnumValues -// Value::enumValues() const -//{ -// if ( type_ == objectValue || type_ == arrayValue ) -// return CppTL::Enum::anyValues( *(value_.map_), -// CppTL::Type() ); -// return EnumValues(); -//} -// -//# endif - -static bool IsIntegral(double d) { - double integral_part; - return modf(d, &integral_part) == 0.0; -} - -bool Value::isNull() const { return type_ == nullValue; } - -bool Value::isBool() const { return type_ == booleanValue; } - -bool Value::isInt() const { - switch (type_) { - case intValue: - return value_.int_ >= minInt && value_.int_ <= maxInt; - case uintValue: - return value_.uint_ <= UInt(maxInt); - case realValue: - return value_.real_ >= minInt && value_.real_ <= maxInt && - IsIntegral(value_.real_); - default: - break; - } - return false; -} - -bool Value::isUInt() const { - switch (type_) { - case intValue: - return value_.int_ >= 0 && LargestUInt(value_.int_) <= LargestUInt(maxUInt); - case uintValue: - return value_.uint_ <= maxUInt; - case realValue: - return value_.real_ >= 0 && value_.real_ <= maxUInt && - IsIntegral(value_.real_); - default: - break; - } - return false; -} - -bool Value::isInt64() const { -#if defined(JSON_HAS_INT64) - switch (type_) { - case intValue: - return true; - case uintValue: - return value_.uint_ <= UInt64(maxInt64); - case realValue: - // Note that maxInt64 (= 2^63 - 1) is not exactly representable as a - // double, so double(maxInt64) will be rounded up to 2^63. Therefore we - // require the value to be strictly less than the limit. - return value_.real_ >= double(minInt64) && - value_.real_ < double(maxInt64) && IsIntegral(value_.real_); - default: - break; - } -#endif // JSON_HAS_INT64 - return false; -} - -bool Value::isUInt64() const { -#if defined(JSON_HAS_INT64) - switch (type_) { - case intValue: - return value_.int_ >= 0; - case uintValue: - return true; - case realValue: - // Note that maxUInt64 (= 2^64 - 1) is not exactly representable as a - // double, so double(maxUInt64) will be rounded up to 2^64. Therefore we - // require the value to be strictly less than the limit. - return value_.real_ >= 0 && value_.real_ < maxUInt64AsDouble && - IsIntegral(value_.real_); - default: - break; - } -#endif // JSON_HAS_INT64 - return false; -} - -bool Value::isIntegral() const { -#if defined(JSON_HAS_INT64) - return isInt64() || isUInt64(); -#else - return isInt() || isUInt(); -#endif -} - -bool Value::isDouble() const { return type_ == realValue || isIntegral(); } - -bool Value::isNumeric() const { return isIntegral() || isDouble(); } - -bool Value::isString() const { return type_ == stringValue; } - -bool Value::isArray() const { return type_ == arrayValue; } - -bool Value::isObject() const { return type_ == objectValue; } - -void Value::setComment(const char* comment, size_t len, CommentPlacement placement) { - if (!comments_) - comments_ = new CommentInfo[numberOfCommentPlacement]; - if ((len > 0) && (comment[len-1] == '\n')) { - // Always discard trailing newline, to aid indentation. - len -= 1; - } - comments_[placement].setComment(comment, len); -} - -void Value::setComment(const char* comment, CommentPlacement placement) { - setComment(comment, strlen(comment), placement); -} - -void Value::setComment(const std::string& comment, CommentPlacement placement) { - setComment(comment.c_str(), comment.length(), placement); -} - -bool Value::hasComment(CommentPlacement placement) const { - return comments_ != 0 && comments_[placement].comment_ != 0; -} - -std::string Value::getComment(CommentPlacement placement) const { - if (hasComment(placement)) - return comments_[placement].comment_; - return ""; -} - -void Value::setOffsetStart(size_t start) { start_ = start; } - -void Value::setOffsetLimit(size_t limit) { limit_ = limit; } - -size_t Value::getOffsetStart() const { return start_; } - -size_t Value::getOffsetLimit() const { return limit_; } - -std::string Value::toStyledString() const { - StyledWriter writer; - return writer.write(*this); -} - -Value::const_iterator Value::begin() const { - switch (type_) { - case arrayValue: - case objectValue: - if (value_.map_) - return const_iterator(value_.map_->begin()); - break; - default: - break; - } - return const_iterator(); -} - -Value::const_iterator Value::end() const { - switch (type_) { - case arrayValue: - case objectValue: - if (value_.map_) - return const_iterator(value_.map_->end()); - break; - default: - break; - } - return const_iterator(); -} - -Value::iterator Value::begin() { - switch (type_) { - case arrayValue: - case objectValue: - if (value_.map_) - return iterator(value_.map_->begin()); - break; - default: - break; - } - return iterator(); -} - -Value::iterator Value::end() { - switch (type_) { - case arrayValue: - case objectValue: - if (value_.map_) - return iterator(value_.map_->end()); - break; - default: - break; - } - return iterator(); -} - -// class PathArgument -// ////////////////////////////////////////////////////////////////// - -PathArgument::PathArgument() : key_(), index_(), kind_(kindNone) {} - -PathArgument::PathArgument(ArrayIndex index) - : key_(), index_(index), kind_(kindIndex) {} - -PathArgument::PathArgument(const char* key) - : key_(key), index_(), kind_(kindKey) {} - -PathArgument::PathArgument(const std::string& key) - : key_(key.c_str()), index_(), kind_(kindKey) {} - -// class Path -// ////////////////////////////////////////////////////////////////// - -Path::Path(const std::string& path, - const PathArgument& a1, - const PathArgument& a2, - const PathArgument& a3, - const PathArgument& a4, - const PathArgument& a5) { - InArgs in; - in.push_back(&a1); - in.push_back(&a2); - in.push_back(&a3); - in.push_back(&a4); - in.push_back(&a5); - makePath(path, in); -} - -void Path::makePath(const std::string& path, const InArgs& in) { - const char* current = path.c_str(); - const char* end = current + path.length(); - InArgs::const_iterator itInArg = in.begin(); - while (current != end) { - if (*current == '[') { - ++current; - if (*current == '%') - addPathInArg(path, in, itInArg, PathArgument::kindIndex); - else { - ArrayIndex index = 0; - for (; current != end && *current >= '0' && *current <= '9'; ++current) - index = index * 10 + ArrayIndex(*current - '0'); - args_.push_back(index); - } - if (current == end || *current++ != ']') - invalidPath(path, int(current - path.c_str())); - } else if (*current == '%') { - addPathInArg(path, in, itInArg, PathArgument::kindKey); - ++current; - } else if (*current == '.') { - ++current; - } else { - const char* beginName = current; - while (current != end && !strchr("[.", *current)) - ++current; - args_.push_back(std::string(beginName, current)); - } - } -} - -void Path::addPathInArg(const std::string& /*path*/, - const InArgs& in, - InArgs::const_iterator& itInArg, - PathArgument::Kind kind) { - if (itInArg == in.end()) { - // Error: missing argument %d - } else if ((*itInArg)->kind_ != kind) { - // Error: bad argument type - } else { - args_.push_back(**itInArg); - } -} - -void Path::invalidPath(const std::string& /*path*/, int /*location*/) { - // Error: invalid path. -} - -const Value& Path::resolve(const Value& root) const { - const Value* node = &root; - for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) { - const PathArgument& arg = *it; - if (arg.kind_ == PathArgument::kindIndex) { - if (!node->isArray() || !node->isValidIndex(arg.index_)) { - // Error: unable to resolve path (array value expected at position... - } - node = &((*node)[arg.index_]); - } else if (arg.kind_ == PathArgument::kindKey) { - if (!node->isObject()) { - // Error: unable to resolve path (object value expected at position...) - } - node = &((*node)[arg.key_]); - if (node == &Value::nullRef) { - // Error: unable to resolve path (object has no member named '' at - // position...) - } - } - } - return *node; -} - -Value Path::resolve(const Value& root, const Value& defaultValue) const { - const Value* node = &root; - for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) { - const PathArgument& arg = *it; - if (arg.kind_ == PathArgument::kindIndex) { - if (!node->isArray() || !node->isValidIndex(arg.index_)) - return defaultValue; - node = &((*node)[arg.index_]); - } else if (arg.kind_ == PathArgument::kindKey) { - if (!node->isObject()) - return defaultValue; - node = &((*node)[arg.key_]); - if (node == &Value::nullRef) - return defaultValue; - } - } - return *node; -} - -Value& Path::make(Value& root) const { - Value* node = &root; - for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) { - const PathArgument& arg = *it; - if (arg.kind_ == PathArgument::kindIndex) { - if (!node->isArray()) { - // Error: node is not an array at position ... - } - node = &((*node)[arg.index_]); - } else if (arg.kind_ == PathArgument::kindKey) { - if (!node->isObject()) { - // Error: node is not an object at position... - } - node = &((*node)[arg.key_]); - } - } - return *node; -} - -} // namespace Json - -// ////////////////////////////////////////////////////////////////////// -// End of content of file: src/lib_json/json_value.cpp -// ////////////////////////////////////////////////////////////////////// - - - - - - -// ////////////////////////////////////////////////////////////////////// -// Beginning of content of file: src/lib_json/json_writer.cpp -// ////////////////////////////////////////////////////////////////////// - -// Copyright 2011 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#if !defined(JSON_IS_AMALGAMATION) -#include -#include "json_tool.h" -#endif // if !defined(JSON_IS_AMALGAMATION) -#include -#include -#include -#include -#include -#include -#include -#include - -#if defined(_MSC_VER) && _MSC_VER >= 1200 && _MSC_VER < 1800 // Between VC++ 6.0 and VC++ 11.0 -#include -#define isfinite _finite -#elif defined(__sun) && defined(__SVR4) //Solaris -#include -#define isfinite finite -#else -#include -#define isfinite std::isfinite -#endif - -#if defined(_MSC_VER) && _MSC_VER < 1500 // VC++ 8.0 and below -#define snprintf _snprintf -#elif defined(__ANDROID__) -#define snprintf snprintf -#elif __cplusplus >= 201103L -#define snprintf std::snprintf -#endif - -#if defined(__BORLANDC__) -#include -#define isfinite _finite -#define snprintf _snprintf -#endif - -#if defined(_MSC_VER) && _MSC_VER >= 1400 // VC++ 8.0 -// Disable warning about strdup being deprecated. -#pragma warning(disable : 4996) -#endif - -namespace Json { - -#if __cplusplus >= 201103L -typedef std::unique_ptr StreamWriterPtr; -#else -typedef std::auto_ptr StreamWriterPtr; -#endif - -static bool containsControlCharacter(const char* str) { - while (*str) { - if (isControlCharacter(*(str++))) - return true; - } - return false; -} - -static bool containsControlCharacter0(const char* str, unsigned len) { - char const* end = str + len; - while (end != str) { - if (isControlCharacter(*str) || 0==*str) - return true; - ++str; - } - return false; -} - -std::string valueToString(LargestInt value) { - UIntToStringBuffer buffer; - char* current = buffer + sizeof(buffer); - bool isNegative = value < 0; - if (isNegative) - value = -value; - uintToString(LargestUInt(value), current); - if (isNegative) - *--current = '-'; - assert(current >= buffer); - return current; -} - -std::string valueToString(LargestUInt value) { - UIntToStringBuffer buffer; - char* current = buffer + sizeof(buffer); - uintToString(value, current); - assert(current >= buffer); - return current; -} - -#if defined(JSON_HAS_INT64) - -std::string valueToString(Int value) { - return valueToString(LargestInt(value)); -} - -std::string valueToString(UInt value) { - return valueToString(LargestUInt(value)); -} - -#endif // # if defined(JSON_HAS_INT64) - -std::string valueToString(double value) { - // Allocate a buffer that is more than large enough to store the 16 digits of - // precision requested below. - char buffer[32]; - int len = -1; - -// Print into the buffer. We need not request the alternative representation -// that always has a decimal point because JSON doesn't distingish the -// concepts of reals and integers. -#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) // Use secure version with - // visual studio 2005 to - // avoid warning. -#if defined(WINCE) - len = _snprintf(buffer, sizeof(buffer), "%.17g", value); -#else - len = sprintf_s(buffer, sizeof(buffer), "%.17g", value); -#endif -#else - if (isfinite(value)) { - len = snprintf(buffer, sizeof(buffer), "%.17g", value); - } else { - // IEEE standard states that NaN values will not compare to themselves - if (value != value) { - len = snprintf(buffer, sizeof(buffer), "null"); - } else if (value < 0) { - len = snprintf(buffer, sizeof(buffer), "-1e+9999"); - } else { - len = snprintf(buffer, sizeof(buffer), "1e+9999"); - } - // For those, we do not need to call fixNumLoc, but it is fast. - } -#endif - assert(len >= 0); - fixNumericLocale(buffer, buffer + len); - return buffer; -} - -std::string valueToString(bool value) { return value ? "true" : "false"; } - -std::string valueToQuotedString(const char* value) { - if (value == NULL) - return ""; - // Not sure how to handle unicode... - if (strpbrk(value, "\"\\\b\f\n\r\t") == NULL && - !containsControlCharacter(value)) - return std::string("\"") + value + "\""; - // We have to walk value and escape any special characters. - // Appending to std::string is not efficient, but this should be rare. - // (Note: forward slashes are *not* rare, but I am not escaping them.) - std::string::size_type maxsize = - strlen(value) * 2 + 3; // allescaped+quotes+NULL - std::string result; - result.reserve(maxsize); // to avoid lots of mallocs - result += "\""; - for (const char* c = value; *c != 0; ++c) { - switch (*c) { - case '\"': - result += "\\\""; - break; - case '\\': - result += "\\\\"; - break; - case '\b': - result += "\\b"; - break; - case '\f': - result += "\\f"; - break; - case '\n': - result += "\\n"; - break; - case '\r': - result += "\\r"; - break; - case '\t': - result += "\\t"; - break; - // case '/': - // Even though \/ is considered a legal escape in JSON, a bare - // slash is also legal, so I see no reason to escape it. - // (I hope I am not misunderstanding something. - // blep notes: actually escaping \/ may be useful in javascript to avoid (*c); - result += oss.str(); - } else { - result += *c; - } - break; - } - } - result += "\""; - return result; -} - -// https://github.com/upcaste/upcaste/blob/master/src/upcore/src/cstring/strnpbrk.cpp -static char const* strnpbrk(char const* s, char const* accept, size_t n) { - assert((s || !n) && accept); - - char const* const end = s + n; - for (char const* cur = s; cur < end; ++cur) { - int const c = *cur; - for (char const* a = accept; *a; ++a) { - if (*a == c) { - return cur; - } - } - } - return NULL; -} -static std::string valueToQuotedStringN(const char* value, unsigned length) { - if (value == NULL) - return ""; - // Not sure how to handle unicode... - if (strnpbrk(value, "\"\\\b\f\n\r\t", length) == NULL && - !containsControlCharacter0(value, length)) - return std::string("\"") + value + "\""; - // We have to walk value and escape any special characters. - // Appending to std::string is not efficient, but this should be rare. - // (Note: forward slashes are *not* rare, but I am not escaping them.) - std::string::size_type maxsize = - length * 2 + 3; // allescaped+quotes+NULL - std::string result; - result.reserve(maxsize); // to avoid lots of mallocs - result += "\""; - char const* end = value + length; - for (const char* c = value; c != end; ++c) { - switch (*c) { - case '\"': - result += "\\\""; - break; - case '\\': - result += "\\\\"; - break; - case '\b': - result += "\\b"; - break; - case '\f': - result += "\\f"; - break; - case '\n': - result += "\\n"; - break; - case '\r': - result += "\\r"; - break; - case '\t': - result += "\\t"; - break; - // case '/': - // Even though \/ is considered a legal escape in JSON, a bare - // slash is also legal, so I see no reason to escape it. - // (I hope I am not misunderstanding something.) - // blep notes: actually escaping \/ may be useful in javascript to avoid (*c); - result += oss.str(); - } else { - result += *c; - } - break; - } - } - result += "\""; - return result; -} - -// Class Writer -// ////////////////////////////////////////////////////////////////// -Writer::~Writer() {} - -// Class FastWriter -// ////////////////////////////////////////////////////////////////// - -FastWriter::FastWriter() - : yamlCompatiblityEnabled_(false), dropNullPlaceholders_(false), - omitEndingLineFeed_(false) {} - -void FastWriter::enableYAMLCompatibility() { yamlCompatiblityEnabled_ = true; } - -void FastWriter::dropNullPlaceholders() { dropNullPlaceholders_ = true; } - -void FastWriter::omitEndingLineFeed() { omitEndingLineFeed_ = true; } - -std::string FastWriter::write(const Value& root) { - document_ = ""; - writeValue(root); - if (!omitEndingLineFeed_) - document_ += "\n"; - return document_; -} - -void FastWriter::writeValue(const Value& value) { - switch (value.type()) { - case nullValue: - if (!dropNullPlaceholders_) - document_ += "null"; - break; - case intValue: - document_ += valueToString(value.asLargestInt()); - break; - case uintValue: - document_ += valueToString(value.asLargestUInt()); - break; - case realValue: - document_ += valueToString(value.asDouble()); - break; - case stringValue: - { - // Is NULL possible for value.string_? - char const* str; - char const* end; - bool ok = value.getString(&str, &end); - if (ok) document_ += valueToQuotedStringN(str, static_cast(end-str)); - break; - } - case booleanValue: - document_ += valueToString(value.asBool()); - break; - case arrayValue: { - document_ += '['; - int size = value.size(); - for (int index = 0; index < size; ++index) { - if (index > 0) - document_ += ','; - writeValue(value[index]); - } - document_ += ']'; - } break; - case objectValue: { - Value::Members members(value.getMemberNames()); - document_ += '{'; - for (Value::Members::iterator it = members.begin(); it != members.end(); - ++it) { - const std::string& name = *it; - if (it != members.begin()) - document_ += ','; - document_ += valueToQuotedStringN(name.data(), name.length()); - document_ += yamlCompatiblityEnabled_ ? ": " : ":"; - writeValue(value[name]); - } - document_ += '}'; - } break; - } -} - -// Class StyledWriter -// ////////////////////////////////////////////////////////////////// - -StyledWriter::StyledWriter() - : rightMargin_(74), indentSize_(3), addChildValues_() {} - -std::string StyledWriter::write(const Value& root) { - document_ = ""; - addChildValues_ = false; - indentString_ = ""; - writeCommentBeforeValue(root); - writeValue(root); - writeCommentAfterValueOnSameLine(root); - document_ += "\n"; - return document_; -} - -void StyledWriter::writeValue(const Value& value) { - switch (value.type()) { - case nullValue: - pushValue("null"); - break; - case intValue: - pushValue(valueToString(value.asLargestInt())); - break; - case uintValue: - pushValue(valueToString(value.asLargestUInt())); - break; - case realValue: - pushValue(valueToString(value.asDouble())); - break; - case stringValue: - { - // Is NULL possible for value.string_? - char const* str; - char const* end; - bool ok = value.getString(&str, &end); - if (ok) pushValue(valueToQuotedStringN(str, static_cast(end-str))); - else pushValue(""); - break; - } - case booleanValue: - pushValue(valueToString(value.asBool())); - break; - case arrayValue: - writeArrayValue(value); - break; - case objectValue: { - Value::Members members(value.getMemberNames()); - if (members.empty()) - pushValue("{}"); - else { - writeWithIndent("{"); - indent(); - Value::Members::iterator it = members.begin(); - for (;;) { - const std::string& name = *it; - const Value& childValue = value[name]; - writeCommentBeforeValue(childValue); - writeWithIndent(valueToQuotedString(name.c_str())); - document_ += " : "; - writeValue(childValue); - if (++it == members.end()) { - writeCommentAfterValueOnSameLine(childValue); - break; - } - document_ += ','; - writeCommentAfterValueOnSameLine(childValue); - } - unindent(); - writeWithIndent("}"); - } - } break; - } -} - -void StyledWriter::writeArrayValue(const Value& value) { - unsigned size = value.size(); - if (size == 0) - pushValue("[]"); - else { - bool isArrayMultiLine = isMultineArray(value); - if (isArrayMultiLine) { - writeWithIndent("["); - indent(); - bool hasChildValue = !childValues_.empty(); - unsigned index = 0; - for (;;) { - const Value& childValue = value[index]; - writeCommentBeforeValue(childValue); - if (hasChildValue) - writeWithIndent(childValues_[index]); - else { - writeIndent(); - writeValue(childValue); - } - if (++index == size) { - writeCommentAfterValueOnSameLine(childValue); - break; - } - document_ += ','; - writeCommentAfterValueOnSameLine(childValue); - } - unindent(); - writeWithIndent("]"); - } else // output on a single line - { - assert(childValues_.size() == size); - document_ += "[ "; - for (unsigned index = 0; index < size; ++index) { - if (index > 0) - document_ += ", "; - document_ += childValues_[index]; - } - document_ += " ]"; - } - } -} - -bool StyledWriter::isMultineArray(const Value& value) { - int size = value.size(); - bool isMultiLine = size * 3 >= rightMargin_; - childValues_.clear(); - for (int index = 0; index < size && !isMultiLine; ++index) { - const Value& childValue = value[index]; - isMultiLine = - isMultiLine || ((childValue.isArray() || childValue.isObject()) && - childValue.size() > 0); - } - if (!isMultiLine) // check if line length > max line length - { - childValues_.reserve(size); - addChildValues_ = true; - int lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]' - for (int index = 0; index < size; ++index) { - if (hasCommentForValue(value[index])) { - isMultiLine = true; - } - writeValue(value[index]); - lineLength += int(childValues_[index].length()); - } - addChildValues_ = false; - isMultiLine = isMultiLine || lineLength >= rightMargin_; - } - return isMultiLine; -} - -void StyledWriter::pushValue(const std::string& value) { - if (addChildValues_) - childValues_.push_back(value); - else - document_ += value; -} - -void StyledWriter::writeIndent() { - if (!document_.empty()) { - char last = document_[document_.length() - 1]; - if (last == ' ') // already indented - return; - if (last != '\n') // Comments may add new-line - document_ += '\n'; - } - document_ += indentString_; -} - -void StyledWriter::writeWithIndent(const std::string& value) { - writeIndent(); - document_ += value; -} - -void StyledWriter::indent() { indentString_ += std::string(indentSize_, ' '); } - -void StyledWriter::unindent() { - assert(int(indentString_.size()) >= indentSize_); - indentString_.resize(indentString_.size() - indentSize_); -} - -void StyledWriter::writeCommentBeforeValue(const Value& root) { - if (!root.hasComment(commentBefore)) - return; - - document_ += "\n"; - writeIndent(); - const std::string& comment = root.getComment(commentBefore); - std::string::const_iterator iter = comment.begin(); - while (iter != comment.end()) { - document_ += *iter; - if (*iter == '\n' && - (iter != comment.end() && *(iter + 1) == '/')) - writeIndent(); - ++iter; - } - - // Comments are stripped of trailing newlines, so add one here - document_ += "\n"; -} - -void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) { - if (root.hasComment(commentAfterOnSameLine)) - document_ += " " + root.getComment(commentAfterOnSameLine); - - if (root.hasComment(commentAfter)) { - document_ += "\n"; - document_ += root.getComment(commentAfter); - document_ += "\n"; - } -} - -bool StyledWriter::hasCommentForValue(const Value& value) { - return value.hasComment(commentBefore) || - value.hasComment(commentAfterOnSameLine) || - value.hasComment(commentAfter); -} - -// Class StyledStreamWriter -// ////////////////////////////////////////////////////////////////// - -StyledStreamWriter::StyledStreamWriter(std::string indentation) - : document_(NULL), rightMargin_(74), indentation_(indentation), - addChildValues_() {} - -void StyledStreamWriter::write(std::ostream& out, const Value& root) { - document_ = &out; - addChildValues_ = false; - indentString_ = ""; - indented_ = true; - writeCommentBeforeValue(root); - if (!indented_) writeIndent(); - indented_ = true; - writeValue(root); - writeCommentAfterValueOnSameLine(root); - *document_ << "\n"; - document_ = NULL; // Forget the stream, for safety. -} - -void StyledStreamWriter::writeValue(const Value& value) { - switch (value.type()) { - case nullValue: - pushValue("null"); - break; - case intValue: - pushValue(valueToString(value.asLargestInt())); - break; - case uintValue: - pushValue(valueToString(value.asLargestUInt())); - break; - case realValue: - pushValue(valueToString(value.asDouble())); - break; - case stringValue: - { - // Is NULL possible for value.string_? - char const* str; - char const* end; - bool ok = value.getString(&str, &end); - if (ok) pushValue(valueToQuotedStringN(str, static_cast(end-str))); - else pushValue(""); - break; - } - case booleanValue: - pushValue(valueToString(value.asBool())); - break; - case arrayValue: - writeArrayValue(value); - break; - case objectValue: { - Value::Members members(value.getMemberNames()); - if (members.empty()) - pushValue("{}"); - else { - writeWithIndent("{"); - indent(); - Value::Members::iterator it = members.begin(); - for (;;) { - const std::string& name = *it; - const Value& childValue = value[name]; - writeCommentBeforeValue(childValue); - writeWithIndent(valueToQuotedString(name.c_str())); - *document_ << " : "; - writeValue(childValue); - if (++it == members.end()) { - writeCommentAfterValueOnSameLine(childValue); - break; - } - *document_ << ","; - writeCommentAfterValueOnSameLine(childValue); - } - unindent(); - writeWithIndent("}"); - } - } break; - } -} - -void StyledStreamWriter::writeArrayValue(const Value& value) { - unsigned size = value.size(); - if (size == 0) - pushValue("[]"); - else { - bool isArrayMultiLine = isMultineArray(value); - if (isArrayMultiLine) { - writeWithIndent("["); - indent(); - bool hasChildValue = !childValues_.empty(); - unsigned index = 0; - for (;;) { - const Value& childValue = value[index]; - writeCommentBeforeValue(childValue); - if (hasChildValue) - writeWithIndent(childValues_[index]); - else { - if (!indented_) writeIndent(); - indented_ = true; - writeValue(childValue); - indented_ = false; - } - if (++index == size) { - writeCommentAfterValueOnSameLine(childValue); - break; - } - *document_ << ","; - writeCommentAfterValueOnSameLine(childValue); - } - unindent(); - writeWithIndent("]"); - } else // output on a single line - { - assert(childValues_.size() == size); - *document_ << "[ "; - for (unsigned index = 0; index < size; ++index) { - if (index > 0) - *document_ << ", "; - *document_ << childValues_[index]; - } - *document_ << " ]"; - } - } -} - -bool StyledStreamWriter::isMultineArray(const Value& value) { - int size = value.size(); - bool isMultiLine = size * 3 >= rightMargin_; - childValues_.clear(); - for (int index = 0; index < size && !isMultiLine; ++index) { - const Value& childValue = value[index]; - isMultiLine = - isMultiLine || ((childValue.isArray() || childValue.isObject()) && - childValue.size() > 0); - } - if (!isMultiLine) // check if line length > max line length - { - childValues_.reserve(size); - addChildValues_ = true; - int lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]' - for (int index = 0; index < size; ++index) { - if (hasCommentForValue(value[index])) { - isMultiLine = true; - } - writeValue(value[index]); - lineLength += int(childValues_[index].length()); - } - addChildValues_ = false; - isMultiLine = isMultiLine || lineLength >= rightMargin_; - } - return isMultiLine; -} - -void StyledStreamWriter::pushValue(const std::string& value) { - if (addChildValues_) - childValues_.push_back(value); - else - *document_ << value; -} - -void StyledStreamWriter::writeIndent() { - // blep intended this to look at the so-far-written string - // to determine whether we are already indented, but - // with a stream we cannot do that. So we rely on some saved state. - // The caller checks indented_. - *document_ << '\n' << indentString_; -} - -void StyledStreamWriter::writeWithIndent(const std::string& value) { - if (!indented_) writeIndent(); - *document_ << value; - indented_ = false; -} - -void StyledStreamWriter::indent() { indentString_ += indentation_; } - -void StyledStreamWriter::unindent() { - assert(indentString_.size() >= indentation_.size()); - indentString_.resize(indentString_.size() - indentation_.size()); -} - -void StyledStreamWriter::writeCommentBeforeValue(const Value& root) { - if (!root.hasComment(commentBefore)) - return; - - if (!indented_) writeIndent(); - const std::string& comment = root.getComment(commentBefore); - std::string::const_iterator iter = comment.begin(); - while (iter != comment.end()) { - *document_ << *iter; - if (*iter == '\n' && - (iter != comment.end() && *(iter + 1) == '/')) - // writeIndent(); // would include newline - *document_ << indentString_; - ++iter; - } - indented_ = false; -} - -void StyledStreamWriter::writeCommentAfterValueOnSameLine(const Value& root) { - if (root.hasComment(commentAfterOnSameLine)) - *document_ << ' ' << root.getComment(commentAfterOnSameLine); - - if (root.hasComment(commentAfter)) { - writeIndent(); - *document_ << root.getComment(commentAfter); - } - indented_ = false; -} - -bool StyledStreamWriter::hasCommentForValue(const Value& value) { - return value.hasComment(commentBefore) || - value.hasComment(commentAfterOnSameLine) || - value.hasComment(commentAfter); -} - -////////////////////////// -// BuiltStyledStreamWriter - -/// Scoped enums are not available until C++11. -struct CommentStyle { - /// Decide whether to write comments. - enum Enum { - None, ///< Drop all comments. - Most, ///< Recover odd behavior of previous versions (not implemented yet). - All ///< Keep all comments. - }; -}; - -struct BuiltStyledStreamWriter : public StreamWriter -{ - BuiltStyledStreamWriter( - std::string const& indentation, - CommentStyle::Enum cs, - std::string const& colonSymbol, - std::string const& nullSymbol, - std::string const& endingLineFeedSymbol); - virtual int write(Value const& root, std::ostream* sout); -private: - void writeValue(Value const& value); - void writeArrayValue(Value const& value); - bool isMultineArray(Value const& value); - void pushValue(std::string const& value); - void writeIndent(); - void writeWithIndent(std::string const& value); - void indent(); - void unindent(); - void writeCommentBeforeValue(Value const& root); - void writeCommentAfterValueOnSameLine(Value const& root); - static bool hasCommentForValue(const Value& value); - - typedef std::vector ChildValues; - - ChildValues childValues_; - std::string indentString_; - int rightMargin_; - std::string indentation_; - CommentStyle::Enum cs_; - std::string colonSymbol_; - std::string nullSymbol_; - std::string endingLineFeedSymbol_; - bool addChildValues_ : 1; - bool indented_ : 1; -}; -BuiltStyledStreamWriter::BuiltStyledStreamWriter( - std::string const& indentation, - CommentStyle::Enum cs, - std::string const& colonSymbol, - std::string const& nullSymbol, - std::string const& endingLineFeedSymbol) - : rightMargin_(74) - , indentation_(indentation) - , cs_(cs) - , colonSymbol_(colonSymbol) - , nullSymbol_(nullSymbol) - , endingLineFeedSymbol_(endingLineFeedSymbol) - , addChildValues_(false) - , indented_(false) -{ -} -int BuiltStyledStreamWriter::write(Value const& root, std::ostream* sout) -{ - sout_ = sout; - addChildValues_ = false; - indented_ = true; - indentString_ = ""; - writeCommentBeforeValue(root); - if (!indented_) writeIndent(); - indented_ = true; - writeValue(root); - writeCommentAfterValueOnSameLine(root); - *sout_ << endingLineFeedSymbol_; - sout_ = NULL; - return 0; -} -void BuiltStyledStreamWriter::writeValue(Value const& value) { - switch (value.type()) { - case nullValue: - pushValue(nullSymbol_); - break; - case intValue: - pushValue(valueToString(value.asLargestInt())); - break; - case uintValue: - pushValue(valueToString(value.asLargestUInt())); - break; - case realValue: - pushValue(valueToString(value.asDouble())); - break; - case stringValue: - { - // Is NULL is possible for value.string_? - char const* str; - char const* end; - bool ok = value.getString(&str, &end); - if (ok) pushValue(valueToQuotedStringN(str, static_cast(end-str))); - else pushValue(""); - break; - } - case booleanValue: - pushValue(valueToString(value.asBool())); - break; - case arrayValue: - writeArrayValue(value); - break; - case objectValue: { - Value::Members members(value.getMemberNames()); - if (members.empty()) - pushValue("{}"); - else { - writeWithIndent("{"); - indent(); - Value::Members::iterator it = members.begin(); - for (;;) { - std::string const& name = *it; - Value const& childValue = value[name]; - writeCommentBeforeValue(childValue); - writeWithIndent(valueToQuotedStringN(name.data(), name.length())); - *sout_ << colonSymbol_; - writeValue(childValue); - if (++it == members.end()) { - writeCommentAfterValueOnSameLine(childValue); - break; - } - *sout_ << ","; - writeCommentAfterValueOnSameLine(childValue); - } - unindent(); - writeWithIndent("}"); - } - } break; - } -} - -void BuiltStyledStreamWriter::writeArrayValue(Value const& value) { - unsigned size = value.size(); - if (size == 0) - pushValue("[]"); - else { - bool isMultiLine = (cs_ == CommentStyle::All) || isMultineArray(value); - if (isMultiLine) { - writeWithIndent("["); - indent(); - bool hasChildValue = !childValues_.empty(); - unsigned index = 0; - for (;;) { - Value const& childValue = value[index]; - writeCommentBeforeValue(childValue); - if (hasChildValue) - writeWithIndent(childValues_[index]); - else { - if (!indented_) writeIndent(); - indented_ = true; - writeValue(childValue); - indented_ = false; - } - if (++index == size) { - writeCommentAfterValueOnSameLine(childValue); - break; - } - *sout_ << ","; - writeCommentAfterValueOnSameLine(childValue); - } - unindent(); - writeWithIndent("]"); - } else // output on a single line - { - assert(childValues_.size() == size); - *sout_ << "["; - if (!indentation_.empty()) *sout_ << " "; - for (unsigned index = 0; index < size; ++index) { - if (index > 0) - *sout_ << ", "; - *sout_ << childValues_[index]; - } - if (!indentation_.empty()) *sout_ << " "; - *sout_ << "]"; - } - } -} - -bool BuiltStyledStreamWriter::isMultineArray(Value const& value) { - int size = value.size(); - bool isMultiLine = size * 3 >= rightMargin_; - childValues_.clear(); - for (int index = 0; index < size && !isMultiLine; ++index) { - Value const& childValue = value[index]; - isMultiLine = - isMultiLine || ((childValue.isArray() || childValue.isObject()) && - childValue.size() > 0); - } - if (!isMultiLine) // check if line length > max line length - { - childValues_.reserve(size); - addChildValues_ = true; - int lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]' - for (int index = 0; index < size; ++index) { - if (hasCommentForValue(value[index])) { - isMultiLine = true; - } - writeValue(value[index]); - lineLength += int(childValues_[index].length()); - } - addChildValues_ = false; - isMultiLine = isMultiLine || lineLength >= rightMargin_; - } - return isMultiLine; -} - -void BuiltStyledStreamWriter::pushValue(std::string const& value) { - if (addChildValues_) - childValues_.push_back(value); - else - *sout_ << value; -} - -void BuiltStyledStreamWriter::writeIndent() { - // blep intended this to look at the so-far-written string - // to determine whether we are already indented, but - // with a stream we cannot do that. So we rely on some saved state. - // The caller checks indented_. - - if (!indentation_.empty()) { - // In this case, drop newlines too. - *sout_ << '\n' << indentString_; - } -} - -void BuiltStyledStreamWriter::writeWithIndent(std::string const& value) { - if (!indented_) writeIndent(); - *sout_ << value; - indented_ = false; -} - -void BuiltStyledStreamWriter::indent() { indentString_ += indentation_; } - -void BuiltStyledStreamWriter::unindent() { - assert(indentString_.size() >= indentation_.size()); - indentString_.resize(indentString_.size() - indentation_.size()); -} - -void BuiltStyledStreamWriter::writeCommentBeforeValue(Value const& root) { - if (cs_ == CommentStyle::None) return; - if (!root.hasComment(commentBefore)) - return; - - if (!indented_) writeIndent(); - const std::string& comment = root.getComment(commentBefore); - std::string::const_iterator iter = comment.begin(); - while (iter != comment.end()) { - *sout_ << *iter; - if (*iter == '\n' && - (iter != comment.end() && *(iter + 1) == '/')) - // writeIndent(); // would write extra newline - *sout_ << indentString_; - ++iter; - } - indented_ = false; -} - -void BuiltStyledStreamWriter::writeCommentAfterValueOnSameLine(Value const& root) { - if (cs_ == CommentStyle::None) return; - if (root.hasComment(commentAfterOnSameLine)) - *sout_ << " " + root.getComment(commentAfterOnSameLine); - - if (root.hasComment(commentAfter)) { - writeIndent(); - *sout_ << root.getComment(commentAfter); - } -} - -// static -bool BuiltStyledStreamWriter::hasCommentForValue(const Value& value) { - return value.hasComment(commentBefore) || - value.hasComment(commentAfterOnSameLine) || - value.hasComment(commentAfter); -} - -/////////////// -// StreamWriter - -StreamWriter::StreamWriter() - : sout_(NULL) -{ -} -StreamWriter::~StreamWriter() -{ -} -StreamWriter::Factory::~Factory() -{} -StreamWriterBuilder::StreamWriterBuilder() -{ - setDefaults(&settings_); -} -StreamWriterBuilder::~StreamWriterBuilder() -{} -StreamWriter* StreamWriterBuilder::newStreamWriter() const -{ - std::string indentation = settings_["indentation"].asString(); - std::string cs_str = settings_["commentStyle"].asString(); - bool eyc = settings_["enableYAMLCompatibility"].asBool(); - bool dnp = settings_["dropNullPlaceholders"].asBool(); - CommentStyle::Enum cs = CommentStyle::All; - if (cs_str == "All") { - cs = CommentStyle::All; - } else if (cs_str == "None") { - cs = CommentStyle::None; - } else { - throwRuntimeError("commentStyle must be 'All' or 'None'"); - } - std::string colonSymbol = " : "; - if (eyc) { - colonSymbol = ": "; - } else if (indentation.empty()) { - colonSymbol = ":"; - } - std::string nullSymbol = "null"; - if (dnp) { - nullSymbol = ""; - } - std::string endingLineFeedSymbol = ""; - return new BuiltStyledStreamWriter( - indentation, cs, - colonSymbol, nullSymbol, endingLineFeedSymbol); -} -static void getValidWriterKeys(std::set* valid_keys) -{ - valid_keys->clear(); - valid_keys->insert("indentation"); - valid_keys->insert("commentStyle"); - valid_keys->insert("enableYAMLCompatibility"); - valid_keys->insert("dropNullPlaceholders"); -} -bool StreamWriterBuilder::validate(Json::Value* invalid) const -{ - Json::Value my_invalid; - if (!invalid) invalid = &my_invalid; // so we do not need to test for NULL - Json::Value& inv = *invalid; - std::set valid_keys; - getValidWriterKeys(&valid_keys); - Value::Members keys = settings_.getMemberNames(); - size_t n = keys.size(); - for (size_t i = 0; i < n; ++i) { - std::string const& key = keys[i]; - if (valid_keys.find(key) == valid_keys.end()) { - inv[key] = settings_[key]; - } - } - return 0u == inv.size(); -} -Value& StreamWriterBuilder::operator[](std::string key) -{ - return settings_[key]; -} -// static -void StreamWriterBuilder::setDefaults(Json::Value* settings) -{ - //! [StreamWriterBuilderDefaults] - (*settings)["commentStyle"] = "All"; - (*settings)["indentation"] = "\t"; - (*settings)["enableYAMLCompatibility"] = false; - (*settings)["dropNullPlaceholders"] = false; - //! [StreamWriterBuilderDefaults] -} - -std::string writeString(StreamWriter::Factory const& builder, Value const& root) { - std::ostringstream sout; - StreamWriterPtr const writer(builder.newStreamWriter()); - writer->write(root, &sout); - return sout.str(); -} - -std::ostream& operator<<(std::ostream& sout, Value const& root) { - StreamWriterBuilder builder; - StreamWriterPtr const writer(builder.newStreamWriter()); - writer->write(root, &sout); - return sout; -} - -} // namespace Json - -// ////////////////////////////////////////////////////////////////////// -// End of content of file: src/lib_json/json_writer.cpp -// ////////////////////////////////////////////////////////////////////// - - - - - diff --git a/tools/buildHeaders/main.cpp b/tools/buildHeaders/main.cpp deleted file mode 100644 index 7e5f7f80..00000000 --- a/tools/buildHeaders/main.cpp +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) 2014-2019 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -//#include -#include -#include - -#include "jsonToSpirv.h" -#include "header.h" - -// Command-line options -enum TOptions { - EOptionNone = 0x000, - EOptionPrintHeader = 0x008, -}; - -std::string jsonPath; -int Options; -spv::TLanguage Language; - -void Usage() -{ - printf("Usage: spirv option [file]\n" - "\n" - " -h print header for given language to stdout, from one of:\n" - " C - C99 header\n" - " C++ - C++03 or greater header (also accepts C++03)\n" - " C++11 - C++11 or greater header\n" - " JSON - JSON format data\n" - " Lua - Lua module\n" - " Python - Python module (also accepts Py)\n" - " C# - C# module (also accepts CSharp)\n" - " D - D module\n" - " -H print header in all supported languages to files in current directory\n" - ); -} - -std::string tolower_s(std::string s) -{ - std::transform(s.begin(), s.end(), s.begin(), ::tolower); - return s; -} - -bool ProcessArguments(int argc, char* argv[]) -{ - argc--; - argv++; - for (; argc >= 1; argc--, argv++) { - if (argv[0][0] == '-') { - switch (argv[0][1]) { - case 'H': - Options |= EOptionPrintHeader; - Language = spv::ELangAll; - break; - case 'h': { - if (argc < 2) - return false; - - Options |= EOptionPrintHeader; - const std::string language(tolower_s(argv[1])); - - if (language == "c") { - Language = spv::ELangC; - } else if (language == "c++" || language == "c++03") { - Language = spv::ELangCPP; - } else if (language == "c++11") { - Language = spv::ELangCPP11; - } else if (language == "json") { - Language = spv::ELangJSON; - } else if (language == "lua") { - Language = spv::ELangLua; - } else if (language == "python" || language == "py") { - Language = spv::ELangPython; - } else if (language == "c#" || language == "csharp") { - Language = spv::ELangCSharp; - } else if (language == "d") { - Language = spv::ELangD; - } else - return false; - - return true; - } - default: - return false; - } - } else { - jsonPath = std::string(argv[0]); - } - } - - return true; -} - -int main(int argc, char* argv[]) -{ - if (argc < 2 || ! ProcessArguments(argc, argv)) { - Usage(); - return 1; - } - - spv::jsonToSpirv(jsonPath, (Options & EOptionPrintHeader) != 0); - if (Options & EOptionPrintHeader) - spv::PrintHeader(Language, std::cout); - - return 0; -} diff --git a/tools/cfg/cfg.cpp b/tools/cfg/cfg.cpp index 6a5faa18..a93488d5 100644 --- a/tools/cfg/cfg.cpp +++ b/tools/cfg/cfg.cpp @@ -69,16 +69,16 @@ int main(int argc, char** argv) { if (0 == strcmp(argv[argi], "--help")) { print_usage(argv[0]); return 0; - } - if (0 == strcmp(argv[argi], "--version")) { + } else if (0 == strcmp(argv[argi], "--version")) { printf("%s EXPERIMENTAL\n", spvSoftwareVersionDetailsString()); printf("Target: %s\n", spvTargetEnvDescription(kDefaultEnvironment)); return 0; + } else { + print_usage(argv[0]); + return 1; } - print_usage(argv[0]); - return 1; - } + } break; case 0: { // Setting a filename of "-" to indicate stdin. if (!inFile) { diff --git a/tools/diff/diff.cpp b/tools/diff/diff.cpp deleted file mode 100644 index d3cad04b..00000000 --- a/tools/diff/diff.cpp +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) 2022 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) -#include -#endif - -#include "source/diff/diff.h" - -#include "source/opt/build_module.h" -#include "source/opt/ir_context.h" -#include "spirv-tools/libspirv.hpp" -#include "tools/io.h" -#include "tools/util/cli_consumer.h" - -static void print_usage(char* argv0) { - printf(R"(%s - Compare two SPIR-V files - -Usage: %s - -The SPIR-V binary is read from and . If either -file ends in .spvasm, the SPIR-V is read as text and disassembled. - -The contents of the SPIR-V modules are analyzed and a diff is produced showing a -logical transformation from src to dst, in src's id-space. - - -h, --help Print this help. - --version Display diff version information. - - --color Force color output. The default when printing to a terminal. - Overrides a previous --no-color option. - --no-color Don't print in color. Overrides a previous --color option. - The default when output goes to something other than a - terminal (e.g. a pipe, or a shell redirection). - - --no-indent Don't indent instructions. - - --no-header Don't output the header as leading comments. - - --with-id-map Also output the mapping between src and dst outputs. - - --ignore-set-binding - Don't use set/binding decorations for variable matching. - --ignore-location - Don't use location decorations for variable matching. -)", - argv0, argv0); -} - -static const auto kDefaultEnvironment = SPV_ENV_UNIVERSAL_1_6; - -static bool is_assembly(const char* path) { - const char* suffix = strrchr(path, '.'); - if (suffix == nullptr) { - return false; - } - - return strcmp(suffix, ".spvasm") == 0; -} - -static std::unique_ptr load_module(const char* path) { - if (is_assembly(path)) { - std::vector contents; - if (!ReadTextFile(path, &contents)) return {}; - - return spvtools::BuildModule( - kDefaultEnvironment, spvtools::utils::CLIMessageConsumer, - std::string(contents.begin(), contents.end()), - spvtools::SpirvTools::kDefaultAssembleOption | - SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - } - - std::vector contents; - if (!ReadBinaryFile(path, &contents)) return {}; - - return spvtools::BuildModule(kDefaultEnvironment, - spvtools::utils::CLIMessageConsumer, - contents.data(), contents.size()); -} - -int main(int argc, char** argv) { - const char* src_file = nullptr; - const char* dst_file = nullptr; - bool color_is_possible = -#if SPIRV_COLOR_TERMINAL - true; -#else - false; -#endif - bool force_color = false; - bool force_no_color = false; - bool allow_indent = true; - bool no_header = false; - bool dump_id_map = false; - bool ignore_set_binding = false; - bool ignore_location = false; - - for (int argi = 1; argi < argc; ++argi) { - if ('-' == argv[argi][0]) { - switch (argv[argi][1]) { - case 'h': - print_usage(argv[0]); - return 0; - case '-': { - // Long options - if (strcmp(argv[argi], "--no-color") == 0) { - force_no_color = true; - force_color = false; - } else if (strcmp(argv[argi], "--color") == 0) { - force_no_color = false; - force_color = true; - } else if (strcmp(argv[argi], "--no-indent") == 0) { - allow_indent = false; - } else if (strcmp(argv[argi], "--no-header") == 0) { - no_header = true; - } else if (strcmp(argv[argi], "--with-id-map") == 0) { - dump_id_map = true; - } else if (strcmp(argv[argi], "--ignore-set-binding") == 0) { - ignore_set_binding = true; - } else if (strcmp(argv[argi], "--ignore-location") == 0) { - ignore_location = true; - } else if (strcmp(argv[argi], "--help") == 0) { - print_usage(argv[0]); - return 0; - } else if (strcmp(argv[argi], "--version") == 0) { - printf("%s\n", spvSoftwareVersionDetailsString()); - printf("Target: %s\n", - spvTargetEnvDescription(kDefaultEnvironment)); - return 0; - } else { - print_usage(argv[0]); - return 1; - } - } break; - default: - print_usage(argv[0]); - return 1; - } - } else { - if (src_file == nullptr) { - src_file = argv[argi]; - } else if (dst_file == nullptr) { - dst_file = argv[argi]; - } else { - fprintf(stderr, "error: More than two input files specified\n"); - return 1; - } - } - } - - if (src_file == nullptr || dst_file == nullptr) { - print_usage(argv[0]); - return 1; - } - - spvtools::diff::Options options; - - if (allow_indent) options.indent = true; - if (no_header) options.no_header = true; - if (dump_id_map) options.dump_id_map = true; - if (ignore_set_binding) options.ignore_set_binding = true; - if (ignore_location) options.ignore_location = true; - - if (color_is_possible && !force_no_color) { - bool output_is_tty = true; -#if defined(_POSIX_VERSION) - output_is_tty = isatty(fileno(stdout)); -#endif - if (output_is_tty || force_color) { - options.color_output = true; - } - } - - std::unique_ptr src = load_module(src_file); - std::unique_ptr dst = load_module(dst_file); - - if (!src) { - fprintf(stderr, "error: Loading src file\n"); - } - if (!dst) { - fprintf(stderr, "error: Loading dst file\n"); - } - if (!src || !dst) { - return 1; - } - - spvtools::diff::Diff(src.get(), dst.get(), std::cout, options); - - return 0; -} diff --git a/tools/fuzz/fuzz.cpp b/tools/fuzz/fuzz.cpp index 306f9255..422bea53 100644 --- a/tools/fuzz/fuzz.cpp +++ b/tools/fuzz/fuzz.cpp @@ -630,7 +630,7 @@ bool Fuzz(const spv_target_env& target_env, std::move(ir_context), std::move(transformation_context), std::move(fuzzer_context), message_consumer, donor_suppliers, fuzzer_options->all_passes_enabled, repeated_pass_strategy, - fuzzer_options->fuzzer_pass_validation_enabled, validator_options, false); + fuzzer_options->fuzzer_pass_validation_enabled, validator_options); auto fuzz_result = fuzzer.Run(0); if (fuzz_result.status == spvtools::fuzz::Fuzzer::Status::kFuzzerPassLedToInvalidModule) { @@ -673,19 +673,6 @@ void DumpTransformationsBinary( transformations_file.close(); } -// The Chromium project applies the following patch to the protobuf library: -// -// source.chromium.org/chromium/chromium/src/+/main:third_party/protobuf/patches/0003-remove-static-initializers.patch -// -// This affects how Status objects must be constructed. This method provides a -// convenient way to get the OK status that works both with and without the -// patch. With the patch OK is a StatusPod, from which a Status can be -// constructed. Without the patch, OK is already a Status, and we harmlessly -// copy-construct the result from it. -google::protobuf::util::Status GetProtobufOkStatus() { - return google::protobuf::util::Status(google::protobuf::util::Status::OK); -} - // Dumps |transformations| to file |filename| in JSON format. Useful for // interactive debugging. void DumpTransformationsJson( @@ -696,7 +683,7 @@ void DumpTransformationsJson( json_options.add_whitespace = true; auto json_generation_status = google::protobuf::util::MessageToJsonString( transformations, &json_string, json_options); - if (json_generation_status == GetProtobufOkStatus()) { + if (json_generation_status == google::protobuf::util::Status::OK) { std::ofstream transformations_json_file(filename); transformations_json_file << json_string; transformations_json_file.close(); @@ -747,8 +734,9 @@ int main(int argc, const char** argv) { std::string facts_json_string((std::istreambuf_iterator(facts_input)), std::istreambuf_iterator()); facts_input.close(); - if (GetProtobufOkStatus() != google::protobuf::util::JsonStringToMessage( - facts_json_string, &initial_facts)) { + if (google::protobuf::util::Status::OK != + google::protobuf::util::JsonStringToMessage(facts_json_string, + &initial_facts)) { spvtools::Error(FuzzDiagnostic, nullptr, {}, "Error reading facts data"); return 1; } @@ -828,7 +816,7 @@ int main(int argc, const char** argv) { json_options.add_whitespace = true; auto json_generation_status = google::protobuf::util::MessageToJsonString( transformations_applied, &json_string, json_options); - if (json_generation_status != GetProtobufOkStatus()) { + if (json_generation_status != google::protobuf::util::Status::OK) { spvtools::Error(FuzzDiagnostic, nullptr, {}, "Error writing out transformations in JSON format"); return 1; diff --git a/tools/io.h b/tools/io.h index 83a85c1d..aff9eabd 100644 --- a/tools/io.h +++ b/tools/io.h @@ -89,7 +89,7 @@ bool ReadBinaryFile(const char* filename, std::vector* data) { ReadFile(fp, data); bool succeeded = WasFileCorrectlyRead(fp, filename); - if (use_file && fp) fclose(fp); + if (use_file) fclose(fp); return succeeded; } @@ -111,7 +111,7 @@ bool ReadTextFile(const char* filename, std::vector* data) { ReadFile(fp, data); bool succeeded = WasFileCorrectlyRead(fp, filename); - if (use_file && fp) fclose(fp); + if (use_file) fclose(fp); return succeeded; } diff --git a/tools/lint/lint.cpp b/tools/lint/lint.cpp deleted file mode 100644 index 5c2a82ac..00000000 --- a/tools/lint/lint.cpp +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) 2021 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include - -#include "source/opt/log.h" -#include "spirv-tools/linter.hpp" -#include "tools/io.h" -#include "tools/util/cli_consumer.h" - -const auto kDefaultEnvironment = SPV_ENV_UNIVERSAL_1_5; - -namespace { -// Status and actions to perform after parsing command-line arguments. -enum LintActions { LINT_CONTINUE, LINT_STOP }; - -struct LintStatus { - LintActions action; - int code; -}; - -// Parses command-line flags. |argc| contains the number of command-line flags. -// |argv| points to an array of strings holding the flags. -// -// On return, this function stores the name of the input program in |in_file|. -// The return value indicates whether optimization should continue and a status -// code indicating an error or success. -LintStatus ParseFlags(int argc, const char** argv, const char** in_file) { - // TODO (dongja): actually parse flags, etc. - if (argc != 2) { - spvtools::Error(spvtools::utils::CLIMessageConsumer, nullptr, {}, - "expected exactly one argument: in_file"); - return {LINT_STOP, 1}; - } - - *in_file = argv[1]; - - return {LINT_CONTINUE, 0}; -} -} // namespace - -int main(int argc, const char** argv) { - const char* in_file = nullptr; - - spv_target_env target_env = kDefaultEnvironment; - - spvtools::Linter linter(target_env); - linter.SetMessageConsumer(spvtools::utils::CLIMessageConsumer); - - LintStatus status = ParseFlags(argc, argv, &in_file); - - if (status.action == LINT_STOP) { - return status.code; - } - - std::vector binary; - if (!ReadBinaryFile(in_file, &binary)) { - return 1; - } - - bool ok = linter.Run(binary.data(), binary.size()); - - return ok ? 0 : 1; -} diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index 28770cb9..b9339abe 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -143,15 +143,6 @@ Options (in lexicographical order):)", does not support RelaxedPrecision or ignores it. This pass also removes all RelaxedPrecision decorations.)"); printf(R"( - --convert-to-sampled-image ": ..." - convert images and/or samplers with the given pairs of descriptor - set and binding to sampled images. If a pair of an image and a - sampler have the same pair of descriptor set and binding that is - one of the given pairs, they will be converted to a sampled - image. In addition, if only an image or a sampler has the - descriptor set and binding that is one of the given pairs, it - will be converted to a sampled image.)"); - printf(R"( --copy-propagate-arrays Does propagation of memory references when an array is a copy of another. It will only propagate an array if the source is never @@ -415,12 +406,6 @@ Options (in lexicographical order):)", Removes duplicate types, decorations, capabilities and extension instructions.)"); printf(R"( - --remove-unused-interface-variables - Removes variables referenced on the |OpEntryPoint| instruction - that are not referenced in the entry point function or any function - in its call tree. Note that this could cause the shader interface - to no longer match other shader stages.)"); - printf(R"( --replace-invalid-opcode Replaces instructions whose opcode is valid for shader modules, but not for the current shader stage. To have an effect, all diff --git a/tools/sva/yarn.lock b/tools/sva/yarn.lock index afa11f6c..c46b9017 100644 --- a/tools/sva/yarn.lock +++ b/tools/sva/yarn.lock @@ -694,9 +694,9 @@ get-stream@^4.0.0: pump "^3.0.0" glob-parent@^5.0.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + version "5.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.0.0.tgz#1dc99f0f39b006d3e92c2c284068382f0c20e954" + integrity sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg== dependencies: is-glob "^4.0.1" @@ -938,9 +938,9 @@ locate-path@^3.0.0: path-exists "^3.0.0" lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.14: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + version "4.17.19" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b" + integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ== log-symbols@2.2.0: version "2.2.0" diff --git a/tools/val/val.cpp b/tools/val/val.cpp index 55321dab..21a7d8f4 100644 --- a/tools/val/val.cpp +++ b/tools/val/val.cpp @@ -64,8 +64,6 @@ Options: --relax-struct-store Allow store from one struct type to a different type with compatible layout and members. - --allow-localsizeid Allow use of the LocalSizeId decoration where it would otherwise not - be allowed by the target environment. --before-hlsl-legalization Allows code patterns that are intended to be fixed by spirv-opt's legalization passes. --version Display validator version information. @@ -155,8 +153,6 @@ int main(int argc, char** argv) { options.SetWorkgroupScalarBlockLayout(true); } else if (0 == strcmp(cur_arg, "--skip-block-layout")) { options.SetSkipBlockLayout(true); - } else if (0 == strcmp(cur_arg, "--allow-localsizeid")) { - options.SetAllowLocalSizeId(true); } else if (0 == strcmp(cur_arg, "--relax-struct-store")) { options.SetRelaxStructStore(true); } else if (0 == cur_arg[1]) { diff --git a/utils/check_copyright.py b/utils/check_copyright.py index 49892ee6..1bc39f67 100755 --- a/utils/check_copyright.py +++ b/utils/check_copyright.py @@ -37,11 +37,8 @@ AUTHORS = ['The Khronos Group Inc.', 'Vasyl Teliman', 'Advanced Micro Devices, Inc.', 'Stefano Milizia', - 'Alastair F. Donaldson', - 'Mostafa Ashraf', - 'Shiyu Liu', - 'ZHOU He'] -CURRENT_YEAR='2021' + 'Alastair F. Donaldson'] +CURRENT_YEAR='2020' YEARS = '(2014-2016|2015-2016|2015-2020|2016|2016-2017|2017|2017-2019|2018|2019|2020|2021)' COPYRIGHT_RE = re.compile( @@ -132,7 +129,7 @@ def insert_copyright(author, glob, comment_prefix): update_file = False for line in fileinput.input(file, inplace=1): emit = True - if state == 0: + if state is 0: if COPYRIGHT_RE.search(line): state = 1 elif skip(line): @@ -143,7 +140,7 @@ def insert_copyright(author, glob, comment_prefix): sys.stdout.write(licensed) # Assume there isn't a previous license notice. state = 1 - elif state == 1: + elif state is 1: if MIT_BEGIN_RE.search(line): state = 2 emit = False @@ -151,7 +148,7 @@ def insert_copyright(author, glob, comment_prefix): # Assume an Apache license is preceded by a copyright # notice. So just emit it like the rest of the file. state = 9 - elif state == 2: + elif state is 2: # Replace the MIT license with Apache 2 emit = False if MIT_END_RE.search(line): diff --git a/utils/check_symbol_exports.py b/utils/check_symbol_exports.py index 7795d72b..bcd77da6 100755 --- a/utils/check_symbol_exports.py +++ b/utils/check_symbol_exports.py @@ -12,13 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -"""Ensures that all externally visible functions in the library have an appropriate name - -Appropriate function names are: - - names starting with spv, - - anything in a namespace, - - functions added by the protobuf compiler, - - and weak definitions of new and delete.""" +"""Checks names of global exports from a library.""" import os.path import re @@ -52,16 +46,14 @@ def check_library(library): exports are namespaced or begin with spv (in either C or C++ styles) then return 0. Otherwise emit a message and return 1.""" - # The pattern for an externally visible symbol record - symbol_pattern = re.compile(r'^[0-aA-Fa-f]+ +([wg]) *F \.text.*[0-9A-Fa-f]+ +(.*)') + # The pattern for a global symbol record + symbol_pattern = re.compile(r'^[0-aA-Fa-f]+ g *F \.text.*[0-9A-Fa-f]+ +(.*)') # Ok patterns are as follows, assuming Itanium name mangling: # spv[A-Z] : extern "C" symbol starting with spv # _ZN : something in a namespace - # _ZSt : something in the standard namespace - # _ZZN : something in a local scope and namespace # _Z[0-9]+spv[A-Z_] : C++ symbol starting with spv[A-Z_] - symbol_ok_pattern = re.compile(r'^(spv[A-Z]|_ZN|_ZSt|_ZZN|_Z[0-9]+spv[A-Z_])') + symbol_ok_pattern = re.compile(r'^(spv[A-Z]|_ZN|_Z[0-9]+spv[A-Z_])') # In addition, the following pattern allowlists global functions that are added # by the protobuf compiler: @@ -69,31 +61,18 @@ def check_library(library): # - InitDefaults_spvtoolsfuzz_2eproto() symbol_allowlist_pattern = re.compile(r'_Z[0-9]+(InitDefaults|AddDescriptors)_spvtoolsfuzz_2eprotov') - symbol_is_new_or_delete = re.compile(r'^(_Zna|_Znw|_Zdl|_Zda)') - # Compilaion for Arm has various thunks for constructors, destructors, vtables. - # They are weak. - symbol_is_thunk = re.compile(r'^_ZT') - - # This occurs in NDK builds. - symbol_is_hidden = re.compile(r'^\.hidden ') - seen = set() result = 0 for line in command_output(['objdump', '-t', library], '.').split('\n'): match = symbol_pattern.search(line) if match: - linkage = match.group(1) - symbol = match.group(2) + symbol = match.group(1) if symbol not in seen: seen.add(symbol) #print("look at '{}'".format(symbol)) - if not (symbol_is_new_or_delete.match(symbol) and linkage == 'w'): - if not (symbol_is_thunk.match(symbol) and linkage == 'w'): - if not (symbol_allowlist_pattern.match(symbol) or - symbol_ok_pattern.match(symbol) or - symbol_is_hidden.match(symbol)): - print('{}: error: Unescaped exported symbol: {}'.format(PROG, symbol)) - result = 1 + if not (symbol_allowlist_pattern.match(symbol) or symbol_ok_pattern.match(symbol)): + print('{}: error: Unescaped exported symbol: {}'.format(PROG, symbol)) + result = 1 return result diff --git a/utils/generate_grammar_tables.py b/utils/generate_grammar_tables.py index 9ccf410b..c4ed180a 100755 --- a/utils/generate_grammar_tables.py +++ b/utils/generate_grammar_tables.py @@ -523,17 +523,17 @@ def generate_operand_kind_table(enums): enums = [generate_enum_operand_kind(e, exts) for e in enums] exts_arrays = generate_extension_arrays(exts) - # We have a few operand kinds that require their optional counterpart to + # We have three operand kinds that requires their optional counterpart to # exist in the operand info table. - optional_enums = ['ImageOperands', 'AccessQualifier', 'MemoryAccess', 'PackedVectorFormat'] - optional_enums = [e for e in enums if e[0] in optional_enums] - enums.extend(optional_enums) + three_optional_enums = ['ImageOperands', 'AccessQualifier', 'MemoryAccess'] + three_optional_enums = [e for e in enums if e[0] in three_optional_enums] + enums.extend(three_optional_enums) enum_kinds, enum_names, enum_entries = zip(*enums) - # Mark the last few as optional ones. - enum_quantifiers = [''] * (len(enums) - len(optional_enums)) + ['?'] * len(optional_enums) + # Mark the last three as optional ones. + enum_quantifiers = [''] * (len(enums) - 3) + ['?'] * 3 # And we don't want redefinition of them. - enum_entries = enum_entries[:-len(optional_enums)] + enum_entries = enum_entries[:-3] enum_kinds = [convert_operand_kind(e) for e in zip(enum_kinds, enum_quantifiers)] table_entries = zip(enum_kinds, enum_names, enum_names) diff --git a/utils/vscode/install.sh b/utils/vscode/install.sh index de54c623..01fc9140 100755 --- a/utils/vscode/install.sh +++ b/utils/vscode/install.sh @@ -18,17 +18,15 @@ set -e # Fail on any error. EXT_PATH=~/.vscode/extensions/google.spirvls-0.0.1 ROOT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -pushd ${ROOT_PATH} - go run ./src/tools/gen-grammar.go --cache ./cache --template ./spirv.json.tmpl --out ./spirv.json - go run ./src/tools/gen-grammar.go --cache ./cache --template ./src/schema/schema.go.tmpl --out ./src/schema/schema.go +go run ${ROOT_PATH}/src/tools/gen-grammar.go --cache ${ROOT_PATH}/cache --template ${ROOT_PATH}/spirv.json.tmpl --out ${ROOT_PATH}/spirv.json +go run ${ROOT_PATH}/src/tools/gen-grammar.go --cache ${ROOT_PATH}/cache --template ${ROOT_PATH}/src/schema/schema.go.tmpl --out ${ROOT_PATH}/src/schema/schema.go - mkdir -p ${EXT_PATH} - cp ./extension.js ${EXT_PATH} - cp ./package.json ${EXT_PATH} - cp ./spirv.json ${EXT_PATH} +mkdir -p ${EXT_PATH} +cp ${ROOT_PATH}/extension.js ${EXT_PATH} +cp ${ROOT_PATH}/package.json ${EXT_PATH} +cp ${ROOT_PATH}/spirv.json ${EXT_PATH} - go build -o ${EXT_PATH}/langsvr ./src/langsvr.go -popd +go build -o ${EXT_PATH}/langsvr ${ROOT_PATH}/src/langsvr.go cd ${EXT_PATH} npm install diff --git a/utils/vscode/spirv.json b/utils/vscode/spirv.json index 2e88296e..29b679c3 100644 --- a/utils/vscode/spirv.json +++ b/utils/vscode/spirv.json @@ -1,7 +1,7 @@ { "scopeName": "source.spirv", "name": "SPIR-V", - "comment": "Generated by gen-grammar.go --template=./spirv.json.tmpl --out=./spirv.json. Do not modify this file directly.", + "comment": "Generated by gen-grammar.go --template=../../spirv.json.tmpl --out=../../spirv.json. Do not modify this file directly.", "patterns": [ { "include": "#BitEnum_ImageOperands" }, { "include": "#BitEnum_FPFastMathMode" }, @@ -12,6 +12,7 @@ { "include": "#BitEnum_MemoryAccess" }, { "include": "#BitEnum_KernelProfilingInfo" }, { "include": "#BitEnum_RayFlags" }, + { "include": "#BitEnum_FragmentShadingRate" }, { "include": "#ValueEnum_SourceLanguage" }, { "include": "#ValueEnum_ExecutionModel" }, { "include": "#ValueEnum_AddressingModel" }, @@ -25,6 +26,8 @@ { "include": "#ValueEnum_ImageChannelOrder" }, { "include": "#ValueEnum_ImageChannelDataType" }, { "include": "#ValueEnum_FPRoundingMode" }, + { "include": "#ValueEnum_FPDenormMode" }, + { "include": "#ValueEnum_FPOperationMode" }, { "include": "#ValueEnum_LinkageType" }, { "include": "#ValueEnum_AccessQualifier" }, { "include": "#ValueEnum_FunctionParameterAttribute" }, @@ -57,7 +60,7 @@ "name": "keyword.spirv" }, "BitEnum_FPFastMathMode": { - "match": "\\b(None|NotNaN|NotInf|NSZ|AllowRecip|Fast)\\b", + "match": "\\b(None|NotNaN|NotInf|NSZ|AllowRecip|Fast|AllowContractFastINTEL|AllowReassocINTEL)\\b", "name": "keyword.spirv" }, "BitEnum_SelectionControl": { @@ -65,7 +68,7 @@ "name": "keyword.spirv" }, "BitEnum_LoopControl": { - "match": "\\b(None|Unroll|DontUnroll|DependencyInfinite|DependencyLength|MinIterations|MaxIterations|IterationMultiple|PeelCount|PartialCount)\\b", + "match": "\\b(None|Unroll|DontUnroll|DependencyInfinite|DependencyLength|MinIterations|MaxIterations|IterationMultiple|PeelCount|PartialCount|InitiationIntervalINTEL|MaxConcurrencyINTEL|DependencyArrayINTEL|PipelineEnableINTEL|LoopCoalesceINTEL|MaxInterleavingINTEL|SpeculatedIterationsINTEL|NoFusionINTEL)\\b", "name": "keyword.spirv" }, "BitEnum_FunctionControl": { @@ -88,6 +91,10 @@ "match": "\\b(NoneKHR|OpaqueKHR|NoOpaqueKHR|TerminateOnFirstHitKHR|SkipClosestHitShaderKHR|CullBackFacingTrianglesKHR|CullFrontFacingTrianglesKHR|CullOpaqueKHR|CullNoOpaqueKHR|SkipTrianglesKHR|SkipAABBsKHR)\\b", "name": "keyword.spirv" }, + "BitEnum_FragmentShadingRate": { + "match": "\\b(Vertical2Pixels|Vertical4Pixels|Horizontal2Pixels|Horizontal4Pixels)\\b", + "name": "keyword.spirv" + }, "ValueEnum_SourceLanguage": { "match": "\\b(Unknown|ESSL|GLSL|OpenCL_C|OpenCL_CPP|HLSL)\\b", "name": "keyword.spirv" @@ -105,11 +112,11 @@ "name": "keyword.spirv" }, "ValueEnum_ExecutionMode": { - "match": "\\b(Invocations|SpacingEqual|SpacingFractionalEven|SpacingFractionalOdd|VertexOrderCw|VertexOrderCcw|PixelCenterInteger|OriginUpperLeft|OriginLowerLeft|EarlyFragmentTests|PointMode|Xfb|DepthReplacing|DepthGreater|DepthLess|DepthUnchanged|LocalSize|LocalSizeHint|InputPoints|InputLines|InputLinesAdjacency|Triangles|InputTrianglesAdjacency|Quads|Isolines|OutputVertices|OutputPoints|OutputLineStrip|OutputTriangleStrip|VecTypeHint|ContractionOff|Initializer|Finalizer|SubgroupSize|SubgroupsPerWorkgroup|SubgroupsPerWorkgroupId|LocalSizeId|LocalSizeHintId|PostDepthCoverage|DenormPreserve|DenormFlushToZero|SignedZeroInfNanPreserve|RoundingModeRTE|RoundingModeRTZ|StencilRefReplacingEXT|OutputLinesNV|OutputPrimitivesNV|DerivativeGroupQuadsNV|DerivativeGroupLinearNV|OutputTrianglesNV|PixelInterlockOrderedEXT|PixelInterlockUnorderedEXT|SampleInterlockOrderedEXT|SampleInterlockUnorderedEXT|ShadingRateInterlockOrderedEXT|ShadingRateInterlockUnorderedEXT)\\b", + "match": "\\b(Invocations|SpacingEqual|SpacingFractionalEven|SpacingFractionalOdd|VertexOrderCw|VertexOrderCcw|PixelCenterInteger|OriginUpperLeft|OriginLowerLeft|EarlyFragmentTests|PointMode|Xfb|DepthReplacing|DepthGreater|DepthLess|DepthUnchanged|LocalSize|LocalSizeHint|InputPoints|InputLines|InputLinesAdjacency|Triangles|InputTrianglesAdjacency|Quads|Isolines|OutputVertices|OutputPoints|OutputLineStrip|OutputTriangleStrip|VecTypeHint|ContractionOff|Initializer|Finalizer|SubgroupSize|SubgroupsPerWorkgroup|SubgroupsPerWorkgroupId|LocalSizeId|LocalSizeHintId|PostDepthCoverage|DenormPreserve|DenormFlushToZero|SignedZeroInfNanPreserve|RoundingModeRTE|RoundingModeRTZ|StencilRefReplacingEXT|OutputLinesNV|OutputPrimitivesNV|DerivativeGroupQuadsNV|DerivativeGroupLinearNV|OutputTrianglesNV|PixelInterlockOrderedEXT|PixelInterlockUnorderedEXT|SampleInterlockOrderedEXT|SampleInterlockUnorderedEXT|ShadingRateInterlockOrderedEXT|ShadingRateInterlockUnorderedEXT|SharedLocalMemorySizeINTEL|RoundingModeRTPINTEL|RoundingModeRTNINTEL|FloatingPointModeALTINTEL|FloatingPointModeIEEEINTEL|MaxWorkgroupSizeINTEL|MaxWorkDimINTEL|NoGlobalOffsetINTEL|NumSIMDWorkitemsINTEL|SchedulerTargetFmaxMhzINTEL)\\b", "name": "keyword.spirv" }, "ValueEnum_StorageClass": { - "match": "\\b(UniformConstant|Input|Uniform|Output|Workgroup|CrossWorkgroup|Private|Function|Generic|PushConstant|AtomicCounter|Image|StorageBuffer|CallableDataNV|CallableDataKHR|IncomingCallableDataNV|IncomingCallableDataKHR|RayPayloadNV|RayPayloadKHR|HitAttributeNV|HitAttributeKHR|IncomingRayPayloadNV|IncomingRayPayloadKHR|ShaderRecordBufferNV|ShaderRecordBufferKHR|PhysicalStorageBuffer|PhysicalStorageBufferEXT)\\b", + "match": "\\b(UniformConstant|Input|Uniform|Output|Workgroup|CrossWorkgroup|Private|Function|Generic|PushConstant|AtomicCounter|Image|StorageBuffer|CallableDataNV|CallableDataKHR|IncomingCallableDataNV|IncomingCallableDataKHR|RayPayloadNV|RayPayloadKHR|HitAttributeNV|HitAttributeKHR|IncomingRayPayloadNV|IncomingRayPayloadKHR|ShaderRecordBufferNV|ShaderRecordBufferKHR|PhysicalStorageBuffer|PhysicalStorageBufferEXT|CodeSectionINTEL|DeviceOnlyINTEL|HostOnlyINTEL)\\b", "name": "keyword.spirv" }, "ValueEnum_Dim": { @@ -125,7 +132,7 @@ "name": "keyword.spirv" }, "ValueEnum_ImageFormat": { - "match": "\\b(Unknown|Rgba32f|Rgba16f|R32f|Rgba8|Rgba8Snorm|Rg32f|Rg16f|R11fG11fB10f|R16f|Rgba16|Rgb10A2|Rg16|Rg8|R16|R8|Rgba16Snorm|Rg16Snorm|Rg8Snorm|R16Snorm|R8Snorm|Rgba32i|Rgba16i|Rgba8i|R32i|Rg32i|Rg16i|Rg8i|R16i|R8i|Rgba32ui|Rgba16ui|Rgba8ui|R32ui|Rgb10a2ui|Rg32ui|Rg16ui|Rg8ui|R16ui|R8ui)\\b", + "match": "\\b(Unknown|Rgba32f|Rgba16f|R32f|Rgba8|Rgba8Snorm|Rg32f|Rg16f|R11fG11fB10f|R16f|Rgba16|Rgb10A2|Rg16|Rg8|R16|R8|Rgba16Snorm|Rg16Snorm|Rg8Snorm|R16Snorm|R8Snorm|Rgba32i|Rgba16i|Rgba8i|R32i|Rg32i|Rg16i|Rg8i|R16i|R8i|Rgba32ui|Rgba16ui|Rgba8ui|R32ui|Rgb10a2ui|Rg32ui|Rg16ui|Rg8ui|R16ui|R8ui|R64ui|R64i)\\b", "name": "keyword.spirv" }, "ValueEnum_ImageChannelOrder": { @@ -140,6 +147,14 @@ "match": "\\b(RTE|RTZ|RTP|RTN)\\b", "name": "keyword.spirv" }, + "ValueEnum_FPDenormMode": { + "match": "\\b(Preserve|FlushToZero)\\b", + "name": "keyword.spirv" + }, + "ValueEnum_FPOperationMode": { + "match": "\\b(IEEE|ALT)\\b", + "name": "keyword.spirv" + }, "ValueEnum_LinkageType": { "match": "\\b(Export|Import)\\b", "name": "keyword.spirv" @@ -153,11 +168,11 @@ "name": "keyword.spirv" }, "ValueEnum_Decoration": { - "match": "\\b(RelaxedPrecision|SpecId|Block|BufferBlock|RowMajor|ColMajor|ArrayStride|MatrixStride|GLSLShared|GLSLPacked|CPacked|BuiltIn|NoPerspective|Flat|Patch|Centroid|Sample|Invariant|Restrict|Aliased|Volatile|Constant|Coherent|NonWritable|NonReadable|Uniform|UniformId|SaturatedConversion|Stream|Location|Component|Index|Binding|DescriptorSet|Offset|XfbBuffer|XfbStride|FuncParamAttr|FPRoundingMode|FPFastMathMode|LinkageAttributes|NoContraction|InputAttachmentIndex|Alignment|MaxByteOffset|AlignmentId|MaxByteOffsetId|NoSignedWrap|NoUnsignedWrap|ExplicitInterpAMD|OverrideCoverageNV|PassthroughNV|ViewportRelativeNV|SecondaryViewportRelativeNV|PerPrimitiveNV|PerViewNV|PerTaskNV|PerVertexNV|NonUniform|NonUniformEXT|RestrictPointer|RestrictPointerEXT|AliasedPointer|AliasedPointerEXT|CounterBuffer|HlslCounterBufferGOOGLE|UserSemantic|HlslSemanticGOOGLE|UserTypeGOOGLE)\\b", + "match": "\\b(RelaxedPrecision|SpecId|Block|BufferBlock|RowMajor|ColMajor|ArrayStride|MatrixStride|GLSLShared|GLSLPacked|CPacked|BuiltIn|NoPerspective|Flat|Patch|Centroid|Sample|Invariant|Restrict|Aliased|Volatile|Constant|Coherent|NonWritable|NonReadable|Uniform|UniformId|SaturatedConversion|Stream|Location|Component|Index|Binding|DescriptorSet|Offset|XfbBuffer|XfbStride|FuncParamAttr|FPRoundingMode|FPFastMathMode|LinkageAttributes|NoContraction|InputAttachmentIndex|Alignment|MaxByteOffset|AlignmentId|MaxByteOffsetId|NoSignedWrap|NoUnsignedWrap|ExplicitInterpAMD|OverrideCoverageNV|PassthroughNV|ViewportRelativeNV|SecondaryViewportRelativeNV|PerPrimitiveNV|PerViewNV|PerTaskNV|PerVertexNV|NonUniform|NonUniformEXT|RestrictPointer|RestrictPointerEXT|AliasedPointer|AliasedPointerEXT|SIMTCallINTEL|ReferencedIndirectlyINTEL|ClobberINTEL|SideEffectsINTEL|VectorComputeVariableINTEL|FuncParamIOKindINTEL|VectorComputeFunctionINTEL|StackCallINTEL|GlobalVariableOffsetINTEL|CounterBuffer|HlslCounterBufferGOOGLE|UserSemantic|HlslSemanticGOOGLE|UserTypeGOOGLE|FunctionRoundingModeINTEL|FunctionDenormModeINTEL|RegisterINTEL|MemoryINTEL|NumbanksINTEL|BankwidthINTEL|MaxPrivateCopiesINTEL|SinglepumpINTEL|DoublepumpINTEL|MaxReplicatesINTEL|SimpleDualPortINTEL|MergeINTEL|BankBitsINTEL|ForcePow2DepthINTEL|BurstCoalesceINTEL|CacheSizeINTEL|DontStaticallyCoalesceINTEL|PrefetchINTEL|StallEnableINTEL|FuseLoopsInFunctionINTEL|BufferLocationINTEL|IOPipeStorageINTEL|FunctionFloatingPointModeINTEL|SingleElementVectorINTEL|VectorComputeCallableFunctionINTEL)\\b", "name": "keyword.spirv" }, "ValueEnum_BuiltIn": { - "match": "\\b(Position|PointSize|ClipDistance|CullDistance|VertexId|InstanceId|PrimitiveId|InvocationId|Layer|ViewportIndex|TessLevelOuter|TessLevelInner|TessCoord|PatchVertices|FragCoord|PointCoord|FrontFacing|SampleId|SamplePosition|SampleMask|FragDepth|HelperInvocation|NumWorkgroups|WorkgroupSize|WorkgroupId|LocalInvocationId|GlobalInvocationId|LocalInvocationIndex|WorkDim|GlobalSize|EnqueuedWorkgroupSize|GlobalOffset|GlobalLinearId|SubgroupSize|SubgroupMaxSize|NumSubgroups|NumEnqueuedSubgroups|SubgroupId|SubgroupLocalInvocationId|VertexIndex|InstanceIndex|SubgroupEqMask|SubgroupGeMask|SubgroupGtMask|SubgroupLeMask|SubgroupLtMask|SubgroupEqMaskKHR|SubgroupGeMaskKHR|SubgroupGtMaskKHR|SubgroupLeMaskKHR|SubgroupLtMaskKHR|BaseVertex|BaseInstance|DrawIndex|DeviceIndex|ViewIndex|BaryCoordNoPerspAMD|BaryCoordNoPerspCentroidAMD|BaryCoordNoPerspSampleAMD|BaryCoordSmoothAMD|BaryCoordSmoothCentroidAMD|BaryCoordSmoothSampleAMD|BaryCoordPullModelAMD|FragStencilRefEXT|ViewportMaskNV|SecondaryPositionNV|SecondaryViewportMaskNV|PositionPerViewNV|ViewportMaskPerViewNV|FullyCoveredEXT|TaskCountNV|PrimitiveCountNV|PrimitiveIndicesNV|ClipDistancePerViewNV|CullDistancePerViewNV|LayerPerViewNV|MeshViewCountNV|MeshViewIndicesNV|BaryCoordNV|BaryCoordNoPerspNV|FragSizeEXT|FragmentSizeNV|FragInvocationCountEXT|InvocationsPerPixelNV|LaunchIdNV|LaunchIdKHR|LaunchSizeNV|LaunchSizeKHR|WorldRayOriginNV|WorldRayOriginKHR|WorldRayDirectionNV|WorldRayDirectionKHR|ObjectRayOriginNV|ObjectRayOriginKHR|ObjectRayDirectionNV|ObjectRayDirectionKHR|RayTminNV|RayTminKHR|RayTmaxNV|RayTmaxKHR|InstanceCustomIndexNV|InstanceCustomIndexKHR|ObjectToWorldNV|ObjectToWorldKHR|WorldToObjectNV|WorldToObjectKHR|HitTNV|HitTKHR|HitKindNV|HitKindKHR|IncomingRayFlagsNV|IncomingRayFlagsKHR|RayGeometryIndexKHR|WarpsPerSMNV|SMCountNV|WarpIDNV|SMIDNV)\\b", + "match": "\\b(Position|PointSize|ClipDistance|CullDistance|VertexId|InstanceId|PrimitiveId|InvocationId|Layer|ViewportIndex|TessLevelOuter|TessLevelInner|TessCoord|PatchVertices|FragCoord|PointCoord|FrontFacing|SampleId|SamplePosition|SampleMask|FragDepth|HelperInvocation|NumWorkgroups|WorkgroupSize|WorkgroupId|LocalInvocationId|GlobalInvocationId|LocalInvocationIndex|WorkDim|GlobalSize|EnqueuedWorkgroupSize|GlobalOffset|GlobalLinearId|SubgroupSize|SubgroupMaxSize|NumSubgroups|NumEnqueuedSubgroups|SubgroupId|SubgroupLocalInvocationId|VertexIndex|InstanceIndex|SubgroupEqMask|SubgroupEqMaskKHR|SubgroupGeMask|SubgroupGeMaskKHR|SubgroupGtMask|SubgroupGtMaskKHR|SubgroupLeMask|SubgroupLeMaskKHR|SubgroupLtMask|SubgroupLtMaskKHR|BaseVertex|BaseInstance|DrawIndex|PrimitiveShadingRateKHR|DeviceIndex|ViewIndex|ShadingRateKHR|BaryCoordNoPerspAMD|BaryCoordNoPerspCentroidAMD|BaryCoordNoPerspSampleAMD|BaryCoordSmoothAMD|BaryCoordSmoothCentroidAMD|BaryCoordSmoothSampleAMD|BaryCoordPullModelAMD|FragStencilRefEXT|ViewportMaskNV|SecondaryPositionNV|SecondaryViewportMaskNV|PositionPerViewNV|ViewportMaskPerViewNV|FullyCoveredEXT|TaskCountNV|PrimitiveCountNV|PrimitiveIndicesNV|ClipDistancePerViewNV|CullDistancePerViewNV|LayerPerViewNV|MeshViewCountNV|MeshViewIndicesNV|BaryCoordNV|BaryCoordNoPerspNV|FragSizeEXT|FragmentSizeNV|FragInvocationCountEXT|InvocationsPerPixelNV|LaunchIdNV|LaunchIdKHR|LaunchSizeNV|LaunchSizeKHR|WorldRayOriginNV|WorldRayOriginKHR|WorldRayDirectionNV|WorldRayDirectionKHR|ObjectRayOriginNV|ObjectRayOriginKHR|ObjectRayDirectionNV|ObjectRayDirectionKHR|RayTminNV|RayTminKHR|RayTmaxNV|RayTmaxKHR|InstanceCustomIndexNV|InstanceCustomIndexKHR|ObjectToWorldNV|ObjectToWorldKHR|WorldToObjectNV|WorldToObjectKHR|HitTNV|HitKindNV|HitKindKHR|IncomingRayFlagsNV|IncomingRayFlagsKHR|RayGeometryIndexKHR|WarpsPerSMNV|SMCountNV|WarpIDNV|SMIDNV)\\b", "name": "keyword.spirv" }, "ValueEnum_Scope": { @@ -173,7 +188,7 @@ "name": "keyword.spirv" }, "ValueEnum_Capability": { - "match": "\\b(Matrix|Shader|Geometry|Tessellation|Addresses|Linkage|Kernel|Vector16|Float16Buffer|Float16|Float64|Int64|Int64Atomics|ImageBasic|ImageReadWrite|ImageMipmap|Pipes|Groups|DeviceEnqueue|LiteralSampler|AtomicStorage|Int16|TessellationPointSize|GeometryPointSize|ImageGatherExtended|StorageImageMultisample|UniformBufferArrayDynamicIndexing|SampledImageArrayDynamicIndexing|StorageBufferArrayDynamicIndexing|StorageImageArrayDynamicIndexing|ClipDistance|CullDistance|ImageCubeArray|SampleRateShading|ImageRect|SampledRect|GenericPointer|Int8|InputAttachment|SparseResidency|MinLod|Sampled1D|Image1D|SampledCubeArray|SampledBuffer|ImageBuffer|ImageMSArray|StorageImageExtendedFormats|ImageQuery|DerivativeControl|InterpolationFunction|TransformFeedback|GeometryStreams|StorageImageReadWithoutFormat|StorageImageWriteWithoutFormat|MultiViewport|SubgroupDispatch|NamedBarrier|PipeStorage|GroupNonUniform|GroupNonUniformVote|GroupNonUniformArithmetic|GroupNonUniformBallot|GroupNonUniformShuffle|GroupNonUniformShuffleRelative|GroupNonUniformClustered|GroupNonUniformQuad|ShaderLayer|ShaderViewportIndex|SubgroupBallotKHR|DrawParameters|SubgroupVoteKHR|StorageBuffer16BitAccess|StorageUniformBufferBlock16|UniformAndStorageBuffer16BitAccess|StorageUniform16|StoragePushConstant16|StorageInputOutput16|DeviceGroup|MultiView|VariablePointersStorageBuffer|VariablePointers|AtomicStorageOps|SampleMaskPostDepthCoverage|StorageBuffer8BitAccess|UniformAndStorageBuffer8BitAccess|StoragePushConstant8|DenormPreserve|DenormFlushToZero|SignedZeroInfNanPreserve|RoundingModeRTE|RoundingModeRTZ|RayQueryProvisionalKHR|RayTraversalPrimitiveCullingProvisionalKHR|Float16ImageAMD|ImageGatherBiasLodAMD|FragmentMaskAMD|StencilExportEXT|ImageReadWriteLodAMD|ShaderClockKHR|SampleMaskOverrideCoverageNV|GeometryShaderPassthroughNV|ShaderViewportIndexLayerEXT|ShaderViewportIndexLayerNV|ShaderViewportMaskNV|ShaderStereoViewNV|PerViewAttributesNV|FragmentFullyCoveredEXT|MeshShadingNV|ImageFootprintNV|FragmentBarycentricNV|ComputeDerivativeGroupQuadsNV|FragmentDensityEXT|ShadingRateNV|GroupNonUniformPartitionedNV|ShaderNonUniform|ShaderNonUniformEXT|RuntimeDescriptorArray|RuntimeDescriptorArrayEXT|InputAttachmentArrayDynamicIndexing|InputAttachmentArrayDynamicIndexingEXT|UniformTexelBufferArrayDynamicIndexing|UniformTexelBufferArrayDynamicIndexingEXT|StorageTexelBufferArrayDynamicIndexing|StorageTexelBufferArrayDynamicIndexingEXT|UniformBufferArrayNonUniformIndexing|UniformBufferArrayNonUniformIndexingEXT|SampledImageArrayNonUniformIndexing|SampledImageArrayNonUniformIndexingEXT|StorageBufferArrayNonUniformIndexing|StorageBufferArrayNonUniformIndexingEXT|StorageImageArrayNonUniformIndexing|StorageImageArrayNonUniformIndexingEXT|InputAttachmentArrayNonUniformIndexing|InputAttachmentArrayNonUniformIndexingEXT|UniformTexelBufferArrayNonUniformIndexing|UniformTexelBufferArrayNonUniformIndexingEXT|StorageTexelBufferArrayNonUniformIndexing|StorageTexelBufferArrayNonUniformIndexingEXT|RayTracingNV|VulkanMemoryModel|VulkanMemoryModelKHR|VulkanMemoryModelDeviceScope|VulkanMemoryModelDeviceScopeKHR|PhysicalStorageBufferAddresses|PhysicalStorageBufferAddressesEXT|ComputeDerivativeGroupLinearNV|RayTracingProvisionalKHR|CooperativeMatrixNV|FragmentShaderSampleInterlockEXT|FragmentShaderShadingRateInterlockEXT|ShaderSMBuiltinsNV|FragmentShaderPixelInterlockEXT|DemoteToHelperInvocationEXT|SubgroupShuffleINTEL|SubgroupBufferBlockIOINTEL|SubgroupImageBlockIOINTEL|SubgroupImageMediaBlockIOINTEL|IntegerFunctions2INTEL|SubgroupAvcMotionEstimationINTEL|SubgroupAvcMotionEstimationIntraINTEL|SubgroupAvcMotionEstimationChromaINTEL)\\b", + "match": "\\b(Matrix|Shader|Geometry|Tessellation|Addresses|Linkage|Kernel|Vector16|Float16Buffer|Float16|Float64|Int64|Int64Atomics|ImageBasic|ImageReadWrite|ImageMipmap|Pipes|Groups|DeviceEnqueue|LiteralSampler|AtomicStorage|Int16|TessellationPointSize|GeometryPointSize|ImageGatherExtended|StorageImageMultisample|UniformBufferArrayDynamicIndexing|SampledImageArrayDynamicIndexing|StorageBufferArrayDynamicIndexing|StorageImageArrayDynamicIndexing|ClipDistance|CullDistance|ImageCubeArray|SampleRateShading|ImageRect|SampledRect|GenericPointer|Int8|InputAttachment|SparseResidency|MinLod|Sampled1D|Image1D|SampledCubeArray|SampledBuffer|ImageBuffer|ImageMSArray|StorageImageExtendedFormats|ImageQuery|DerivativeControl|InterpolationFunction|TransformFeedback|GeometryStreams|StorageImageReadWithoutFormat|StorageImageWriteWithoutFormat|MultiViewport|SubgroupDispatch|NamedBarrier|PipeStorage|GroupNonUniform|GroupNonUniformVote|GroupNonUniformArithmetic|GroupNonUniformBallot|GroupNonUniformShuffle|GroupNonUniformShuffleRelative|GroupNonUniformClustered|GroupNonUniformQuad|ShaderLayer|ShaderViewportIndex|FragmentShadingRateKHR|SubgroupBallotKHR|DrawParameters|WorkgroupMemoryExplicitLayoutKHR|WorkgroupMemoryExplicitLayout8BitAccessKHR|WorkgroupMemoryExplicitLayout16BitAccessKHR|SubgroupVoteKHR|StorageBuffer16BitAccess|StorageUniformBufferBlock16|UniformAndStorageBuffer16BitAccess|StorageUniform16|StoragePushConstant16|StorageInputOutput16|DeviceGroup|MultiView|VariablePointersStorageBuffer|VariablePointers|AtomicStorageOps|SampleMaskPostDepthCoverage|StorageBuffer8BitAccess|UniformAndStorageBuffer8BitAccess|StoragePushConstant8|DenormPreserve|DenormFlushToZero|SignedZeroInfNanPreserve|RoundingModeRTE|RoundingModeRTZ|RayQueryProvisionalKHR|RayQueryKHR|RayTraversalPrimitiveCullingKHR|RayTracingKHR|Float16ImageAMD|ImageGatherBiasLodAMD|FragmentMaskAMD|StencilExportEXT|ImageReadWriteLodAMD|Int64ImageEXT|ShaderClockKHR|SampleMaskOverrideCoverageNV|GeometryShaderPassthroughNV|ShaderViewportIndexLayerEXT|ShaderViewportIndexLayerNV|ShaderViewportMaskNV|ShaderStereoViewNV|PerViewAttributesNV|FragmentFullyCoveredEXT|MeshShadingNV|ImageFootprintNV|FragmentBarycentricNV|ComputeDerivativeGroupQuadsNV|FragmentDensityEXT|ShadingRateNV|GroupNonUniformPartitionedNV|ShaderNonUniform|ShaderNonUniformEXT|RuntimeDescriptorArray|RuntimeDescriptorArrayEXT|InputAttachmentArrayDynamicIndexing|InputAttachmentArrayDynamicIndexingEXT|UniformTexelBufferArrayDynamicIndexing|UniformTexelBufferArrayDynamicIndexingEXT|StorageTexelBufferArrayDynamicIndexing|StorageTexelBufferArrayDynamicIndexingEXT|UniformBufferArrayNonUniformIndexing|UniformBufferArrayNonUniformIndexingEXT|SampledImageArrayNonUniformIndexing|SampledImageArrayNonUniformIndexingEXT|StorageBufferArrayNonUniformIndexing|StorageBufferArrayNonUniformIndexingEXT|StorageImageArrayNonUniformIndexing|StorageImageArrayNonUniformIndexingEXT|InputAttachmentArrayNonUniformIndexing|InputAttachmentArrayNonUniformIndexingEXT|UniformTexelBufferArrayNonUniformIndexing|UniformTexelBufferArrayNonUniformIndexingEXT|StorageTexelBufferArrayNonUniformIndexing|StorageTexelBufferArrayNonUniformIndexingEXT|RayTracingNV|VulkanMemoryModel|VulkanMemoryModelKHR|VulkanMemoryModelDeviceScope|VulkanMemoryModelDeviceScopeKHR|PhysicalStorageBufferAddresses|PhysicalStorageBufferAddressesEXT|ComputeDerivativeGroupLinearNV|RayTracingProvisionalKHR|CooperativeMatrixNV|FragmentShaderSampleInterlockEXT|FragmentShaderShadingRateInterlockEXT|ShaderSMBuiltinsNV|FragmentShaderPixelInterlockEXT|DemoteToHelperInvocationEXT|SubgroupShuffleINTEL|SubgroupBufferBlockIOINTEL|SubgroupImageBlockIOINTEL|SubgroupImageMediaBlockIOINTEL|RoundToInfinityINTEL|FloatingPointModeINTEL|IntegerFunctions2INTEL|FunctionPointersINTEL|IndirectReferencesINTEL|AsmINTEL|AtomicFloat32MinMaxEXT|AtomicFloat64MinMaxEXT|AtomicFloat16MinMaxEXT|VectorComputeINTEL|VectorAnyINTEL|SubgroupAvcMotionEstimationINTEL|SubgroupAvcMotionEstimationIntraINTEL|SubgroupAvcMotionEstimationChromaINTEL|VariableLengthArrayINTEL|FunctionFloatControlINTEL|FPGAMemoryAttributesINTEL|FPFastMathModeINTEL|ArbitraryPrecisionIntegersINTEL|UnstructuredLoopControlsINTEL|FPGALoopControlsINTEL|KernelAttributesINTEL|FPGAKernelAttributesINTEL|FPGAMemoryAccessesINTEL|FPGAClusterAttributesINTEL|LoopFuseINTEL|FPGABufferLocationINTEL|USMStorageClassesINTEL|IOPipesINTEL|BlockingPipesINTEL|FPGARegINTEL|AtomicFloat32AddEXT|AtomicFloat64AddEXT|LongConstantCompositeINTEL)\\b", "name": "keyword.spirv" }, "ValueEnum_RayQueryIntersection": { @@ -189,7 +204,7 @@ "name": "keyword.spirv" }, "BitEnum_DebugInfoFlags": { - "match": "\\b(FlagIsProtected|FlagIsPrivate|FlagIsPublic|FlagIsLocal|FlagIsDefinition|FlagFwdDecl|FlagArtificial|FlagExplicit|FlagPrototyped|FlagObjectPointer|FlagStaticMember|FlagIndirectVariable|FlagLValueReference|FlagRValueReference|FlagIsOptimized|FlagIsEnumClass|FlagTypePassByValue|FlagTypePassByReference)\\b", + "match": "\\b(None|FlagIsProtected|FlagIsPrivate|FlagIsPublic|FlagIsLocal|FlagIsDefinition|FlagFwdDecl|FlagArtificial|FlagExplicit|FlagPrototyped|FlagObjectPointer|FlagStaticMember|FlagIndirectVariable|FlagLValueReference|FlagRValueReference|FlagIsOptimized|FlagIsEnumClass|FlagTypePassByValue|FlagTypePassByReference)\\b", "name": "keyword.spirv" }, "ValueEnum_DebugBaseTypeAttributeEncoding": { diff --git a/utils/vscode/src/langsvr.go b/utils/vscode/src/langsvr.go index b76e35f7..4ed441cb 100644 --- a/utils/vscode/src/langsvr.go +++ b/utils/vscode/src/langsvr.go @@ -412,15 +412,13 @@ func (s *server) Formatting(ctx context.Context, p *lsp.DocumentFormattingParams } } - formatted := sb.String() - - // Every good file ends with a single new line. - formatted = strings.TrimRight(formatted, "\n") + "\n" + // Every good file ends with a new line. + sb.WriteString("\n") return []lsp.TextEdit{ - { + lsp.TextEdit{ Range: rangeToLSP(f.fullRange), - NewText: formatted, + NewText: sb.String(), }, }, nil } diff --git a/utils/vscode/src/schema/schema.go b/utils/vscode/src/schema/schema.go index ed02de4e..86d856fd 100755 --- a/utils/vscode/src/schema/schema.go +++ b/utils/vscode/src/schema/schema.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Generated by gen-grammar.go --template=./src/schema/schema.go.tmpl --out=./src/schema/schema.go +// Generated by gen-grammar.go --template=../schema/schema.go.tmpl --out=../schema/schema.go // Do not modify this file directly. package schema @@ -447,12 +447,25 @@ var ( "OpPtrEqual": OpPtrEqual, "OpPtrNotEqual": OpPtrNotEqual, "OpPtrDiff": OpPtrDiff, + "OpTerminateInvocation": OpTerminateInvocation, "OpSubgroupBallotKHR": OpSubgroupBallotKHR, "OpSubgroupFirstInvocationKHR": OpSubgroupFirstInvocationKHR, "OpSubgroupAllKHR": OpSubgroupAllKHR, "OpSubgroupAnyKHR": OpSubgroupAnyKHR, "OpSubgroupAllEqualKHR": OpSubgroupAllEqualKHR, "OpSubgroupReadInvocationKHR": OpSubgroupReadInvocationKHR, + "OpTraceRayKHR": OpTraceRayKHR, + "OpExecuteCallableKHR": OpExecuteCallableKHR, + "OpConvertUToAccelerationStructureKHR": OpConvertUToAccelerationStructureKHR, + "OpIgnoreIntersectionKHR": OpIgnoreIntersectionKHR, + "OpTerminateRayKHR": OpTerminateRayKHR, + "OpTypeRayQueryKHR": OpTypeRayQueryKHR, + "OpRayQueryInitializeKHR": OpRayQueryInitializeKHR, + "OpRayQueryTerminateKHR": OpRayQueryTerminateKHR, + "OpRayQueryGenerateIntersectionKHR": OpRayQueryGenerateIntersectionKHR, + "OpRayQueryConfirmIntersectionKHR": OpRayQueryConfirmIntersectionKHR, + "OpRayQueryProceedKHR": OpRayQueryProceedKHR, + "OpRayQueryGetIntersectionTypeKHR": OpRayQueryGetIntersectionTypeKHR, "OpGroupIAddNonUniformAMD": OpGroupIAddNonUniformAMD, "OpGroupFAddNonUniformAMD": OpGroupFAddNonUniformAMD, "OpGroupFMinNonUniformAMD": OpGroupFMinNonUniformAMD, @@ -470,39 +483,11 @@ var ( "OpReportIntersectionNV": OpReportIntersectionNV, "OpReportIntersectionKHR": OpReportIntersectionKHR, "OpIgnoreIntersectionNV": OpIgnoreIntersectionNV, - "OpIgnoreIntersectionKHR": OpIgnoreIntersectionKHR, "OpTerminateRayNV": OpTerminateRayNV, - "OpTerminateRayKHR": OpTerminateRayKHR, "OpTraceNV": OpTraceNV, - "OpTraceRayKHR": OpTraceRayKHR, "OpTypeAccelerationStructureNV": OpTypeAccelerationStructureNV, "OpTypeAccelerationStructureKHR": OpTypeAccelerationStructureKHR, - "OpTypeRayQueryProvisionalKHR": OpTypeRayQueryProvisionalKHR, - "OpRayQueryInitializeKHR": OpRayQueryInitializeKHR, - "OpRayQueryTerminateKHR": OpRayQueryTerminateKHR, - "OpRayQueryGenerateIntersectionKHR": OpRayQueryGenerateIntersectionKHR, - "OpRayQueryConfirmIntersectionKHR": OpRayQueryConfirmIntersectionKHR, - "OpRayQueryProceedKHR": OpRayQueryProceedKHR, - "OpRayQueryGetIntersectionTypeKHR": OpRayQueryGetIntersectionTypeKHR, - "OpRayQueryGetRayTMinKHR": OpRayQueryGetRayTMinKHR, - "OpRayQueryGetRayFlagsKHR": OpRayQueryGetRayFlagsKHR, - "OpRayQueryGetIntersectionTKHR": OpRayQueryGetIntersectionTKHR, - "OpRayQueryGetIntersectionInstanceCustomIndexKHR": OpRayQueryGetIntersectionInstanceCustomIndexKHR, - "OpRayQueryGetIntersectionInstanceIdKHR": OpRayQueryGetIntersectionInstanceIdKHR, - "OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR": OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR, - "OpRayQueryGetIntersectionGeometryIndexKHR": OpRayQueryGetIntersectionGeometryIndexKHR, - "OpRayQueryGetIntersectionPrimitiveIndexKHR": OpRayQueryGetIntersectionPrimitiveIndexKHR, - "OpRayQueryGetIntersectionBarycentricsKHR": OpRayQueryGetIntersectionBarycentricsKHR, - "OpRayQueryGetIntersectionFrontFaceKHR": OpRayQueryGetIntersectionFrontFaceKHR, - "OpRayQueryGetIntersectionCandidateAABBOpaqueKHR": OpRayQueryGetIntersectionCandidateAABBOpaqueKHR, - "OpRayQueryGetIntersectionObjectRayDirectionKHR": OpRayQueryGetIntersectionObjectRayDirectionKHR, - "OpRayQueryGetIntersectionObjectRayOriginKHR": OpRayQueryGetIntersectionObjectRayOriginKHR, - "OpRayQueryGetWorldRayDirectionKHR": OpRayQueryGetWorldRayDirectionKHR, - "OpRayQueryGetWorldRayOriginKHR": OpRayQueryGetWorldRayOriginKHR, - "OpRayQueryGetIntersectionObjectToWorldKHR": OpRayQueryGetIntersectionObjectToWorldKHR, - "OpRayQueryGetIntersectionWorldToObjectKHR": OpRayQueryGetIntersectionWorldToObjectKHR, "OpExecuteCallableNV": OpExecuteCallableNV, - "OpExecuteCallableKHR": OpExecuteCallableKHR, "OpTypeCooperativeMatrixNV": OpTypeCooperativeMatrixNV, "OpCooperativeMatrixLoadNV": OpCooperativeMatrixLoadNV, "OpCooperativeMatrixStoreNV": OpCooperativeMatrixStoreNV, @@ -536,6 +521,13 @@ var ( "OpUSubSatINTEL": OpUSubSatINTEL, "OpIMul32x16INTEL": OpIMul32x16INTEL, "OpUMul32x16INTEL": OpUMul32x16INTEL, + "OpConstFunctionPointerINTEL": OpConstFunctionPointerINTEL, + "OpFunctionPointerCallINTEL": OpFunctionPointerCallINTEL, + "OpAsmTargetINTEL": OpAsmTargetINTEL, + "OpAsmINTEL": OpAsmINTEL, + "OpAsmCallINTEL": OpAsmCallINTEL, + "OpAtomicFMinEXT": OpAtomicFMinEXT, + "OpAtomicFMaxEXT": OpAtomicFMaxEXT, "OpDecorateString": OpDecorateString, "OpDecorateStringGOOGLE": OpDecorateStringGOOGLE, "OpMemberDecorateString": OpMemberDecorateString, @@ -658,6 +650,37 @@ var ( "OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL": OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL, "OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL": OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL, "OpSubgroupAvcSicGetInterRawSadsINTEL": OpSubgroupAvcSicGetInterRawSadsINTEL, + "OpVariableLengthArrayINTEL": OpVariableLengthArrayINTEL, + "OpSaveMemoryINTEL": OpSaveMemoryINTEL, + "OpRestoreMemoryINTEL": OpRestoreMemoryINTEL, + "OpLoopControlINTEL": OpLoopControlINTEL, + "OpPtrCastToCrossWorkgroupINTEL": OpPtrCastToCrossWorkgroupINTEL, + "OpCrossWorkgroupCastToPtrINTEL": OpCrossWorkgroupCastToPtrINTEL, + "OpReadPipeBlockingINTEL": OpReadPipeBlockingINTEL, + "OpWritePipeBlockingINTEL": OpWritePipeBlockingINTEL, + "OpFPGARegINTEL": OpFPGARegINTEL, + "OpRayQueryGetRayTMinKHR": OpRayQueryGetRayTMinKHR, + "OpRayQueryGetRayFlagsKHR": OpRayQueryGetRayFlagsKHR, + "OpRayQueryGetIntersectionTKHR": OpRayQueryGetIntersectionTKHR, + "OpRayQueryGetIntersectionInstanceCustomIndexKHR": OpRayQueryGetIntersectionInstanceCustomIndexKHR, + "OpRayQueryGetIntersectionInstanceIdKHR": OpRayQueryGetIntersectionInstanceIdKHR, + "OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR": OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR, + "OpRayQueryGetIntersectionGeometryIndexKHR": OpRayQueryGetIntersectionGeometryIndexKHR, + "OpRayQueryGetIntersectionPrimitiveIndexKHR": OpRayQueryGetIntersectionPrimitiveIndexKHR, + "OpRayQueryGetIntersectionBarycentricsKHR": OpRayQueryGetIntersectionBarycentricsKHR, + "OpRayQueryGetIntersectionFrontFaceKHR": OpRayQueryGetIntersectionFrontFaceKHR, + "OpRayQueryGetIntersectionCandidateAABBOpaqueKHR": OpRayQueryGetIntersectionCandidateAABBOpaqueKHR, + "OpRayQueryGetIntersectionObjectRayDirectionKHR": OpRayQueryGetIntersectionObjectRayDirectionKHR, + "OpRayQueryGetIntersectionObjectRayOriginKHR": OpRayQueryGetIntersectionObjectRayOriginKHR, + "OpRayQueryGetWorldRayDirectionKHR": OpRayQueryGetWorldRayDirectionKHR, + "OpRayQueryGetWorldRayOriginKHR": OpRayQueryGetWorldRayOriginKHR, + "OpRayQueryGetIntersectionObjectToWorldKHR": OpRayQueryGetIntersectionObjectToWorldKHR, + "OpRayQueryGetIntersectionWorldToObjectKHR": OpRayQueryGetIntersectionWorldToObjectKHR, + "OpAtomicFAddEXT": OpAtomicFAddEXT, + "OpTypeBufferSurfaceINTEL": OpTypeBufferSurfaceINTEL, + "OpTypeStructContinuedINTEL": OpTypeStructContinuedINTEL, + "OpConstantCompositeContinuedINTEL": OpConstantCompositeContinuedINTEL, + "OpSpecConstantCompositeContinuedINTEL": OpSpecConstantCompositeContinuedINTEL, } // ExtOpcodes is a map of extension name to Opcode description list. @@ -10022,6 +10045,13 @@ var ( }, }, } + OpTerminateInvocation = &Opcode { + Opname: "OpTerminateInvocation", + Class: "Control-Flow", + Opcode: 4416, + Operands: []Operand { + }, + } OpSubgroupBallotKHR = &Opcode { Opname: "OpSubgroupBallotKHR", Class: "Group", @@ -10159,6 +10189,270 @@ var ( }, }, } + OpTraceRayKHR = &Opcode { + Opname: "OpTraceRayKHR", + Class: "Reserved", + Opcode: 4445, + Operands: []Operand { + Operand { + Kind: OperandKindIdRef, + Name: "'Accel'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Ray Flags'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Cull Mask'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'SBT Offset'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'SBT Stride'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Miss Index'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Ray Origin'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Ray Tmin'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Ray Direction'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Ray Tmax'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Payload'", + Quantifier: "", + }, + }, + } + OpExecuteCallableKHR = &Opcode { + Opname: "OpExecuteCallableKHR", + Class: "Reserved", + Opcode: 4446, + Operands: []Operand { + Operand { + Kind: OperandKindIdRef, + Name: "'SBT Index'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Callable Data'", + Quantifier: "", + }, + }, + } + OpConvertUToAccelerationStructureKHR = &Opcode { + Opname: "OpConvertUToAccelerationStructureKHR", + Class: "Reserved", + Opcode: 4447, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Accel'", + Quantifier: "", + }, + }, + } + OpIgnoreIntersectionKHR = &Opcode { + Opname: "OpIgnoreIntersectionKHR", + Class: "Reserved", + Opcode: 4448, + Operands: []Operand { + }, + } + OpTerminateRayKHR = &Opcode { + Opname: "OpTerminateRayKHR", + Class: "Reserved", + Opcode: 4449, + Operands: []Operand { + }, + } + OpTypeRayQueryKHR = &Opcode { + Opname: "OpTypeRayQueryKHR", + Class: "Reserved", + Opcode: 4472, + Operands: []Operand { + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + }, + } + OpRayQueryInitializeKHR = &Opcode { + Opname: "OpRayQueryInitializeKHR", + Class: "Reserved", + Opcode: 4473, + Operands: []Operand { + Operand { + Kind: OperandKindIdRef, + Name: "'RayQuery'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Accel'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'RayFlags'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'CullMask'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'RayOrigin'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'RayTMin'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'RayDirection'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'RayTMax'", + Quantifier: "", + }, + }, + } + OpRayQueryTerminateKHR = &Opcode { + Opname: "OpRayQueryTerminateKHR", + Class: "Reserved", + Opcode: 4474, + Operands: []Operand { + Operand { + Kind: OperandKindIdRef, + Name: "'RayQuery'", + Quantifier: "", + }, + }, + } + OpRayQueryGenerateIntersectionKHR = &Opcode { + Opname: "OpRayQueryGenerateIntersectionKHR", + Class: "Reserved", + Opcode: 4475, + Operands: []Operand { + Operand { + Kind: OperandKindIdRef, + Name: "'RayQuery'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'HitT'", + Quantifier: "", + }, + }, + } + OpRayQueryConfirmIntersectionKHR = &Opcode { + Opname: "OpRayQueryConfirmIntersectionKHR", + Class: "Reserved", + Opcode: 4476, + Operands: []Operand { + Operand { + Kind: OperandKindIdRef, + Name: "'RayQuery'", + Quantifier: "", + }, + }, + } + OpRayQueryProceedKHR = &Opcode { + Opname: "OpRayQueryProceedKHR", + Class: "Reserved", + Opcode: 4477, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'RayQuery'", + Quantifier: "", + }, + }, + } + OpRayQueryGetIntersectionTypeKHR = &Opcode { + Opname: "OpRayQueryGetIntersectionTypeKHR", + Class: "Reserved", + Opcode: 4479, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'RayQuery'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Intersection'", + Quantifier: "", + }, + }, + } OpGroupIAddNonUniformAMD = &Opcode { Opname: "OpGroupIAddNonUniformAMD", Class: "Group", @@ -10638,13 +10932,6 @@ var ( Operands: []Operand { }, } - OpIgnoreIntersectionKHR = &Opcode { - Opname: "OpIgnoreIntersectionKHR", - Class: "Reserved", - Opcode: 5335, - Operands: []Operand { - }, - } OpTerminateRayNV = &Opcode { Opname: "OpTerminateRayNV", Class: "Reserved", @@ -10652,13 +10939,6 @@ var ( Operands: []Operand { }, } - OpTerminateRayKHR = &Opcode { - Opname: "OpTerminateRayKHR", - Class: "Reserved", - Opcode: 5336, - Operands: []Operand { - }, - } OpTraceNV = &Opcode { Opname: "OpTraceNV", Class: "Reserved", @@ -10721,68 +11001,6 @@ var ( }, }, } - OpTraceRayKHR = &Opcode { - Opname: "OpTraceRayKHR", - Class: "Reserved", - Opcode: 5337, - Operands: []Operand { - Operand { - Kind: OperandKindIdRef, - Name: "'Accel'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'Ray Flags'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'Cull Mask'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'SBT Offset'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'SBT Stride'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'Miss Index'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'Ray Origin'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'Ray Tmin'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'Ray Direction'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'Ray Tmax'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'PayloadId'", - Quantifier: "", - }, - }, - } OpTypeAccelerationStructureNV = &Opcode { Opname: "OpTypeAccelerationStructureNV", Class: "Reserved", @@ -10807,589 +11025,6 @@ var ( }, }, } - OpTypeRayQueryProvisionalKHR = &Opcode { - Opname: "OpTypeRayQueryProvisionalKHR", - Class: "Reserved", - Opcode: 4472, - Operands: []Operand { - Operand { - Kind: OperandKindIdResult, - Name: "", - Quantifier: "", - }, - }, - } - OpRayQueryInitializeKHR = &Opcode { - Opname: "OpRayQueryInitializeKHR", - Class: "Reserved", - Opcode: 4473, - Operands: []Operand { - Operand { - Kind: OperandKindIdRef, - Name: "'RayQuery'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'Accel'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'RayFlags'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'CullMask'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'RayOrigin'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'RayTMin'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'RayDirection'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'RayTMax'", - Quantifier: "", - }, - }, - } - OpRayQueryTerminateKHR = &Opcode { - Opname: "OpRayQueryTerminateKHR", - Class: "Reserved", - Opcode: 4474, - Operands: []Operand { - Operand { - Kind: OperandKindIdRef, - Name: "'RayQuery'", - Quantifier: "", - }, - }, - } - OpRayQueryGenerateIntersectionKHR = &Opcode { - Opname: "OpRayQueryGenerateIntersectionKHR", - Class: "Reserved", - Opcode: 4475, - Operands: []Operand { - Operand { - Kind: OperandKindIdRef, - Name: "'RayQuery'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'HitT'", - Quantifier: "", - }, - }, - } - OpRayQueryConfirmIntersectionKHR = &Opcode { - Opname: "OpRayQueryConfirmIntersectionKHR", - Class: "Reserved", - Opcode: 4476, - Operands: []Operand { - Operand { - Kind: OperandKindIdRef, - Name: "'RayQuery'", - Quantifier: "", - }, - }, - } - OpRayQueryProceedKHR = &Opcode { - Opname: "OpRayQueryProceedKHR", - Class: "Reserved", - Opcode: 4477, - Operands: []Operand { - Operand { - Kind: OperandKindIdResultType, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdResult, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'RayQuery'", - Quantifier: "", - }, - }, - } - OpRayQueryGetIntersectionTypeKHR = &Opcode { - Opname: "OpRayQueryGetIntersectionTypeKHR", - Class: "Reserved", - Opcode: 4479, - Operands: []Operand { - Operand { - Kind: OperandKindIdResultType, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdResult, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'RayQuery'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'Intersection'", - Quantifier: "", - }, - }, - } - OpRayQueryGetRayTMinKHR = &Opcode { - Opname: "OpRayQueryGetRayTMinKHR", - Class: "Reserved", - Opcode: 6016, - Operands: []Operand { - Operand { - Kind: OperandKindIdResultType, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdResult, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'RayQuery'", - Quantifier: "", - }, - }, - } - OpRayQueryGetRayFlagsKHR = &Opcode { - Opname: "OpRayQueryGetRayFlagsKHR", - Class: "Reserved", - Opcode: 6017, - Operands: []Operand { - Operand { - Kind: OperandKindIdResultType, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdResult, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'RayQuery'", - Quantifier: "", - }, - }, - } - OpRayQueryGetIntersectionTKHR = &Opcode { - Opname: "OpRayQueryGetIntersectionTKHR", - Class: "Reserved", - Opcode: 6018, - Operands: []Operand { - Operand { - Kind: OperandKindIdResultType, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdResult, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'RayQuery'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'Intersection'", - Quantifier: "", - }, - }, - } - OpRayQueryGetIntersectionInstanceCustomIndexKHR = &Opcode { - Opname: "OpRayQueryGetIntersectionInstanceCustomIndexKHR", - Class: "Reserved", - Opcode: 6019, - Operands: []Operand { - Operand { - Kind: OperandKindIdResultType, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdResult, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'RayQuery'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'Intersection'", - Quantifier: "", - }, - }, - } - OpRayQueryGetIntersectionInstanceIdKHR = &Opcode { - Opname: "OpRayQueryGetIntersectionInstanceIdKHR", - Class: "Reserved", - Opcode: 6020, - Operands: []Operand { - Operand { - Kind: OperandKindIdResultType, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdResult, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'RayQuery'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'Intersection'", - Quantifier: "", - }, - }, - } - OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR = &Opcode { - Opname: "OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR", - Class: "Reserved", - Opcode: 6021, - Operands: []Operand { - Operand { - Kind: OperandKindIdResultType, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdResult, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'RayQuery'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'Intersection'", - Quantifier: "", - }, - }, - } - OpRayQueryGetIntersectionGeometryIndexKHR = &Opcode { - Opname: "OpRayQueryGetIntersectionGeometryIndexKHR", - Class: "Reserved", - Opcode: 6022, - Operands: []Operand { - Operand { - Kind: OperandKindIdResultType, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdResult, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'RayQuery'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'Intersection'", - Quantifier: "", - }, - }, - } - OpRayQueryGetIntersectionPrimitiveIndexKHR = &Opcode { - Opname: "OpRayQueryGetIntersectionPrimitiveIndexKHR", - Class: "Reserved", - Opcode: 6023, - Operands: []Operand { - Operand { - Kind: OperandKindIdResultType, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdResult, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'RayQuery'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'Intersection'", - Quantifier: "", - }, - }, - } - OpRayQueryGetIntersectionBarycentricsKHR = &Opcode { - Opname: "OpRayQueryGetIntersectionBarycentricsKHR", - Class: "Reserved", - Opcode: 6024, - Operands: []Operand { - Operand { - Kind: OperandKindIdResultType, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdResult, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'RayQuery'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'Intersection'", - Quantifier: "", - }, - }, - } - OpRayQueryGetIntersectionFrontFaceKHR = &Opcode { - Opname: "OpRayQueryGetIntersectionFrontFaceKHR", - Class: "Reserved", - Opcode: 6025, - Operands: []Operand { - Operand { - Kind: OperandKindIdResultType, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdResult, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'RayQuery'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'Intersection'", - Quantifier: "", - }, - }, - } - OpRayQueryGetIntersectionCandidateAABBOpaqueKHR = &Opcode { - Opname: "OpRayQueryGetIntersectionCandidateAABBOpaqueKHR", - Class: "Reserved", - Opcode: 6026, - Operands: []Operand { - Operand { - Kind: OperandKindIdResultType, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdResult, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'RayQuery'", - Quantifier: "", - }, - }, - } - OpRayQueryGetIntersectionObjectRayDirectionKHR = &Opcode { - Opname: "OpRayQueryGetIntersectionObjectRayDirectionKHR", - Class: "Reserved", - Opcode: 6027, - Operands: []Operand { - Operand { - Kind: OperandKindIdResultType, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdResult, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'RayQuery'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'Intersection'", - Quantifier: "", - }, - }, - } - OpRayQueryGetIntersectionObjectRayOriginKHR = &Opcode { - Opname: "OpRayQueryGetIntersectionObjectRayOriginKHR", - Class: "Reserved", - Opcode: 6028, - Operands: []Operand { - Operand { - Kind: OperandKindIdResultType, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdResult, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'RayQuery'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'Intersection'", - Quantifier: "", - }, - }, - } - OpRayQueryGetWorldRayDirectionKHR = &Opcode { - Opname: "OpRayQueryGetWorldRayDirectionKHR", - Class: "Reserved", - Opcode: 6029, - Operands: []Operand { - Operand { - Kind: OperandKindIdResultType, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdResult, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'RayQuery'", - Quantifier: "", - }, - }, - } - OpRayQueryGetWorldRayOriginKHR = &Opcode { - Opname: "OpRayQueryGetWorldRayOriginKHR", - Class: "Reserved", - Opcode: 6030, - Operands: []Operand { - Operand { - Kind: OperandKindIdResultType, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdResult, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'RayQuery'", - Quantifier: "", - }, - }, - } - OpRayQueryGetIntersectionObjectToWorldKHR = &Opcode { - Opname: "OpRayQueryGetIntersectionObjectToWorldKHR", - Class: "Reserved", - Opcode: 6031, - Operands: []Operand { - Operand { - Kind: OperandKindIdResultType, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdResult, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'RayQuery'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'Intersection'", - Quantifier: "", - }, - }, - } - OpRayQueryGetIntersectionWorldToObjectKHR = &Opcode { - Opname: "OpRayQueryGetIntersectionWorldToObjectKHR", - Class: "Reserved", - Opcode: 6032, - Operands: []Operand { - Operand { - Kind: OperandKindIdResultType, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdResult, - Name: "", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'RayQuery'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'Intersection'", - Quantifier: "", - }, - }, - } OpExecuteCallableNV = &Opcode { Opname: "OpExecuteCallableNV", Class: "Reserved", @@ -11407,23 +11042,6 @@ var ( }, }, } - OpExecuteCallableKHR = &Opcode { - Opname: "OpExecuteCallableKHR", - Class: "Reserved", - Opcode: 5344, - Operands: []Operand { - Operand { - Kind: OperandKindIdRef, - Name: "'SBT Index'", - Quantifier: "", - }, - Operand { - Kind: OperandKindIdRef, - Name: "'Callable DataId'", - Quantifier: "", - }, - }, - } OpTypeCooperativeMatrixNV = &Opcode { Opname: "OpTypeCooperativeMatrixNV", Class: "Reserved", @@ -12260,6 +11878,210 @@ var ( }, }, } + OpConstFunctionPointerINTEL = &Opcode { + Opname: "OpConstFunctionPointerINTEL", + Class: "@exclude", + Opcode: 5600, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Function'", + Quantifier: "", + }, + }, + } + OpFunctionPointerCallINTEL = &Opcode { + Opname: "OpFunctionPointerCallINTEL", + Class: "@exclude", + Opcode: 5601, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Operand 1'", + Quantifier: "*", + }, + }, + } + OpAsmTargetINTEL = &Opcode { + Opname: "OpAsmTargetINTEL", + Class: "@exclude", + Opcode: 5609, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindLiteralString, + Name: "'Asm target'", + Quantifier: "", + }, + }, + } + OpAsmINTEL = &Opcode { + Opname: "OpAsmINTEL", + Class: "@exclude", + Opcode: 5610, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Asm type'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Target'", + Quantifier: "", + }, + Operand { + Kind: OperandKindLiteralString, + Name: "'Asm instructions'", + Quantifier: "", + }, + Operand { + Kind: OperandKindLiteralString, + Name: "'Constraints'", + Quantifier: "", + }, + }, + } + OpAsmCallINTEL = &Opcode { + Opname: "OpAsmCallINTEL", + Class: "@exclude", + Opcode: 5611, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Asm'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Argument 0'", + Quantifier: "*", + }, + }, + } + OpAtomicFMinEXT = &Opcode { + Opname: "OpAtomicFMinEXT", + Class: "Atomic", + Opcode: 5614, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Pointer'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdScope, + Name: "'Memory'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdMemorySemantics, + Name: "'Semantics'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Value'", + Quantifier: "", + }, + }, + } + OpAtomicFMaxEXT = &Opcode { + Opname: "OpAtomicFMaxEXT", + Class: "Atomic", + Opcode: 5615, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Pointer'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdScope, + Name: "'Memory'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdMemorySemantics, + Name: "'Semantics'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Value'", + Quantifier: "", + }, + }, + } OpDecorateString = &Opcode { Opname: "OpDecorateString", Class: "Annotation", @@ -15439,6 +15261,713 @@ var ( }, }, } + OpVariableLengthArrayINTEL = &Opcode { + Opname: "OpVariableLengthArrayINTEL", + Class: "@exclude", + Opcode: 5818, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Lenght'", + Quantifier: "", + }, + }, + } + OpSaveMemoryINTEL = &Opcode { + Opname: "OpSaveMemoryINTEL", + Class: "@exclude", + Opcode: 5819, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + }, + } + OpRestoreMemoryINTEL = &Opcode { + Opname: "OpRestoreMemoryINTEL", + Class: "@exclude", + Opcode: 5820, + Operands: []Operand { + Operand { + Kind: OperandKindIdRef, + Name: "'Ptr'", + Quantifier: "", + }, + }, + } + OpLoopControlINTEL = &Opcode { + Opname: "OpLoopControlINTEL", + Class: "Reserved", + Opcode: 5887, + Operands: []Operand { + Operand { + Kind: OperandKindLiteralInteger, + Name: "'Loop Control Parameters'", + Quantifier: "*", + }, + }, + } + OpPtrCastToCrossWorkgroupINTEL = &Opcode { + Opname: "OpPtrCastToCrossWorkgroupINTEL", + Class: "@exclude", + Opcode: 5934, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Pointer'", + Quantifier: "", + }, + }, + } + OpCrossWorkgroupCastToPtrINTEL = &Opcode { + Opname: "OpCrossWorkgroupCastToPtrINTEL", + Class: "@exclude", + Opcode: 5938, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Pointer'", + Quantifier: "", + }, + }, + } + OpReadPipeBlockingINTEL = &Opcode { + Opname: "OpReadPipeBlockingINTEL", + Class: "Pipe", + Opcode: 5946, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Packet Size'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Packet Alignment'", + Quantifier: "", + }, + }, + } + OpWritePipeBlockingINTEL = &Opcode { + Opname: "OpWritePipeBlockingINTEL", + Class: "Pipe", + Opcode: 5947, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Packet Size'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Packet Alignment'", + Quantifier: "", + }, + }, + } + OpFPGARegINTEL = &Opcode { + Opname: "OpFPGARegINTEL", + Class: "Reserved", + Opcode: 5949, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Result'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Input'", + Quantifier: "", + }, + }, + } + OpRayQueryGetRayTMinKHR = &Opcode { + Opname: "OpRayQueryGetRayTMinKHR", + Class: "Reserved", + Opcode: 6016, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'RayQuery'", + Quantifier: "", + }, + }, + } + OpRayQueryGetRayFlagsKHR = &Opcode { + Opname: "OpRayQueryGetRayFlagsKHR", + Class: "Reserved", + Opcode: 6017, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'RayQuery'", + Quantifier: "", + }, + }, + } + OpRayQueryGetIntersectionTKHR = &Opcode { + Opname: "OpRayQueryGetIntersectionTKHR", + Class: "Reserved", + Opcode: 6018, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'RayQuery'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Intersection'", + Quantifier: "", + }, + }, + } + OpRayQueryGetIntersectionInstanceCustomIndexKHR = &Opcode { + Opname: "OpRayQueryGetIntersectionInstanceCustomIndexKHR", + Class: "Reserved", + Opcode: 6019, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'RayQuery'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Intersection'", + Quantifier: "", + }, + }, + } + OpRayQueryGetIntersectionInstanceIdKHR = &Opcode { + Opname: "OpRayQueryGetIntersectionInstanceIdKHR", + Class: "Reserved", + Opcode: 6020, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'RayQuery'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Intersection'", + Quantifier: "", + }, + }, + } + OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR = &Opcode { + Opname: "OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR", + Class: "Reserved", + Opcode: 6021, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'RayQuery'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Intersection'", + Quantifier: "", + }, + }, + } + OpRayQueryGetIntersectionGeometryIndexKHR = &Opcode { + Opname: "OpRayQueryGetIntersectionGeometryIndexKHR", + Class: "Reserved", + Opcode: 6022, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'RayQuery'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Intersection'", + Quantifier: "", + }, + }, + } + OpRayQueryGetIntersectionPrimitiveIndexKHR = &Opcode { + Opname: "OpRayQueryGetIntersectionPrimitiveIndexKHR", + Class: "Reserved", + Opcode: 6023, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'RayQuery'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Intersection'", + Quantifier: "", + }, + }, + } + OpRayQueryGetIntersectionBarycentricsKHR = &Opcode { + Opname: "OpRayQueryGetIntersectionBarycentricsKHR", + Class: "Reserved", + Opcode: 6024, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'RayQuery'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Intersection'", + Quantifier: "", + }, + }, + } + OpRayQueryGetIntersectionFrontFaceKHR = &Opcode { + Opname: "OpRayQueryGetIntersectionFrontFaceKHR", + Class: "Reserved", + Opcode: 6025, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'RayQuery'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Intersection'", + Quantifier: "", + }, + }, + } + OpRayQueryGetIntersectionCandidateAABBOpaqueKHR = &Opcode { + Opname: "OpRayQueryGetIntersectionCandidateAABBOpaqueKHR", + Class: "Reserved", + Opcode: 6026, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'RayQuery'", + Quantifier: "", + }, + }, + } + OpRayQueryGetIntersectionObjectRayDirectionKHR = &Opcode { + Opname: "OpRayQueryGetIntersectionObjectRayDirectionKHR", + Class: "Reserved", + Opcode: 6027, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'RayQuery'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Intersection'", + Quantifier: "", + }, + }, + } + OpRayQueryGetIntersectionObjectRayOriginKHR = &Opcode { + Opname: "OpRayQueryGetIntersectionObjectRayOriginKHR", + Class: "Reserved", + Opcode: 6028, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'RayQuery'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Intersection'", + Quantifier: "", + }, + }, + } + OpRayQueryGetWorldRayDirectionKHR = &Opcode { + Opname: "OpRayQueryGetWorldRayDirectionKHR", + Class: "Reserved", + Opcode: 6029, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'RayQuery'", + Quantifier: "", + }, + }, + } + OpRayQueryGetWorldRayOriginKHR = &Opcode { + Opname: "OpRayQueryGetWorldRayOriginKHR", + Class: "Reserved", + Opcode: 6030, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'RayQuery'", + Quantifier: "", + }, + }, + } + OpRayQueryGetIntersectionObjectToWorldKHR = &Opcode { + Opname: "OpRayQueryGetIntersectionObjectToWorldKHR", + Class: "Reserved", + Opcode: 6031, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'RayQuery'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Intersection'", + Quantifier: "", + }, + }, + } + OpRayQueryGetIntersectionWorldToObjectKHR = &Opcode { + Opname: "OpRayQueryGetIntersectionWorldToObjectKHR", + Class: "Reserved", + Opcode: 6032, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'RayQuery'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Intersection'", + Quantifier: "", + }, + }, + } + OpAtomicFAddEXT = &Opcode { + Opname: "OpAtomicFAddEXT", + Class: "Atomic", + Opcode: 6035, + Operands: []Operand { + Operand { + Kind: OperandKindIdResultType, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Pointer'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdScope, + Name: "'Memory'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdMemorySemantics, + Name: "'Semantics'", + Quantifier: "", + }, + Operand { + Kind: OperandKindIdRef, + Name: "'Value'", + Quantifier: "", + }, + }, + } + OpTypeBufferSurfaceINTEL = &Opcode { + Opname: "OpTypeBufferSurfaceINTEL", + Class: "Type-Declaration", + Opcode: 6086, + Operands: []Operand { + Operand { + Kind: OperandKindIdResult, + Name: "", + Quantifier: "", + }, + }, + } + OpTypeStructContinuedINTEL = &Opcode { + Opname: "OpTypeStructContinuedINTEL", + Class: "Type-Declaration", + Opcode: 6090, + Operands: []Operand { + Operand { + Kind: OperandKindIdRef, + Name: "'Member 0 type', + 'member 1 type', + ...", + Quantifier: "*", + }, + }, + } + OpConstantCompositeContinuedINTEL = &Opcode { + Opname: "OpConstantCompositeContinuedINTEL", + Class: "Constant-Creation", + Opcode: 6091, + Operands: []Operand { + Operand { + Kind: OperandKindIdRef, + Name: "'Constituents'", + Quantifier: "*", + }, + }, + } + OpSpecConstantCompositeContinuedINTEL = &Opcode { + Opname: "OpSpecConstantCompositeContinuedINTEL", + Class: "Constant-Creation", + Opcode: 6092, + Operands: []Operand { + Operand { + Kind: OperandKindIdRef, + Name: "'Constituents'", + Quantifier: "*", + }, + }, + } GLSLStd450_Round = &Opcode { Opname: "Round", @@ -19788,6 +20317,20 @@ var ( Parameters: []Parameter{}, Version: "", }, + Enumerant{ + Enumerant: "AllowContractFastINTEL", + Value: 0x10000, + Capabilities: []string{"FPFastMathModeINTEL",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "AllowReassocINTEL", + Value: 0x20000, + Capabilities: []string{"FPFastMathModeINTEL",}, + Parameters: []Parameter{}, + Version: "None", + }, }, Bases: []*OperandKind {}, } @@ -19893,6 +20436,62 @@ var ( Parameters: []Parameter{{OperandKindLiteralInteger, ""},}, Version: "1.4", }, + Enumerant{ + Enumerant: "InitiationIntervalINTEL", + Value: 0x10000, + Capabilities: []string{"FPGALoopControlsINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, ""},}, + Version: "None", + }, + Enumerant{ + Enumerant: "MaxConcurrencyINTEL", + Value: 0x20000, + Capabilities: []string{"FPGALoopControlsINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, ""},}, + Version: "None", + }, + Enumerant{ + Enumerant: "DependencyArrayINTEL", + Value: 0x40000, + Capabilities: []string{"FPGALoopControlsINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, ""},}, + Version: "None", + }, + Enumerant{ + Enumerant: "PipelineEnableINTEL", + Value: 0x80000, + Capabilities: []string{"FPGALoopControlsINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, ""},}, + Version: "None", + }, + Enumerant{ + Enumerant: "LoopCoalesceINTEL", + Value: 0x100000, + Capabilities: []string{"FPGALoopControlsINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, ""},}, + Version: "None", + }, + Enumerant{ + Enumerant: "MaxInterleavingINTEL", + Value: 0x200000, + Capabilities: []string{"FPGALoopControlsINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, ""},}, + Version: "None", + }, + Enumerant{ + Enumerant: "SpeculatedIterationsINTEL", + Value: 0x400000, + Capabilities: []string{"FPGALoopControlsINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, ""},}, + Version: "None", + }, + Enumerant{ + Enumerant: "NoFusionINTEL", + Value: 0x800000, + Capabilities: []string{"FPGALoopControlsINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, ""},}, + Version: "None", + }, }, Bases: []*OperandKind {}, } @@ -20183,79 +20782,114 @@ var ( Enumerant{ Enumerant: "NoneKHR", Value: 0x0000, - Capabilities: []string{"RayQueryProvisionalKHR","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayQueryKHR","RayTracingKHR",}, Parameters: []Parameter{}, - Version: "", + Version: "None", }, Enumerant{ Enumerant: "OpaqueKHR", Value: 0x0001, - Capabilities: []string{"RayQueryProvisionalKHR","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayQueryKHR","RayTracingKHR",}, Parameters: []Parameter{}, - Version: "", + Version: "None", }, Enumerant{ Enumerant: "NoOpaqueKHR", Value: 0x0002, - Capabilities: []string{"RayQueryProvisionalKHR","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayQueryKHR","RayTracingKHR",}, Parameters: []Parameter{}, - Version: "", + Version: "None", }, Enumerant{ Enumerant: "TerminateOnFirstHitKHR", Value: 0x0004, - Capabilities: []string{"RayQueryProvisionalKHR","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayQueryKHR","RayTracingKHR",}, Parameters: []Parameter{}, - Version: "", + Version: "None", }, Enumerant{ Enumerant: "SkipClosestHitShaderKHR", Value: 0x0008, - Capabilities: []string{"RayQueryProvisionalKHR","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayQueryKHR","RayTracingKHR",}, Parameters: []Parameter{}, - Version: "", + Version: "None", }, Enumerant{ Enumerant: "CullBackFacingTrianglesKHR", Value: 0x0010, - Capabilities: []string{"RayQueryProvisionalKHR","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayQueryKHR","RayTracingKHR",}, Parameters: []Parameter{}, - Version: "", + Version: "None", }, Enumerant{ Enumerant: "CullFrontFacingTrianglesKHR", Value: 0x0020, - Capabilities: []string{"RayQueryProvisionalKHR","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayQueryKHR","RayTracingKHR",}, Parameters: []Parameter{}, - Version: "", + Version: "None", }, Enumerant{ Enumerant: "CullOpaqueKHR", Value: 0x0040, - Capabilities: []string{"RayQueryProvisionalKHR","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayQueryKHR","RayTracingKHR",}, Parameters: []Parameter{}, - Version: "", + Version: "None", }, Enumerant{ Enumerant: "CullNoOpaqueKHR", Value: 0x0080, - Capabilities: []string{"RayQueryProvisionalKHR","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayQueryKHR","RayTracingKHR",}, Parameters: []Parameter{}, - Version: "", + Version: "None", }, Enumerant{ Enumerant: "SkipTrianglesKHR", Value: 0x0100, - Capabilities: []string{"RayTraversalPrimitiveCullingProvisionalKHR",}, + Capabilities: []string{"RayTraversalPrimitiveCullingKHR",}, Parameters: []Parameter{}, - Version: "", + Version: "None", }, Enumerant{ Enumerant: "SkipAABBsKHR", Value: 0x0200, - Capabilities: []string{"RayTraversalPrimitiveCullingProvisionalKHR",}, + Capabilities: []string{"RayTraversalPrimitiveCullingKHR",}, Parameters: []Parameter{}, - Version: "", + Version: "None", + }, + }, + Bases: []*OperandKind {}, + } + OperandKindFragmentShadingRate = &OperandKind { + Kind: "FragmentShadingRate", + Category: "BitEnum", + Enumerants: []Enumerant { + Enumerant{ + Enumerant: "Vertical2Pixels", + Value: 0x0001, + Capabilities: []string{"FragmentShadingRateKHR",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "Vertical4Pixels", + Value: 0x0002, + Capabilities: []string{"FragmentShadingRateKHR",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "Horizontal2Pixels", + Value: 0x0004, + Capabilities: []string{"FragmentShadingRateKHR",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "Horizontal4Pixels", + Value: 0x0008, + Capabilities: []string{"FragmentShadingRateKHR",}, + Parameters: []Parameter{}, + Version: "None", }, }, Bases: []*OperandKind {}, @@ -20379,84 +21013,84 @@ var ( Enumerant{ Enumerant: "RayGenerationNV", Value: 5313, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "RayGenerationKHR", Value: 5313, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "IntersectionNV", Value: 5314, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "IntersectionKHR", Value: 5314, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "AnyHitNV", Value: 5315, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "AnyHitKHR", Value: 5315, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "ClosestHitNV", Value: 5316, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "ClosestHitKHR", Value: 5316, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "MissNV", Value: 5317, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "MissKHR", Value: 5317, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "CallableNV", Value: 5318, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "CallableKHR", Value: 5318, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, @@ -20943,6 +21577,76 @@ var ( Parameters: []Parameter{}, Version: "None", }, + Enumerant{ + Enumerant: "SharedLocalMemorySizeINTEL", + Value: 5618, + Capabilities: []string{"VectorComputeINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, "'Size'"},}, + Version: "None", + }, + Enumerant{ + Enumerant: "RoundingModeRTPINTEL", + Value: 5620, + Capabilities: []string{"RoundToInfinityINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, "'Target Width'"},}, + Version: "None", + }, + Enumerant{ + Enumerant: "RoundingModeRTNINTEL", + Value: 5621, + Capabilities: []string{"RoundToInfinityINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, "'Target Width'"},}, + Version: "None", + }, + Enumerant{ + Enumerant: "FloatingPointModeALTINTEL", + Value: 5622, + Capabilities: []string{"RoundToInfinityINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, "'Target Width'"},}, + Version: "None", + }, + Enumerant{ + Enumerant: "FloatingPointModeIEEEINTEL", + Value: 5623, + Capabilities: []string{"RoundToInfinityINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, "'Target Width'"},}, + Version: "None", + }, + Enumerant{ + Enumerant: "MaxWorkgroupSizeINTEL", + Value: 5893, + Capabilities: []string{"KernelAttributesINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, "'max_x_size'"},{OperandKindLiteralInteger, "'max_y_size'"},{OperandKindLiteralInteger, "'max_z_size'"},}, + Version: "None", + }, + Enumerant{ + Enumerant: "MaxWorkDimINTEL", + Value: 5894, + Capabilities: []string{"KernelAttributesINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, "'max_dimensions'"},}, + Version: "None", + }, + Enumerant{ + Enumerant: "NoGlobalOffsetINTEL", + Value: 5895, + Capabilities: []string{"KernelAttributesINTEL",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "NumSIMDWorkitemsINTEL", + Value: 5896, + Capabilities: []string{"FPGAKernelAttributesINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, "'vector_width'"},}, + Version: "None", + }, + Enumerant{ + Enumerant: "SchedulerTargetFmaxMhzINTEL", + Value: 5903, + Capabilities: []string{"FPGAKernelAttributesINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, "'target_fmax'"},}, + Version: "None", + }, }, Bases: []*OperandKind {}, } @@ -21044,84 +21748,84 @@ var ( Enumerant{ Enumerant: "CallableDataNV", Value: 5328, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "CallableDataKHR", Value: 5328, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "IncomingCallableDataNV", Value: 5329, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "IncomingCallableDataKHR", Value: 5329, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "RayPayloadNV", Value: 5338, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "RayPayloadKHR", Value: 5338, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "HitAttributeNV", Value: 5339, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "HitAttributeKHR", Value: 5339, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "IncomingRayPayloadNV", Value: 5342, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "IncomingRayPayloadKHR", Value: 5342, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "ShaderRecordBufferNV", Value: 5343, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "ShaderRecordBufferKHR", Value: 5343, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, @@ -21139,6 +21843,27 @@ var ( Parameters: []Parameter{}, Version: "1.5", }, + Enumerant{ + Enumerant: "CodeSectionINTEL", + Value: 5605, + Capabilities: []string{"FunctionPointersINTEL",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "DeviceOnlyINTEL", + Value: 5936, + Capabilities: []string{"USMStorageClassesINTEL",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "HostOnlyINTEL", + Value: 5937, + Capabilities: []string{"USMStorageClassesINTEL",}, + Parameters: []Parameter{}, + Version: "None", + }, }, Bases: []*OperandKind {}, } @@ -21545,6 +22270,20 @@ var ( Parameters: []Parameter{}, Version: "", }, + Enumerant{ + Enumerant: "R64ui", + Value: 40, + Capabilities: []string{"Int64ImageEXT",}, + Parameters: []Parameter{}, + Version: "", + }, + Enumerant{ + Enumerant: "R64i", + Value: 41, + Capabilities: []string{"Int64ImageEXT",}, + Parameters: []Parameter{}, + Version: "", + }, }, Bases: []*OperandKind {}, } @@ -21856,6 +22595,48 @@ var ( }, Bases: []*OperandKind {}, } + OperandKindFPDenormMode = &OperandKind { + Kind: "FPDenormMode", + Category: "ValueEnum", + Enumerants: []Enumerant { + Enumerant{ + Enumerant: "Preserve", + Value: 0, + Capabilities: []string{"FunctionFloatControlINTEL",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "FlushToZero", + Value: 1, + Capabilities: []string{"FunctionFloatControlINTEL",}, + Parameters: []Parameter{}, + Version: "None", + }, + }, + Bases: []*OperandKind {}, + } + OperandKindFPOperationMode = &OperandKind { + Kind: "FPOperationMode", + Category: "ValueEnum", + Enumerants: []Enumerant { + Enumerant{ + Enumerant: "IEEE", + Value: 0, + Capabilities: []string{"FunctionFloatControlINTEL",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "ALT", + Value: 1, + Capabilities: []string{"FunctionFloatControlINTEL",}, + Parameters: []Parameter{}, + Version: "None", + }, + }, + Bases: []*OperandKind {}, + } OperandKindLinkageType = &OperandKind { Kind: "LinkageType", Category: "ValueEnum", @@ -22420,6 +23201,69 @@ var ( Parameters: []Parameter{}, Version: "1.5", }, + Enumerant{ + Enumerant: "SIMTCallINTEL", + Value: 5599, + Capabilities: []string{"VectorComputeINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, "'N'"},}, + Version: "None", + }, + Enumerant{ + Enumerant: "ReferencedIndirectlyINTEL", + Value: 5602, + Capabilities: []string{"IndirectReferencesINTEL",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "ClobberINTEL", + Value: 5607, + Capabilities: []string{"AsmINTEL",}, + Parameters: []Parameter{{OperandKindLiteralString, "'Register'"},}, + Version: "None", + }, + Enumerant{ + Enumerant: "SideEffectsINTEL", + Value: 5608, + Capabilities: []string{"AsmINTEL",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "VectorComputeVariableINTEL", + Value: 5624, + Capabilities: []string{"VectorComputeINTEL",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "FuncParamIOKindINTEL", + Value: 5625, + Capabilities: []string{"VectorComputeINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, "'Kind'"},}, + Version: "None", + }, + Enumerant{ + Enumerant: "VectorComputeFunctionINTEL", + Value: 5626, + Capabilities: []string{"VectorComputeINTEL",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "StackCallINTEL", + Value: 5627, + Capabilities: []string{"VectorComputeINTEL",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "GlobalVariableOffsetINTEL", + Value: 5628, + Capabilities: []string{"VectorComputeINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, "'Offset'"},}, + Version: "None", + }, Enumerant{ Enumerant: "CounterBuffer", Value: 5634, @@ -22455,6 +23299,181 @@ var ( Parameters: []Parameter{{OperandKindLiteralString, "'User Type'"},}, Version: "None", }, + Enumerant{ + Enumerant: "FunctionRoundingModeINTEL", + Value: 5822, + Capabilities: []string{"FunctionFloatControlINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, "'Target Width'"},{OperandKindFPRoundingMode, "'FP Rounding Mode'"},}, + Version: "None", + }, + Enumerant{ + Enumerant: "FunctionDenormModeINTEL", + Value: 5823, + Capabilities: []string{"FunctionFloatControlINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, "'Target Width'"},{OperandKindFPDenormMode, "'FP Denorm Mode'"},}, + Version: "None", + }, + Enumerant{ + Enumerant: "RegisterINTEL", + Value: 5825, + Capabilities: []string{"FPGAMemoryAttributesINTEL",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "MemoryINTEL", + Value: 5826, + Capabilities: []string{"FPGAMemoryAttributesINTEL",}, + Parameters: []Parameter{{OperandKindLiteralString, "'Memory Type'"},}, + Version: "None", + }, + Enumerant{ + Enumerant: "NumbanksINTEL", + Value: 5827, + Capabilities: []string{"FPGAMemoryAttributesINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, "'Banks'"},}, + Version: "None", + }, + Enumerant{ + Enumerant: "BankwidthINTEL", + Value: 5828, + Capabilities: []string{"FPGAMemoryAttributesINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, "'Bank Width'"},}, + Version: "None", + }, + Enumerant{ + Enumerant: "MaxPrivateCopiesINTEL", + Value: 5829, + Capabilities: []string{"FPGAMemoryAttributesINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, "'Maximum Copies'"},}, + Version: "None", + }, + Enumerant{ + Enumerant: "SinglepumpINTEL", + Value: 5830, + Capabilities: []string{"FPGAMemoryAttributesINTEL",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "DoublepumpINTEL", + Value: 5831, + Capabilities: []string{"FPGAMemoryAttributesINTEL",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "MaxReplicatesINTEL", + Value: 5832, + Capabilities: []string{"FPGAMemoryAttributesINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, "'Maximum Replicates'"},}, + Version: "None", + }, + Enumerant{ + Enumerant: "SimpleDualPortINTEL", + Value: 5833, + Capabilities: []string{"FPGAMemoryAttributesINTEL",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "MergeINTEL", + Value: 5834, + Capabilities: []string{"FPGAMemoryAttributesINTEL",}, + Parameters: []Parameter{{OperandKindLiteralString, "'Merge Key'"},{OperandKindLiteralString, "'Merge Type'"},}, + Version: "None", + }, + Enumerant{ + Enumerant: "BankBitsINTEL", + Value: 5835, + Capabilities: []string{"FPGAMemoryAttributesINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, "'Bank Bits'"},}, + Version: "None", + }, + Enumerant{ + Enumerant: "ForcePow2DepthINTEL", + Value: 5836, + Capabilities: []string{"FPGAMemoryAttributesINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, "'Force Key'"},}, + Version: "None", + }, + Enumerant{ + Enumerant: "BurstCoalesceINTEL", + Value: 5899, + Capabilities: []string{"FPGAMemoryAccessesINTEL",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "CacheSizeINTEL", + Value: 5900, + Capabilities: []string{"FPGAMemoryAccessesINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, "'Cache Size in bytes'"},}, + Version: "None", + }, + Enumerant{ + Enumerant: "DontStaticallyCoalesceINTEL", + Value: 5901, + Capabilities: []string{"FPGAMemoryAccessesINTEL",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "PrefetchINTEL", + Value: 5902, + Capabilities: []string{"FPGAMemoryAccessesINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, "'Prefetcher Size in bytes'"},}, + Version: "None", + }, + Enumerant{ + Enumerant: "StallEnableINTEL", + Value: 5905, + Capabilities: []string{"FPGAClusterAttributesINTEL",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "FuseLoopsInFunctionINTEL", + Value: 5907, + Capabilities: []string{"LoopFuseINTEL",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "BufferLocationINTEL", + Value: 5921, + Capabilities: []string{"FPGABufferLocationINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, "'Buffer Location ID'"},}, + Version: "None", + }, + Enumerant{ + Enumerant: "IOPipeStorageINTEL", + Value: 5944, + Capabilities: []string{"IOPipesINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, "'IO Pipe ID'"},}, + Version: "None", + }, + Enumerant{ + Enumerant: "FunctionFloatingPointModeINTEL", + Value: 6080, + Capabilities: []string{"FunctionFloatControlINTEL",}, + Parameters: []Parameter{{OperandKindLiteralInteger, "'Target Width'"},{OperandKindFPOperationMode, "'FP Operation Mode'"},}, + Version: "None", + }, + Enumerant{ + Enumerant: "SingleElementVectorINTEL", + Value: 6085, + Capabilities: []string{"VectorComputeINTEL",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "VectorComputeCallableFunctionINTEL", + Value: 6087, + Capabilities: []string{"VectorComputeINTEL",}, + Parameters: []Parameter{}, + Version: "None", + }, }, Bases: []*OperandKind {}, } @@ -22507,7 +23526,7 @@ var ( Enumerant{ Enumerant: "PrimitiveId", Value: 7, - Capabilities: []string{"Geometry","Tessellation","RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"Geometry","Tessellation","RayTracingNV","RayTracingKHR","MeshShadingNV",}, Parameters: []Parameter{}, Version: "", }, @@ -22521,14 +23540,14 @@ var ( Enumerant{ Enumerant: "Layer", Value: 9, - Capabilities: []string{"Geometry","ShaderLayer","ShaderViewportIndexLayerEXT",}, + Capabilities: []string{"Geometry","ShaderLayer","ShaderViewportIndexLayerEXT","MeshShadingNV",}, Parameters: []Parameter{}, Version: "", }, Enumerant{ Enumerant: "ViewportIndex", Value: 10, - Capabilities: []string{"MultiViewport","ShaderViewportIndex","ShaderViewportIndexLayerEXT",}, + Capabilities: []string{"MultiViewport","ShaderViewportIndex","ShaderViewportIndexLayerEXT","MeshShadingNV",}, Parameters: []Parameter{}, Version: "", }, @@ -22756,6 +23775,13 @@ var ( Parameters: []Parameter{}, Version: "1.3", }, + Enumerant{ + Enumerant: "SubgroupEqMaskKHR", + Value: 4416, + Capabilities: []string{"SubgroupBallotKHR","GroupNonUniformBallot",}, + Parameters: []Parameter{}, + Version: "1.3", + }, Enumerant{ Enumerant: "SubgroupGeMask", Value: 4417, @@ -22763,6 +23789,13 @@ var ( Parameters: []Parameter{}, Version: "1.3", }, + Enumerant{ + Enumerant: "SubgroupGeMaskKHR", + Value: 4417, + Capabilities: []string{"SubgroupBallotKHR","GroupNonUniformBallot",}, + Parameters: []Parameter{}, + Version: "1.3", + }, Enumerant{ Enumerant: "SubgroupGtMask", Value: 4418, @@ -22770,6 +23803,13 @@ var ( Parameters: []Parameter{}, Version: "1.3", }, + Enumerant{ + Enumerant: "SubgroupGtMaskKHR", + Value: 4418, + Capabilities: []string{"SubgroupBallotKHR","GroupNonUniformBallot",}, + Parameters: []Parameter{}, + Version: "1.3", + }, Enumerant{ Enumerant: "SubgroupLeMask", Value: 4419, @@ -22777,6 +23817,13 @@ var ( Parameters: []Parameter{}, Version: "1.3", }, + Enumerant{ + Enumerant: "SubgroupLeMaskKHR", + Value: 4419, + Capabilities: []string{"SubgroupBallotKHR","GroupNonUniformBallot",}, + Parameters: []Parameter{}, + Version: "1.3", + }, Enumerant{ Enumerant: "SubgroupLtMask", Value: 4420, @@ -22784,34 +23831,6 @@ var ( Parameters: []Parameter{}, Version: "1.3", }, - Enumerant{ - Enumerant: "SubgroupEqMaskKHR", - Value: 4416, - Capabilities: []string{"SubgroupBallotKHR","GroupNonUniformBallot",}, - Parameters: []Parameter{}, - Version: "1.3", - }, - Enumerant{ - Enumerant: "SubgroupGeMaskKHR", - Value: 4417, - Capabilities: []string{"SubgroupBallotKHR","GroupNonUniformBallot",}, - Parameters: []Parameter{}, - Version: "1.3", - }, - Enumerant{ - Enumerant: "SubgroupGtMaskKHR", - Value: 4418, - Capabilities: []string{"SubgroupBallotKHR","GroupNonUniformBallot",}, - Parameters: []Parameter{}, - Version: "1.3", - }, - Enumerant{ - Enumerant: "SubgroupLeMaskKHR", - Value: 4419, - Capabilities: []string{"SubgroupBallotKHR","GroupNonUniformBallot",}, - Parameters: []Parameter{}, - Version: "1.3", - }, Enumerant{ Enumerant: "SubgroupLtMaskKHR", Value: 4420, @@ -22840,6 +23859,13 @@ var ( Parameters: []Parameter{}, Version: "1.3", }, + Enumerant{ + Enumerant: "PrimitiveShadingRateKHR", + Value: 4432, + Capabilities: []string{"FragmentShadingRateKHR",}, + Parameters: []Parameter{}, + Version: "None", + }, Enumerant{ Enumerant: "DeviceIndex", Value: 4438, @@ -22854,6 +23880,13 @@ var ( Parameters: []Parameter{}, Version: "1.3", }, + Enumerant{ + Enumerant: "ShadingRateKHR", + Value: 4444, + Capabilities: []string{"FragmentShadingRateKHR",}, + Parameters: []Parameter{}, + Version: "None", + }, Enumerant{ Enumerant: "BaryCoordNoPerspAMD", Value: 4992, @@ -23053,203 +24086,196 @@ var ( Enumerant{ Enumerant: "LaunchIdNV", Value: 5319, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "LaunchIdKHR", Value: 5319, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "LaunchSizeNV", Value: 5320, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "LaunchSizeKHR", Value: 5320, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "WorldRayOriginNV", Value: 5321, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "WorldRayOriginKHR", Value: 5321, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "WorldRayDirectionNV", Value: 5322, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "WorldRayDirectionKHR", Value: 5322, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "ObjectRayOriginNV", Value: 5323, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "ObjectRayOriginKHR", Value: 5323, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "ObjectRayDirectionNV", Value: 5324, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "ObjectRayDirectionKHR", Value: 5324, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "RayTminNV", Value: 5325, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "RayTminKHR", Value: 5325, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "RayTmaxNV", Value: 5326, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "RayTmaxKHR", Value: 5326, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "InstanceCustomIndexNV", Value: 5327, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "InstanceCustomIndexKHR", Value: 5327, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "ObjectToWorldNV", Value: 5330, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "ObjectToWorldKHR", Value: 5330, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "WorldToObjectNV", Value: 5331, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "WorldToObjectKHR", Value: 5331, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "HitTNV", Value: 5332, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, - Parameters: []Parameter{}, - Version: "None", - }, - Enumerant{ - Enumerant: "HitTKHR", - Value: 5332, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "HitKindNV", Value: 5333, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "HitKindKHR", Value: 5333, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "IncomingRayFlagsNV", Value: 5351, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "IncomingRayFlagsKHR", Value: 5351, - Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingNV","RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, Enumerant{ Enumerant: "RayGeometryIndexKHR", Value: 5352, - Capabilities: []string{"RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingKHR",}, Parameters: []Parameter{}, Version: "None", }, @@ -23340,9 +24366,9 @@ var ( Enumerant{ Enumerant: "ShaderCallKHR", Value: 6, - Capabilities: []string{"RayTracingProvisionalKHR",}, + Capabilities: []string{"RayTracingKHR",}, Parameters: []Parameter{}, - Version: "", + Version: "None", }, }, Bases: []*OperandKind {}, @@ -23918,6 +24944,13 @@ var ( Parameters: []Parameter{}, Version: "1.5", }, + Enumerant{ + Enumerant: "FragmentShadingRateKHR", + Value: 4422, + Capabilities: []string{"Shader",}, + Parameters: []Parameter{}, + Version: "None", + }, Enumerant{ Enumerant: "SubgroupBallotKHR", Value: 4423, @@ -23932,6 +24965,27 @@ var ( Parameters: []Parameter{}, Version: "1.3", }, + Enumerant{ + Enumerant: "WorkgroupMemoryExplicitLayoutKHR", + Value: 4428, + Capabilities: []string{"Shader",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "WorkgroupMemoryExplicitLayout8BitAccessKHR", + Value: 4429, + Capabilities: []string{"WorkgroupMemoryExplicitLayoutKHR",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "WorkgroupMemoryExplicitLayout16BitAccessKHR", + Value: 4430, + Capabilities: []string{"Shader",}, + Parameters: []Parameter{}, + Version: "None", + }, Enumerant{ Enumerant: "SubgroupVoteKHR", Value: 4431, @@ -24087,9 +25141,23 @@ var ( Version: "None", }, Enumerant{ - Enumerant: "RayTraversalPrimitiveCullingProvisionalKHR", + Enumerant: "RayQueryKHR", + Value: 4472, + Capabilities: []string{"Shader",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "RayTraversalPrimitiveCullingKHR", Value: 4478, - Capabilities: []string{"RayQueryProvisionalKHR","RayTracingProvisionalKHR",}, + Capabilities: []string{"RayQueryKHR","RayTracingKHR",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "RayTracingKHR", + Value: 4479, + Capabilities: []string{"Shader",}, Parameters: []Parameter{}, Version: "None", }, @@ -24128,6 +25196,13 @@ var ( Parameters: []Parameter{}, Version: "None", }, + Enumerant{ + Enumerant: "Int64ImageEXT", + Value: 5016, + Capabilities: []string{"Shader",}, + Parameters: []Parameter{}, + Version: "None", + }, Enumerant{ Enumerant: "ShaderClockKHR", Value: 5055, @@ -24541,6 +25616,20 @@ var ( Parameters: []Parameter{}, Version: "None", }, + Enumerant{ + Enumerant: "RoundToInfinityINTEL", + Value: 5582, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "FloatingPointModeINTEL", + Value: 5583, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "None", + }, Enumerant{ Enumerant: "IntegerFunctions2INTEL", Value: 5584, @@ -24548,6 +25637,62 @@ var ( Parameters: []Parameter{}, Version: "None", }, + Enumerant{ + Enumerant: "FunctionPointersINTEL", + Value: 5603, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "IndirectReferencesINTEL", + Value: 5604, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "AsmINTEL", + Value: 5606, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "AtomicFloat32MinMaxEXT", + Value: 5612, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "AtomicFloat64MinMaxEXT", + Value: 5613, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "AtomicFloat16MinMaxEXT", + Value: 5616, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "VectorComputeINTEL", + Value: 5617, + Capabilities: []string{"VectorAnyINTEL",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "VectorAnyINTEL", + Value: 5619, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "None", + }, Enumerant{ Enumerant: "SubgroupAvcMotionEstimationINTEL", Value: 5696, @@ -24569,6 +25714,146 @@ var ( Parameters: []Parameter{}, Version: "None", }, + Enumerant{ + Enumerant: "VariableLengthArrayINTEL", + Value: 5817, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "FunctionFloatControlINTEL", + Value: 5821, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "FPGAMemoryAttributesINTEL", + Value: 5824, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "FPFastMathModeINTEL", + Value: 5837, + Capabilities: []string{"Kernel",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "ArbitraryPrecisionIntegersINTEL", + Value: 5844, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "UnstructuredLoopControlsINTEL", + Value: 5886, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "FPGALoopControlsINTEL", + Value: 5888, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "KernelAttributesINTEL", + Value: 5892, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "FPGAKernelAttributesINTEL", + Value: 5897, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "FPGAMemoryAccessesINTEL", + Value: 5898, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "FPGAClusterAttributesINTEL", + Value: 5904, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "LoopFuseINTEL", + Value: 5906, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "FPGABufferLocationINTEL", + Value: 5920, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "USMStorageClassesINTEL", + Value: 5935, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "IOPipesINTEL", + Value: 5943, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "BlockingPipesINTEL", + Value: 5945, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "FPGARegINTEL", + Value: 5948, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "AtomicFloat32AddEXT", + Value: 6033, + Capabilities: []string{"Shader",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "AtomicFloat64AddEXT", + Value: 6034, + Capabilities: []string{"Shader",}, + Parameters: []Parameter{}, + Version: "None", + }, + Enumerant{ + Enumerant: "LongConstantCompositeINTEL", + Value: 6089, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "None", + }, }, Bases: []*OperandKind {}, } @@ -24579,16 +25864,16 @@ var ( Enumerant{ Enumerant: "RayQueryCandidateIntersectionKHR", Value: 0, - Capabilities: []string{"RayQueryProvisionalKHR",}, + Capabilities: []string{"RayQueryKHR",}, Parameters: []Parameter{}, - Version: "", + Version: "None", }, Enumerant{ Enumerant: "RayQueryCommittedIntersectionKHR", Value: 1, - Capabilities: []string{"RayQueryProvisionalKHR",}, + Capabilities: []string{"RayQueryKHR",}, Parameters: []Parameter{}, - Version: "", + Version: "None", }, }, Bases: []*OperandKind {}, @@ -24600,23 +25885,23 @@ var ( Enumerant{ Enumerant: "RayQueryCommittedIntersectionNoneKHR", Value: 0, - Capabilities: []string{"RayQueryProvisionalKHR",}, + Capabilities: []string{"RayQueryKHR",}, Parameters: []Parameter{}, - Version: "", + Version: "None", }, Enumerant{ Enumerant: "RayQueryCommittedIntersectionTriangleKHR", Value: 1, - Capabilities: []string{"RayQueryProvisionalKHR",}, + Capabilities: []string{"RayQueryKHR",}, Parameters: []Parameter{}, - Version: "", + Version: "None", }, Enumerant{ Enumerant: "RayQueryCommittedIntersectionGeneratedKHR", Value: 2, - Capabilities: []string{"RayQueryProvisionalKHR",}, + Capabilities: []string{"RayQueryKHR",}, Parameters: []Parameter{}, - Version: "", + Version: "None", }, }, Bases: []*OperandKind {}, @@ -24628,16 +25913,16 @@ var ( Enumerant{ Enumerant: "RayQueryCandidateIntersectionTriangleKHR", Value: 0, - Capabilities: []string{"RayQueryProvisionalKHR",}, + Capabilities: []string{"RayQueryKHR",}, Parameters: []Parameter{}, - Version: "", + Version: "None", }, Enumerant{ Enumerant: "RayQueryCandidateIntersectionAABBKHR", Value: 1, - Capabilities: []string{"RayQueryProvisionalKHR",}, + Capabilities: []string{"RayQueryKHR",}, Parameters: []Parameter{}, - Version: "", + Version: "None", }, }, Bases: []*OperandKind {}, @@ -24737,6 +26022,13 @@ var ( Kind: "DebugInfoFlags", Category: "BitEnum", Enumerants: []Enumerant { + Enumerant{ + Enumerant: "None", + Value: 0x0000, + Capabilities: []string{}, + Parameters: []Parameter{}, + Version: "", + }, Enumerant{ Enumerant: "FlagIsProtected", Value: 0x01,