Fragment-based discarding clipping issues on Mali GPUs

Mali T760 on Galaxy S6 seems to ignore the GLSL discard command regardless of whether "layout (early_fragment_tests) in;" is defined or not, and Mali seems doesn't support gl_ClipDistance[] in contrast to Adreno and Tegra mobile GPUs.

On mobile GPUs, the PasVulkan GUI renderer uses Z-Buffer-based front-to-back rendering for opaque objects like widgets centers, and back-to-front rendering for transparent objects like widget edges, text, icons, and so on.

And on normal Desktop/Notebook iGPUs/dGPUs the PasVulkan GUI renderer uses brute-force only-alpha-blended back-to-front rendering, because it is faster there than the two-pass-optimization-technique for mobile GPUs but it seems, that at least Mali GPUs has a problem with that two-pass-optimization-technique.

All in all, The PasVulkan GUI renderer uses gl_ClipDistance if it's supported, otherwise it uses fragment discards.

You can see the problem with a Mali GPU and a comparison with a Tegra GPU at


(Galaxy S6 with ARM Mali T760 MP8)

vs


(NVIDIA Tablet K1 with NVIDIA Tegra K1)