summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2021-04-21 08:59:21 +0200
committerMarge Bot <eric+marge@anholt.net>2021-04-27 07:31:03 +0000
commit1bc43492b600b9a65ccd8449ddc51c2e377422fd (patch)
tree10c59dd7b1315bd0c74548a67e1009bee9839471
parent4c2add8cbababf9598319de831e1d2232b90f6c2 (diff)
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>
-rw-r--r--docs/relnotes/new_features.txt1
-rw-r--r--src/amd/vulkan/radv_device.c15
-rw-r--r--src/amd/vulkan/radv_pipeline.c12
3 files changed, 27 insertions, 1 deletions
diff --git a/docs/relnotes/new_features.txt b/docs/relnotes/new_features.txt
index eae7887d453b..8e7b54f64385 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 9ca5068973ca..67c775ab0397 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 efd1387b27c3..e7bbaa30f337 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. */