freedreno/a4xx: add depth clamp and halfz clip
authorIlia Mirkin <imirkin@alum.mit.edu>
Thu, 19 Nov 2015 05:32:39 +0000 (00:32 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Fri, 20 Nov 2015 00:00:18 +0000 (19:00 -0500)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/freedreno/a4xx/a4xx.xml.h
src/gallium/drivers/freedreno/a4xx/fd4_rasterizer.c
src/gallium/drivers/freedreno/freedreno_screen.c

index ec002f679800e22aa866b8549f28582f10f95d1a..ef4f53fa7e586d7bf816493de8380e35e4719f25 100644 (file)
@@ -2059,6 +2059,8 @@ static inline uint32_t A4XX_TPL1_TP_TEX_COUNT_GS(uint32_t val)
 #define REG_A4XX_GRAS_PERFCTR_TSE_SEL_3                                0x00000c8b
 
 #define REG_A4XX_GRAS_CL_CLIP_CNTL                             0x00002000
+#define A4XX_GRAS_CL_CLIP_CNTL_CLIP_DISABLE                    0x00008000
+#define A4XX_GRAS_CL_CLIP_CNTL_ZERO_GB_SCALE_Z                 0x00400000
 
 #define REG_A4XX_GRAS_CLEAR_CNTL                               0x00002003
 #define A4XX_GRAS_CLEAR_CNTL_NOT_FASTCLEAR                     0x00000001
index dc7e98b149d332238d7e290bb46c357fd44ffb50..d894b6b9e096fd51af1461e9688457b8deac8952 100644 (file)
@@ -90,5 +90,10 @@ fd4_rasterizer_state_create(struct pipe_context *pctx,
        if (cso->offset_tri)
                so->gras_su_mode_control |= A4XX_GRAS_SU_MODE_CONTROL_POLY_OFFSET;
 
+       if (!cso->depth_clip)
+               so->gras_cl_clip_cntl |= A4XX_GRAS_CL_CLIP_CNTL_CLIP_DISABLE;
+       if (cso->clip_halfz)
+               so->gras_cl_clip_cntl |= A4XX_GRAS_CL_CLIP_CNTL_ZERO_GB_SCALE_Z;
+
        return so;
 }
index 8ab78d8187cae8b23e0f5d9535f388ef1d39c5ef..adb0982132dce9abbbcd9e603f5f56d561236a16 100644 (file)
@@ -179,6 +179,8 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
        case PIPE_CAP_FAKE_SW_MSAA:
        case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
+       case PIPE_CAP_DEPTH_CLIP_DISABLE:
+       case PIPE_CAP_CLIP_HALFZ:
                return is_a3xx(screen) || is_a4xx(screen);
 
        case PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT:
@@ -192,10 +194,6 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
                if (is_a4xx(screen)) return 16383;
                return 0;
 
-       case PIPE_CAP_DEPTH_CLIP_DISABLE:
-       case PIPE_CAP_CLIP_HALFZ:
-               return is_a3xx(screen);
-
        case PIPE_CAP_TEXTURE_FLOAT_LINEAR:
        case PIPE_CAP_CUBE_MAP_ARRAY:
                return is_a4xx(screen);