English 中文(简体)
缩略语
原标题:C++/opengl application running smoother with debugger attached
  • 时间:2012-01-13 22:30:02
  •  标签:
  • c++
  • opengl

您是否经历过一种情况,即C++的开放式申请在视觉演播室执行时速度更快、更顺利? 在不夸张的情况下,当我执行时,每20-30个框架中,有50个而不是80个,有奇怪的滞后,就有大约25个框架。 是否有办法解决这一问题?

Edit: Also we are using quite many display lists (created with glNewList). And increasing the number of display lists seem to increase lagging.

Edit: The problem seems to be caused by page faults. Adjusting process working set with SetProcessWorkingSetSizeEx() doesn t help.

Edit: With some large models the problem is easy to spot with procexp-utility s GPU-memory usage. Memory usage is very unstable when there are many glCallList-calls per frame. No new geometry is added, no textures loaded, but gpu-memory-allocation fluctuates +-20 Mbytes. After a while it becomes even worse, and may allocate something like 150Mb in one go.

问题回答

我认为,你看到的是,一些页页的倒置,因此,他们可以被推卸,立即供变迁者使用。 在程序转换时,这给本组织带来了一些警告,而且总体上说,这并不是不建议的。

也许你不想听我说这一点,但是,即使你这样做,也没有任何很好的办法解决这一问题。

使用VBO,或至少是垂直阵列,预期在驾驶员中能更好地优化这些装置(从表面上删除——显示名单已经过时)。 显示清单很容易包装,以产生垂直缓冲,因此只有少数旧代码需要修改。 另外,你还可以使用“无纸面图”,目的是避免驾驶员的页面故障(GL_EXT_direct_state_access)。

您是否有任何机会获得NVidia制图卡? nVidia OpenGL似乎在配对挖尸首时使用不同的执行方式。 对我来说,不夸张的版本正在泄漏多达1兆赫的记忆,在某些局势中,我带上前方缓冲,不提每一框架。 夸张的说法是绝对的。

我不知道为什么它需要分配和(有时)把这么多的记忆分配给一个没有变化的场所。

而且,我不使用显示清单。

这可能是表面上或过程上的优先事项。 视像演播室可能会以略为高的优先地位启动工作,以确保清醒会的响应。 Try using SetPriorityClass()。

SetPriorityClass(GetCurrentProcess(), ABOVE_NORMAL_PRIORITY_CLASS);

以上正常的阶层只是把它放在正常的班级之外。 正如文件所言,不会出现过一个超高优先事项,或者你可以重新制定系统的时间表。

在60分位的 app光中,只有16秒才能提取一个框架(不到80分点!)——如果需要更长的时间,你就会放弃能够造成小幅 frame缩的框架。 如果你的建议与其他建议一样具有优先地位,那么另一个人相对可能暂时偷窃CPU从事某些工作,而你则放弃了几个框架,或至少错失了你目前框架中的16个ms窗。 这一想法正在提升优先程度,略微意味着窗户更经常地回到你身上,因此它不会像许多框架那样减少。





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签