for AMD_depth_clamp_separate.
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 &&
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);
/* 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;
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;
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;
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;
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);
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);
}
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;
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);
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;
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;
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;
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;
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;
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;
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);
* 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])));
{
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) |
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;
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 |
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)
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) */
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;
}
SB_DATA (so, fui(cso->offset_clamp));
}
- if (cso->depth_clip) {
+ if (cso->depth_clip_near) {
reg = 0;
} else {
reg =
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 =
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;
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 |=
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);
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);
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;
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,
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);
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) |
* 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
/* 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; */
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);
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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));
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;
}
/* _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);
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,
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;
}
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);
}