From 4a9987558281c4ac4b235f7965ff323e5dba5673 Mon Sep 17 00:00:00 2001 From: Stephan Unverwerth Date: Sun, 27 Mar 2022 16:26:50 +0200 Subject: 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. --- Userland/Libraries/LibSoftGPU/Sampler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Userland/Libraries/LibSoftGPU/Sampler.cpp') diff --git a/Userland/Libraries/LibSoftGPU/Sampler.cpp b/Userland/Libraries/LibSoftGPU/Sampler.cpp index fa37aa6836..082760a4b9 100644 --- a/Userland/Libraries/LibSoftGPU/Sampler.cpp +++ b/Userland/Libraries/LibSoftGPU/Sampler.cpp @@ -109,7 +109,7 @@ Vector4 Sampler::sample_2d(Vector2 const& uv) if (m_config.bound_image.is_null()) return expand4(FloatVector4 { 1, 0, 0, 1 }); - auto const& image = *m_config.bound_image; + auto const& image = *static_ptr_cast(m_config.bound_image); // FIXME: Make base level configurable with glTexParameteri(GL_TEXTURE_BASE_LEVEL, base_level) constexpr unsigned base_level = 0; @@ -152,7 +152,7 @@ Vector4 Sampler::sample_2d(Vector2 const& uv) Vector4 Sampler::sample_2d_lod(Vector2 const& uv, AK::SIMD::u32x4 level, GPU::TextureFilter filter) const { - auto const& image = *m_config.bound_image; + auto const& image = *static_ptr_cast(m_config.bound_image); u32x4 const layer = expand4(0u); u32x4 const width = { -- cgit v1.2.3