Hi,
I’m trying to upload data to my rendering engine using a simple known approach:
- Rendering thread maps a buffer, back buffer and draw front buffer
- Working thread copy data to back buffer
- Rendering thread after draw unmap the back buffer, swap the buffers, orphan and map again the new
This is very simple but I get weird results:
- First time I call glUnMapBuffer I get INVALID_OPERATION after that no errors, the buffer was mapped correctly (same buffer id and given size)
- The drawing is done one cycle on one cycle off, and it blinks like hell
- Sometimes the entire screen, not just the OpenGL windows blinks
- Sometime I get “lost connection to nVidia drivers”, that timeout win7 TDR thing
I’ve looked at the data, the copy, no overruns, all syncs and locks are ok, swap and load is protected, buffers are binded when mapped and unmapped
I’ve already implemented similar thing but not directly swapping the buffer but using PBO to copy to new front buffer after orphaning with rendering and working threat but this seems more correct when loading instancing data to my instance renderer
Am I missing something here, seems simple enough, is that not the way?
Any help will be appreciated
Ido