lavapipe: implement VK_EXT_provoking_vertex

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10458>
This commit is contained in:
Mike Blumenkrantz
2021-04-20 17:19:05 -04:00
committed by Marge Bot
parent a60767ec26
commit 0e439541a5
4 changed files with 23 additions and 2 deletions

View File

@@ -137,6 +137,7 @@ static const struct vk_device_extension_table lvp_device_extensions_supported =
.EXT_transform_feedback = true,
.EXT_vertex_attribute_divisor = true,
.EXT_custom_border_color = true,
.EXT_provoking_vertex = true,
.GOOGLE_decorate_string = true,
.GOOGLE_hlsl_functionality1 = true,
};
@@ -636,7 +637,13 @@ VKAPI_ATTR void VKAPI_CALL lvp_GetPhysicalDeviceFeatures2(
features->customBorderColorWithoutFormat = true;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: {
VkPhysicalDeviceProvokingVertexFeaturesEXT *features =
(VkPhysicalDeviceProvokingVertexFeaturesEXT*)ext;
features->provokingVertexLast = true;
features->transformFeedbackPreservesProvokingVertex = true;
break;
}
default:
break;
}
@@ -954,6 +961,13 @@ VKAPI_ATTR void VKAPI_CALL lvp_GetPhysicalDeviceProperties2(
properties->maxCustomBorderColorSamplers = 32 * 1024;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT: {
VkPhysicalDeviceProvokingVertexPropertiesEXT *properties =
(VkPhysicalDeviceProvokingVertexPropertiesEXT*)ext;
properties->provokingVertexModePerPipeline = true;
properties->transformFeedbackPreservesTriangleFanProvokingVertex = true;
break;
}
default:
break;
}

View File

@@ -463,7 +463,7 @@ static void handle_graphics_pipeline(struct lvp_cmd_buffer_entry *cmd,
state->rs_state.fill_front = vk_polygon_mode_to_pipe(rsc->polygonMode);
state->rs_state.fill_back = vk_polygon_mode_to_pipe(rsc->polygonMode);
state->rs_state.point_size_per_vertex = true;
state->rs_state.flatshade_first = true;
state->rs_state.flatshade_first = !pipeline->provoking_vertex_last;
state->rs_state.point_quad_rasterization = true;
state->rs_state.clip_halfz = true;
state->rs_state.half_pixel_center = true;

View File

@@ -755,6 +755,12 @@ lvp_graphics_pipeline_init(struct lvp_pipeline *pipeline,
deep_copy_graphics_create_info(pipeline->mem_ctx, &pipeline->graphics_create_info, pCreateInfo);
pipeline->is_compute_pipeline = false;
const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT *pv_state =
vk_find_struct_const(pCreateInfo->pRasterizationState,
PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT);
pipeline->provoking_vertex_last = pv_state && pv_state->provokingVertexMode == VK_PROVOKING_VERTEX_MODE_LAST_VERTEX_EXT;
for (uint32_t i = 0; i < pCreateInfo->stageCount; i++) {
VK_FROM_HANDLE(vk_shader_module, module,
pCreateInfo->pStages[i].module);

View File

@@ -475,6 +475,7 @@ struct lvp_pipeline {
void *shader_cso[PIPE_SHADER_TYPES];
VkGraphicsPipelineCreateInfo graphics_create_info;
VkComputePipelineCreateInfo compute_create_info;
bool provoking_vertex_last;
};
struct lvp_event {