Sign in to follow this  

Render Retrieval

This topic is 4490 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey :) I need to render some scenes and have the results available in system memory for manipulation; what is the fastest way to do this? The naive approach drops my frame rate to maybe 35fps or so (purely for the render, and recovery to system memory). Thanks for all help :D LoreKeeper

Share this post


Link to post
Share on other sites
What's the 'naive' approach that you're using?
My suggestion would be to use D3DDevice9::GetRenderTargetData() for this purpose. For this to work you'll need to have a texture in SYSTEMPOOL memory of the same size and format of the rendertarget (best way to do this is to set up your rendertarget to be the same size and shape as your system texture by creating a D3DPOOL_DEFAULT texture with D3DUSAGE_RENDERTARGET and setting it as the rendertarget).

Keep in mind that this call does require transferring data between GPU and system memory, and will likely be rather slow in any case.

Share this post


Link to post
Share on other sites
Do you need to export the image or just manipulate it? Render to surface is generally the way if you want to just have it to manipulate...

If you want to export just use D3DXSaveTextureToFile(...).

If you want to simply have it use these commands:

m_pd3dDevice->CreateTexture(...);
texture->GetSurfaceLevel(...);
m_pd3dDevice->SetRenderTarget(...);

The GetSurfaceLevel(...) which I know little about what it actually does, it seems to link the texture and surface?

Anywho good luck,
Brad

Share this post


Link to post
Share on other sites
The naive approach I'm talkin about is setting a rendersurface as accessable from system-memory (lockable) and then fetching the data.

I improved on that using the GetRenderTargetData method as well, which is faster - but honestly I was hoping that the old AGP speed limitations for downstream data was lifted by now.

Surely there must be a way to have a decent rate of data retrieval from the graphics card?

Share this post


Link to post
Share on other sites
Quote:
Original post by LoreKeeper
The naive approach I'm talkin about is setting a rendersurface as accessable from system-memory (lockable) and then fetching the data.

I improved on that using the GetRenderTargetData method as well, which is faster - but honestly I was hoping that the old AGP speed limitations for downstream data was lifted by now.

Surely there must be a way to have a decent rate of data retrieval from the graphics card?


I write to surfaces without a problem, and manipulate each inside of the pixel shader, i use 4 targets with very little speed decrease... Are you not manipulating them inside of the shaders?

Share this post


Link to post
Share on other sites
Quote:
Original post by LoreKeeper
The naive approach I'm talkin about is setting a rendersurface as accessable from system-memory (lockable) and then fetching the data.

I improved on that using the GetRenderTargetData method as well, which is faster - but honestly I was hoping that the old AGP speed limitations for downstream data was lifted by now.

Surely there must be a way to have a decent rate of data retrieval from the graphics card?

There is no efficient way to retrieve data from the GPU to the CPU, not even on PCI-Express. (It's better there, but not optimal either).

Share this post


Link to post
Share on other sites
I'm not doing manipulation in the pixel shaders.

To clear up what I'm actually doing:

I'm retrieving rendering results between different frames and performing motion estimation matches on it. The renders themselves are just a tool and data-source for the real work that happens on the CPU (revolving around 3D reconstruction from motion data).

thanks for all the input; pity there isn't a decent GPU-to-CPU stream available yet. :/

Share this post


Link to post
Share on other sites

This topic is 4490 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this