From 2da792d398de445240a7216fe5266903b8daace3 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Mon, 7 Oct 2019 12:07:20 +0200 Subject: [PATCH] panfrost: do not report alpha-test as supported MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This triggers lowering in the state-tracker, which makes things a bit simpler. Reviewed-by: Marek Olšák --- src/gallium/drivers/panfrost/pan_assemble.c | 9 --------- src/gallium/drivers/panfrost/pan_screen.c | 3 +++ src/panfrost/midgard/midgard_compile.c | 11 ----------- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_assemble.c b/src/gallium/drivers/panfrost/pan_assemble.c index 8c3690c8e8c..2d1d1d172aa 100644 --- a/src/gallium/drivers/panfrost/pan_assemble.c +++ b/src/gallium/drivers/panfrost/pan_assemble.c @@ -59,15 +59,6 @@ panfrost_shader_compile( s->info.stage = stage; - if (stage == MESA_SHADER_FRAGMENT) { - /* Inject the alpha test now if we need to */ - - if (state->alpha_state.enabled) { - NIR_PASS_V(s, nir_lower_alpha_test, - state->alpha_state.func, false, NULL); - } - } - /* Call out to Midgard compiler given the above NIR */ midgard_program program = { diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c index 0d67675b7fc..4c21bf3efaf 100644 --- a/src/gallium/drivers/panfrost/pan_screen.c +++ b/src/gallium/drivers/panfrost/pan_screen.c @@ -244,6 +244,9 @@ panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param) case PIPE_CAP_MAX_VARYINGS: return 16; + case PIPE_CAP_ALPHA_TEST: + return 0; + default: return u_pipe_screen_get_param_defaults(screen, param); } diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c index 3719ac869b4..cd8a8165157 100644 --- a/src/panfrost/midgard/midgard_compile.c +++ b/src/panfrost/midgard/midgard_compile.c @@ -1548,17 +1548,6 @@ emit_intrinsic(compiler_context *ctx, nir_intrinsic_instr *instr) emit_ssbo_access(ctx, &instr->instr, false, reg, offset, indirect_offset, uindex); break; - case nir_intrinsic_load_alpha_ref_float: - assert(instr->dest.is_ssa); - - float ref_value = ctx->alpha_ref; - - /* See emit_load_const */ - float *v = ralloc_array(NULL, float, 4); - memcpy(v, &ref_value, sizeof(float)); - _mesa_hash_table_u64_insert(ctx->ssa_constants, (instr->dest.ssa.index << 1) + 1, v); - break; - case nir_intrinsic_load_viewport_scale: case nir_intrinsic_load_viewport_offset: case nir_intrinsic_load_num_work_groups: -- 2.30.2