In addition to basic if-then-else statements, it is possible to write for, while, and do-while loops. In OpenGL ES 2.0, very strict rules governed the usage of loops. Essentially, only loops that could be unrolled by the compiler were supported. These restrictions no longer exist in OpenGL ES 3.0. The GPU hardware is expected to provide support for looping and flow control; thus loops are fully supported.

That is not to say that loops don't come with some performance implications. On most GPU architectures, vertices or fragments are executed in parallel in batches. The GPU typically requires that all fragments or vertices in a batch evaluate all branches (or loop iterations) of flow control statements. If vertices or fragments in a batch execute different paths, then, usually all of the other vertices/fragments in a batch will need to execute that path as well. The size of a batch is GPU dependent and will often require profiling to determine the performance implications of the use of flow control on a particular architecture. However, a good rule of thumb is to try to limit the use of divergent flow control or loop iterations across vertices/fragments

最新文章

  1. 聊聊 C 语言中的 sizeof 运算
  2. ThinkInside
  3. mysql设置远程访问权限
  4. 基于 jQuery 实现垂直滑动的手风琴效果
  5. 11 TCP/IP 基础与Linux的网络配置
  6. mysql高可用框架-MHA
  7. Java-transient
  8. 从状态转移看:载波侦听多路访问/冲突避免(CSMA/CA)
  9. 调用数据库过程函数mysql
  10. php每秒输出一次
  11. Windows Socket I/O模型
  12. jquery 延迟执行实例介绍
  13. MySQL两个最简单的delimiter的使用demo
  14. ZigBee技术
  15. Hibernate从入门到了解
  16. Oracle 巡检命令
  17. 第八周助教工作总结——NWNU李泓毅
  18. 从服务器角度分析RPG游戏——NPC的AI
  19. 求最大流dinic算法模板
  20. scrapy-CrawlSpider的rules使用规则

热门文章

  1. LPC43xx MCU PIN Name and GPIO PIN Name Table
  2. RabbitMQ高级指南:从配置、使用到高可用集群搭建
  3. [Winform]js与webbrowser交互
  4. 我所经历的SAP选型[转]
  5. AutoMapper在MVC中的运用05-映射中的忽略、处理null、多种映射转换
  6. HTML5之SVG
  7. c++ #ifdef的用法
  8. mongodb常用查询
  9. ImageView和onTouchListener实现,点击查看图片细节
  10. HTML 5 <script> async 属性简单设置代码异步执行