Unified · Split
| @@ -281,6 +281,15 @@ int ff_vk_exec_pool_init(FFVulkanContext *s, FFVkQueueFamilyCtx *qf, · 280 unmodified lines | ||
| 281 | 281 | VkCommandPoolCreateInfo cqueue_create; |
| 282 | 282 | VkCommandBufferAllocateInfo cbuf_create; |
| 283 | 283 | |
| 284 | + const VkQueryPoolVideoEncodeFeedbackCreateInfoKHR *ef = NULL; | |
| 285 | + | |
| 286 | + if (query_type == VK_QUERY_TYPE_VIDEO_ENCODE_FEEDBACK_KHR) { | |
| 287 | + ef = ff_vk_find_struct(query_create_pnext, | |
| 288 | + VK_STRUCTURE_TYPE_QUERY_POOL_VIDEO_ENCODE_FEEDBACK_CREATE_INFO_KHR); | |
| 289 | + if (!ef) | |
| 290 | + return AVERROR(EINVAL); | |
| 291 | + } | |
| 292 | + | |
| 284 | 293 | /* Create command pool */ |
| 285 | 294 | cqueue_create = (VkCommandPoolCreateInfo) { |
| 286 | 295 | .sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, |
| @@ -338,21 +347,18 @@ int ff_vk_exec_pool_init(FFVulkanContext *s, FFVkQueueFamilyCtx *qf, · 51 unmodified lines | ||
| 338 | 347 | } |
| 339 | 348 | |
| 340 | 349 | pool->nb_queries = nb_queries; |
| 341 | − pool->query_status_stride = 2; | |
| 350 | + pool->query_status_stride = 1 + 1; /* One result, one status by default */ | |
| 342 | 351 | pool->query_results = nb_queries; |
| 343 | − pool->query_statuses = 0; /* if radv supports it, nb_queries; */ | |
| 352 | + pool->query_statuses = nb_queries; | |
| 344 | 353 | |
| 345 | −#if 0 /* CONFIG_VULKAN_ENCODE */ | |
| 346 | 354 | /* Video encode quieries produce two results per query */ |
| 347 | 355 | if (query_type == VK_QUERY_TYPE_VIDEO_ENCODE_FEEDBACK_KHR) { |
| 348 | − pool->query_status_stride = 3; /* skip,skip,result,skip,skip,result */ | |
| 349 | − pool->query_results *= 2; | |
| 350 | − } else | |
| 351 | −#endif | |
| 352 | − if (query_type == VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR) { | |
| 356 | + int nb_results = av_popcount(ef->encodeFeedbackFlags); | |
| 357 | + pool->query_status_stride = nb_results + 1; | |
| 358 | + pool->query_results *= nb_results; | |
| 359 | + } else if (query_type == VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR) { | |
| 353 | 360 | pool->query_status_stride = 1; |
| 354 | 361 | pool->query_results = 0; |
| 355 | − pool->query_statuses = nb_queries; | |
| 356 | 362 | } |
| 357 | 363 | |
| 358 | 364 | pool->qd_size = (pool->query_results + pool->query_statuses)*(query_64bit ? 8 : 4); |
| @@ -444,7 +450,7 @@ VkResult ff_vk_exec_get_query(FFVulkanContext *s, FFVkExecContext *e, · 85 unmodified lines | ||
| 444 | 450 | e->query_idx, |
| 445 | 451 | pool->nb_queries, |
| 446 | 452 | pool->qd_size, e->query_data, |
| 447 | − pool->query_64bit ? 8 : 4, qf); | |
| 453 | + pool->qd_size, qf); | |
| 448 | 454 | if (ret != VK_SUCCESS) |
| 449 | 455 | return ret; |
| 450 | 456 | |