vulkan/overlay: make overlay size configurable
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
This commit is contained in:
@@ -484,10 +484,11 @@ static void destroy_command_buffer_data(struct command_buffer_data *data)
|
||||
static struct swapchain_data *new_swapchain_data(VkSwapchainKHR swapchain,
|
||||
struct device_data *device_data)
|
||||
{
|
||||
struct instance_data *instance_data = device_data->instance;
|
||||
struct swapchain_data *data = rzalloc(NULL, struct swapchain_data);
|
||||
data->device = device_data;
|
||||
data->swapchain = swapchain;
|
||||
data->window_size = ImVec2(300, 300);
|
||||
data->window_size = ImVec2(instance_data->params.width, instance_data->params.height);
|
||||
map_object((void *) data->swapchain, data);
|
||||
return data;
|
||||
}
|
||||
|
@@ -59,6 +59,15 @@ parse_no_display(const char *str)
|
||||
return strtol(str, NULL, 0) != 0;
|
||||
}
|
||||
|
||||
static unsigned
|
||||
parse_unsigned(const char *str)
|
||||
{
|
||||
return strtol(str, NULL, 0);
|
||||
}
|
||||
|
||||
#define parse_width(s) parse_unsigned(s)
|
||||
#define parse_height(s) parse_unsigned(s)
|
||||
|
||||
static bool
|
||||
parse_help(const char *str)
|
||||
{
|
||||
@@ -73,6 +82,8 @@ parse_help(const char *str)
|
||||
fprintf(stderr, "\tfps_sampling_period=number-of-milliseconds\n");
|
||||
fprintf(stderr, "\tno_display=0|1\n");
|
||||
fprintf(stderr, "\toutput_file=/path/to/output.txt\n");
|
||||
fprintf(stderr, "\twidth=width-in-pixels\n");
|
||||
fprintf(stderr, "\theight=height-in-pixels\n");
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -136,6 +147,7 @@ parse_overlay_env(struct overlay_params *params,
|
||||
params->enabled[OVERLAY_PARAM_ENABLED_fps] = true;
|
||||
params->enabled[OVERLAY_PARAM_ENABLED_frame_timing] = true;
|
||||
params->fps_sampling_period = 500000; /* 500ms */
|
||||
params->width = params->height = 300;
|
||||
|
||||
if (!env)
|
||||
return;
|
||||
|
@@ -65,6 +65,8 @@ extern "C" {
|
||||
OVERLAY_PARAM_CUSTOM(fps_sampling_period) \
|
||||
OVERLAY_PARAM_CUSTOM(output_file) \
|
||||
OVERLAY_PARAM_CUSTOM(position) \
|
||||
OVERLAY_PARAM_CUSTOM(width) \
|
||||
OVERLAY_PARAM_CUSTOM(height) \
|
||||
OVERLAY_PARAM_CUSTOM(no_display) \
|
||||
OVERLAY_PARAM_CUSTOM(help)
|
||||
|
||||
@@ -91,6 +93,8 @@ struct overlay_params {
|
||||
uint32_t fps_sampling_period; /* us */
|
||||
bool help;
|
||||
bool no_display;
|
||||
unsigned width;
|
||||
unsigned height;
|
||||
};
|
||||
|
||||
const extern char *overlay_param_names[];
|
||||
|
Reference in New Issue
Block a user