Use a temp FBO at 1x to upload stencil.

This improves performance at > 1x resolutions.
Optimize away bits in the stencil upload.

Should be faster than sending to the GPU this way, if we can help it.
Should improve delays on FBO creation at high render resolutions.
Small optimizations to stencil scanning.
Merge pull request #6445 from unknownbrackets/gpu-stencil

Optimize stencil uploading