LibGL: Implement glColorMask

This commit is contained in:
Jesse Buhagiar 2021-08-13 22:03:39 +10:00 committed by Linus Groh
commit 8157e7740b
Notes: sideshowbarker 2024-07-18 05:39:04 +09:00
7 changed files with 41 additions and 3 deletions

View file

@ -383,7 +383,7 @@ static void rasterize_triangle(const RasterizerOptions& options, Gfx::Bitmap& re
+ float_dst * dst_factor_dst_color
+ FloatVector4(float_dst.w(), float_dst.w(), float_dst.w(), float_dst.w()) * dst_factor_dst_alpha;
*dst = to_rgba32(*src * src_factor + float_dst * dst_factor);
*dst = (*dst & ~options.color_mask) | (to_rgba32(*src * src_factor + float_dst * dst_factor) & options.color_mask);
}
}
} else {
@ -395,7 +395,7 @@ static void rasterize_triangle(const RasterizerOptions& options, Gfx::Bitmap& re
if (~pixel_mask[y] & (1 << x))
continue;
*dst = to_rgba32(*src);
*dst = (*dst & ~options.color_mask) | (to_rgba32(*src) & options.color_mask);
}
}
}