博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
OpenGL ES Shading Language中应尽量避免使用循环
阅读量:7137 次
发布时间:2019-06-28

本文共 1226 字,大约阅读时间需要 4 分钟。

 

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

转载于:https://www.cnblogs.com/time-is-life/p/7597246.html

你可能感兴趣的文章
META-INF\MANIFEST.MF (系统找不到指定的路径)
查看>>
俄罗斯方块软件:C语言应用初步感受
查看>>
【安全牛学习笔记】收集敏感数据、隐藏痕迹
查看>>
LinkedME|Deep Linking技术你真的了解吗
查看>>
Memcached,redis监控详解
查看>>
Linux-13软件安装
查看>>
MySQL 基本语句
查看>>
CentOS7.4——构建iscsi网络存储
查看>>
DEDECMS 全站关键字自动添加链接的方法
查看>>
Linux入门及企业服务器知识学习笔记
查看>>
Let’sEncrypt证书申请
查看>>
硬盘分区、寻址和系统启动过程
查看>>
C#.NET 大型通用信息化系统集成快速开发平台 4.1 版本 - 发送通知功能改进改进...
查看>>
写了C# ASP.NET WebService的XML解析网站接口程序收了200元辛苦费【加入软件项目源码交易群的好处】...
查看>>
机械硬盘磁盘结构损坏且无法读取文件如何找到
查看>>
linux入门级知识大全
查看>>
linux笔记(历史,含义,以及安装centos7)
查看>>
Linux关机提示"A stop job is running for ..."
查看>>
文件上传限制绕过技巧
查看>>
二、免费KVM_Input Director帮你用一套键盘鼠标操作多台电脑
查看>>