gallium: split depth_clip into depth_clip_near & depth_clip_far
authorMarek Olšák <marek.olsak@amd.com>
Wed, 22 Aug 2018 01:59:23 +0000 (21:59 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 7 Sep 2018 01:53:00 +0000 (21:53 -0400)
for AMD_depth_clamp_separate.

51 files changed:
src/gallium/auxiliary/draw/draw_context.c
src/gallium/auxiliary/driver_trace/tr_dump_state.c
src/gallium/auxiliary/hud/hud_context.c
src/gallium/auxiliary/postprocess/pp_program.c
src/gallium/auxiliary/util/u_blit.c
src/gallium/auxiliary/util/u_blitter.c
src/gallium/auxiliary/util/u_dump_state.c
src/gallium/auxiliary/util/u_tests.c
src/gallium/auxiliary/vl/vl_bicubic_filter.c
src/gallium/auxiliary/vl/vl_compositor.c
src/gallium/auxiliary/vl/vl_deint_filter.c
src/gallium/auxiliary/vl/vl_idct.c
src/gallium/auxiliary/vl/vl_matrix_filter.c
src/gallium/auxiliary/vl/vl_mc.c
src/gallium/auxiliary/vl/vl_median_filter.c
src/gallium/auxiliary/vl/vl_zscan.c
src/gallium/drivers/freedreno/a3xx/fd3_emit.c
src/gallium/drivers/freedreno/a3xx/fd3_program.c
src/gallium/drivers/freedreno/a3xx/fd3_rasterizer.c
src/gallium/drivers/freedreno/a4xx/fd4_emit.c
src/gallium/drivers/freedreno/a4xx/fd4_rasterizer.c
src/gallium/drivers/llvmpipe/lp_state_fs.c
src/gallium/drivers/nouveau/nv30/nv30_state.c
src/gallium/drivers/nouveau/nv50/nv50_state.c
src/gallium/drivers/nouveau/nvc0/nvc0_state.c
src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_state.c
src/gallium/drivers/radeonsi/si_state.c
src/gallium/drivers/softpipe/sp_quad_depth_test.c
src/gallium/drivers/svga/svga_pipe_rasterizer.c
src/gallium/drivers/swr/swr_state.cpp
src/gallium/drivers/virgl/virgl_encode.c
src/gallium/include/pipe/p_state.h
src/gallium/state_trackers/nine/nine_pipe.c
src/gallium/state_trackers/xa/xa_renderer.c
src/gallium/tests/graw/fs-test.c
src/gallium/tests/graw/gs-test.c
src/gallium/tests/graw/quad-sample.c
src/gallium/tests/graw/quad-tex.c
src/gallium/tests/graw/shader-leak.c
src/gallium/tests/graw/tri-gs.c
src/gallium/tests/graw/tri-instanced.c
src/gallium/tests/graw/tri-large.c
src/gallium/tests/graw/tri.c
src/gallium/tests/graw/vs-test.c
src/gallium/tests/trivial/quad-tex.c
src/gallium/tests/trivial/tri.c
src/mesa/state_tracker/st_atom_rasterizer.c
src/mesa/state_tracker/st_cb_bitmap.c
src/mesa/state_tracker/st_cb_clear.c
src/mesa/state_tracker/st_cb_drawpixels.c

index e887272e154a52d92029e8f7c5541281167176a3..3fc096789c0f7a0b5f7c3a18f053ae9e8f3558ef 100644 (file)
@@ -275,7 +275,7 @@ draw_update_clip_flags(struct draw_context *draw)
    draw->guard_band_xy = (!draw->driver.bypass_clip_xy &&
                           draw->driver.guard_band_xy);
    draw->clip_z = (!draw->driver.bypass_clip_z &&
-                   draw->rasterizer && draw->rasterizer->depth_clip) &&
+                   draw->rasterizer && draw->rasterizer->depth_clip_near) &&
                   !window_space;
    draw->clip_user = draw->rasterizer &&
                      draw->rasterizer->clip_plane_enable != 0 &&
index 46fa5747460ea4eeeca664f8f7ac8cbcb380c08b..88a50b80903c919e8987be2be0d150710dd0a0ad 100644 (file)
@@ -143,7 +143,8 @@ void trace_dump_rasterizer_state(const struct pipe_rasterizer_state *state)
 
    trace_dump_member(bool, state, rasterizer_discard);
 
-   trace_dump_member(bool, state, depth_clip);
+   trace_dump_member(bool, state, depth_clip_near);
+   trace_dump_member(bool, state, depth_clip_far);
 
    trace_dump_member(bool, state, clip_halfz);
 
index 3dd7c102edbe0fd4673e2bbb2b6b03ab13c6ccb4..9f9db850a71dbdbfe6ebc64f719225b41b7f848e 100644 (file)
@@ -1860,7 +1860,8 @@ hud_create(struct cso_context *cso, struct hud_context *share)
    /* rasterizer */
    hud->rasterizer.half_pixel_center = 1;
    hud->rasterizer.bottom_edge_rule = 1;
