This change gives us more accurate preview in GLSL viewport, though it still doesn't support material's "Exclusive" option. I believe this is much useful for creating scenes with complicated lamp settings.
Note: Changes in view3d_draw.c are not essential, these avoid preparing unused shadow buffers.