nvk: enable EXT_depth_clip_control

This is already handled in the dynamic state.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Dave Airlie 2023-07-26 17:27:43 +10:00 committed by Marge Bot
parent 57c38a5669
commit 15d12bb615
2 changed files with 14 additions and 3 deletions

View file

@ -926,18 +926,25 @@ nvk_flush_vp_state(struct nvk_cmd_buffer *cmd)
/* Nothing to do for MESA_VK_DYNAMIC_VP_VIEWPORT_COUNT */
if (BITSET_TEST(dyn->dirty, MESA_VK_DYNAMIC_VP_VIEWPORTS)) {
if (BITSET_TEST(dyn->dirty, MESA_VK_DYNAMIC_VP_VIEWPORTS) ||
BITSET_TEST(dyn->dirty, MESA_VK_DYNAMIC_VP_DEPTH_CLIP_NEGATIVE_ONE_TO_ONE)) {
for (uint32_t i = 0; i < dyn->vp.viewport_count; i++) {
const VkViewport *vp = &dyn->vp.viewports[i];
P_MTHD(p, NV9097, SET_VIEWPORT_SCALE_X(i));
P_NV9097_SET_VIEWPORT_SCALE_X(p, i, fui(0.5f * vp->width));
P_NV9097_SET_VIEWPORT_SCALE_Y(p, i, fui(0.5f * vp->height));
P_NV9097_SET_VIEWPORT_SCALE_Z(p, i, fui(vp->maxDepth - vp->minDepth));
if (dyn->vp.depth_clip_negative_one_to_one)
P_NV9097_SET_VIEWPORT_SCALE_Z(p, i, fui(0.5f * (vp->maxDepth - vp->minDepth)));
else
P_NV9097_SET_VIEWPORT_SCALE_Z(p, i, fui(vp->maxDepth - vp->minDepth));
P_NV9097_SET_VIEWPORT_OFFSET_X(p, i, fui(vp->x + 0.5f * vp->width));
P_NV9097_SET_VIEWPORT_OFFSET_Y(p, i, fui(vp->y + 0.5f * vp->height));
P_NV9097_SET_VIEWPORT_OFFSET_Z(p, i, fui(vp->minDepth));
if (dyn->vp.depth_clip_negative_one_to_one)
P_NV9097_SET_VIEWPORT_OFFSET_Z(p, i, fui(0.5f * (vp->minDepth + vp->maxDepth)));
else
P_NV9097_SET_VIEWPORT_OFFSET_Z(p, i, fui(vp->minDepth));
float xmin = vp->x;
float xmax = vp->x + vp->width;

View file

@ -374,6 +374,7 @@ nvk_get_device_extensions(const struct nv_device_info *info,
.EXT_border_color_swizzle = true,
.EXT_buffer_device_address = true,
.EXT_custom_border_color = true,
.EXT_depth_clip_control = true,
.EXT_descriptor_indexing = true,
.EXT_extended_dynamic_state = true,
.EXT_extended_dynamic_state2 = true,
@ -525,6 +526,9 @@ nvk_get_device_features(const struct nv_device_info *info,
.customBorderColors = true,
.customBorderColorWithoutFormat = true,
/* VK_EXT_depth_clip_control */
.depthClipControl = true,
/* VK_EXT_extended_dynamic_state */
.extendedDynamicState = true,