   Trying to make a HLSL array dynamic.
  Using shader model 4 I'm trying to make an array of lights which can be resized so that I can have an infinite number but I can't get it to work.uint light_count: LIGHTCOUNT;float4x4 Lights[light_count]: LIGHTARRAY;Why does this not work?   
  It's because in HLSL arrays are always allocated out of the constant registers at compile time. You want a fixed size array of the maximum number of lights you'll ever use at once. I'd suggest limiting it to around eight or less for performance reasons.As a side note if instead of looping on a runtime constant you loop on a compile time constant the shader should run significantly quicker, although that will require compiling several different shaders (one for each light count).   