diff --git a/Userland/Libraries/LibSoftGPU/Device.cpp b/Userland/Libraries/LibSoftGPU/Device.cpp index e678c2db0d..8440e0c88c 100644 --- a/Userland/Libraries/LibSoftGPU/Device.cpp +++ b/Userland/Libraries/LibSoftGPU/Device.cpp @@ -812,4 +812,11 @@ NonnullRefPtr Device::create_image(ImageFormat format, unsigned width, un return adopt_ref(*new Image(format, width, height, depth, levels, layers)); } +void Device::set_sampler_config(unsigned sampler, SamplerConfig const& config) +{ + VERIFY(sampler < num_samplers); + + m_samplers[sampler].set_config(config); +} + } diff --git a/Userland/Libraries/LibSoftGPU/Device.h b/Userland/Libraries/LibSoftGPU/Device.h index 789eb5ea9a..0ea13f47df 100644 --- a/Userland/Libraries/LibSoftGPU/Device.h +++ b/Userland/Libraries/LibSoftGPU/Device.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -61,6 +62,8 @@ struct RasterizerOptions { GLenum culled_sides { GL_BACK }; }; +inline static constexpr size_t const num_samplers = 32; + class Device final { public: Device(const Gfx::IntSize& min_size); @@ -79,6 +82,8 @@ public: NonnullRefPtr create_image(ImageFormat, unsigned width, unsigned height, unsigned depth, unsigned levels, unsigned layers); + void set_sampler_config(unsigned, SamplerConfig const&); + private: void submit_triangle(Triangle const& triangle, GL::TextureUnit::BoundList const& bound_texture_units); @@ -90,6 +95,7 @@ private: Vector m_triangle_list; Vector m_processed_triangles; Vector m_clipped_vertices; + Sampler m_samplers[num_samplers]; }; }