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. linux分区和文件系统

    linux分区主分区:最多只能有4个扩展分区:最多只能有一个 主分区+扩展分区最多4个 扩展分区不能写入数据,只能包含逻辑分区 见图示:fq.png 主分区:总共最多只能分4个扩展分区:只能有1个,也 ...

  2. C++十进制转换为二进制

    题目内容:将十进制整数转换成二进制数. 输入描述:输入数据中含有不多于50个的整数n(-231<n<231). 输出描述:对于每个n,以11位的宽度右对齐输入n值,然后输出“-->” ...

  3. 通过Messenger与后台连接(单向操作,activity向service发送数据)

    xml: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:t ...

  4. python 序列的方法

    作者:Vamei 出处:http://www.cnblogs.com/vamei 欢迎转载,也请保留这段声明.谢谢! 在快速教程中,我们了解了最基本的序列(sequence).回忆一下,序列包含有定值 ...

  5. python encode decode unicode区别及用法

    decode 解码 encode 转码 unicode是一种编码,具体可以百度搜 # coding: UTF-8 u = u'汉' print repr(u) # u'\u6c49' s = u.en ...

  6. arcgis中使用excel中x,y坐标创建点问题

    文件——从x,y中添加,可以显示点的位置 右击图层导出数据时,出现无法绘制图形,生成shapefile文件的情况.经过排除数据发现 当x,y坐标值中出现null等异常值时,会出现上述无法导出的情况.

  7. [JAVA][RCP] Eclipse4/RCP/Lifecycle

    E4AP provides two levels of lifecycles, for contributions and for the application. Contents [hide]  ...

  8. android获取手机录

    在Android开发中,读取手机通讯录中的号码是一种基本操作,但是由于Android的版本众多,所以手机通讯录操作的代码比较纷杂,在本文中进行一下总结. Android1.5是现在的Android系统 ...

  9. PHP中使用CURL实现GET和POST请求

    转自:http://www.smsyun.com/home-index-page-id-284.html 一.什么是CURL? cURL 是一个利用URL语法规定来传输文件和数据的工具,支持很多协议, ...

  10. sharepoint 2010 重建遇到的问题

    需要重新安装Sharepoint 2010 ,遇到问题记录下来,sharepoint中安装了热补丁和英文语言包. 卸载: 1.运行配置向导将服务器从服务场中脱离: 2.在管理中心中卸载sharepoi ...