panfrost: do not report alpha-test as supported
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 7 Oct 2019 10:07:20 +0000 (12:07 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Thu, 17 Oct 2019 08:41:36 +0000 (10:41 +0200)
This triggers lowering in the state-tracker, which makes things a bit
simpler.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/panfrost/pan_assemble.c
src/gallium/drivers/panfrost/pan_screen.c
src/panfrost/midgard/midgard_compile.c

index 8c3690c8e8c809e4accf2b466db07c35b2809749..2d1d1d172aada82586317abb47d8b23564d6ccdb 100644 (file)
@@ -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 = {
index 0d67675b7fc31a5da5c39654b84ebddee16ee554..4c21bf3efafd35cc4fd7f77d8b5607a04c3b97c7 100644 (file)
@@ -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);
         }
index 3719ac869b4ef49a26b334af2755ae69a45bda33..cd8a81651574bf97c9c2be00dd9ee4a493b5ebaf 100644 (file)
@@ -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: