Sign in to follow this  

GS Steam-Out to new VS

This topic is 2660 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

I have a question that I can't find a direct answer to in the documentation. I'm trying to build a geometry shader that uses Stream-Out that I want to in turn feed back into either the same or a different vertex shader.

All of the documentation I've read about the stream-out feature seems to focus on reading the buffer on the CPU side, then possibly using it again for the GPU. However, is this required? I would think that you could create a buffer specifically on the GPU that will be immediately used for the GPU again.

So I'd like to do the following:
1) Create a regular Vertex Buffer
2) Send it to the Vert Shader
3) Send that to the stream-out Geom Shader
4) Stream-Out _back_ into the same or different Vert Shader (without any external buffer calls)
5) Use the new buffer as if I were binding it on the CPU side.

The post at http://shadermodel1337.wordpress.com/ showed me a nice step-through of the process, but it's still being written assuming that you want to read the results of the stream-out buffer.

Anyways, any info would be appreciated. Thanks!

Share this post


Link to post
Share on other sites
Sorry, I guess I should post the example of what I'm working on. I'm using a vert buffer of points in the following way:

1) Point list buffer into the Geo shader to change into a line buffer
2) Stream-out the new line buffer back into a different vert shader
3) Use the new vert shader and new geo shader to create triangles from the lines.

I'm setting everything up right now to use the CPU calls to set a buffer, but it seems like that's too much data being sent through the BUS to the GPU. I assumed it would be more similar to tessellation if I didn't intend on reading the data on the CPU side.

Share this post


Link to post
Share on other sites
Just by calling the Set*** commands with the CPU doesn't mean that you are reading the data back to the CPU and then re-uploading it. You are only working with a reference to the buffer, which is most likely still sitting in video memory the whole time.

From your question above, you can't use the same buffer for input to the pipeline (in the IA stage) and for output (in the SO stage) at the same time. You'll need two buffers to get the job done. However, it sounds like you want to try out the DrawAuto() method. This should minimize the amount of work that you need to do on the CPU side (are you already using these methods?).

Do you have reason to think that there is a big slowdown when using this method?

Share this post


Link to post
Share on other sites

This topic is 2660 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.

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