   Bug in Cg compiler?
  Yeah, I know that mostly when people suspect there might be a bug in such a serious tool, they must be wrong :)Yet I have a really strange problem. Look at this shader code:PS_OUTPUT main(PS_INPUT input){PS_OUTPUT output;input.texCoord0 *= texCoordSize_normalMapSamplingOffset.xy;float3 pixelNormal = 2.0 * (0.5*tex2D(normalMap, input.texCoord0) + 0.5*tex2D(normalMap, input.texCoord0 + texCoordSize_normalMapSamplingOffset.zw)).xyz - 1.0;input.projSceneTexCoord.xy += rippliness * pixelNormal.xy * input.projSceneTexCoord.w; // here we multiply by .w, because it's not equal to 1.0 (due to perspective projection; see source projection matrix)input.projShadowMapTexCoord.xy += 0.5 * rippliness * pixelNormal.xy; // here we don't multiply by .w because shadow projection matrix is orthogonalfloat shadow = 1.0;if (receiveShadow)shadow = tex2Dproj(shadowMap, input.projShadowMapTexCoord).r;float3 sceneReflectedColor = reflectivness * tex2Dproj(sceneReflected, input.projSceneTexCoord).xyz;float3 diffuseMapColor = (1.0 - reflectivness) * tex2D(diffuseMap, input.texCoord0 + rippliness*pixelNormal.xy).xyz;output.color = color * (lightAmbient + shadow*lightDiffuse) * (float4(sceneReflectedColor + diffuseMapColor, 1.0));return output;}It just "shades" water plane. Look at the line where I check if it is meant to receive shadows. If so, I do a tex2dproj lookup. And it's fine... for my OpenGL renderer which uses NV40 profile. But when I compile *the same* shader for PS3.0 for my D3D renderer I get a "black water" with such debugger's hints:D3D9 Helper: IDirect3DDevice9::DrawPrimitive failed: D3DERR_INVALIDCALLDirect3D9: VS->PS Linker: X138: (Error) The current pixel shader expects input semantic 'texcoord3' including component(s): 'xyz', however the current vertex shader does not output 'texcoord3' at all.Direct3D9: VS->PS Linker: X138: (Error) The current pixel shader expects input semantic 'texcoord4' including component(s): 'xyzw', however the current vertex shader does not output 'texcoord4' at all.First-chance exception at 0x7c812afb in BlossomEngine_D3D9.exe: Microsoft C++ exception: long at memory location 0x0012eff4..Direct3D9: (ERROR) :DrawPrimitive failed.Which is a total rubbish! I don't even use such a semantic. But when I change the code to:float shadow = tex2Dproj(shadowMap, input.projShadowMapTexCoord).r;if (!receiveShadow)shadow = 1.0;It works! I've also noticed, that the first version of code works, if I don't alter input.projShadowMapTexCoord.xy in the one line above.Is this some compiler bug?   