Commit 937dd764 authored by Hyunjun Ko's avatar Hyunjun Ko Committed by Marge Bot

turnip: Implement VK_KHR_performance_query

There are still some commands unimplemented yet.

- vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR:
  The following patch supports this.

- vkAcquireProfilingLockKHR / vkReleaseProfilingLock
  This patch supports only monitoring perf counters for each submit.
  To reserve/configure counters across submits we would need a kernel
  interface to be able to do that.
Signed-off-by: Hyunjun Ko's avatarHyunjun Ko <zzoon@igalia.com>
Part-of: <!6808>
parent a250f362
......@@ -132,6 +132,7 @@ libvulkan_freedreno = shared_library(
tu_link_with,
libfreedreno_ir3,
libfreedreno_layout,
libfreedreno_perfcntrs,
],
dependencies : [
idep_libfreedreno_common,
......
......@@ -614,6 +614,14 @@ tu_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
features->extendedDynamicState = true;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR: {
VkPhysicalDevicePerformanceQueryFeaturesKHR *feature =
(VkPhysicalDevicePerformanceQueryFeaturesKHR *)ext;
feature->performanceCounterQueryPools = true;
feature->performanceCounterMultipleQueryPools = false;
break;
}
default:
break;
}
......@@ -867,6 +875,12 @@ tu_GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice,
props->supportedStencilResolveModes = VK_RESOLVE_MODE_SAMPLE_ZERO_BIT;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR: {
VkPhysicalDevicePerformanceQueryPropertiesKHR *properties =
(VkPhysicalDevicePerformanceQueryPropertiesKHR *)ext;
properties->allowCommandBufferQueryCopies = false;
break;
}
default:
break;
}
......
......@@ -101,6 +101,7 @@ EXTENSIONS = [
Extension('VK_KHR_incremental_present', 1, 'TU_HAS_SURFACE'),
Extension('VK_KHR_image_format_list', 1, True),
Extension('VK_KHR_depth_stencil_resolve', 1, True),
Extension('VK_KHR_performance_query', 1, False),
]
MAX_API_VERSION = VkVersion(MAX_API_VERSION)
......
......@@ -64,6 +64,7 @@
#include "a6xx.xml.h"
#include "fdl/freedreno_layout.h"
#include "common/freedreno_dev_info.h"
#include "perfcntrs/freedreno_perfcntr.h"
#include "tu_descriptor_set.h"
#include "tu_extensions.h"
......@@ -1511,6 +1512,12 @@ struct tu_query_pool
uint64_t size;
uint32_t pipeline_statistics;
struct tu_bo bo;
/* For performance query */
const struct fd_perfcntr_group *perf_group;
uint32_t perf_group_count;
uint32_t counter_index_count;
uint32_t counter_indices[0];
};
uint32_t
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment