freedreno: constify fd_vsc_pipe
[mesa.git] / src / gallium / drivers / freedreno / a3xx / fd3_rasterizer.c
index 94f6d6e1f51cdd8ba2306faf41bb1020702d0c16..31cc6d422a0b0b739a741b058033d2f6c43b7270 100644 (file)
@@ -1,5 +1,3 @@
-/* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */
-
 /*
  * Copyright (C) 2013 Rob Clark <robclark@freedesktop.org>
  *
@@ -65,7 +63,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);
@@ -73,7 +72,7 @@ fd3_rasterizer_state_create(struct pipe_context *pctx,
        so->gras_su_poly_offset_scale =
                        A3XX_GRAS_SU_POLY_OFFSET_SCALE_VAL(cso->offset_scale);
        so->gras_su_poly_offset_offset =
-                       A3XX_GRAS_SU_POLY_OFFSET_OFFSET(cso->offset_units);
+                       A3XX_GRAS_SU_POLY_OFFSET_OFFSET(cso->offset_units * 2.0f);
 
        so->gras_su_mode_control =
                        A3XX_GRAS_SU_MODE_CONTROL_LINEHALFWIDTH(cso->line_width/2.0);
@@ -97,6 +96,8 @@ fd3_rasterizer_state_create(struct pipe_context *pctx,
 
        if (cso->offset_tri)
                so->gras_su_mode_control |= A3XX_GRAS_SU_MODE_CONTROL_POLY_OFFSET;
+       if (!cso->depth_clip_near)
+               so->gras_cl_clip_cntl |= A3XX_GRAS_CL_CLIP_CNTL_CLIP_DISABLE;
 
        return so;
 }