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

LibSoftGPU: Add legacy texture env mode to sampler config

This commit is contained in:
Stephan Unverwerth 2021-12-22 21:56:16 +01:00 committed by Brian Gianforcaro
parent b41ad28654
commit 908a6339ec

View file

@ -32,6 +32,12 @@ enum class TextureWrapMode {
ClampToEdge,
};
enum class TextureEnvMode {
Modulate,
Replace,
Decal,
};
struct SamplerConfig final {
RefPtr<Image> 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;