diff options
author | Marek Olšák <[email protected]> | 2018-08-21 21:59:23 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-09-06 21:53:00 -0400 |
commit | daa19363def83c025ccf16106b3402268bf1f56f (patch) | |
tree | 94fd791ebf78e36f29ddf8c8cd665a3731688d6e /src/gallium/drivers | |
parent | 7b26741806c521279a1b83f2eae40a277d806626 (diff) |
gallium: split depth_clip into depth_clip_near & depth_clip_far
for AMD_depth_clamp_separate.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/freedreno/a3xx/fd3_emit.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a3xx/fd3_program.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a3xx/fd3_rasterizer.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a4xx/fd4_emit.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a4xx/fd4_rasterizer.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_state_fs.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nv30/nv30_state.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nv50/nv50_state.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nvc0/nvc0_state.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/r600/evergreen_state.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_state.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/softpipe/sp_quad_depth_test.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_pipe_rasterizer.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/swr/swr_state.cpp | 2 | ||||
-rw-r--r-- | src/gallium/drivers/virgl/virgl_encode.c | 2 |
16 files changed, 21 insertions, 21 deletions
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_emit.c b/src/gallium/drivers/freedreno/a3xx/fd3_emit.c index bab3d3d28c8..c970ef63ee7 100644 --- a/src/gallium/drivers/freedreno/a3xx/fd3_emit.c +++ b/src/gallium/drivers/freedreno/a3xx/fd3_emit.c @@ -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]))); diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_program.c b/src/gallium/drivers/freedreno/a3xx/fd3_program.c index b6f8ff33c47..87ba28a6b2c 100644 --- a/src/gallium/drivers/freedreno/a3xx/fd3_program.c +++ b/src/gallium/drivers/freedreno/a3xx/fd3_program.c @@ -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) | diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_rasterizer.c b/src/gallium/drivers/freedreno/a3xx/fd3_rasterizer.c index 260eacd301a..6efff82e336 100644 --- a/src/gallium/drivers/freedreno/a3xx/fd3_rasterizer.c +++ b/src/gallium/drivers/freedreno/a3xx/fd3_rasterizer.c @@ -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; diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_emit.c b/src/gallium/drivers/freedreno/a4xx/fd4_emit.c index 8470fa95783..13cb2c44375 100644 --- a/src/gallium/drivers/freedreno/a4xx/fd4_emit.c +++ b/src/gallium/drivers/freedreno/a4xx/fd4_emit.c @@ -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 | diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_rasterizer.c b/src/gallium/drivers/freedreno/a4xx/fd4_rasterizer.c index b3a42929c50..b57ac19bef8 100644 --- a/src/gallium/drivers/freedreno/a4xx/fd4_rasterizer.c +++ b/src/gallium/drivers/freedreno/a4xx/fd4_rasterizer.c @@ -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) diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index b7e16f92469..ab285bed1ca 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -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) */ diff --git a/src/gallium/drivers/nouveau/nv30/nv30_state.c b/src/gallium/drivers/nouveau/nv30/nv30_state.c index 2a812252c98..19e10d31d92 100644 --- a/src/gallium/drivers/nouveau/nv30/nv30_state.c +++ b/src/gallium/drivers/nouveau/nv30/nv30_state.c @@ -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; } diff --git a/src/gallium/drivers/nouveau/nv50/nv50_state.c b/src/gallium/drivers/nouveau/nv50/nv50_state.c index a7d86b0f90c..fb4a259ce16 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_state.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_state.c @@ -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 = diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c index d9ee62523b9..f2393cb27b5 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c @@ -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 = diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index cc41e114369..49c9ad9ee4a 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -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; diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c index c26a38d9264..9a49ba065f4 100644 --- a/src/gallium/drivers/r600/r600_state.c +++ b/src/gallium/drivers/r600/r600_state.c @@ -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 |= diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index 780d9010abc..18024a9f77d 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -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); diff --git a/src/gallium/drivers/softpipe/sp_quad_depth_test.c b/src/gallium/drivers/softpipe/sp_quad_depth_test.c index 847a616f491..98dd36d21a3 100644 --- a/src/gallium/drivers/softpipe/sp_quad_depth_test.c +++ b/src/gallium/drivers/softpipe/sp_quad_depth_test.c @@ -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; diff --git a/src/gallium/drivers/svga/svga_pipe_rasterizer.c b/src/gallium/drivers/svga/svga_pipe_rasterizer.c index d54ce2d4180..bc0acd94625 100644 --- a/src/gallium/drivers/svga/svga_pipe_rasterizer.c +++ b/src/gallium/drivers/svga/svga_pipe_rasterizer.c @@ -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, diff --git a/src/gallium/drivers/swr/swr_state.cpp b/src/gallium/drivers/swr/swr_state.cpp index c5d755d7200..e540ddb06c8 100644 --- a/src/gallium/drivers/swr/swr_state.cpp +++ b/src/gallium/drivers/swr/swr_state.cpp @@ -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); diff --git a/src/gallium/drivers/virgl/virgl_encode.c b/src/gallium/drivers/virgl/virgl_encode.c index 29920b22be5..d130e4059e6 100644 --- a/src/gallium/drivers/virgl/virgl_encode.c +++ b/src/gallium/drivers/virgl/virgl_encode.c @@ -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) | |