Author: ahuillet <email@example.com>
Date: Fri Oct 28 12:36:09 2016 +0200
GL blitter shader: fix wrong texture unit being picked due to FP
floating point operations on the Z texture coord are not exact, such
that the computed Z texture coordinate (which really is the texture unit
times 10) isn't exact, and can sometimes be a bit less than the expected
value (20 - epsilon instead of 20).
The fragment shader truncates the value to compute the texture unit to
texture from -- so 20 - epsilon ends up being 19, an invalid unit number
that is displayed as red by the fragment shader (to draw attention to
The fix consists in making sure that the value passed to the fragment
shader is always slightly greater than the expected value, such that
truncating yields that expected value exactly.