From 84f15592dca3b2318cbedbf4366933bdeff0f2cc Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 2 Apr 2026 01:20:10 -0600 Subject: [PATCH] [gpu] Hoist fwidth out of _hb_gpu_render_single Compute pixelsPerEm once in hb_gpu_render and pass it down, so MSAA samples share one fwidth call instead of each computing their own. Required for WGSL (fwidth must be called from uniform control flow) and a minor win for all backends. Assisted-by: Claude --- src/hb-gpu-fragment-glsl.hh | 18 +++++++++--------- src/hb-gpu-fragment-hlsl.hh | 18 +++++++++--------- src/hb-gpu-fragment-msl.hh | 18 +++++++++--------- src/hb-gpu-fragment-wgsl.hh | 18 +++++++++--------- src/hb-gpu-fragment.glsl | 18 +++++++++--------- src/hb-gpu-fragment.hlsl | 18 +++++++++--------- src/hb-gpu-fragment.msl | 18 +++++++++--------- src/hb-gpu-fragment.wgsl | 18 +++++++++--------- 8 files changed, 72 insertions(+), 72 deletions(-) diff --git a/src/hb-gpu-fragment-glsl.hh b/src/hb-gpu-fragment-glsl.hh index 247b1a428..0e2597253 100644 --- a/src/hb-gpu-fragment-glsl.hh +++ b/src/hb-gpu-fragment-glsl.hh @@ -173,10 +173,8 @@ static const char *hb_gpu_fragment_glsl = "}\n" "\n" "/* Single-sample coverage in [0, 1]. */\n" -"float _hb_gpu_render_single (vec2 renderCoord, uint glyphLoc_)\n" +"float _hb_gpu_render_single (vec2 renderCoord, vec2 pixelsPerEm, uint glyphLoc_)\n" "{\n" -" vec2 emsPerPixel = fwidth (renderCoord);\n" -" vec2 pixelsPerEm = 1.0 / emsPerPixel;\n" "\n" " _hb_gpu_glyph_info gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_);\n" " int glyphLoc = gi.glyphLoc;\n" @@ -297,20 +295,22 @@ static const char *hb_gpu_fragment_glsl = " */\n" "float hb_gpu_render (vec2 renderCoord, uint glyphLoc_)\n" "{\n" -" float c = _hb_gpu_render_single (renderCoord, glyphLoc_);\n" +" vec2 emsPerPixel = fwidth (renderCoord);\n" +" vec2 pixelsPerEm = 1.0 / emsPerPixel;\n" +"\n" +" float c = _hb_gpu_render_single (renderCoord, pixelsPerEm, glyphLoc_);\n" "\n" "#ifndef HB_GPU_NO_MSAA\n" " float ppem = hb_gpu_ppem (renderCoord, glyphLoc_);\n" -" vec2 emsPerPixel = fwidth (renderCoord);\n" "\n" " if (ppem < 16.0)\n" " {\n" " vec2 d = emsPerPixel * (1.0 / 3.0);\n" " float msaa = 0.25 *\n" -" (_hb_gpu_render_single (renderCoord + vec2 (-d.x, -d.y), glyphLoc_) +\n" -" _hb_gpu_render_single (renderCoord + vec2 ( d.x, -d.y), glyphLoc_) +\n" -" _hb_gpu_render_single (renderCoord + vec2 (-d.x, d.y), glyphLoc_) +\n" -" _hb_gpu_render_single (renderCoord + vec2 ( d.x, d.y), glyphLoc_));\n" +" (_hb_gpu_render_single (renderCoord + vec2 (-d.x, -d.y), pixelsPerEm, glyphLoc_) +\n" +" _hb_gpu_render_single (renderCoord + vec2 ( d.x, -d.y), pixelsPerEm, glyphLoc_) +\n" +" _hb_gpu_render_single (renderCoord + vec2 (-d.x, d.y), pixelsPerEm, glyphLoc_) +\n" +" _hb_gpu_render_single (renderCoord + vec2 ( d.x, d.y), pixelsPerEm, glyphLoc_));\n" "\n" " c = mix (c, msaa, smoothstep (16.0, 8.0, ppem));\n" " }\n" diff --git a/src/hb-gpu-fragment-hlsl.hh b/src/hb-gpu-fragment-hlsl.hh index 2d979ca08..206cc19fe 100644 --- a/src/hb-gpu-fragment-hlsl.hh +++ b/src/hb-gpu-fragment-hlsl.hh @@ -159,10 +159,8 @@ static const char *hb_gpu_fragment_hlsl = "\n" "\n" "/* Single-sample coverage in [0, 1]. */\n" -"float _hb_gpu_render_single (float2 renderCoord, uint glyphLoc_)\n" +"float _hb_gpu_render_single (float2 renderCoord, float2 pixelsPerEm, uint glyphLoc_)\n" "{\n" -" float2 emsPerPixel = fwidth (renderCoord);\n" -" float2 pixelsPerEm = 1.0 / emsPerPixel;\n" "\n" " _hb_gpu_glyph_info gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_);\n" " int glyphLoc = gi.glyphLoc;\n" @@ -283,20 +281,22 @@ static const char *hb_gpu_fragment_hlsl = " */\n" "float hb_gpu_render (float2 renderCoord, uint glyphLoc_)\n" "{\n" -" float c = _hb_gpu_render_single (renderCoord, glyphLoc_);\n" +" float2 emsPerPixel = fwidth (renderCoord);\n" +" float2 pixelsPerEm = 1.0 / emsPerPixel;\n" +"\n" +" float c = _hb_gpu_render_single (renderCoord, pixelsPerEm, glyphLoc_);\n" "\n" "#ifndef HB_GPU_NO_MSAA\n" " float ppem = hb_gpu_ppem (renderCoord, glyphLoc_);\n" -" float2 emsPerPixel = fwidth (renderCoord);\n" "\n" " if (ppem < 16.0)\n" " {\n" " float2 d = emsPerPixel * (1.0 / 3.0);\n" " float msaa = 0.25 *\n" -" (_hb_gpu_render_single (renderCoord + float2 (-d.x, -d.y), glyphLoc_) +\n" -" _hb_gpu_render_single (renderCoord + float2 ( d.x, -d.y), glyphLoc_) +\n" -" _hb_gpu_render_single (renderCoord + float2 (-d.x, d.y), glyphLoc_) +\n" -" _hb_gpu_render_single (renderCoord + float2 ( d.x, d.y), glyphLoc_));\n" +" (_hb_gpu_render_single (renderCoord + float2 (-d.x, -d.y), pixelsPerEm, glyphLoc_) +\n" +" _hb_gpu_render_single (renderCoord + float2 ( d.x, -d.y), pixelsPerEm, glyphLoc_) +\n" +" _hb_gpu_render_single (renderCoord + float2 (-d.x, d.y), pixelsPerEm, glyphLoc_) +\n" +" _hb_gpu_render_single (renderCoord + float2 ( d.x, d.y), pixelsPerEm, glyphLoc_));\n" "\n" " c = lerp (c, msaa, smoothstep (16.0, 8.0, ppem));\n" " }\n" diff --git a/src/hb-gpu-fragment-msl.hh b/src/hb-gpu-fragment-msl.hh index e31693363..b8c88b76c 100644 --- a/src/hb-gpu-fragment-msl.hh +++ b/src/hb-gpu-fragment-msl.hh @@ -158,11 +158,9 @@ static const char *hb_gpu_fragment_msl = "}\n" "\n" "/* Single-sample coverage in [0, 1]. */\n" -"float _hb_gpu_render_single (float2 renderCoord, uint glyphLoc_,\n" +"float _hb_gpu_render_single (float2 renderCoord, float2 pixelsPerEm, uint glyphLoc_,\n" " device const short4* hb_gpu_atlas)\n" "{\n" -" float2 emsPerPixel = fwidth (renderCoord);\n" -" float2 pixelsPerEm = 1.0 / emsPerPixel;\n" "\n" " _hb_gpu_glyph_info gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_, hb_gpu_atlas);\n" " int glyphLoc = gi.glyphLoc;\n" @@ -285,20 +283,22 @@ static const char *hb_gpu_fragment_msl = "float hb_gpu_render (float2 renderCoord, uint glyphLoc_,\n" " device const short4* hb_gpu_atlas)\n" "{\n" -" float c = _hb_gpu_render_single (renderCoord, glyphLoc_, hb_gpu_atlas);\n" +" float2 emsPerPixel = fwidth (renderCoord);\n" +" float2 pixelsPerEm = 1.0 / emsPerPixel;\n" +"\n" +" float c = _hb_gpu_render_single (renderCoord, pixelsPerEm, glyphLoc_, hb_gpu_atlas);\n" "\n" "#ifndef HB_GPU_NO_MSAA\n" " float ppem = hb_gpu_ppem (renderCoord, glyphLoc_, hb_gpu_atlas);\n" -" float2 emsPerPixel = fwidth (renderCoord);\n" "\n" " if (ppem < 16.0)\n" " {\n" " float2 d = emsPerPixel * (1.0 / 3.0);\n" " float msaa = 0.25 *\n" -" (_hb_gpu_render_single (renderCoord + float2 (-d.x, -d.y), glyphLoc_, hb_gpu_atlas) +\n" -" _hb_gpu_render_single (renderCoord + float2 ( d.x, -d.y), glyphLoc_, hb_gpu_atlas) +\n" -" _hb_gpu_render_single (renderCoord + float2 (-d.x, d.y), glyphLoc_, hb_gpu_atlas) +\n" -" _hb_gpu_render_single (renderCoord + float2 ( d.x, d.y), glyphLoc_, hb_gpu_atlas));\n" +" (_hb_gpu_render_single (renderCoord + float2 (-d.x, -d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas) +\n" +" _hb_gpu_render_single (renderCoord + float2 ( d.x, -d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas) +\n" +" _hb_gpu_render_single (renderCoord + float2 (-d.x, d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas) +\n" +" _hb_gpu_render_single (renderCoord + float2 ( d.x, d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas));\n" "\n" " c = mix (c, msaa, smoothstep (16.0, 8.0, ppem));\n" " }\n" diff --git a/src/hb-gpu-fragment-wgsl.hh b/src/hb-gpu-fragment-wgsl.hh index c0bb91b3b..d06e3c5f8 100644 --- a/src/hb-gpu-fragment-wgsl.hh +++ b/src/hb-gpu-fragment-wgsl.hh @@ -160,11 +160,9 @@ static const char *hb_gpu_fragment_wgsl = "}\n" "\n" "/* Single-sample coverage in [0, 1]. */\n" -"fn _hb_gpu_render_single (renderCoord: vec2f, glyphLoc_: u32,\n" +"fn _hb_gpu_render_single (renderCoord: vec2f, pixelsPerEm: vec2f, glyphLoc_: u32,\n" " hb_gpu_atlas: ptr>, read>) -> f32\n" "{\n" -" let emsPerPixel = fwidth (renderCoord);\n" -" let pixelsPerEm = 1.0 / emsPerPixel;\n" "\n" " let gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_, hb_gpu_atlas);\n" " let glyphLoc = gi.glyphLoc;\n" @@ -293,19 +291,21 @@ static const char *hb_gpu_fragment_wgsl = "fn hb_gpu_render (renderCoord: vec2f, glyphLoc_: u32,\n" " hb_gpu_atlas: ptr>, read>) -> f32\n" "{\n" -" var c = _hb_gpu_render_single (renderCoord, glyphLoc_, hb_gpu_atlas);\n" +" let emsPerPixel = fwidth (renderCoord);\n" +" let pixelsPerEm = 1.0 / emsPerPixel;\n" +"\n" +" var c = _hb_gpu_render_single (renderCoord, pixelsPerEm, glyphLoc_, hb_gpu_atlas);\n" "\n" " let ppem = hb_gpu_ppem (renderCoord, glyphLoc_, hb_gpu_atlas);\n" -" let emsPerPixel = fwidth (renderCoord);\n" "\n" " if (ppem < 16.0)\n" " {\n" " let d = emsPerPixel * (1.0 / 3.0);\n" " let msaa = 0.25 *\n" -" (_hb_gpu_render_single (renderCoord + vec2f (-d.x, -d.y), glyphLoc_, hb_gpu_atlas) +\n" -" _hb_gpu_render_single (renderCoord + vec2f ( d.x, -d.y), glyphLoc_, hb_gpu_atlas) +\n" -" _hb_gpu_render_single (renderCoord + vec2f (-d.x, d.y), glyphLoc_, hb_gpu_atlas) +\n" -" _hb_gpu_render_single (renderCoord + vec2f ( d.x, d.y), glyphLoc_, hb_gpu_atlas));\n" +" (_hb_gpu_render_single (renderCoord + vec2f (-d.x, -d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas) +\n" +" _hb_gpu_render_single (renderCoord + vec2f ( d.x, -d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas) +\n" +" _hb_gpu_render_single (renderCoord + vec2f (-d.x, d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas) +\n" +" _hb_gpu_render_single (renderCoord + vec2f ( d.x, d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas));\n" "\n" " c = mix (c, msaa, smoothstep (16.0, 8.0, ppem));\n" " }\n" diff --git a/src/hb-gpu-fragment.glsl b/src/hb-gpu-fragment.glsl index 53fa267fa..a3872303a 100644 --- a/src/hb-gpu-fragment.glsl +++ b/src/hb-gpu-fragment.glsl @@ -172,10 +172,8 @@ ivec2 _hb_gpu_curve_counts (vec2 renderCoord, uint glyphLoc_) } /* Single-sample coverage in [0, 1]. */ -float _hb_gpu_render_single (vec2 renderCoord, uint glyphLoc_) +float _hb_gpu_render_single (vec2 renderCoord, vec2 pixelsPerEm, uint glyphLoc_) { - vec2 emsPerPixel = fwidth (renderCoord); - vec2 pixelsPerEm = 1.0 / emsPerPixel; _hb_gpu_glyph_info gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_); int glyphLoc = gi.glyphLoc; @@ -296,20 +294,22 @@ float _hb_gpu_render_single (vec2 renderCoord, uint glyphLoc_) */ float hb_gpu_render (vec2 renderCoord, uint glyphLoc_) { - float c = _hb_gpu_render_single (renderCoord, glyphLoc_); + vec2 emsPerPixel = fwidth (renderCoord); + vec2 pixelsPerEm = 1.0 / emsPerPixel; + + float c = _hb_gpu_render_single (renderCoord, pixelsPerEm, glyphLoc_); #ifndef HB_GPU_NO_MSAA float ppem = hb_gpu_ppem (renderCoord, glyphLoc_); - vec2 emsPerPixel = fwidth (renderCoord); if (ppem < 16.0) { vec2 d = emsPerPixel * (1.0 / 3.0); float msaa = 0.25 * - (_hb_gpu_render_single (renderCoord + vec2 (-d.x, -d.y), glyphLoc_) + - _hb_gpu_render_single (renderCoord + vec2 ( d.x, -d.y), glyphLoc_) + - _hb_gpu_render_single (renderCoord + vec2 (-d.x, d.y), glyphLoc_) + - _hb_gpu_render_single (renderCoord + vec2 ( d.x, d.y), glyphLoc_)); + (_hb_gpu_render_single (renderCoord + vec2 (-d.x, -d.y), pixelsPerEm, glyphLoc_) + + _hb_gpu_render_single (renderCoord + vec2 ( d.x, -d.y), pixelsPerEm, glyphLoc_) + + _hb_gpu_render_single (renderCoord + vec2 (-d.x, d.y), pixelsPerEm, glyphLoc_) + + _hb_gpu_render_single (renderCoord + vec2 ( d.x, d.y), pixelsPerEm, glyphLoc_)); c = mix (c, msaa, smoothstep (16.0, 8.0, ppem)); } diff --git a/src/hb-gpu-fragment.hlsl b/src/hb-gpu-fragment.hlsl index 208956dd8..c18898e3a 100644 --- a/src/hb-gpu-fragment.hlsl +++ b/src/hb-gpu-fragment.hlsl @@ -158,10 +158,8 @@ int2 _hb_gpu_curve_counts (float2 renderCoord, uint glyphLoc_) /* Single-sample coverage in [0, 1]. */ -float _hb_gpu_render_single (float2 renderCoord, uint glyphLoc_) +float _hb_gpu_render_single (float2 renderCoord, float2 pixelsPerEm, uint glyphLoc_) { - float2 emsPerPixel = fwidth (renderCoord); - float2 pixelsPerEm = 1.0 / emsPerPixel; _hb_gpu_glyph_info gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_); int glyphLoc = gi.glyphLoc; @@ -282,20 +280,22 @@ float _hb_gpu_render_single (float2 renderCoord, uint glyphLoc_) */ float hb_gpu_render (float2 renderCoord, uint glyphLoc_) { - float c = _hb_gpu_render_single (renderCoord, glyphLoc_); + float2 emsPerPixel = fwidth (renderCoord); + float2 pixelsPerEm = 1.0 / emsPerPixel; + + float c = _hb_gpu_render_single (renderCoord, pixelsPerEm, glyphLoc_); #ifndef HB_GPU_NO_MSAA float ppem = hb_gpu_ppem (renderCoord, glyphLoc_); - float2 emsPerPixel = fwidth (renderCoord); if (ppem < 16.0) { float2 d = emsPerPixel * (1.0 / 3.0); float msaa = 0.25 * - (_hb_gpu_render_single (renderCoord + float2 (-d.x, -d.y), glyphLoc_) + - _hb_gpu_render_single (renderCoord + float2 ( d.x, -d.y), glyphLoc_) + - _hb_gpu_render_single (renderCoord + float2 (-d.x, d.y), glyphLoc_) + - _hb_gpu_render_single (renderCoord + float2 ( d.x, d.y), glyphLoc_)); + (_hb_gpu_render_single (renderCoord + float2 (-d.x, -d.y), pixelsPerEm, glyphLoc_) + + _hb_gpu_render_single (renderCoord + float2 ( d.x, -d.y), pixelsPerEm, glyphLoc_) + + _hb_gpu_render_single (renderCoord + float2 (-d.x, d.y), pixelsPerEm, glyphLoc_) + + _hb_gpu_render_single (renderCoord + float2 ( d.x, d.y), pixelsPerEm, glyphLoc_)); c = lerp (c, msaa, smoothstep (16.0, 8.0, ppem)); } diff --git a/src/hb-gpu-fragment.msl b/src/hb-gpu-fragment.msl index 773eee476..bd4ba056b 100644 --- a/src/hb-gpu-fragment.msl +++ b/src/hb-gpu-fragment.msl @@ -157,11 +157,9 @@ int2 _hb_gpu_curve_counts (float2 renderCoord, uint glyphLoc_, } /* Single-sample coverage in [0, 1]. */ -float _hb_gpu_render_single (float2 renderCoord, uint glyphLoc_, +float _hb_gpu_render_single (float2 renderCoord, float2 pixelsPerEm, uint glyphLoc_, device const short4* hb_gpu_atlas) { - float2 emsPerPixel = fwidth (renderCoord); - float2 pixelsPerEm = 1.0 / emsPerPixel; _hb_gpu_glyph_info gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_, hb_gpu_atlas); int glyphLoc = gi.glyphLoc; @@ -284,20 +282,22 @@ float _hb_gpu_render_single (float2 renderCoord, uint glyphLoc_, float hb_gpu_render (float2 renderCoord, uint glyphLoc_, device const short4* hb_gpu_atlas) { - float c = _hb_gpu_render_single (renderCoord, glyphLoc_, hb_gpu_atlas); + float2 emsPerPixel = fwidth (renderCoord); + float2 pixelsPerEm = 1.0 / emsPerPixel; + + float c = _hb_gpu_render_single (renderCoord, pixelsPerEm, glyphLoc_, hb_gpu_atlas); #ifndef HB_GPU_NO_MSAA float ppem = hb_gpu_ppem (renderCoord, glyphLoc_, hb_gpu_atlas); - float2 emsPerPixel = fwidth (renderCoord); if (ppem < 16.0) { float2 d = emsPerPixel * (1.0 / 3.0); float msaa = 0.25 * - (_hb_gpu_render_single (renderCoord + float2 (-d.x, -d.y), glyphLoc_, hb_gpu_atlas) + - _hb_gpu_render_single (renderCoord + float2 ( d.x, -d.y), glyphLoc_, hb_gpu_atlas) + - _hb_gpu_render_single (renderCoord + float2 (-d.x, d.y), glyphLoc_, hb_gpu_atlas) + - _hb_gpu_render_single (renderCoord + float2 ( d.x, d.y), glyphLoc_, hb_gpu_atlas)); + (_hb_gpu_render_single (renderCoord + float2 (-d.x, -d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas) + + _hb_gpu_render_single (renderCoord + float2 ( d.x, -d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas) + + _hb_gpu_render_single (renderCoord + float2 (-d.x, d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas) + + _hb_gpu_render_single (renderCoord + float2 ( d.x, d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas)); c = mix (c, msaa, smoothstep (16.0, 8.0, ppem)); } diff --git a/src/hb-gpu-fragment.wgsl b/src/hb-gpu-fragment.wgsl index b27ae806c..7691142fd 100644 --- a/src/hb-gpu-fragment.wgsl +++ b/src/hb-gpu-fragment.wgsl @@ -159,11 +159,9 @@ fn _hb_gpu_curve_counts (renderCoord: vec2f, glyphLoc_: u32, } /* Single-sample coverage in [0, 1]. */ -fn _hb_gpu_render_single (renderCoord: vec2f, glyphLoc_: u32, +fn _hb_gpu_render_single (renderCoord: vec2f, pixelsPerEm: vec2f, glyphLoc_: u32, hb_gpu_atlas: ptr>, read>) -> f32 { - let emsPerPixel = fwidth (renderCoord); - let pixelsPerEm = 1.0 / emsPerPixel; let gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_, hb_gpu_atlas); let glyphLoc = gi.glyphLoc; @@ -292,19 +290,21 @@ fn _hb_gpu_render_single (renderCoord: vec2f, glyphLoc_: u32, fn hb_gpu_render (renderCoord: vec2f, glyphLoc_: u32, hb_gpu_atlas: ptr>, read>) -> f32 { - var c = _hb_gpu_render_single (renderCoord, glyphLoc_, hb_gpu_atlas); + let emsPerPixel = fwidth (renderCoord); + let pixelsPerEm = 1.0 / emsPerPixel; + + var c = _hb_gpu_render_single (renderCoord, pixelsPerEm, glyphLoc_, hb_gpu_atlas); let ppem = hb_gpu_ppem (renderCoord, glyphLoc_, hb_gpu_atlas); - let emsPerPixel = fwidth (renderCoord); if (ppem < 16.0) { let d = emsPerPixel * (1.0 / 3.0); let msaa = 0.25 * - (_hb_gpu_render_single (renderCoord + vec2f (-d.x, -d.y), glyphLoc_, hb_gpu_atlas) + - _hb_gpu_render_single (renderCoord + vec2f ( d.x, -d.y), glyphLoc_, hb_gpu_atlas) + - _hb_gpu_render_single (renderCoord + vec2f (-d.x, d.y), glyphLoc_, hb_gpu_atlas) + - _hb_gpu_render_single (renderCoord + vec2f ( d.x, d.y), glyphLoc_, hb_gpu_atlas)); + (_hb_gpu_render_single (renderCoord + vec2f (-d.x, -d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas) + + _hb_gpu_render_single (renderCoord + vec2f ( d.x, -d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas) + + _hb_gpu_render_single (renderCoord + vec2f (-d.x, d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas) + + _hb_gpu_render_single (renderCoord + vec2f ( d.x, d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas)); c = mix (c, msaa, smoothstep (16.0, 8.0, ppem)); }