From 843548a39509ddc861eb08884fb35b99044d229a Mon Sep 17 00:00:00 2001 From: "Eunki, Hong" Date: Mon, 22 Nov 2021 18:09:18 +0900 Subject: [PATCH] [Tizen] Remove return; statement at fragment shader Some graphic driver doesn't support return statement at fragment shader's main. This patch just avoid that case with same logic Change-Id: I54ea6c9a880c8a8e64bc1128cc94856210face06 Signed-off-by: Eunki, Hong --- .../graphics/shaders/color-visual-shader.frag | 21 +++++++++++++-------- .../graphics/shaders/gradient-visual-shader.frag | 17 +++++++++++------ .../graphics/shaders/image-visual-shader.frag | 19 ++++++++++++------- 3 files changed, 36 insertions(+), 21 deletions(-) diff --git a/dali-toolkit/internal/graphics/shaders/color-visual-shader.frag b/dali-toolkit/internal/graphics/shaders/color-visual-shader.frag index 3e3d19d..33202a2 100644 --- a/dali-toolkit/internal/graphics/shaders/color-visual-shader.frag +++ b/dali-toolkit/internal/graphics/shaders/color-visual-shader.frag @@ -273,21 +273,26 @@ void main() if(abs(vPosition.x) < vOptRectSize.x && abs(vPosition.y) < vOptRectSize.y) { OUT_COLOR = targetColor; - return; } - PreprocessPotential(); + else + { + PreprocessPotential(); #endif #if !IS_REQUIRED_BLUR && IS_REQUIRED_BORDERLINE - targetColor = convertBorderlineColor(targetColor); + targetColor = convertBorderlineColor(targetColor); #endif - OUT_COLOR = targetColor; + OUT_COLOR = targetColor; #if IS_REQUIRED_BLUR - mediump float opacity = calculateBlurOpacity(); - OUT_COLOR.a *= opacity; + mediump float opacity = calculateBlurOpacity(); + OUT_COLOR.a *= opacity; #elif IS_REQUIRED_ROUNDED_CORNER - mediump float opacity = calculateCornerOpacity(); - OUT_COLOR.a *= opacity; + mediump float opacity = calculateCornerOpacity(); + OUT_COLOR.a *= opacity; +#endif + +#if IS_REQUIRED_BLUR || IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE + } #endif } diff --git a/dali-toolkit/internal/graphics/shaders/gradient-visual-shader.frag b/dali-toolkit/internal/graphics/shaders/gradient-visual-shader.frag index 80090f8..a30bf5e 100644 --- a/dali-toolkit/internal/graphics/shaders/gradient-visual-shader.frag +++ b/dali-toolkit/internal/graphics/shaders/gradient-visual-shader.frag @@ -207,18 +207,23 @@ void main() if(abs(vPosition.x) < vOptRectSize.x && abs(vPosition.y) < vOptRectSize.y) { OUT_COLOR = textureColor; - return; } - PreprocessPotential(); + else + { + PreprocessPotential(); #endif #if IS_REQUIRED_BORDERLINE - textureColor = convertBorderlineColor(textureColor); + textureColor = convertBorderlineColor(textureColor); #endif - OUT_COLOR = textureColor; + OUT_COLOR = textureColor; #if IS_REQUIRED_ROUNDED_CORNER - mediump float opacity = calculateCornerOpacity(); - OUT_COLOR *= opacity; + mediump float opacity = calculateCornerOpacity(); + OUT_COLOR *= opacity; +#endif + +#if IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE + } #endif } diff --git a/dali-toolkit/internal/graphics/shaders/image-visual-shader.frag b/dali-toolkit/internal/graphics/shaders/image-visual-shader.frag index 37f080f..703c649 100644 --- a/dali-toolkit/internal/graphics/shaders/image-visual-shader.frag +++ b/dali-toolkit/internal/graphics/shaders/image-visual-shader.frag @@ -233,19 +233,24 @@ void main() if(abs(vPosition.x) < vOptRectSize.x && abs(vPosition.y) < vOptRectSize.y) { OUT_COLOR = textureColor; - return; } - PreprocessPotential(); + else + { + PreprocessPotential(); #endif #if IS_REQUIRED_BORDERLINE - textureColor = convertBorderlineColor(textureColor); + textureColor = convertBorderlineColor(textureColor); #endif - OUT_COLOR = textureColor; + OUT_COLOR = textureColor; #if IS_REQUIRED_ROUNDED_CORNER - mediump float opacity = calculateCornerOpacity(); - OUT_COLOR.a *= opacity; - OUT_COLOR.rgb *= mix(1.0, opacity, preMultipliedAlpha); + mediump float opacity = calculateCornerOpacity(); + OUT_COLOR.a *= opacity; + OUT_COLOR.rgb *= mix(1.0, opacity, preMultipliedAlpha); +#endif + +#if IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE + } #endif } -- 2.7.4