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:
parent
dcf33f9b8f
commit
62f4486190
2 changed files with 11 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue