RasterizerOptions.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org>
  3. * Copyright (c) 2022, Jelle Raaijmakers <jelle@gmta.nl>
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #pragma once
  8. #include <LibGPU/Config.h>
  9. #include <LibGPU/Enums.h>
  10. #include <LibGfx/Rect.h>
  11. #include <LibGfx/Vector4.h>
  12. namespace GPU {
  13. struct RasterizerOptions {
  14. bool shade_smooth { true };
  15. bool enable_stencil_test { false };
  16. bool enable_depth_test { false };
  17. bool enable_depth_write { true };
  18. bool enable_alpha_test { false };
  19. AlphaTestFunction alpha_test_func { AlphaTestFunction::Always };
  20. float alpha_test_ref_value { 0 };
  21. bool enable_blending { false };
  22. BlendFactor blend_source_factor { BlendFactor::One };
  23. BlendFactor blend_destination_factor { BlendFactor::One };
  24. u32 color_mask { 0xffffffff };
  25. float depth_min { 0.f };
  26. float depth_max { 1.f };
  27. DepthTestFunction depth_func { DepthTestFunction::Less };
  28. PolygonMode polygon_mode { PolygonMode::Fill };
  29. FloatVector4 fog_color { 0.0f, 0.0f, 0.0f, 0.0f };
  30. float fog_density { 1.0f };
  31. FogMode fog_mode { FogMode::Exp };
  32. bool fog_enabled { false };
  33. float fog_start { 0.0f };
  34. float fog_end { 1.0f };
  35. bool line_smooth { false };
  36. float line_width { 1.f };
  37. bool point_smooth { false };
  38. float point_size { 1.f };
  39. bool scissor_enabled { false };
  40. bool normalization_enabled { false };
  41. Gfx::IntRect scissor_box;
  42. bool enable_color_write { true };
  43. float depth_offset_factor { 0 };
  44. float depth_offset_constant { 0 };
  45. bool depth_offset_enabled { false };
  46. bool enable_culling { false };
  47. WindingOrder front_face { WindingOrder::CounterClockwise };
  48. bool cull_back { true };
  49. bool cull_front { false };
  50. Gfx::IntRect viewport;
  51. bool lighting_enabled { false };
  52. bool color_material_enabled { false };
  53. ColorMaterialFace color_material_face { ColorMaterialFace::FrontAndBack };
  54. ColorMaterialMode color_material_mode { ColorMaterialMode::AmbientAndDiffuse };
  55. };
  56. }