Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your feedback on a survey! Each completed response supports our community and gives you a chance to win a $25 Amazon gift card!


error X4502: invalid vs_4_0 output semantic 'SV_TARGET'


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 viper110110   Members   -  Reputation: 707

Like
1Likes
Like

Posted 02 November 2012 - 08:52 PM

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]

Sponsor:

#2 MJP   Moderators   -  Reputation: 11859

Like
7Likes
Like

Posted 02 November 2012 - 11:40 PM

You're compiling the shader with the wrong profile. You're compiling it with vs_4_0, and you want ps_4_0.

#3 viper110110   Members   -  Reputation: 707

Like
0Likes
Like

Posted 03 November 2012 - 01:04 PM

Thanks, I've been staring at that problem for days now, and I knew it was something as simple as that.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS