summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-04-13 21:49:45 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-04-14 16:37:12 +0900
commit404ecdd8d7b0a91876c9ae11d1f0a80634b557d3 (patch)
tree5f2c5156ac8a92a0189bd9c056a5606fe649b698 /src/modules
parent99347e91789217a294172cb670b349fb6eb1c5d9 (diff)
Evas GL common: Fix RGB+A textures
Since the shaders system rewrite, RGB+A (used for ETC1+Alpha encoding) did not work anymore.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/engines/gl_common/shader/evas_gl_enum.x6
-rw-r--r--src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x28
-rw-r--r--src/modules/evas/engines/gl_common/shader/shaders.txt12
3 files changed, 36 insertions, 10 deletions
diff --git a/src/modules/evas/engines/gl_common/shader/evas_gl_enum.x b/src/modules/evas/engines/gl_common/shader/evas_gl_enum.x
index 5c523fc..4f3cb12 100644
--- a/src/modules/evas/engines/gl_common/shader/evas_gl_enum.x
+++ b/src/modules/evas/engines/gl_common/shader/evas_gl_enum.x
@@ -119,8 +119,14 @@ static struct {
119 { SHADER_IMG_21_BGRA_MASK_NOMUL, "texm" }, 119 { SHADER_IMG_21_BGRA_MASK_NOMUL, "texm" },
120 { SHADER_IMG_22_BGRA_MASK_NOMUL, "tex" }, 120 { SHADER_IMG_22_BGRA_MASK_NOMUL, "tex" },
121 { SHADER_IMG_22_BGRA_MASK_NOMUL, "texm" }, 121 { SHADER_IMG_22_BGRA_MASK_NOMUL, "texm" },
122 { SHADER_RGB_A_PAIR, "tex" },
123 { SHADER_RGB_A_PAIR, "texa" },
124 { SHADER_RGB_A_PAIR_MASK, "tex" },
122 { SHADER_RGB_A_PAIR_MASK, "texa" }, 125 { SHADER_RGB_A_PAIR_MASK, "texa" },
123 { SHADER_RGB_A_PAIR_MASK, "texm" }, 126 { SHADER_RGB_A_PAIR_MASK, "texm" },
127 { SHADER_RGB_A_PAIR_NOMUL, "tex" },
128 { SHADER_RGB_A_PAIR_NOMUL, "texa" },
129 { SHADER_RGB_A_PAIR_MASK_NOMUL, "tex" },
124 { SHADER_RGB_A_PAIR_MASK_NOMUL, "texa" }, 130 { SHADER_RGB_A_PAIR_MASK_NOMUL, "texa" },
125 { SHADER_RGB_A_PAIR_MASK_NOMUL, "texm" }, 131 { SHADER_RGB_A_PAIR_MASK_NOMUL, "texm" },
126 { SHADER_YUV, "tex" }, 132 { SHADER_YUV, "tex" },
diff --git a/src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x b/src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x
index f5dd596..38cdc25 100644
--- a/src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x
+++ b/src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x
@@ -2928,12 +2928,14 @@ static const char const rgb_a_pair_frag_glsl[] =
2928 "#endif\n" 2928 "#endif\n"
2929 "#endif\n" 2929 "#endif\n"
2930 "varying vec4 col;\n" 2930 "varying vec4 col;\n"
2931 "uniform sampler2D tex;\n"
2932 "varying vec2 tex_c;\n"
2931 "uniform sampler2D texa;\n" 2933 "uniform sampler2D texa;\n"
2932 "varying vec2 tex_a;\n" 2934 "varying vec2 tex_a;\n"
2933 "void main()\n" 2935 "void main()\n"
2934 "{\n" 2936 "{\n"
2935 " vec4 c;\n" 2937 " vec4 c;\n"
2936 " c = vec4(1, 1, 1, 1);\n" 2938 " c = texture2D(tex, tex_c).bgra;\n"
2937 " gl_FragColor =\n" 2939 " gl_FragColor =\n"
2938 " c\n" 2940 " c\n"
2939 " * col\n" 2941 " * col\n"
@@ -2954,12 +2956,15 @@ static const char const rgb_a_pair_vert_glsl[] =
2954 "uniform mat4 mvp;\n" 2956 "uniform mat4 mvp;\n"
2955 "attribute vec4 color;\n" 2957 "attribute vec4 color;\n"
2956 "varying vec4 col;\n" 2958 "varying vec4 col;\n"
2959 "attribute vec2 tex_coord;\n"
2960 "varying vec2 tex_c;\n"
2957 "attribute vec2 tex_coorda;\n" 2961 "attribute vec2 tex_coorda;\n"
2958 "varying vec2 tex_a;\n" 2962 "varying vec2 tex_a;\n"
2959 "void main()\n" 2963 "void main()\n"
2960 "{\n" 2964 "{\n"
2961 " gl_Position = mvp * vertex;\n" 2965 " gl_Position = mvp * vertex;\n"
2962 " col = color;\n" 2966 " col = color;\n"
2967 " tex_c = tex_coord;\n"
2963 " tex_a = tex_coorda;\n" 2968 " tex_a = tex_coorda;\n"
2964 "}\n"; 2969 "}\n";
2965Evas_GL_Program_Source shader_rgb_a_pair_vert_src = 2970Evas_GL_Program_Source shader_rgb_a_pair_vert_src =
@@ -2977,6 +2982,8 @@ static const char const rgb_a_pair_mask_frag_glsl[] =
2977 "#endif\n" 2982 "#endif\n"
2978 "#endif\n" 2983 "#endif\n"
2979 "varying vec4 col;\n" 2984 "varying vec4 col;\n"
2985 "uniform sampler2D tex;\n"
2986 "varying vec2 tex_c;\n"
2980 "uniform sampler2D texa;\n" 2987 "uniform sampler2D texa;\n"
2981 "varying vec2 tex_a;\n" 2988 "varying vec2 tex_a;\n"
2982 "uniform sampler2D texm;\n" 2989 "uniform sampler2D texm;\n"
@@ -2984,7 +2991,7 @@ static const char const rgb_a_pair_mask_frag_glsl[] =
2984 "void main()\n" 2991 "void main()\n"
2985 "{\n" 2992 "{\n"
2986 " vec4 c;\n" 2993 " vec4 c;\n"
2987 " c = vec4(1, 1, 1, 1);\n" 2994 " c = texture2D(tex, tex_c).bgra;\n"
2988 " gl_FragColor =\n" 2995 " gl_FragColor =\n"
2989 " c\n" 2996 " c\n"
2990 " * col\n" 2997 " * col\n"
@@ -3006,6 +3013,8 @@ static const char const rgb_a_pair_mask_vert_glsl[] =
3006 "uniform mat4 mvp;\n" 3013 "uniform mat4 mvp;\n"
3007 "attribute vec4 color;\n" 3014 "attribute vec4 color;\n"
3008 "varying vec4 col;\n" 3015 "varying vec4 col;\n"
3016 "attribute vec2 tex_coord;\n"
3017 "varying vec2 tex_c;\n"
3009 "attribute vec2 tex_coorda;\n" 3018 "attribute vec2 tex_coorda;\n"
3010 "varying vec2 tex_a;\n" 3019 "varying vec2 tex_a;\n"
3011 "attribute vec4 mask_coord;\n" 3020 "attribute vec4 mask_coord;\n"
@@ -3014,6 +3023,7 @@ static const char const rgb_a_pair_mask_vert_glsl[] =
3014 "{\n" 3023 "{\n"
3015 " gl_Position = mvp * vertex;\n" 3024 " gl_Position = mvp * vertex;\n"
3016 " col = color;\n" 3025 " col = color;\n"
3026 " tex_c = tex_coord;\n"
3017 " tex_a = tex_coorda;\n" 3027 " tex_a = tex_coorda;\n"
3018 " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" 3028 " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n"
3019 " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" 3029 " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n"
@@ -3032,12 +3042,14 @@ static const char const rgb_a_pair_nomul_frag_glsl[] =
3032 "precision mediump float;\n" 3042 "precision mediump float;\n"
3033 "#endif\n" 3043 "#endif\n"
3034 "#endif\n" 3044 "#endif\n"
3045 "uniform sampler2D tex;\n"
3046 "varying vec2 tex_c;\n"
3035 "uniform sampler2D texa;\n" 3047 "uniform sampler2D texa;\n"
3036 "varying vec2 tex_a;\n" 3048 "varying vec2 tex_a;\n"
3037 "void main()\n" 3049 "void main()\n"
3038 "{\n" 3050 "{\n"
3039 " vec4 c;\n" 3051 " vec4 c;\n"
3040 " c = vec4(1, 1, 1, 1);\n" 3052 " c = texture2D(tex, tex_c).bgra;\n"
3041 " gl_FragColor =\n" 3053 " gl_FragColor =\n"
3042 " c\n" 3054 " c\n"
3043 " * texture2D(texa, tex_a).r\n" 3055 " * texture2D(texa, tex_a).r\n"
@@ -3055,11 +3067,14 @@ static const char const rgb_a_pair_nomul_vert_glsl[] =
3055 "#endif\n" 3067 "#endif\n"
3056 "attribute vec4 vertex;\n" 3068 "attribute vec4 vertex;\n"
3057 "uniform mat4 mvp;\n" 3069 "uniform mat4 mvp;\n"
3070 "attribute vec2 tex_coord;\n"
3071 "varying vec2 tex_c;\n"
3058 "attribute vec2 tex_coorda;\n" 3072 "attribute vec2 tex_coorda;\n"
3059 "varying vec2 tex_a;\n" 3073 "varying vec2 tex_a;\n"
3060 "void main()\n" 3074 "void main()\n"
3061 "{\n" 3075 "{\n"
3062 " gl_Position = mvp * vertex;\n" 3076 " gl_Position = mvp * vertex;\n"
3077 " tex_c = tex_coord;\n"
3063 " tex_a = tex_coorda;\n" 3078 " tex_a = tex_coorda;\n"
3064 "}\n"; 3079 "}\n";
3065Evas_GL_Program_Source shader_rgb_a_pair_nomul_vert_src = 3080Evas_GL_Program_Source shader_rgb_a_pair_nomul_vert_src =
@@ -3076,6 +3091,8 @@ static const char const rgb_a_pair_mask_nomul_frag_glsl[] =
3076 "precision mediump float;\n" 3091 "precision mediump float;\n"
3077 "#endif\n" 3092 "#endif\n"
3078 "#endif\n" 3093 "#endif\n"
3094 "uniform sampler2D tex;\n"
3095 "varying vec2 tex_c;\n"
3079 "uniform sampler2D texa;\n" 3096 "uniform sampler2D texa;\n"
3080 "varying vec2 tex_a;\n" 3097 "varying vec2 tex_a;\n"
3081 "uniform sampler2D texm;\n" 3098 "uniform sampler2D texm;\n"
@@ -3083,7 +3100,7 @@ static const char const rgb_a_pair_mask_nomul_frag_glsl[] =
3083 "void main()\n" 3100 "void main()\n"
3084 "{\n" 3101 "{\n"
3085 " vec4 c;\n" 3102 " vec4 c;\n"
3086 " c = vec4(1, 1, 1, 1);\n" 3103 " c = texture2D(tex, tex_c).bgra;\n"
3087 " gl_FragColor =\n" 3104 " gl_FragColor =\n"
3088 " c\n" 3105 " c\n"
3089 " * texture2D(texm, tex_m).a\n" 3106 " * texture2D(texm, tex_m).a\n"
@@ -3102,6 +3119,8 @@ static const char const rgb_a_pair_mask_nomul_vert_glsl[] =
3102 "#endif\n" 3119 "#endif\n"
3103 "attribute vec4 vertex;\n" 3120 "attribute vec4 vertex;\n"
3104 "uniform mat4 mvp;\n" 3121 "uniform mat4 mvp;\n"
3122 "attribute vec2 tex_coord;\n"
3123 "varying vec2 tex_c;\n"
3105 "attribute vec2 tex_coorda;\n" 3124 "attribute vec2 tex_coorda;\n"
3106 "varying vec2 tex_a;\n" 3125 "varying vec2 tex_a;\n"
3107 "attribute vec4 mask_coord;\n" 3126 "attribute vec4 mask_coord;\n"
@@ -3109,6 +3128,7 @@ static const char const rgb_a_pair_mask_nomul_vert_glsl[] =
3109 "void main()\n" 3128 "void main()\n"
3110 "{\n" 3129 "{\n"
3111 " gl_Position = mvp * vertex;\n" 3130 " gl_Position = mvp * vertex;\n"
3131 " tex_c = tex_coord;\n"
3112 " tex_a = tex_coorda;\n" 3132 " tex_a = tex_coorda;\n"
3113 " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" 3133 " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n"
3114 " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" 3134 " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n"
diff --git a/src/modules/evas/engines/gl_common/shader/shaders.txt b/src/modules/evas/engines/gl_common/shader/shaders.txt
index 6dd7f12..e5a3e7a 100644
--- a/src/modules/evas/engines/gl_common/shader/shaders.txt
+++ b/src/modules/evas/engines/gl_common/shader/shaders.txt
@@ -77,12 +77,12 @@ img_22_bgra_nomul_afill:tex,sam22,bgra,nomul,afill
77 77
78 78
79# RGB+A. We can add more! 79# RGB+A. We can add more!
80rgb_a_pair:texa 80rgb_a_pair:tex,texa
81rgb_a_pair_mask:texa,mask 81rgb_a_pair_mask:tex,texa,mask
82rgb_a_pair_nomul:texa,nomul 82rgb_a_pair_nomul:tex,texa,nomul
83rgb_a_pair_mask_nomul:texa,mask,nomul 83rgb_a_pair_mask_nomul:tex,texa,mask,nomul
84#rgb_a_pair_afill:texa,afill 84#rgb_a_pair_afill:tex,texa,afill
85#rgb_a_pair_nomul_afill:texa,nomul,afill 85#rgb_a_pair_nomul_afill:tex,texa,nomul,afill
86 86
87 87
88 88