Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am having trouble trying to send verticies generated in the Geometry Shader to Stream Output. What I am trying to accomplish is to generate verticies from the Geometry Shader and store them to a vertex buffer so that I can use the vertex buffer to draw later.

I read that I have to use the CreateGeometryShaderWithStreamOutput function to create a Geometry Shader that can send verticies to Stream Output instead of the rasterization stage.

This is how I am trying to use it:

    device->CreateGeometryShaderWithStreamOutput(this->mGSBlobSO->GetBufferPointer(), this->mGSBlobSO->GetBufferSize(), so_decl, 1, &stride, 1, D3D11_SO_NO_RASTERIZED_STREAM, NULL, &this->mGeometryShaderSO)

I am getting an E_INVALIDARG at this line. I am specifying D3D11_SO_NO_RASTERIZED_STREAM because I think this means that I do not want to send data to the rasterizer but I am not sure. When I replace D3D11_SO_NO_RASTERIZED_STREAM with a 0, I do not get this runtime error, but I do not get the result I want.

How can I setup the geometry shader to store vertices to a vertex buffer in Stream Output?

share|improve this question
I think the way I did this recently was to simply unbind the Pixel Shader, hence no reasterizer stage, but let me look at my code.. – melak47 May 1 '12 at 16:01
okay, I didn't do exactly what you are asking. Do you have the debug layer enabled, can you provide some more information? You must have feature level 11.0+ support to use other values than 0 for the RasterizedStream parameter. – melak47 May 1 '12 at 16:09
I didn't realize to use the debug layer, and when I did, I found out what was wrong. I was not setting up my rasterize states correctly. You are right, I need feature level 11.0+ to support other values besides 0 for the RasterizedStream, so I left it at 0. Thanks for telling me about debug layer. – lexro May 2 '12 at 0:19
You may find this [blog post] (…) useful. – Chuck Walbourn Jul 1 '14 at 6:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.