anv/perf: fixup counter/query mapping

The intel_perf_counter_pass::pass field is actually useless and
invalid.

Once you have mapped all the counters to all the metrics, the order of
the metrics capture is dictated by intel_perf_get_n_passes().

When reading values that is the order we should follow.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 2001a80d4a ("anv: Implement VK_KHR_performance_query")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18893>
This commit is contained in:
Lionel Landwerlin 2022-07-27 08:51:29 +00:00 committed by Marge Bot
parent 7fbfa694a8
commit 56bd81ee21
4 changed files with 7 additions and 7 deletions

View file

@ -985,12 +985,9 @@ intel_perf_get_counters_passes(struct intel_perf_config *perf,
}
}
if (pass_idx == UINT32_MAX) {
if (pass_idx == UINT32_MAX)
pass_array[n_written_passes] = counter_pass[i].query;
pass_idx = n_written_passes++;
}
counter_pass[i].pass = pass_idx;
assert(n_written_passes <= n_passes);
}
}

View file

@ -415,7 +415,6 @@ struct intel_perf_config {
struct intel_perf_counter_pass {
struct intel_perf_query_info *query;
struct intel_perf_query_counter *counter;
uint32_t pass;
};
/** Initialize the intel_perf_config object for a given device.

View file

@ -430,10 +430,12 @@ anv_perf_write_pass_results(struct intel_perf_config *perf,
const struct intel_perf_query_result *accumulated_results,
union VkPerformanceCounterResultKHR *results)
{
const struct intel_perf_query_info *query = pool->pass_query[pass];
for (uint32_t c = 0; c < pool->n_counters; c++) {
const struct intel_perf_counter_pass *counter_pass = &pool->counter_pass[c];
if (counter_pass->pass != pass)
if (counter_pass->query != query)
continue;
switch (pool->pass_query[pass]->kind) {

View file

@ -440,10 +440,12 @@ anv_perf_write_pass_results(struct intel_perf_config *perf,
const struct intel_perf_query_result *accumulated_results,
union VkPerformanceCounterResultKHR *results)
{
const struct intel_perf_query_info *query = pool->pass_query[pass];
for (uint32_t c = 0; c < pool->n_counters; c++) {
const struct intel_perf_counter_pass *counter_pass = &pool->counter_pass[c];
if (counter_pass->pass != pass)
if (counter_pass->query != query)
continue;
switch (pool->pass_query[pass]->kind) {