mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
LibGL+LibGPU+LibSoftGPU: Implement matrix stack per texture unit
Each texture unit now has its own texture transformation matrix stack. Introduce a new texture unit configuration that is synced when changed. Because we're no longer passing a silly `Vector` when drawing each primitive, this results in a slightly improved frames per second :^)
This commit is contained in:
parent
1540c56e6c
commit
00d46e5d77
Notes:
sideshowbarker
2024-07-17 07:15:30 +09:00
Author: https://github.com/gmta
Commit: 00d46e5d77
Pull-request: https://github.com/SerenityOS/serenity/pull/15150
Reviewed-by: https://github.com/linusg ✅
Reviewed-by: https://github.com/sunverwerth ✅
22 changed files with 208 additions and 152 deletions
30
Userland/Libraries/LibGPU/TextureUnitConfiguration.h
Normal file
30
Userland/Libraries/LibGPU/TextureUnitConfiguration.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Jelle Raaijmakers <jelle@gmta.nl>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibGPU/Enums.h>
|
||||
#include <LibGfx/Matrix4x4.h>
|
||||
#include <LibGfx/Vector4.h>
|
||||
|
||||
namespace GPU {
|
||||
|
||||
typedef u8 TextureUnitIndex;
|
||||
|
||||
struct TexCoordGeneration {
|
||||
bool enabled;
|
||||
TexCoordGenerationMode mode;
|
||||
FloatVector4 coefficients;
|
||||
};
|
||||
|
||||
struct TextureUnitConfiguration {
|
||||
bool enabled { false };
|
||||
FloatMatrix4x4 transformation_matrix { FloatMatrix4x4::identity() };
|
||||
u8 tex_coord_generation_enabled;
|
||||
TexCoordGeneration tex_coord_generation[4];
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue