freedreno/a3xx: implement half-z clipping
authorIlia Mirkin <imirkin@alum.mit.edu>
Wed, 26 Aug 2015 04:11:23 +0000 (00:11 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sat, 29 Aug 2015 20:18:04 +0000 (16:18 -0400)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/freedreno/a3xx/a3xx.xml.h
src/gallium/drivers/freedreno/a3xx/fd3_rasterizer.c
src/gallium/drivers/freedreno/freedreno_screen.c

index 441bfec5756422fcbdf45f5c53b959698be4d1e4..a157dc33db9dbc0c799e6559f6bc6ae2b90e162b 100644 (file)
@@ -680,6 +680,7 @@ static inline uint32_t REG_A3XX_CP_PROTECT_REG(uint32_t i0) { return 0x00000460
 #define A3XX_GRAS_CL_CLIP_CNTL_VP_CLIP_CODE_IGNORE             0x00080000
 #define A3XX_GRAS_CL_CLIP_CNTL_VP_XFORM_DISABLE                        0x00100000
 #define A3XX_GRAS_CL_CLIP_CNTL_PERSP_DIVISION_DISABLE          0x00200000
+#define A3XX_GRAS_CL_CLIP_CNTL_ZERO_GB_SCALE_Z                 0x00400000
 #define A3XX_GRAS_CL_CLIP_CNTL_ZCOORD                          0x00800000
 #define A3XX_GRAS_CL_CLIP_CNTL_WCOORD                          0x01000000
 #define A3XX_GRAS_CL_CLIP_CNTL_ZCLIP_DISABLE                   0x02000000
index 583caaa806f6fb0e72ecbb33d6f34d5ce5a0569b..260eacd301a2558415329ab162df1521343ca5d2 100644 (file)
@@ -65,7 +65,8 @@ fd3_rasterizer_state_create(struct pipe_context *pctx,
        if (cso->multisample)
                TODO
 */
-       so->gras_cl_clip_cntl = A3XX_GRAS_CL_CLIP_CNTL_IJ_PERSP_CENTER; /* ??? */
+       so->gras_cl_clip_cntl = A3XX_GRAS_CL_CLIP_CNTL_IJ_PERSP_CENTER /* ??? */ |
+               COND(cso->clip_halfz, A3XX_GRAS_CL_CLIP_CNTL_ZERO_GB_SCALE_Z);
        so->gras_su_point_minmax =
                        A3XX_GRAS_SU_POINT_MINMAX_MIN(psize_min) |
                        A3XX_GRAS_SU_POINT_MINMAX_MAX(psize_max);
index 86e9a21da2ff45ef2488d21321c180b976b7b5f5..17dd47c71abd2945e749544fbd7c5ac6f5d12d43 100644 (file)
@@ -191,6 +191,7 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
                return 16383;
 
        case PIPE_CAP_DEPTH_CLIP_DISABLE:
+       case PIPE_CAP_CLIP_HALFZ:
        case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
                return is_a3xx(screen);
 
@@ -228,7 +229,6 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_TGSI_FS_FINE_DERIVATIVE:
        case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
        case PIPE_CAP_SAMPLER_VIEW_TARGET:
-       case PIPE_CAP_CLIP_HALFZ:
        case PIPE_CAP_POLYGON_OFFSET_CLAMP:
        case PIPE_CAP_MULTISAMPLE_Z_RESOLVE:
        case PIPE_CAP_RESOURCE_FROM_USER_MEMORY: