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. AlertDialog.Builder对话框类的用法

    1.在测试时,如何实现一个提示 可以使用 Toast.makeText(this, "这是一个提示", Toast.LENGTH_SHORT).show(); //从资源文件str ...

  2. ED/EP系列6《扩展应用》

    包括:电子钱包复合应用:电子钱包灰锁应用. 1. 复合应用模式 Ø INITIALIZE FOR CAPP PURCHASE(复合应用消费初始化): Ø UPDATE CAPP DATA CACHE( ...

  3. Percona-Xtrabackup 2.3.3 慢查询不再堵塞备份(一)

    在Percona-Xtrabackup 2.3.3[root@b28-19-17 bak]# rpm -q percona-xtrabackuppercona-xtrabackup-2.3.3-1.e ...

  4. AppCan移动技术全景图:创新、协作、支撑

    开发者是移动互联网宏伟蓝图的最终实现者.如果你有创意.有技术,你可以开发一款服务上亿人的应用.所以,我感觉幸运,没有任何一个时代,能像现在这么好,技术人能够服务这么广大的市场,能够撬动百亿级的市场. ...

  5. Swift弹窗

    在一个ViewController中使用以下代码: let alertController = UIAlertController(title: "Game Set", messa ...

  6. wordpress 为文章内容添加自动过滤,例如为出站链接添加nofollow,也可以将淘宝客链接转换。。

    做seo的都明白,反向链接对与网站的优化有着很重要的作用,是搜索引擎给网站排名的一个重要因素.为了添加反向链接,SEO作弊者会在论坛和博客等大量发布带无关链接的 内容.这些垃圾链接的存在给搜索引擎对网 ...

  7. scjp考试准备 - 1 - 循环控制

    判断如下代码最后的执行结果. public class Breaker{ static String o = ""; public static void main(String[ ...

  8. 两个有用的shell工具总结

    shell工具之一:sed sed基础 sed编辑器被称作流编辑器,与常见的交互式文本编辑器刚好相反.文本编辑器可以通过键盘来交互式地插入.删除.替换文本中的数据:而流编辑器是基于一组预先的规则来编辑 ...

  9. bootstrap bootstrapTable 隐藏列

    主要代码: <script type="text/javascript"> $(function () { LoadingDataListOrderRealItems( ...

  10. PB中掉用Run以后,等Run的程序关闭以后才会执行后边的语句

    OleObject wsh integer li_rc CONSTANT integer MAXIMIZED = CONSTANT integer MINIMIZED = CONSTANT integ ...