Maximum number of texture fetches in shader?

Is there a limit to how many texture fetches can be performed in a shader?

The 4850 spec, for instance, says “128 textures per pixel” - does this mean that if I tried to run a shader that did 256 texture fetches, it would fail (on a 4850)?

Or would it just run a “second pass” of texture fetching, or something similar?

Is there a limit to how many texture fetches can be performed in a shader?

It rather depends on the hardware, but in the most technical sense, yes. Any DX10 or better hardware will have texture fetch limits only to the extent that they have program size limits. Various DX9 hardware have varying different limits. Most NVIDIA DX9 hardware doesn’t give you much as vertex texturing (I think 4 was the number), but fragment texturing is much like DX10 hardware. ATI DX9 hardware has more explicit limitations, particularly in terms of dependent texture fetches.

Thanks, Alfonse