gallium: split depth_clip into depth_clip_near & depth_clip_far
for AMD_depth_clamp_separate.
This commit is contained in:
@@ -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 &&
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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])));
|
||||
|
@@ -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) |
|
||||
|
@@ -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;
|
||||
|
@@ -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 |
|
||||
|
@@ -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)
|
||||
|
@@ -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) */
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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 =
|
||||
|
@@ -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 =
|
||||
|
@@ -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;
|
||||
|
@@ -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 |=
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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,
|
||||
|
@@ -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);
|
||||
|
@@ -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) |
|
||||
|
@@ -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
|
||||
|
@@ -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; */
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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));
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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,
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user