From 16f6f50ce49c965302c4d81fd65c96c9d630f66b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Pi=C3=B1eiro?= Date: Wed, 31 Jan 2024 11:31:02 +0100 Subject: [PATCH] v3dv: expose VK_EXT_depth_clip_enable We already had the logic implemented, but it was never really tested (there was a comment about that) So the advantage of this is that we now test that code (in fact, there were a small typo on that code). There aren't too much CTS tests for this feature, but we gets tests like this working: dEQP-VK.clipping.clip_volume.depth_clip.* Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10527 Reviewed-by: Iago Toral Quiroga Part-of: --- docs/features.txt | 2 +- src/broadcom/vulkan/v3dv_device.c | 4 ++++ src/broadcom/vulkan/v3dvx_pipeline.c | 6 +----- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/features.txt b/docs/features.txt index 6f0a73d73d4..15cfe300672 100644 --- a/docs/features.txt +++ b/docs/features.txt @@ -565,7 +565,7 @@ Khronos extensions that are not part of any Vulkan version: VK_EXT_debug_report DONE (anv, dzn, lvp, nvk, pvr, radv, tu, v3dv) VK_EXT_depth_bias_control DONE (anv, nvk, radv) VK_EXT_depth_clip_control DONE (anv, hasvk, lvp, nvk, radv, tu, v3dv, vn) - VK_EXT_depth_clip_enable DONE (anv, hasvk, lvp, nvk, radv, tu, vn) + VK_EXT_depth_clip_enable DONE (anv, hasvk, lvp, nvk, radv, tu, v3dv, vn) VK_EXT_depth_range_unrestricted DONE (anv/gen20+, radv, lvp) VK_EXT_descriptor_buffer DONE (lvp, radv, tu) VK_EXT_device_fault DONE (radv) diff --git a/src/broadcom/vulkan/v3dv_device.c b/src/broadcom/vulkan/v3dv_device.c index d90991c9fa9..5bbd1a87b8b 100644 --- a/src/broadcom/vulkan/v3dv_device.c +++ b/src/broadcom/vulkan/v3dv_device.c @@ -188,6 +188,7 @@ get_device_extensions(const struct v3dv_physical_device *device, .EXT_color_write_enable = true, .EXT_custom_border_color = true, .EXT_depth_clip_control = true, + .EXT_depth_clip_enable = device->devinfo.ver >= 71, .EXT_load_store_op_none = true, .EXT_inline_uniform_block = true, .EXT_external_memory_dma_buf = true, @@ -429,6 +430,9 @@ get_features(const struct v3dv_physical_device *physical_device, /* VK_EXT_depth_clip_control */ .depthClipControl = true, + /* VK_EXT_depth_clip_enable */ + .depthClipEnable = physical_device->devinfo.ver >= 71, + /* VK_EXT_attachment_feedback_loop_layout */ .attachmentFeedbackLoopLayout = true, diff --git a/src/broadcom/vulkan/v3dvx_pipeline.c b/src/broadcom/vulkan/v3dvx_pipeline.c index 478fb9a0fa1..e46342b529b 100644 --- a/src/broadcom/vulkan/v3dvx_pipeline.c +++ b/src/broadcom/vulkan/v3dvx_pipeline.c @@ -238,15 +238,11 @@ pack_cfg_bits(struct v3dv_pipeline *pipeline, * the z planes of the frustrum as described in Primitive Clipping. * Otherwise depth clipping is controlled by the state set in * VkPipelineRasterizationDepthClipStateCreateInfoEXT." - * - * Note: neither depth clamping nor VK_EXT_depth_clip_enable are actually - * supported in the driver yet, so in practice we are always enabling Z - * clipping for now. */ bool z_clamp_enable = rs_info && rs_info->depthClampEnable; bool z_clip_enable = false; const VkPipelineRasterizationDepthClipStateCreateInfoEXT *clip_info = - ds_info ? vk_find_struct_const(ds_info->pNext, + rs_info ? vk_find_struct_const(rs_info->pNext, PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT) : NULL; if (clip_info)