RasterizerOptions.h 2.1 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 <AK/Array.h>
  9. #include <LibGPU/Config.h>
  10. #include <LibGPU/Enums.h>
  11. #include <LibGPU/TexCoordGenerationConfig.h>
  12. #include <LibGfx/Rect.h>
  13. #include <LibGfx/Vector4.h>
  14. namespace GPU {
  15. struct RasterizerOptions {
  16. bool shade_smooth { true };
  17. bool enable_stencil_test { false };
  18. bool enable_depth_test { false };
  19. bool enable_depth_write { true };
  20. bool enable_alpha_test { false };
  21. AlphaTestFunction alpha_test_func { AlphaTestFunction::Always };
  22. float alpha_test_ref_value { 0 };
  23. bool enable_blending { false };
  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 scissor_enabled { false };
  38. bool normalization_enabled { false };
  39. Gfx::IntRect scissor_box;
  40. bool enable_color_write { true };
  41. float depth_offset_factor { 0 };
  42. float depth_offset_constant { 0 };
  43. bool depth_offset_enabled { false };
  44. bool enable_culling { false };
  45. WindingOrder front_face { WindingOrder::CounterClockwise };
  46. bool cull_back { true };
  47. bool cull_front { false };
  48. Array<u8, NUM_SAMPLERS> texcoord_generation_enabled_coordinates {};
  49. Array<Array<TexCoordGenerationConfig, 4>, NUM_SAMPLERS> texcoord_generation_config {};
  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. }