For reference to anyone else with the same problem:
The following works on NVIDIA but not on “ATI Radeon HD 4800 Series”
uniform sampler2D ShadowTexture[2];
void main()
{
int splitPlane = 0;
float value = texture2D(ShadowTexture[splitPlane], vec2(0.0, 0.0)).x;
With amd_catalyst_12.1a_preview_win7_32-64 ,you get the following error
ERROR: error(#15) Extension: ‘sm5’ isn’t supported=> sampler array isn’t support indirect index Sampler array indexes must be integral constant expressions
With earlier drivers, the fragment is discarded without any error.
The Radeon HD 4800 series does not support shader model 5. Therefore non-constant indices aren’t allowed for array lookups. If you change the following line
const int splitPlane = 0;
it should work. I bet you’re testing on a GeForce 4xx+ model, right? These support SM5 so your comparison is a bit lacking. If your testing with a GF 2xx- generation card then the CG compiler doesn’t obey the limitations of SM4 correctly.
If you want shader model 5 you need to upgrade to a HD 5000+ card.
Edit: BTW, are you implementing cascaded shadow maps?