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 98e6b9332a05261a7a773204b32e6d1ef5cc9c44
Author: [email protected] <[email protected]>
AuthorDate: Mon Aug 10 21:07:54 2026 -0600

    fix(evas_ector_gl): flush before reusing span textures across passes
    
    eng_ector_begin resets the collector counts but keeps the collectors, so a
    second pass on the same ector surface reuses slot 0 and its
    Evas_GL_Texture, overwriting it in place.  Uploads happen before the flush,
    so on a surface rendered twice in one frame the second pass's span data
    reached GL ahead of the draw that was supposed to read the first pass's -
    the first pass then sampled the wrong spans.
    
    Drain pending draws when a pass starts on a surface that still has live
    collectors.  In the ordinary single-pass case eng_ector_end has already
    flushed via target_surface_set, so this costs a check that stops at the
    first empty pipe.
---
 src/modules/evas/engines/gl_generic/evas_engine.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c
index a6c54d0a75..089de72ed5 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -2856,6 +2856,23 @@ eng_ector_begin(void *engine, void *surface,
            Ector_Software_Surface_Data *pd = efl_data_scope_get(ector, ECTOR_SOFTWARE_SURFACE_CLASS);
            if (!pd) return EINA_FALSE;
 
+           /* Collectors survive across passes and their Evas_GL_Textures are
+            * overwritten in place by span_collector_upload_textures.  If this
+            * surface already ran a pass whose draws are still queued, those
+            * uploads would land in the GL stream ahead of the draw that reads
+            * them, and the earlier pass would sample this pass's spans.
+            * Drain first.  In the normal single-pass case eng_ector_end's
+            * target_surface_set has already flushed, so this is a cheap
+            * no-op: evas_gl_common_context_flush stops at the first empty
+            * pipe. */
+           if (pd->span_collectors_fill_count > 0 ||
+               pd->span_collectors_stroke_count > 0)
+             {
+                Evas_Engine_GL_Context *fgc =
+                   gl_generic_context_find(engine, EINA_FALSE);
+                if (fgc) evas_gl_common_context_flush(fgc);
+             }
+
            /* Reset counts — existing collectors are reused by the alloc cb. */
            pd->span_collectors_fill_count   = 0;
            pd->span_collectors_stroke_count = 0;

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

Reply via email to