Hello (again),
I've been trying to use the GetData method on Texture2D to get some results from both the BackBuffer / a RenderTarget but with limited success. The example on the MSDN shows how to return the single pixel from the texture back to an array for the benefit of determining what colour the pixel was, but even this seems to be running incredibly slowly.
I've timed the GetData to call it about 50ms, which is an eternity to do 1 pixel, the funny thing is that 1280x720 pixels also takes the same amount of time.
I've zipped up the code/project I'm using, it outputs the time taken to execute the GetData call every time it happens, and on my 6800GT (PCI-Express) it takes 50ms on average, ideally it should take barely any time at all, especially for one pixel.
This is a texture that has just been written to by the pixel shaders, resolving it takes no time at all. PIX shows:
968 <0x05F19388> IDirect3DTexture9::GetSurfaceLevel(0, 0x0016EDA8 --> 0x05EA3ED8) 4391765713
969 <0x05EA3ED8> IDirect3DSurface9::GetDesc(0x0016ED78) 5616729500
Basically a massive time taken between call 968 and 969, 1.2 billion (ticks?).
Anyone with any ideas?
ajmiles
PS I'll have to upload the zip file later, the university is having some connectivity issues so hosting the file may happen in an hour or two.