Skip to content

v3d/vc4: restore alpha-test lowering

!2213 (merged) included an alpha-test lowering for V3D/VC4, which was causing regressions (#1973 (closed)) and thus were reverted in !2399 (merged).

This MR reintroduces the commits reverted, as well as a fix for the problem that was causing those regressions.

Summing up, the problem was when using GL_NEVER as alpha test func; the lowering in this case never happens, and thus no fragment is discarded. The solution seems to rather initialize the alpha_func as GL_ALWAYS, and run the lowering if the function has changed (because GL_ALWAYS has the same effect as not running the alpha test).

/cc @kusma

Merge request reports