Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 25 Jul 2011
Offline Last Active Jun 03 2014 01:36 PM

Topics I've Started

[SlimDX] Geometry shader with stream output - E_INVALIDARG

01 October 2011 - 08:54 AM

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:

var sElement = new StreamOutputElement[]


                new StreamOutputElement(0, "POSITION", 0, 0, 1, 0),


Bytecode and geometry shader creation code:

bytecode = ShaderBytecode.CompileFromFile(StringTable.ShaderPath + "list_nonempty.gs", 







                                out error);

gShader = new GeometryShader(device, bytecode, sElement, new int[] { 4 }, GeometryShader.NoRasterizedStream);

And my geometry shader code:

struct vs_to_gs


	uint z8_y8_x8_case8	: OUTPUT;


struct gs_to_app


	uint z8_y8_x8_case8	: POSITION;



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;