Jump to content

  • Log In with Google      Sign In   
  • Create Account

Ways to pass data to GPU


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 gnomgrol   Members   -  Reputation: 584

Like
0Likes
Like

Posted 31 July 2012 - 11:59 AM

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!

Sponsor:

#2 Seabolt   Members   -  Reputation: 633

Like
1Likes
Like

Posted 31 July 2012 - 12:08 PM

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.
Perception is when one imagination clashes with another

#3 gnomgrol   Members   -  Reputation: 584

Like
0Likes
Like

Posted 31 July 2012 - 12:47 PM

Thanks! That's exactly what I was looking for!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS