Something you may find interesting Ashkan:
I thought I would start a little investigating into the notorious expense of opengl render context switching vs 1 context + multiple device contexts.
I also said:
Quote:
OOps - should be real easy to just change it over to the one context multiple window method then!!! I put my foot in it now hey?
And it is true: All I did is the following:
private: System::Void ShareGLContexts(){ /**** (A)changed this ***********************/ // get the contexts to share resources HGLRC c1 = m_OpenglViewports[0]->GetContext(); HGLRC c2 = m_OpenglViewports[1]->GetContext(); HGLRC c3 = m_OpenglViewports[2]->GetContext(); HGLRC c4 = m_OpenglViewports[3]->GetContext(); // whats with the going overboard with sharing both ways?: could be a problem. if(!wglShareLists( c1,c2 ) || !wglShareLists( c3,c2 ) || !wglShareLists( c4,c2 ) || !wglShareLists( c2,c1 ) || !wglShareLists( c2,c3 ) || !wglShareLists( c2,c4 ) ) { bGLContextShared = false; } /* (B)to this: *************************/ // 4 devices sharing one render context test HGLRC c1 = m_OpenglViewports[0]->GetContext(); m_OpenglViewports[1]->SetContext(c1); m_OpenglViewports[2]->SetContext(c1); m_OpenglViewports[3]->SetContext(c1);}
So far in testing nothing has changed: not even my fps metric of 260(or so I thought).
I tried out gDebugger for more reliable metrics and it records the following:
Option (A) 4 shared render contexts: 130 fps.[edited: 15th may 08 only 2 contexts where mesured!]
(Edit 15th may 08: Option(A) 4 shared contexts where all 4 where measured (65 fps per context)
Option (B) 1 render context shared among 4 DCs 260 fps.
Now that might be potentially compelling (so far). But something is not right (e.g. My fps counter?, or the way I use gDebugger is not right?). I need to continue testing, but with more rigor before making conclusions just yet. I must say gDebugger's metrics/testing options are very impressive (and very quick and easy to use).
Something of maybe more interest Ashkan, may be talk from
here:
Quote:
...today with FBOs, there's no reason to use more than one context per GPU. You either just don't need it(no Pbuffers anymore) or got something else wrong (there' s no point in talking to the same gfx cards from two threads concurrently)....
FBO specs (and other docs) do mention FBO superiority to and substitution for context switching. Apparently different precision depths(you mention) can be achieved if you delve further into the use of FBOs. However, I have my doubts about FBO as suitable for multi windows (could it be a square peg for a round whole?): meaning "try it see" tests are required (there are 2 typical uses of FBOs, mutli windows is not one of them, as far as I can tell so far).
Hope this tentative speculation has been of interest.
[Edited by - steven katic on May 15, 2008 5:59:04 AM]