Oculus Rift support development 2

Made separate rendering of the GUI and the frame for Oculus Rift (so HDR, FXAA and so did not affect the GUI). But because the GUI texture resolution is bigger than its image on the final frame, there is an undersampling of texture obtained, resulting in flickering of fine details. Look at the lines of GUI window frame (open in new tab to see in full resolution):
The same is true for the main frame texture (space) - Oculus warp shader compresses it on the edges. So, in theory, frame and GUI texture must be rendered with mipmapping enabled. I implemented generation of mipmap levels, and got a soap ... I tried different filters, the simplest Box gives the best results, but is still very blurry:
Box:
Lanczos:
Although Lanczos made better smoothing of broken lines, but fonts looks terrible... The best solution for them is the Nearest Neighbor "filter" (almost equivalent to disabling mipmapping as in the first screenshot). But SE can't render GUI windows and fonts separately!
Using mipmapping on the frame texture is not much affects the quality of the final image, because the first mipmap level is visible only at edges - in Oculus you must strongly squint your eyes to see this area.