LibGL+LibGPU+LibSoftGPU: Add virtual base class for Images

This introduces a new device independent base class for Images in LibGPU
that also keeps track of the device from which it was created in order
to prevent assigning images across devices.
This commit is contained in:
Stephan Unverwerth 2022-03-27 16:26:50 +02:00 committed by Andreas Kling
commit 4a99875582
Notes: sideshowbarker 2024-07-17 14:22:48 +09:00
8 changed files with 69 additions and 26 deletions

View file

@ -8,7 +8,7 @@
#pragma once
#include <AK/RefCounted.h>
#include <LibSoftGPU/Image.h>
#include <LibGPU/Image.h>
namespace GL {
@ -21,11 +21,11 @@ public:
virtual bool is_texture_3d() const { return false; }
virtual bool is_cube_map() const { return false; }
RefPtr<SoftGPU::Image> device_image() { return m_device_image; }
void set_device_image(RefPtr<SoftGPU::Image> image) { m_device_image = image; }
RefPtr<GPU::Image> device_image() { return m_device_image; }
void set_device_image(RefPtr<GPU::Image> image) { m_device_image = image; }
private:
RefPtr<SoftGPU::Image> m_device_image;
RefPtr<GPU::Image> m_device_image;
};
}