turnip: implement VK_EXT_provoking_vertex

Passes: dEQP-VK.rasterization.provoking_vertex.*

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11112>
This commit is contained in:
Danylo Piliaiev 2021-06-01 12:49:31 +03:00 committed by Marge Bot
parent 49add985ff
commit 20d8324a1b
5 changed files with 23 additions and 0 deletions

View File

@ -537,6 +537,7 @@ Khronos extensions that are not part of any Vulkan version:
VK_EXT_pipeline_creation_feedback DONE (anv, radv)
VK_EXT_post_depth_coverage DONE (anv/gfx10+, lvp, radv)
VK_EXT_private_data DONE (anv, lvp, radv, tu, v3dv)
VK_EXT_provoking_vertex DONE (anv, lvp, radv, tu)
VK_EXT_queue_family_foreign DONE (anv, radv)
VK_EXT_robustness2 DONE (anv, radv, tu)
VK_EXT_sample_locations DONE (anv, radv/gfx9-, tu/a650)

View File

@ -3632,6 +3632,7 @@ tu6_draw_common(struct tu_cmd_buffer *cmd,
tu_cs_emit_regs(cs, A6XX_PC_PRIMITIVE_CNTL_0(
.primitive_restart =
pipeline->ia.primitive_restart && indexed,
.provoking_vtx_last = pipeline->provoking_vertex_last,
.tess_upper_left_domain_origin =
pipeline->tess.upper_left_domain_origin));

View File

@ -177,6 +177,7 @@ get_device_extensions(const struct tu_physical_device *device,
.EXT_shader_stencil_export = true,
.EXT_shader_viewport_index_layer = true,
.EXT_vertex_attribute_divisor = true,
.EXT_provoking_vertex = true,
#ifdef ANDROID
.ANDROID_native_buffer = true,
#endif
@ -734,6 +735,13 @@ tu_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
features->timelineSemaphore = 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;
@ -1059,6 +1067,13 @@ tu_GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice,
props->maxTimelineSemaphoreValueDifference = UINT64_MAX;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT: {
VkPhysicalDeviceProvokingVertexPropertiesEXT *properties =
(VkPhysicalDeviceProvokingVertexPropertiesEXT *)ext;
properties->provokingVertexModePerPipeline = true;
properties->transformFeedbackPreservesTriangleFanProvokingVertex = false;
break;
}
default:
break;
}

View File

@ -2642,6 +2642,10 @@ tu_pipeline_builder_parse_rasterization(struct tu_pipeline_builder *builder,
rast_info->depthBiasSlopeFactor);
}
const struct VkPipelineRasterizationProvokingVertexStateCreateInfoEXT *provoking_vtx_state =
vk_find_struct_const(rast_info->pNext, PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT);
pipeline->provoking_vertex_last = provoking_vtx_state &&
provoking_vtx_state->provokingVertexMode == VK_PROVOKING_VERTEX_MODE_LAST_VERTEX_EXT;
}
static void

View File

@ -1173,6 +1173,8 @@ struct tu_pipeline
uint32_t local_size[3];
} compute;
bool provoking_vertex_last;
struct tu_lrz_pipeline lrz;
void *executables_mem_ctx;