From 08ee7d4b8c708eac2f94e2792df69867d47f0a32 Mon Sep 17 00:00:00 2001 From: Oleksandr Shcherbina Date: Thu, 24 Sep 2015 20:28:53 +0900 Subject: [PATCH] evas_canvas3d:Broken source file for generation 3D shaders Summary: Bug reproduce if delete evas_gl_3d_shaders.x and try re-build. Source file include.shd for generation shader code consist m4 macro definitions. After this revision https://phab.enlightenment.org/D3056 order of the quatation marks in function pcf was broken. @fix Reviewers: cedric, Hermet Reviewed By: Hermet Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3085 --- .../gl_common/shader_3d/evas_gl_3d_shaders.x | 42 +++++++++++-------- .../engines/gl_common/shader_3d/include.shd | 8 ++-- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/src/modules/evas/engines/gl_common/shader_3d/evas_gl_3d_shaders.x b/src/modules/evas/engines/gl_common/shader_3d/evas_gl_3d_shaders.x index 0284011c4f..b6dbb5ab2d 100644 --- a/src/modules/evas/engines/gl_common/shader_3d/evas_gl_3d_shaders.x +++ b/src/modules/evas/engines/gl_common/shader_3d/evas_gl_3d_shaders.x @@ -3,7 +3,7 @@ static const char vertex_color_vert_glsl[] = "#ifdef GL_ES\n" - "precision highp float;\n" + "precision mediump float;\n" "precision mediump int;\n" "precision lowp sampler2D;\n" "#endif\n" @@ -46,7 +46,7 @@ static const char vertex_color_vert_glsl[] = static const char vertex_color_frag_glsl[] = "#ifdef GL_ES\n" - "precision highp float;\n" + "precision mediump float;\n" "precision mediump int;\n" "precision lowp sampler2D;\n" "#endif\n" @@ -116,7 +116,7 @@ static const char vertex_color_frag_glsl[] = static const char diffuse_vert_glsl[] = "#ifdef GL_ES\n" - "precision highp float;\n" + "precision mediump float;\n" "precision mediump int;\n" "precision lowp sampler2D;\n" "#endif\n" @@ -160,7 +160,7 @@ static const char diffuse_vert_glsl[] = static const char diffuse_frag_glsl[] = "#ifdef GL_ES\n" - "precision highp float;\n" + "precision mediump float;\n" "precision mediump int;\n" "precision lowp sampler2D;\n" "#endif\n" @@ -261,7 +261,7 @@ static const char diffuse_frag_glsl[] = static const char flat_vert_glsl[] = "#ifdef GL_ES\n" - "precision highp float;\n" + "precision mediump float;\n" "precision mediump int;\n" "precision lowp sampler2D;\n" "#endif\n" @@ -386,7 +386,7 @@ static const char flat_vert_glsl[] = static const char flat_frag_glsl[] = "#ifdef GL_ES\n" - "precision highp float;\n" + "precision mediump float;\n" "precision mediump int;\n" "precision lowp sampler2D;\n" "#endif\n" @@ -403,7 +403,9 @@ static const char flat_frag_glsl[] = "uniform sampler2D uShadowMap;\n" "uniform float uShadowsPCFStep;\n" "uniform float uShadowsPCFSize;\n" + "#ifdef GL_ES\n" "uniform float uShadowsConstantBias;\n" + "#endif //GL_ES\n" "float shadow;\n" "float pcf(vec4 lpos)\n" "{\n" @@ -632,7 +634,7 @@ static const char flat_frag_glsl[] = static const char phong_vert_glsl[] = "#ifdef GL_ES\n" - "precision highp float;\n" + "precision mediump float;\n" "precision mediump int;\n" "precision lowp sampler2D;\n" "#endif\n" @@ -725,7 +727,7 @@ static const char phong_vert_glsl[] = static const char phong_frag_glsl[] = "#ifdef GL_ES\n" - "precision highp float;\n" + "precision mediump float;\n" "precision mediump int;\n" "precision lowp sampler2D;\n" "#endif\n" @@ -744,7 +746,9 @@ static const char phong_frag_glsl[] = "uniform sampler2D uShadowMap;\n" "uniform float uShadowsPCFStep;\n" "uniform float uShadowsPCFSize;\n" + "#ifdef GL_ES\n" "uniform float uShadowsConstantBias;\n" + "#endif //GL_ES\n" "float shadow;\n" "float pcf(vec4 lpos)\n" "{\n" @@ -1009,7 +1013,7 @@ static const char phong_frag_glsl[] = static const char normal_map_vert_glsl[] = "#ifdef GL_ES\n" - "precision highp float;\n" + "precision mediump float;\n" "precision mediump int;\n" "precision lowp sampler2D;\n" "#endif\n" @@ -1159,7 +1163,7 @@ static const char normal_map_vert_glsl[] = static const char normal_map_frag_glsl[] = "#ifdef GL_ES\n" - "precision highp float;\n" + "precision mediump float;\n" "precision mediump int;\n" "precision lowp sampler2D;\n" "#endif\n" @@ -1178,7 +1182,9 @@ static const char normal_map_frag_glsl[] = "uniform sampler2D uShadowMap;\n" "uniform float uShadowsPCFStep;\n" "uniform float uShadowsPCFSize;\n" + "#ifdef GL_ES\n" "uniform float uShadowsConstantBias;\n" + "#endif //GL_ES\n" "float shadow;\n" "float pcf(vec4 lpos)\n" "{\n" @@ -1486,7 +1492,7 @@ static const char normal_map_frag_glsl[] = static const char shadow_map_vert_glsl[] = "#ifdef GL_ES\n" - "precision highp float;\n" + "precision mediump float;\n" "precision mediump int;\n" "precision lowp sampler2D;\n" "#endif\n" @@ -1522,7 +1528,7 @@ static const char shadow_map_vert_glsl[] = "#endif // VERTEX_POSITION\n" "#endif //VERTEX_POSITION_BLEND\n" "#ifdef ALPHA_TEST_ENABLED\n" - "#ifdef VERTEX_TEXCOORD_BLEND\n" + " #ifdef VERTEX_TEXCOORD_BLEND\n" " vTexCoord = mix(aTexCoord1.st, aTexCoord0.st, uTexCoordWeight);\n" "#else\n" "#ifdef VERTEX_TEXCOORD\n" @@ -1536,7 +1542,7 @@ static const char shadow_map_vert_glsl[] = static const char shadow_map_frag_glsl[] = "#ifdef GL_ES\n" - "precision highp float;\n" + "precision mediump float;\n" "precision mediump int;\n" "precision lowp sampler2D;\n" "#endif\n" @@ -1639,7 +1645,7 @@ static const char shadow_map_frag_glsl[] = static const char color_pick_vert_glsl[] = "#ifdef GL_ES\n" - "precision highp float;\n" + "precision mediump float;\n" "precision mediump int;\n" "precision lowp sampler2D;\n" "#endif\n" @@ -1666,7 +1672,7 @@ static const char color_pick_vert_glsl[] = static const char color_pick_frag_glsl[] = "#ifdef GL_ES\n" - "precision highp float;\n" + "precision mediump float;\n" "precision mediump int;\n" "precision lowp sampler2D;\n" "#endif\n" @@ -1735,7 +1741,7 @@ static const char color_pick_frag_glsl[] = static const char parallax_occlusion_vert_glsl[] = "#ifdef GL_ES\n" - "precision highp float;\n" + "precision mediump float;\n" "precision mediump int;\n" "precision lowp sampler2D;\n" "#endif\n" @@ -1855,7 +1861,7 @@ static const char parallax_occlusion_vert_glsl[] = static const char parallax_occlusion_frag_glsl[] = "#ifdef GL_ES\n" - "precision highp float;\n" + "precision mediump float;\n" "precision mediump int;\n" "precision lowp sampler2D;\n" "#endif\n" @@ -1885,7 +1891,9 @@ static const char parallax_occlusion_frag_glsl[] = "uniform sampler2D uShadowMap;\n" "uniform float uShadowsPCFStep;\n" "uniform float uShadowsPCFSize;\n" + "#ifdef GL_ES\n" "uniform float uShadowsConstantBias;\n" + "#endif //GL_ES\n" "float shadow;\n" "float pcf(vec4 lpos)\n" "{\n" diff --git a/src/modules/evas/engines/gl_common/shader_3d/include.shd b/src/modules/evas/engines/gl_common/shader_3d/include.shd index fd6be4d972..28a99556a9 100644 --- a/src/modules/evas/engines/gl_common/shader_3d/include.shd +++ b/src/modules/evas/engines/gl_common/shader_3d/include.shd @@ -44,7 +44,7 @@ uniform float uShadowsPCFStep; uniform float uShadowsPCFSize; #ifdef GL_ES uniform float uShadowsConstantBias; -#endif //GL_ES' +#endif //GL_ES float shadow; float pcf(vec4 lpos) { @@ -53,11 +53,11 @@ float pcf(vec4 lpos) q = floor(uShadowsPCFStep * 2.0); c = floor(uShadowsPCFStep * uShadowsPCFStep * 4.0); shadow = 0.0; -`#ifndef GL_ES' +#ifndef GL_ES for (i = -uShadowsPCFStep; i < uShadowsPCFStep; i += 1.0) for (j = -uShadowsPCFStep; j < uShadowsPCFStep; j += 1.0) shadow += float(smcoord.z <= texture2D(uShadowMap, smcoord.xy + vec2(i / q, j / q) * uShadowsPCFSize).x); -`#else' +#else const vec4 unpack = vec4(1.0 / (256.0 * 256.0 * 256.0), 1.0 / (256.0 * 256.0), 1.0 / 256.0, 1.0); for (i = -uShadowsPCFStep; i < uShadowsPCFStep; i += 1.0) for (j = -uShadowsPCFStep; j < uShadowsPCFStep; j += 1.0) @@ -65,7 +65,7 @@ float pcf(vec4 lpos) vec4 zvalue = texture2D(uShadowMap, smcoord.xy + vec2(i / q, j / q) * uShadowsPCFSize); shadow += float(smcoord.z < dot(zvalue, unpack) + uShadowsConstantBias); } -`#endif //GL_ES' +#endif //GL_ES return shadow / c; } #endif //SHADOWED')