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

LibSoftGPU: Return a const& texel in Image to prevent copying

On every texel access, some floating point instructions involved in
copying 4 floats popped up. Let `Image::texel() const` return a
`FloatVector4 const&` to prevent these operations.

This results in a ~7% FPS increase in GLQuake on my machine.
This commit is contained in:
Jelle Raaijmakers 2022-09-14 16:19:39 +02:00 committed by Andreas Kling
parent e9d2f9a95e
commit 8ff7c52cf4
3 changed files with 10 additions and 10 deletions

View file

@ -33,7 +33,7 @@ public:
GPU::ImageDataLayout image_data_layout(u32 level, Vector3<i32> offset) const;
virtual void regenerate_mipmaps() override;
FloatVector4 texel(u32 level, int x, int y, int z) const
FloatVector4 const& texel(u32 level, int x, int y, int z) const
{
return *texel_pointer(level, x, y, z);
}