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

LibGPU+LibSoftGPU: Move size and pixel format information to GPU::Image

Size and format information are the same for every implementation and do
not need to be virtual. This removes the need to reimplement them for
each driver.
This commit is contained in:
Stephan Unverwerth 2022-12-19 14:25:17 +01:00 committed by Andreas Kling
parent dc8be499e6
commit 3b2ded1d44
6 changed files with 51 additions and 37 deletions

View file

@ -22,10 +22,6 @@ class Image final : public GPU::Image {
public:
Image(void const* ownership_token, GPU::PixelFormat const&, u32 width, u32 height, u32 depth, u32 max_levels);
virtual u32 width_at_level(u32 level) const override { return m_mipmap_buffers[level]->width(); }
virtual u32 height_at_level(u32 level) const override { return m_mipmap_buffers[level]->height(); }
virtual u32 depth_at_level(u32 level) const override { return m_mipmap_buffers[level]->depth(); }
virtual u32 number_of_levels() const override { return m_number_of_levels; }
bool width_is_power_of_two() const { return m_width_is_power_of_two; }
bool height_is_power_of_two() const { return m_height_is_power_of_two; }
bool depth_is_power_of_two() const { return m_depth_is_power_of_two; }
@ -58,9 +54,6 @@ public:
}
private:
u32 m_number_of_levels { 0 };
GPU::PixelFormat m_pixel_format;
FixedArray<RefPtr<Typed3DBuffer<FloatVector4>>> m_mipmap_buffers;
bool m_width_is_power_of_two { false };