mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:47:46 +00:00
LibGL+LibGPU+LibSoftGPU: Implement blend equations
This implements support for `glBlendEquation` and `glBlendEquationSeparate`. These functions modify the calculation of the resulting color in blending mode.
This commit is contained in:
parent
55668c3e48
commit
aa3a6767f6
10 changed files with 202 additions and 30 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org>
|
||||
* Copyright (c) 2024, Jelle Raaijmakers <jelle@gmta.nl>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -21,6 +22,14 @@ enum class AlphaTestFunction {
|
|||
Greater,
|
||||
};
|
||||
|
||||
enum class BlendEquation {
|
||||
Add,
|
||||
Subtract,
|
||||
ReverseSubtract,
|
||||
Min,
|
||||
Max,
|
||||
};
|
||||
|
||||
enum class BlendFactor {
|
||||
Zero,
|
||||
One,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org>
|
||||
* Copyright (c) 2022, Jelle Raaijmakers <jelle@gmta.nl>
|
||||
* Copyright (c) 2022-2024, Jelle Raaijmakers <jelle@gmta.nl>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -23,6 +23,8 @@ struct RasterizerOptions {
|
|||
AlphaTestFunction alpha_test_func { AlphaTestFunction::Always };
|
||||
float alpha_test_ref_value { 0 };
|
||||
bool enable_blending { false };
|
||||
BlendEquation blend_equation_rgb { BlendEquation::Add };
|
||||
BlendEquation blend_equation_alpha { BlendEquation::Add };
|
||||
BlendFactor blend_source_factor { BlendFactor::One };
|
||||
BlendFactor blend_destination_factor { BlendFactor::One };
|
||||
u32 color_mask { 0xffffffff };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue