Skip to main content
GameDev.net gamedev.net
🔒 Locked

Vertex Shader Problem

Started by trick Feb 2, 2012 at 1:10 AM 1 replies 1.4k views
Original Post
trick
trick
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;
}

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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.