runtime_info.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include <array>
  5. #include <map>
  6. #include <optional>
  7. #include <vector>
  8. #include "common/common_types.h"
  9. #include "shader_recompiler/varying_state.h"
  10. namespace Shader {
  11. enum class AttributeType : u8 {
  12. Float,
  13. SignedInt,
  14. UnsignedInt,
  15. SignedScaled,
  16. UnsignedScaled,
  17. Disabled,
  18. };
  19. enum class InputTopology {
  20. Points,
  21. Lines,
  22. LinesAdjacency,
  23. Triangles,
  24. TrianglesAdjacency,
  25. };
  26. enum class CompareFunction {
  27. Never,
  28. Less,
  29. Equal,
  30. LessThanEqual,
  31. Greater,
  32. NotEqual,
  33. GreaterThanEqual,
  34. Always,
  35. };
  36. enum class TessPrimitive {
  37. Isolines,
  38. Triangles,
  39. Quads,
  40. };
  41. enum class TessSpacing {
  42. Equal,
  43. FractionalOdd,
  44. FractionalEven,
  45. };
  46. struct TransformFeedbackVarying {
  47. u32 buffer{};
  48. u32 stride{};
  49. u32 offset{};
  50. u32 components{};
  51. };
  52. struct RuntimeInfo {
  53. std::array<AttributeType, 32> generic_input_types{};
  54. VaryingState previous_stage_stores;
  55. std::map<IR::Attribute, IR::Attribute> previous_stage_legacy_stores_mapping;
  56. bool convert_depth_mode{};
  57. bool force_early_z{};
  58. TessPrimitive tess_primitive{};
  59. TessSpacing tess_spacing{};
  60. bool tess_clockwise{};
  61. InputTopology input_topology{};
  62. std::optional<float> fixed_state_point_size;
  63. std::optional<CompareFunction> alpha_test_func;
  64. float alpha_test_reference{};
  65. /// Static Y negate value
  66. bool y_negate{};
  67. /// Use storage buffers instead of global pointers on GLASM
  68. bool glasm_use_storage_buffers{};
  69. /// Transform feedback state for each varying
  70. std::array<TransformFeedbackVarying, 256> xfb_varyings{};
  71. u32 xfb_count{0};
  72. };
  73. } // namespace Shader