mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:27:45 +00:00
LibGL+LibSoftGPU: Implement fixed pipeline support for GL_COMBINE
`GL_COMBINE` is basically a fixed function calculator to perform simple arithmetics on configurable fragment sources. This patch implements a number of texture env parameters with support for the RGBA internal format.
This commit is contained in:
parent
494024b70e
commit
1d36bfdac1
10 changed files with 461 additions and 58 deletions
|
@ -19,8 +19,26 @@ public:
|
|||
RefPtr<Texture2D> texture_2d_target_texture() const { return m_texture_2d_target_texture; }
|
||||
void set_texture_2d_target_texture(RefPtr<Texture2D> const& texture) { m_texture_2d_target_texture = texture; }
|
||||
|
||||
void set_alpha_combinator(GLenum combinator) { m_alpha_combinator = combinator; }
|
||||
GLenum alpha_combinator() const { return m_alpha_combinator; }
|
||||
void set_alpha_operand(size_t index, GLenum operand) { m_alpha_operand[index] = operand; }
|
||||
GLenum alpha_operand(size_t index) const { return m_alpha_operand[index]; }
|
||||
void set_alpha_scale(float scale) { m_alpha_scale = scale; }
|
||||
float alpha_scale() const { return m_alpha_scale; }
|
||||
void set_alpha_source(size_t index, GLenum source) { m_alpha_source[index] = source; }
|
||||
GLenum alpha_source(size_t index) const { return m_alpha_source[index]; }
|
||||
void set_env_mode(GLenum mode) { m_env_mode = mode; }
|
||||
GLenum env_mode() const { return m_env_mode; }
|
||||
void set_level_of_detail_bias(float bias) { m_level_of_detail_bias = bias; }
|
||||
float level_of_detail_bias() const { return m_level_of_detail_bias; }
|
||||
void set_rgb_combinator(GLenum combinator) { m_rgb_combinator = combinator; }
|
||||
GLenum rgb_combinator() const { return m_rgb_combinator; }
|
||||
void set_rgb_operand(size_t index, GLenum operand) { m_rgb_operand[index] = operand; }
|
||||
GLenum rgb_operand(size_t index) const { return m_rgb_operand[index]; }
|
||||
void set_rgb_scale(float scale) { m_rgb_scale = scale; }
|
||||
float rgb_scale() const { return m_rgb_scale; }
|
||||
void set_rgb_source(size_t index, GLenum source) { m_rgb_source[index] = source; }
|
||||
GLenum rgb_source(size_t index) const { return m_rgb_source[index]; }
|
||||
|
||||
bool texture_1d_enabled() const { return m_texture_1d_enabled; };
|
||||
void set_texture_1d_enabled(bool texture_1d_enabled) { m_texture_1d_enabled = texture_1d_enabled; }
|
||||
|
@ -32,7 +50,16 @@ public:
|
|||
void set_texture_cube_map_enabled(bool texture_cube_map_enabled) { m_texture_cube_map_enabled = texture_cube_map_enabled; }
|
||||
|
||||
private:
|
||||
GLenum m_alpha_combinator { GL_MODULATE };
|
||||
Array<GLenum, 3> m_alpha_operand { GL_SRC_ALPHA, GL_SRC_ALPHA, GL_SRC_ALPHA };
|
||||
float m_alpha_scale { 1.f };
|
||||
Array<GLenum, 3> m_alpha_source { GL_TEXTURE, GL_PREVIOUS, GL_CONSTANT };
|
||||
GLenum m_env_mode { GL_MODULATE };
|
||||
float m_level_of_detail_bias { 0.f };
|
||||
GLenum m_rgb_combinator { GL_MODULATE };
|
||||
Array<GLenum, 3> m_rgb_operand { GL_SRC_COLOR, GL_SRC_COLOR, GL_SRC_ALPHA };
|
||||
float m_rgb_scale { 1.f };
|
||||
Array<GLenum, 3> m_rgb_source { GL_TEXTURE, GL_PREVIOUS, GL_CONSTANT };
|
||||
|
||||
// Bound textures
|
||||
RefPtr<Texture2D> m_texture_2d_target_texture {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue