RasterizerOptions.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 <AK/Array.h>
  9. #include <LibGPU/Config.h>
  10. #include <LibGPU/Enums.h>
  11. #include <LibGfx/Rect.h>
  12. #include <LibGfx/Vector4.h>
  13. namespace GPU {
  14. struct RasterizerOptions {
  15. bool shade_smooth { true };
  16. bool enable_stencil_test { false };
  17. bool enable_depth_test { false };
  18. bool enable_depth_write { true };
  19. bool enable_alpha_test { false };
  20. AlphaTestFunction alpha_test_func { AlphaTestFunction::Always };
  21. float alpha_test_ref_value { 0 };
  22. bool enable_blending { false };
  23. BlendFactor blend_source_factor { BlendFactor::One };
  24. BlendFactor blend_destination_factor { BlendFactor::One };
  25. u32 color_mask { 0xffffffff };
  26. float depth_min { 0.f };
  27. float depth_max { 1.f };
  28. DepthTestFunction depth_func { DepthTestFunction::Less };
  29. PolygonMode polygon_mode { PolygonMode::Fill };
  30. FloatVector4 fog_color { 0.0f, 0.0f, 0.0f, 0.0f };
  31. float fog_density { 1.0f };
  32. FogMode fog_mode { FogMode::Exp };
  33. bool fog_enabled { false };
  34. float fog_start { 0.0f };
  35. float fog_end { 1.0f };
  36. bool line_smooth { false };
  37. float line_width { 1.f };
  38. bool point_smooth { false };
  39. float point_size { 1.f };
  40. bool scissor_enabled { false };
  41. bool normalization_enabled { false };
  42. Gfx::IntRect scissor_box;
  43. bool enable_color_write { true };
  44. float depth_offset_factor { 0 };
  45. float depth_offset_constant { 0 };
  46. bool depth_offset_enabled { false };
  47. bool enable_culling { false };
  48. WindingOrder front_face { WindingOrder::CounterClockwise };
  49. bool cull_back { true };
  50. bool cull_front { false };
  51. Gfx::IntRect viewport;
  52. bool lighting_enabled { false };
  53. bool color_material_enabled { false };
  54. ColorMaterialFace color_material_face { ColorMaterialFace::FrontAndBack };
  55. ColorMaterialMode color_material_mode { ColorMaterialMode::AmbientAndDiffuse };
  56. };
  57. }