Jump to content
  • Advertisement
Sign in to follow this  
Tasche

DX11 geo shader problem...

This topic is 2633 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

what the hell is wrong with this piece of code?

D3D11_SO_DECLARATION_ENTRY so_decl[] =
{
{0,"POSITION",0,0,4,0},
{0,"TEXCCORD",0,0,2,0},
{0,"TEXCCORD",1,0,3,0},
{0,"TEXCCORD",2,0,4,0}
};
unsigned int stride = 13*sizeof(float);
hr = m_pDev->CreateGeometryShaderWithStreamOutput(GS->GetBufferPointer(),GS->GetBufferSize(),so_decl,4,&stride,1,D3D11_SO_NO_RASTERIZED_STREAM,NULL,NULL);


the associated shader code (should just pass through vertices from vertexshader):

struct GIn
{
float4 position : SV_POSITION;
float2 tex : TEXCOORD0;
float3 lightDirSurf : TEXCOORD1;
float4 lightParam : TEXCOORD2; //x contains distance, y falloff param
};

struct PIn
{
float4 position : SV_POSITION;
float2 tex : TEXCOORD0;
float3 lightDirSurf : TEXCOORD1;
float4 lightParam : TEXCOORD2; //x contains distance, y falloff param
};

[maxvertexcount(3)]
void GShader( triangle GIn triIn[3], inout TriangleStream<PIn> triStream )
{
triStream.Append(triIn[0]);
triStream.Append(triIn[1]);
triStream.Append(triIn[2]);
}


i always get E_INVALIDARG instead of S_FALSE.
the shaderbytecode and its lenght are valid values, i also tried passing values of a vertex shader (the vertshader has already been sucessfully tested), stil getting E_INVALIDARG. the shaderbytecode in GS was also tested with fxc w/o errors.
so this should actually work right?
i suspect the so declaration or the stride to be the problem, but i cant seems to find a working dx11 example, only dx10 or using effects interface...

thanks i.a.
tasche

Share this post


Link to post
Share on other sites
Advertisement
Did you create the device with D3D11_CREATE_DEVICE_DEBUG? If you did, usually you get information about a failure in the debug output.

Share this post


Link to post
Share on other sites
no i didnt even know about that feature... and it seems like *really* useful, how did i manage to code so long without it?
anyway, that helped me alot, now i can continue debugging.

thanks MJP

and cheers all,
tasche

EDIT: btw the problem was the semantics, just check in the original post how i wrote TEXCOORD :D. hehe, fail.

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!