cgCreateEffectFromFile not working?
Hi, I'm having some issues with getting Cg effect files to work. ( using Tao v2.1.0 )
The issue I'm having is that I can't get cgCreateEffectFromFile to work. It always throws a CG_COMPILER_ERROR, no matter what the file contains(even empty file). Oddly enough, cgCreateEffect works when I read in the file text from disk and pass in the string. I'm really confused, because this tells me that my cgfx file is valid, but cgCreateEffectFromFile is reporting otherwise.
When I cgGetLastListing(context) immediately after calling cgCreateEffectFromFile, it returns me this string:
"(1) : error C0501: type name expected at token "(undefined)"
(1) : error C0000: syntax error, unexpected $undefined at token "(undefined)"
(22) : error C0501: type name expected at token "float4x4"
(22) : error C0000: syntax error, unexpected identifier at token "float4x4"
(49) : error C1104: too many parameters in function call" string
Also here's my cgfx file to verify that it's valid:
float4x4 mvp : WorldViewProjection;
struct VS_INPUT
{
float3 position : POSITION;
};
struct VS_OUTPUT
{
float4 position : POSITION;
float4 color : COLOR0;
};
struct PS_OUTPUT
{
float4 color : COLOR;
};
VS_OUTPUT vs_main( const VS_INPUT IN, uniform float4x4 modelViewProjection )
{
VS_OUTPUT OUT;
OUT.position = mul( modelViewProjection, float4(IN.position, 1.0) );
OUT.color = float4( 1.0f, 1.0f, 1.0f, 1.0f );
return OUT;
}
PS_OUTPUT ps_main( VS_OUTPUT IN )
{
PS_OUTPUT OUT;
OUT.color = float4( 1.0, 0.0, 0.0, 1.0);
return OUT;
}
technique Technique0
{
pass Pass0
{
Zenable = true;
VertexShader = compile arbvp1 vs_main( mvp );
PixelShader = compile arbfp1 ps_main();
}
}
I didn't find any known issues with this function, but it seems that I'm experiencing incorrect behavior. Any ideas?
