X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fsoftpipe%2Fsp_quad_depth_test.c;h=98dd36d21a394522ee7da2af92662cc52f5e2ed6;hb=0765a1dd0ec59646b6cca80b424be3ce094176d7;hp=be2504e18845eaeda798e0c39caa144d69ea9aae;hpb=5a57248541b45c81081b2d7bd30dc0097f126ad6;p=mesa.git diff --git a/src/gallium/drivers/softpipe/sp_quad_depth_test.c b/src/gallium/drivers/softpipe/sp_quad_depth_test.c index be2504e1884..98dd36d21a3 100644 --- a/src/gallium/drivers/softpipe/sp_quad_depth_test.c +++ b/src/gallium/drivers/softpipe/sp_quad_depth_test.c @@ -782,9 +782,10 @@ depth_test_quads_fallback(struct quad_stage *qs, { unsigned i, pass = 0; const struct tgsi_shader_info *fsInfo = &qs->softpipe->fs_variant->info; - boolean interp_depth = !fsInfo->writes_z; + boolean interp_depth = !fsInfo->writes_z || qs->softpipe->early_depth; boolean shader_stencil_ref = fsInfo->writes_stencil; struct depth_data data; + unsigned vp_idx = quads[0]->input.viewport_index; data.use_shader_stencil_refs = FALSE; @@ -801,11 +802,11 @@ depth_test_quads_fallback(struct quad_stage *qs, data.format = data.ps->format; data.tile = sp_get_cached_tile(qs->softpipe->zsbuf_cache, quads[0]->input.x0, - quads[0]->input.y0); - data.clamp = !qs->softpipe->rasterizer->depth_clip; + quads[0]->input.y0, quads[0]->input.layer); + data.clamp = !qs->softpipe->rasterizer->depth_clip_near; - near_val = qs->softpipe->viewport.translate[2] - qs->softpipe->viewport.scale[2]; - far_val = near_val + (qs->softpipe->viewport.scale[2] * 2.0); + 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); @@ -901,7 +902,7 @@ choose_depth_test(struct quad_stage *qs, { const struct tgsi_shader_info *fsInfo = &qs->softpipe->fs_variant->info; - boolean interp_depth = !fsInfo->writes_z; + boolean interp_depth = !fsInfo->writes_z || qs->softpipe->early_depth; boolean alpha = qs->softpipe->depth_stencil->alpha.enabled; @@ -915,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;