winforms - Is there a limit to how many OpenGL rendering contexts you can create simultaneously? -


my .net winforms application creates 3 opengl rendering contexts in main window, , allows user popup other windows each window has 2 more rendering contexts (using splitter). @ around 26th rendering context, things start go slow. instead of taking few milliseconds render frame, new rendering context takes between 5 , 10 seconds. still works, slow! , opengl not return errors (glgeterror).

the other windows work fine. new rendering contexts after number slow down. if close windows, fine -- until reopen enough windows pass limit. each rendering context has own thread, , each 1 uses simple shader. slow down appears happen when upload texture. size of texture has no effect on how many contexts can create, nor size of opengl window.

i'm running on nvidia cards , see on different gpu's different amounts of memory , different driver versions. what's deal? there limit how many rendering contexts application can create?

does else have application lots of rendering contexts going @ same time?

as nathan kidd correctly said, limit implementation-specific, , can run tests on common hardware.

i bored @ today's department meeting, tried piece bit of code creates opengl contexts , tries rendering. tried rendering , without textures, , without forward-compatible opengl context.

it turned out limit pretty high geforce cards (maybe no limit). desktop quadro, there limit of 128 contexts able repaint correctly, program able create 128 more contexts no errors, windows contained rubbish.

it more interesting on ati radeon 6950, there redrawing stopped @ window #105, , creating rendering context #200 failed.

if want try yourself, program can found here: max opengl contexts test (there full source code + win32 binaries).

that's result. 1 piece of advice - avoid using multiple contexts possible. multiple contexts can understood in application running @ mulitple monitors, applications on single monitor should resort single context. context switching slow. , that's not all. applications opengl windows overlapped windows require hardware clipping regions. there 1 hardware clipping region on geforce, 8 or more on quadro (cad applications use windows , menus overlap opengl window, in contrast games). in case more regions needed, rendering falls software - again - having lots of opengl windows (contexts) not idea.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -