简体   繁体   English

GLSL“ for”指令的性能

[英]performance on GLSL “for” instruction

Hi I'm doing fractal work using GLSL, and I need to use the "for" instruction. 嗨,我正在使用GLSL进行分形工作,我需要使用“ for”指令。 Is is better (performance-wise) to do a for instruction n times, or to redirect the ouput of the shader on a FBO, and apply the shader n times on a FBO? 在指令上执行n次,或者将着色器的输出重定向到FBO上,然后在FBO上应用n次,是否更好(在性能方面)? Thanks :) 谢谢 :)

Applying a shader n times will definitively be more expensive. 一次应用着色器肯定会更昂贵。 It will not only be more expensive due to the actual shader, but also due to texture fetch and ROP. 由于实际的着色器,它不仅会更昂贵,而且由于纹理获取和ROP会更昂贵。 Plus, rebinding buffers and synchronization. 另外,重新绑定缓冲区和同步。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM