GLES2.0:

Some device will give a warning on compling shaders(yet the compling will succeed), and the rendering result is incorrect with blink & artifacts.

the problems is gradient calculation(interpolation) relies on the neighbor pixels,

if the neighbor pixels are not in the same conditional branch,  the gradient will be invalid and result may be undifed.

I guess it is an un-defined behavior, so some devices/drivers works good, some don't.

 //like this
if( test )
color = texture2D(sampler,UV);
else
color = vec4(,,,);

One workaround is use mix() or step() instead of conditional test.

 color = mix(vec4(,,,), texture2D(...), testVal);

When using conditional branch, the texture sampling may be not actually executed, which will increase graphics performance.

One draw back on using mix/step is that the sampling is always performed, then interpolated/multiplied.


udpate:

Actually to many conditonal test & branch blocks(even without texture sampling in it) in fragment shader will case rendering halt, no response, and even system restart.

this result is based on testing on Galaxy S4 (PowerVR SGX544), compared to testing on iPad Air(PowerVR G6430, no such problems).

maybe it's only a driver issue, since both graphics chips are PowerVR family.

WARNING: Calls to any function that may require a gradient calculation inside a conditional block may return undefined results的更多相关文章

  1. linux系统下,警告:warning: implicit declaration of function ‘gets’ [-Wimplicit-function-declaration] 和 warning: the `gets' function is dangerous and should not be used. 的由来和解决方法。

    字符数组 的英文名字是 char [] gets()函数的基本用法为:char *gets(char *s); 该函数的参数是一个字符数组,该函数的返回值也是一个字符数组. linux下的代码如下: ...

  2. vs的【warning C4996:'fopen': This function or variable may be unsafe】解决方案

    编译警告:warning C4996 与 Security Enhancements in the CRT 将过去的工程用VS2005打开的时候.你有可能会遇到一大堆的警告:warning C4996 ...

  3. warning: control reaches end of non-void function 和 warning: implicit declaration of function 'rsgClearColor' is invalid in C99

    用gcc编译一个程序的时候出现这样的警告: warning: control reaches end of non-void function 它的意思是:控制到达非void函数的结尾.就是说你的一些 ...

  4. warning C4996: 'fopen': This function or variable may be unsafe.(_CRT_SECURE_NO_WARNINGS)

    在 windows 平台下的 visual studio IDE,使用 fopen 等 CRT 函数(C runtime library(part of the C standard library) ...

  5. “warning C4996: 'fopen': This function or variable may be unsafe”和“LINK : fatal error LNK1104”的解决办法

    程序有时编译出现警告C4996,报错:  warning C4996: 'fopen': This function or variable may be unsafe. Consider using ...

  6. warning: implicit declaration of function 'getMyfilename' [-Wimplicit-function-declaration]|

    我在main后面定义了getMyfilename()函数,然后就报出这个warning. 在main前声明一下就好了.

  7. warning C4996: 'sprintf': This function or variable may be unsafe

    选项Project   |   Configuration   Properties   |   C/C++   |   Preprocessor   |   Preprocessor   Defin ...

  8. warning C4996: 'strcpy': This function or variable may be unsafe.

    mkdir 写成  _mkdir strcpy 写成为 strcpy_s 或是在项目处右击-->属性-->C/C++-->预处理器-->在预处理器定义后添加";_CR ...

  9. Unresolved function or method require()

    1. 这是在JavaScript配置中没有node.js,去设置中配置就行了,方法如下: setting -> Languages&Frameworks -> Javascript ...

随机推荐

  1. 安装elasticsearch

    安装elasticsearch   来自:http://www.cnblogs.com/huangfox/p/3541300.html 一)安装elasticsearch 1)下载elasticsea ...

  2. 禁止 PC端打开网页 进行跳转

    try {var urlhash = window.location.hash;if (!urlhash.match("fromapp")){if ((navigator.user ...

  3. 一月份实现Adb小程序

    As Brian said: According to a post on xda-developers, you can enable ADB over WiFi from the device w ...

  4. Delphi中nil和null的区别

    nil:空指针,空地址,对象也是指针,可以object := nil;null:是一个未定义值的变量,既不是0也不代表空字符串,它是未定义的.

  5. JS实现浏览器的title闪烁

    经常可以看见的title里面的消息提示,下面是JS的一种实现方法:主要是通过setTimeout方法设置一个定时器,切换消息提示,从而达title到消息提示的闪烁. <html> < ...

  6. wpf做的可扩展记事本

    记得有个winform利用反射做的可扩展笔记本,闲来无事,便用wpf也搞了个可扩展记事本,可用接口动态扩展功能,较简单,以便参考: 目录结构如下: MainWindow.xaml为主功能界面,Func ...

  7. R语言将数据框转成xts

    R语言初学者,不怎么会,今天碰到的问题,查了好久才找到,原来如此简单 尼玛,下次再忘记抽自己3巴掌

  8. MAC 重置MySQL root 密码

    重置MySQL root 密码:当忘记密码,或者想要强行重置 MySQL 密码的时候,可以像下面这样: 1.停止 MySQL 服务 sudo /usr/local/mysql/support-file ...

  9. Mybatis动态SQL

    1.动态SQL基本标签 •if •choose (when, otherwise) •trim (where, set) •foreach 2.IF 具体用法 <select id=" ...

  10. 023使用typeof关键字获取类内部结构

    private void button1_Click(object sender, EventArgs e) { Focus(); string a=txtType.Text; // Type typ ...