Lines Matching defs:query
32 * even though this query needs an 8-byte slot. */
96 /* Returns the IOVA of a given uint64_t field in a given slot of a query
98 #define query_iova(type, pool, query, field) \
99 pool->bo->iova + pool->stride * (query) + offsetof(type, field)
101 #define occlusion_query_iova(pool, query, field) \
102 query_iova(struct occlusion_query_slot, pool, query, field)
104 #define pipeline_stat_query_iova(pool, query, field) \
105 pool->bo->iova + pool->stride * (query) + \
108 #define primitive_query_iova(pool, query, field, i) \
109 query_iova(struct primitive_query_slot, pool, query, field) + \
112 #define perf_query_iova(pool, query, field, i) \
113 pool->bo->iova + pool->stride * (query) + \
118 #define primitives_generated_query_iova(pool, query, field) \
119 query_iova(struct primitives_generated_query_slot, pool, query, field)
121 #define query_available_iova(pool, query) \
122 query_iova(struct query_slot, pool, query, available)
124 #define query_result_iova(pool, query, type, i) \
125 pool->bo->iova + pool->stride * (query) + \
128 #define query_result_addr(pool, query, type, i) \
129 pool->bo->map + pool->stride * (query) + \
153 * when it starts supporting perf query.
172 * Returns a pointer to a given slot in a query pool.
174 static void* slot_address(struct tu_query_pool *pool, uint32_t query)
176 return (char*)pool->bo->map + query * pool->stride;
252 unreachable("Invalid query type");
324 /* Initialize all query statuses to unavailable */
368 assert(!"Invalid query type");
435 /* Wait on the the availability status of a query up until a timeout. */
438 uint32_t query)
443 struct query_slot *slot = slot_address(pool, query);
453 /* Writes a query value to a buffer from the CPU. */
482 uint32_t query = firstQuery + i;
483 struct query_slot *slot = slot_address(pool, query);
489 VkResult wait_result = wait_for_available(device, pool, query);
516 result = query_result_addr(pool, query, uint64_t, stat_idx);
518 result = query_result_addr(pool, query, struct perfcntr_query_slot, k);
520 result = query_result_addr(pool, query, uint64_t, k);
528 * is not set, and the query’s status is unavailable, an
530 * value is written to pData for that query.
541 * integer value written for each query is non-zero if the query’s
578 assert(!"Invalid query type");
583 /* Copies a query value from one buffer to another from the GPU. */
626 uint32_t query = firstQuery + i;
627 uint64_t available_iova = query_available_iova(pool, query);
649 result_iova = query_result_iova(pool, query, uint64_t, stat_idx);
651 result_iova = query_result_iova(pool, query,
654 result_iova = query_result_iova(pool, query, uint64_t, k);
660 * if the query is unavailable, this will copy the correct partial
667 * query is available.
721 assert(!"Invalid query type");
734 uint32_t query = firstQuery + i;
738 tu_cs_emit_qw(cs, query_available_iova(pool, query));
746 result_iova = query_result_iova(pool, query, uint64_t, stat_idx);
748 result_iova = query_result_iova(pool, query,
751 result_iova = query_result_iova(pool, query, uint64_t, k);
781 assert(!"Invalid query type");
815 uint32_t query)
819 * A query must begin and end inside the same subpass of a render pass
825 * query begins/ends inside the same subpass of a render pass, we need to
828 * sample counts in slot->result to compute the query result.
832 uint64_t begin_iova = occlusion_query_iova(pool, query, begin);
847 uint32_t query)
850 uint64_t begin_iova = pipeline_stat_query_iova(pool, query, begin);
857 * for outer VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT query.
907 uint32_t query)
918 * 0) There's a scratch reg to set a pass index for perf counters query.
922 * passes in begin/end query with CP_REG_TEST/CP_COND_REG_EXEC, which
985 uint32_t query,
989 uint64_t begin_iova = primitive_query_iova(pool, query, begin[0], 0);
998 uint32_t query)
1001 uint64_t begin_iova = primitives_generated_query_iova(pool, query, begin);
1038 uint32_t query,
1043 assert(query < pool->size);
1051 emit_begin_occlusion_query(cmdbuf, pool, query);
1054 emit_begin_xfb_query(cmdbuf, pool, query, 0);
1057 emit_begin_prim_generated_query(cmdbuf, pool, query);
1060 emit_begin_perf_query(cmdbuf, pool, query);
1063 emit_begin_stat_query(cmdbuf, pool, query);
1066 unreachable("Unimplemented query type");
1068 assert(!"Invalid query type");
1075 uint32_t query,
1081 assert(query < pool->size);
1085 emit_begin_xfb_query(cmdbuf, pool, query, index);
1088 emit_begin_prim_generated_query(cmdbuf, pool, query);
1091 assert(!"Invalid query type");
1098 uint32_t query)
1100 /* Ending an occlusion query happens in a few steps:
1106 * 4) Accumulate the results of the query (slot->end - slot->begin) into
1109 * pass, set the slot's available bit since the query is now done.
1117 uint64_t available_iova = query_available_iova(pool, query);
1118 uint64_t begin_iova = occlusion_query_iova(pool, query, begin);
1119 uint64_t end_iova = occlusion_query_iova(pool, query, end);
1120 uint64_t result_iova = query_result_iova(pool, query, uint64_t, 0);
1172 * only for outer query.
1174 * Also, pipeline stat query could run outside of renderpass and prim gen
1175 * query inside of secondary cmd buffer - for such case we ought to track
1176 * the status of pipeline stats query.
1195 /* Check that pipeline stats query is not running, only then
1218 uint32_t query)
1221 uint64_t end_iova = pipeline_stat_query_iova(pool, query, end);
1222 uint64_t available_iova = query_available_iova(pool, query);
1252 result_iova = query_result_iova(pool, query, uint64_t, i);
1253 stat_start_iova = pipeline_stat_query_iova(pool, query, begin[i]);
1254 stat_stop_iova = pipeline_stat_query_iova(pool, query, end[i]);
1281 uint32_t query)
1284 uint64_t available_iova = query_available_iova(pool, query);
1360 uint32_t query,
1365 uint64_t end_iova = primitive_query_iova(pool, query, end[0], 0);
1366 uint64_t result_written_iova = query_result_iova(pool, query, uint64_t, 0);
1367 uint64_t result_generated_iova = query_result_iova(pool, query, uint64_t, 1);
1368 uint64_t begin_written_iova = primitive_query_iova(pool, query, begin[stream_id], 0);
1369 uint64_t begin_generated_iova = primitive_query_iova(pool, query, begin[stream_id], 1);
1370 uint64_t end_written_iova = primitive_query_iova(pool, query, end[stream_id], 0);
1371 uint64_t end_generated_iova = primitive_query_iova(pool, query, end[stream_id], 1);
1372 uint64_t available_iova = query_available_iova(pool, query);
1409 uint32_t query)
1417 uint64_t begin_iova = primitives_generated_query_iova(pool, query, begin);
1418 uint64_t end_iova = primitives_generated_query_iova(pool, query, end);
1419 uint64_t result_iova = primitives_generated_query_iova(pool, query, result);
1420 uint64_t available_iova = query_available_iova(pool, query);
1447 * about which query is running.
1467 * multiview enabled, the query uses N consecutive query indices in the
1468 * query pool (starting at query) where N is the number of bits set in the
1469 * view mask in the subpass the query is used in. How the numerical
1470 * results of the query are distributed among the queries is
1472 * each view’s results to a distinct query, while other implementations
1473 * may write the total result to the first query and write zero to the
1475 * accurately reflect the total result of the query summed over all views.
1487 uint32_t query)
1497 tu_cs_emit_qw(cs, query_available_iova(pool, query + i));
1505 uint32_t query)
1509 assert(query < pool->size);
1513 emit_end_occlusion_query(cmdbuf, pool, query);
1516 emit_end_xfb_query(cmdbuf, pool, query, 0);
1519 emit_end_prim_generated_query(cmdbuf, pool, query);
1522 emit_end_perf_query(cmdbuf, pool, query);
1525 emit_end_stat_query(cmdbuf, pool, query);
1528 unreachable("Unimplemented query type");
1530 assert(!"Invalid query type");
1533 handle_multiview_queries(cmdbuf, pool, query);
1539 uint32_t query,
1544 assert(query < pool->size);
1549 emit_end_xfb_query(cmdbuf, pool, query, index);
1552 emit_end_prim_generated_query(cmdbuf, pool, query);
1555 assert(!"Invalid query type");
1563 uint32_t query)
1598 tu_cs_emit_qw(cs, query_result_iova(pool, query, uint64_t, 0));
1606 tu_cs_emit_qw(cs, query_available_iova(pool, query));
1613 * query indices in the query pool (starting at query) where N is the
1615 * executed in. The resulting query values are determined by an
1618 * - The first query is a timestamp value and (if more than one bit is
1622 * difference between the first query written by each command.
1634 handle_multiview_queries(cmd, pool, query);