diff options
author | Stephan Unverwerth <s.unverwerth@serenityos.org> | 2022-03-27 15:50:06 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-04-06 11:32:24 +0200 |
commit | 1f3642ed48b6be1e1e913e5a550f2e38f299f07f (patch) | |
tree | 4af9e74b3d3afdf7eb8b601161cab04511380d48 /Userland/Libraries/LibGPU | |
parent | 5d2740217fbc0f62f46480f85c142a340580f679 (diff) | |
download | serenity-1f3642ed48b6be1e1e913e5a550f2e38f299f07f.zip |
LibGPU+LibSoftGPU: Move RasterizerOptions into LibGPU
Diffstat (limited to 'Userland/Libraries/LibGPU')
-rw-r--r-- | Userland/Libraries/LibGPU/RasterizerOptions.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGPU/RasterizerOptions.h b/Userland/Libraries/LibGPU/RasterizerOptions.h new file mode 100644 index 0000000000..b5dea99e5d --- /dev/null +++ b/Userland/Libraries/LibGPU/RasterizerOptions.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org> + * Copyright (c) 2022, Jelle Raaijmakers <jelle@gmta.nl> + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include <AK/Array.h> +#include <LibGPU/Config.h> +#include <LibGPU/Enums.h> +#include <LibGPU/TexCoordGenerationConfig.h> +#include <LibGfx/Rect.h> +#include <LibGfx/Vector4.h> + +namespace GPU { + +struct RasterizerOptions { + bool shade_smooth { true }; + bool enable_stencil_test { false }; + bool enable_depth_test { false }; + bool enable_depth_write { true }; + bool enable_alpha_test { false }; + AlphaTestFunction alpha_test_func { AlphaTestFunction::Always }; + float alpha_test_ref_value { 0 }; + bool enable_blending { false }; + BlendFactor blend_source_factor { BlendFactor::One }; + BlendFactor blend_destination_factor { BlendFactor::One }; + u32 color_mask { 0xffffffff }; + float depth_min { 0.f }; + float depth_max { 1.f }; + DepthTestFunction depth_func { DepthTestFunction::Less }; + PolygonMode polygon_mode { PolygonMode::Fill }; + FloatVector4 fog_color { 0.0f, 0.0f, 0.0f, 0.0f }; + float fog_density { 1.0f }; + FogMode fog_mode { FogMode::Exp }; + bool fog_enabled { false }; + float fog_start { 0.0f }; + float fog_end { 1.0f }; + bool scissor_enabled { false }; + bool normalization_enabled { false }; + Gfx::IntRect scissor_box; + bool enable_color_write { true }; + float depth_offset_factor { 0 }; + float depth_offset_constant { 0 }; + bool depth_offset_enabled { false }; + bool enable_culling { false }; + WindingOrder front_face { WindingOrder::CounterClockwise }; + bool cull_back { true }; + bool cull_front { false }; + Array<u8, NUM_SAMPLERS> texcoord_generation_enabled_coordinates {}; + Array<Array<TexCoordGenerationConfig, 4>, NUM_SAMPLERS> texcoord_generation_config {}; + Gfx::IntRect viewport; + bool lighting_enabled { false }; + bool color_material_enabled { false }; + ColorMaterialFace color_material_face { ColorMaterialFace::FrontAndBack }; + ColorMaterialMode color_material_mode { ColorMaterialMode::AmbientAndDiffuse }; +}; + +} |