[Tizen][ROBOT-hotfix] Remove return; statement at fragment shader tizen_6.5_robot_hotfix_1122
authorEunki, Hong <eunkiki.hong@samsung.com>
Mon, 22 Nov 2021 10:52:09 +0000 (19:52 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Mon, 22 Nov 2021 10:52:09 +0000 (19:52 +0900)
Some graphic driver doesn't support return statement at fragment shader's main.
THis patch just avoid that case with same logic

Change-Id: I6028836e03f01f0bc2f56e4a6f37f10f925ab5f3
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali-toolkit/internal/graphics/shaders/color-visual-shader.frag
dali-toolkit/internal/graphics/shaders/gradient-visual-shader.frag
dali-toolkit/internal/graphics/shaders/image-visual-shader.frag

index cf1eb08..40a5599 100644 (file)
@@ -251,21 +251,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
 }
index 78f8f22..90b93e3 100644 (file)
@@ -188,18 +188,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
 }
index 676c02b..597d861 100644 (file)
@@ -213,19 +213,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
 }