From 908a6339ecc97f8d259ecfafe076d6010502244f Mon Sep 17 00:00:00 2001 From: Stephan Unverwerth Date: Wed, 22 Dec 2021 21:56:16 +0100 Subject: [PATCH] LibSoftGPU: Add legacy texture env mode to sampler config --- Userland/Libraries/LibSoftGPU/Sampler.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Userland/Libraries/LibSoftGPU/Sampler.h b/Userland/Libraries/LibSoftGPU/Sampler.h index 66335735c6..d83a16c5bd 100644 --- a/Userland/Libraries/LibSoftGPU/Sampler.h +++ b/Userland/Libraries/LibSoftGPU/Sampler.h @@ -32,6 +32,12 @@ enum class TextureWrapMode { ClampToEdge, }; +enum class TextureEnvMode { + Modulate, + Replace, + Decal, +}; + struct SamplerConfig final { RefPtr bound_image; MipMapFilter mipmap_filter { MipMapFilter::Nearest }; @@ -41,6 +47,7 @@ struct SamplerConfig final { TextureWrapMode texture_wrap_v { TextureWrapMode::Repeat }; TextureWrapMode texture_wrap_w { TextureWrapMode::Repeat }; FloatVector4 border_color { 0, 0, 0, 1 }; + TextureEnvMode fixed_function_texture_env_mode { TextureEnvMode::Modulate }; }; class Sampler final { @@ -48,6 +55,7 @@ public: FloatVector4 sample_2d(FloatVector2 const& uv) const; void set_config(SamplerConfig const& config) { m_config = config; } + SamplerConfig const& config() const { return m_config; } private: SamplerConfig m_config;