From f5e5d7180fc9403689fe6a85f4d7c537eb35b61d Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 31 Mar 2021 10:30:16 +0200 Subject: [PATCH] Remove conditional from winding number computation --- gpui/src/platform/mac/shaders/shaders.metal | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gpui/src/platform/mac/shaders/shaders.metal b/gpui/src/platform/mac/shaders/shaders.metal index 7e80674ccc..e9f8239541 100644 --- a/gpui/src/platform/mac/shaders/shaders.metal +++ b/gpui/src/platform/mac/shaders/shaders.metal @@ -204,10 +204,7 @@ fragment float4 sprite_fragment( float4 sample = atlas.sample(atlas_sampler, input.atlas_position); float mask; if (input.compute_winding) { - mask = fmod(sample.r * MAX_WINDINGS, 2.); - if (mask > 1) { - mask = 2. - mask; - } + mask = 1. - abs(1. - fmod(sample.r * MAX_WINDINGS, 2.)); } else { mask = sample.a; }