Looks like we don't have CI coverage for this (since deqp==GLES) but
alpha test is conceptually the same as frag shaders with discard, and
should be handled as such.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5298>
static enum a6xx_ztest_mode
compute_ztest_mode(struct fd6_emit *emit, bool lrz_valid)
{
+ struct fd6_zsa_stateobj *zsa = fd6_zsa_stateobj(emit->ctx->zsa);
const struct ir3_shader_variant *fs = emit->fs;
if (fs->no_earlyz || fs->writes_pos) {
return A6XX_LATE_Z;
- } else if (fs->has_kill) {
+ } else if (fs->has_kill || zsa->alpha_test) {
return lrz_valid ? A6XX_EARLY_LRZ_LATE_Z : A6XX_LATE_Z;
} else {
return A6XX_EARLY_Z;
*/
if (cso->alpha.func != PIPE_FUNC_ALWAYS) {
so->lrz.write = false;
+ so->alpha_test = true;
}
uint32_t ref = cso->alpha.ref_value * 255.0;
struct fd6_lrz_state lrz;
bool invalidate_lrz;
+ bool alpha_test;
struct fd_ringbuffer *stateobj;
struct fd_ringbuffer *stateobj_no_alpha;