When I compile the effect file I get the following error: D3D11: ERROR: ID3D11Device::CreateGeometryShaderWithStreamOutput: Stream Output Declaration Element[1]'s semantic (Normal 0) not found in output signature of shader.
I don't understand it.
Setting the declaration for the second stream to NULL makes it compile. It even works but obviously the second stream does not receive the data I want to have.
Any idea how to configure ConstructGSWithSO() correctly?
Funnily, I can compile that shader with fxc without any problems. Haven't played around with multiple streams yet, but if I get the effect file syntax right from here, maybe this works:
As you say, I don't get a compile error but the error appears later when the effect framework calls CreateGSWithSO(). The variant suggested by you works but than I end up with an interleaved stream, which I don't want.
I tried this:
It doesn't give me any errors but it crashes the video driver.
BTW, do you happen to know what the fx equivalent of D3D11_SO_NO_RASTERIZED_STREAM is? I tried 0xffffffff, but this still gives me a warning that the rasterizer is activated unless I manually disable depth-writes.
The second part is pseudo code:ish but I hope you can still see the d3d11 calls beneath it. As I said earlier that stuff actually works as long as I only write to one stream, but I'd rather have two.
Hot stuff, literally. Experimenting with your setup - manually though, not through the effect framework - I first got a memory corruption when calling CreateGeometryShaderWithStreamOutput and later a freeze of my apps and suddenly some weird rendering with a blue background and white text. Blue screen of death
So I'm of little help now, sorry. I'd double check the strides and experiment with buffers with equal strides. But that's just a real shot in the dark.
I managed to get away the errors by specifying [font="Courier New"]uint normal : Normal[/font] as the output for the second stream which matches the stride of my normals, because they are compressed. However whatever I output in the geometry shader it does not seem to end up in the output stream.
EDIT0: I confirmed that the second stream is not being written too, by outputting the same data to both streams. Reading from those streams later the data is not identical.
EDIT1: Had to specify [maxvertexcount(2)]. Now it works!