val_code_generator.h 1.3 KB

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