PipelineState.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
  2. // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
  3. // SPDX-License-Identifier: MIT
  4. #pragma once
  5. /// Defines how primitives should be rendered
  6. class PipelineState
  7. {
  8. public:
  9. /// Describes the input layout of the vertex shader
  10. enum class EInputDescription
  11. {
  12. Position, ///< 3 float position
  13. Color, ///< 4 uint8 color
  14. Normal, ///< 3 float normal
  15. TexCoord, ///< 2 float texture coordinate
  16. InstanceColor, ///< 4 uint8 per instance color
  17. InstanceTransform, ///< 4x4 float per instance transform
  18. InstanceInvTransform, ///< 4x4 float per instance inverse transform
  19. };
  20. /// In which draw pass to use this pipeline state
  21. enum class EDrawPass
  22. {
  23. Shadow,
  24. Normal
  25. };
  26. /// The type of topology to emit
  27. enum class ETopology
  28. {
  29. Triangle,
  30. Line
  31. };
  32. /// Fill mode of the triangles
  33. enum class EFillMode
  34. {
  35. Solid,
  36. Wireframe
  37. };
  38. /// If depth write / depth test is on
  39. enum class EDepthTest
  40. {
  41. Off,
  42. On
  43. };
  44. /// How to blend the pixel from the shader in the back buffer
  45. enum class EBlendMode
  46. {
  47. Write,
  48. AlphaBlend,
  49. };
  50. /// How to cull triangles
  51. enum class ECullMode
  52. {
  53. Backface,
  54. FrontFace,
  55. };
  56. /// Destructor
  57. virtual ~PipelineState() = default;
  58. /// Make this pipeline state active (any primitives rendered after this will use this state)
  59. virtual void Activate() = 0;
  60. };