error C1019: scalar Boolean expression expected
. Weirdly, it only threw this error on the machines at school (the Cg shader code is compiled at run-time). Though the line numbers don't make this clear, the problem code appears to be this:
float4 val = readFloat4FromTexture();
if (val != float4(1,1,1,1)) {
...
}
I haven't investigated why this works at home and not school (different Cg compiler versions?), but I fixed it by changing to this:
...
if (val.x != 1 && val.y != 1 && val.z != 1 && val.w != 1) {
...
}
I wasn't able to find *anything* about the error on Google or in the Cg documentation, so hopefully this is useful if anyone else has this problem.