瀏覽代碼

LibGL: Leave render loop early if color mask empty

Stephan Unverwerth 3 年之前
父節點
當前提交
c4de2bb5e5
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      Userland/Libraries/LibGL/SoftwareRasterizer.cpp

+ 4 - 0
Userland/Libraries/LibGL/SoftwareRasterizer.cpp

@@ -308,6 +308,10 @@ static void rasterize_triangle(const RasterizerOptions& options, Gfx::Bitmap& re
                     continue;
                     continue;
             }
             }
 
 
+            // We will not update the color buffer at all
+            if (!options.color_mask)
+                continue;
+
             // Draw the pixels according to the previously generated mask
             // Draw the pixels according to the previously generated mask
             auto coords = b0;
             auto coords = b0;
             for (int y = 0; y < RASTERIZER_BLOCK_SIZE; y++, coords += step_y) {
             for (int y = 0; y < RASTERIZER_BLOCK_SIZE; y++, coords += step_y) {