Path: blob/21.2-virgl/src/vulkan/overlay-layer/overlay_params.h
7233 views
/*1* Copyright © 2019 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* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* 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 NONINFRINGEMENT. IN NO EVENT SHALL17* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER18* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING19* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS20* IN THE SOFTWARE.21*/2223#ifndef OVERLAY_PARAMS_H24#define OVERLAY_PARAMS_H2526#ifdef __cplusplus27extern "C" {28#endif2930#include <stdio.h>31#include <stdint.h>32#include <stdbool.h>3334#define OVERLAY_PARAMS \35OVERLAY_PARAM_BOOL(device) \36OVERLAY_PARAM_BOOL(format) \37OVERLAY_PARAM_BOOL(fps) \38OVERLAY_PARAM_BOOL(frame) \39OVERLAY_PARAM_BOOL(frame_timing) \40OVERLAY_PARAM_BOOL(submit) \41OVERLAY_PARAM_BOOL(draw) \42OVERLAY_PARAM_BOOL(draw_indexed) \43OVERLAY_PARAM_BOOL(draw_indirect) \44OVERLAY_PARAM_BOOL(draw_indexed_indirect) \45OVERLAY_PARAM_BOOL(draw_indirect_count) \46OVERLAY_PARAM_BOOL(draw_indexed_indirect_count) \47OVERLAY_PARAM_BOOL(dispatch) \48OVERLAY_PARAM_BOOL(dispatch_indirect) \49OVERLAY_PARAM_BOOL(pipeline_graphics) \50OVERLAY_PARAM_BOOL(pipeline_compute) \51OVERLAY_PARAM_BOOL(pipeline_raytracing) \52OVERLAY_PARAM_BOOL(acquire) \53OVERLAY_PARAM_BOOL(acquire_timing) \54OVERLAY_PARAM_BOOL(present_timing) \55OVERLAY_PARAM_BOOL(vertices) \56OVERLAY_PARAM_BOOL(primitives) \57OVERLAY_PARAM_BOOL(vert_invocations) \58OVERLAY_PARAM_BOOL(geom_invocations) \59OVERLAY_PARAM_BOOL(geom_primitives) \60OVERLAY_PARAM_BOOL(clip_invocations) \61OVERLAY_PARAM_BOOL(clip_primitives) \62OVERLAY_PARAM_BOOL(frag_invocations) \63OVERLAY_PARAM_BOOL(tess_ctrl_patches) \64OVERLAY_PARAM_BOOL(tess_eval_invocations) \65OVERLAY_PARAM_BOOL(compute_invocations) \66OVERLAY_PARAM_BOOL(gpu_timing) \67OVERLAY_PARAM_CUSTOM(fps_sampling_period) \68OVERLAY_PARAM_CUSTOM(output_file) \69OVERLAY_PARAM_CUSTOM(position) \70OVERLAY_PARAM_CUSTOM(width) \71OVERLAY_PARAM_CUSTOM(height) \72OVERLAY_PARAM_CUSTOM(no_display) \73OVERLAY_PARAM_CUSTOM(control) \74OVERLAY_PARAM_CUSTOM(help)7576enum overlay_param_position {77LAYER_POSITION_TOP_LEFT,78LAYER_POSITION_TOP_RIGHT,79LAYER_POSITION_BOTTOM_LEFT,80LAYER_POSITION_BOTTOM_RIGHT,81};8283enum overlay_param_enabled {84#define OVERLAY_PARAM_BOOL(name) OVERLAY_PARAM_ENABLED_##name,85#define OVERLAY_PARAM_CUSTOM(name)86OVERLAY_PARAMS87#undef OVERLAY_PARAM_BOOL88#undef OVERLAY_PARAM_CUSTOM89OVERLAY_PARAM_ENABLED_MAX90};9192struct overlay_params {93bool enabled[OVERLAY_PARAM_ENABLED_MAX];94enum overlay_param_position position;95FILE *output_file;96int control;97uint32_t fps_sampling_period; /* us */98bool help;99bool no_display;100unsigned width;101unsigned height;102};103104const extern char *overlay_param_names[];105106void parse_overlay_env(struct overlay_params *params,107const char *env);108109#ifdef __cplusplus110}111#endif112113#endif /* OVERLAY_PARAMS_H */114115116