本文介绍了进行冗余OpenGL调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否建议消除所有冗余的opengl调用。

I was wondering if it is recommended to eliminate all redundant opengl calls.

例如,我应该做一些类似的东西p>

For instance, should I be doing something like (wrapped in a function):

if(foobuffer != boundbuffer) {
  glBindBuffer(GL_BAR_BUFFER, foobuffer);
  boundbuffer = foobuffer;
}



或者是驱动程序自动执行这样的操作,这实际上是一个冗余的reduntant-检查?

Or is the driver automatically doing such things and this is actually a redundant reduntant-check?

推荐答案

你应该避免。 (特别是22.040,您必须向下滚动页面,因为它没有锚点),注意冗余调用通常是坏的做法,即使一些实现试图最小化影响。

You should probably avoid it. Here (specifically 22.040, you'll have to scroll down the page since there's no anchor for it), it is noted that redundant calls are generally bad practice even though some implementations attempt to minimize the impact.

像这样的工具可用于帮助跟踪您可能在哪里如果你不知道你可能在你的代码库中做了多少,也可以进行冗余调用。

Tools like gDEBugger can be used to help track down where you might be making redundant calls, too, if you're in a position where you're not sure how many you may be making in your code base.

这篇关于进行冗余OpenGL调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 08:14