Jump to content

  • Log In with Google      Sign In   
  • Create Account


Vertex Shader Problem


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 trick   Members   -  Reputation: 139

Like
0Likes
Like

Posted 01 February 2012 - 07:10 PM

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

//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;
}


Sponsor:

#2 MJP   Moderators   -  Reputation: 10264

Like
0Likes
Like

Posted 01 February 2012 - 07:31 PM

The compile error will be in the ID3D10Blob that you get back from the ppErrorMsgs parameter.

#3 trick   Members   -  Reputation: 139

Like
0Likes
Like

Posted 01 February 2012 - 07:37 PM

Thanks for quick response! Managed to see what was going on, after checking 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