RasterizerOptions.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org>
  3. * Copyright (c) 2022-2024, 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. BlendEquation blend_equation_rgb { BlendEquation::Add };
  23. BlendEquation blend_equation_alpha { BlendEquation::Add };
  24. BlendFactor blend_source_factor { BlendFactor::One };
  25. BlendFactor blend_destination_factor { BlendFactor::One };
  26. u32 color_mask { 0xffffffff };
  27. float depth_min { 0.f };
  28. float depth_max { 1.f };
  29. DepthTestFunction depth_func { DepthTestFunction::Less };
  30. PolygonMode polygon_mode { PolygonMode::Fill };
  31. FloatVector4 fog_color { 0.0f, 0.0f, 0.0f, 0.0f };
  32. float fog_density { 1.0f };
  33. FogMode fog_mode { FogMode::Exp };
  34. bool fog_enabled { false };
  35. float fog_start { 0.0f };
  36. float fog_end { 1.0f };
  37. bool line_smooth { false };
  38. float line_width { 1.f };
  39. bool point_smooth { false };
  40. float point_size { 1.f };
  41. bool scissor_enabled { false };
  42. bool normalization_enabled { false };
  43. Gfx::IntRect scissor_box;
  44. bool enable_color_write { true };
  45. float depth_offset_factor { 0 };
  46. float depth_offset_constant { 0 };
  47. bool depth_offset_enabled { false };
  48. bool enable_culling { false };
  49. WindingOrder front_face { WindingOrder::CounterClockwise };
  50. bool cull_back { true };
  51. bool cull_front { false };
  52. Gfx::IntRect viewport;
  53. bool lighting_enabled { false };
  54. bool color_material_enabled { false };
  55. ColorMaterialFace color_material_face { ColorMaterialFace::FrontAndBack };
  56. ColorMaterialMode color_material_mode { ColorMaterialMode::AmbientAndDiffuse };
  57. };
  58. }