Re: [PyOpenGL-Users] Tracking down an invalid operation
Brought to you by:
mcfletch
|
From: Ian M. <geo...@gm...> - 2011-06-02 21:24:19
|
On Thu, Jun 2, 2011 at 1:35 PM, Derakon <de...@gm...> wrote: > I have an OpenGL-related crash that's giving me fits trying to trace > it. This is gonna take a bit to describe, unfortunately. > > We have a computerized microscope with four cameras which each image > different wavelength bands (colors) of the sample as 512x512 pixel > arrays. These are displayed as OpenGL textures by some C++ code. I've > made an overlaid view as a separate window, which runs in Python -- > our C++ code is old and crufty and every time I touch it I'm worried > it'll collapse into dust, but the Python "half" (more like 80%) of the > program is more up-to-date. Basically, each time a camera receives new > image, an event is generated on the C++ side, which is picked up by > the Python side. The Python side makes a request to the C++ side for > the image data, converts that into its own texture, and displays it. > Ideally I'd just re-use the same textures the normal camera displays > use, but they're in separate OpenGL contexts so, as far as I'm aware, > that's not possible. > Hi, Generally, having multiple contexts in OpenGL is a very very very bad idea. If you're doing a readback of the texture data from one context, and then trying to use that data in another, it may not work properly, because OpenGL works asynchronously. In a single context, OpenGL calls will execute in order--but some won't block while they do the underlying work. In the context isn't managed, the context will get confused. If the work done by one context isn't done (e.g., copy this texture) and another context gets a function call in edge-wise, you'll have problems. Ian |