From ef4ec772ad6b0939d9bf761aa16d613dff8a4bb5 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 24 Dec 2020 11:41:19 +0100 Subject: [PATCH] backdrop: repair unsound optimization Signed-off-by: Elias Naur --- piet-gpu/shader/backdrop.comp | 5 ++++- piet-gpu/shader/backdrop.spv | Bin 7840 -> 7980 bytes 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/piet-gpu/shader/backdrop.comp b/piet-gpu/shader/backdrop.comp index fb01d0d..6828ac1 100644 --- a/piet-gpu/shader/backdrop.comp +++ b/piet-gpu/shader/backdrop.comp @@ -54,7 +54,10 @@ void main() { Path path = Path_read(path_ref); sh_row_width[th_ix] = path.bbox.z - path.bbox.x; row_count = path.bbox.w - path.bbox.y; - if (row_count == 1) { + // Paths that don't cross tile top edges don't have backdrops. + // Don't apply the optimization to paths that may cross the y = 0 + // top edge, but clipped to 1 row. + if (row_count == 1 && path.bbox.y > 0) { // Note: this can probably be expanded to width = 2 as // long as it doesn't cross the left edge. row_count = 0; diff --git a/piet-gpu/shader/backdrop.spv b/piet-gpu/shader/backdrop.spv index e71fd9b5c06cb42cf09a8c4cd09eb3ea34054251..dc1cbc476990d468c314ef76f181347ec746fd55 100644 GIT binary patch literal 7980 zcmai&37C~-6~{lB1rP+;R90uC6c>#L6RrvV*Aq&0M~HwVjB)oS%-xmoFddSxRfY)8(E>l-%?SDG2j zM9!MTmYU^F3x=DGk-p}_G{M4=#fw)M-$vD0)*z+(9su4@Zfo?Gt>4NtPGZ-COataemTFT(%4w7Z#B;P^m&i?@;vS_Qzwu3aP$C`+oPkv zjq=ufezXPHi&43MY0F;HvfHwifY$livuA@jovDZ&m(SOxYH3})uUuVQ+k$Ei)N5GFYiK^F^+49$C{IlW%nIIyYJn|yHKYNaA8h1oNC zds8b7(f#2H;jm+K-o9)d=(p@zskp50`SxtC3~bs=dEtzF&amO7-tw?D1@Al7OLRf+ zg0gr1M=tg~O zsjog#<2B0tj8n$j18&b=3?3>s%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