From: Sunghyun Kim Date: Fri, 4 Sep 2020 07:14:04 +0000 (+0900) Subject: Change the precision of size and uSize from mediumP to highP X-Git-Tag: dali_1.9.31~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F43%2F243243%2F5;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git Change the precision of size and uSize from mediumP to highP When I checked the value of uSize and size set in the application, the multiplication of these values could result in INF number if shader uses mediump (fp16). To avoid this problem, i change the precision of size and uSize from mediumP to highP Change-Id: Iaa3e6f4427cfbf82a2ca59f0c5628f746ebdbb80 --- diff --git a/dali-toolkit/internal/controls/video-view/video-view-impl.cpp b/dali-toolkit/internal/controls/video-view/video-view-impl.cpp index 463a214..523fcf0 100644 --- a/dali-toolkit/internal/controls/video-view/video-view-impl.cpp +++ b/dali-toolkit/internal/controls/video-view/video-view-impl.cpp @@ -88,7 +88,7 @@ const char* const CUSTOM_SAMPLER_TYPE_NAME( "samplerExternalOES" ); const char* VERTEX_SHADER = DALI_COMPOSE_SHADER( attribute mediump vec2 aPosition;\n uniform highp mat4 uMvpMatrix;\n - uniform mediump vec3 uSize;\n + uniform highp vec3 uSize;\n \n void main()\n {\n @@ -110,7 +110,7 @@ const char* VERTEX_SHADER_TEXTURE = DALI_COMPOSE_SHADER( attribute mediump vec2 aPosition;\n varying mediump vec2 vTexCoord;\n uniform highp mat4 uMvpMatrix;\n - uniform mediump vec3 uSize;\n + uniform highp vec3 uSize;\n varying mediump vec2 sTexCoordRect;\n void main()\n {\n diff --git a/dali-toolkit/internal/text/text-scroller.cpp b/dali-toolkit/internal/text/text-scroller.cpp index 6d0930b..b2c1b19 100755 --- a/dali-toolkit/internal/text/text-scroller.cpp +++ b/dali-toolkit/internal/text/text-scroller.cpp @@ -42,7 +42,7 @@ const int MINIMUM_SCROLL_SPEED = 1; // Speed should be set by Property system. const char* VERTEX_SHADER_SCROLL = DALI_COMPOSE_SHADER( attribute mediump vec2 aPosition;\n varying highp vec2 vTexCoord;\n - uniform mediump vec3 uSize;\n + uniform highp vec3 uSize;\n uniform mediump float uDelta;\n uniform mediump vec2 uTextureSize;\n uniform mediump float uGap;\n @@ -53,7 +53,7 @@ const char* VERTEX_SHADER_SCROLL = DALI_COMPOSE_SHADER( \n //Visual size and offset uniform mediump vec2 offset;\n - uniform mediump vec2 size;\n + uniform highp vec2 size;\n uniform mediump vec4 offsetSizeMode;\n uniform mediump vec2 origin;\n uniform mediump vec2 anchorPoint;\n diff --git a/dali-toolkit/internal/visuals/animated-gradient/animated-gradient-visual.cpp b/dali-toolkit/internal/visuals/animated-gradient/animated-gradient-visual.cpp index 0a045f0..05d1724 100755 --- a/dali-toolkit/internal/visuals/animated-gradient/animated-gradient-visual.cpp +++ b/dali-toolkit/internal/visuals/animated-gradient/animated-gradient-visual.cpp @@ -96,7 +96,7 @@ const Toolkit::DevelAnimatedGradientVisual::AnimationParameter::EasingType::Type const char* const BASIC_VERTEX_SHADER = DALI_COMPOSE_SHADER( attribute mediump vec2 aPosition; uniform highp mat4 uMvpMatrix; - uniform mediump vec3 uSize; + uniform highp vec3 uSize; uniform mediump vec2 start_point; uniform mediump vec2 end_point; @@ -118,7 +118,7 @@ const char* const BASIC_VERTEX_SHADER = DALI_COMPOSE_SHADER( //Visual size and offset uniform mediump vec2 offset; - uniform mediump vec2 size; + uniform highp vec2 size; uniform mediump vec4 offsetSizeMode; uniform mediump vec2 origin; uniform mediump vec2 anchorPoint; diff --git a/dali-toolkit/internal/visuals/border/border-visual.cpp b/dali-toolkit/internal/visuals/border/border-visual.cpp index 47667fc..03412bf 100644 --- a/dali-toolkit/internal/visuals/border/border-visual.cpp +++ b/dali-toolkit/internal/visuals/border/border-visual.cpp @@ -49,13 +49,13 @@ const char* VERTEX_SHADER = DALI_COMPOSE_SHADER( attribute mediump vec2 aPosition;\n attribute mediump vec2 aDrift;\n uniform highp mat4 uMvpMatrix;\n - uniform mediump vec3 uSize;\n + uniform highp vec3 uSize;\n uniform mediump float borderSize;\n \n //Visual size and offset uniform mediump vec2 offset;\n - uniform mediump vec2 size;\n + uniform highp vec2 size;\n uniform mediump vec4 offsetSizeMode;\n uniform mediump vec2 origin;\n uniform mediump vec2 anchorPoint;\n @@ -89,7 +89,7 @@ const char* VERTEX_SHADER_ANTI_ALIASING = DALI_COMPOSE_SHADER( attribute mediump vec2 aPosition;\n attribute mediump vec2 aDrift;\n uniform highp mat4 uMvpMatrix;\n - uniform mediump vec3 uSize;\n + uniform highp vec3 uSize;\n uniform mediump float borderSize;\n varying mediump float vAlpha;\n \n diff --git a/dali-toolkit/internal/visuals/color/color-visual.cpp b/dali-toolkit/internal/visuals/color/color-visual.cpp index dce5255..63d02ec 100644 --- a/dali-toolkit/internal/visuals/color/color-visual.cpp +++ b/dali-toolkit/internal/visuals/color/color-visual.cpp @@ -46,12 +46,12 @@ namespace const char* VERTEX_SHADER = DALI_COMPOSE_SHADER( attribute mediump vec2 aPosition;\n uniform highp mat4 uMvpMatrix;\n - uniform mediump vec3 uSize;\n + uniform highp vec3 uSize;\n \n //Visual size and offset uniform mediump vec2 offset;\n - uniform mediump vec2 size;\n + uniform highp vec2 size;\n uniform mediump vec4 offsetSizeMode;\n uniform mediump vec2 origin;\n uniform mediump vec2 anchorPoint;\n @@ -83,14 +83,14 @@ const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER( const char* VERTEX_SHADER_ROUNDED_CORNER = DALI_COMPOSE_SHADER( attribute mediump vec2 aPosition;\n uniform highp mat4 uMvpMatrix;\n - uniform mediump vec3 uSize;\n + uniform highp vec3 uSize;\n varying mediump vec2 vPosition;\n varying mediump vec2 vRectSize;\n varying mediump float vCornerRadius;\n \n //Visual size and offset uniform mediump vec2 offset;\n - uniform mediump vec2 size;\n + uniform highp vec2 size;\n uniform mediump vec2 extraSize;\n uniform mediump vec4 offsetSizeMode;\n uniform mediump vec2 origin;\n @@ -135,13 +135,13 @@ const char* FRAGMENT_SHADER_ROUNDED_CORNER = DALI_COMPOSE_SHADER( const char* VERTEX_SHADER_BLUR_EDGE = DALI_COMPOSE_SHADER( attribute mediump vec2 aPosition;\n uniform highp mat4 uMvpMatrix;\n - uniform mediump vec3 uSize;\n + uniform highp vec3 uSize;\n varying mediump vec2 vPosition;\n varying mediump vec2 vRectSize;\n \n //Visual size and offset uniform mediump vec2 offset;\n - uniform mediump vec2 size;\n + uniform highp vec2 size;\n uniform mediump vec2 extraSize;\n uniform mediump vec4 offsetSizeMode;\n uniform mediump vec2 origin;\n diff --git a/dali-toolkit/internal/visuals/gradient/gradient-visual.cpp b/dali-toolkit/internal/visuals/gradient/gradient-visual.cpp index d5af5a4..7a3af39 100644 --- a/dali-toolkit/internal/visuals/gradient/gradient-visual.cpp +++ b/dali-toolkit/internal/visuals/gradient/gradient-visual.cpp @@ -88,14 +88,14 @@ const char* VERTEX_SHADER[] = DALI_COMPOSE_SHADER( attribute mediump vec2 aPosition;\n uniform highp mat4 uMvpMatrix;\n - uniform mediump vec3 uSize;\n + uniform highp vec3 uSize;\n uniform mediump mat3 uAlignmentMatrix;\n varying mediump vec2 vTexCoord;\n \n //Visual size and offset uniform mediump vec2 offset;\n - uniform mediump vec2 size;\n + uniform highp vec2 size;\n uniform mediump vec4 offsetSizeMode;\n uniform mediump vec2 origin;\n uniform mediump vec2 anchorPoint;\n @@ -120,14 +120,14 @@ DALI_COMPOSE_SHADER( DALI_COMPOSE_SHADER( attribute mediump vec2 aPosition;\n uniform highp mat4 uMvpMatrix;\n - uniform mediump vec3 uSize;\n + uniform highp vec3 uSize;\n uniform mediump mat3 uAlignmentMatrix;\n varying mediump vec2 vTexCoord;\n \n //Visual size and offset uniform mediump vec2 offset;\n - uniform mediump vec2 size;\n + uniform highp vec2 size;\n uniform mediump vec4 offsetSizeMode;\n uniform mediump vec2 origin;\n uniform mediump vec2 anchorPoint;\n @@ -153,7 +153,7 @@ DALI_COMPOSE_SHADER( DALI_COMPOSE_SHADER( attribute mediump vec2 aPosition;\n uniform highp mat4 uMvpMatrix;\n - uniform mediump vec3 uSize;\n + uniform highp vec3 uSize;\n uniform mediump mat3 uAlignmentMatrix;\n varying mediump vec2 vTexCoord;\n varying mediump vec2 vPosition;\n @@ -162,7 +162,7 @@ DALI_COMPOSE_SHADER( \n //Visual size and offset uniform mediump vec2 offset;\n - uniform mediump vec2 size;\n + uniform highp vec2 size;\n uniform mediump vec4 offsetSizeMode;\n uniform mediump vec2 origin;\n uniform mediump vec2 anchorPoint;\n @@ -194,7 +194,7 @@ DALI_COMPOSE_SHADER( DALI_COMPOSE_SHADER( attribute mediump vec2 aPosition;\n uniform highp mat4 uMvpMatrix;\n - uniform mediump vec3 uSize;\n + uniform highp vec3 uSize;\n uniform mediump mat3 uAlignmentMatrix;\n varying mediump vec2 vTexCoord;\n varying mediump vec2 vPosition;\n @@ -203,7 +203,7 @@ DALI_COMPOSE_SHADER( \n //Visual size and offset uniform mediump vec2 offset;\n - uniform mediump vec2 size;\n + uniform highp vec2 size;\n uniform mediump vec4 offsetSizeMode;\n uniform mediump vec2 origin;\n uniform mediump vec2 anchorPoint;\n diff --git a/dali-toolkit/internal/visuals/image-visual-shader-factory.cpp b/dali-toolkit/internal/visuals/image-visual-shader-factory.cpp index beb4f09..45d0e3f 100644 --- a/dali-toolkit/internal/visuals/image-visual-shader-factory.cpp +++ b/dali-toolkit/internal/visuals/image-visual-shader-factory.cpp @@ -39,13 +39,13 @@ const Vector4 FULL_TEXTURE_RECT(0.f, 0.f, 1.f, 1.f); const char* VERTEX_SHADER = DALI_COMPOSE_SHADER( attribute mediump vec2 aPosition;\n uniform highp mat4 uMvpMatrix;\n - uniform mediump vec3 uSize;\n + uniform highp vec3 uSize;\n uniform mediump vec4 pixelArea; varying mediump vec2 vTexCoord;\n \n //Visual size and offset uniform mediump vec2 offset;\n - uniform mediump vec2 size;\n + uniform highp vec2 size;\n uniform mediump vec4 offsetSizeMode;\n uniform mediump vec2 origin;\n uniform mediump vec2 anchorPoint;\n diff --git a/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp b/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp index b954c8c..bd374aa 100644 --- a/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp +++ b/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp @@ -51,14 +51,14 @@ const char* VERTEX_SHADER = DALI_COMPOSE_SHADER( varying mediump vec2 vTexCoord;\n varying mediump vec2 vMaskTexCoord;\n uniform highp mat4 uMvpMatrix;\n - uniform mediump vec3 uSize;\n + uniform highp vec3 uSize;\n uniform mediump vec2 uNinePatchFactorsX[ FACTOR_SIZE_X ];\n uniform mediump vec2 uNinePatchFactorsY[ FACTOR_SIZE_Y ];\n \n // Visual size and offset uniform mediump vec2 offset;\n - uniform mediump vec2 size;\n + uniform highp vec2 size;\n uniform mediump vec4 offsetSizeMode;\n uniform mediump vec2 origin;\n uniform mediump vec2 anchorPoint;\n @@ -93,13 +93,13 @@ const char* VERTEX_SHADER_3X3 = DALI_COMPOSE_SHADER( varying mediump vec2 vTexCoord;\n varying mediump vec2 vMaskTexCoord;\n uniform highp mat4 uMvpMatrix;\n - uniform mediump vec3 uSize;\n + uniform highp vec3 uSize;\n uniform mediump vec2 uFixed[ 3 ];\n uniform mediump vec2 uStretchTotal;\n \n //Visual size and offset uniform mediump vec2 offset;\n - uniform mediump vec2 size;\n + uniform highp vec2 size;\n uniform mediump vec4 offsetSizeMode;\n uniform mediump vec2 origin;\n uniform mediump vec2 anchorPoint;\n diff --git a/dali-toolkit/internal/visuals/text/text-visual.cpp b/dali-toolkit/internal/visuals/text/text-visual.cpp index 1d75634..e9a32f6 100755 --- a/dali-toolkit/internal/visuals/text/text-visual.cpp +++ b/dali-toolkit/internal/visuals/text/text-visual.cpp @@ -58,14 +58,14 @@ const Vector4 FULL_TEXTURE_RECT( 0.f, 0.f, 1.f, 1.f ); const char* VERTEX_SHADER = DALI_COMPOSE_SHADER( attribute mediump vec2 aPosition;\n uniform highp mat4 uMvpMatrix;\n - uniform mediump vec3 uSize;\n + uniform highp vec3 uSize;\n uniform mediump vec4 pixelArea;\n varying mediump vec2 vTexCoord;\n //Visual size and offset uniform mediump vec2 offset;\n - uniform mediump vec2 size;\n + uniform highp vec2 size;\n uniform mediump vec4 offsetSizeMode;\n uniform mediump vec2 origin;\n uniform mediump vec2 anchorPoint;\n diff --git a/dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp b/dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp index ba3b651..3707465 100644 --- a/dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp +++ b/dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp @@ -43,12 +43,12 @@ const char * const INDEX_NAME("indices"); const char* VERTEX_SHADER = DALI_COMPOSE_SHADER( attribute mediump vec2 aPosition;\n uniform highp mat4 uMvpMatrix;\n -uniform mediump vec3 uSize;\n +uniform highp vec3 uSize;\n \n //Visual size and offset uniform mediump vec2 offset;\n -uniform mediump vec2 size;\n +uniform highp vec2 size;\n uniform mediump vec4 offsetSizeMode;\n uniform mediump vec2 origin;\n uniform mediump vec2 anchorPoint;\n