[GPU] Translucent trace viewer controls

This commit is contained in:
Triang3l 2022-07-17 17:29:41 +03:00
parent 273a489e2a
commit e8652e544a
2 changed files with 9 additions and 0 deletions

View File

@ -223,6 +223,7 @@ void TraceViewer::DrawUI() {
void TraceViewer::DrawControllerUI() {
ImGui::SetNextWindowPos(ImVec2(5, 5), ImGuiCond_FirstUseEver);
ImGui::SetNextWindowSize(ImVec2(340, 60));
ImGui::SetNextWindowBgAlpha(kWindowBgAlpha);
if (!ImGui::Begin("Controller", nullptr)) {
ImGui::End();
return;
@ -274,6 +275,7 @@ void TraceViewer::DrawPacketDisassemblerUI() {
ImVec2(float(window_->GetActualLogicalWidth()) - 500 - 5, 5),
ImGuiCond_FirstUseEver);
ImGui::SetNextWindowSize(ImVec2(500, 300));
ImGui::SetNextWindowBgAlpha(kWindowBgAlpha);
if (!ImGui::Begin("Packet Disassembler", nullptr)) {
ImGui::End();
return;
@ -493,6 +495,7 @@ int TraceViewer::RecursiveDrawCommandBufferUI(
void TraceViewer::DrawCommandListUI() {
ImGui::SetNextWindowPos(ImVec2(5, 70), ImGuiCond_FirstUseEver);
ImGui::SetNextWindowSize(ImVec2(200, 640));
ImGui::SetNextWindowBgAlpha(kWindowBgAlpha);
if (!ImGui::Begin("Command List", nullptr)) {
ImGui::End();
return;
@ -1106,6 +1109,7 @@ void TraceViewer::DrawStateUI() {
ImVec2(float(window_->GetActualLogicalWidth()) - 500 - 5, 30),
ImGuiCond_FirstUseEver);
ImGui::SetNextWindowSize(ImVec2(500, 680));
ImGui::SetNextWindowBgAlpha(kWindowBgAlpha);
if (!ImGui::Begin("State", nullptr)) {
ImGui::End();
return;

View File

@ -95,6 +95,11 @@ class TraceViewer : public xe::ui::WindowedApp {
kHostDisasm,
};
// Same as for Dear ImGui tooltips. Windows are translucent as the controls
// may take a pretty large fraction of the screen, especially on small
// screens, so the image from the guest can be seen through them.
static constexpr float kWindowBgAlpha = 0.6f;
bool Load(const std::string_view trace_file_path);
void DrawUI();