diff --git a/docs/relnotes/new_features.txt b/docs/relnotes/new_features.txt index eae7887d453..8e7b54f6438 100644 --- a/docs/relnotes/new_features.txt +++ b/docs/relnotes/new_features.txt @@ -1 +1,2 @@ zink supports GL_ARB_texture_filter_minmax +VK_EXT_provoking_vertex on RADV. diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 9ca5068973c..67c775ab039 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -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; } diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index efd1387b27c..e7bbaa30f33 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -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. */