1fd4e5da5Sopenharmony_ci// Copyright (c) 2019 Google LLC. 2fd4e5da5Sopenharmony_ci// 3fd4e5da5Sopenharmony_ci// Licensed under the Apache License, Version 2.0 (the "License"); 4fd4e5da5Sopenharmony_ci// you may not use this file except in compliance with the License. 5fd4e5da5Sopenharmony_ci// You may obtain a copy of the License at 6fd4e5da5Sopenharmony_ci// 7fd4e5da5Sopenharmony_ci// http://www.apache.org/licenses/LICENSE-2.0 8fd4e5da5Sopenharmony_ci// 9fd4e5da5Sopenharmony_ci// Unless required by applicable law or agreed to in writing, software 10fd4e5da5Sopenharmony_ci// distributed under the License is distributed on an "AS IS" BASIS, 11fd4e5da5Sopenharmony_ci// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12fd4e5da5Sopenharmony_ci// See the License for the specific language governing permissions and 13fd4e5da5Sopenharmony_ci// limitations under the License. 14fd4e5da5Sopenharmony_ci 15fd4e5da5Sopenharmony_ci// Utility class used to generate SPIR-V code strings for tests 16fd4e5da5Sopenharmony_ci 17fd4e5da5Sopenharmony_ci#include <string> 18fd4e5da5Sopenharmony_ci#include <vector> 19fd4e5da5Sopenharmony_ci 20fd4e5da5Sopenharmony_cinamespace spvtools { 21fd4e5da5Sopenharmony_cinamespace val { 22fd4e5da5Sopenharmony_ci 23fd4e5da5Sopenharmony_cistruct EntryPoint { 24fd4e5da5Sopenharmony_ci std::string name; 25fd4e5da5Sopenharmony_ci std::string execution_model; 26fd4e5da5Sopenharmony_ci std::string execution_modes; 27fd4e5da5Sopenharmony_ci std::string body; 28fd4e5da5Sopenharmony_ci std::string interfaces; 29fd4e5da5Sopenharmony_ci}; 30fd4e5da5Sopenharmony_ci 31fd4e5da5Sopenharmony_ciclass CodeGenerator { 32fd4e5da5Sopenharmony_ci public: 33fd4e5da5Sopenharmony_ci static CodeGenerator GetDefaultShaderCodeGenerator(); 34fd4e5da5Sopenharmony_ci 35fd4e5da5Sopenharmony_ci std::string Build() const; 36fd4e5da5Sopenharmony_ci 37fd4e5da5Sopenharmony_ci std::vector<EntryPoint> entry_points_; 38fd4e5da5Sopenharmony_ci std::string capabilities_; 39fd4e5da5Sopenharmony_ci std::string extensions_; 40fd4e5da5Sopenharmony_ci std::string memory_model_; 41fd4e5da5Sopenharmony_ci std::string before_types_; 42fd4e5da5Sopenharmony_ci std::string types_; 43fd4e5da5Sopenharmony_ci std::string after_types_; 44fd4e5da5Sopenharmony_ci std::string add_at_the_end_; 45fd4e5da5Sopenharmony_ci}; 46fd4e5da5Sopenharmony_ci 47fd4e5da5Sopenharmony_ci} // namespace val 48fd4e5da5Sopenharmony_ci} // namespace spvtools 49