tu: Enable VK_EXT_depth_clip_enable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6047>
This commit is contained in:
Connor Abbott 2020-07-23 11:44:40 +02:00 committed by Marge Bot
parent 1b3be07b5f
commit 1610c69f34
3 changed files with 17 additions and 2 deletions

View File

@ -768,6 +768,12 @@ tu_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
features->privateData = true;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: {
VkPhysicalDeviceDepthClipEnableFeaturesEXT *features =
(VkPhysicalDeviceDepthClipEnableFeaturesEXT *)ext;
features->depthClipEnable = true;
break;
}
default:
break;
}

View File

@ -87,6 +87,7 @@ EXTENSIONS = [
Extension('VK_KHR_variable_pointers', 1, True),
Extension('VK_EXT_private_data', 1, True),
Extension('VK_EXT_shader_stencil_export', 1, True),
Extension('VK_EXT_depth_clip_enable', 1, True),
]
MAX_API_VERSION = VkVersion(MAX_API_VERSION)

View File

@ -2216,13 +2216,21 @@ tu_pipeline_builder_parse_rasterization(struct tu_pipeline_builder *builder,
enum a6xx_polygon_mode mode = tu6_polygon_mode(rast_info->polygonMode);
bool depth_clip_disable = rast_info->depthClampEnable;
const VkPipelineRasterizationDepthClipStateCreateInfoEXT *depth_clip_state =
vk_find_struct_const(rast_info, PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT);
if (depth_clip_state)
depth_clip_disable = !depth_clip_state->depthClipEnable;
struct tu_cs cs;
pipeline->rast_state = tu_cs_draw_state(&pipeline->cs, &cs, 9);
tu_cs_emit_regs(&cs,
A6XX_GRAS_CL_CNTL(
.znear_clip_disable = rast_info->depthClampEnable,
.zfar_clip_disable = rast_info->depthClampEnable,
.znear_clip_disable = depth_clip_disable,
.zfar_clip_disable = depth_clip_disable,
/* TODO should this be depth_clip_disable instead? */
.unk5 = rast_info->depthClampEnable,
.zero_gb_scale_z = 1,
.vp_clip_code_ignore = 1));