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?