Jump to content
  • Advertisement
Sign in to follow this  
Jimbobicus

[SlimDX] Geometry shader with stream output - E_INVALIDARG

This topic is 2629 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'm trying to recreate the NVidia Cascades demo (sort of) using SlimDX and D3D11 but I keep running into a problem on creating the geometry shaders with stream output.
I'm running the debug runtime, but I'm not seeing any output from that. The only thing I get in the VS output window is: A first chance exception of type 'SlimDX.Direct3D11.Direct3D11Exception' occurred in SlimDX.dll

The unhandled exception window shows up and tells me that the error was an E_INVALIDARG. Which usually indicates an error on the stream output declaration, but I can't for the life of me see what that would be. Any help would be greatly appreciated!

My stream output declaration:
[source]
var sElement = new StreamOutputElement[]
{
new StreamOutputElement(0, "POSITION", 0, 0, 1, 0),
};
[/source]

Bytecode and geometry shader creation code:
[source]
bytecode = ShaderBytecode.CompileFromFile(StringTable.ShaderPath + "list_nonempty.gs",
"GS",
"gs_4_1",
ShaderFlags.Debug,
EffectFlags.None,
null,
includeHandler,
out error);
gShader = new GeometryShader(device, bytecode, sElement, new int[] { 4 }, GeometryShader.NoRasterizedStream);
[/source]

And my geometry shader code:
[source]
struct vs_to_gs
{
uint z8_y8_x8_case8 : OUTPUT;
};

struct gs_to_app
{
uint z8_y8_x8_case8 : POSITION;
};

[maxvertexcount(1)]
void GS(point vs_to_gs input[1], inout PointStream<gs_to_app> Stream)
{
// pull the case out of the input
uint cube_case = input[0].z8_y8_x8_case8 & 0xFF;
// check that the case is not 0
if(cube_case * (255 - cube_case) > 0)
{
// if the case is not zero add this voxel to the output stream
gs_to_app output;
output.z8_y8_x8_case8 = input[0].z8_y8_x8_case8;
Stream.Append(output);
}
}
[/source]

Share this post


Link to post
Share on other sites
Advertisement
You should be getting a debug message if you created the device with DEBUG flag. I haven't done any managed stuff in a long time, but I think you have enable mixed mode debugging if you want to see the native debug output. Or you can use DebugView, or some other program that can view the debug output stream.

Share this post


Link to post
Share on other sites
Thanks for the input! I haven't figured out how to get the D3D debug info to show in the output window (I've had it there before, so I'm not sure what happened...)

At any rate I used PIX to get the debug output and got the problem figured out. It was [font="Consolas,"]GeometryShader.NoRasterizedStream[/font] ..... Apparently that only works with D3D11 feature level. I've got a 10.1 card so there has to be a rasterized stream set. I changed it to 0 and it works fine.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!