1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:47:44 +00:00

LibSoftGPU: Only enable texture stages if required

Copying over every texel (4x`f32x4`) for every texture unit is
relatively expensive. By checking if we even need to remember these
texel values, we reduce the time spent in `rasterize_triangle` by
around 2% as measured in Quake III.
This commit is contained in:
Jelle Raaijmakers 2023-02-01 23:06:48 +01:00 committed by Andreas Kling
parent dcf33f9b8f
commit 62f4486190
2 changed files with 11 additions and 1 deletions

View file

@ -111,6 +111,7 @@ private:
Vector<Triangle> m_processed_triangles;
Vector<GPU::Vertex> m_clipped_vertices;
Array<Sampler, GPU::NUM_TEXTURE_UNITS> m_samplers;
bool m_samplers_need_texture_staging { false };
Array<GPU::Light, NUM_LIGHTS> m_lights;
Array<GPU::Material, 2u> m_materials;
GPU::RasterPosition m_raster_position;