runtime_info.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 <bitset>
  7. #include <optional>
  8. #include <vector>
  9. #include "common/common_types.h"
  10. #include "shader_recompiler/varying_state.h"
  11. namespace Shader {
  12. enum class AttributeType : u8 {
  13. Float,
  14. SignedInt,
  15. UnsignedInt,
  16. Disabled,
  17. };
  18. enum class InputTopology {
  19. Points,
  20. Lines,
  21. LinesAdjacency,
  22. Triangles,
  23. TrianglesAdjacency,
  24. };
  25. enum class CompareFunction {
  26. Never,
  27. Less,
  28. Equal,
  29. LessThanEqual,
  30. Greater,
  31. NotEqual,
  32. GreaterThanEqual,
  33. Always,
  34. };
  35. enum class TessPrimitive {
  36. Isolines,
  37. Triangles,
  38. Quads,
  39. };
  40. enum class TessSpacing {
  41. Equal,
  42. FractionalOdd,
  43. FractionalEven,
  44. };
  45. struct TransformFeedbackVarying {
  46. u32 buffer{};
  47. u32 stride{};
  48. u32 offset{};
  49. u32 components{};
  50. };
  51. struct RuntimeInfo {
  52. std::array<AttributeType, 32> generic_input_types{};
  53. VaryingState previous_stage_stores;
  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