Work around new intel Mesa/xorg bug where alpha

channel in NON-ARGB windows is not filled in with 0xff
even if all the code does things right.
This commit is contained in:
Carsten Haitzler 2013-04-14 01:12:35 +09:00
parent 4d703c12b3
commit 9ec8064638
39 changed files with 807 additions and 8 deletions

View File

@ -1,3 +1,9 @@
2013-04-14 Carsten Haitzler (The Rasterman)
* Evas: Work around new intel Mesa/xorg bug where alpha
channel in NON-ARGB windows is not filled in with 0xff even if all the
code does things right.
2013-04-13 ChunEon Park
* Evas: Don't be crashed even if the map image size is 0.

1
NEWS
View File

@ -149,6 +149,7 @@ Improvements:
* Edje: use Eina_Cow to reduce memory usage.
* Embryo: use eina_file_mkstemp().
* Evas textblock : Added split cursor for BiDi text
* Evas works around MESA/intel xorg bug where alpha channel of non-argb windows is not filled in with 0xff.
Fixes:
* Fix a memory leak in ecore_con_dns when using ecore_con_server_connect

View File

@ -501,6 +501,22 @@ modules/evas/engines/gl_common/shader/tex_frag.h \
modules/evas/engines/gl_common/shader/tex_nomul_frag.h \
modules/evas/engines/gl_common/shader/tex_nomul_vert.h \
modules/evas/engines/gl_common/shader/tex_vert.h \
modules/evas/engines/gl_common/shader/tex_12_afill_frag.h \
modules/evas/engines/gl_common/shader/tex_12_nomul_afill_frag.h \
modules/evas/engines/gl_common/shader/tex_12_nomul_afill_vert.h \
modules/evas/engines/gl_common/shader/tex_12_afill_vert.h \
modules/evas/engines/gl_common/shader/tex_21_afill_frag.h \
modules/evas/engines/gl_common/shader/tex_21_nomul_afill_frag.h \
modules/evas/engines/gl_common/shader/tex_21_nomul_afill_vert.h \
modules/evas/engines/gl_common/shader/tex_21_afill_vert.h \
modules/evas/engines/gl_common/shader/tex_22_afill_frag.h \
modules/evas/engines/gl_common/shader/tex_22_nomul_afill_frag.h \
modules/evas/engines/gl_common/shader/tex_22_nomul_afill_vert.h \
modules/evas/engines/gl_common/shader/tex_22_afill_vert.h \
modules/evas/engines/gl_common/shader/tex_afill_frag.h \
modules/evas/engines/gl_common/shader/tex_nomul_afill_frag.h \
modules/evas/engines/gl_common/shader/tex_nomul_afill_vert.h \
modules/evas/engines/gl_common/shader/tex_afill_vert.h \
modules/evas/engines/gl_common/shader/yuv_frag.h \
modules/evas/engines/gl_common/shader/yuv_nomul_frag.h \
modules/evas/engines/gl_common/shader/yuv_nomul_vert.h \

View File

