Revert "v3d: do not report alpha-test as supported"
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 21 Oct 2019 08:48:11 +0000 (10:48 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 23 Oct 2019 11:03:55 +0000 (13:03 +0200)
This reverts commit 9d0523b569bb7208c6e74cafc0f3945415d94336.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jose Maria Casanova <jmcasanova@igalia.com>
src/broadcom/compiler/nir_to_vir.c
src/broadcom/compiler/vir.c
src/gallium/drivers/v3d/v3d_screen.c

index 2de7f7e32b088cb3704a51f4b5020f1f88ff4fec..a457b7ad85f90b4a9434da364fc087e513ebff50 100644 (file)
@@ -2030,6 +2030,11 @@ ntq_emit_intrinsic(struct v3d_compile *c, nir_intrinsic_instr *instr)
                                vir_uniform(c, QUNIFORM_VIEWPORT_Z_OFFSET, 0));
                 break;
 
+        case nir_intrinsic_load_alpha_ref_float:
+                ntq_store_dest(c, &instr->dest, 0,
+                               vir_uniform(c, QUNIFORM_ALPHA_REF, 0));
+                break;
+
         case nir_intrinsic_load_sample_mask_in:
                 ntq_store_dest(c, &instr->dest, 0, vir_MSF(c));
                 break;
index af8c7aab1a75712ebb5e8f091472e0902037f41a..99168847adf2b97847f717d0c4b9dd3fc9900d77 100644 (file)
@@ -844,6 +844,12 @@ v3d_nir_lower_fs_late(struct v3d_compile *c)
         if (c->fs_key->clamp_color)
                 NIR_PASS_V(c->s, nir_lower_clamp_color_outputs);
 
+        if (c->fs_key->alpha_test) {
+                NIR_PASS_V(c->s, nir_lower_alpha_test,
+                           c->fs_key->alpha_test_func,
+                           false, NULL);
+        }
+
         if (c->key->ucp_enables)
                 NIR_PASS_V(c->s, nir_lower_clip_fs, c->key->ucp_enables,
                            false);
index d468ae6144ace8a850344815914d7f55a732aeca..0f9e306685e8d37dcb4f07b6034351e30b34533f 100644 (file)
@@ -251,9 +251,6 @@ v3d_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
         case PIPE_CAP_UMA:
                 return 1;
 
-        case PIPE_CAP_ALPHA_TEST:
-                return 0;
-
         default:
                 return u_pipe_screen_get_param_defaults(pscreen, param);
         }