freedreno/a4xx: alpha-test
authorRob Clark <robclark@freedesktop.org>
Sat, 20 Dec 2014 17:01:02 +0000 (12:01 -0500)
committerRob Clark <robclark@freedesktop.org>
Sat, 20 Dec 2014 17:08:37 +0000 (12:08 -0500)
Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/a4xx/fd4_zsa.c

index da0c2b748fed9fd85922697dd055af757fd4bca0..e14b617570d0e3d48b40154190e1014b92e99f7e 100644 (file)
@@ -92,10 +92,12 @@ fd4_zsa_state_create(struct pipe_context *pctx,
        }
 
        if (cso->alpha.enabled) {
+               uint32_t ref = cso->alpha.ref_value * 255.0;
                so->gras_alpha_control =
                        A4XX_GRAS_ALPHA_CONTROL_ALPHA_TEST_ENABLE;
                so->rb_alpha_control =
                        A4XX_RB_ALPHA_CONTROL_ALPHA_TEST |
+                       A4XX_RB_ALPHA_CONTROL_ALPHA_REF(ref) |
                        A4XX_RB_ALPHA_CONTROL_ALPHA_TEST_FUNC(cso->alpha.func);
                so->rb_depth_control |=
                        A4XX_RB_DEPTH_CONTROL_EARLY_Z_DISABLE;