PDA

View Full Version : Context switching is extremely slow?



JoshKlint
01-12-2014, 10:46 AM
In our 4-viewport editor, I have noticed that when drawing objects the mouse movement gets extremely laggy. This only occurs when there is an event that causes all four viewports to be redrawn. It's not just four times slower, it's like an order of magnitude. It makes the editor unusable. If the event only causes a single viewport to be redrawn, everything runs at a normal speed.

Is there something special about switching contexts in OpenGL that I don't know about? Is this a known issue or something? I've never seen anything like this on Windows or Mac.

l_belev
01-21-2014, 04:09 AM
it is slow, yes, but THAT slow? it sounds more like bug. I think it should be fast enough as to not cause noticeable difference when you do it up to a few hundred times per second.
Then again I haven't tested it under linux. In any case the best thing to do is to minimize the context switches as much as possible. E.g. in your 4 viewports (i assume they are separate windows)
fully draw one viewport before switching to the next. That would total to only 4 switches which should be perfectly fine.