summaryrefslogtreecommitdiff
path: root/AK/SIMDExtras.h
diff options
context:
space:
mode:
authorJelle Raaijmakers <jelle@gmta.nl>2022-01-16 22:48:46 +0100
committerAndreas Kling <kling@serenityos.org>2022-01-17 12:49:00 +0100
commit11c807ebd1e0677bc93e6dc98123c9ca210b2cff (patch)
treeac20931082cace861085fcf8f3b0cf63c80020ad /AK/SIMDExtras.h
parent638667194438416527b267065e1077a747208c35 (diff)
downloadserenity-11c807ebd1e0677bc93e6dc98123c9ca210b2cff.zip
LibGL+LibSoftGPU: Implement the stencil buffer
This implements an 8-bit front stencil buffer. Stencil operations are SIMD optimized. LibGL changes include: * New `glStencilMask` and `glStencilMaskSeparate` functions * New context parameter `GL_STENCIL_CLEAR_VALUE`
Diffstat (limited to 'AK/SIMDExtras.h')
-rw-r--r--AK/SIMDExtras.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/AK/SIMDExtras.h b/AK/SIMDExtras.h
index 88ec07d942..dac25d456d 100644
--- a/AK/SIMDExtras.h
+++ b/AK/SIMDExtras.h
@@ -109,6 +109,17 @@ ALWAYS_INLINE static f32x4 load4_masked(float const* a, float const* b, float co
};
}
+ALWAYS_INLINE static i32x4 load4_masked(u8 const* a, u8 const* b, u8 const* c, u8 const* d, i32x4 mask)
+{
+ int bits = maskbits(mask);
+ return i32x4 {
+ bits & 1 ? *a : 0,
+ bits & 2 ? *b : 0,
+ bits & 4 ? *c : 0,
+ bits & 8 ? *d : 0,
+ };
+}
+
ALWAYS_INLINE static u32x4 load4_masked(u32 const* a, u32 const* b, u32 const* c, u32 const* d, i32x4 mask)
{
int bits = maskbits(mask);