Jump to content
  • Advertisement
Sign in to follow this  
trick

DX11 Vertex Shader Problem

This topic is 2507 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'm having trouble with my 3rd vertex shader for my application. I am getting E_FAIL result when calling

[font=Consolas][font=Consolas]D3DX11CompileFromFile. Can anyone take a look at the HLSL below, and let me know if you see anything? I've been over it numerous times, and can't see what I'm doing wrong.[/font][/font]

//Sprites.vs
//--------------------------------------------------------------------------------------
// Buffers
//--------------------------------------------------------------------------------------
cbuffer OnScreen : register( b0 )
{
float2 screenSize;
}
//--------------------------------------------------------------------------------------
// Typedefs
//--------------------------------------------------------------------------------------
struct VertexInput
{
float4 Pos : POSITION;
float2 Tex : TEXCOORD0;
float2 sPos : TEXCOORD1;
float2 sSize : TEXCOORD2;
float2 tPos : TEXCOORD3;
float2 tSize : TEXCOORD4;
};
struct PixelInput
{
float4 Pos : SV_POSITION;
float2 Tex : TEXCOORD0;
};

//--------------------------------------------------------------------------------------
// Vertex Shader
//--------------------------------------------------------------------------------------
PixelInput VS( VertexInput input )
{
PixelInput output;
output.Pos = input.Pos;
output.Pos[0] = (((output.Pos[0] * output.sSize[0]) + output.sPos[0]) / screenSize[0]) - 1;
output.Pos[1] = (((output.Pos[1] * output.sSize[1]) + output.sPos[1]) / screenSize[1]) - 1;
output.Tex = input.Tex;
output.Tex[0] = ((output.Tex[0] * input.tSize[0]) + input.tPos[0]);
output.Tex[1] = ((output.Tex[1] * input.tSize[1]) + input.tPos[1]);
return output;
}

Share this post


Link to post
Share on other sites
Advertisement
The compile error will be in the ID3D10Blob that you get back from the ppErrorMsgs parameter.

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!