# New CTS failures in 1.3.5.0
dEQP-VK.drm_format_modifiers.export_import_fmt_features2.b4g4r4a4_unorm_pack16,Crash
-
-# Waiting on clarification from https://gitlab.khronos.org/vulkan/vulkan/-/issues/3115
-dEQP-VK.pipeline.pipeline_library.creation_feedback.graphics_tests.vertex_stage_geometry_stage_fragment_stage_delayed_destroy,Crash
-dEQP-VK.pipeline.pipeline_library.creation_feedback.graphics_tests.vertex_stage_fragment_stage,Crash
-dEQP-VK.pipeline.pipeline_library.creation_feedback.graphics_tests.vertex_stage_tessellation_control_stage_tessellation_evaluation_stage_fragment_stage_no_cache,Crash
-dEQP-VK.pipeline.pipeline_library.creation_feedback.graphics_tests.vertex_stage_geometry_stage_fragment_stage,Crash
-dEQP-VK.pipeline.pipeline_library.creation_feedback.graphics_tests.vertex_stage_tessellation_control_stage_tessellation_evaluation_stage_fragment_stage_delayed_destroy,Crash
-dEQP-VK.pipeline.pipeline_library.creation_feedback.graphics_tests.vertex_stage_fragment_stage_delayed_destroy,Crash
-dEQP-VK.pipeline.pipeline_library.creation_feedback.graphics_tests.vertex_stage_geometry_stage_fragment_stage_no_cache,Crash
-dEQP-VK.pipeline.pipeline_library.creation_feedback.graphics_tests.vertex_stage_fragment_stage_no_cache,Crash
-dEQP-VK.pipeline.pipeline_library.creation_feedback.graphics_tests.vertex_stage_tessellation_control_stage_tessellation_evaluation_stage_fragment_stage,Crash
char *disasm[3];
VkPipelineCreationFeedback feedback;
+ uint32_t feedback_idx;
const unsigned *code;
}
static void
-anv_fill_pipeline_creation_feedback(VkPipelineCreationFeedbackEXT *pipeline_feedback,
+anv_fill_pipeline_creation_feedback(const struct anv_graphics_base_pipeline *pipeline,
+ VkPipelineCreationFeedbackEXT *pipeline_feedback,
const VkGraphicsPipelineCreateInfo *info,
struct anv_pipeline_stage *stages)
{
if (create_feedback) {
*create_feedback->pPipelineCreationFeedback = *pipeline_feedback;
- uint32_t stage_count = create_feedback->pipelineStageCreationFeedbackCount;
- assert(stage_count == 0 || info->stageCount == stage_count);
- for (uint32_t i = 0; i < stage_count; i++) {
- gl_shader_stage s = vk_to_mesa_shader_stage(info->pStages[i].stage);
- create_feedback->pPipelineStageCreationFeedbacks[i] = stages[s].feedback;
+ /* VkPipelineCreationFeedbackCreateInfo:
+ *
+ * "An implementation must set or clear the
+ * VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT in
+ * VkPipelineCreationFeedback::flags for pPipelineCreationFeedback
+ * and every element of pPipelineStageCreationFeedbacks."
+ *
+ */
+ for (uint32_t i = 0; i < create_feedback->pipelineStageCreationFeedbackCount; i++) {
+ create_feedback->pPipelineStageCreationFeedbacks[i].flags &=
+ ~VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT;
+ }
+ /* This part is not really specified in the Vulkan spec at the moment.
+ * We're kind of guessing what the CTS wants. We might need to update
+ * when https://gitlab.khronos.org/vulkan/vulkan/-/issues/3115 is
+ * clarified.
+ */
+ for (uint32_t s = 0; s < ANV_GRAPHICS_SHADER_STAGE_COUNT; s++) {
+ if (!anv_pipeline_base_has_stage(pipeline, s))
+ continue;
+
+ if (stages[s].feedback_idx < create_feedback->pipelineStageCreationFeedbackCount) {
+ create_feedback->pPipelineStageCreationFeedbacks[
+ stages[s].feedback_idx] = stages[s].feedback;
+ }
}
}
}
+static uint32_t
+anv_graphics_pipeline_imported_shader_count(struct anv_pipeline_stage *stages)
+{
+ uint32_t count = 0;
+ for (uint32_t s = 0; s < ANV_GRAPHICS_SHADER_STAGE_COUNT; s++) {
+ if (stages[s].imported.bin != NULL)
+ count++;
+ }
+ return count;
+}
+
static VkResult
anv_graphics_pipeline_compile(struct anv_graphics_base_pipeline *pipeline,
struct anv_pipeline_stage *stages,
* Other shaders imported from libraries should have been added by
* anv_graphics_pipeline_import_lib().
*/
+ uint32_t shader_count = anv_graphics_pipeline_imported_shader_count(stages);
for (uint32_t i = 0; i < info->stageCount; i++) {
gl_shader_stage stage = vk_to_mesa_shader_stage(info->pStages[i].stage);
stages[stage].stage = stage;
stages[stage].info = &info->pStages[i];
+ stages[stage].feedback_idx = shader_count++;
vk_pipeline_hash_shader_stage(stages[stage].info, NULL, stages[stage].shader_sha1);
}
done:
- pipeline_feedback->duration = os_time_get_nano() - pipeline_start;
+ /* Write the feedback index into the pipeline */
+ for (unsigned s = 0; s < ARRAY_SIZE(pipeline->shaders); s++) {
+ if (!anv_pipeline_base_has_stage(pipeline, s))
+ continue;
- anv_fill_pipeline_creation_feedback(pipeline_feedback, info, stages);
+ struct anv_pipeline_stage *stage = &stages[s];
+ pipeline->feedback_index[s] = stage->feedback_idx;
+ }
+
+ pipeline_feedback->duration = os_time_get_nano() - pipeline_start;
if (pipeline->shaders[MESA_SHADER_FRAGMENT]) {
pipeline->fragment_dynamic =
}
}
+ uint32_t shader_count = anv_graphics_pipeline_imported_shader_count(stages);
for (uint32_t s = 0; s < ARRAY_SIZE(lib->base.shaders); s++) {
if (lib->base.shaders[s] == NULL)
continue;
stages[s].stage = s;
+ stages[s].feedback_idx = shader_count + lib->base.feedback_index[s];
/* Always import the shader sha1, this will be used for cache lookup. */
memcpy(stages[s].shader_sha1, lib->retained_shaders[s].shader_sha1,
pipeline_feedback.duration = os_time_get_nano() - pipeline_start;
- anv_fill_pipeline_creation_feedback(&pipeline_feedback, pCreateInfo, stages);
+ anv_fill_pipeline_creation_feedback(&pipeline->base, &pipeline_feedback,
+ pCreateInfo, stages);
anv_graphics_lib_validate_shaders(pipeline,
pCreateInfo->flags & VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT);
pipeline_feedback.duration = os_time_get_nano() - pipeline_start;
- anv_fill_pipeline_creation_feedback(&pipeline_feedback, pCreateInfo, stages);
+ anv_fill_pipeline_creation_feedback(&pipeline->base, &pipeline_feedback,
+ pCreateInfo, stages);
*pPipeline = anv_pipeline_to_handle(&pipeline->base.base);