Vertex Shader Problem

Started by
1 comment, last by trick 12 years, 2 months ago
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;
}

Advertisement
The compile error will be in the ID3D10Blob that you get back from the ppErrorMsgs parameter.
Thanks for quick response! Managed to see what was going on, after checking that.

This topic is closed to new replies.

Advertisement