-   hud->rasterizer.depth_clip = 1;
+   hud->rasterizer.depth_clip_near = 1;
+   hud->rasterizer.depth_clip_far = 1;
    hud->rasterizer.line_width = 1;
    hud->rasterizer.line_last_pixel = 1;
 
index cb06c8d81f31998774686472db89aa5be30dd78b..52786de297bdc5cadd2df39f990f4d4ece0a36a4 100644 (file)
@@ -91,7 +91,8 @@ pp_init_prog(struct pp_queue_t *ppq, struct pipe_context *pipe,
    p->rasterizer.cull_face = PIPE_FACE_NONE;
    p->rasterizer.half_pixel_center = 1;
    p->rasterizer.bottom_edge_rule = 1;
-   p->rasterizer.depth_clip = 1;
+   p->rasterizer.depth_clip_near = 1;
+   p->rasterizer.depth_clip_far = 1;
 
    p->sampler.wrap_s = p->sampler.wrap_t = p->sampler.wrap_r =
       PIPE_TEX_WRAP_CLAMP_TO_EDGE;
index ca3d221ed3679c7638ac9120bb8104c944da9db1..15edf2f48dc1d6e0f717637028ff6ddf3290d1db 100644 (file)
@@ -98,7 +98,8 @@ util_create_blit(struct pipe_context *pipe, struct cso_context *cso)
    ctx->rasterizer.cull_face = PIPE_FACE_NONE;
    ctx->rasterizer.half_pixel_center = 1;
    ctx->rasterizer.bottom_edge_rule = 1;
-   ctx->rasterizer.depth_clip = 1;
+   ctx->rasterizer.depth_clip_near = 1;
+   ctx->rasterizer.depth_clip_far = 1;
 
    /* samplers */
    ctx->sampler.wrap_s = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
index fc86fa367c66f534687ad868f5fb3eebf12b2a00..e19fde9873d711b76a72903db3be51985123d9fc 100644 (file)
@@ -276,7 +276,8 @@ struct blitter_context *util_blitter_create(struct pipe_context *pipe)
    rs_state.half_pixel_center = 1;
    rs_state.bottom_edge_rule = 1;
    rs_state.flatshade = 1;
-   rs_state.depth_clip = 1;
+   rs_state.depth_clip_near = 1;
+   rs_state.depth_clip_far = 1;
    ctx->rs_state = pipe->create_rasterizer_state(pipe, &rs_state);
 
    rs_state.scissor = 1;
index 286d5fad75b3609e569a89ede1342e796a3d72b3..638dac79db23b498d7f31b3dbb7e335b78666374 100644 (file)
@@ -368,7 +368,8 @@ util_dump_rasterizer_state(FILE *stream, const struct pipe_rasterizer_state *sta
    util_dump_member(stream, bool, state, half_pixel_center);
    util_dump_member(stream, bool, state, bottom_edge_rule);
    util_dump_member(stream, bool, state, rasterizer_discard);
-   util_dump_member(stream, bool, state, depth_clip);
+   util_dump_member(stream, bool, state, depth_clip_near);
+   util_dump_member(stream, bool, state, depth_clip_far);
    util_dump_member(stream, bool, state, clip_halfz);
    util_dump_member(stream, uint, state, clip_plane_enable);
 
index 7360eb976394d9fefa3fd1d3048fb44ea9b2a201..59953dc70a47977020b72e85346f6808cf44bb5a 100644 (file)
@@ -108,7 +108,8 @@ util_set_rasterizer_normal(struct cso_context *cso)
 
    rs.half_pixel_center = 1;
    rs.bottom_edge_rule = 1;
-   rs.depth_clip = 1;
+   rs.depth_clip_near = 1;
+   rs.depth_clip_far = 1;
 
    cso_set_rasterizer(cso, &rs);
 }
index a3dc6c8c5cfb02861a606aa3b2791d27cfa27de9..f3f8cbee778ebc166854d1d396b1bb5ec84149c6 100644 (file)
@@ -262,7 +262,9 @@ vl_bicubic_filter_init(struct vl_bicubic_filter *filter, struct pipe_context *pi
    memset(&rs_state, 0, sizeof(rs_state));
    rs_state.half_pixel_center = true;
    rs_state.bottom_edge_rule = true;
-   rs_state.depth_clip = 1;
+   rs_state.depth_clip_near = 1;
+   rs_state.depth_clip_far = 1;
+
    filter->rs_state = pipe->create_rasterizer_state(pipe, &rs_state);
    if (!filter->rs_state)
       goto error_rs_state;
index 725bfd9126e7654848221dd23f66af276ab3d096..159a2952af4090a84fa1d4624bdbf2df877a7b42 100644 (file)
@@ -611,7 +611,8 @@ init_pipe_state(struct vl_compositor *c)
    rast.offset_scale = 1;
    rast.half_pixel_center = 1;
    rast.bottom_edge_rule = 1;
-   rast.depth_clip = 1;
+   rast.depth_clip_near = 1;
+   rast.depth_clip_far = 1;
 
    c->rast = c->pipe->create_rasterizer_state(c->pipe, &rast);
 
index d2c48bda7f99006b4d728b1d338d4bd97dbd8d64..dbd6be534e9be18fccef65423fd87c25802ddbc5 100644 (file)
@@ -273,7 +273,9 @@ vl_deint_filter_init(struct vl_deint_filter *filter, struct pipe_context *pipe,
    memset(&rs_state, 0, sizeof(rs_state));
    rs_state.half_pixel_center = true;
    rs_state.bottom_edge_rule = true;
-   rs_state.depth_clip = 1;
+   rs_state.depth_clip_near = 1;
+   rs_state.depth_clip_far = 1;
+
    filter->rs_state = pipe->create_rasterizer_state(pipe, &rs_state);
    if (!filter->rs_state)
       goto error_rs_state;
index 3e6f581244e24d27fabdbad5fee6817cdd7d6c1f..91ff02b3911177080e17dc435388ae52138195d6 100644 (file)
@@ -516,7 +516,9 @@ init_state(struct vl_idct *idct)
    rs_state.point_size = 1;
    rs_state.half_pixel_center = true;
    rs_state.bottom_edge_rule = true;
-   rs_state.depth_clip = 1;
+   rs_state.depth_clip_near = 1;
+   rs_state.depth_clip_far = 1;
+
    idct->rs_state = idct->pipe->create_rasterizer_state(idct->pipe, &rs_state);
    if (!idct->rs_state)
       goto error_rs_state;
index 1dacc7c6025ca6fa4d812ba74c19c2fd4f94b960..4a24c6a3f97d021acde7945545af2e7843ed2fe2 100644 (file)
@@ -151,7 +151,9 @@ vl_matrix_filter_init(struct vl_matrix_filter *filter, struct pipe_context *pipe
    memset(&rs_state, 0, sizeof(rs_state));
    rs_state.half_pixel_center = true;
    rs_state.bottom_edge_rule = true;
-   rs_state.depth_clip = 1;
+   rs_state.depth_clip_near = 1;
+   rs_state.depth_clip_far = 1;
+
    filter->rs_state = pipe->create_rasterizer_state(pipe, &rs_state);
    if (!filter->rs_state)
       goto error_rs_state;
index a202fac54b09d73390a9e56598237cdb8f8ea3df..414aff9623f8588d59b5b15d018c822f35f49900 100644 (file)
@@ -434,7 +434,9 @@ init_pipe_state(struct vl_mc *r)
    rs_state.point_size = VL_BLOCK_WIDTH;
    rs_state.half_pixel_center = true;
    rs_state.bottom_edge_rule = true;
-   rs_state.depth_clip = 1;
+   rs_state.depth_clip_near = 1;
+   rs_state.depth_clip_far = 1;
+
    r->rs_state = r->pipe->create_rasterizer_state(r->pipe, &rs_state);
    if (!r->rs_state)
       goto error_rs_state;
index 273afaf2fb2799e9701a4724e154ed8acd6c469d..b10237d1e56983987f7149800b70aece10bf9cc3 100644 (file)
@@ -262,7 +262,9 @@ vl_median_filter_init(struct vl_median_filter *filter, struct pipe_context *pipe
    memset(&rs_state, 0, sizeof(rs_state));
    rs_state.half_pixel_center = true;
    rs_state.bottom_edge_rule = true;
-   rs_state.depth_clip = 1;
+   rs_state.depth_clip_near = 1;
+   rs_state.depth_clip_far = 1;
+
    filter->rs_state = pipe->create_rasterizer_state(pipe, &rs_state);
    if (!filter->rs_state)
       goto error_rs_state;
index 75013c42bfed423f9f3c7bd368274492b2c737c0..769fc71ff4243219efd1ffd21fa54303ac81ef12 100644 (file)
@@ -297,7 +297,9 @@ init_state(struct vl_zscan *zscan)
    memset(&rs_state, 0, sizeof(rs_state));
    rs_state.half_pixel_center = true;
    rs_state.bottom_edge_rule = true;
-   rs_state.depth_clip = 1;
+   rs_state.depth_clip_near = 1;
+   rs_state.depth_clip_far = 1;
+
    zscan->rs_state = zscan->pipe->create_rasterizer_state(zscan->pipe, &rs_state);
    if (!zscan->rs_state)
       goto error_rs_state;
index bab3d3d28c8af495db8bf12ce123c83c74b4e53f..c970ef63ee76e48235dbde5f6c7d67bea505211c 100644 (file)
@@ -557,7 +557,7 @@ fd3_emit_state(struct fd_context *ctx, struct fd_ringbuffer *ring,
                if (fp->has_kill) {
                        val |= A3XX_RB_DEPTH_CONTROL_EARLY_Z_DISABLE;
                }
-               if (!ctx->rasterizer->depth_clip) {
+               if (!ctx->rasterizer->depth_clip_near) {
                        val |= A3XX_RB_DEPTH_CONTROL_Z_CLAMP_ENABLE;
                }
                OUT_PKT0(ring, REG_A3XX_RB_DEPTH_CONTROL, 1);
@@ -652,7 +652,7 @@ fd3_emit_state(struct fd_context *ctx, struct fd_ringbuffer *ring,
                 * or nothing deal. So when we disable clipping, we must handle the
                 * viewport clip via scissors.
                 */
-               if (!ctx->rasterizer->depth_clip) {
+               if (!ctx->rasterizer->depth_clip_near) {
                        struct pipe_viewport_state *vp = &ctx->viewport;
                        minx = MAX2(minx, (int)floorf(vp->translate[0] - fabsf(vp->scale[0])));
                        miny = MAX2(miny, (int)floorf(vp->translate[1] - fabsf(vp->scale[1])));
index b6f8ff33c4785a4292259048971fd6c8c4351e07..87ba28a6b2ce2023eecfc28427162270d2705f61 100644 (file)
@@ -83,7 +83,7 @@ fd3_needs_manual_clipping(const struct ir3_shader *shader,
 {
        uint64_t outputs = ir3_shader_outputs(shader);
 
-       return (!rast->depth_clip ||
+       return (!rast->depth_clip_near ||
                        util_bitcount(rast->clip_plane_enable) > 6 ||
                        outputs & ((1ULL << VARYING_SLOT_CLIP_VERTEX) |
                                           (1ULL << VARYING_SLOT_CLIP_DIST0) |
index 260eacd301a2558415329ab162df1521343ca5d2..6efff82e336bd3f03d237f0ac3e404baf3890e93 100644 (file)
@@ -98,7 +98,7 @@ 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)
+       if (!cso->depth_clip_near)
                so->gras_cl_clip_cntl |= A3XX_GRAS_CL_CLIP_CNTL_CLIP_DISABLE;
 
        return so;
index 8470fa957831231189c53b2a9f1b0e346a6cca5e..13cb2c443755999d195d2e4d6e83d24b4563c431 100644 (file)
@@ -561,7 +561,7 @@ fd4_emit_state(struct fd_context *ctx, struct fd_ringbuffer *ring,
        if (dirty & (FD_DIRTY_ZSA | FD_DIRTY_RASTERIZER | FD_DIRTY_PROG)) {
                struct fd4_zsa_stateobj *zsa = fd4_zsa_stateobj(ctx->zsa);
                bool fragz = fp->has_kill | fp->writes_pos;
-               bool clamp = !ctx->rasterizer->depth_clip;
+               bool clamp = !ctx->rasterizer->depth_clip_near;
 
                OUT_PKT0(ring, REG_A4XX_RB_DEPTH_CONTROL, 1);
                OUT_RING(ring, zsa->rb_depth_control |
index b3a42929c50cdafbae177baedb046a9bbd49727a..b57ac19bef8d8d4d24f89b132b279d9723a0e81a 100644 (file)
@@ -97,7 +97,7 @@ 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)
+       if (!cso->depth_clip_near)
                so->gras_cl_clip_cntl |= A4XX_GRAS_CL_CLIP_CNTL_ZNEAR_CLIP_DISABLE |
                        A4XX_GRAS_CL_CLIP_CNTL_ZFAR_CLIP_DISABLE;
        if (cso->clip_halfz)
index b7e16f92469782d540e7862281114283a37094c8..ab285bed1cab9ef8b83de7fbd0e266657113cdf6 100644 (file)
@@ -3212,7 +3212,7 @@ make_variant_key(struct llvmpipe_context *lp,
    if (lp->rasterizer->clip_halfz) {
       key->depth_clamp = 1;
    } else {
-      key->depth_clamp = (lp->rasterizer->depth_clip == 0) ? 1 : 0;
+      key->depth_clamp = (lp->rasterizer->depth_clip_near == 0) ? 1 : 0;
    }
 
    /* alpha test only applies if render buffer 0 is non-integer (or does not exist) */
index 2a812252c9831ddc2825e683326b5c81135f076e..19e10d31d92fba1a06360e78b80b3337beb582c9 100644 (file)
@@ -188,7 +188,7 @@ nv30_rasterizer_state_create(struct pipe_context *pipe,
    SB_DATA  (so, cso->flatshade_first);
 
    SB_MTHD30(so, DEPTH_CONTROL, 1);
-   SB_DATA  (so, cso->depth_clip ? 0x00000001 : 0x00000010);
+   SB_DATA  (so, cso->depth_clip_near ? 0x00000001 : 0x00000010);
    return so;
 }
 
index a7d86b0f90c49ec1d5bff046f0f1b6930ae1703d..fb4a259ce1657b7d157007c205bf972bff18e35c 100644 (file)
@@ -315,7 +315,7 @@ nv50_rasterizer_state_create(struct pipe_context *pipe,
       SB_DATA    (so, fui(cso->offset_clamp));
    }
 
-   if (cso->depth_clip) {
+   if (cso->depth_clip_near) {
       reg = 0;
    } else {
       reg =
index d9ee62523b9ada3fbad2aec37ed609fa39fea0a3..f2393cb27b5f3e706d7044e94e64f466b62ec8da 100644 (file)
@@ -311,7 +311,7 @@ nvc0_rasterizer_state_create(struct pipe_context *pipe,
         SB_DATA    (so, fui(cso->offset_clamp));
     }
 
-    if (cso->depth_clip)
+    if (cso->depth_clip_near)
        reg = NVC0_3D_VIEW_VOLUME_CLIP_CTRL_UNK1_UNK1;
     else
        reg =
index cc41e1143693ee3f489b3fff13363eac15727f08..49c9ad9ee4ab364c93e22e14e05a2f510363570d 100644 (file)
@@ -492,8 +492,8 @@ static void *evergreen_create_rs_state(struct pipe_context *ctx,
                                S_028A0C_REPEAT_COUNT(state->line_stipple_factor) : 0;
        rs->pa_cl_clip_cntl =
                S_028810_DX_CLIP_SPACE_DEF(state->clip_halfz) |
-               S_028810_ZCLIP_NEAR_DISABLE(!state->depth_clip) |
-               S_028810_ZCLIP_FAR_DISABLE(!state->depth_clip) |
+               S_028810_ZCLIP_NEAR_DISABLE(!state->depth_clip_near) |
+               S_028810_ZCLIP_FAR_DISABLE(!state->depth_clip_near) |
                S_028810_DX_LINEAR_ATTR_CLIP_ENA(1) |
                S_028810_DX_RASTERIZATION_KILL(state->rasterizer_discard);
        rs->multisample_enable = state->multisample;
index c26a38d92647fca5834003616a7ba45b79e6d398..9a49ba065f40697f3f104825b31154ee82180834 100644 (file)
@@ -479,8 +479,8 @@ static void *r600_create_rs_state(struct pipe_context *ctx,
                                S_028A0C_REPEAT_COUNT(state->line_stipple_factor) : 0;
        rs->pa_cl_clip_cntl =
                S_028810_DX_CLIP_SPACE_DEF(state->clip_halfz) |
-               S_028810_ZCLIP_NEAR_DISABLE(!state->depth_clip) |
-               S_028810_ZCLIP_FAR_DISABLE(!state->depth_clip) |
+               S_028810_ZCLIP_NEAR_DISABLE(!state->depth_clip_near) |
+               S_028810_ZCLIP_FAR_DISABLE(!state->depth_clip_near) |
                S_028810_DX_LINEAR_ATTR_CLIP_ENA(1);
        if (rctx->b.chip_class == R700) {
                rs->pa_cl_clip_cntl |=
index 780d9010abcd888fb7d3d8608dea8c1c77199e19..18024a9f77dc14f2578d9415e385b0f24dca4476 100644 (file)
@@ -869,8 +869,8 @@ static void *si_create_rs_state(struct pipe_context *ctx,
                                S_028A0C_REPEAT_COUNT(state->line_stipple_factor) : 0;
        rs->pa_cl_clip_cntl =
                S_028810_DX_CLIP_SPACE_DEF(state->clip_halfz) |
-               S_028810_ZCLIP_NEAR_DISABLE(!state->depth_clip) |
-               S_028810_ZCLIP_FAR_DISABLE(!state->depth_clip) |
+               S_028810_ZCLIP_NEAR_DISABLE(!state->depth_clip_near) |
+               S_028810_ZCLIP_FAR_DISABLE(!state->depth_clip_near) |
                S_028810_DX_RASTERIZATION_KILL(state->rasterizer_discard) |
                S_028810_DX_LINEAR_ATTR_CLIP_ENA(1);
 
index 847a616f4911e28a0d6b8b10da31ef4149283f06..98dd36d21a394522ee7da2af92662cc52f5e2ed6 100644 (file)
@@ -803,7 +803,7 @@ depth_test_quads_fallback(struct quad_stage *qs,
       data.tile = sp_get_cached_tile(qs->softpipe->zsbuf_cache, 
                                      quads[0]->input.x0, 
                                      quads[0]->input.y0, quads[0]->input.layer);
-      data.clamp = !qs->softpipe->rasterizer->depth_clip;
+      data.clamp = !qs->softpipe->rasterizer->depth_clip_near;
 
       near_val = qs->softpipe->viewports[vp_idx].translate[2] - qs->softpipe->viewports[vp_idx].scale[2];
       far_val = near_val + (qs->softpipe->viewports[vp_idx].scale[2] * 2.0);
@@ -916,7 +916,7 @@ choose_depth_test(struct quad_stage *qs,
 
    boolean occlusion = qs->softpipe->active_query_count;
 
-   boolean clipped = !qs->softpipe->rasterizer->depth_clip;
+   boolean clipped = !qs->softpipe->rasterizer->depth_clip_near;
 
    if(!qs->softpipe->framebuffer.zsbuf)
       depth = depthwrite = stencil = FALSE;
index d54ce2d41809fdbf449f1940dec678d8a2132bac..bc0acd94625f42487f7df87baa510bce830f7b8d 100644 (file)
@@ -142,7 +142,7 @@ define_rasterizer_object(struct svga_context *svga,
                                              depth_bias,
                                              depth_bias_clamp,
                                              slope_scaled_depth_bias,
-                                             rast->templ.depth_clip,
+                                             rast->templ.depth_clip_near,
                                              rast->templ.scissor,
                                              rast->templ.multisample,
                                              rast->templ.line_smooth,
index c5d755d72009282fec5865445b7123966d771d05..e540ddb06c868046d9afcd3aaccc776d85670235 100644 (file)
@@ -1198,7 +1198,7 @@ swr_update_derived(struct pipe_context *pipe,
       if (zb && swr_resource(zb->texture)->has_depth)
          rastState->depthFormat = swr_resource(zb->texture)->swr.format;
 
-      rastState->depthClipEnable = rasterizer->depth_clip;
+      rastState->depthClipEnable = rasterizer->depth_clip_near;
       rastState->clipHalfZ = rasterizer->clip_halfz;
 
       ctx->api.pfnSwrSetRastState(ctx->swrContext, rastState);
index 29920b22be550bd135168a05ef5b82f6ffeac3ec..d130e4059e69c71ea5441919c7ead7c56a2dda97 100644 (file)
@@ -154,7 +154,7 @@ int virgl_encode_rasterizer_state(struct virgl_context *ctx,
    virgl_encoder_write_dword(ctx->cbuf, handle);
 
    tmp = VIRGL_OBJ_RS_S0_FLATSHADE(state->flatshade) |
-      VIRGL_OBJ_RS_S0_DEPTH_CLIP(state->depth_clip) |
+      VIRGL_OBJ_RS_S0_DEPTH_CLIP(state->depth_clip_near) |
       VIRGL_OBJ_RS_S0_CLIP_HALFZ(state->clip_halfz) |
       VIRGL_OBJ_RS_S0_RASTERIZER_DISCARD(state->rasterizer_discard) |
       VIRGL_OBJ_RS_S0_FLATSHADE_FIRST(state->flatshade_first) |
index 671cccda4eb25fcf7557109117eb95b3b2a2c58c..95a18a72b5cff3f9dc36cbcac9cb0375c115b31d 100644 (file)
@@ -151,8 +151,12 @@ struct pipe_rasterizer_state
     * When false, depth clipping is disabled and the depth value will be
     * clamped later at the per-pixel level before depth testing.
     * This depends on PIPE_CAP_DEPTH_CLIP_DISABLE.
+    *
+    * If PIPE_CAP_DEPTH_CLIP_DISABLE_SEPARATE is unsupported, depth_clip_near
+    * is equal to depth_clip_far.
     */
-   unsigned depth_clip:1;
+   unsigned depth_clip_near:1;
+   unsigned depth_clip_far:1;
 
    /**
     * When true clip space in the z axis goes from [0..1] (D3D).  When false
index a28b4c6d57a6f1fd0c8811529e2e2d3217e3b8a2..a84a17f551f92659a0053f72d5a1381a9d24fefd 100644 (file)
@@ -105,7 +105,8 @@ nine_convert_rasterizer_state(struct NineDevice9 *device,
  /* rast.lower_left_origin = 0; */
  /* rast.bottom_edge_rule = 0; */
  /* rast.rasterizer_discard = 0; */
-    rast.depth_clip = 1;
+    rast.depth_clip_near = 1;
+    rast.depth_clip_far = 1;
     rast.clip_halfz = 1;
     rast.clip_plane_enable = rs[D3DRS_CLIPPLANEENABLE];
  /* rast.line_stipple_factor = 0; */
index e3311232e77db86d021d66852c1a84cebbaac3ed..d87a14e80880cc154a6175d296042f97018ce0a2 100644 (file)
@@ -121,7 +121,8 @@ renderer_init_state(struct xa_context *r)
     memset(&raster, 0, sizeof(struct pipe_rasterizer_state));
     raster.half_pixel_center = 1;
     raster.bottom_edge_rule = 1;
-    raster.depth_clip = 1;
+    raster.depth_clip_near = 1;
+    raster.depth_clip_far = 1;
     raster.scissor = 1;
     cso_set_rasterizer(r->cso, &raster);
 
index cc87b02a0a2485baa14cff86aaeac85a3191a150..a4182be55bd9b4c0c1be49e423204f69656beaa3 100644 (file)
@@ -458,7 +458,8 @@ static void init( void )
       rasterizer.cull_face = PIPE_FACE_NONE;
       rasterizer.half_pixel_center = 1;
       rasterizer.bottom_edge_rule = 1;
-      rasterizer.depth_clip = 1;
+      rasterizer.depth_clip_near = 1;
+      rasterizer.depth_clip_far = 1;
       handle = ctx->create_rasterizer_state(ctx, &rasterizer);
       ctx->bind_rasterizer_state(ctx, handle);
    }
index 9c3c29bc3c64158437a9ce23311847b5eea7bd11..a984e0acfb01e650f8d8f2b5ba717a2e1e22266a 100644 (file)
@@ -548,7 +548,8 @@ static void init( void )
       rasterizer.cull_face = PIPE_FACE_NONE;
       rasterizer.half_pixel_center = 1;
       rasterizer.bottom_edge_rule = 1;
-      rasterizer.depth_clip = 1;
+      rasterizer.depth_clip_near = 1;
+      rasterizer.depth_clip_far = 1;
       handle = ctx->create_rasterizer_state(ctx, &rasterizer);
       ctx->bind_rasterizer_state(ctx, handle);
    }
index d532e60e1e266295f499f63f1fb0a2c62d67dc88..a5029484b3ba6956645deb1d70ee1686df39c8b0 100644 (file)
@@ -373,7 +373,8 @@ static void init( void )
       rasterizer.cull_face = PIPE_FACE_NONE;
       rasterizer.half_pixel_center = 1;
       rasterizer.bottom_edge_rule = 1;
-      rasterizer.depth_clip = 1;
+      rasterizer.depth_clip_near = 1;
+      rasterizer.depth_clip_far = 1;
       handle = ctx->create_rasterizer_state(ctx, &rasterizer);
       ctx->bind_rasterizer_state(ctx, handle);
    }
index 444f64e947f6ed4cb930848c1d651b84035c9e66..35ba4fa3469adc16a8ea4e16165b284bde7a230a 100644 (file)
@@ -192,7 +192,8 @@ static void init( void )
       rasterizer.cull_face = PIPE_FACE_NONE;
       rasterizer.half_pixel_center = 1;
       rasterizer.bottom_edge_rule = 1;
-      rasterizer.depth_clip = 1;
+      rasterizer.depth_clip_near = 1;
+      rasterizer.depth_clip_far = 1;
       handle = info.ctx->create_rasterizer_state(info.ctx, &rasterizer);
       info.ctx->bind_rasterizer_state(info.ctx, handle);
    }
index 4178448f768394776e2efe455d5240392ed82931..8fa1a727f54327e536437fcea14e6d148f12c7d5 100644 (file)
@@ -250,7 +250,8 @@ static void init( void )
       rasterizer.cull_face = PIPE_FACE_NONE;
       rasterizer.half_pixel_center = 1;
       rasterizer.bottom_edge_rule = 1;
-      rasterizer.depth_clip = 1;
+      rasterizer.depth_clip_near = 1;
+      rasterizer.depth_clip_far = 1;
       handle = ctx->create_rasterizer_state(ctx, &rasterizer);
       ctx->bind_rasterizer_state(ctx, handle);
    }
index 5efc9e87c4c44fe62f11caa4da96306a60faf730..ed721f378b1f9d03e79e71cb3c139f4d5d44ca89 100644 (file)
@@ -255,7 +255,8 @@ static void init( void )
       rasterizer.cull_face = PIPE_FACE_NONE;
       rasterizer.half_pixel_center = 1;
       rasterizer.bottom_edge_rule = 1;
-      rasterizer.depth_clip = 1;
+      rasterizer.depth_clip_near = 1;
+      rasterizer.depth_clip_far = 1;
       handle = ctx->create_rasterizer_state(ctx, &rasterizer);
       ctx->bind_rasterizer_state(ctx, handle);
    }
index 9bd2ff58687607a476c91441819806e92b885c24..297377b894e26f35575e4c814d132a38052ddf1d 100644 (file)
@@ -306,7 +306,8 @@ static void init( void )
       rasterizer.cull_face = PIPE_FACE_NONE;
       rasterizer.half_pixel_center = 1;
       rasterizer.bottom_edge_rule = 1;
-      rasterizer.depth_clip = 1;
+      rasterizer.depth_clip_near = 1;
+      rasterizer.depth_clip_far = 1;
       handle = ctx->create_rasterizer_state(ctx, &rasterizer);
       ctx->bind_rasterizer_state(ctx, handle);
    }
index 1ca915aa1265a80b619980d45a78182a94a9f429..78a2ddbda449d86b4bfdb543632851b2f6becc7a 100644 (file)
@@ -131,7 +131,8 @@ static void init( void )
       rasterizer.half_pixel_center = 1;
       rasterizer.bottom_edge_rule = 1;
       rasterizer.flatshade = FlatShade;
-      rasterizer.depth_clip = 1;
+      rasterizer.depth_clip_near = 1;
+      rasterizer.depth_clip_far = 1;
       handle = info.ctx->create_rasterizer_state(info.ctx, &rasterizer);
       info.ctx->bind_rasterizer_state(info.ctx, handle);
    }
index b62a2ab4896f91a9418fc6f550bf873df8aa2131..2267d98a8feafa5fe1ea19dd4ca7a247c87e4259 100644 (file)
@@ -128,7 +128,8 @@ static void init( void )
       rasterizer.half_pixel_center = 1;
       rasterizer.bottom_edge_rule = 1;
       rasterizer.flatshade = FlatShade;
-      rasterizer.depth_clip = 1;
+      rasterizer.depth_clip_near = 1;
+      rasterizer.depth_clip_far = 1;
       handle = info.ctx->create_rasterizer_state(info.ctx, &rasterizer);
       info.ctx->bind_rasterizer_state(info.ctx, handle);
    }
index 26976f41682b4a01419b13849df21b206a686239..b3714543b3a8715b32a6985e6ae1b91d09d8064b 100644 (file)
@@ -447,7 +447,8 @@ static void init( void )
       rasterizer.point_size = 8.0;
       rasterizer.half_pixel_center = 1;
       rasterizer.bottom_edge_rule = 1;
-      rasterizer.depth_clip = 1;
+      rasterizer.depth_clip_near = 1;
+      rasterizer.depth_clip_far = 1;
       handle = ctx->create_rasterizer_state(ctx, &rasterizer);
       ctx->bind_rasterizer_state(ctx, handle);
    }
index 1f29306ec0453ecf9eabbeb540b758838d1b9784..9a9d7012249cc5e69e779149533faa0c602a8a5b 100644 (file)
@@ -200,7 +200,8 @@ static void init_prog(struct program *p)
        p->rasterizer.cull_face = PIPE_FACE_NONE;
        p->rasterizer.half_pixel_center = 1;
        p->rasterizer.bottom_edge_rule = 1;
-       p->rasterizer.depth_clip = 1;
+       p->rasterizer.depth_clip_near = 1;
+       p->rasterizer.depth_clip_far = 1;
 
        /* sampler */
        memset(&p->sampler, 0, sizeof(p->sampler));
index 87a335fba1e5818bcae4c0f4878af93db0d00ebd..3827edc0da3761ead2c3669a5bfb50442d20715e 100644 (file)
@@ -154,7 +154,8 @@ static void init_prog(struct program *p)
        p->rasterizer.cull_face = PIPE_FACE_NONE;
        p->rasterizer.half_pixel_center = 1;
        p->rasterizer.bottom_edge_rule = 1;
-       p->rasterizer.depth_clip = 1;
+       p->rasterizer.depth_clip_near = 1;
+       p->rasterizer.depth_clip_far = 1;
 
        surf_tmpl.format = PIPE_FORMAT_B8G8R8A8_UNORM;
        surf_tmpl.u.tex.level = 0;
index 1f66b9d05976c84715c0b7c3ed23974fe35c4c4a..2bffa684a25336599c6ff9d2627268b8deeb8478 100644 (file)
@@ -294,8 +294,8 @@ st_update_rasterizer(struct st_context *st)
    }
 
    /* _NEW_TRANSFORM */
-   raster->depth_clip = !(ctx->Transform.DepthClampNear &&
-                          ctx->Transform.DepthClampFar);
+   raster->depth_clip_near = !ctx->Transform.DepthClampNear;
+   raster->depth_clip_far = !ctx->Transform.DepthClampFar;
    raster->clip_plane_enable = ctx->Transform.ClipPlanesEnabled;
    raster->clip_halfz = (ctx->Transform.ClipDepthMode == GL_ZERO_TO_ONE);
 
index babb00178ae2cd8d76c1da6d8718cefac9b3924b..a73d6c7e06233bab59f094032b73d662437e2743 100644 (file)
@@ -560,7 +560,8 @@ init_bitmap_state(struct st_context *st)
    memset(&st->bitmap.rasterizer, 0, sizeof(st->bitmap.rasterizer));
    st->bitmap.rasterizer.half_pixel_center = 1;
    st->bitmap.rasterizer.bottom_edge_rule = 1;
-   st->bitmap.rasterizer.depth_clip = 1;
+   st->bitmap.rasterizer.depth_clip_near = 1;
+   st->bitmap.rasterizer.depth_clip_far = 1;
 
    /* find a usable texture format */
    if (screen->is_format_supported(screen, PIPE_FORMAT_I8_UNORM,
index fbc577a370c9848920254eced06d095a1aa1ef4c..22e85019764ae5ab36c4430914f796b74288e0de 100644 (file)
@@ -71,7 +71,8 @@ st_init_clear(struct st_context *st)
 
    st->clear.raster.half_pixel_center = 1;
    st->clear.raster.bottom_edge_rule = 1;
-   st->clear.raster.depth_clip = 1;
+   st->clear.raster.depth_clip_near = 1;
+   st->clear.raster.depth_clip_far = 1;
 }
 
 
index 67bbb358500614707d13ee950f3b1bb23fe8359c..cb50b7104a0b4f6adedfc5aa2a913b592c7d2591 100644 (file)
@@ -677,8 +677,8 @@ draw_textured_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z,
                                         ctx->Color._ClampFragmentColor;
       rasterizer.half_pixel_center = 1;
       rasterizer.bottom_edge_rule = 1;
-      rasterizer.depth_clip = !(ctx->Transform.DepthClampNear &&
-                                ctx->Transform.DepthClampFar);
+      rasterizer.depth_clip_near = !ctx->Transform.DepthClampNear;
+      rasterizer.depth_clip_far = !ctx->Transform.DepthClampFar;
       rasterizer.scissor = ctx->Scissor.EnableFlags;
       cso_set_rasterizer(cso, &rasterizer);
    }