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 867a07b846a57a61722b0e1519964b7f10aedf5a
Author: [email protected] <[email protected]>
AuthorDate: Tue May 5 21:58:39 2026 -0600
refactor(evas_ector_gl): drop dead per-shape uniform path
Prior commits (tasks 1–4) refactored the span-buffer pipeline to pack all
per-shape geometry and shading parameters (colors, gradient coefficients,
offsets, mask state) into the per-vertex interleaved buffer (span_vertex_data)
as varyings. The pipe merge predicate now uses only 6 fields: the texture
identities (fill_tex, stroke_tex, grad_atlas_tex, mask_tex) and frame-level
constants (inv_tw, inv_th).
The ~42 fields that carried per-shape uniform data are no longer written or
read; they were made obsolete in tasks 1–4 but left in place to support a
gradual transition. This commit completes the cleanup:
- Shrink pipe entry shader substruct from 44+ fields to 6 (saving ~200 bytes/pipe)
- Delete grad_ramp_tex and grad_ramp_crc from Span_Collector (no longer used
since the ramp atlas was introduced in task 1; the orphaned glDeleteTextures
guard is removed)
- Remove gw/gh arguments from span_shader_pipe_flush signature—NDC conversion
was moved to push time in task 3, so the flush function no longer needs
canvas dimensions
- Flip use_vertex from 1 to 0 for span pipes (array.vertex is never read by
span_shader_pipe_flush; the real geometry is in span_vertex_data)
- Replace PIPE_GROW / vertex_array_size_check / PUSH_6_VERTICES with direct
array.num update and explicit gc->havestuff = EINA_TRUE (necessary because
switching use_vertex to 0 means the old flag wouldn't be set transitively,
causing span-only frames to be skipped)
- Fix stale comment ("use_vertex is always true") to note the exception
No behavioral change: every deleted field/call was already unreachable at
commit 760d799f79 (the pre-cleanup state). The merge predicate relied solely
on the 6 retained fields; the 44 deleted ones were written but never read.
Verification: ector suite 19/0/0, evas suite 120/0/0, Expedite VG benchmark
10/10 PNGs byte-identical vs baseline.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
---
.../evas/engines/gl_common/evas_gl_common.h | 72 ++++------------------
.../evas/engines/gl_common/evas_gl_context.c | 22 +++----
.../evas/engines/gl_generic/evas_ector_gl_span.h | 10 +--
.../engines/gl_generic/evas_ector_gl_span_shader.c | 14 +----
4 files changed, 25 insertions(+), 93 deletions(-)
diff --git a/src/modules/evas/engines/gl_common/evas_gl_common.h b/src/modules/evas/engines/gl_common/evas_gl_common.h
index 4e9ce9a25e..c967fa8a35 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_common.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_common.h
@@ -375,61 +375,15 @@ struct _Evas_Engine_GL_Context
Eina_Bool map_nearest : 1;
Eina_Bool map_delete : 1;
} filter;
- /* SHD_SPAN: span-lookup shader parameters */
- /* Span textures for fill and stroke (both from same pool atlas). */
- GLuint span_fill_tex; /* pool GL texture for fill spans (0 = none) */
- float span_fill_off_tx;/* texel x-offset of fill in pool */
- float span_fill_off_ty;/* texel y-offset of fill in pool */
- uint32_t span_fill_col; /* fill base color (premultiplied ARGB) */
- GLuint span_stroke_tex; /* pool GL texture for stroke spans (0 = none) */
- float span_stroke_off_tx;
- float span_stroke_off_ty;
- uint32_t span_stroke_col; /* stroke base color (premultiplied ARGB) */
- float span_inv_tw; /* 1.0 / pool_width (shared, same pool) */
- float span_inv_th; /* 1.0 / pool_height */
- int span_max_spans; /* max spans per row */
- uint32_t span_mul_col; /* multiply color (premultiplied ARGB) */
- int span_fill_type; /* Span_Data_Type for fill (1=Solid, 2=Linear, 3=Radial) */
- int span_stroke_type; /* Span_Data_Type for stroke (1=Solid, 2=Linear, 3=Radial) */
- /* Per-pixel gradient shader parameters for fill and stroke.
- * t = grad_a * gl_FragCoord.x + grad_b * gl_FragCoord.y + grad_c
- * For Solid fills these are unused (shader ignores them). */
- float span_fill_grad_a; /* x coefficient for fill gradient t */
- float span_fill_grad_b; /* y coefficient for fill gradient t */
- float span_fill_grad_c; /* constant term for fill gradient t */
- int span_fill_grad_spread; /* 0=PAD 1=REFLECT 2=REPEAT */
- float span_fill_grad_ramp_y; /* atlas V coord: (row+0.5)/SPAN_GRAD_ATLAS_H */
- int span_fill_grad_type; /* 0=linear, 1=radial */
- float span_fill_grad_d; /* radial: 2nd affine row x coeff */
- float span_fill_grad_e; /* radial: 2nd affine row y coeff */
- float span_fill_grad_f; /* radial: 2nd affine row constant */
- float span_fill_grad_ra; /* radial: quadratic a (dr²-dx²-dy²) */
- float span_fill_grad_rdx; /* radial: delta x (center-focal) */
- float span_fill_grad_rdy; /* radial: delta y (center-focal) */
- float span_stroke_grad_a;
- float span_stroke_grad_b;
- float span_stroke_grad_c;
- int span_stroke_grad_spread;
- float span_stroke_grad_ramp_y; /* atlas V coord: (row+0.5)/SPAN_GRAD_ATLAS_H */
- int span_stroke_grad_type;
- float span_stroke_grad_d;
- float span_stroke_grad_e;
- float span_stroke_grad_f;
- float span_stroke_grad_ra;
- float span_stroke_grad_rdx;
- float span_stroke_grad_rdy;
- GLuint span_grad_atlas_tex; /* gradient ramp atlas GL texture name */
- float span_fbo_off_x; /* atlas FBO sub-region x offset */
- float span_fbo_off_y; /* atlas FBO sub-region y offset */
- int span_fill_x_min; /* spatial split: fill texture x_min */
- int span_stroke_x_min; /* spatial split: stroke texture x_min */
- /* Composite mask parameters (0 = no mask) */
- GLuint span_mask_tex; /* mask FBO texture (0 = no mask) */
- int span_comp_method; /* composite method */
- float span_mask_w; /* mask texture width */
- float span_mask_h; /* mask texture height */
- float span_mask_off_x; /* mask atlas x offset */
- float span_mask_off_y; /* mask atlas y offset */
+ /* SHD_SPAN: span-lookup shader parameters.
+ * Only the 6 fields used by the merge predicate and flush survive;
+ * all per-shape data now lives in the per-vertex span_vertex_data buffer. */
+ GLuint span_fill_tex; /* pool GL texture for fill spans (0 = none) */
+ GLuint span_stroke_tex; /* pool GL texture for stroke spans (0 = none) */
+ GLuint span_grad_atlas_tex; /* gradient ramp atlas GL texture name */
+ GLuint span_mask_tex; /* mask FBO texture (0 = no mask) */
+ float span_inv_tw; /* 1.0 / pool_width (shared, same pool) */
+ float span_inv_th; /* 1.0 / pool_height */
} shader;
struct {
int num, alloc;
@@ -449,7 +403,7 @@ struct _Evas_Engine_GL_Context
int buffer_alloc;
int buffer_use;
Eina_Bool line : 1;
- Eina_Bool use_vertex : 1; // always true
+ Eina_Bool use_vertex : 1; // true for all non-span pipes
Eina_Bool use_color : 1;
Eina_Bool use_texuv : 1;
Eina_Bool use_texuv2 : 1;
@@ -459,10 +413,10 @@ struct _Evas_Engine_GL_Context
Eina_Bool use_mask : 1;
Eina_Bool use_masksam : 1;
Eina_Bool anti_alias : 1;
- /* Span-buffer attribute batching (Task 3+).
+ /* Span-buffer attribute batching.
* Heap-grown interleaved buffer of Span_Vertex_<variant> structs.
- * 6 vertices per quad (two triangles). Filled at push-time;
- * currently unused at flush-time (Task 4 will flip this). */
+ * 6 vertices per quad (two triangles). Sole source of truth for
+ * span_shader_pipe_flush; array.vertex is not used by span pipes. */
void *span_vertex_data; /* heap-grown; NULL until first push */
size_t span_vertex_data_size; /* bytes allocated */
size_t span_vertex_data_used; /* bytes filled */
diff --git a/src/modules/evas/engines/gl_common/evas_gl_context.c b/src/modules/evas/engines/gl_common/evas_gl_context.c
index f0ab5afc92..03d6be0f16 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_context.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_context.c
@@ -17,9 +17,7 @@
* link cleanly; for those modules SHD_SPAN pipes are never created. */
void __attribute__((weak))
span_shader_pipe_flush(Evas_Engine_GL_Context *gc EINA_UNUSED,
- int pipe_idx EINA_UNUSED,
- int gw EINA_UNUSED,
- int gh EINA_UNUSED)
+ int pipe_idx EINA_UNUSED)
{
}
@@ -2340,7 +2338,7 @@ evas_gl_common_context_span_push(Evas_Engine_GL_Context *gc,
#undef _S
gc->pipe[pn].array.line = 0;
- gc->pipe[pn].array.use_vertex = 1;
+ gc->pipe[pn].array.use_vertex = 0;
gc->pipe[pn].array.use_color = 0;
gc->pipe[pn].array.use_texuv = 0;
gc->pipe[pn].array.use_texuv2 = 0;
@@ -2351,12 +2349,11 @@ evas_gl_common_context_span_push(Evas_Engine_GL_Context *gc,
gc->pipe[pn].array.use_masksam = 0;
pipe_region_expand(gc, pn, p->x, p->y, p->w, p->h);
- /* array.vertex is no longer used by span_shader_pipe_flush (Task 4).
- * Maintain array.num so the flush condition triggers; use PIPE_GROW to
- * keep the count in sync. The actual geometry comes from span_vertex_data. */
- vertex_array_size_check(gc, pn, 6);
- PIPE_GROW(gc, pn, 6);
- PUSH_6_VERTICES(pn, p->x, p->y, p->w, p->h);
+ /* Span pipes carry all geometry in span_vertex_data; array.vertex is not
+ * used. Bump array.num directly so the flush trigger fires (num > 0).
+ * Set havestuff so shader_array_flush does not bail early on span-only frames. */
+ gc->havestuff = EINA_TRUE;
+ gc->pipe[pn].array.num += 6;
/* Fill the per-variant interleaved vertex buffer — this is the source of
* truth for span_shader_pipe_flush starting in Task 4. */
@@ -4332,7 +4329,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
* its own program. */
if (gc->pipe[i].region.type == SHD_SPAN)
{
- span_shader_pipe_flush(gc, i, gw, gh);
+ span_shader_pipe_flush(gc, i);
/* Reset both num and alloc so the next push re-allocates
* arrays with the correct use_* flags. Without this, a
* reused pipe keeps the old alloc count and array_alloc()
@@ -4701,7 +4698,8 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
masksam_ptr = (unsigned char *)gc->pipe[i].array.masksam;
}
- // use_vertex is always true
+ // use_vertex is always true here (span pipes take the early-return
+ // path above; non-span pipes always populate array.vertex via PIPE_GROW).
glVertexAttribPointer(SHAD_VERTEX, VERTEX_CNT, GL_FLOAT, GL_FALSE, 0, vertex_ptr);
if (gc->pipe[i].array.use_color)
diff --git a/src/modules/evas/engines/gl_generic/evas_ector_gl_span.h b/src/modules/evas/engines/gl_generic/evas_ector_gl_span.h
index 858296c103..d3b5288816 100644
--- a/src/modules/evas/engines/gl_generic/evas_ector_gl_span.h
+++ b/src/modules/evas/engines/gl_generic/evas_ector_gl_span.h
@@ -231,11 +231,6 @@ struct _Span_Collector
void *mask_surface; /* Evas_GL_Image* for the mask FBO (NULL = no mask) */
int comp_method; /* Efl_Gfx_Vg_Composite_Method (0 = NONE) */
- /* GL texture name for the 1024×1 gradient ramp, managed by eng_ector_end().
- * 0 until the first gradient frame. Persists across frames if the gradient
- * data pointer is unchanged; freed in span_collector_delete_textures(). */
- unsigned int grad_ramp_tex; /* GLuint, stored as unsigned int */
- uint32_t grad_ramp_crc; /* CRC of last uploaded color_table */
};
/* ------------------------------------------------------------------ */
@@ -407,11 +402,8 @@ void span_shader_shutdown(void);
*
* @param gc Evas GL context.
* @param pipe_idx Index of the pipe being flushed.
- * @param gw Viewport width in pixels (for NDC conversion).
- * @param gh Viewport height in pixels (for NDC conversion).
*/
-void span_shader_pipe_flush(Evas_Engine_GL_Context *gc, int pipe_idx,
- int gw, int gh);
+void span_shader_pipe_flush(Evas_Engine_GL_Context *gc, int pipe_idx);
/**
* Debug helper: read a single pixel from a GL texture via a temp FBO.
diff --git a/src/modules/evas/engines/gl_generic/evas_ector_gl_span_shader.c b/src/modules/evas/engines/gl_generic/evas_ector_gl_span_shader.c
index 9e37b3ce94..c1439d746e 100644
--- a/src/modules/evas/engines/gl_generic/evas_ector_gl_span_shader.c
+++ b/src/modules/evas/engines/gl_generic/evas_ector_gl_span_shader.c
@@ -1034,13 +1034,6 @@ span_collector_delete_textures(Span_Collector *sc)
}
}
- /* Free the gradient ramp texture if one was created. */
- if (sc->grad_ramp_tex)
- {
- GLuint t = (GLuint)sc->grad_ramp_tex;
- glDeleteTextures(1, &t);
- sc->grad_ramp_tex = 0;
- }
}
/* ------------------------------------------------------------------ */
@@ -1048,13 +1041,8 @@ span_collector_delete_textures(Span_Collector *sc)
/* ------------------------------------------------------------------ */
void
-span_shader_pipe_flush(Evas_Engine_GL_Context *gc, int pipe_idx, int gw, int gh)
+span_shader_pipe_flush(Evas_Engine_GL_Context *gc, int pipe_idx)
{
- /* gw/gh were used for NDC conversion in the old canvas-space path.
- * NDC is now pre-baked by _span_fill_vertices at push time. Kept in
- * the signature for ABI compatibility; removed in Task 5. */
- (void)gw; (void)gh;
-
Span_Variant variant = gc->pipe[pipe_idx].array.span_variant;
void *vdata = gc->pipe[pipe_idx].array.span_vertex_data;
int nverts = gc->pipe[pipe_idx].array.num;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.