Sign in to follow this  
Anand Baumunk

Ways to pass data to GPU

Recommended Posts

Hey guys, I want to pass data to my GPU / shader.
Currently I know two ways. Passing vertexdata as shaderinput and filling a constantbuffer.
The problem I've got with this is that I'm using up a lot of bandwidth which makes my drawing very slow due to my large vertexlayout (64 byte!).
It's for my terrain right now. But, I could set the vertexbuffer only once and pass a stream with the heights(+shadows etc) to the shader.

But I have no idea what the could look like. I can't fill a whole cBuffer with it, and I don't know any other way.
So I have to pass data per-vertex, but without setting the vertexbuffer.

Thanks in advance!

Share this post

Link to post
Share on other sites
You can set multiple vertex streams per draw call. You specify the data in the streams in your Vertex Declaration( DirectX9 ), or InputLayout( DirectX11 ). Then you can just setup the vertex buffer in one stream, and fill the other buffer as necessary and bind that separate from your original buffer.

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