Sign in to follow this  
CastorX

Data transfer inside video memory

Recommended Posts

CastorX    132
Hy! Is it possible to transfer data from a render target texture into a vertex buffer without a system memory copy? Right now I do it like this: tPositionTexture0.GetTexture().GetData<Vector4>(posTmpArray); vbPosition.SetData<Vector4>(posTmpArray, 0, numParticles); This code is part of a GPU managed particle system with WH geometry instancing. Currently I'm testing it with ~250.000 particles. (20-30 fps) But I want to decrease the CPU load. Any ideas how to do it, or how to avoid the system-mem copy?

Share this post


Link to post
Share on other sites
Hodgman    51325
The most common way to use rendered-data as part of your vertex stream is probably to just use vertex-texture-fetch (i.e. sample from the texture in your vertex shader), but there's also the R2VB trick.

In the last particle system I used, it was implemented using both of these techniques (1 or the other) -- a VTF code-path for most cards, and a R2VB code-path on a few other cards.

Share this post


Link to post
Share on other sites

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