[Mesa-dev] [PATCH 1/2] gallium: split depth_clip into depth_clip_near & depth_clip_far
Marek Olšák
maraeo at gmail.com
Wed Aug 29 22:21:59 UTC 2018
From: Marek Olšák <marek.olsak at amd.com>
for AMD_depth_clamp_separate.
---
src/gallium/auxiliary/draw/draw_context.c | 2 +-
src/gallium/auxiliary/driver_trace/tr_dump_state.c | 3 ++-
src/gallium/auxiliary/hud/hud_context.c | 3 ++-
src/gallium/auxiliary/postprocess/pp_program.c | 3 ++-
src/gallium/auxiliary/util/u_blit.c | 3 ++-
src/gallium/auxiliary/util/u_blitter.c | 3 ++-
src/gallium/auxiliary/util/u_dump_state.c | 3 ++-
src/gallium/auxiliary/util/u_tests.c | 3 ++-
src/gallium/auxiliary/vl/vl_bicubic_filter.c | 4 +++-
src/gallium/auxiliary/vl/vl_compositor.c | 3 ++-
src/gallium/auxiliary/vl/vl_deint_filter.c | 4 +++-
src/gallium/auxiliary/vl/vl_idct.c | 4 +++-
src/gallium/auxiliary/vl/vl_matrix_filter.c | 4 +++-
src/gallium/auxiliary/vl/vl_mc.c | 4 +++-
src/gallium/auxiliary/vl/vl_median_filter.c | 4 +++-
src/gallium/auxiliary/vl/vl_zscan.c | 4 +++-
src/gallium/drivers/freedreno/a3xx/fd3_emit.c | 4 ++--
src/gallium/drivers/freedreno/a3xx/fd3_program.c | 2 +-
src/gallium/drivers/freedreno/a3xx/fd3_rasterizer.c | 2 +-
src/gallium/drivers/freedreno/a4xx/fd4_emit.c | 2 +-
src/gallium/drivers/freedreno/a4xx/fd4_rasterizer.c | 2 +-
src/gallium/drivers/llvmpipe/lp_state_fs.c | 2 +-
src/gallium/drivers/nouveau/nv30/nv30_state.c | 2 +-
src/gallium/drivers/nouveau/nv50/nv50_state.c | 2 +-
src/gallium/drivers/nouveau/nvc0/nvc0_state.c | 2 +-
src/gallium/drivers/r600/evergreen_state.c | 4 ++--
src/gallium/drivers/r600/r600_state.c | 4 ++--
src/gallium/drivers/radeonsi/si_state.c | 4 ++--
src/gallium/drivers/softpipe/sp_quad_depth_test.c | 4 ++--
src/gallium/drivers/svga/svga_pipe_rasterizer.c | 2 +-
src/gallium/drivers/swr/swr_state.cpp | 2 +-
src/gallium/drivers/virgl/virgl_encode.c | 2 +-
src/gallium/include/pipe/p_state.h | 6 +++++-
src/gallium/state_trackers/nine/nine_pipe.c | 3 ++-
src/gallium/state_trackers/xa/xa_renderer.c | 3 ++-
src/gallium/tests/graw/fs-test.c | 3 ++-
src/gallium/tests/graw/gs-test.c | 3 ++-
src/gallium/tests/graw/quad-sample.c | 3 ++-
src/gallium/tests/graw/quad-tex.c | 3 ++-
src/gallium/tests/graw/shader-leak.c | 3 ++-
src/gallium/tests/graw/tri-gs.c | 3 ++-
src/gallium/tests/graw/tri-instanced.c | 3 ++-
src/gallium/tests/graw/tri-large.c | 3 ++-
src/gallium/tests/graw/tri.c | 3 ++-
src/gallium/tests/graw/vs-test.c | 3 ++-
src/gallium/tests/trivial/quad-tex.c | 3 ++-
src/gallium/tests/trivial/tri.c | 3 ++-
src/mesa/state_tracker/st_atom_rasterizer.c | 4 ++--
src/mesa/state_tracker/st_cb_bitmap.c | 3 ++-
src/mesa/state_tracker/st_cb_clear.c | 3 ++-
src/mesa/state_tracker/st_cb_drawpixels.c | 4 ++--
51 files changed, 100 insertions(+), 58 deletions(-)
diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c
index e887272e154..3fc096789c0 100644
--- a/src/gallium/auxiliary/draw/draw_context.c
+++ b/src/gallium/auxiliary/draw/draw_context.c
@@ -268,21 +268,21 @@ draw_is_vs_window_space(struct draw_context *draw)
void
draw_update_clip_flags(struct draw_context *draw)
{
bool window_space = draw_is_vs_window_space(draw);
draw->clip_xy = !draw->driver.bypass_clip_xy && !window_space;
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 &&
!window_space;
draw->guard_band_points_xy = draw->guard_band_xy ||
(draw->driver.bypass_clip_points &&
(draw->rasterizer &&
draw->rasterizer->point_tri_clip));
}
diff --git a/src/gallium/auxiliary/driver_trace/tr_dump_state.c b/src/gallium/auxiliary/driver_trace/tr_dump_state.c
index 46fa5747460..88a50b80903 100644
--- a/src/gallium/auxiliary/driver_trace/tr_dump_state.c
+++ b/src/gallium/auxiliary/driver_trace/tr_dump_state.c
@@ -136,21 +136,22 @@ void trace_dump_rasterizer_state(const struct pipe_rasterizer_state *state)
trace_dump_member(bool, state, line_stipple_enable);
trace_dump_member(bool, state, line_last_pixel);
trace_dump_member(bool, state, flatshade_first);
trace_dump_member(bool, state, half_pixel_center);
trace_dump_member(bool, state, bottom_edge_rule);
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);
trace_dump_member(uint, state, clip_plane_enable);
trace_dump_member(uint, state, line_stipple_factor);
trace_dump_member(uint, state, line_stipple_pattern);
trace_dump_member(uint, state, sprite_coord_enable);
diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c
index 3dd7c102edb..9f9db850a71 100644
--- a/src/gallium/auxiliary/hud/hud_context.c
+++ b/src/gallium/auxiliary/hud/hud_context.c
@@ -1853,21 +1853,22 @@ hud_create(struct cso_context *cso, struct hud_context *share)
hud->alpha_blend.rt[0].rgb_func = PIPE_BLEND_ADD;
hud->alpha_blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_SRC_ALPHA;
hud->alpha_blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_INV_SRC_ALPHA;
hud->alpha_blend.rt[0].alpha_func = PIPE_BLEND_ADD;
hud->alpha_blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ZERO;
hud->alpha_blend.rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ONE;
/* 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;
hud->rasterizer_aa_lines = hud->rasterizer;
hud->rasterizer_aa_lines.line_smooth = 1;
/* vertex elements */
for (i = 0; i < 2; i++) {
hud->velems[i].src_offset = i * 2 * sizeof(float);
hud->velems[i].src_format = PIPE_FORMAT_R32G32_FLOAT;
diff --git a/src/gallium/auxiliary/postprocess/pp_program.c b/src/gallium/auxiliary/postprocess/pp_program.c
index cb06c8d81f3..52786de297b 100644
--- a/src/gallium/auxiliary/postprocess/pp_program.c
+++ b/src/gallium/auxiliary/postprocess/pp_program.c
@@ -84,21 +84,22 @@ pp_init_prog(struct pp_queue_t *ppq, struct pipe_context *pipe,
p->blend.rt[0].colormask = PIPE_MASK_RGBA;
p->blend.rt[0].rgb_src_factor = p->blend.rt[0].alpha_src_factor =
PIPE_BLENDFACTOR_SRC_ALPHA;
p->blend.rt[0].rgb_dst_factor = p->blend.rt[0].alpha_dst_factor =
PIPE_BLENDFACTOR_INV_SRC_ALPHA;
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;
p->sampler.min_mip_filter = PIPE_TEX_MIPFILTER_NONE;
p->sampler.min_img_filter = p->sampler.mag_img_filter =
PIPE_TEX_FILTER_LINEAR;
p->sampler.normalized_coords = 1;
p->sampler_point.wrap_s = p->sampler_point.wrap_t =
diff --git a/src/gallium/auxiliary/util/u_blit.c b/src/gallium/auxiliary/util/u_blit.c
index ca3d221ed36..15edf2f48dc 100644
--- a/src/gallium/auxiliary/util/u_blit.c
+++ b/src/gallium/auxiliary/util/u_blit.c
@@ -91,21 +91,22 @@ util_create_blit(struct pipe_context *pipe, struct cso_context *cso)
ctx->pipe = pipe;
ctx->cso = cso;
/* disabled blending/masking */
ctx->blend_write_color.rt[0].colormask = PIPE_MASK_RGBA;
/* rasterizer */
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;
ctx->sampler.wrap_t = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
ctx->sampler.wrap_r = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
ctx->sampler.min_mip_filter = PIPE_TEX_MIPFILTER_NONE;
ctx->sampler.min_img_filter = 0; /* set later */
ctx->sampler.mag_img_filter = 0; /* set later */
/* vertex elements state */
diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c
index fc86fa367c6..e19fde9873d 100644
--- a/src/gallium/auxiliary/util/u_blitter.c
+++ b/src/gallium/auxiliary/util/u_blitter.c
@@ -269,21 +269,22 @@ struct blitter_context *util_blitter_create(struct pipe_context *pipe)
ctx->sampler_state_linear = pipe->create_sampler_state(pipe, &sampler_state);
sampler_state.normalized_coords = 0;
ctx->sampler_state_rect_linear = pipe->create_sampler_state(pipe, &sampler_state);
/* rasterizer state */
memset(&rs_state, 0, sizeof(rs_state));
rs_state.cull_face = PIPE_FACE_NONE;
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;
ctx->rs_state_scissor = pipe->create_rasterizer_state(pipe, &rs_state);
if (ctx->has_stream_out) {
rs_state.scissor = 0;
rs_state.rasterizer_discard = 1;
ctx->rs_discard_state = pipe->create_rasterizer_state(pipe, &rs_state);
}
diff --git a/src/gallium/auxiliary/util/u_dump_state.c b/src/gallium/auxiliary/util/u_dump_state.c
index 286d5fad75b..638dac79db2 100644
--- a/src/gallium/auxiliary/util/u_dump_state.c
+++ b/src/gallium/auxiliary/util/u_dump_state.c
@@ -361,21 +361,22 @@ util_dump_rasterizer_state(FILE *stream, const struct pipe_rasterizer_state *sta
util_dump_member(stream, bool, state, multisample);
util_dump_member(stream, bool, state, line_smooth);
util_dump_member(stream, bool, state, line_stipple_enable);
util_dump_member(stream, uint, state, line_stipple_factor);
util_dump_member(stream, uint, state, line_stipple_pattern);
util_dump_member(stream, bool, state, line_last_pixel);
util_dump_member(stream, bool, state, flatshade_first);
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);
util_dump_member(stream, float, state, line_width);
util_dump_member(stream, float, state, point_size);
util_dump_member(stream, float, state, offset_units);
util_dump_member(stream, float, state, offset_scale);
util_dump_member(stream, float, state, offset_clamp);
util_dump_struct_end(stream);
diff --git a/src/gallium/auxiliary/util/u_tests.c b/src/gallium/auxiliary/util/u_tests.c
index 7360eb97639..59953dc70a4 100644
--- a/src/gallium/auxiliary/util/u_tests.c
+++ b/src/gallium/auxiliary/util/u_tests.c
@@ -101,21 +101,22 @@ util_set_dsa_disable(struct cso_context *cso)
cso_set_depth_stencil_alpha(cso, &dsa);
}
static void
util_set_rasterizer_normal(struct cso_context *cso)
{
struct pipe_rasterizer_state rs = {0};
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);
}
static void
util_set_max_viewport(struct cso_context *cso, struct pipe_resource *tex)
{
struct pipe_viewport_state viewport;
viewport.scale[0] = 0.5f * tex->width0;
diff --git a/src/gallium/auxiliary/vl/vl_bicubic_filter.c b/src/gallium/auxiliary/vl/vl_bicubic_filter.c
index a3dc6c8c5cf..f3f8cbee778 100644
--- a/src/gallium/auxiliary/vl/vl_bicubic_filter.c
+++ b/src/gallium/auxiliary/vl/vl_bicubic_filter.c
@@ -255,21 +255,23 @@ vl_bicubic_filter_init(struct vl_bicubic_filter *filter, struct pipe_context *pi
assert(filter && pipe);
assert(width && height);
memset(filter, 0, sizeof(*filter));
filter->pipe = 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;
memset(&blend, 0, sizeof blend);
blend.rt[0].rgb_func = PIPE_BLEND_ADD;
blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE;
blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ONE;
blend.rt[0].alpha_func = PIPE_BLEND_ADD;
blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE;
diff --git a/src/gallium/auxiliary/vl/vl_compositor.c b/src/gallium/auxiliary/vl/vl_compositor.c
index 725bfd9126e..159a2952af4 100644
--- a/src/gallium/auxiliary/vl/vl_compositor.c
+++ b/src/gallium/auxiliary/vl/vl_compositor.c
@@ -604,21 +604,22 @@ init_pipe_state(struct vl_compositor *c)
rast.cull_face = PIPE_FACE_NONE;
rast.fill_back = PIPE_POLYGON_MODE_FILL;
rast.fill_front = PIPE_POLYGON_MODE_FILL;
rast.scissor = 1;
rast.line_width = 1;
rast.point_size_per_vertex = 1;
rast.offset_units = 1;
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(&dsa, 0, sizeof dsa);
dsa.depth.enabled = 0;
dsa.depth.writemask = 0;
dsa.depth.func = PIPE_FUNC_ALWAYS;
for (i = 0; i < 2; ++i) {
dsa.stencil[i].enabled = 0;
dsa.stencil[i].func = PIPE_FUNC_ALWAYS;
diff --git a/src/gallium/auxiliary/vl/vl_deint_filter.c b/src/gallium/auxiliary/vl/vl_deint_filter.c
index d2c48bda7f9..dbd6be534e9 100644
--- a/src/gallium/auxiliary/vl/vl_deint_filter.c
+++ b/src/gallium/auxiliary/vl/vl_deint_filter.c
@@ -266,21 +266,23 @@ vl_deint_filter_init(struct vl_deint_filter *filter, struct pipe_context *pipe,
templ.width = video_width;
templ.height = video_height;
templ.interlaced = true;
filter->video_buffer = vl_video_buffer_create(pipe, &templ);
if (!filter->video_buffer)
goto error_video_buffer;
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(&blend, 0, sizeof blend);
blend.rt[0].colormask = PIPE_MASK_R;
filter->blend[0] = pipe->create_blend_state(pipe, &blend);
if (!filter->blend[0])
goto error_blendR;
diff --git a/src/gallium/auxiliary/vl/vl_idct.c b/src/gallium/auxiliary/vl/vl_idct.c
index 3e6f581244e..91ff02b3911 100644
--- a/src/gallium/auxiliary/vl/vl_idct.c
+++ b/src/gallium/auxiliary/vl/vl_idct.c
@@ -509,21 +509,23 @@ init_state(struct vl_idct *idct)
struct pipe_rasterizer_state rs_state;
struct pipe_sampler_state sampler;
unsigned i;
assert(idct);
memset(&rs_state, 0, sizeof(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(&blend, 0, sizeof blend);
blend.independent_blend_enable = 0;
blend.rt[0].blend_enable = 0;
blend.rt[0].rgb_func = PIPE_BLEND_ADD;
blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE;
diff --git a/src/gallium/auxiliary/vl/vl_matrix_filter.c b/src/gallium/auxiliary/vl/vl_matrix_filter.c
index 1dacc7c6025..4a24c6a3f97 100644
--- a/src/gallium/auxiliary/vl/vl_matrix_filter.c
+++ b/src/gallium/auxiliary/vl/vl_matrix_filter.c
@@ -144,21 +144,23 @@ vl_matrix_filter_init(struct vl_matrix_filter *filter, struct pipe_context *pipe
assert(filter && pipe);
assert(video_width && video_height);
assert(matrix_width && matrix_height);
memset(filter, 0, sizeof(*filter));
filter->pipe = 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;
memset(&blend, 0, sizeof blend);
blend.rt[0].rgb_func = PIPE_BLEND_ADD;
blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE;
blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ONE;
blend.rt[0].alpha_func = PIPE_BLEND_ADD;
blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE;
diff --git a/src/gallium/auxiliary/vl/vl_mc.c b/src/gallium/auxiliary/vl/vl_mc.c
index a202fac54b0..414aff9623f 100644
--- a/src/gallium/auxiliary/vl/vl_mc.c
+++ b/src/gallium/auxiliary/vl/vl_mc.c
@@ -427,21 +427,23 @@ init_pipe_state(struct vl_mc *r)
goto error_blend;
}
memset(&rs_state, 0, sizeof(rs_state));
/*rs_state.sprite_coord_enable */
rs_state.sprite_coord_mode = PIPE_SPRITE_COORD_UPPER_LEFT;
rs_state.point_quad_rasterization = true;
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;
return true;
error_rs_state:
error_blend:
for (i = 0; i < VL_MC_NUM_BLENDERS; ++i) {
if (r->blend_sub[i])
diff --git a/src/gallium/auxiliary/vl/vl_median_filter.c b/src/gallium/auxiliary/vl/vl_median_filter.c
index 273afaf2fb2..b10237d1e56 100644
--- a/src/gallium/auxiliary/vl/vl_median_filter.c
+++ b/src/gallium/auxiliary/vl/vl_median_filter.c
@@ -255,21 +255,23 @@ vl_median_filter_init(struct vl_median_filter *filter, struct pipe_context *pipe
assert(filter && pipe);
assert(width && height);
assert(size > 1 && size < 20);
memset(filter, 0, sizeof(*filter));
filter->pipe = 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;
memset(&blend, 0, sizeof blend);
blend.rt[0].rgb_func = PIPE_BLEND_ADD;
blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE;
blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ONE;
blend.rt[0].alpha_func = PIPE_BLEND_ADD;
blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE;
diff --git a/src/gallium/auxiliary/vl/vl_zscan.c b/src/gallium/auxiliary/vl/vl_zscan.c
index 75013c42bfe..769fc71ff42 100644
--- a/src/gallium/auxiliary/vl/vl_zscan.c
+++ b/src/gallium/auxiliary/vl/vl_zscan.c
@@ -290,21 +290,23 @@ init_state(struct vl_zscan *zscan)
struct pipe_blend_state blend;
struct pipe_rasterizer_state rs_state;
struct pipe_sampler_state sampler;
unsigned i;
assert(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;
memset(&blend, 0, sizeof blend);
blend.independent_blend_enable = 0;
blend.rt[0].blend_enable = 0;
blend.rt[0].rgb_func = PIPE_BLEND_ADD;
blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE;
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
@@ -550,21 +550,21 @@ fd3_emit_state(struct fd_context *ctx, struct fd_ringbuffer *ring,
if (dirty & (FD_DIRTY_ZSA | FD_DIRTY_RASTERIZER | FD_DIRTY_PROG)) {
uint32_t val = fd3_zsa_stateobj(ctx->zsa)->rb_depth_control;
if (fp->writes_pos) {
val |= A3XX_RB_DEPTH_CONTROL_FRAG_WRITES_Z;
val |= A3XX_RB_DEPTH_CONTROL_EARLY_Z_DISABLE;
}
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);
OUT_RING(ring, val);
}
if (dirty & FD_DIRTY_RASTERIZER) {
struct fd3_rasterizer_stateobj *rasterizer =
fd3_rasterizer_stateobj(ctx->rasterizer);
@@ -645,21 +645,21 @@ fd3_emit_state(struct fd_context *ctx, struct fd_ringbuffer *ring,
struct pipe_scissor_state *scissor = fd_context_get_scissor(ctx);
int minx = scissor->minx;
int miny = scissor->miny;
int maxx = scissor->maxx;
int maxy = scissor->maxy;
/* Unfortunately there is no separate depth clip disable, only an all
* 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])));
maxx = MIN2(maxx, (int)ceilf(vp->translate[0] + fabsf(vp->scale[0])));
maxy = MIN2(maxy, (int)ceilf(vp->translate[1] + fabsf(vp->scale[1])));
}
OUT_PKT0(ring, REG_A3XX_GRAS_SC_WINDOW_SCISSOR_TL, 2);
OUT_RING(ring, A3XX_GRAS_SC_WINDOW_SCISSOR_TL_X(minx) |
A3XX_GRAS_SC_WINDOW_SCISSOR_TL_Y(miny));
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
@@ -76,21 +76,21 @@ fd3_vp_state_delete(struct pipe_context *pctx, void *hwcso)
struct ir3_shader *so = hwcso;
ir3_shader_destroy(so);
}
bool
fd3_needs_manual_clipping(const struct ir3_shader *shader,
const struct pipe_rasterizer_state *rast)
{
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) |
(1ULL << VARYING_SLOT_CLIP_DIST1)));
}
static void
emit_shader(struct fd_ringbuffer *ring, const struct ir3_shader_variant *so)
{
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
@@ -91,15 +91,15 @@ fd3_rasterizer_state_create(struct pipe_context *pctx,
so->gras_su_mode_control |= A3XX_GRAS_SU_MODE_CONTROL_CULL_FRONT;
if (cso->cull_face & PIPE_FACE_BACK)
so->gras_su_mode_control |= A3XX_GRAS_SU_MODE_CONTROL_CULL_BACK;
if (!cso->front_ccw)
so->gras_su_mode_control |= A3XX_GRAS_SU_MODE_CONTROL_FRONT_CW;
if (!cso->flatshade_first)
so->pc_prim_vtx_cntl |= A3XX_PC_PRIM_VTX_CNTL_PROVOKING_VTX_LAST;
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
@@ -554,21 +554,21 @@ fd4_emit_state(struct fd_context *ctx, struct fd_ringbuffer *ring,
OUT_PKT0(ring, REG_A4XX_RB_STENCILREFMASK, 2);
OUT_RING(ring, zsa->rb_stencilrefmask |
A4XX_RB_STENCILREFMASK_STENCILREF(sr->ref_value[0]));
OUT_RING(ring, zsa->rb_stencilrefmask_bf |
A4XX_RB_STENCILREFMASK_BF_STENCILREF(sr->ref_value[1]));
}
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 |
COND(clamp, A4XX_RB_DEPTH_CONTROL_Z_CLAMP_ENABLE) |
COND(fragz, A4XX_RB_DEPTH_CONTROL_EARLY_Z_DISABLE) |
COND(fragz && fp->frag_coord, A4XX_RB_DEPTH_CONTROL_FORCE_FRAGZ_TO_FS));
/* maybe this register/bitfield needs a better name.. this
* appears to be just disabling early-z
*/
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
@@ -90,18 +90,18 @@ fd4_rasterizer_state_create(struct pipe_context *pctx,
if (cso->cull_face & PIPE_FACE_BACK)
so->gras_su_mode_control |= A4XX_GRAS_SU_MODE_CONTROL_CULL_BACK;
if (!cso->front_ccw)
so->gras_su_mode_control |= A4XX_GRAS_SU_MODE_CONTROL_FRONT_CW;
if (!cso->flatshade_first)
so->pc_prim_vtx_cntl |= A4XX_PC_PRIM_VTX_CNTL_PROVOKING_VTX_LAST;
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)
so->gras_cl_clip_cntl |= A4XX_GRAS_CL_CLIP_CNTL_ZERO_GB_SCALE_Z;
return so;
}
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
@@ -3205,21 +3205,21 @@ make_variant_key(struct llvmpipe_context *lp,
* XXX: This is incorrect for GL, but correct for d3d10 (depth
* clamp is always active in d3d10, regardless if depth clip is
* enabled or not).
* (GL has an always-on [0,1] clamp on fs depth output instead
* to ensure the depth values stay in range. Doesn't look like
* we do that, though...)
*/
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) */
if (!lp->framebuffer.nr_cbufs ||
!lp->framebuffer.cbufs[0] ||
!util_format_is_pure_integer(lp->framebuffer.cbufs[0]->format)) {
key->alpha.enabled = lp->depth_stencil->alpha.enabled;
}
if(key->alpha.enabled)
key->alpha.func = lp->depth_stencil->alpha.func;
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
@@ -181,21 +181,21 @@ nv30_rasterizer_state_create(struct pipe_context *pipe,
SB_MTHD30(so, VERTEX_TWO_SIDE_ENABLE, 1);
SB_DATA (so, cso->light_twoside);
SB_MTHD30(so, POLYGON_STIPPLE_ENABLE, 1);
SB_DATA (so, cso->poly_stipple_enable);
SB_MTHD30(so, POINT_SIZE, 1);
SB_DATA (so, fui(cso->point_size));
SB_MTHD30(so, FLATSHADE_FIRST, 1);
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;
}
static void
nv30_rasterizer_state_bind(struct pipe_context *pipe, void *hwcso)
{
struct nv30_context *nv30 = nv30_context(pipe);
nv30->rast = hwcso;
nv30->dirty |= NV30_NEW_RASTERIZER;
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
@@ -308,21 +308,21 @@ nv50_rasterizer_state_create(struct pipe_context *pipe,
if (cso->offset_point || cso->offset_line || cso->offset_tri) {
SB_BEGIN_3D(so, POLYGON_OFFSET_FACTOR, 1);
SB_DATA (so, fui(cso->offset_scale));
SB_BEGIN_3D(so, POLYGON_OFFSET_UNITS, 1);
SB_DATA (so, fui(cso->offset_units * 2.0f));
SB_BEGIN_3D(so, POLYGON_OFFSET_CLAMP, 1);
SB_DATA (so, fui(cso->offset_clamp));
}
- if (cso->depth_clip) {
+ if (cso->depth_clip_near) {
reg = 0;
} else {
reg =
NV50_3D_VIEW_VOLUME_CLIP_CTRL_DEPTH_CLAMP_NEAR |
NV50_3D_VIEW_VOLUME_CLIP_CTRL_DEPTH_CLAMP_FAR |
NV50_3D_VIEW_VOLUME_CLIP_CTRL_UNK12_UNK1;
}
#ifndef NV50_SCISSORS_CLIPPING
reg |=
NV50_3D_VIEW_VOLUME_CLIP_CTRL_UNK7 |
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
@@ -304,21 +304,21 @@ nvc0_rasterizer_state_create(struct pipe_context *pipe,
SB_BEGIN_3D(so, POLYGON_OFFSET_FACTOR, 1);
SB_DATA (so, fui(cso->offset_scale));
if (!cso->offset_units_unscaled) {
SB_BEGIN_3D(so, POLYGON_OFFSET_UNITS, 1);
SB_DATA (so, fui(cso->offset_units * 2.0f));
}
SB_BEGIN_3D(so, POLYGON_OFFSET_CLAMP, 1);
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 =
NVC0_3D_VIEW_VOLUME_CLIP_CTRL_UNK1_UNK1 |
NVC0_3D_VIEW_VOLUME_CLIP_CTRL_DEPTH_CLAMP_NEAR |
NVC0_3D_VIEW_VOLUME_CLIP_CTRL_DEPTH_CLAMP_FAR |
NVC0_3D_VIEW_VOLUME_CLIP_CTRL_UNK12_UNK2;
SB_BEGIN_3D(so, VIEW_VOLUME_CLIP_CTRL, 1);
SB_DATA (so, 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
@@ -485,22 +485,22 @@ static void *evergreen_create_rs_state(struct pipe_context *ctx,
rs->flatshade = state->flatshade;
rs->sprite_coord_enable = state->sprite_coord_enable;
rs->rasterizer_discard = state->rasterizer_discard;
rs->two_side = state->light_twoside;
rs->clip_plane_enable = state->clip_plane_enable;
rs->pa_sc_line_stipple = state->line_stipple_enable ?
S_028A0C_LINE_PATTERN(state->line_stipple_pattern) |
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;
/* offset */
rs->offset_units = state->offset_units;
rs->offset_scale = state->offset_scale * 16.0f;
rs->offset_enable = state->offset_point || state->offset_line || state->offset_tri;
rs->offset_units_unscaled = state->offset_units_unscaled;
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
@@ -472,22 +472,22 @@ static void *r600_create_rs_state(struct pipe_context *ctx,
rs->flatshade = state->flatshade;
rs->sprite_coord_enable = state->sprite_coord_enable;
rs->rasterizer_discard = state->rasterizer_discard;
rs->two_side = state->light_twoside;
rs->clip_plane_enable = state->clip_plane_enable;
rs->pa_sc_line_stipple = state->line_stipple_enable ?
S_028A0C_LINE_PATTERN(state->line_stipple_pattern) |
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_028810_DX_RASTERIZATION_KILL(state->rasterizer_discard);
}
rs->multisample_enable = state->multisample;
/* offset */
rs->offset_units = state->offset_units;
rs->offset_scale = state->offset_scale * 16.0f;
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
@@ -862,22 +862,22 @@ static void *si_create_rs_state(struct pipe_context *ctx,
rs->clamp_fragment_color = state->clamp_fragment_color;
rs->clamp_vertex_color = state->clamp_vertex_color;
rs->flatshade = state->flatshade;
rs->sprite_coord_enable = state->sprite_coord_enable;
rs->rasterizer_discard = state->rasterizer_discard;
rs->pa_sc_line_stipple = state->line_stipple_enable ?
S_028A0C_LINE_PATTERN(state->line_stipple_pattern) |
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);
si_pm4_set_reg(pm4, R_0286D4_SPI_INTERP_CONTROL_0,
S_0286D4_FLAT_SHADE_ENA(1) |
S_0286D4_PNT_SPRITE_ENA(state->point_quad_rasterization) |
S_0286D4_PNT_SPRITE_OVRD_X(V_0286D4_SPI_PNT_SPRITE_SEL_S) |
S_0286D4_PNT_SPRITE_OVRD_Y(V_0286D4_SPI_PNT_SPRITE_SEL_T) |
S_0286D4_PNT_SPRITE_OVRD_Z(V_0286D4_SPI_PNT_SPRITE_SEL_0) |
S_0286D4_PNT_SPRITE_OVRD_W(V_0286D4_SPI_PNT_SPRITE_SEL_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
@@ -796,21 +796,21 @@ depth_test_quads_fallback(struct quad_stage *qs,
if (qs->softpipe->framebuffer.zsbuf &&
(qs->softpipe->depth_stencil->depth.enabled ||
qs->softpipe->depth_stencil->stencil[0].enabled)) {
float near_val, far_val;
data.ps = qs->softpipe->framebuffer.zsbuf;
data.format = data.ps->format;
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);
data.minval = MIN2(near_val, far_val);
data.maxval = MAX2(near_val, far_val);
for (i = 0; i < nr; i++) {
get_depth_stencil_values(&data, quads[i]);
if (qs->softpipe->depth_stencil->depth.enabled) {
@@ -909,21 +909,21 @@ choose_depth_test(struct quad_stage *qs,
boolean depth = qs->softpipe->depth_stencil->depth.enabled;
unsigned depthfunc = qs->softpipe->depth_stencil->depth.func;
boolean stencil = qs->softpipe->depth_stencil->stencil[0].enabled;
boolean depthwrite = qs->softpipe->depth_stencil->depth.writemask;
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;
/* default */
qs->run = depth_test_quads_fallback;
/* look for special cases */
if (!alpha &&
!depth &&
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
@@ -135,21 +135,21 @@ define_rasterizer_object(struct svga_context *svga,
svgascreen->haveProvokingVertex;
enum pipe_error ret =
SVGA3D_vgpu10_DefineRasterizerState(svga->swc,
rast->id,
fill_mode,
cull_mode,
rast->templ.front_ccw,
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,
line_width,
rast->templ.line_stipple_enable,
line_factor,
line_pattern,
pv_last);
if (ret == PIPE_OK)
return;
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
@@ -1191,21 +1191,21 @@ swr_update_derived(struct pipe_context *pipe,
rastState->depthBiasClamp = 0;
}
/* translate polygon mode, at least for the front==back case */
rastState->fillMode = swr_convert_fill_mode(rasterizer->fill_front);
struct pipe_surface *zb = fb->zsbuf;
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);
}
/* Viewport */
if (ctx->dirty & (SWR_NEW_VIEWPORT | SWR_NEW_FRAMEBUFFER
| SWR_NEW_RASTERIZER)) {
pipe_viewport_state *state = &ctx->viewport;
pipe_framebuffer_state *fb = &ctx->framebuffer;
diff --git a/src/gallium/drivers/virgl/virgl_encode.c b/src/gallium/drivers/virgl/virgl_encode.c
index bcb14d8939a..383d0a06474 100644
--- a/src/gallium/drivers/virgl/virgl_encode.c
+++ b/src/gallium/drivers/virgl/virgl_encode.c
@@ -147,21 +147,21 @@ int virgl_encode_dsa_state(struct virgl_context *ctx,
int virgl_encode_rasterizer_state(struct virgl_context *ctx,
uint32_t handle,
const struct pipe_rasterizer_state *state)
{
uint32_t tmp;
virgl_encoder_write_cmd_dword(ctx, VIRGL_CMD0(VIRGL_CCMD_CREATE_OBJECT, VIRGL_OBJECT_RASTERIZER, VIRGL_OBJ_RS_SIZE));
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) |
VIRGL_OBJ_RS_S0_LIGHT_TWOSIZE(state->light_twoside) |
VIRGL_OBJ_RS_S0_SPRITE_COORD_MODE(state->sprite_coord_mode) |
VIRGL_OBJ_RS_S0_POINT_QUAD_RASTERIZATION(state->point_quad_rasterization) |
VIRGL_OBJ_RS_S0_CULL_FACE(state->cull_face) |
VIRGL_OBJ_RS_S0_FILL_FRONT(state->fill_front) |
VIRGL_OBJ_RS_S0_FILL_BACK(state->fill_back) |
VIRGL_OBJ_RS_S0_SCISSOR(state->scissor) |
diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h
index 671cccda4eb..95a18a72b5c 100644
--- a/src/gallium/include/pipe/p_state.h
+++ b/src/gallium/include/pipe/p_state.h
@@ -144,22 +144,26 @@ struct pipe_rasterizer_state
* GL_MESA_tile_raster_order.
*/
unsigned tile_raster_order_fixed:1;
unsigned tile_raster_order_increasing_x:1;
unsigned tile_raster_order_increasing_y:1;
/**
* 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
* [-1, 1] (GL).
*
* NOTE: D3D will always use depth clamping.
*/
unsigned clip_halfz:1;
/**
diff --git a/src/gallium/state_trackers/nine/nine_pipe.c b/src/gallium/state_trackers/nine/nine_pipe.c
index a28b4c6d57a..a84a17f551f 100644
--- a/src/gallium/state_trackers/nine/nine_pipe.c
+++ b/src/gallium/state_trackers/nine/nine_pipe.c
@@ -98,21 +98,22 @@ nine_convert_rasterizer_state(struct NineDevice9 *device,
rast.point_size_per_vertex = rs[NINED3DRS_VSPOINTSIZE];
rast.multisample = rs[NINED3DRS_MULTISAMPLE];
rast.line_smooth = !!rs[D3DRS_ANTIALIASEDLINEENABLE];
/* rast.line_stipple_enable = 0; */
rast.line_last_pixel = !!rs[D3DRS_LASTPIXEL];
rast.flatshade_first = 1;
/* rast.half_pixel_center = 0; */
/* 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; */
/* rast.line_stipple_pattern = 0; */
rast.sprite_coord_enable = rs[D3DRS_POINTSPRITEENABLE] ? 0xff : 0x00;
rast.line_width = 1.0f;
if (rs[NINED3DRS_VSPOINTSIZE]) {
rast.point_size = 1.0f;
} else {
rast.point_size = CLAMP(asfloat(rs[D3DRS_POINTSIZE]),
diff --git a/src/gallium/state_trackers/xa/xa_renderer.c b/src/gallium/state_trackers/xa/xa_renderer.c
index e3311232e77..d87a14e8088 100644
--- a/src/gallium/state_trackers/xa/xa_renderer.c
+++ b/src/gallium/state_trackers/xa/xa_renderer.c
@@ -114,21 +114,22 @@ renderer_init_state(struct xa_context *r)
unsigned i;
/* set common initial clip state */
memset(&dsa, 0, sizeof(struct pipe_depth_stencil_alpha_state));
cso_set_depth_stencil_alpha(r->cso, &dsa);
/* XXX: move to renderer_init_state? */
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);
/* vertex elements state */
memset(&r->velems[0], 0, sizeof(r->velems[0]) * 3);
for (i = 0; i < 3; i++) {
r->velems[i].src_offset = i * 4 * sizeof(float);
r->velems[i].instance_divisor = 0;
r->velems[i].vertex_buffer_index = 0;
r->velems[i].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
diff --git a/src/gallium/tests/graw/fs-test.c b/src/gallium/tests/graw/fs-test.c
index cc87b02a0a2..a4182be55bd 100644
--- a/src/gallium/tests/graw/fs-test.c
+++ b/src/gallium/tests/graw/fs-test.c
@@ -451,21 +451,22 @@ static void init( void )
ctx->bind_depth_stencil_alpha_state(ctx, handle);
}
{
struct pipe_rasterizer_state rasterizer;
void *handle;
memset(&rasterizer, 0, sizeof rasterizer);
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);
}
set_viewport(0, 0, WIDTH, HEIGHT, 30, 1000);
init_tex();
init_fs_constbuf();
set_vertices();
diff --git a/src/gallium/tests/graw/gs-test.c b/src/gallium/tests/graw/gs-test.c
index 9c3c29bc3c6..a984e0acfb0 100644
--- a/src/gallium/tests/graw/gs-test.c
+++ b/src/gallium/tests/graw/gs-test.c
@@ -541,21 +541,22 @@ static void init( void )
ctx->bind_depth_stencil_alpha_state(ctx, handle);
}
{
struct pipe_rasterizer_state rasterizer;
void *handle;
memset(&rasterizer, 0, sizeof rasterizer);
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);
}
set_viewport(0, 0, WIDTH, HEIGHT, 30, 1000);
init_tex();
init_fs_constbuf();
set_vertices();
diff --git a/src/gallium/tests/graw/quad-sample.c b/src/gallium/tests/graw/quad-sample.c
index d532e60e1e2..a5029484b3b 100644
--- a/src/gallium/tests/graw/quad-sample.c
+++ b/src/gallium/tests/graw/quad-sample.c
@@ -366,21 +366,22 @@ static void init( void )
ctx->bind_depth_stencil_alpha_state(ctx, handle);
}
{
struct pipe_rasterizer_state rasterizer;
void *handle;
memset(&rasterizer, 0, sizeof rasterizer);
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);
}
set_viewport(0, 0, WIDTH, HEIGHT, 30, 1000);
init_tex();
set_vertices();
set_vertex_shader();
diff --git a/src/gallium/tests/graw/quad-tex.c b/src/gallium/tests/graw/quad-tex.c
index 444f64e947f..35ba4fa3469 100644
--- a/src/gallium/tests/graw/quad-tex.c
+++ b/src/gallium/tests/graw/quad-tex.c
@@ -185,21 +185,22 @@ static void init( void )
graw_util_default_state(&info, FALSE);
{
struct pipe_rasterizer_state rasterizer;
void *handle;
memset(&rasterizer, 0, sizeof rasterizer);
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);
}
graw_util_viewport(&info, 0, 0, WIDTH, HEIGHT, 30, 1000);
init_tex();
set_vertices();
set_vertex_shader();
diff --git a/src/gallium/tests/graw/shader-leak.c b/src/gallium/tests/graw/shader-leak.c
index 4178448f768..8fa1a727f54 100644
--- a/src/gallium/tests/graw/shader-leak.c
+++ b/src/gallium/tests/graw/shader-leak.c
@@ -243,21 +243,22 @@ static void init( void )
ctx->bind_depth_stencil_alpha_state(ctx, handle);
}
{
struct pipe_rasterizer_state rasterizer;
void *handle;
memset(&rasterizer, 0, sizeof rasterizer);
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);
}
set_viewport(0, 0, WIDTH, HEIGHT, 30, 1000);
set_vertices();
set_vertex_shader();
if (0)
set_fragment_shader();
}
diff --git a/src/gallium/tests/graw/tri-gs.c b/src/gallium/tests/graw/tri-gs.c
index 5efc9e87c4c..ed721f378b1 100644
--- a/src/gallium/tests/graw/tri-gs.c
+++ b/src/gallium/tests/graw/tri-gs.c
@@ -248,21 +248,22 @@ static void init( void )
ctx->bind_depth_stencil_alpha_state(ctx, handle);
}
{
struct pipe_rasterizer_state rasterizer;
void *handle;
memset(&rasterizer, 0, sizeof rasterizer);
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);
}
set_viewport(0, 0, WIDTH, HEIGHT, 30, 1000);
set_vertices();
set_vertex_shader();
set_fragment_shader();
set_geometry_shader();
}
diff --git a/src/gallium/tests/graw/tri-instanced.c b/src/gallium/tests/graw/tri-instanced.c
index 9bd2ff58687..297377b894e 100644
--- a/src/gallium/tests/graw/tri-instanced.c
+++ b/src/gallium/tests/graw/tri-instanced.c
@@ -299,21 +299,22 @@ static void init( void )
ctx->bind_depth_stencil_alpha_state(ctx, handle);
}
{
struct pipe_rasterizer_state rasterizer;
void *handle;
memset(&rasterizer, 0, sizeof rasterizer);
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);
}
set_viewport(0, 0, WIDTH, HEIGHT, 30, 1000);
set_vertices();
set_vertex_shader();
set_fragment_shader();
}
diff --git a/src/gallium/tests/graw/tri-large.c b/src/gallium/tests/graw/tri-large.c
index 1ca915aa126..78a2ddbda44 100644
--- a/src/gallium/tests/graw/tri-large.c
+++ b/src/gallium/tests/graw/tri-large.c
@@ -124,21 +124,22 @@ static void init( void )
graw_util_default_state(&info, FALSE);
{
struct pipe_rasterizer_state rasterizer;
void *handle;
memset(&rasterizer, 0, sizeof rasterizer);
rasterizer.cull_face = PIPE_FACE_NONE;
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);
}
graw_util_viewport(&info, 0, 0, WIDTH, HEIGHT, 30, 1000);
set_vertices();
set_vertex_shader();
set_fragment_shader();
diff --git a/src/gallium/tests/graw/tri.c b/src/gallium/tests/graw/tri.c
index b62a2ab4896..2267d98a8fe 100644
--- a/src/gallium/tests/graw/tri.c
+++ b/src/gallium/tests/graw/tri.c
@@ -121,21 +121,22 @@ static void init( void )
graw_util_default_state(&info, FALSE);
{
struct pipe_rasterizer_state rasterizer;
void *handle;
memset(&rasterizer, 0, sizeof rasterizer);
rasterizer.cull_face = PIPE_FACE_NONE;
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);
}
graw_util_viewport(&info, 0, 0, WIDTH, HEIGHT, 30, 1000);
set_vertices();
set_vertex_shader();
set_fragment_shader();
diff --git a/src/gallium/tests/graw/vs-test.c b/src/gallium/tests/graw/vs-test.c
index 26976f41682..b3714543b3a 100644
--- a/src/gallium/tests/graw/vs-test.c
+++ b/src/gallium/tests/graw/vs-test.c
@@ -440,21 +440,22 @@ static void init( void )
}
{
struct pipe_rasterizer_state rasterizer;
void *handle;
memset(&rasterizer, 0, sizeof rasterizer);
rasterizer.cull_face = PIPE_FACE_NONE;
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);
}
set_viewport(0, 0, WIDTH, HEIGHT, 30, 1000);
init_tex();
init_fs_constbuf();
set_vertices();
diff --git a/src/gallium/tests/trivial/quad-tex.c b/src/gallium/tests/trivial/quad-tex.c
index 1f29306ec04..9a9d7012249 100644
--- a/src/gallium/tests/trivial/quad-tex.c
+++ b/src/gallium/tests/trivial/quad-tex.c
@@ -193,21 +193,22 @@ static void init_prog(struct program *p)
p->blend.rt[0].colormask = PIPE_MASK_RGBA;
/* no-op depth/stencil/alpha */
memset(&p->depthstencil, 0, sizeof(p->depthstencil));
/* rasterizer */
memset(&p->rasterizer, 0, sizeof(p->rasterizer));
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->sampler.wrap_s = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
p->sampler.wrap_t = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
p->sampler.wrap_r = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
p->sampler.min_mip_filter = PIPE_TEX_MIPFILTER_NONE;
p->sampler.min_img_filter = PIPE_TEX_MIPFILTER_LINEAR;
p->sampler.mag_img_filter = PIPE_TEX_MIPFILTER_LINEAR;
p->sampler.normalized_coords = 1;
diff --git a/src/gallium/tests/trivial/tri.c b/src/gallium/tests/trivial/tri.c
index 87a335fba1e..3827edc0da3 100644
--- a/src/gallium/tests/trivial/tri.c
+++ b/src/gallium/tests/trivial/tri.c
@@ -147,21 +147,22 @@ static void init_prog(struct program *p)
p->blend.rt[0].colormask = PIPE_MASK_RGBA;
/* no-op depth/stencil/alpha */
memset(&p->depthstencil, 0, sizeof(p->depthstencil));
/* rasterizer */
memset(&p->rasterizer, 0, sizeof(p->rasterizer));
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;
surf_tmpl.u.tex.first_layer = 0;
surf_tmpl.u.tex.last_layer = 0;
/* drawing destination */
memset(&p->framebuffer, 0, sizeof(p->framebuffer));
p->framebuffer.width = WIDTH;
p->framebuffer.height = HEIGHT;
p->framebuffer.nr_cbufs = 1;
diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c
index 1f66b9d0597..2bffa684a25 100644
--- a/src/mesa/state_tracker/st_atom_rasterizer.c
+++ b/src/mesa/state_tracker/st_atom_rasterizer.c
@@ -287,22 +287,22 @@ st_update_rasterizer(struct st_context *st)
if (st->edgeflag_culls_prims) {
/* All edge flags are FALSE. Cull the affected faces. */
if (raster->fill_front != PIPE_POLYGON_MODE_FILL)
raster->cull_face |= PIPE_FACE_FRONT;
if (raster->fill_back != PIPE_POLYGON_MODE_FILL)
raster->cull_face |= PIPE_FACE_BACK;
}
/* _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);
/* ST_NEW_RASTERIZER */
if (ctx->ConservativeRasterization) {
if (ctx->ConservativeRasterMode == GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV)
raster->conservative_raster_mode = PIPE_CONSERVATIVE_RASTER_POST_SNAP;
else
raster->conservative_raster_mode = PIPE_CONSERVATIVE_RASTER_PRE_SNAP;
} else {
diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c
index babb00178ae..a73d6c7e062 100644
--- a/src/mesa/state_tracker/st_cb_bitmap.c
+++ b/src/mesa/state_tracker/st_cb_bitmap.c
@@ -553,21 +553,22 @@ init_bitmap_state(struct st_context *st)
st->bitmap.sampler.mag_img_filter = PIPE_TEX_FILTER_NEAREST;
st->bitmap.sampler.normalized_coords = st->internal_target == PIPE_TEXTURE_2D;
st->bitmap.atlas_sampler = st->bitmap.sampler;
st->bitmap.atlas_sampler.normalized_coords = 0;
/* init baseline rasterizer state once */
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->internal_target, 0, 0,
PIPE_BIND_SAMPLER_VIEW)) {
st->bitmap.tex_format = PIPE_FORMAT_I8_UNORM;
}
else if (screen->is_format_supported(screen, PIPE_FORMAT_A8_UNORM,
st->internal_target, 0, 0,
PIPE_BIND_SAMPLER_VIEW)) {
diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c
index fbc577a370c..22e85019764 100644
--- a/src/mesa/state_tracker/st_cb_clear.c
+++ b/src/mesa/state_tracker/st_cb_clear.c
@@ -64,21 +64,22 @@
/**
* Do per-context initialization for glClear.
*/
void
st_init_clear(struct st_context *st)
{
memset(&st->clear, 0, sizeof(st->clear));
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;
}
/**
* Free per-context state for glClear.
*/
void
st_destroy_clear(struct st_context *st)
{
if (st->clear.fs) {
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index 67bbb358500..cb50b7104a0 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -670,22 +670,22 @@ draw_textured_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z,
cso_save_state(cso, cso_state_mask);
/* rasterizer state: just scissor */
{
struct pipe_rasterizer_state rasterizer;
memset(&rasterizer, 0, sizeof(rasterizer));
rasterizer.clamp_fragment_color = !st->clamp_frag_color_in_shader &&
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);
}
if (write_stencil) {
/* Stencil writing bypasses the normal fragment pipeline to
* disable color writing and set stencil test to always pass.
*/
struct pipe_depth_stencil_alpha_state dsa;
struct pipe_blend_state blend;
--
2.17.1
More information about the mesa-dev
mailing list