mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-06 04:08:48 +02:00
tu: Add support for VK_EXT_depth_clamp_control
Wire up the existing runtime plumbing to the z-clamp registers. Test: dEQP-VK.draw.*clamp_control* Signed-off-by: Valentine Burley <valentine.burley@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40317>
This commit is contained in:
parent
a9ea5825b6
commit
b26838ed37
3 changed files with 14 additions and 4 deletions
|
|
@ -613,7 +613,7 @@ Khronos extensions that are not part of any Vulkan version:
|
|||
VK_EXT_debug_report DONE (anv, dzn, hk, lvp, nvk, panvk, pvr, radv, tu, v3dv, vn)
|
||||
VK_EXT_debug_utils DONE (anv, dzn, hasvk, hk, lvp, nvk, panvk, pvr, radv, tu, v3dv, vn)
|
||||
VK_EXT_depth_bias_control DONE (anv, hk, lvp, nvk, panvk, radv, vn)
|
||||
VK_EXT_depth_clamp_control DONE (anv, hasvk, nvk, panvk, radv, vn)
|
||||
VK_EXT_depth_clamp_control DONE (anv, hasvk, nvk, panvk, radv, tu, vn)
|
||||
VK_EXT_depth_clip_control DONE (anv, hasvk, hk, lvp, nvk, panvk, radv, tu, v3dv, vn)
|
||||
VK_EXT_depth_clip_enable DONE (anv, hasvk, hk, lvp, nvk, panvk, pvr, radv, tu, v3dv/vc7+, vn)
|
||||
VK_EXT_depth_range_unrestricted DONE (anv/gen20+, nvk, radv, lvp, vn)
|
||||
|
|
|
|||
|
|
@ -274,6 +274,7 @@ get_device_extensions(const struct tu_physical_device *device,
|
|||
.EXT_conservative_rasterization = device->info->chip >= 7,
|
||||
.EXT_custom_border_color = true,
|
||||
.EXT_custom_resolve = true,
|
||||
.EXT_depth_clamp_control = true,
|
||||
.EXT_depth_clamp_zero_one = true,
|
||||
.EXT_depth_clip_control = true,
|
||||
.EXT_depth_clip_enable = true,
|
||||
|
|
@ -630,6 +631,9 @@ tu_get_features(struct tu_physical_device *pdevice,
|
|||
features->customBorderColors = true;
|
||||
features->customBorderColorWithoutFormat = true;
|
||||
|
||||
/* VK_EXT_depth_clamp_control */
|
||||
features->depthClampControl = true;
|
||||
|
||||
/* VK_KHR_depth_clamp_zero_one */
|
||||
features->depthClampZeroOne = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -2531,6 +2531,7 @@ static const enum mesa_vk_dynamic_graphics_state tu_viewport_state[] = {
|
|||
MESA_VK_DYNAMIC_VP_VIEWPORTS,
|
||||
MESA_VK_DYNAMIC_VP_VIEWPORT_COUNT,
|
||||
MESA_VK_DYNAMIC_VP_DEPTH_CLIP_NEGATIVE_ONE_TO_ONE,
|
||||
MESA_VK_DYNAMIC_VP_DEPTH_CLAMP_RANGE,
|
||||
MESA_VK_DYNAMIC_RS_DEPTH_CLAMP_ENABLE,
|
||||
};
|
||||
|
||||
|
|
@ -2636,12 +2637,17 @@ tu6_emit_viewport(struct tu_cs *cs,
|
|||
|
||||
for (uint32_t i = 0; i < vp->viewport_count; i++) {
|
||||
const VkViewport *viewport = &vp->viewports[i];
|
||||
float zmin = MIN2(viewport->minDepth, viewport->maxDepth);
|
||||
float zmax = MAX2(viewport->minDepth, viewport->maxDepth);
|
||||
float zmin, zmax;
|
||||
|
||||
if (zero_one_depth_clamp) {
|
||||
if (vp->depth_clamp_mode == VK_DEPTH_CLAMP_MODE_USER_DEFINED_RANGE_EXT) {
|
||||
zmin = vp->depth_clamp_range.minDepthClamp;
|
||||
zmax = vp->depth_clamp_range.maxDepthClamp;
|
||||
} else if (zero_one_depth_clamp) {
|
||||
zmin = 0.0f;
|
||||
zmax = 1.0f;
|
||||
} else {
|
||||
zmin = MIN2(viewport->minDepth, viewport->maxDepth);
|
||||
zmax = MAX2(viewport->minDepth, viewport->maxDepth);
|
||||
}
|
||||
|
||||
crb.add(GRAS_CL_VIEWPORT_ZCLAMP_MIN(CHIP, i, zmin));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue