This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch span-gl-clean
in repository efl.
View the commit online.
commit 90bffc3fc688689148af62f36ea89cb718ae07ea
Author: [email protected] <[email protected]>
AuthorDate: Mon Aug 10 20:40:34 2026 -0600
feat(evas_ector_gl): gate the span path on queried GL limits
The span shaders were written against desktop-class limits and nothing ever
asked the driver what it had. The widest variant, gradient plus mask,
declares 13 vertex attributes and about 11 packed varying vectors; GLES2
guarantees only 8 of each, so on a device at the floor the gradient variants
cannot link.
Query GL_MAX_VERTEX_ATTRIBS and GL_MAX_VARYING_VECTORS once at init and mark
the span path unusable when the device is short. EVAS_GL_SPAN_TIER
overrides the decision with auto, wide, or off; compact is reserved for the
Stage 2 shader family and is rejected with a message for now.
This commit only decides; declining to install the span collectors is the
next commit.
---
.../evas/engines/gl_generic/evas_ector_gl_span.h | 5 ++
.../engines/gl_generic/evas_ector_gl_span_shader.c | 75 ++++++++++++++++++++++
2 files changed, 80 insertions(+)
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 41ab1c9833..7bcc10b2bf 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
@@ -380,6 +380,11 @@ Eina_Bool span_shader_init(void);
/* EINA_TRUE only when span_shader_init() has run and every variant linked. */
Eina_Bool span_shader_available(void);
+/* EINA_TRUE when the span rendering path may be used: the tier setting
+ * permits it and the shaders linked. When EINA_FALSE the caller must not
+ * install span collectors. */
+Eina_Bool span_path_usable(void);
+
/**
* Delete the GL programs and reset internal shader state.
* Must be called from the GL thread.
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 893e838d5b..743a145316 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
@@ -217,6 +217,68 @@ _span_fragment_highp_supported(void)
static const char _glsl_hp_highp[] = "#define SPAN_HP highp\n";
static const char _glsl_hp_mediump[] = "#define SPAN_HP mediump\n";
+/* Widest variant (gradient + mask) resource usage, counted from the shader
+ * source blocks: 5 common + 6 gradient + 2 mask attributes, and roughly 11
+ * packed varying vectors. GLES2 guarantees only 8 of each. */
+#define SPAN_WIDE_MAX_ATTRIBS 13
+#define SPAN_WIDE_MAX_VARYINGS 11
+
+typedef enum {
+ SPAN_TIER_AUTO = 0,
+ SPAN_TIER_WIDE = 1,
+ SPAN_TIER_OFF = 2
+} Span_Tier;
+
+static int _span_tier_resolved = -1; /* -1 unresolved, else Span_Tier */
+
+static Span_Tier
+_span_tier_get(void)
+{
+ const char *env;
+ GLint attribs = 0, varyings = 0;
+
+ if (_span_tier_resolved >= 0) return (Span_Tier)_span_tier_resolved;
+
+ env = getenv("EVAS_GL_SPAN_TIER");
+ if (env)
+ {
+ if (!strcmp(env, "wide")) { _span_tier_resolved = SPAN_TIER_WIDE; goto done; }
+ if (!strcmp(env, "off")) { _span_tier_resolved = SPAN_TIER_OFF; goto done; }
+ if (!strcmp(env, "compact"))
+ {
+ ERR("EVAS_GL_SPAN_TIER=compact is not implemented yet "
+ "(Stage 2); falling back to auto");
+ }
+ else if (strcmp(env, "auto"))
+ {
+ ERR("EVAS_GL_SPAN_TIER: unknown value '%s'; falling back to auto", env);
+ }
+ }
+
+ glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &attribs);
+#ifdef GL_MAX_VARYING_VECTORS
+ glGetIntegerv(GL_MAX_VARYING_VECTORS, &varyings);
+#else
+ glGetIntegerv(GL_MAX_VARYING_FLOATS, &varyings);
+ varyings /= 4;
+#endif
+
+ if (attribs < SPAN_WIDE_MAX_ATTRIBS ||
+ varyings < SPAN_WIDE_MAX_VARYINGS)
+ {
+ INF("span path disabled: device reports %d vertex attributes and %d "
+ "varying vectors, the span shaders need %d and %d",
+ (int)attribs, (int)varyings,
+ SPAN_WIDE_MAX_ATTRIBS, SPAN_WIDE_MAX_VARYINGS);
+ _span_tier_resolved = SPAN_TIER_OFF;
+ }
+ else
+ _span_tier_resolved = SPAN_TIER_WIDE;
+
+done:
+ return (Span_Tier)_span_tier_resolved;
+}
+
/* Default precision: mediump for register pressure on tilers (V3D 4.2 / Mali).
* Locals and uniforms that need fp32 (gradient coefficients, gl_FragCoord
* arithmetic) are explicitly qualified highp at their declaration site. */
@@ -822,6 +884,12 @@ span_shader_init(void)
if (_span_shader_state == SPAN_SHADER_OK) return EINA_TRUE;
if (_span_shader_state == SPAN_SHADER_FAILED) return EINA_FALSE;
+ if (_span_tier_get() == SPAN_TIER_OFF)
+ {
+ _span_shader_state = SPAN_SHADER_FAILED;
+ return EINA_FALSE;
+ }
+
for (kind = 0; kind < 2; kind++)
{
for (b = 0; b < (int)SPAN_BIND_COUNT; b++)
@@ -881,6 +949,13 @@ span_shader_available(void)
return _span_shader_state == SPAN_SHADER_OK;
}
+Eina_Bool
+span_path_usable(void)
+{
+ if (_span_tier_get() == SPAN_TIER_OFF) return EINA_FALSE;
+ return span_shader_init();
+}
+
void
span_shader_shutdown(void)
{
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.