radv: implement VK_EXT_provoking_vertex

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Tested-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10449>
This commit is contained in:
Samuel Pitoiset 2021-04-21 08:59:21 +02:00 committed by Marge Bot
parent 4c2add8cba
commit 1bc43492b6
3 changed files with 27 additions and 1 deletions

View File

@ -1 +1,2 @@
zink supports GL_ARB_texture_filter_minmax
VK_EXT_provoking_vertex on RADV.

View File

@ -455,6 +455,7 @@ radv_physical_device_get_supported_extensions(const struct radv_physical_device
.EXT_pipeline_creation_feedback = true,
.EXT_post_depth_coverage = device->rad_info.chip_class >= GFX10,
.EXT_private_data = true,
.EXT_provoking_vertex = true,
.EXT_queue_family_foreign = true,
.EXT_robustness2 = true,
.EXT_sample_locations = device->rad_info.chip_class < GFX10,
@ -1608,6 +1609,13 @@ radv_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
features->shaderZeroInitializeWorkgroupMemory = 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;
}
@ -2273,6 +2281,13 @@ radv_GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice,
props->fragmentShadingRateStrictMultiplyCombiner = true;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT: {
VkPhysicalDeviceProvokingVertexPropertiesEXT *props =
(VkPhysicalDeviceProvokingVertexPropertiesEXT *)ext;
props->provokingVertexModePerPipeline = true;
props->transformFeedbackPreservesTriangleFanProvokingVertex = true;
break;
}
default:
break;
}

View File

@ -1728,6 +1728,15 @@ radv_pipeline_init_raster_state(struct radv_pipeline *pipeline,
const VkGraphicsPipelineCreateInfo *pCreateInfo)
{
const VkPipelineRasterizationStateCreateInfo *raster_info = pCreateInfo->pRasterizationState;
const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT *provoking_vtx_info =
vk_find_struct_const(raster_info->pNext,
PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT);
bool provoking_vtx_last = false;
if (provoking_vtx_info &&
provoking_vtx_info->provokingVertexMode == VK_PROVOKING_VERTEX_MODE_LAST_VERTEX_EXT) {
provoking_vtx_last = true;
}
pipeline->graphics.pa_su_sc_mode_cntl =
S_028814_FACE(raster_info->frontFace) |
@ -1738,7 +1747,8 @@ radv_pipeline_init_raster_state(struct radv_pipeline *pipeline,
S_028814_POLYMODE_BACK_PTYPE(si_translate_fill(raster_info->polygonMode)) |
S_028814_POLY_OFFSET_FRONT_ENABLE(raster_info->depthBiasEnable ? 1 : 0) |
S_028814_POLY_OFFSET_BACK_ENABLE(raster_info->depthBiasEnable ? 1 : 0) |
S_028814_POLY_OFFSET_PARA_ENABLE(raster_info->depthBiasEnable ? 1 : 0);
S_028814_POLY_OFFSET_PARA_ENABLE(raster_info->depthBiasEnable ? 1 : 0) |
S_028814_PROVOKING_VTX_LAST(provoking_vtx_last);
if (pipeline->device->physical_device->rad_info.chip_class >= GFX10) {
/* It should also be set if PERPENDICULAR_ENDCAP_ENA is set. */