From c4de2bb5e55113b1a3c69eed4b9f08cdcd6fe521 Mon Sep 17 00:00:00 2001 From: Stephan Unverwerth Date: Mon, 16 Aug 2021 19:28:01 +0200 Subject: [PATCH] LibGL: Leave render loop early if color mask empty --- Userland/Libraries/LibGL/SoftwareRasterizer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/Libraries/LibGL/SoftwareRasterizer.cpp b/Userland/Libraries/LibGL/SoftwareRasterizer.cpp index ea4e019418a..79bd4a7e1be 100644 --- a/Userland/Libraries/LibGL/SoftwareRasterizer.cpp +++ b/Userland/Libraries/LibGL/SoftwareRasterizer.cpp @@ -308,6 +308,10 @@ static void rasterize_triangle(const RasterizerOptions& options, Gfx::Bitmap& re continue; } + // We will not update the color buffer at all + if (!options.color_mask) + continue; + // Draw the pixels according to the previously generated mask auto coords = b0; for (int y = 0; y < RASTERIZER_BLOCK_SIZE; y++, coords += step_y) {