@ -157,6 +157,8 @@ typedef enum {
SHADER_IMG_BGRA_NOMUL,
SHADER_TEX,
SHADER_TEX_NOMUL,
SHADER_TEX_AFILL,
SHADER_TEX_NOMUL_AFILL,
SHADER_IMG_21,
SHADER_IMG_21_NOMUL,
@ -164,6 +166,8 @@ typedef enum {
SHADER_IMG_21_BGRA_NOMUL,
SHADER_TEX_21,
SHADER_TEX_21_NOMUL,
SHADER_TEX_21_AFILL,
SHADER_TEX_21_NOMUL_AFILL,
SHADER_IMG_12,
SHADER_IMG_12_NOMUL,
@ -171,6 +175,8 @@ typedef enum {
SHADER_IMG_12_BGRA_NOMUL,
SHADER_TEX_12,
SHADER_TEX_12_NOMUL,
SHADER_TEX_12_AFILL,
SHADER_TEX_12_NOMUL_AFILL,
SHADER_IMG_22,
SHADER_IMG_22_NOMUL,
@ -178,6 +184,8 @@ typedef enum {
SHADER_IMG_22_BGRA_NOMUL,
SHADER_TEX_22,
SHADER_TEX_22_NOMUL,
SHADER_TEX_22_AFILL,
SHADER_TEX_22_NOMUL_AFILL,
SHADER_YUV,
SHADER_YUV_NOMUL,

View File

@ -1574,26 +1574,42 @@ evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc,
{
if ((smooth) && ((sw >= (w * 2)) && (sh >= (h * 2))))
{
prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a,
SHADER_TEX_22_NOMUL, SHADER_TEX_22)].prog;
if ((!tex->alpha) && (tex->pt->native))
prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a,
SHADER_TEX_22_NOMUL_AFILL, SHADER_TEX_22_AFILL)].prog;
else
prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a,
SHADER_TEX_22_NOMUL, SHADER_TEX_22)].prog;
sam = 1;
}
else if ((smooth) && (sw >= (w * 2)))
{
prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a,
SHADER_TEX_21_NOMUL, SHADER_TEX_21)].prog;
if ((!tex->alpha) && (tex->pt->native))
prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a,
SHADER_TEX_21_NOMUL_AFILL, SHADER_TEX_21_AFILL)].prog;
else
prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a,
SHADER_TEX_21_NOMUL, SHADER_TEX_21)].prog;
sam = 1;
}
else if ((smooth) && (sh >= (h * 2)))
{
prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a,
SHADER_TEX_12_NOMUL, SHADER_TEX_12)].prog;
if ((!tex->alpha) && (tex->pt->native))
prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a,
SHADER_TEX_12_NOMUL_AFILL, SHADER_TEX_12_AFILL)].prog;
else
prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a,
SHADER_TEX_12_NOMUL, SHADER_TEX_12)].prog;
sam = 1;
}
else
{
prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a,
SHADER_TEX_NOMUL, SHADER_TEX)].prog;
if ((!tex->alpha) && (tex->pt->native))
prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a,
SHADER_TEX_NOMUL_AFILL, SHADER_TEX_AFILL)].prog;
else
prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a,
SHADER_TEX_NOMUL, SHADER_TEX)].prog;
}
}
}

View File

