// a hack for now. map pipes use their whole bounding box for intersects
// which at worst case reduces to old pipeline flushes, but cheaper than
// full quad region or triangle intersects right now
- if (gc->pipe[n].region.type == RTYPE_MAP) return 1;
+ if (gc->pipe[n].region.type == SHD_MAP) return 1;
v = gc->pipe[n].array.vertex;
end = gc->pipe[n].array.num * 3;
*/
}
-static inline Evas_GL_Shader
-evas_gl_common_shader_choice(int npoints EINA_UNUSED,
- RGBA_Map_Point *p,
+static Evas_GL_Shader
+evas_gl_common_shader_select(Evas_Engine_GL_Context *gc,
+ Shader_Type type,
+ RGBA_Map_Point *p, int npoints EINA_UNUSED,
int r, int g, int b, int a,
- Eina_Bool has_mask,
- Evas_GL_Shader nomul,
- Evas_GL_Shader mul,
- Evas_GL_Shader mask_nomul,
- Evas_GL_Shader mask_mul)
+ int sw, int sh, int w, int h, Eina_Bool smooth,
+ Evas_GL_Texture *tex, Eina_Bool tex_only,
+ Evas_GL_Texture *mtex)
{
- if ((a == 255) && (r == 255) && (g == 255) && (b == 255))
- {
- if (!p) return (has_mask ? mask_nomul : nomul);
-
- if ((p[0].col == 0xffffffff) && (p[1].col == 0xffffffff) &&
- (p[2].col == 0xffffffff) && (p[3].col == 0xffffffff))
- return (has_mask ? mask_nomul : nomul);
- }
- return (has_mask ? mask_mul : mul);
+ const Eina_Bool gc_bgra = gc->shared->info.bgra;
+ int nomul = 1, bgra = 0;
+ int mask = (mtex != NULL), afill = 0;
+ Shader_Sampling sam = SHD_SAM11;
+ Evas_GL_Shader shader;
+ int k = 0;
+
+ if ((type <= SHD_UNKNOWN) || (type >= SHD_TYPE_LAST))
+ {
+ CRI("Unknown shader type requested!");
+ return SHADER_RECT;
+ }
+
+ if ((type == SHD_RECT) || (type == SHD_LINE))
+ return (!mtex) ? SHADER_RECT : SHADER_RECT_MASK;
+ if (type == SHD_FONT)
+ return (!mtex) ? SHADER_FONT : SHADER_FONT_MASK;
+
+ // sampling
+ if (smooth && (type == SHD_IMAGE))
+ {
+ if ((sw >= (w * 2)) && (sh >= (h * 2)))
+ sam = SHD_SAM22;
+ else if (sw >= (w * 2))
+ sam = SHD_SAM21;
+ else if (sh >= (h * 2))
+ sam = SHD_SAM12;
+ }
+
+ // color mul
+ if ((a == 255) && (r == 255) && (g == 255) && (b == 255) && p)
+ {
+ if ((p[0].col != 0xffffffff) || (p[1].col != 0xffffffff) ||
+ (p[2].col != 0xffffffff) || (p[3].col != 0xffffffff))
+ nomul = 0;
+ }
+ else if (!p)
+ nomul = 0;
+
+ // bgra
+ if (tex_only)
+ {
+ if (tex->pt->dyn.img)
+ {
+ afill = !tex->alpha;
+ bgra = 1;
+ }
+ else if (tex->im && tex->im->native.target == GL_TEXTURE_EXTERNAL_OES)
+ {
+ type = SHD_TEX_EXTERNAL;
+ afill = !tex->alpha;
+ }
+ else
+ bgra = 1;
+ }
+ else
+ bgra = gc_bgra;
+
+ if ((type == SHD_IMAGE) || (type == SHD_MAP))
+ shader = evas_gl_common_img_shader_select(sam, nomul, afill, bgra, mask);
+ else
+ {
+ static const Evas_GL_Shader yuv_shaders[] = {
+ // YUV does not support extra sampling
+ SHADER_YUV_NOMUL, SHADER_YUV, SHADER_YUV_MASK_NOMUL, SHADER_YUV_MASK,
+ SHADER_YUY2_NOMUL, SHADER_YUY2, SHADER_YUY2_MASK_NOMUL, SHADER_YUY2_MASK,
+ SHADER_NV12_NOMUL, SHADER_NV12, SHADER_NV12_MASK_NOMUL, SHADER_NV12_MASK,
+ // RGB+A could support extra sampling
+ SHADER_RGB_A_PAIR_NOMUL, SHADER_RGB_A_PAIR, SHADER_RGB_A_PAIR_MASK_NOMUL, SHADER_RGB_A_PAIR_MASK,
+ // TEX_EXTERNAL could support extra sampling
+ SHADER_TEX_EXTERNAL_NOMUL, SHADER_TEX_EXTERNAL, SHADER_TEX_EXTERNAL_MASK_NOMUL, SHADER_TEX_EXTERNAL_MASK,
+ SHADER_TEX_EXTERNAL_NOMUL_AFILL, SHADER_TEX_EXTERNAL_AFILL, SHADER_TEX_EXTERNAL_MASK_NOMUL, SHADER_TEX_EXTERNAL_MASK,
+
+ };
+
+ if (type == SHD_YUV)
+ k = 0;
+ else if (type == SHD_YUY2)
+ k = 4;
+ else if (type == SHD_NV12)
+ k = 8;
+ else if (type == SHD_RGB_A_PAIR)
+ k = 12;
+ else if (type == SHD_TEX_EXTERNAL)
+ k = 16;
+
+ shader = yuv_shaders[k + (afill * 4) + (mask * 2) + (!nomul)];
+ }
+
+ /*
+ DBG("sam %d, nomul %d, afill %d, bgra %d, mask %d --> [%02d] %s",
+ (int) sam, nomul, afill, bgra, mask, shader,
+ evas_gl_common_shader_name_get(shader));
+ */
+
+ return shader;
}
static int
-_evas_gl_common_context_push(int rtype,
+_evas_gl_common_context_push(Shader_Type rtype,
Evas_Engine_GL_Context *gc,
Evas_GL_Texture *tex,
Evas_GL_Texture *texm,
vertex_array_size_check(gc, gc->state.top_pipe, 2);
pn = gc->state.top_pipe;
- gc->pipe[pn].region.type = RTYPE_LINE;
+ gc->pipe[pn].region.type = SHD_LINE;
gc->pipe[pn].shader.id = shader;
gc->pipe[pn].shader.cur_tex = 0;
gc->pipe[pn].shader.cur_texm = mtexid;
#ifdef GLPIPES
if ((pn == 0) && (gc->pipe[pn].array.num == 0))
{
- gc->pipe[pn].region.type = RTYPE_RECT;
+ gc->pipe[pn].region.type = SHD_RECT;
gc->pipe[pn].shader.id = shader;
gc->pipe[pn].shader.cur_tex = 0;
gc->pipe[pn].shader.cur_texm = mtexid;
for (i = pn; i >= 0; i--)
{
- if ((gc->pipe[i].region.type == RTYPE_RECT)
+ if ((gc->pipe[i].region.type == SHD_RECT)
&& (gc->pipe[i].shader.cur_tex == 0)
&& (gc->pipe[i].shader.cur_texm == mtexid)
&& (gc->pipe[i].shader.cur_prog == prog)
goto again;
}
gc->state.top_pipe = pn;
- gc->pipe[pn].region.type = RTYPE_RECT;
+ gc->pipe[pn].region.type = SHD_RECT;
gc->pipe[pn].shader.id = shader;
gc->pipe[pn].shader.cur_tex = 0;
gc->pipe[pn].shader.cur_texm = mtexid;
gc->pipe[pn].shader.ch = 0;
}
- gc->pipe[pn].region.type = RTYPE_RECT;
+ gc->pipe[pn].region.type = SHD_RECT;
gc->pipe[pn].array.line = 0;
gc->pipe[pn].array.use_vertex = 1;
gc->pipe[pn].array.use_color = 1;
else if (!(render_op == EVAS_RENDER_COPY) && ((a < 255) || (tex->alpha)))
blend = EINA_TRUE;
- if (tex_only)
- {
- if (tex->pt->dyn.img)
- {
- if ((smooth) && ((sw >= (w * 2)) && (sh >= (h * 2))))
- {
- shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
- SHADER_IMG_22_BGRA_NOMUL, SHADER_IMG_22_BGRA,
- SHADER_IMG_22_BGRA_MASK_NOMUL, SHADER_IMG_22_BGRA_MASK);
- sam = 1;
- }
- else if ((smooth) && (sw >= (w * 2)))
- {
- shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
- SHADER_IMG_21_BGRA_NOMUL, SHADER_IMG_21_BGRA,
- SHADER_IMG_BGRA_MASK_NOMUL, SHADER_IMG_BGRA_MASK);
- sam = 1;
- }
- else if ((smooth) && (sh >= (h * 2)))
- {
- shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
- SHADER_IMG_12_BGRA_NOMUL, SHADER_IMG_12_BGRA,
- SHADER_IMG_BGRA_MASK_NOMUL, SHADER_IMG_BGRA_MASK);
- sam = 1;
- }
- else
- {
- shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
- SHADER_IMG_BGRA_NOMUL, SHADER_IMG_BGRA,
- SHADER_IMG_BGRA_MASK_NOMUL, SHADER_IMG_BGRA_MASK);
- }
- }
-#ifdef GL_GLES
- else if (tex->im && tex->im->native.target == GL_TEXTURE_EXTERNAL_OES)
- {
- if ((!tex->alpha) && (tex->pt->native))
- shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
- SHADER_TEX_EXTERNAL_NOMUL_AFILL, SHADER_TEX_EXTERNAL_AFILL,
- SHADER_TEX_EXTERNAL_MASK_NOMUL, SHADER_TEX_EXTERNAL_MASK);
- else
- shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
- SHADER_TEX_EXTERNAL_NOMUL, SHADER_TEX_EXTERNAL,
- SHADER_TEX_EXTERNAL_MASK_NOMUL, SHADER_TEX_EXTERNAL_MASK);
- }
-#endif
- else
- {
- if ((smooth) && ((sw >= (w * 2)) && (sh >= (h * 2))))
- {
- if ((!tex->alpha) && (tex->pt->native))
- shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
- SHADER_IMG_22_BGRA_NOMUL_AFILL, SHADER_IMG_22_BGRA_AFILL,
- SHADER_IMG_22_BGRA_MASK_NOMUL, SHADER_IMG_22_BGRA_MASK);
- else
- shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
- SHADER_IMG_22_BGRA_NOMUL, SHADER_IMG_22_BGRA,
- SHADER_IMG_22_BGRA_MASK_NOMUL, SHADER_IMG_22_BGRA_MASK);
- sam = 1;
- }
- else if ((smooth) && (sw >= (w * 2)))
- {
- if ((!tex->alpha) && (tex->pt->native))
- shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
- SHADER_IMG_21_BGRA_NOMUL_AFILL, SHADER_IMG_21_BGRA_AFILL,
- SHADER_IMG_21_BGRA_MASK_NOMUL, SHADER_IMG_21_BGRA_MASK);
- else
- shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
- SHADER_IMG_21_BGRA_NOMUL, SHADER_IMG_21_BGRA,
- SHADER_IMG_21_BGRA_MASK_NOMUL, SHADER_IMG_21_BGRA_MASK);
- sam = 1;
- }
- else if ((smooth) && (sh >= (h * 2)))
- {
- if ((!tex->alpha) && (tex->pt->native))
- shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
- SHADER_IMG_12_BGRA_NOMUL_AFILL, SHADER_IMG_12_BGRA_AFILL,
- SHADER_IMG_12_BGRA_MASK_NOMUL, SHADER_IMG_12_BGRA_MASK);
- else
- shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
- SHADER_IMG_12_BGRA_NOMUL, SHADER_IMG_12_BGRA,
- SHADER_IMG_12_BGRA_MASK_NOMUL, SHADER_IMG_12_BGRA_MASK);
- sam = 1;
- }
- else
- {
- if ((!tex->alpha) && (tex->pt->native))
- shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
- SHADER_IMG_BGRA_NOMUL_AFILL, SHADER_IMG_BGRA_AFILL,
- SHADER_IMG_BGRA_MASK_NOMUL, SHADER_IMG_BGRA_MASK);
- else
- shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
- SHADER_IMG_BGRA_NOMUL, SHADER_IMG_BGRA,
- SHADER_IMG_BGRA_MASK_NOMUL, SHADER_IMG_BGRA_MASK);
- }
- }
- }
- else
- {
- if (tex->gc->shared->info.bgra)
- {
- if ((smooth) && ((sw >= (w * 2)) && (sh >= (h * 2))))
- {
- shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
- SHADER_IMG_22_BGRA_NOMUL, SHADER_IMG_22_BGRA,
- SHADER_IMG_BGRA_MASK_NOMUL, SHADER_IMG_BGRA_MASK);
- sam = 1;
- }
- else if ((smooth) && (sw >= (w * 2)))
- {
- shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
- SHADER_IMG_21_BGRA_NOMUL, SHADER_IMG_21_BGRA,
- SHADER_IMG_BGRA_MASK_NOMUL, SHADER_IMG_BGRA_MASK);
- sam = 1;
- }
- else if ((smooth) && (sh >= (h * 2)))
- {
- shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
- SHADER_IMG_12_BGRA_NOMUL, SHADER_IMG_12_BGRA,
- SHADER_IMG_BGRA_MASK_NOMUL, SHADER_IMG_BGRA_MASK);
- sam = 1;
- }
- else
- {
- shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
- SHADER_IMG_BGRA_NOMUL, SHADER_IMG_BGRA,
- SHADER_IMG_BGRA_MASK_NOMUL, SHADER_IMG_BGRA_MASK);
- }
- }
- else
- {
- if ((smooth) && ((sw >= (w * 2)) && (sh >= (h * 2))))
- {
- shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
- SHADER_IMG_22_NOMUL, SHADER_IMG_22,
- SHADER_IMG_MASK_NOMUL, SHADER_IMG_MASK);
- sam = 1;
- }
- else if ((smooth) && (sw >= (w * 2)))
- {
- shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
- SHADER_IMG_21_NOMUL, SHADER_IMG_21,
- SHADER_IMG_MASK_NOMUL, SHADER_IMG_MASK);
- sam = 1;
- }
- else if ((smooth) && (sh >= (h * 2)))
- {
- shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
- SHADER_IMG_12_NOMUL, SHADER_IMG_12,
- SHADER_IMG_MASK_NOMUL, SHADER_IMG_MASK);
- sam = 1;
- }
- else
- {
- shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
- SHADER_IMG_NOMUL, SHADER_IMG,
- SHADER_IMG_MASK_NOMUL, SHADER_IMG_MASK);
- }
- }
- }
+ shader = evas_gl_common_shader_select(gc, SHD_IMAGE, NULL, 0, r, g, b, a,
+ sw, sh, w, h, smooth, tex, tex_only,
+ mtex);
prog = gc->shared->shader[shader].prog;
if (tex->ptt)
offsety = tex->y;
}
- pn = _evas_gl_common_context_push(RTYPE_IMAGE,
+ pn = _evas_gl_common_context_push(SHD_IMAGE,
gc, tex, mtex,
prog,
x, y, w, h,
0, 0, 0, 0, 0,
mask_smooth);
- gc->pipe[pn].region.type = RTYPE_IMAGE;
+ gc->pipe[pn].region.type = SHD_IMAGE;
gc->pipe[pn].shader.id = shader;
gc->pipe[pn].shader.cur_tex = pt->texture;
gc->pipe[pn].shader.cur_texm = mtex ? mtex->pt->texture : 0;
shader = (!mtex) ? SHADER_FONT : SHADER_FONT_MASK;
prog = gc->shared->shader[shader].prog;
- pn = _evas_gl_common_context_push(RTYPE_FONT,
+ pn = _evas_gl_common_context_push(SHD_FONT,
gc, tex, mtex,
prog,
x, y, w, h,
0, 0, 0, 0, 0,
mask_smooth);
- gc->pipe[pn].region.type = RTYPE_FONT;
+ gc->pipe[pn].region.type = SHD_FONT;
gc->pipe[pn].shader.id = shader;
gc->pipe[pn].shader.cur_tex = tex->pt->texture;
gc->pipe[pn].shader.cur_texm = mtex ? mtex->pt->texture : 0;
if ((a < 255) || (!!mtex))
blend = 1;
- shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
- SHADER_YUV_NOMUL, SHADER_YUV,
- SHADER_YUV_MASK, SHADER_YUV_MASK);
+ shader = evas_gl_common_shader_select(gc, SHD_YUV, NULL, 0, r, g, b, a,
+ w, h, w, h, smooth, tex, 0, mtex);
prog = gc->shared->shader[shader].prog;
- pn = _evas_gl_common_context_push(RTYPE_YUV,
+ pn = _evas_gl_common_context_push(SHD_YUV,
gc, tex, mtex,
prog,
x, y, w, h,
0, 0, 0, 0, 0,
mask_smooth);
- gc->pipe[pn].region.type = RTYPE_YUV;
+ gc->pipe[pn].region.type = SHD_YUV;
gc->pipe[pn].shader.id = shader;
gc->pipe[pn].shader.cur_tex = tex->pt->texture;
gc->pipe[pn].shader.cur_texu = tex->ptu->texture;
if ((a < 255) || (!!mtex))
blend = 1;
- shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
- SHADER_YUY2_NOMUL, SHADER_YUY2,
- SHADER_YUY2_MASK, SHADER_YUY2_MASK);
+ shader = evas_gl_common_shader_select(gc, SHD_YUY2, NULL, 0, r, g, b, a,
+ sw, sh, w, h, smooth, tex, 0, mtex);
prog = gc->shared->shader[shader].prog;
- pn = _evas_gl_common_context_push(RTYPE_YUY2,
+ pn = _evas_gl_common_context_push(SHD_YUY2,
gc, tex, mtex,
prog,
x, y, w, h,
0, 0, 0, 0, 0,
mask_smooth);
- gc->pipe[pn].region.type = RTYPE_YUY2;
+ gc->pipe[pn].region.type = SHD_YUY2;
gc->pipe[pn].shader.id = shader;
gc->pipe[pn].shader.cur_tex = tex->pt->texture;
gc->pipe[pn].shader.cur_texu = tex->ptuv->texture;
if ((a < 255) || (!!mtex))
blend = 1;
- shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
- SHADER_NV12_NOMUL, SHADER_NV12,
- SHADER_NV12_MASK, SHADER_NV12_MASK);
+ shader = evas_gl_common_shader_select(gc, SHD_NV12, NULL, 0, r, g, b, a,
+ sw, sh, w, h, smooth, tex, 0, mtex);
+ prog = gc->shared->shader[shader].prog;
prog = gc->shared->shader[shader].prog;
- pn = _evas_gl_common_context_push(RTYPE_NV12,
+ pn = _evas_gl_common_context_push(SHD_NV12,
gc, tex, mtex,
prog,
x, y, w, h,
0, 0, 0, 0, 0,
mask_smooth);
- gc->pipe[pn].region.type = RTYPE_NV12;
+ gc->pipe[pn].region.type = SHD_NV12;
gc->pipe[pn].shader.id = shader;
gc->pipe[pn].shader.cur_tex = tex->pt->texture;
gc->pipe[pn].shader.cur_tex_dyn = tex->pt->dyn.img;
GLuint prog;
int pn;
- shader = evas_gl_common_shader_choice
- (0, NULL, r, g, b, a, !!mtex,
- SHADER_RGB_A_PAIR_NOMUL, SHADER_RGB_A_PAIR,
- SHADER_RGB_A_PAIR_MASK_NOMUL, SHADER_RGB_A_PAIR_MASK);
+ shader = evas_gl_common_shader_select(gc, SHD_RGB_A_PAIR, NULL, 0, r, g, b, a,
+ sw, sh, w, h, smooth, tex, 0, mtex);
prog = gc->shared->shader[shader].prog;
- pn = _evas_gl_common_context_push(RTYPE_IMAGE,
+ pn = _evas_gl_common_context_push(SHD_RGB_A_PAIR,
gc, tex, mtex,
prog,
x, y, w, h,
EINA_FALSE, 0, 0, 0, 0,
mask_smooth);
- gc->pipe[pn].region.type = RTYPE_IMAGE;
+ gc->pipe[pn].region.type = SHD_RGB_A_PAIR;
gc->pipe[pn].shader.id = shader;
gc->pipe[pn].shader.cur_tex = tex->pt->texture;
gc->pipe[pn].shader.cur_texa = tex->pta->texture;
Evas_GL_Shader shader = SHADER_IMG;
Eina_Bool utexture = EINA_FALSE;
Eina_Bool uvtexture = EINA_FALSE;
+ Shader_Type type;
int pn = 0, i;
int flat = 0;
GLuint prog;
{
case EVAS_COLORSPACE_YCBCR422P601_PL:
case EVAS_COLORSPACE_YCBCR422P709_PL:
- shader = evas_gl_common_shader_choice(npoints, p, r, g, b, a, !!mtex,
- SHADER_YUV_NOMUL, SHADER_YUV,
- SHADER_YUV_MASK_NOMUL, SHADER_YUV_MASK);
+ type = SHD_YUV;
utexture = EINA_TRUE;
break;
case EVAS_COLORSPACE_YCBCR422601_PL:
- shader = evas_gl_common_shader_choice(npoints, p, r, g, b, a, !!mtex,
- SHADER_YUY2_NOMUL, SHADER_YUY2,
- SHADER_YUY2_MASK_NOMUL, SHADER_YUY2_MASK);
+ type = SHD_YUY2;
uvtexture = EINA_TRUE;
break;
case EVAS_COLORSPACE_YCBCR420NV12601_PL:
case EVAS_COLORSPACE_YCBCR420TM12601_PL:
- shader = evas_gl_common_shader_choice(npoints, p, r, g, b, a, !!mtex,
- SHADER_NV12_NOMUL, SHADER_NV12,
- SHADER_NV12_MASK_NOMUL, SHADER_NV12_MASK);
+ type = SHD_NV12;
uvtexture = EINA_TRUE;
break;
-
default:
- if (tex_only)
- {
- if (tex->pt->dyn.img)
- {
- shader = evas_gl_common_shader_choice(npoints, p, r, g, b, a, !!mtex,
- SHADER_IMG_BGRA_NOMUL, SHADER_IMG_BGRA,
- SHADER_IMG_BGRA_MASK_NOMUL, SHADER_IMG_BGRA_MASK);
- }
- else
- {
- shader = evas_gl_common_shader_choice(npoints, p, r, g, b, a, !!mtex,
- SHADER_IMG_BGRA_NOMUL, SHADER_IMG_BGRA,
- SHADER_IMG_BGRA_MASK_NOMUL, SHADER_IMG_BGRA_MASK);
- }
- }
- else
- {
- if (tex->gc->shared->info.bgra)
- {
- shader = evas_gl_common_shader_choice(npoints, p, r, g, b, a, !!mtex,
- SHADER_IMG_BGRA_NOMUL, SHADER_IMG_BGRA,
- SHADER_IMG_BGRA_MASK_NOMUL, SHADER_IMG_BGRA_MASK);
- }
- else
- {
- shader = evas_gl_common_shader_choice(npoints, p, r, g, b, a, !!mtex,
- SHADER_IMG_NOMUL, SHADER_IMG,
- SHADER_IMG_MASK_NOMUL, SHADER_IMG_MASK);
- }
- }
+ type = SHD_MAP;
+ break;
}
+ shader = evas_gl_common_shader_select(gc, type, p, npoints, r, g, b, a,
+ w, h, w, h, smooth, tex, tex_only, mtex);
prog = gc->shared->shader[shader].prog;
/* FIXME: Add RGB+A support, as well as YUV map masking
_evas_gl_common_viewport_set(gc);
}
- pn = _evas_gl_common_context_push(RTYPE_MAP,
+ pn = _evas_gl_common_context_push(SHD_MAP,
gc, tex, mtex,
prog,
x, y, w, h,
smooth,
clip, cx, cy, cw, ch,
mask_smooth);
- gc->pipe[pn].region.type = RTYPE_MAP;
+ gc->pipe[pn].region.type = SHD_MAP;
gc->pipe[pn].shader.id = shader;
gc->pipe[pn].shader.cur_tex = tex->pt->texture;
if (utexture)
if (dbgflushnum == 1)
{
const char *types[] =
- { "----", "RECT", "IMAG", "FONT", "YUV-", "MAP-", "YUY2", "NV12", "LINE", "PAIR", "EXTR" };
+ { "----", "RECT", "IMAG", "FONT", "YUV-", "YUY2", "NV12", "LINE", "PAIR", "EXTR", "MAP-" };
printf(" DRAW#%3i %4i -> %p[%4ix%4i] @ %4ix%4i -{ tex %4i type %s }-\n",
i,
gc->pipe[i].array.num / 6,
gc->pipe[0].shader.surface,
- gc->pipe[0].shader.surface->w,
- gc->pipe[0].shader.surface->h,
- gw, gh,
- gc->pipe[i].shader.cur_tex,
- types[gc->pipe[i].region.type]
- );
+ gc->pipe[0].shader.surface->w,
+ gc->pipe[0].shader.surface->h,
+ gw, gh,
+ gc->pipe[i].shader.cur_tex,
+ types[gc->pipe[i].region.type]
+ );
}
glDrawArrays(GL_TRIANGLES, 0, gc->pipe[i].array.num);
}
};
-typedef enum _Shader_Sampling Shader_Sampling;
-enum _Shader_Sampling {
- SHADER_SAM11,
- SHADER_SAM12,
- SHADER_SAM21,
- SHADER_SAM22
-};
-
static const struct {
Evas_GL_Shader id;
Evas_GL_Program_Source *vert;
Evas_GL_Program_Source *frag;
const char *name;
- unsigned char type; // RTYPE
+ Shader_Type type;
Shader_Sampling sam;
Eina_Bool bgra : 1;
Eina_Bool mask : 1;
Eina_Bool nomul : 1;
Eina_Bool afill : 1;
} _shaders_source[] = {
- { SHADER_RECT, &(shader_rect_vert_src), &(shader_rect_frag_src), "rect", RTYPE_RECT, SHADER_SAM11, 0, 0, 0, 0 },
- { SHADER_RECT_MASK, &(shader_rect_mask_vert_src), &(shader_rect_mask_frag_src), "rect_mask", RTYPE_RECT, SHADER_SAM11, 0, 1, 0, 0 },
- { SHADER_FONT, &(shader_font_vert_src), &(shader_font_frag_src), "font", RTYPE_FONT, SHADER_SAM11, 0, 0, 0, 0 },
- { SHADER_FONT_MASK, &(shader_font_mask_vert_src), &(shader_font_mask_frag_src), "font_mask", RTYPE_FONT, SHADER_SAM11, 0, 1, 0, 0 },
- { SHADER_IMG, &(shader_img_vert_src), &(shader_img_frag_src), "img", RTYPE_IMAGE, SHADER_SAM11, 0, 0, 0, 0 },
- { SHADER_IMG_BGRA, &(shader_img_bgra_vert_src), &(shader_img_bgra_frag_src), "img_bgra", RTYPE_IMAGE, SHADER_SAM11, 1, 0, 0, 0 },
- { SHADER_IMG_12, &(shader_img_12_vert_src), &(shader_img_12_frag_src), "img_12", RTYPE_IMAGE, SHADER_SAM12, 0, 0, 0, 0 },
- { SHADER_IMG_21, &(shader_img_21_vert_src), &(shader_img_21_frag_src), "img_21", RTYPE_IMAGE, SHADER_SAM21, 0, 0, 0, 0 },
- { SHADER_IMG_22, &(shader_img_22_vert_src), &(shader_img_22_frag_src), "img_22", RTYPE_IMAGE, SHADER_SAM22, 0, 0, 0, 0 },
- { SHADER_IMG_12_BGRA, &(shader_img_12_bgra_vert_src), &(shader_img_12_bgra_frag_src), "img_12_bgra", RTYPE_IMAGE, SHADER_SAM12, 1, 0, 0, 0 },
- { SHADER_IMG_21_BGRA, &(shader_img_21_bgra_vert_src), &(shader_img_21_bgra_frag_src), "img_21_bgra", RTYPE_IMAGE, SHADER_SAM21, 1, 0, 0, 0 },
- { SHADER_IMG_22_BGRA, &(shader_img_22_bgra_vert_src), &(shader_img_22_bgra_frag_src), "img_22_bgra", RTYPE_IMAGE, SHADER_SAM22, 1, 0, 0, 0 },
- { SHADER_IMG_MASK, &(shader_img_mask_vert_src), &(shader_img_mask_frag_src), "img_mask", RTYPE_IMAGE, SHADER_SAM11, 0, 1, 0, 0 },
- { SHADER_IMG_BGRA_MASK, &(shader_img_bgra_mask_vert_src), &(shader_img_bgra_mask_frag_src), "img_bgra_mask", RTYPE_IMAGE, SHADER_SAM11, 1, 1, 0, 0 },
- { SHADER_IMG_12_MASK, &(shader_img_12_mask_vert_src), &(shader_img_12_mask_frag_src), "img_12_mask", RTYPE_IMAGE, SHADER_SAM12, 0, 1, 0, 0 },
- { SHADER_IMG_21_MASK, &(shader_img_21_mask_vert_src), &(shader_img_21_mask_frag_src), "img_21_mask", RTYPE_IMAGE, SHADER_SAM21, 0, 1, 0, 0 },
- { SHADER_IMG_22_MASK, &(shader_img_22_mask_vert_src), &(shader_img_22_mask_frag_src), "img_22_mask", RTYPE_IMAGE, SHADER_SAM22, 0, 1, 0, 0 },
- { SHADER_IMG_12_BGRA_MASK, &(shader_img_12_bgra_mask_vert_src), &(shader_img_12_bgra_mask_frag_src), "img_12_bgra_mask", RTYPE_IMAGE, SHADER_SAM12, 1, 1, 0, 0 },
- { SHADER_IMG_21_BGRA_MASK, &(shader_img_21_bgra_mask_vert_src), &(shader_img_21_bgra_mask_frag_src), "img_21_bgra_mask", RTYPE_IMAGE, SHADER_SAM21, 1, 1, 0, 0 },
- { SHADER_IMG_22_BGRA_MASK, &(shader_img_22_bgra_mask_vert_src), &(shader_img_22_bgra_mask_frag_src), "img_22_bgra_mask", RTYPE_IMAGE, SHADER_SAM22, 1, 1, 0, 0 },
- { SHADER_IMG_NOMUL, &(shader_img_nomul_vert_src), &(shader_img_nomul_frag_src), "img_nomul", RTYPE_IMAGE, SHADER_SAM11, 0, 0, 1, 0 },
- { SHADER_IMG_BGRA_NOMUL, &(shader_img_bgra_nomul_vert_src), &(shader_img_bgra_nomul_frag_src), "img_bgra_nomul", RTYPE_IMAGE, SHADER_SAM11, 1, 0, 1, 0 },
- { SHADER_IMG_12_NOMUL, &(shader_img_12_nomul_vert_src), &(shader_img_12_nomul_frag_src), "img_12_nomul", RTYPE_IMAGE, SHADER_SAM12, 0, 0, 1, 0 },
- { SHADER_IMG_21_NOMUL, &(shader_img_21_nomul_vert_src), &(shader_img_21_nomul_frag_src), "img_21_nomul", RTYPE_IMAGE, SHADER_SAM21, 0, 0, 1, 0 },
- { SHADER_IMG_22_NOMUL, &(shader_img_22_nomul_vert_src), &(shader_img_22_nomul_frag_src), "img_22_nomul", RTYPE_IMAGE, SHADER_SAM22, 0, 0, 1, 0 },
- { SHADER_IMG_12_BGRA_NOMUL, &(shader_img_12_bgra_nomul_vert_src), &(shader_img_12_bgra_nomul_frag_src), "img_12_bgra_nomul", RTYPE_IMAGE, SHADER_SAM12, 1, 0, 1, 0 },
- { SHADER_IMG_21_BGRA_NOMUL, &(shader_img_21_bgra_nomul_vert_src), &(shader_img_21_bgra_nomul_frag_src), "img_21_bgra_nomul", RTYPE_IMAGE, SHADER_SAM21, 1, 0, 1, 0 },
- { SHADER_IMG_22_BGRA_NOMUL, &(shader_img_22_bgra_nomul_vert_src), &(shader_img_22_bgra_nomul_frag_src), "img_22_bgra_nomul", RTYPE_IMAGE, SHADER_SAM22, 1, 0, 1, 0 },
- { SHADER_IMG_MASK_NOMUL, &(shader_img_mask_nomul_vert_src), &(shader_img_mask_nomul_frag_src), "img_mask_nomul", RTYPE_IMAGE, SHADER_SAM11, 0, 1, 1, 0 },
- { SHADER_IMG_BGRA_MASK_NOMUL, &(shader_img_bgra_mask_nomul_vert_src), &(shader_img_bgra_mask_nomul_frag_src), "img_bgra_mask_nomul", RTYPE_IMAGE, SHADER_SAM11, 1, 1, 1, 0 },
- { SHADER_IMG_12_MASK_NOMUL, &(shader_img_12_mask_nomul_vert_src), &(shader_img_12_mask_nomul_frag_src), "img_12_mask_nomul", RTYPE_IMAGE, SHADER_SAM12, 0, 1, 1, 0 },
- { SHADER_IMG_21_MASK_NOMUL, &(shader_img_21_mask_nomul_vert_src), &(shader_img_21_mask_nomul_frag_src), "img_21_mask_nomul", RTYPE_IMAGE, SHADER_SAM21, 0, 1, 1, 0 },
- { SHADER_IMG_22_MASK_NOMUL, &(shader_img_22_mask_nomul_vert_src), &(shader_img_22_mask_nomul_frag_src), "img_22_mask_nomul", RTYPE_IMAGE, SHADER_SAM22, 0, 1, 1, 0 },
- { SHADER_IMG_12_BGRA_MASK_NOMUL, &(shader_img_12_bgra_mask_nomul_vert_src), &(shader_img_12_bgra_mask_nomul_frag_src), "img_12_bgra_mask_nomul", RTYPE_IMAGE, SHADER_SAM12, 1, 1, 1, 0 },
- { SHADER_IMG_21_BGRA_MASK_NOMUL, &(shader_img_21_bgra_mask_nomul_vert_src), &(shader_img_21_bgra_mask_nomul_frag_src), "img_21_bgra_mask_nomul", RTYPE_IMAGE, SHADER_SAM21, 1, 1, 1, 0 },
- { SHADER_IMG_22_BGRA_MASK_NOMUL, &(shader_img_22_bgra_mask_nomul_vert_src), &(shader_img_22_bgra_mask_nomul_frag_src), "img_22_bgra_mask_nomul", RTYPE_IMAGE, SHADER_SAM22, 1, 1, 1, 0 },
- { SHADER_IMG_AFILL, &(shader_img_afill_vert_src), &(shader_img_afill_frag_src), "img_afill", RTYPE_IMAGE, SHADER_SAM11, 0, 0, 0, 1 },
- { SHADER_IMG_BGRA_AFILL, &(shader_img_bgra_afill_vert_src), &(shader_img_bgra_afill_frag_src), "img_bgra_afill", RTYPE_IMAGE, SHADER_SAM11, 1, 0, 0, 1 },
- { SHADER_IMG_NOMUL_AFILL, &(shader_img_nomul_afill_vert_src), &(shader_img_nomul_afill_frag_src), "img_nomul_afill", RTYPE_IMAGE, SHADER_SAM11, 0, 0, 1, 1 },
- { SHADER_IMG_BGRA_NOMUL_AFILL, &(shader_img_bgra_nomul_afill_vert_src), &(shader_img_bgra_nomul_afill_frag_src), "img_bgra_nomul_afill", RTYPE_IMAGE, SHADER_SAM11, 1, 0, 1, 1 },
- { SHADER_IMG_12_AFILL, &(shader_img_12_afill_vert_src), &(shader_img_12_afill_frag_src), "img_12_afill", RTYPE_IMAGE, SHADER_SAM12, 0, 0, 0, 1 },
- { SHADER_IMG_21_AFILL, &(shader_img_21_afill_vert_src), &(shader_img_21_afill_frag_src), "img_21_afill", RTYPE_IMAGE, SHADER_SAM21, 0, 0, 0, 1 },
- { SHADER_IMG_22_AFILL, &(shader_img_22_afill_vert_src), &(shader_img_22_afill_frag_src), "img_22_afill", RTYPE_IMAGE, SHADER_SAM22, 0, 0, 0, 1 },
- { SHADER_IMG_12_BGRA_AFILL, &(shader_img_12_bgra_afill_vert_src), &(shader_img_12_bgra_afill_frag_src), "img_12_bgra_afill", RTYPE_IMAGE, SHADER_SAM12, 1, 0, 0, 1 },
- { SHADER_IMG_21_BGRA_AFILL, &(shader_img_21_bgra_afill_vert_src), &(shader_img_21_bgra_afill_frag_src), "img_21_bgra_afill", RTYPE_IMAGE, SHADER_SAM21, 1, 0, 0, 1 },
- { SHADER_IMG_22_BGRA_AFILL, &(shader_img_22_bgra_afill_vert_src), &(shader_img_22_bgra_afill_frag_src), "img_22_bgra_afill", RTYPE_IMAGE, SHADER_SAM22, 1, 0, 0, 1 },
- { SHADER_IMG_12_NOMUL_AFILL, &(shader_img_12_nomul_afill_vert_src), &(shader_img_12_nomul_afill_frag_src), "img_12_nomul_afill", RTYPE_IMAGE, SHADER_SAM12, 0, 0, 1, 1 },
- { SHADER_IMG_21_NOMUL_AFILL, &(shader_img_21_nomul_afill_vert_src), &(shader_img_21_nomul_afill_frag_src), "img_21_nomul_afill", RTYPE_IMAGE, SHADER_SAM21, 0, 0, 1, 1 },
- { SHADER_IMG_22_NOMUL_AFILL, &(shader_img_22_nomul_afill_vert_src), &(shader_img_22_nomul_afill_frag_src), "img_22_nomul_afill", RTYPE_IMAGE, SHADER_SAM22, 0, 0, 1, 1 },
- { SHADER_IMG_12_BGRA_NOMUL_AFILL, &(shader_img_12_bgra_nomul_afill_vert_src), &(shader_img_12_bgra_nomul_afill_frag_src), "img_12_bgra_nomul_afill", RTYPE_IMAGE, SHADER_SAM12, 1, 0, 1, 1 },
- { SHADER_IMG_21_BGRA_NOMUL_AFILL, &(shader_img_21_bgra_nomul_afill_vert_src), &(shader_img_21_bgra_nomul_afill_frag_src), "img_21_bgra_nomul_afill", RTYPE_IMAGE, SHADER_SAM21, 1, 0, 1, 1 },
- { SHADER_IMG_22_BGRA_NOMUL_AFILL, &(shader_img_22_bgra_nomul_afill_vert_src), &(shader_img_22_bgra_nomul_afill_frag_src), "img_22_bgra_nomul_afill", RTYPE_IMAGE, SHADER_SAM22, 1, 0, 1, 1 },
- { SHADER_RGB_A_PAIR, &(shader_rgb_a_pair_vert_src), &(shader_rgb_a_pair_frag_src), "rgb_a_pair", RTYPE_RGB_A_PAIR, SHADER_SAM11, 0, 0, 0, 0 },
- { SHADER_RGB_A_PAIR_MASK, &(shader_rgb_a_pair_mask_vert_src), &(shader_rgb_a_pair_mask_frag_src), "rgb_a_pair_mask", RTYPE_RGB_A_PAIR, SHADER_SAM11, 0, 1, 0, 0 },
- { SHADER_RGB_A_PAIR_NOMUL, &(shader_rgb_a_pair_nomul_vert_src), &(shader_rgb_a_pair_nomul_frag_src), "rgb_a_pair_nomul", RTYPE_RGB_A_PAIR, SHADER_SAM11, 0, 0, 1, 0 },
- { SHADER_RGB_A_PAIR_MASK_NOMUL, &(shader_rgb_a_pair_mask_nomul_vert_src), &(shader_rgb_a_pair_mask_nomul_frag_src), "rgb_a_pair_mask_nomul", RTYPE_RGB_A_PAIR, SHADER_SAM11, 0, 1, 1, 0 },
- { SHADER_TEX_EXTERNAL, &(shader_tex_external_vert_src), &(shader_tex_external_frag_src), "tex_external", RTYPE_TEX_EXTERNAL, SHADER_SAM11, 0, 0, 0, 0 },
- { SHADER_TEX_EXTERNAL_AFILL, &(shader_tex_external_afill_vert_src), &(shader_tex_external_afill_frag_src), "tex_external_afill", RTYPE_TEX_EXTERNAL, SHADER_SAM11, 0, 0, 0, 1 },
- { SHADER_TEX_EXTERNAL_NOMUL, &(shader_tex_external_nomul_vert_src), &(shader_tex_external_nomul_frag_src), "tex_external_nomul", RTYPE_TEX_EXTERNAL, SHADER_SAM11, 0, 0, 1, 0 },
- { SHADER_TEX_EXTERNAL_NOMUL_AFILL, &(shader_tex_external_nomul_afill_vert_src), &(shader_tex_external_nomul_afill_frag_src), "tex_external_nomul_afill", RTYPE_TEX_EXTERNAL, SHADER_SAM11, 0, 0, 1, 1 },
- { SHADER_TEX_EXTERNAL_MASK, &(shader_tex_external_mask_vert_src), &(shader_tex_external_mask_frag_src), "tex_external_mask", RTYPE_TEX_EXTERNAL, SHADER_SAM11, 0, 1, 0, 0 },
- { SHADER_TEX_EXTERNAL_MASK_NOMUL, &(shader_tex_external_mask_nomul_vert_src), &(shader_tex_external_mask_nomul_frag_src), "tex_external_mask_nomul", RTYPE_TEX_EXTERNAL, SHADER_SAM11, 0, 1, 1, 0 },
- { SHADER_YUV, &(shader_yuv_vert_src), &(shader_yuv_frag_src), "yuv", RTYPE_YUV, SHADER_SAM11, 0, 0, 0, 0 },
- { SHADER_YUV_NOMUL, &(shader_yuv_nomul_vert_src), &(shader_yuv_nomul_frag_src), "yuv_nomul", RTYPE_YUV, SHADER_SAM11, 0, 0, 1, 0 },
- { SHADER_YUV_MASK, &(shader_yuv_mask_vert_src), &(shader_yuv_mask_frag_src), "yuv_mask", RTYPE_YUV, SHADER_SAM11, 0, 1, 0, 0 },
- { SHADER_YUV_MASK_NOMUL, &(shader_yuv_mask_nomul_vert_src), &(shader_yuv_mask_nomul_frag_src), "yuv_mask_nomul", RTYPE_YUV, SHADER_SAM11, 0, 1, 1, 0 },
- { SHADER_YUY2, &(shader_yuy2_vert_src), &(shader_yuy2_frag_src), "yuy2", RTYPE_YUY2, SHADER_SAM11, 0, 0, 0, 0 },
- { SHADER_YUY2_NOMUL, &(shader_yuy2_nomul_vert_src), &(shader_yuy2_nomul_frag_src), "yuy2_nomul", RTYPE_YUY2, SHADER_SAM11, 0, 0, 1, 0 },
- { SHADER_YUY2_MASK, &(shader_yuy2_mask_vert_src), &(shader_yuy2_mask_frag_src), "yuy2_mask", RTYPE_YUY2, SHADER_SAM11, 0, 1, 0, 0 },
- { SHADER_YUY2_MASK_NOMUL, &(shader_yuy2_mask_nomul_vert_src), &(shader_yuy2_mask_nomul_frag_src), "yuy2_mask_nomul", RTYPE_YUY2, SHADER_SAM11, 0, 1, 1, 0 },
- { SHADER_NV12, &(shader_nv12_vert_src), &(shader_nv12_frag_src), "nv12", RTYPE_NV12, SHADER_SAM11, 0, 0, 0, 0 },
- { SHADER_NV12_NOMUL, &(shader_nv12_nomul_vert_src), &(shader_nv12_nomul_frag_src), "nv12_nomul", RTYPE_NV12, SHADER_SAM11, 0, 0, 1, 0 },
- { SHADER_NV12_MASK, &(shader_nv12_mask_vert_src), &(shader_nv12_mask_frag_src), "nv12_mask", RTYPE_NV12, SHADER_SAM11, 0, 1, 0, 0 },
- { SHADER_NV12_MASK_NOMUL, &(shader_nv12_mask_nomul_vert_src), &(shader_nv12_mask_nomul_frag_src), "nv12_mask_nomul", RTYPE_NV12, SHADER_SAM11, 0, 1, 1, 0 },
+ { SHADER_RECT, &(shader_rect_vert_src), &(shader_rect_frag_src), "rect", SHD_RECT, SHD_SAM11, 0, 0, 0, 0 },
+ { SHADER_RECT_MASK, &(shader_rect_mask_vert_src), &(shader_rect_mask_frag_src), "rect_mask", SHD_RECT, SHD_SAM11, 0, 1, 0, 0 },
+ { SHADER_FONT, &(shader_font_vert_src), &(shader_font_frag_src), "font", SHD_FONT, SHD_SAM11, 0, 0, 0, 0 },
+ { SHADER_FONT_MASK, &(shader_font_mask_vert_src), &(shader_font_mask_frag_src), "font_mask", SHD_FONT, SHD_SAM11, 0, 1, 0, 0 },
+ { SHADER_IMG, &(shader_img_vert_src), &(shader_img_frag_src), "img", SHD_IMAGE, SHD_SAM11, 0, 0, 0, 0 },
+ { SHADER_IMG_BGRA, &(shader_img_bgra_vert_src), &(shader_img_bgra_frag_src), "img_bgra", SHD_IMAGE, SHD_SAM11, 1, 0, 0, 0 },
+ { SHADER_IMG_12, &(shader_img_12_vert_src), &(shader_img_12_frag_src), "img_12", SHD_IMAGE, SHD_SAM12, 0, 0, 0, 0 },
+ { SHADER_IMG_21, &(shader_img_21_vert_src), &(shader_img_21_frag_src), "img_21", SHD_IMAGE, SHD_SAM21, 0, 0, 0, 0 },
+ { SHADER_IMG_22, &(shader_img_22_vert_src), &(shader_img_22_frag_src), "img_22", SHD_IMAGE, SHD_SAM22, 0, 0, 0, 0 },
+ { SHADER_IMG_12_BGRA, &(shader_img_12_bgra_vert_src), &(shader_img_12_bgra_frag_src), "img_12_bgra", SHD_IMAGE, SHD_SAM12, 1, 0, 0, 0 },
+ { SHADER_IMG_21_BGRA, &(shader_img_21_bgra_vert_src), &(shader_img_21_bgra_frag_src), "img_21_bgra", SHD_IMAGE, SHD_SAM21, 1, 0, 0, 0 },
+ { SHADER_IMG_22_BGRA, &(shader_img_22_bgra_vert_src), &(shader_img_22_bgra_frag_src), "img_22_bgra", SHD_IMAGE, SHD_SAM22, 1, 0, 0, 0 },
+ { SHADER_IMG_MASK, &(shader_img_mask_vert_src), &(shader_img_mask_frag_src), "img_mask", SHD_IMAGE, SHD_SAM11, 0, 1, 0, 0 },
+ { SHADER_IMG_BGRA_MASK, &(shader_img_bgra_mask_vert_src), &(shader_img_bgra_mask_frag_src), "img_bgra_mask", SHD_IMAGE, SHD_SAM11, 1, 1, 0, 0 },
+ { SHADER_IMG_12_MASK, &(shader_img_12_mask_vert_src), &(shader_img_12_mask_frag_src), "img_12_mask", SHD_IMAGE, SHD_SAM12, 0, 1, 0, 0 },
+ { SHADER_IMG_21_MASK, &(shader_img_21_mask_vert_src), &(shader_img_21_mask_frag_src), "img_21_mask", SHD_IMAGE, SHD_SAM21, 0, 1, 0, 0 },
+ { SHADER_IMG_22_MASK, &(shader_img_22_mask_vert_src), &(shader_img_22_mask_frag_src), "img_22_mask", SHD_IMAGE, SHD_SAM22, 0, 1, 0, 0 },
+ { SHADER_IMG_12_BGRA_MASK, &(shader_img_12_bgra_mask_vert_src), &(shader_img_12_bgra_mask_frag_src), "img_12_bgra_mask", SHD_IMAGE, SHD_SAM12, 1, 1, 0, 0 },
+ { SHADER_IMG_21_BGRA_MASK, &(shader_img_21_bgra_mask_vert_src), &(shader_img_21_bgra_mask_frag_src), "img_21_bgra_mask", SHD_IMAGE, SHD_SAM21, 1, 1, 0, 0 },
+ { SHADER_IMG_22_BGRA_MASK, &(shader_img_22_bgra_mask_vert_src), &(shader_img_22_bgra_mask_frag_src), "img_22_bgra_mask", SHD_IMAGE, SHD_SAM22, 1, 1, 0, 0 },
+ { SHADER_IMG_NOMUL, &(shader_img_nomul_vert_src), &(shader_img_nomul_frag_src), "img_nomul", SHD_IMAGE, SHD_SAM11, 0, 0, 1, 0 },
+ { SHADER_IMG_BGRA_NOMUL, &(shader_img_bgra_nomul_vert_src), &(shader_img_bgra_nomul_frag_src), "img_bgra_nomul", SHD_IMAGE, SHD_SAM11, 1, 0, 1, 0 },
+ { SHADER_IMG_12_NOMUL, &(shader_img_12_nomul_vert_src), &(shader_img_12_nomul_frag_src), "img_12_nomul", SHD_IMAGE, SHD_SAM12, 0, 0, 1, 0 },
+ { SHADER_IMG_21_NOMUL, &(shader_img_21_nomul_vert_src), &(shader_img_21_nomul_frag_src), "img_21_nomul", SHD_IMAGE, SHD_SAM21, 0, 0, 1, 0 },
+ { SHADER_IMG_22_NOMUL, &(shader_img_22_nomul_vert_src), &(shader_img_22_nomul_frag_src), "img_22_nomul", SHD_IMAGE, SHD_SAM22, 0, 0, 1, 0 },
+ { SHADER_IMG_12_BGRA_NOMUL, &(shader_img_12_bgra_nomul_vert_src), &(shader_img_12_bgra_nomul_frag_src), "img_12_bgra_nomul", SHD_IMAGE, SHD_SAM12, 1, 0, 1, 0 },
+ { SHADER_IMG_21_BGRA_NOMUL, &(shader_img_21_bgra_nomul_vert_src), &(shader_img_21_bgra_nomul_frag_src), "img_21_bgra_nomul", SHD_IMAGE, SHD_SAM21, 1, 0, 1, 0 },
+ { SHADER_IMG_22_BGRA_NOMUL, &(shader_img_22_bgra_nomul_vert_src), &(shader_img_22_bgra_nomul_frag_src), "img_22_bgra_nomul", SHD_IMAGE, SHD_SAM22, 1, 0, 1, 0 },
+ { SHADER_IMG_MASK_NOMUL, &(shader_img_mask_nomul_vert_src), &(shader_img_mask_nomul_frag_src), "img_mask_nomul", SHD_IMAGE, SHD_SAM11, 0, 1, 1, 0 },
+ { SHADER_IMG_BGRA_MASK_NOMUL, &(shader_img_bgra_mask_nomul_vert_src), &(shader_img_bgra_mask_nomul_frag_src), "img_bgra_mask_nomul", SHD_IMAGE, SHD_SAM11, 1, 1, 1, 0 },
+ { SHADER_IMG_12_MASK_NOMUL, &(shader_img_12_mask_nomul_vert_src), &(shader_img_12_mask_nomul_frag_src), "img_12_mask_nomul", SHD_IMAGE, SHD_SAM12, 0, 1, 1, 0 },
+ { SHADER_IMG_21_MASK_NOMUL, &(shader_img_21_mask_nomul_vert_src), &(shader_img_21_mask_nomul_frag_src), "img_21_mask_nomul", SHD_IMAGE, SHD_SAM21, 0, 1, 1, 0 },
+ { SHADER_IMG_22_MASK_NOMUL, &(shader_img_22_mask_nomul_vert_src), &(shader_img_22_mask_nomul_frag_src), "img_22_mask_nomul", SHD_IMAGE, SHD_SAM22, 0, 1, 1, 0 },
+ { SHADER_IMG_12_BGRA_MASK_NOMUL, &(shader_img_12_bgra_mask_nomul_vert_src), &(shader_img_12_bgra_mask_nomul_frag_src), "img_12_bgra_mask_nomul", SHD_IMAGE, SHD_SAM12, 1, 1, 1, 0 },
+ { SHADER_IMG_21_BGRA_MASK_NOMUL, &(shader_img_21_bgra_mask_nomul_vert_src), &(shader_img_21_bgra_mask_nomul_frag_src), "img_21_bgra_mask_nomul", SHD_IMAGE, SHD_SAM21, 1, 1, 1, 0 },
+ { SHADER_IMG_22_BGRA_MASK_NOMUL, &(shader_img_22_bgra_mask_nomul_vert_src), &(shader_img_22_bgra_mask_nomul_frag_src), "img_22_bgra_mask_nomul", SHD_IMAGE, SHD_SAM22, 1, 1, 1, 0 },
+ { SHADER_IMG_AFILL, &(shader_img_afill_vert_src), &(shader_img_afill_frag_src), "img_afill", SHD_IMAGE, SHD_SAM11, 0, 0, 0, 1 },
+ { SHADER_IMG_BGRA_AFILL, &(shader_img_bgra_afill_vert_src), &(shader_img_bgra_afill_frag_src), "img_bgra_afill", SHD_IMAGE, SHD_SAM11, 1, 0, 0, 1 },
+ { SHADER_IMG_NOMUL_AFILL, &(shader_img_nomul_afill_vert_src), &(shader_img_nomul_afill_frag_src), "img_nomul_afill", SHD_IMAGE, SHD_SAM11, 0, 0, 1, 1 },
+ { SHADER_IMG_BGRA_NOMUL_AFILL, &(shader_img_bgra_nomul_afill_vert_src), &(shader_img_bgra_nomul_afill_frag_src), "img_bgra_nomul_afill", SHD_IMAGE, SHD_SAM11, 1, 0, 1, 1 },
+ { SHADER_IMG_12_AFILL, &(shader_img_12_afill_vert_src), &(shader_img_12_afill_frag_src), "img_12_afill", SHD_IMAGE, SHD_SAM12, 0, 0, 0, 1 },
+ { SHADER_IMG_21_AFILL, &(shader_img_21_afill_vert_src), &(shader_img_21_afill_frag_src), "img_21_afill", SHD_IMAGE, SHD_SAM21, 0, 0, 0, 1 },
+ { SHADER_IMG_22_AFILL, &(shader_img_22_afill_vert_src), &(shader_img_22_afill_frag_src), "img_22_afill", SHD_IMAGE, SHD_SAM22, 0, 0, 0, 1 },
+ { SHADER_IMG_12_BGRA_AFILL, &(shader_img_12_bgra_afill_vert_src), &(shader_img_12_bgra_afill_frag_src), "img_12_bgra_afill", SHD_IMAGE, SHD_SAM12, 1, 0, 0, 1 },
+ { SHADER_IMG_21_BGRA_AFILL, &(shader_img_21_bgra_afill_vert_src), &(shader_img_21_bgra_afill_frag_src), "img_21_bgra_afill", SHD_IMAGE, SHD_SAM21, 1, 0, 0, 1 },
+ { SHADER_IMG_22_BGRA_AFILL, &(shader_img_22_bgra_afill_vert_src), &(shader_img_22_bgra_afill_frag_src), "img_22_bgra_afill", SHD_IMAGE, SHD_SAM22, 1, 0, 0, 1 },
+ { SHADER_IMG_12_NOMUL_AFILL, &(shader_img_12_nomul_afill_vert_src), &(shader_img_12_nomul_afill_frag_src), "img_12_nomul_afill", SHD_IMAGE, SHD_SAM12, 0, 0, 1, 1 },
+ { SHADER_IMG_21_NOMUL_AFILL, &(shader_img_21_nomul_afill_vert_src), &(shader_img_21_nomul_afill_frag_src), "img_21_nomul_afill", SHD_IMAGE, SHD_SAM21, 0, 0, 1, 1 },
+ { SHADER_IMG_22_NOMUL_AFILL, &(shader_img_22_nomul_afill_vert_src), &(shader_img_22_nomul_afill_frag_src), "img_22_nomul_afill", SHD_IMAGE, SHD_SAM22, 0, 0, 1, 1 },
+ { SHADER_IMG_12_BGRA_NOMUL_AFILL, &(shader_img_12_bgra_nomul_afill_vert_src), &(shader_img_12_bgra_nomul_afill_frag_src), "img_12_bgra_nomul_afill", SHD_IMAGE, SHD_SAM12, 1, 0, 1, 1 },
+ { SHADER_IMG_21_BGRA_NOMUL_AFILL, &(shader_img_21_bgra_nomul_afill_vert_src), &(shader_img_21_bgra_nomul_afill_frag_src), "img_21_bgra_nomul_afill", SHD_IMAGE, SHD_SAM21, 1, 0, 1, 1 },
+ { SHADER_IMG_22_BGRA_NOMUL_AFILL, &(shader_img_22_bgra_nomul_afill_vert_src), &(shader_img_22_bgra_nomul_afill_frag_src), "img_22_bgra_nomul_afill", SHD_IMAGE, SHD_SAM22, 1, 0, 1, 1 },
+ { SHADER_RGB_A_PAIR, &(shader_rgb_a_pair_vert_src), &(shader_rgb_a_pair_frag_src), "rgb_a_pair", SHD_RGB_A_PAIR, SHD_SAM11, 0, 0, 0, 0 },
+ { SHADER_RGB_A_PAIR_MASK, &(shader_rgb_a_pair_mask_vert_src), &(shader_rgb_a_pair_mask_frag_src), "rgb_a_pair_mask", SHD_RGB_A_PAIR, SHD_SAM11, 0, 1, 0, 0 },
+ { SHADER_RGB_A_PAIR_NOMUL, &(shader_rgb_a_pair_nomul_vert_src), &(shader_rgb_a_pair_nomul_frag_src), "rgb_a_pair_nomul", SHD_RGB_A_PAIR, SHD_SAM11, 0, 0, 1, 0 },
+ { SHADER_RGB_A_PAIR_MASK_NOMUL, &(shader_rgb_a_pair_mask_nomul_vert_src), &(shader_rgb_a_pair_mask_nomul_frag_src), "rgb_a_pair_mask_nomul", SHD_RGB_A_PAIR, SHD_SAM11, 0, 1, 1, 0 },
+ { SHADER_TEX_EXTERNAL, &(shader_tex_external_vert_src), &(shader_tex_external_frag_src), "tex_external", SHD_TEX_EXTERNAL, SHD_SAM11, 0, 0, 0, 0 },
+ { SHADER_TEX_EXTERNAL_AFILL, &(shader_tex_external_afill_vert_src), &(shader_tex_external_afill_frag_src), "tex_external_afill", SHD_TEX_EXTERNAL, SHD_SAM11, 0, 0, 0, 1 },
+ { SHADER_TEX_EXTERNAL_NOMUL, &(shader_tex_external_nomul_vert_src), &(shader_tex_external_nomul_frag_src), "tex_external_nomul", SHD_TEX_EXTERNAL, SHD_SAM11, 0, 0, 1, 0 },
+ { SHADER_TEX_EXTERNAL_NOMUL_AFILL, &(shader_tex_external_nomul_afill_vert_src), &(shader_tex_external_nomul_afill_frag_src), "tex_external_nomul_afill", SHD_TEX_EXTERNAL, SHD_SAM11, 0, 0, 1, 1 },
+ { SHADER_TEX_EXTERNAL_MASK, &(shader_tex_external_mask_vert_src), &(shader_tex_external_mask_frag_src), "tex_external_mask", SHD_TEX_EXTERNAL, SHD_SAM11, 0, 1, 0, 0 },
+ { SHADER_TEX_EXTERNAL_MASK_NOMUL, &(shader_tex_external_mask_nomul_vert_src), &(shader_tex_external_mask_nomul_frag_src), "tex_external_mask_nomul", SHD_TEX_EXTERNAL, SHD_SAM11, 0, 1, 1, 0 },
+ { SHADER_YUV, &(shader_yuv_vert_src), &(shader_yuv_frag_src), "yuv", SHD_YUV, SHD_SAM11, 0, 0, 0, 0 },
+ { SHADER_YUV_NOMUL, &(shader_yuv_nomul_vert_src), &(shader_yuv_nomul_frag_src), "yuv_nomul", SHD_YUV, SHD_SAM11, 0, 0, 1, 0 },
+ { SHADER_YUV_MASK, &(shader_yuv_mask_vert_src), &(shader_yuv_mask_frag_src), "yuv_mask", SHD_YUV, SHD_SAM11, 0, 1, 0, 0 },
+ { SHADER_YUV_MASK_NOMUL, &(shader_yuv_mask_nomul_vert_src), &(shader_yuv_mask_nomul_frag_src), "yuv_mask_nomul", SHD_YUV, SHD_SAM11, 0, 1, 1, 0 },
+ { SHADER_YUY2, &(shader_yuy2_vert_src), &(shader_yuy2_frag_src), "yuy2", SHD_YUY2, SHD_SAM11, 0, 0, 0, 0 },
+ { SHADER_YUY2_NOMUL, &(shader_yuy2_nomul_vert_src), &(shader_yuy2_nomul_frag_src), "yuy2_nomul", SHD_YUY2, SHD_SAM11, 0, 0, 1, 0 },
+ { SHADER_YUY2_MASK, &(shader_yuy2_mask_vert_src), &(shader_yuy2_mask_frag_src), "yuy2_mask", SHD_YUY2, SHD_SAM11, 0, 1, 0, 0 },
+ { SHADER_YUY2_MASK_NOMUL, &(shader_yuy2_mask_nomul_vert_src), &(shader_yuy2_mask_nomul_frag_src), "yuy2_mask_nomul", SHD_YUY2, SHD_SAM11, 0, 1, 1, 0 },
+ { SHADER_NV12, &(shader_nv12_vert_src), &(shader_nv12_frag_src), "nv12", SHD_NV12, SHD_SAM11, 0, 0, 0, 0 },
+ { SHADER_NV12_NOMUL, &(shader_nv12_nomul_vert_src), &(shader_nv12_nomul_frag_src), "nv12_nomul", SHD_NV12, SHD_SAM11, 0, 0, 1, 0 },
+ { SHADER_NV12_MASK, &(shader_nv12_mask_vert_src), &(shader_nv12_mask_frag_src), "nv12_mask", SHD_NV12, SHD_SAM11, 0, 1, 0, 0 },
+ { SHADER_NV12_MASK_NOMUL, &(shader_nv12_mask_nomul_vert_src), &(shader_nv12_mask_nomul_frag_src), "nv12_mask_nomul", SHD_NV12, SHD_SAM11, 0, 1, 1, 0 },
};