dolphin-emu/dolphin — pull request #823 by KScorp (2014-08-17 08:11:29+00:00)
Title: Fixed depth matrix shaders in OpenGL and Direct3D to be more precise.

The depth matrix shaders were experiencing loss of precision because the most significant bits were not being subtracted out when shifting the least significant bits left. This change separates the calculations into several statements in order to subtract out the bits that have already been decoded before shifting left, minimizing precision loss. This fixes some graphical glitches when using Copy EFB to Texture.

Code inspired by the old ARBfp1.0 shader that existed before GLSL-master was merged.

One obvious graphic glitch example (from Skyward Sword):
OpenGL without fix, Copy EFB to Texture:
![opengl-nofix](https://cloud.githubusercontent.com/assets/5361635/3944002/6c27dd6c-25df-11e4-86b8-93e401dceb77.png)
OpenGL with fix, Copy EFB to Texture:
![opengl-fix](https://cloud.githubusercontent.com/assets/5361635/3944005/a87f10b4-25df-11e4-907f-98ba7060297b.png)
Similar results with D3D.