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

LibGL: Remove image storage from MipMap

Images are stored on the device side. Texture2D and MipMap are now only
used to store imformation about the texture and reference to the device
image.
This commit is contained in:
Stephan Unverwerth 2021-12-23 13:52:19 +01:00 committed by Brian Gianforcaro
parent 4c944eaa41
commit 5e9d99474d
3 changed files with 34 additions and 114 deletions

View file

@ -44,16 +44,8 @@ public:
Sampler2D const& sampler() const { return m_sampler; }
Sampler2D& sampler() { return m_sampler; }
int width_at_lod(unsigned level) const { return (level >= m_mipmaps.size()) ? 0 : max(1, m_mipmaps.at(level).width() >> level); }
int height_at_lod(unsigned level) const { return (level >= m_mipmaps.size()) ? 0 : max(1, m_mipmaps.at(level).height() >> level); }
private:
template<typename TCallback>
void swizzle(Vector<u32>& pixels, TCallback&& callback)
{
for (auto& pixel : pixels)
pixel = callback(pixel);
}
int width_at_lod(unsigned level) const { return (level >= m_mipmaps.size()) ? 0 : m_mipmaps.at(level).width(); }
int height_at_lod(unsigned level) const { return (level >= m_mipmaps.size()) ? 0 : m_mipmaps.at(level).height(); }
private:
// FIXME: Mipmaps are currently unused, but we have the plumbing for it at least