You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(gfx): drawPolygon kernels use fl::scratch; pick polygon tier by scratch capacity (ESP8266 → 32/64) #5306
drawPolygonCore (src/fl/gfx/primitives.h, ~989 B AVR frame, emitted twice) and drawPolygonABufferCore (src/fl/gfx/poly_abuffer.h, ~605 B, emitted twice) keep scratch on the stack. The default tier (FL_GFX_POLYGON_DEFAULT_MAXN/_CHUNK in src/fl/gfx/canvas.h) is keyed on FL_PLATFORM_HAS_SMALL_STACK, which holds ESP8266 at 8/16 even though it has the RAM for 32/64 — only its 4 KB loop stack is the constraint.
Proposed solution
Gather kernel locals into shape-only structs detail::PolyScratch<MAXN,CHUNK> / detail::AbScratch<MAXN>.
Each kernel opens with fl::scratch<...> s; if (!s) return; — identical behavior to today when FL_SCRATCH_STACK_BYTES == 0.
Select the default tier by capacity: 32/64 on big-stack targets or when FL_SCRATCH_STACK_BYTES >= sizeof(PolyScratch<32,64>); else 8/16. ESP8266 thereby gets 32/64.
Tests: pixel-identical output between stack backend and forced side-stack backend (existing scene hash pins); exhausted side stack → draw is a no-op. Update the canvas.h stack-size note.
Activity
fix(gfx): keep polygon tier macros numeric; stack fallback when the w…
feat(gfx): drawPolygon kernels use fl::scratch; pick polygon tier by …