💿🐜 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.

73 lines
2.3 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_PIPELINE_RASTERIZATION_STATE_HPP
  20. #define ANTKEEPER_GL_PIPELINE_RASTERIZATION_STATE_HPP
  21. #include <engine/gl/front-face.hpp>
  22. #include <engine/gl/cull-mode.hpp>
  23. #include <engine/gl/fill-mode.hpp>
  24. #include <engine/gl/provoking-vertex-mode.hpp>
  25. #include <cstdlib>
  26. namespace gl {
  27. /// Pipeline rasterization state.
  28. struct pipeline_rasterization_state
  29. {
  30. /// `true` if rasterizer discard should be enabled, `false` otherwise.
  31. bool rasterizer_discard_enabled{false};
  32. /// Polygon rasterization mode.
  33. gl::fill_mode fill_mode{gl::fill_mode::fill};
  34. /// Triangle culling mode.
  35. gl::cull_mode cull_mode{gl::cull_mode::back};
  36. /// Polygon front-facing orientation.
  37. gl::front_face front_face{gl::front_face::counter_clockwise};
  38. /// `true` if depth bias should be enabled, `false` otherwise.
  39. bool depth_bias_enabled{false};
  40. /// Depth bias constant factor.
  41. float depth_bias_constant_factor{0.0f};
  42. /// Depth bias slope factor.
  43. float depth_bias_slope_factor{0.0f};
  44. /// `true` if depth clamp should be enabled, `false` otherwise.
  45. bool depth_clamp_enabled{false};
  46. /// `true` if scissor testing should be enabled, `false` otherwise.
  47. bool scissor_test_enabled{false};
  48. /// Vertex to be used as the source of data for flat-shaded varyings.
  49. gl::provoking_vertex_mode provoking_vertex_mode{gl::provoking_vertex_mode::last};
  50. /// Diameter of rasterized points.
  51. float point_size{1.0f};
  52. /// Width of rasterized line segments.
  53. float line_width{1.0f};
  54. };
  55. } // namespace gl
  56. #endif // ANTKEEPER_GL_PIPELINE_RASTERIZATION_STATE_HPP