mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03:00
LibSoftGPU: Remove OpenGL type for draw buffer selection
Replaces the GLenum used in RasterizerConfig to select the draw buffer with a simple boolean that disabled color output when the draw buffer is set to GL_NONE on the OpenGL side.
This commit is contained in:
parent
1904be0370
commit
33e601800c
Notes:
sideshowbarker
2024-07-17 22:15:21 +09:00
Author: https://github.com/sunverwerth Commit: https://github.com/SerenityOS/serenity/commit/33e601800c4 Pull-request: https://github.com/SerenityOS/serenity/pull/11288 Reviewed-by: https://github.com/Quaker762 ✅ Reviewed-by: https://github.com/gmta
@ -1317,7 +1317,9 @@ void SoftwareGLContext::gl_draw_buffer(GLenum buffer)
|
||||
m_current_draw_buffer = buffer;
|
||||
|
||||
auto rasterizer_options = m_rasterizer.options();
|
||||
rasterizer_options.draw_buffer = m_current_draw_buffer;
|
||||
// FIXME: We only have a single draw buffer in SoftGPU at the moment,
|
||||
// so we simply disable color writes if GL_NONE is selected
|
||||
rasterizer_options.enable_color_write = m_current_draw_buffer != GL_NONE;
|
||||
m_rasterizer.set_options(rasterizer_options);
|
||||
}
|
||||
|
||||
|
@ -348,7 +348,7 @@ static void rasterize_triangle(const RasterizerOptions& options, Gfx::Bitmap& re
|
||||
}
|
||||
|
||||
// We will not update the color buffer at all
|
||||
if (!options.color_mask || options.draw_buffer == GL_NONE)
|
||||
if (!options.color_mask || !options.enable_color_write)
|
||||
continue;
|
||||
|
||||
// Draw the pixels according to the previously generated mask
|
||||
|
@ -79,7 +79,7 @@ struct RasterizerOptions {
|
||||
float fog_end { 1.0f };
|
||||
bool scissor_enabled { false };
|
||||
Gfx::IntRect scissor_box;
|
||||
GLenum draw_buffer { GL_BACK };
|
||||
bool enable_color_write { true };
|
||||
float depth_offset_factor { 0 };
|
||||
float depth_offset_constant { 0 };
|
||||
bool enable_culling { false };
|
||||
|
Loading…
Reference in New Issue
Block a user