mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 10:27:36 +00:00
LibSoftGPU: Move alpha blend factor setup out of triangle rasterization
Since the alpha blend configuration should not change between most calls of draw_primitives it makes no sense to reinitialize the blend factors for every rasterized triangle. The alpha blend factors are now set up whenever the device config changes. The blend factors are stored in struct AlphaBlendFactors.
This commit is contained in:
parent
b4a18eaaf0
commit
68a1727547
3 changed files with 107 additions and 61 deletions
27
Userland/Libraries/LibSoftGPU/AlphaBlendFactors.h
Normal file
27
Userland/Libraries/LibSoftGPU/AlphaBlendFactors.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibGfx/Vector4.h>
|
||||
|
||||
namespace SoftGPU {
|
||||
|
||||
struct AlphaBlendFactors final {
|
||||
FloatVector4 src_constant {};
|
||||
float src_factor_src_alpha = 0;
|
||||
float src_factor_dst_alpha = 0;
|
||||
float src_factor_src_color = 0;
|
||||
float src_factor_dst_color = 0;
|
||||
|
||||
FloatVector4 dst_constant {};
|
||||
float dst_factor_src_alpha = 0;
|
||||
float dst_factor_dst_alpha = 0;
|
||||
float dst_factor_src_color = 0;
|
||||
float dst_factor_dst_color = 0;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue