runtime_info.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. Disabled,
  16. };
  17. enum class InputTopology {
  18. Points,
  19. Lines,
  20. LinesAdjacency,
  21. Triangles,
  22. TrianglesAdjacency,
  23. };
  24. enum class CompareFunction {
  25. Never,
  26. Less,
  27. Equal,
  28. LessThanEqual,
  29. Greater,
  30. NotEqual,
  31. GreaterThanEqual,
  32. Always,
  33. };
  34. enum class TessPrimitive {
  35. Isolines,
  36. Triangles,
  37. Quads,
  38. };
  39. enum class TessSpacing {
  40. Equal,
  41. FractionalOdd,
  42. FractionalEven,
  43. };
  44. struct TransformFeedbackVarying {
  45. u32 buffer{};
  46. u32 stride{};
  47. u32 offset{};
  48. u32 components{};
  49. };
  50. struct RuntimeInfo {
  51. std::array<AttributeType, 32> generic_input_types{};
  52. VaryingState previous_stage_stores;
  53. std::map<IR::Attribute, IR::Attribute> previous_stage_legacy_stores_mapping;
  54. bool convert_depth_mode{};
  55. bool force_early_z{};
  56. TessPrimitive tess_primitive{};
  57. TessSpacing tess_spacing{};
  58. bool tess_clockwise{};
  59. InputTopology input_topology{};
  60. std::optional<float> fixed_state_point_size;
  61. std::optional<CompareFunction> alpha_test_func;
  62. float alpha_test_reference{};
  63. /// Static Y negate value
  64. bool y_negate{};
  65. /// Use storage buffers instead of global pointers on GLASM
  66. bool glasm_use_storage_buffers{};
  67. /// Transform feedback state for each varying
  68. std::vector<TransformFeedbackVarying> xfb_varyings;
  69. };
  70. } // namespace Shader