.EXT_calibrated_timestamps = true,
.EXT_color_write_enable = true,
.EXT_conditional_rendering = true,
+ .EXT_depth_clip_enable = true,
.EXT_extended_dynamic_state = true,
.EXT_extended_dynamic_state2 = true,
.EXT_external_memory_host = true,
features->multiDraw = true;
break;
}
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: {
+ VkPhysicalDeviceDepthClipEnableFeaturesEXT *features =
+ (VkPhysicalDeviceDepthClipEnableFeaturesEXT *)ext;
+ if (pdevice->pscreen->get_param(pdevice->pscreen, PIPE_CAP_DEPTH_CLAMP_ENABLE) != 0)
+ features->depthClipEnable = true;
+ else
+ features->depthClipEnable = false;
+ break;
+ }
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT: {
VkPhysicalDeviceExtendedDynamicState2FeaturesEXT *features = (VkPhysicalDeviceExtendedDynamicState2FeaturesEXT *)ext;
features->extendedDynamicState2 = true;
/* rasterization state */
if (pipeline->graphics_create_info.pRasterizationState) {
const VkPipelineRasterizationStateCreateInfo *rsc = pipeline->graphics_create_info.pRasterizationState;
- state->rs_state.depth_clip_near = state->rs_state.depth_clip_far = !rsc->depthClampEnable;
+ const VkPipelineRasterizationDepthClipStateCreateInfoEXT *depth_clip_state =
+ vk_find_struct_const(rsc->pNext, PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT);
+ state->rs_state.depth_clamp = rsc->depthClampEnable;
+ if (!depth_clip_state)
+ state->rs_state.depth_clip_near = state->rs_state.depth_clip_far = !rsc->depthClampEnable;
+ else
+ state->rs_state.depth_clip_near = state->rs_state.depth_clip_far = depth_clip_state->depthClipEnable;
+
if (!dynamic_states[conv_dynamic_state_idx(VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE_EXT)])
state->rs_state.rasterizer_discard = rsc->rasterizerDiscardEnable;
vk_foreach_struct(ext, src->pNext) {
switch (ext->sType) {
case VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT: {
- VkPipelineVertexInputDivisorStateCreateInfoEXT *ext_src = (VkPipelineVertexInputDivisorStateCreateInfoEXT *)ext;;
+ VkPipelineVertexInputDivisorStateCreateInfoEXT *ext_src = (VkPipelineVertexInputDivisorStateCreateInfoEXT *)ext;
VkPipelineVertexInputDivisorStateCreateInfoEXT *ext_dst = ralloc(mem_ctx, VkPipelineVertexInputDivisorStateCreateInfoEXT);
ext_dst->sType = ext_src->sType;
return VK_SUCCESS;
}
+
+static VkResult
+deep_copy_rasterization_state(void *mem_ctx,
+ VkPipelineRasterizationStateCreateInfo *dst,
+ const VkPipelineRasterizationStateCreateInfo *src)
+{
+ memcpy(dst, src, sizeof(VkPipelineRasterizationStateCreateInfo));
+ dst->pNext = NULL;
+
+ if (src->pNext) {
+ vk_foreach_struct(ext, src->pNext) {
+ switch (ext->sType) {
+ case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT: {
+ VkPipelineRasterizationDepthClipStateCreateInfoEXT *ext_src = (VkPipelineRasterizationDepthClipStateCreateInfoEXT *)ext;
+ VkPipelineRasterizationDepthClipStateCreateInfoEXT *ext_dst = ralloc(mem_ctx, VkPipelineRasterizationDepthClipStateCreateInfoEXT);
+ ext_dst->sType = ext_src->sType;
+ ext_dst->flags = ext_src->flags;
+ ext_dst->depthClipEnable = ext_src->depthClipEnable;
+ dst->pNext = ext_dst;
+ break;
+ }
+ default:
+ break;
+ }
+ }
+ }
+ return VK_SUCCESS;
+}
+
static VkResult
deep_copy_graphics_create_info(void *mem_ctx,
VkGraphicsPipelineCreateInfo *dst,
VkResult result;
VkPipelineShaderStageCreateInfo *stages;
VkPipelineVertexInputStateCreateInfo *vertex_input;
+ VkPipelineRasterizationStateCreateInfo *rasterization_state;
LVP_FROM_HANDLE(lvp_render_pass, pass, src->renderPass);
dst->sType = src->sType;
dst->pViewportState = NULL;
/* pRasterizationState */
- LVP_PIPELINE_DUP(dst->pRasterizationState,
- src->pRasterizationState,
- VkPipelineRasterizationStateCreateInfo,
- 1);
+ rasterization_state = ralloc(mem_ctx, VkPipelineRasterizationStateCreateInfo);
+ if (!rasterization_state)
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ deep_copy_rasterization_state(mem_ctx, rasterization_state, src->pRasterizationState);
+ dst->pRasterizationState = rasterization_state;
/* pMultisampleState */
if (src->pMultisampleState && !rasterization_disabled) {