Cg error reporting fun (Cg 3.1.0013). The actual error in both cases is on line 4.
This file:
float4 vert () : POSITION
{
float4 v = 0;
error_line_4;
return 0;
}
produces: (3) : error C1008: undefined variable "error_line_4"
. Cg thinks error is on line 3.
This file:
float4 vert () : POSITION
{
float4 v;
error_line_4;
return 0;
}
produces: (5) : error C1008: undefined variable "error_line_4"
. Cg thinks error is on line 5.
THIS IS WHY WE CAN'T HAVE NICE THINGS