💿🐜 Antkeeper source code https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.9 KiB

  1. /*
  2. * Copyright (C) 2023 Christopher J. Howard
  3. *
  4. * This file is part of Antkeeper source code.
  5. *
  6. * Antkeeper source code is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * Antkeeper source code is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with Antkeeper source code. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef ANTKEEPER_GL_STENCIL_OP_STATE_HPP
  20. #define ANTKEEPER_GL_STENCIL_OP_STATE_HPP
  21. #include <engine/gl/compare-op.hpp>
  22. #include <engine/gl/stencil-op.hpp>
  23. #include <cstdint>
  24. namespace gl {
  25. /// Stencil operation state.
  26. struct stencil_op_state
  27. {
  28. /// Action performed on samples that fail the stencil test.
  29. stencil_op fail_op{stencil_op::keep};
  30. /// Action performed on samples that pass both the depth and stencil tests.
  31. stencil_op pass_op{stencil_op::keep};
  32. /// Action performed on samples that pass the stencil test and fail the depth test.
  33. stencil_op depth_fail_op{stencil_op::keep};
  34. /// Comparison operator used in the stencil test.
  35. gl::compare_op compare_op{gl::compare_op::always};
  36. /// Bits of the unsigned integer stencil values participating in the stencil test.
  37. std::uint32_t compare_mask{0xffffffff};
  38. /// Bits of the unsigned integer stencil values updated by the stencil test in the stencil framebuffer attachment.
  39. std::uint32_t write_mask{0xffffffff};
  40. /// Stencil reference value that is used in the unsigned stencil comparison.
  41. std::uint32_t reference{0};
  42. };
  43. } // namespace gl
  44. #endif // ANTKEEPER_GL_STENCIL_OP_STATE_HPP