Sign in to follow this  

error X4502: invalid vs_4_0 output semantic 'SV_TARGET'

This topic is 1900 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 have a pixel shader, copied from the font tutorial at rastertek. I have changed the tutorials for the new windows sdk on windows 8, but when I try to load the shader, the output says

error X4502: invalid vs_4_0 output semantic 'SV_TARGET'

I find this weird because I have another shader that also uses SV_TARGET in the same place and it works fine.

Here is my shader:

[source lang="cpp"]/////////////
// GLOBALS //
/////////////
Texture2D shaderTexture;
SamplerState SampleType;

cbuffer PixelBuffer
{
float4 pixelColor;
};


//////////////
// TYPEDEFS //
//////////////
struct PixelInputType
{
float4 position : SV_POSITION;
float2 tex : TEXCOORD0;
};

////////////////////////////////////////////////////////////////////////////////
// Pixel Shader
////////////////////////////////////////////////////////////////////////////////
float4 FontPixelShader(PixelInputType input) : SV_TARGET
{
float4 color;


// Sample the texture pixel at this location.
color = shaderTexture.Sample(SampleType, input.tex);

// If the color is black on the texture then treat this pixel as transparent.
if(color.r == 0.0f)
{
color.a = 0.0f;
}

// If the color is other than black on the texture then this is a pixel in the font so draw it using the font pixel color.
else
{
color.a = 1.0f;
color = color * pixelColor;
}

return color;
}[/source]

Share this post


Link to post
Share on other sites

This topic is 1900 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this