vulkan/overlay: add new options to display device/swapchain-format

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3973
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8080>
This commit is contained in:
Lionel Landwerlin 2020-12-14 10:53:42 +02:00 committed by Marge Bot
parent af9481cb89
commit 94687ee59f
3 changed files with 12 additions and 5 deletions

View file

@ -928,11 +928,14 @@ static void compute_swapchain_display(struct swapchain_data *data)
ImGui::NewFrame();
position_layer(data);
ImGui::Begin("Mesa overlay");
ImGui::Text("Device: %s", device_data->properties.deviceName);
if (instance_data->params.enabled[OVERLAY_PARAM_ENABLED_device])
ImGui::Text("Device: %s", device_data->properties.deviceName);
const char *format_name = vk_Format_to_str(data->format);
format_name = format_name ? (format_name + strlen("VK_FORMAT_")) : "unknown";
ImGui::Text("Swapchain format: %s", format_name);
if (instance_data->params.enabled[OVERLAY_PARAM_ENABLED_format]) {
const char *format_name = vk_Format_to_str(data->format);
format_name = format_name ? (format_name + strlen("VK_FORMAT_")) : "unknown";
ImGui::Text("Swapchain format: %s", format_name);
}
if (instance_data->params.enabled[OVERLAY_PARAM_ENABLED_frame])
ImGui::Text("Frames: %" PRIu64, data->n_frames);
if (instance_data->params.enabled[OVERLAY_PARAM_ENABLED_fps])
@ -1327,7 +1330,7 @@ static struct overlay_draw *render_swapchain_display(struct swapchain_data *data
if (device_data->graphic_queue->family_index != present_queue->family_index)
{
/* Transfer the image back to the present queue family
* image layout was already changed to present by the render pass
* image layout was already changed to present by the render pass
*/
imb.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
imb.pNext = nullptr;

View file

@ -165,6 +165,8 @@ parse_overlay_env(struct overlay_params *params,
/* Visible by default */
params->enabled[OVERLAY_PARAM_ENABLED_fps] = true;
params->enabled[OVERLAY_PARAM_ENABLED_frame_timing] = true;
params->enabled[OVERLAY_PARAM_ENABLED_device] = true;
params->enabled[OVERLAY_PARAM_ENABLED_format] = true;
params->fps_sampling_period = 500000; /* 500ms */
params->width = params->height = 300;
params->control = -1;

View file

@ -33,6 +33,8 @@ extern "C" {
#include <stdbool.h>
#define OVERLAY_PARAMS \
OVERLAY_PARAM_BOOL(device) \
OVERLAY_PARAM_BOOL(format) \
OVERLAY_PARAM_BOOL(fps) \
OVERLAY_PARAM_BOOL(frame) \
OVERLAY_PARAM_BOOL(frame_timing) \