devtools: show resolution & fsr state

This commit is contained in:
Vinicius Rangel 2025-03-10 22:50:38 -03:00
parent c478e55305
commit 5569481389
No known key found for this signature in database
GPG Key ID: A5B154D904B761D9
4 changed files with 23 additions and 4 deletions

View File

@ -158,6 +158,10 @@ public:
float Framerate = 1.0f / 60.0f;
float FrameDeltaTime;
std::pair<u32, u32> game_resolution{};
std::pair<u32, u32> output_resolution{};
bool is_using_fsr{};
void ShowDebugMessage(std::string message) {
if (message.empty()) {
return;

View File

@ -74,7 +74,7 @@ void FrameGraph::Draw() {
if (!is_open) {
return;
}
SetNextWindowSize({340.0, 185.0f}, ImGuiCond_FirstUseEver);
SetNextWindowSize({308.0, 270.0f}, ImGuiCond_FirstUseEver);
if (Begin("Video debug info", &is_open)) {
const auto& ctx = *GImGui;
const auto& io = ctx.IO;
@ -88,13 +88,20 @@ void FrameGraph::Draw() {
frameRate = 1000.0f / deltaTime;
}
SeparatorText("Frame graph");
DrawFrameGraph();
SeparatorText("Renderer info");
Text("Frame time: %.3f ms (%.1f FPS)", deltaTime, frameRate);
Text("Presenter time: %.3f ms (%.1f FPS)", io.DeltaTime * 1000.0f, 1.0f / io.DeltaTime);
Text("Flip frame: %d Gnm submit frame: %d", DebugState.flip_frame_count.load(),
DebugState.gnm_frame_count.load());
SeparatorText("Frame graph");
DrawFrameGraph();
Text("Game Res: %dx%d", DebugState.game_resolution.first,
DebugState.game_resolution.second);
Text("Output Res: %dx%d", DebugState.output_resolution.first,
DebugState.output_resolution.second);
Text("FSR: %s", DebugState.is_using_fsr ? "on" : "off");
}
End();
}

View File

@ -9,6 +9,7 @@
#include "video_core/renderer_vulkan/vk_shader_util.h"
#define A_CPU
#include "core/debug_state.h"
#include "video_core/host_shaders/fsr/ffx_a.h"
#include "video_core/host_shaders/fsr/ffx_fsr1.h"
@ -139,12 +140,16 @@ vk::ImageView FsrPass::Render(vk::CommandBuffer cmdbuf, vk::ImageView input,
vk::Extent2D input_size, vk::Extent2D output_size, Settings settings,
bool hdr) {
if (!settings.enable) {
DebugState.is_using_fsr = false;
return input;
}
if (input_size.width >= output_size.width && input_size.height >= output_size.height) {
DebugState.is_using_fsr = false;
return input;
}
DebugState.is_using_fsr = true;
if (output_size != cur_size) {
ResizeAndInvalidate(output_size.width, output_size.height);
}

View File

@ -458,6 +458,9 @@ Frame* Presenter::PrepareFrameInternal(VideoCore::ImageId image_id, bool is_eop)
if (vk_host_markers_enabled) {
cmdbuf.endDebugUtilsLabelEXT();
}
DebugState.game_resolution = {image_size.width, image_size.height};
DebugState.output_resolution = {frame->width, frame->height};
} else {
// Fix display of garbage images on startup on some drivers
const std::array<vk::RenderingAttachmentInfo, 1> attachments = {{