Re: [PyOpenGL-Users] Tracking down an invalid operation
Brought to you by:
mcfletch
|
From: Mike C. F. <mcf...@vr...> - 2011-06-03 02:24:54
|
On 11-06-02 04:35 PM, Derakon 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. ... > 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. The docs for glDeleteTextures say that the point at which it will generate invalid operation is when called between glBegin and glEnd, you may wish to guard that segment of render() with your self.lock. However, given that there should only be a single wxPython thread, you should only have one thread rendering at a time. As far as I recall, wx.PostEvent should do the "correct" thing in scheduling the call in the GUI thread. Note, however, that your C++ code is likely not GIL-locked, so unlike Python code, it can be running between op-codes and the like. I don't know that that would be the problem, but it is a likely difference between the broken and working versions. Afraid I don't have much else to suggest off the top of my head. I expect you are somehow seeing interference between the C++ rendering loop and the wxPython rendering loop, but without knowing what that C++ code is doing (i.e. is it in a thread, is it posting events to wx to do its own rendering, etc), I can't really guess what in particular is going wrong. Good luck, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |