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!
2 replies to this topic
Members - Reputation: 585
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