v3dv: expose depthClamp in V3D 7.x

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
This commit is contained in:
Iago Toral Quiroga 2023-05-31 10:38:59 +02:00 committed by Marge Bot
parent 2212ee82b7
commit dff60b9ee5
2 changed files with 5 additions and 2 deletions

View file

@ -232,7 +232,7 @@ get_features(const struct v3dv_physical_device *physical_device,
.logicOp = true,
.multiDrawIndirect = false,
.drawIndirectFirstInstance = true,
.depthClamp = false, /* Only available since V3D 4.5.1.1 */
.depthClamp = physical_device->devinfo.ver >= 71,
.depthBiasClamp = true,
.fillModeNonSolid = true,
.depthBounds = physical_device->devinfo.ver >= 71,

View file

@ -243,6 +243,7 @@ pack_cfg_bits(struct v3dv_pipeline *pipeline,
* 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,
@ -250,7 +251,7 @@ pack_cfg_bits(struct v3dv_pipeline *pipeline,
NULL;
if (clip_info)
z_clip_enable = clip_info->depthClipEnable;
else if (!(rs_info && rs_info->depthClampEnable))
else if (!z_clamp_enable)
z_clip_enable = true;
if (z_clip_enable) {
@ -260,6 +261,8 @@ pack_cfg_bits(struct v3dv_pipeline *pipeline,
config.z_clipping_mode = V3D_Z_CLIP_MODE_NONE;
}
config.z_clamp_mode = z_clamp_enable;
config.depth_bounds_test_enable =
ds_info && ds_info->depthBoundsTestEnable && has_ds_attachment;
#endif