nvk/query: Pass an IS_TIMESTAMP flag explicitly to the CL kernel

This is more robust than looking at the report stride.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33959>
This commit is contained in:
Faith Ekstrand 2025-10-09 18:05:08 -04:00
parent 98b6b47599
commit 519c4c10f3
3 changed files with 6 additions and 1 deletions

View file

@ -26,7 +26,7 @@ nvk_copy_queries(uint64_t pool_addr, uint query_start, uint query_stride,
uint64_t dst_offset = dst_stride * (uint64_t)i;
uint num_reports = 1;
if (query_stride == sizeof(struct nvk_query_report)) {
if (flags & NVK_QUERY_IS_TIMESTAMP) {
/* Timestamp queries are the only ones use a single report */
if (write_results) {
vk_write_query(dst_addr + dst_offset, 0, flags, report->timestamp);

View file

@ -6,6 +6,8 @@
#include "compiler/libcl/libcl.h"
#define NVK_QUERY_IS_TIMESTAMP 0x80000000u
struct nvk_query_report {
uint64_t value;
uint64_t timestamp;

View file

@ -796,6 +796,9 @@ nvk_meta_copy_query_pool_results(struct nvk_cmd_buffer *cmd,
return;
}
if (pool->vk.query_type == VK_QUERY_TYPE_TIMESTAMP)
flags |= NVK_QUERY_IS_TIMESTAMP;
const struct nvk_copy_query_push push = {
.pool_addr = pool->mem->va->addr,
.query_start = pool->query_start,