runtime_info.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. // Copyright 2021 yuzu Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <array>
  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. bool convert_depth_mode{};
  54. bool force_early_z{};
  55. TessPrimitive tess_primitive{};
  56. TessSpacing tess_spacing{};
  57. bool tess_clockwise{};
  58. InputTopology input_topology{};
  59. std::optional<float> fixed_state_point_size;
  60. std::optional<CompareFunction> alpha_test_func;
  61. float alpha_test_reference{};
  62. /// Static Y negate value
  63. bool y_negate{};
  64. /// Use storage buffers instead of global pointers on GLASM
  65. bool glasm_use_storage_buffers{};
  66. /// Transform feedback state for each varying
  67. std::vector<TransformFeedbackVarying> xfb_varyings;
  68. };
  69. } // namespace Shader