[PyOpenGL-Users] Tracking down an invalid operation
Brought to you by:
mcfletch
|
From: Derakon <de...@gm...> - 2011-06-02 20:35:55
|
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. So far, so good...except that when I ramp up the rate at which the cameras collect images, I get irregular crashes. OpenGL reports an invalid operation in glDeleteTextures, though I've no idea why; I'm certainly not double-deleting textures, and I've put locks around everything remotely sensitive so it shouldn't be e.g. trying to create a texture in one thread while rendering in another. In fact, I probably have too many locks, but there's no deadlocks, so oh well. I made a standalone application. It doesn't crash. I copied the standalone app's code back into the main program and hooked it back in. It crashes. I severed the code that retrieves the image array from the C++ side in favor of displaying a randomly-generated pixel array. It still crashes. At this point the only connection this system has to the rest of the program is the event notification. Here's the standalone, non-crashy version of the program: http://pastebin.com/p2QtTSZf (requires PyOpenGL, wxPython, numpy) The only difference between this version and the version running in the actual app is the source of the events that trigger onNewImageReady (and that the in-app version doesn't make its own wxApp, of course). Any ideas? I'm completely stumped. Also, I've noticed a secondary issue: when this version is running in the main app and hasn't crashed yet, other OpenGL canvases that use FTGL to draw text will sometimes instead draw solid blocks of color (or once, I saw black with random green lines across it) where the text should be. I don't know if this is related. How is display in one window affecting display in another? -Chris |