| 830 | } |
| 831 | |
| 832 | EntryPoint::EntryPoint(const Module& module_state, const Instruction& entrypoint_insn, const ParsedInfo& parsed) |
| 833 | : entrypoint_insn(entrypoint_insn), |
| 834 | is_data_graph(entrypoint_insn.Opcode() == spv::OpGraphEntryPointARM), |
| 835 | execution_model(is_data_graph ? spv::ExecutionModelGLCompute : spv::ExecutionModel(entrypoint_insn.Word(1))), |
| 836 | stage(is_data_graph ? VK_SHADER_STAGE_ALL : ExecutionModelToShaderStageFlagBits(execution_model)), |
| 837 | id(is_data_graph ? entrypoint_insn.Word(1) : entrypoint_insn.Word(2)), |
| 838 | name(is_data_graph ? entrypoint_insn.GetAsString(2) : entrypoint_insn.GetAsString(3)), |
| 839 | execution_mode(module_state.GetExecutionModeSet(id)), |
| 840 | emit_vertex_geometry(false), |
| 841 | accessible(GetAccessibleIds(module_state, *this)), |
| 842 | resource_interface_variables(GetResourceInterfaceVariables(module_state, *this, parsed)), |
| 843 | stage_interface_variables(GetStageInterfaceVariables(module_state, *this, parsed)), |
| 844 | uses_tosa_1_0(parsed.uses_tosa_1_0), |
| 845 | only_entry_point(parsed.total_entry_points == 1) { |
| 846 | // Tried to just create this map in GetResourceInterfaceVariables() but ran into errors because the function is static |
| 847 | for (const auto& variable : resource_interface_variables) { |
| 848 | resource_interface_variable_map[variable.id] = &variable; |
| 849 | } |
| 850 | |
| 851 | // After all variables are made, can get references from them |
| 852 | // Also can set per-Entrypoint values now |
| 853 | for (const auto& variable : stage_interface_variables) { |
| 854 | if (variable.is_per_task_nv) { |
| 855 | continue; // SPV_NV_mesh_shader has a PerTaskNV which is not a builtin or interface |
| 856 | } |
| 857 | has_passthrough |= variable.decorations.Has(DecorationSet::passthrough_bit); |
| 858 | |
| 859 | if (variable.is_built_in) { |
| 860 | built_in_variables.push_back(&variable); |
| 861 | |
| 862 | if (variable.storage_class == spv::StorageClassInput) { |
| 863 | built_in_input_components += variable.total_built_in_components; |
| 864 | } else if (variable.storage_class == spv::StorageClassOutput) { |
| 865 | built_in_output_components += variable.total_built_in_components; |
| 866 | } |
| 867 | |
| 868 | if (IsBuiltInWritten(spv::BuiltInPrimitiveShadingRateKHR, module_state, variable, parsed)) { |
| 869 | written_built_in_primitive_shading_rate_khr = true; |
| 870 | } |
| 871 | if (IsBuiltInWritten(spv::BuiltInViewportIndex, module_state, variable, parsed)) { |
| 872 | written_built_in_viewport_index = true; |
| 873 | } |
| 874 | if (IsBuiltInWritten(spv::BuiltInPointSize, module_state, variable, parsed)) { |
| 875 | written_built_in_point_size = true; |
| 876 | } |
| 877 | if (IsBuiltInWritten(spv::BuiltInLayer, module_state, variable, parsed)) { |
| 878 | written_built_in_layer = true; |
| 879 | } |
| 880 | if (IsBuiltInWritten(spv::BuiltInViewportMaskNV, module_state, variable, parsed)) { |
| 881 | written_built_in_viewport_mask_nv = true; |
| 882 | } |
| 883 | } else { |
| 884 | user_defined_interface_variables.push_back(&variable); |
| 885 | |
| 886 | if (variable.base_type.StorageClass() == spv::StorageClassPhysicalStorageBuffer) { |
| 887 | has_physical_storage_buffer_interface = true; |
| 888 | } |
| 889 |
nothing calls this directly
no test coverage detected