runtime_info.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 <optional>
  6. #include <vector>
  7. #include "common/common_types.h"
  8. #include "shader_recompiler/varying_state.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. VaryingState previous_stage_stores;
  52. bool convert_depth_mode{};
  53. bool force_early_z{};
  54. TessPrimitive tess_primitive{};
  55. TessSpacing tess_spacing{};
  56. bool tess_clockwise{};
  57. InputTopology input_topology{};
  58. std::optional<float> fixed_state_point_size;
  59. std::optional<CompareFunction> alpha_test_func;
  60. float alpha_test_reference{};
  61. /// Static Y negate value
  62. bool y_negate{};
  63. /// Use storage buffers instead of global pointers on GLASM
  64. bool glasm_use_storage_buffers{};
  65. /// Transform feedback state for each varying
  66. std::vector<TransformFeedbackVarying> xfb_varyings;
  67. };
  68. } // namespace Shader