Jump to content
  • Advertisement
Sign in to follow this  
Anand Baumunk

Ways to pass data to GPU

This topic is 2180 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 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!