Module: Mesa
Branch: main
Commit: 04a66938717956f2312feb80082861c10bc13267
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=04a66938717956f2312feb80082861c10bc13267

Author: Vadym Shovkoplias <[email protected]>
Date:   Thu Mar 24 09:34:25 2022 +0200

anv: fix EXT_depth_clip_control

This fixes arb_clip_control-clip-control and depth_clamp piglit
tests on zink.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6186
Signed-off-by: Vadym Shovkoplias <[email protected]>
Reviewed-by: Tapani Pälli <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15561>

---

 src/intel/vulkan/anv_pipeline.c  | 3 +--
 src/intel/vulkan/genX_pipeline.c | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
index 459f376f521..eb5da15cfff 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -2445,8 +2445,7 @@ anv_graphics_pipeline_init(struct anv_graphics_pipeline 
*pipeline,
    const VkPipelineRasterizationDepthClipStateCreateInfoEXT *clip_info =
       vk_find_struct_const(pCreateInfo->pRasterizationState->pNext,
                            
PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT);
-   pipeline->depth_clip_enable = clip_info ? clip_info->depthClipEnable :
-      !(pipeline->depth_clamp_enable || pipeline->negative_one_to_one);
+   pipeline->depth_clip_enable = clip_info ? clip_info->depthClipEnable : 
!pipeline->depth_clamp_enable;
 
    result = anv_pipeline_compile_graphics(pipeline, cache, pCreateInfo,
                                           rendering_info);
diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c
index bc0157dbec5..38a0394a9de 100644
--- a/src/intel/vulkan/genX_pipeline.c
+++ b/src/intel/vulkan/genX_pipeline.c
@@ -1554,7 +1554,7 @@ emit_3dstate_clip(struct anv_graphics_pipeline *pipeline,
    clip.ClipEnable               = true;
    clip.StatisticsEnable         = true;
    clip.EarlyCullEnable          = true;
-   clip.APIMode                  = APIMODE_D3D;
+   clip.APIMode                  = pipeline->negative_one_to_one ? APIMODE_OGL 
: APIMODE_D3D;
    clip.GuardbandClipTestEnable  = true;
 
    /* Only enable the XY clip test when the final polygon rasterization

Reply via email to