mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-05 09:00:08 +01:00
i965: add functional changes for AMD_depth_clamp_separate
Gen >= 9 have ability to control clamping of depth values separately at near and far plane. z_w is clamped to the range [min(n,f), 0] if clamping at near plane is enabled, [0, max(n,f)] if clamping at far plane is enabled and [min(n,f) max(n,f)] if clamping at both plane is enabled. v2: 1) Use better coding style (Ian Romanick) Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
2765749e0f
commit
e6adea0dc0
1 changed files with 16 additions and 6 deletions
|
|
@ -2343,6 +2343,12 @@ genX(upload_cc_viewport)(struct brw_context *brw)
|
|||
if (ctx->Transform.DepthClampNear && ctx->Transform.DepthClampFar) {
|
||||
ccv.MinimumDepth = MIN2(vp->Near, vp->Far);
|
||||
ccv.MaximumDepth = MAX2(vp->Near, vp->Far);
|
||||
} else if (ctx->Transform.DepthClampNear) {
|
||||
ccv.MinimumDepth = MIN2(vp->Near, vp->Far);
|
||||
ccv.MaximumDepth = 0.0;
|
||||
} else if (ctx->Transform.DepthClampFar) {
|
||||
ccv.MinimumDepth = 0.0;
|
||||
ccv.MaximumDepth = MAX2(vp->Near, vp->Far);
|
||||
} else {
|
||||
ccv.MinimumDepth = 0.0;
|
||||
ccv.MaximumDepth = 1.0;
|
||||
|
|
@ -4607,15 +4613,19 @@ genX(upload_raster)(struct brw_context *brw)
|
|||
raster.ScissorRectangleEnable = ctx->Scissor.EnableFlags;
|
||||
|
||||
/* _NEW_TRANSFORM */
|
||||
#if GEN_GEN < 9
|
||||
if (!(ctx->Transform.DepthClampNear &&
|
||||
ctx->Transform.DepthClampFar)) {
|
||||
#if GEN_GEN >= 9
|
||||
raster.ViewportZFarClipTestEnable = true;
|
||||
raster.ViewportZNearClipTestEnable = true;
|
||||
#else
|
||||
ctx->Transform.DepthClampFar))
|
||||
raster.ViewportZClipTestEnable = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if GEN_GEN >= 9
|
||||
if (!ctx->Transform.DepthClampNear)
|
||||
raster.ViewportZNearClipTestEnable = true;
|
||||
|
||||
if (!ctx->Transform.DepthClampFar)
|
||||
raster.ViewportZFarClipTestEnable = true;
|
||||
#endif
|
||||
|
||||
/* BRW_NEW_CONSERVATIVE_RASTERIZATION */
|
||||
#if GEN_GEN >= 9
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue