Path: blob/21.2-virgl/src/intel/vulkan/anv_measure.h
4547 views
/*1* Copyright © 2020 Intel Corporation2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* on the rights to use, copy, modify, merge, publish, distribute, sub7* license, and/or sell copies of the Software, and to permit persons to whom8* the Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice (including the next11* paragraph) shall be included in all copies or substantial portions of the12* Software.13*14* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR15* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,16* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL17* THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,18* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR19* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE20* USE OR OTHER DEALINGS IN THE SOFTWARE.21*/2223#ifndef ANV_MEASURE_H24#define ANV_MEASURE_H2526#include "anv_private.h"27#include "common/intel_measure.h"2829void anv_measure_device_init(struct anv_physical_device *device);30void anv_measure_device_destroy(struct anv_physical_device *device);3132void anv_measure_init(struct anv_cmd_buffer *cmd_buffer);33void anv_measure_destroy(struct anv_cmd_buffer *cmd_buffer);34void anv_measure_reset(struct anv_cmd_buffer *cmd_buffer);3536void _anv_measure_snapshot(struct anv_cmd_buffer *cmd_buffer,37enum intel_measure_snapshot_type type,38const char *event_name,39uint32_t count);4041/* ends snapshots before command buffer submission */42void _anv_measure_endcommandbuffer(struct anv_cmd_buffer *cmd_buffer);4344/* when measuring render passes, inserts a timestamp */45void _anv_measure_beginrenderpass(struct anv_cmd_buffer *cmd_buffer);4647/* tracks frame progression */48void anv_measure_acquire(struct anv_device *device);4950/* should be combined with endcommandbuffer */51void _anv_measure_submit(struct anv_cmd_buffer *cmd_buffer);5253void54_anv_measure_add_secondary(struct anv_cmd_buffer *primary,55struct anv_cmd_buffer *secondary);5657#define anv_measure_snapshot(cmd_buffer, type, event_name, count) \58if (unlikely(cmd_buffer->measure)) \59_anv_measure_snapshot(cmd_buffer, type, event_name, count)6061#define anv_measure_endcommandbuffer(cmd_buffer) \62if (unlikely(cmd_buffer->measure)) \63_anv_measure_endcommandbuffer(cmd_buffer)6465#define anv_measure_beginrenderpass(cmd_buffer) \66if (unlikely(cmd_buffer->measure)) \67_anv_measure_beginrenderpass(cmd_buffer)6869#define anv_measure_submit(cmd_buffer) \70if (unlikely(cmd_buffer->measure)) \71_anv_measure_submit(cmd_buffer)7273#define anv_measure_add_secondary(primary, secondary) \74if (unlikely(primary->measure)) \75_anv_measure_add_secondary(primary, secondary)7677#endif /* ANV_MEASURE_H */787980