This question would probably be more appropriate for a game development forum but, as plugins often have DirectX code for display, perhaps it's not completely off topic.
I'm having a problem with the code here:
https://gist.github.com/karlgluck/84679 ... d-9-cpp-L8
This is a part of a video rendering app as intended, and I need to do some processing on the hardware decoded image before it is displayed.
Needless to say, it would be better to do all this on the GPU, but it's not always feasible.
So I'm trying to get the image to system memory, process it and send it back to the GPU with a call like UpdateSurface ( https://msdn.microsoft.com/en-us/library/windows/desktop/bb205857(v=vs.85).aspx) after the UnlockRect above, as in
- Code: Select all
HRESULT hr = poffscreensurface->UnlockRect();
if (copyDataBack && !FAILED(hr))
hr = pd3d9device->UpdateSurface(poffscreensurface,NULL,
It works, but display flickers as if there is a synchronization problem.
Any idea about why that happens?
p.s. Removing the incorrect D3DLOCK_READONLY flag from the code in github does not fix anything.
p.s.2 Apparently I'm not alone? http://xboxforums.create.msdn.com/forum ... aspx#17202