runtime_info.h 1.5 KB

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