This is an automated email from the git hooks/post-receive script.

git pushed a commit to reference refs/pull/114/head
in repository efl.

View the commit online.

commit 5a67a378ce44f02c2ab6be906892722154a5bd3e
Author: [email protected] <[email protected]>
AuthorDate: Tue May 5 11:09:38 2026 -0600

    perf(evas_ector_gl): use glClear+scissor for FBO sub-region clear
    
    Replaces the SHD_RECT pipe-clear-then-immediate-flush with direct
    glClear(GL_COLOR_BUFFER_BIT) under glScissor. This avoids tile buffer
    inefficiencies on tile-based GPUs (Broadcom V3D 4.2, ARM Mali) where the
    previous immediate flush forced a tile store to LPDDR4 plus a tile reload
    before each span batch.
    
    On desktop GPUs the change is neutral; on Raspberry Pi 4, the tile-reload
    overhead measured around 1 GB/s of additional bandwidth per round-trip. At
    6.4 GB/s shared LPDDR4, this is a measurable fraction of the frame budget.
    Since glClear is not a pipe entry, no pipe-reorder race exists between
    SHD_RECT and SHD_SPAN; we flush once before the clear to drain any prior
    pipe content from earlier shapes, then disable GL_SCISSOR_TEST.
    
    The Evas GL state cache fields (clip, cx/cy/cw/ch, cur_tex, render_op)
    are explicitly invalidated so the next pipe flush re-issues the correct
    glEnable/glDisable(GL_SCISSOR_TEST) for clipped pipes. Without this, a
    subsequent clipped pipe would desynchronize the cache: the pipe-flush loop
    decides whether to enable/disable scissor by comparing shader.clip against
    gc->state.current.clip, and a stale cache value would skip the enable branch,
    silently rendering with scissor disabled.
    
    Verification: Expedite VG benchmarks produce byte-identical PNG output vs
    baseline; ector 13/0/0; evas 120/0/0.
    
    Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
---
 src/modules/evas/engines/gl_generic/evas_engine.c | 44 +++++++++++++++--------
 1 file changed, 29 insertions(+), 15 deletions(-)

diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c
index d53ef00746..18d9e71a8e 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -3111,21 +3111,35 @@ eng_ector_end(void *engine,
                 int ox = glim->tex ? glim->tex->x : 0;
                 int oy = glim->tex ? glim->tex->y : 0;
 
-                /* Clear FBO sub-region to transparent.  Flush immediately
-                 * so the clear is executed before any span draws — otherwise
-                 * the SHD_RECT pipe and SHD_SPAN pipes may be reordered
-                 * during batch flush, causing the clear to overwrite the
-                 * span content on some frames. */
-                {
-                   RGBA_Draw_Context *dc_save = gc->dc;
-                   gc->dc = evas_common_draw_context_new();
-                   evas_common_draw_context_set_color(gc->dc, 0, 0, 0, 0);
-                   evas_common_draw_context_set_render_op(gc->dc, EVAS_RENDER_COPY);
-                   evas_gl_common_rect_draw(gc, 0, 0, w, h);
-                   evas_common_draw_context_free(gc->dc);
-                   gc->dc = dc_save;
-                   evas_gl_common_context_flush(gc);
-                }
+                /* Clear FBO sub-region to transparent via glClear + scissor.
+                 *
+                 * On tile-based GPUs (Broadcom V3D / ARM Mali) glClear is
+                 * a tile-buffer flag — no main-memory traffic — whereas the
+                 * previous SHD_RECT + immediate flush forced a tile store
+                 * and reload before the span draws.  The clear happens
+                 * outside the pipe system, so no pipe-reorder races; we
+                 * still flush any pending pipe content first to be safe.
+                 *
+                 * glScissor uses the same (ox, oy, w, h) as glViewport:
+                 * _evas_gl_common_viewport_set already sets the viewport to
+                 * (tex->x, tex->y, w, h) for atlas sub-rects, so scissor
+                 * coords are in framebuffer space, matching GL bottom-left.
+                 *
+                 * The Evas GL state cache is invalidated on textures and
+                 * render op below so subsequent draws restore them as needed. */
+                evas_gl_common_context_flush(gc);
+                glEnable(GL_SCISSOR_TEST);
+                glScissor(ox, oy, w, h);
+                glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+                glClear(GL_COLOR_BUFFER_BIT);
+                glDisable(GL_SCISSOR_TEST);
+                gc->state.current.clip      = 0;
+                gc->state.current.cx        = 0;
+                gc->state.current.cy        = 0;
+                gc->state.current.cw        = 0;
+                gc->state.current.ch        = 0;
+                gc->state.current.cur_tex   = -1;
+                gc->state.current.render_op = -1;
 
                 /* Per-shape draw loop.
                  *

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to