mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:27:45 +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:
parent
e9d2f9a95e
commit
8ff7c52cf4
3 changed files with 10 additions and 10 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue