This topic is 3379 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Everything works fine when I have just my vertex and pixel shaders bound. When I bind my geometry shader, rather than outputting the cross I expect, nothing appears to be rendered to the output. Pix shows the crossed lines I expect coming out of the geometry shader, but it doesn't appear to render. My geometry shader is below. I know that his is a really trivial use of a geometry shader, but I want to understand how to use them before I write anything more advanced. I just noticed that Pix outputs the following error repeatedly, but I don't understand it. Time EID Type Context Message 0 65 Error Render D3D10: ERROR: ID3D10Device::Draw: Rasterization Unit is enabled (PixelShader is not NULL or Depth/Stencil test is enabled) but position is not provided by the last shader before the Rasterization Unit. [ EXECUTION ERROR #362: DEVICE_DRAW_POSITION_NOT_PRESENT ] Any ideas why nothing gets outputted when this is bound?
cbuffer ScreenConstantsBuffer
{
float4x4 perspectiveTransform;
float screenWidth;
float screenHeight;
float pointCrossSize;
float invalid;
float4 selectedColor;
float4 defaultColor;
float4 cameraLocation;
};

struct VS_INPUT
{
float4 pos : SV_Position;
};

struct PS_INPUT
{
float4 pos : POSITION;
};

[maxvertexcount(4)]
void GS(point VS_INPUT input[1], inout LineStream<PS_INPUT> output)
{
PS_INPUT vertex;
vertex.pos = input[0].pos;
vertex.pos.x = input[0].pos.x - pointCrossSize / screenWidth;
output.Append(vertex);
vertex.pos.x = input[0].pos.x + pointCrossSize / screenWidth;
output.Append(vertex);
output.RestartStrip();

vertex.pos = input[0].pos;
vertex.pos.y = input[0].pos.y - pointCrossSize / screenWidth;
output.Append(vertex);"
vertex.pos.y = input[0].pos.y + pointCrossSize / screenWidth;
output.Append(vertex);

output.RestartStrip();
}



Share on other sites
Try setting PS_INPUT's schematic to SV_POSITION as well. Other than that, make sure that your shader transforms to view space. the PIX shader ouput is NOT in view space, so even if you see output for post VS and post GS, they may not be in the viewport at all. If that doesn't solve your problems, you could post your complete shader, it may help. Oh also make sure that your pos output's w component is 1 (doesn't work as 0, i'm not sure about other values).

Share on other sites
Making the change to SV_Position fixed it. Thanks so much for the help!