From 07f48c925bff65a66412c3d878720aceb14944aa Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Fri, 28 Oct 2022 15:43:40 -0700 Subject: [PATCH] nvk: Use depth_clamp_enable to select PIXEL_*_Z_CLAMP. Fixes most of "-t depth_clamp" (just point_list fails, but other point_list stuff fails too) Part-of: --- src/nouveau/vulkan/nvk_graphics_pipeline.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nouveau/vulkan/nvk_graphics_pipeline.c b/src/nouveau/vulkan/nvk_graphics_pipeline.c index a165afa13e9..88434328018 100644 --- a/src/nouveau/vulkan/nvk_graphics_pipeline.c +++ b/src/nouveau/vulkan/nvk_graphics_pipeline.c @@ -31,11 +31,11 @@ static void emit_pipeline_rs_state(struct nv_push *p, const struct vk_rasterization_state *rs) { - /* TODO: Depth clip/clamp? */ + /* TODO: Depth clip? */ P_IMMD(p, NV9097, SET_VIEWPORT_CLIP_CONTROL, { .min_z_zero_max_z_one = MIN_Z_ZERO_MAX_Z_ONE_TRUE, - .pixel_min_z = PIXEL_MIN_Z_CLAMP, - .pixel_max_z = PIXEL_MAX_Z_CLIP, + .pixel_min_z = rs->depth_clamp_enable ? PIXEL_MIN_Z_CLAMP : PIXEL_MIN_Z_CLIP, + .pixel_max_z = rs->depth_clamp_enable ? PIXEL_MAX_Z_CLAMP : PIXEL_MAX_Z_CLIP, .geometry_guardband = GEOMETRY_GUARDBAND_SCALE_256, .line_point_cull_guardband = LINE_POINT_CULL_GUARDBAND_SCALE_256, .geometry_clip = GEOMETRY_CLIP_WZERO_CLIP,