From 6318522339786e5e25a70f5c95b863ab457f4471 Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Sun, 23 Jan 2022 22:04:06 +0100 Subject: LibSoftGPU: Remove `Device::wait_for_all_threads()` This function was added as a FIXME but was then arbitrarily invoked in the rest of `Device`. We are better off removing this FIXME for now and reevaluate introducing multithreading later on, so the code is not littered with useless empty function calls. --- Userland/Libraries/LibSoftGPU/Device.cpp | 23 ----------------------- Userland/Libraries/LibSoftGPU/Device.h | 1 - 2 files changed, 24 deletions(-) diff --git a/Userland/Libraries/LibSoftGPU/Device.cpp b/Userland/Libraries/LibSoftGPU/Device.cpp index 1d4295711e..ffd2d4abf8 100644 --- a/Userland/Libraries/LibSoftGPU/Device.cpp +++ b/Userland/Libraries/LibSoftGPU/Device.cpp @@ -1103,16 +1103,12 @@ ALWAYS_INLINE bool Device::test_alpha(PixelQuad& quad) void Device::resize(const Gfx::IntSize& size) { - wait_for_all_threads(); - m_render_target = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, size).release_value_but_fixme_should_propagate_errors(); m_depth_buffer = adopt_own(*new DepthBuffer(size)); } void Device::clear_color(const FloatVector4& color) { - wait_for_all_threads(); - uint8_t r = static_cast(clamp(color.x(), 0.0f, 1.0f) * 255); uint8_t g = static_cast(clamp(color.y(), 0.0f, 1.0f) * 255); uint8_t b = static_cast(clamp(color.z(), 0.0f, 1.0f) * 255); @@ -1132,8 +1128,6 @@ void Device::clear_color(const FloatVector4& color) void Device::clear_depth(float depth) { - wait_for_all_threads(); - if (m_options.scissor_enabled) { m_depth_buffer->clear(window_coordinates_to_target_coordinates(m_options.scissor_box), depth); return; @@ -1157,8 +1151,6 @@ void Device::blit_to_color_buffer_at_raster_position(Gfx::Bitmap const& source) if (!m_raster_position.valid) return; - wait_for_all_threads(); - INCREASE_STATISTICS_COUNTER(g_num_pixels, source.width() * source.height()); INCREASE_STATISTICS_COUNTER(g_num_pixels_shaded, source.width() * source.height()); @@ -1189,8 +1181,6 @@ void Device::blit_to_depth_buffer_at_raster_position(Vector const& depth_ void Device::blit_to(Gfx::Bitmap& target) { - wait_for_all_threads(); - Gfx::Painter painter { target }; painter.blit({ 0, 0 }, *m_render_target, m_render_target->rect(), 1.0f, false); @@ -1255,30 +1245,17 @@ void Device::draw_statistics_overlay(Gfx::Bitmap& target) painter.draw_text(target.rect().translated(2, 2), debug_string, font, Gfx::TextAlignment::TopLeft, Gfx::Color::White); } -void Device::wait_for_all_threads() const -{ - // FIXME: Wait for all render threads to finish when multithreading is being implemented -} - void Device::set_options(const RasterizerOptions& options) { - wait_for_all_threads(); - m_options = options; if (m_options.enable_blending) setup_blend_factors(); - - // FIXME: Recreate or reinitialize render threads here when multithreading is being implemented } void Device::set_light_model_params(const LightModelParameters& lighting_model) { - wait_for_all_threads(); - m_lighting_model = lighting_model; - - // FIXME: Recreate or reinitialize render threads here when multithreading is being implemented } Gfx::RGBA32 Device::get_backbuffer_pixel(int x, int y) diff --git a/Userland/Libraries/LibSoftGPU/Device.h b/Userland/Libraries/LibSoftGPU/Device.h index 79246ce56a..6a4b2f6ebb 100644 --- a/Userland/Libraries/LibSoftGPU/Device.h +++ b/Userland/Libraries/LibSoftGPU/Device.h @@ -123,7 +123,6 @@ public: void blit_to(Gfx::Bitmap&); void blit_to_color_buffer_at_raster_position(Gfx::Bitmap const&); void blit_to_depth_buffer_at_raster_position(Vector const&, size_t, size_t); - void wait_for_all_threads() const; void set_options(const RasterizerOptions&); void set_light_model_params(const LightModelParameters&); RasterizerOptions options() const { return m_options; } -- cgit v1.2.3