@ -158,6 +158,25 @@ Evas_GL_Program_Source shader_tex_vert_src =
NULL, 0
};
/////////////////////////////////////////////
const char tex_afill_frag_glsl[] =
#include "shader/tex_afill_frag.h"
;
Evas_GL_Program_Source shader_tex_afill_frag_src =
{
tex_afill_frag_glsl,
NULL, 0
};
const char tex_afill_vert_glsl[] =
#include "shader/tex_afill_vert.h"
;
Evas_GL_Program_Source shader_tex_afill_vert_src =
{
tex_afill_vert_glsl,
NULL, 0
};
/////////////////////////////////////////////
const char tex_nomul_frag_glsl[] =
#include "shader/tex_nomul_frag.h"
@ -177,6 +196,25 @@ Evas_GL_Program_Source shader_tex_nomul_vert_src =
NULL, 0
};
/////////////////////////////////////////////
const char tex_nomul_afill_frag_glsl[] =
#include "shader/tex_nomul_afill_frag.h"
;
Evas_GL_Program_Source shader_tex_nomul_afill_frag_src =
{
tex_nomul_afill_frag_glsl,
NULL, 0
};
const char tex_nomul_afill_vert_glsl[] =
#include "shader/tex_nomul_afill_vert.h"
;
Evas_GL_Program_Source shader_tex_nomul_afill_vert_src =
{
tex_nomul_afill_vert_glsl,
NULL, 0
};
@ -275,6 +313,25 @@ Evas_GL_Program_Source shader_tex_21_vert_src =
NULL, 0
};
/////////////////////////////////////////////
const char tex_21_afill_frag_glsl[] =
#include "shader/tex_21_afill_frag.h"
;
Evas_GL_Program_Source shader_tex_21_afill_frag_src =
{
tex_21_afill_frag_glsl,
NULL, 0
};
const char tex_21_afill_vert_glsl[] =
#include "shader/tex_21_afill_vert.h"
;
Evas_GL_Program_Source shader_tex_21_afill_vert_src =
{
tex_21_afill_vert_glsl,
NULL, 0
};
/////////////////////////////////////////////
const char tex_21_nomul_frag_glsl[] =
#include "shader/tex_21_nomul_frag.h"
@ -294,6 +351,25 @@ Evas_GL_Program_Source shader_tex_21_nomul_vert_src =
NULL, 0
};
/////////////////////////////////////////////
const char tex_21_nomul_afill_frag_glsl[] =
#include "shader/tex_21_nomul_afill_frag.h"
;
Evas_GL_Program_Source shader_tex_21_nomul_afill_frag_src =
{
tex_21_nomul_afill_frag_glsl,
NULL, 0
};
const char tex_21_nomul_afill_vert_glsl[] =
#include "shader/tex_21_nomul_afill_vert.h"
;
Evas_GL_Program_Source shader_tex_21_nomul_afill_vert_src =
{
tex_21_nomul_afill_vert_glsl,
NULL, 0
};
@ -392,6 +468,25 @@ Evas_GL_Program_Source shader_tex_12_vert_src =
NULL, 0
};
/////////////////////////////////////////////
const char tex_12_afill_frag_glsl[] =
#include "shader/tex_12_afill_frag.h"
;
Evas_GL_Program_Source shader_tex_12_afill_frag_src =
{
tex_12_afill_frag_glsl,
NULL, 0
};
const char tex_12_afill_vert_glsl[] =
#include "shader/tex_12_afill_vert.h"
;
Evas_GL_Program_Source shader_tex_12_afill_vert_src =
{
tex_12_afill_vert_glsl,
NULL, 0
};
/////////////////////////////////////////////
const char tex_12_nomul_frag_glsl[] =
#include "shader/tex_12_nomul_frag.h"
@ -411,6 +506,25 @@ Evas_GL_Program_Source shader_tex_12_nomul_vert_src =
NULL, 0
};
/////////////////////////////////////////////
const char tex_12_nomul_afill_frag_glsl[] =
#include "shader/tex_12_nomul_afill_frag.h"
;
Evas_GL_Program_Source shader_tex_12_nomul_afill_frag_src =
{
tex_12_nomul_afill_frag_glsl,
NULL, 0
};
const char tex_12_nomul_afill_vert_glsl[] =
#include "shader/tex_12_nomul_afill_vert.h"
;
Evas_GL_Program_Source shader_tex_12_nomul_afill_vert_src =
{
tex_12_nomul_afill_vert_glsl,
NULL, 0
};
@ -509,6 +623,25 @@ Evas_GL_Program_Source shader_tex_22_vert_src =
NULL, 0
};
/////////////////////////////////////////////
const char tex_22_afill_frag_glsl[] =
#include "shader/tex_22_afill_frag.h"
;
Evas_GL_Program_Source shader_tex_22_afill_frag_src =
{
tex_22_afill_frag_glsl,
NULL, 0
};
const char tex_22_afill_vert_glsl[] =
#include "shader/tex_22_afill_vert.h"
;
Evas_GL_Program_Source shader_tex_22_afill_vert_src =
{
tex_22_afill_vert_glsl,
NULL, 0
};
/////////////////////////////////////////////
const char tex_22_nomul_frag_glsl[] =
#include "shader/tex_22_nomul_frag.h"
@ -528,6 +661,25 @@ Evas_GL_Program_Source shader_tex_22_nomul_vert_src =
NULL, 0
};
/////////////////////////////////////////////
const char tex_22_nomul_afill_frag_glsl[] =
#include "shader/tex_22_nomul_afill_frag.h"
;
Evas_GL_Program_Source shader_tex_22_nomul_afill_frag_src =
{
tex_22_nomul_afill_frag_glsl,
NULL, 0
};
const char tex_22_nomul_afill_vert_glsl[] =
#include "shader/tex_22_nomul_afill_vert.h"
;
Evas_GL_Program_Source shader_tex_22_nomul_afill_vert_src =
{
tex_22_nomul_afill_vert_glsl,
NULL, 0
};
@ -887,6 +1039,8 @@ static const struct {
SHADER_SOURCE_LINE(IMG_BGRA_NOMUL, img_bgra_nomul),
SHADER_SOURCE_LINE(TEX, tex),
SHADER_SOURCE_LINE(TEX_NOMUL, tex_nomul),
SHADER_SOURCE_LINE(TEX_AFILL, tex_afill),
SHADER_SOURCE_LINE(TEX_NOMUL_AFILL, tex_nomul_afill),
SHADER_SOURCE_LINE(IMG_21, img_21),
SHADER_SOURCE_LINE(IMG_21_NOMUL, img_21_nomul),
@ -894,6 +1048,8 @@ static const struct {
SHADER_SOURCE_LINE(IMG_21_BGRA_NOMUL, img_21_bgra_nomul),
SHADER_SOURCE_LINE(TEX_21, tex_21),
SHADER_SOURCE_LINE(TEX_21_NOMUL, tex_21_nomul),
SHADER_SOURCE_LINE(TEX_21_AFILL, tex_21_afill),
SHADER_SOURCE_LINE(TEX_21_NOMUL_AFILL, tex_21_nomul_afill),
SHADER_SOURCE_LINE(IMG_12, img_12),
SHADER_SOURCE_LINE(IMG_12_NOMUL, img_12_nomul),
@ -901,6 +1057,8 @@ static const struct {
SHADER_SOURCE_LINE(IMG_12_BGRA_NOMUL, img_12_bgra_nomul),
SHADER_SOURCE_LINE(TEX_12, tex_12),
SHADER_SOURCE_LINE(TEX_12_NOMUL, tex_12_nomul),
SHADER_SOURCE_LINE(TEX_12_AFILL, tex_12_afill),
SHADER_SOURCE_LINE(TEX_12_NOMUL_AFILL, tex_12_nomul_afill),
SHADER_SOURCE_LINE(IMG_22, img_22),
SHADER_SOURCE_LINE(IMG_22_NOMUL, img_22_nomul),
@ -908,6 +1066,8 @@ static const struct {
SHADER_SOURCE_LINE(IMG_22_BGRA_NOMUL, img_22_bgra_nomul),
SHADER_SOURCE_LINE(TEX_22, tex_22),
SHADER_SOURCE_LINE(TEX_22_NOMUL, tex_22_nomul),
SHADER_SOURCE_LINE(TEX_22_AFILL, tex_22_afill),
SHADER_SOURCE_LINE(TEX_22_NOMUL_AFILL, tex_22_nomul_afill),
SHADER_SOURCE_LINE(YUV, yuv),
SHADER_SOURCE_LINE(YUV_NOMUL, yuv_nomul),

View File

@ -25,6 +25,8 @@ compile img_bgra
compile img_bgra_nomul
compile tex
compile tex_nomul
compile tex_afill
compile tex_nomul_afill
compile img_21
compile img_21_nomul
@ -32,6 +34,8 @@ compile img_21_bgra
compile img_21_bgra_nomul
compile tex_21
compile tex_21_nomul
compile tex_21_afill
compile tex_21_nomul_afill
compile img_12
compile img_12_nomul
@ -39,6 +43,8 @@ compile img_12_bgra
compile img_12_bgra_nomul
compile tex_12
compile tex_12_nomul
compile tex_12_afill
compile tex_12_nomul_afill
compile img_22
compile img_22_nomul
@ -46,6 +52,8 @@ compile img_22_bgra
compile img_22_bgra_nomul
compile tex_22
compile tex_22_nomul
compile tex_22_afill
compile tex_22_nomul_afill
## above section must have 21, 22 and 12 versions

View File

@ -0,0 +1,19 @@
"#ifdef GL_ES\n"
"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
"precision highp float;\n"
"#else\n"
"precision mediump float;\n"
"#endif\n"
"#endif\n"
"uniform sampler2D tex;\n"
"varying vec4 col;\n"
"varying vec2 tex_c;\n"
"varying vec2 tex_s[2];\n"
"varying vec4 div_s;\n"
"void main()\n"
"{\n"
" vec4 col00 = texture2D(tex, tex_c + tex_s[0]);\n"
" vec4 col01 = texture2D(tex, tex_c + tex_s[1]);\n"
" vec4 c = (col00 + col01) / div_s;\n"
" gl_FragColor = vec4(c.r, c.g, c.b, 1) * col;\n"
"}\n"

View File

@ -0,0 +1,19 @@
#ifdef GL_ES
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
#endif
uniform sampler2D tex;
varying vec4 col;
varying vec2 tex_c;
varying vec2 tex_s[2];
varying vec4 div_s;
void main()
{
vec4 col00 = texture2D(tex, tex_c + tex_s[0]);
vec4 col01 = texture2D(tex, tex_c + tex_s[1]);
vec4 c = (col00 + col01) / div_s;
gl_FragColor = vec4(c.r, c.g, c.b, 1) * col;
}

View File

@ -0,0 +1,21 @@
"#ifdef GL_ES\n"
"precision highp float;\n"
"#endif\n"
"attribute vec4 vertex;\n"
"attribute vec4 color;\n"
"attribute vec2 tex_coord;\n"
"attribute vec2 tex_sample;\n"
"uniform mat4 mvp;\n"
"varying vec4 col;\n"
"varying vec2 tex_c;\n"
"varying vec2 tex_s[2];\n"
"varying vec4 div_s;\n"
"void main()\n"
"{\n"
" gl_Position = mvp * vertex;\n"
" col = color;\n"
" tex_c = tex_coord;\n"
" tex_s[0] = vec2(0, -tex_sample.y);\n"
" tex_s[1] = vec2(0, tex_sample.y);\n"
" div_s = vec4(2, 2, 2, 2);\n"
"}\n"

View File

@ -0,0 +1,21 @@
#ifdef GL_ES
precision highp float;
#endif
attribute vec4 vertex;
attribute vec4 color;
attribute vec2 tex_coord;
attribute vec2 tex_sample;
uniform mat4 mvp;
varying vec4 col;
varying vec2 tex_c;
varying vec2 tex_s[2];
varying vec4 div_s;
void main()
{
gl_Position = mvp * vertex;
col = color;
tex_c = tex_coord;
tex_s[0] = vec2(0, -tex_sample.y);
tex_s[1] = vec2(0, tex_sample.y);
div_s = vec4(2, 2, 2, 2);
}

View File

@ -0,0 +1,18 @@
"#ifdef GL_ES\n"
"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
"precision highp float;\n"
"#else\n"
"precision mediump float;\n"
"#endif\n"
"#endif\n"
"uniform sampler2D tex;\n"
"varying vec2 tex_c;\n"
"varying vec2 tex_s[2];\n"
"varying vec4 div_s;\n"
"void main()\n"
"{\n"
" vec4 col00 = texture2D(tex, tex_c + tex_s[0]);\n"
" vec4 col01 = texture2D(tex, tex_c + tex_s[1]);\n"
" vec4 c = (col00 + col01) / div_s;\n"
" gl_FragColor = vec4(c.r, c.g, c.b, 1);\n"
"}\n"

View File

@ -0,0 +1,18 @@
#ifdef GL_ES
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
#endif
uniform sampler2D tex;
varying vec2 tex_c;
varying vec2 tex_s[2];
varying vec4 div_s;
void main()
{
vec4 col00 = texture2D(tex, tex_c + tex_s[0]);
vec4 col01 = texture2D(tex, tex_c + tex_s[1]);
vec4 c = (col00 + col01) / div_s;
gl_FragColor = vec4(c.r, c.g, c.b, 1);
}

View File

@ -0,0 +1,18 @@
"#ifdef GL_ES\n"
"precision highp float;\n"
"#endif\n"
"attribute vec4 vertex;\n"
"attribute vec2 tex_coord;\n"
"attribute vec2 tex_sample;\n"
"uniform mat4 mvp;\n"
"varying vec2 tex_c;\n"
"varying vec2 tex_s[2];\n"
"varying vec4 div_s;\n"
"void main()\n"
"{\n"
" gl_Position = mvp * vertex;\n"
" tex_c = tex_coord;\n"
" tex_s[0] = vec2(0, -tex_sample.y);\n"
" tex_s[1] = vec2(0, tex_sample.y);\n"
" div_s = vec4(2, 2, 2, 2);\n"
"}\n"

View File

@ -0,0 +1,18 @@
#ifdef GL_ES
precision highp float;
#endif
attribute vec4 vertex;
attribute vec2 tex_coord;
attribute vec2 tex_sample;
uniform mat4 mvp;
varying vec2 tex_c;
varying vec2 tex_s[2];
varying vec4 div_s;
void main()
{
gl_Position = mvp * vertex;
tex_c = tex_coord;
tex_s[0] = vec2(0, -tex_sample.y);
tex_s[1] = vec2(0, tex_sample.y);
div_s = vec4(2, 2, 2, 2);
}

View File

@ -0,0 +1,19 @@
"#ifdef GL_ES\n"
"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
"precision highp float;\n"
"#else\n"
"precision mediump float;\n"
"#endif\n"
"#endif\n"
"uniform sampler2D tex;\n"
"varying vec4 col;\n"
"varying vec2 tex_c;\n"
"varying vec2 tex_s[2];\n"
"varying vec4 div_s;\n"
"void main()\n"
"{\n"
" vec4 col00 = texture2D(tex, tex_c + tex_s[0]);\n"
" vec4 col01 = texture2D(tex, tex_c + tex_s[1]);\n"
" vec4 c = (col00 + col01) / div_s;\n"
" gl_FragColor = vec4(c.r, c.g, c.b, 1) * col;\n"
"}\n"

View File

@ -0,0 +1,19 @@
#ifdef GL_ES
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
#endif
uniform sampler2D tex;
varying vec4 col;
varying vec2 tex_c;
varying vec2 tex_s[2];
varying vec4 div_s;
void main()
{
vec4 col00 = texture2D(tex, tex_c + tex_s[0]);
vec4 col01 = texture2D(tex, tex_c + tex_s[1]);
vec4 c = (col00 + col01) / div_s;
gl_FragColor = vec4(c.r, c.g, c.b, 1) * col;
}

View File

@ -0,0 +1,21 @@
"#ifdef GL_ES\n"
"precision highp float;\n"
"#endif\n"
"attribute vec4 vertex;\n"
"attribute vec4 color;\n"
"attribute vec2 tex_coord;\n"
"attribute vec2 tex_sample;\n"
"uniform mat4 mvp;\n"
"varying vec4 col;\n"
"varying vec2 tex_c;\n"
"varying vec2 tex_s[2];\n"
"varying vec4 div_s;\n"
"void main()\n"
"{\n"
" gl_Position = mvp * vertex;\n"
" col = color;\n"
" tex_c = tex_coord;\n"
" tex_s[0] = vec2(-tex_sample.x, 0);\n"
" tex_s[1] = vec2( tex_sample.x, 0);\n"
" div_s = vec4(2, 2, 2, 2);\n"
"}\n"

View File

@ -0,0 +1,21 @@
#ifdef GL_ES
precision highp float;
#endif
attribute vec4 vertex;
attribute vec4 color;
attribute vec2 tex_coord;
attribute vec2 tex_sample;
uniform mat4 mvp;
varying vec4 col;
varying vec2 tex_c;
varying vec2 tex_s[2];
varying vec4 div_s;
void main()
{
gl_Position = mvp * vertex;
col = color;
tex_c = tex_coord;
tex_s[0] = vec2(-tex_sample.x, 0);
tex_s[1] = vec2( tex_sample.x, 0);
div_s = vec4(2, 2, 2, 2);
}

View File

@ -0,0 +1,18 @@
"#ifdef GL_ES\n"
"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
"precision highp float;\n"
"#else\n"
"precision mediump float;\n"
"#endif\n"
"#endif\n"
"uniform sampler2D tex;\n"
"varying vec2 tex_c;\n"
"varying vec2 tex_s[2];\n"
"varying vec4 div_s;\n"
"void main()\n"
"{\n"
" vec4 col00 = texture2D(tex, tex_c + tex_s[0]);\n"
" vec4 col01 = texture2D(tex, tex_c + tex_s[1]);\n"
" vec4 c = (col00 + col01) / div_s;\n"
" gl_FragColor = vec4(c.r, c.g, c.b, 1);\n"
"}\n"

View File

@ -0,0 +1,18 @@
#ifdef GL_ES
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
#endif
uniform sampler2D tex;
varying vec2 tex_c;
varying vec2 tex_s[2];
varying vec4 div_s;
void main()
{
vec4 col00 = texture2D(tex, tex_c + tex_s[0]);
vec4 col01 = texture2D(tex, tex_c + tex_s[1]);
vec4 c = (col00 + col01) / div_s;
gl_FragColor = vec4(c.r, c.g, c.b, 1);
}

View File

@ -0,0 +1,18 @@
"#ifdef GL_ES\n"
"precision highp float;\n"
"#endif\n"
"attribute vec4 vertex;\n"
"attribute vec2 tex_coord;\n"
"attribute vec2 tex_sample;\n"
"uniform mat4 mvp;\n"
"varying vec2 tex_c;\n"
"varying vec2 tex_s[2];\n"
"varying vec4 div_s;\n"
"void main()\n"
"{\n"
" gl_Position = mvp * vertex;\n"
" tex_c = tex_coord;\n"
" tex_s[0] = vec2(-tex_sample.x, 0);\n"
" tex_s[1] = vec2( tex_sample.x, 0);\n"
" div_s = vec4(2, 2, 2, 2);\n"
"}\n"

View File

@ -0,0 +1,18 @@
#ifdef GL_ES
precision highp float;
#endif
attribute vec4 vertex;
attribute vec2 tex_coord;
attribute vec2 tex_sample;
uniform mat4 mvp;
varying vec2 tex_c;
varying vec2 tex_s[2];
varying vec4 div_s;
void main()
{
gl_Position = mvp * vertex;
tex_c = tex_coord;
tex_s[0] = vec2(-tex_sample.x, 0);
tex_s[1] = vec2( tex_sample.x, 0);
div_s = vec4(2, 2, 2, 2);
}

View File

@ -0,0 +1,21 @@
"#ifdef GL_ES\n"
"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
"precision highp float;\n"
"#else\n"
"precision mediump float;\n"
"#endif\n"
"#endif\n"
"uniform sampler2D tex;\n"
"varying vec4 col;\n"
"varying vec2 tex_c;\n"
"varying vec2 tex_s[4];\n"
"varying vec4 div_s;\n"
"void main()\n"
"{\n"
" vec4 col00 = texture2D(tex, tex_c + tex_s[0]);\n"
" vec4 col01 = texture2D(tex, tex_c + tex_s[1]);\n"
" vec4 col10 = texture2D(tex, tex_c + tex_s[2]);\n"
" vec4 col11 = texture2D(tex, tex_c + tex_s[3]);\n"
" vec4 c = (col00 + col01 + col10 + col11) / div_s;\n"
" gl_FragColor = vec4(c.r, c.g, c.b, 1) * col;\n"
"}\n"

View File

@ -0,0 +1,21 @@
#ifdef GL_ES
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
#endif
uniform sampler2D tex;
varying vec4 col;
varying vec2 tex_c;
varying vec2 tex_s[4];
varying vec4 div_s;
void main()
{
vec4 col00 = texture2D(tex, tex_c + tex_s[0]);
vec4 col01 = texture2D(tex, tex_c + tex_s[1]);
vec4 col10 = texture2D(tex, tex_c + tex_s[2]);
vec4 col11 = texture2D(tex, tex_c + tex_s[3]);
vec4 c = (col00 + col01 + col10 + col11) / div_s;
gl_FragColor = vec4(c.r, c.g, c.b, 1) * col;
}

View File

@ -0,0 +1,23 @@
"#ifdef GL_ES\n"
"precision highp float;\n"
"#endif\n"
"attribute vec4 vertex;\n"
"attribute vec4 color;\n"
"attribute vec2 tex_coord;\n"
"attribute vec2 tex_sample;\n"
"uniform mat4 mvp;\n"
"varying vec4 col;\n"
"varying vec2 tex_c;\n"
"varying vec2 tex_s[4];\n"
"varying vec4 div_s;\n"
"void main()\n"
"{\n"
" gl_Position = mvp * vertex;\n"
" col = color;\n"
" tex_c = tex_coord;\n"
" tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n"
" tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n"
" tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n"
" tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n"
" div_s = vec4(4, 4, 4, 4);\n"
"}\n"

View File

@ -0,0 +1,23 @@
#ifdef GL_ES
precision highp float;
#endif
attribute vec4 vertex;
attribute vec4 color;
attribute vec2 tex_coord;
attribute vec2 tex_sample;
uniform mat4 mvp;
varying vec4 col;
varying vec2 tex_c;
varying vec2 tex_s[4];
varying vec4 div_s;
void main()
{
gl_Position = mvp * vertex;
col = color;
tex_c = tex_coord;
tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);
tex_s[1] = vec2( tex_sample.x, -tex_sample.y);
tex_s[2] = vec2( tex_sample.x, tex_sample.y);
tex_s[3] = vec2(-tex_sample.x, tex_sample.y);
div_s = vec4(4, 4, 4, 4);
}

View File

@ -0,0 +1,20 @@
"#ifdef GL_ES\n"
"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
"precision highp float;\n"
"#else\n"
"precision mediump float;\n"
"#endif\n"
"#endif\n"
"uniform sampler2D tex;\n"
"varying vec2 tex_c;\n"
"varying vec2 tex_s[4];\n"
"varying vec4 div_s;\n"
"void main()\n"
"{\n"
" vec4 col00 = texture2D(tex, tex_c + tex_s[0]);\n"
" vec4 col01 = texture2D(tex, tex_c + tex_s[1]);\n"
" vec4 col10 = texture2D(tex, tex_c + tex_s[2]);\n"
" vec4 col11 = texture2D(tex, tex_c + tex_s[3]);\n"
" vec4 c = (col00 + col01 + col10 + col11) / div_s;\n"
" gl_FragColor = vec4(c.r, c.g, c.b, 1);\n"
"}\n"

View File

@ -0,0 +1,20 @@
#ifdef GL_ES
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
#endif
uniform sampler2D tex;
varying vec2 tex_c;
varying vec2 tex_s[4];
varying vec4 div_s;
void main()
{
vec4 col00 = texture2D(tex, tex_c + tex_s[0]);
vec4 col01 = texture2D(tex, tex_c + tex_s[1]);
vec4 col10 = texture2D(tex, tex_c + tex_s[2]);
vec4 col11 = texture2D(tex, tex_c + tex_s[3]);
vec4 c = (col00 + col01 + col10 + col11) / div_s;
gl_FragColor = vec4(c.r, c.g, c.b, 1);
}

View File

@ -0,0 +1,20 @@
"#ifdef GL_ES\n"
"precision highp float;\n"
"#endif\n"
"attribute vec4 vertex;\n"
"attribute vec2 tex_coord;\n"
"attribute vec2 tex_sample;\n"
"uniform mat4 mvp;\n"
"varying vec2 tex_c;\n"
"varying vec2 tex_s[4];\n"
"varying vec4 div_s;\n"
"void main()\n"
"{\n"
" gl_Position = mvp * vertex;\n"
" tex_c = tex_coord;\n"
" tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n"
" tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n"
" tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n"
" tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n"
" div_s = vec4(4, 4, 4, 4);\n"
"}\n"

View File

@ -0,0 +1,20 @@
#ifdef GL_ES
precision highp float;
#endif
attribute vec4 vertex;
attribute vec2 tex_coord;
attribute vec2 tex_sample;
uniform mat4 mvp;
varying vec2 tex_c;
varying vec2 tex_s[4];
varying vec4 div_s;
void main()
{
gl_Position = mvp * vertex;
tex_c = tex_coord;
tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);
tex_s[1] = vec2( tex_sample.x, -tex_sample.y);
tex_s[2] = vec2( tex_sample.x, tex_sample.y);
tex_s[3] = vec2(-tex_sample.x, tex_sample.y);
div_s = vec4(4, 4, 4, 4);
}

View File

@ -0,0 +1,15 @@
"#ifdef GL_ES\n"
"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
"precision highp float;\n"
"#else\n"
"precision mediump float;\n"
"#endif\n"
"#endif\n"
"uniform sampler2D tex;\n"
"varying vec4 col;\n"
"varying vec2 tex_c;\n"
"void main()\n"
"{\n"
" vec4 c = texture2D(tex, tex_c.xy);\n"
" gl_FragColor = vec4(c.r, c.g, c.b, 1) * col;\n"
"}\n"

View File

@ -0,0 +1,15 @@
#ifdef GL_ES
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
#endif
uniform sampler2D tex;
varying vec4 col;
varying vec2 tex_c;
void main()
{
vec4 c = texture2D(tex, tex_c.xy);
gl_FragColor = vec4(c.r, c.g, c.b, 1) * col;
}

View File

@ -0,0 +1,15 @@
"#ifdef GL_ES\n"
"precision highp float;\n"
"#endif\n"
"attribute vec4 vertex;\n"
"attribute vec4 color;\n"
"attribute vec2 tex_coord;\n"
"uniform mat4 mvp;\n"
"varying vec4 col;\n"
"varying vec2 tex_c;\n"
"void main()\n"
"{\n"
" gl_Position = mvp * vertex;\n"
" col = color;\n"
" tex_c = tex_coord;\n"
"}\n"

View File

@ -0,0 +1,15 @@
#ifdef GL_ES
precision highp float;
#endif
attribute vec4 vertex;
attribute vec4 color;
attribute vec2 tex_coord;
uniform mat4 mvp;
varying vec4 col;
varying vec2 tex_c;
void main()
{
gl_Position = mvp * vertex;
col = color;
tex_c = tex_coord;
}

View File

@ -0,0 +1,14 @@
"#ifdef GL_ES\n"
"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
"precision highp float;\n"
"#else\n"
"precision mediump float;\n"
"#endif\n"
"#endif\n"
"uniform sampler2D tex;\n"
"varying vec2 tex_c;\n"
"void main()\n"
"{\n"
" vec4 c = texture2D(tex, tex_c.xy);\n"
" gl_FragColor = vec4(c.r, c.g, c.b, 1);\n"
"}\n"

View File

@ -0,0 +1,14 @@
#ifdef GL_ES
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
#endif
uniform sampler2D tex;
varying vec2 tex_c;
void main()
{
vec4 c = texture2D(tex, tex_c.xy);
gl_FragColor = vec4(c.r, c.g, c.b, 1);
}

View File

@ -0,0 +1,12 @@
"#ifdef GL_ES\n"
"precision highp float;\n"
"#endif\n"
"attribute vec4 vertex;\n"
"attribute vec2 tex_coord;\n"
"uniform mat4 mvp;\n"
"varying vec2 tex_c;\n"
"void main()\n"
"{\n"
" gl_Position = mvp * vertex;\n"
" tex_c = tex_coord;\n"
"}\n"

View File

@ -0,0 +1,12 @@
#ifdef GL_ES
precision highp float;
#endif
attribute vec4 vertex;
attribute vec2 tex_coord;
uniform mat4 mvp;
varying vec2 tex_c;
void main()
{
gl_Position = mvp * vertex;
tex_c = tex_coord;
}