From 9de00e74fe0e0a4044635ddd0cd89188cbbd8c59 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Thu, 25 Jul 2019 10:45:14 +0200 Subject: virgl: Enable depth_clamp by lowering if the host is new enough. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gert Wollny Reviewed-by: Reviewed-by: Marek Olšák --- src/gallium/drivers/virgl/virgl_context.c | 3 +++ src/gallium/drivers/virgl/virgl_screen.c | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src/gallium') diff --git a/src/gallium/drivers/virgl/virgl_context.c b/src/gallium/drivers/virgl/virgl_context.c index f68ac815f15..bbb5247c86f 100644 --- a/src/gallium/drivers/virgl/virgl_context.c +++ b/src/gallium/drivers/virgl/virgl_context.c @@ -464,6 +464,9 @@ static void *virgl_create_rasterizer_state(struct pipe_context *ctx, vrs->rs = *rs_state; vrs->handle = virgl_object_assign_handle(); + assert(rs_state->depth_clip_near || + virgl_screen(ctx->screen)->caps.caps.v1.bset.depth_clip_disable); + virgl_encode_rasterizer_state(vctx, vrs->handle, rs_state); return (void *)vrs; } diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c index e1a9f4ef385..37e75b5e048 100644 --- a/src/gallium/drivers/virgl/virgl_screen.c +++ b/src/gallium/drivers/virgl/virgl_screen.c @@ -115,7 +115,11 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param) case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT: return vscreen->caps.caps.v1.bset.fragment_coord_conventions; case PIPE_CAP_DEPTH_CLIP_DISABLE: - return vscreen->caps.caps.v1.bset.depth_clip_disable; + if (vscreen->caps.caps.v1.bset.depth_clip_disable) + return 1; + if (vscreen->caps.caps.v2.host_feature_check_version >= 3) + return 2; + return 0; case PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS: return vscreen->caps.caps.v1.max_streamout_buffers; case PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS: -- cgit v1.2.3