[UI] Image post-processing and full presentation/window rework

[GPU] Add FXAA post-processing
[UI] Add FidelityFX FSR and CAS post-processing
[UI] Add blue noise dithering from 10bpc to 8bpc
[GPU] Apply the DC PWL gamma ramp closer to the spec, supporting fully white color
[UI] Allow the GPU CP thread to present on the host directly, bypassing the UI thread OS paint event
[UI] Allow variable refresh rate (or tearing)
[UI] Present the newest frame (restart) on DXGI
[UI] Replace GraphicsContext with a far more advanced Presenter with more coherent surface connection and UI overlay state management
[UI] Connect presentation to windows via the Surface class, not native window handles
[Vulkan] Switch to simpler Vulkan setup with no instance/device separation due to interdependencies and to pass fewer objects around
[Vulkan] Lower the minimum required Vulkan version to 1.0
[UI/GPU] Various cleanup, mainly ComPtr usage
[UI] Support per-monitor DPI awareness v2 on Windows
[UI] DPI-scale Dear ImGui
[UI] Replace the remaining non-detachable window delegates with unified window event and input listeners
[UI] Allow listeners to safely destroy or close the window, and to register/unregister listeners without use-after-free and the ABA problem
[UI] Explicit Z ordering of input listeners and UI overlays, top-down for input, bottom-up for drawing
[UI] Add explicit window lifecycle phases
[UI] Replace Window virtual functions with explicit desired state, its application, actual state, its feedback
[UI] GTK: Apply the initial size to the drawing area
[UI] Limit internal UI frame rate to that of the monitor
[UI] Hide the cursor using a timer instead of polling due to no repeated UI thread paints with GPU CP thread presentation, and only within the window
This commit is contained in:
Triang3l
2022-01-29 13:22:03 +03:00
parent 372bdd3ec9
commit fe3f0f26e4
428 changed files with 75942 additions and 18360 deletions

View File

@@ -458,7 +458,7 @@ inline void AppendParam(StringBuffer* string_buffer,
inline void AppendParam(StringBuffer* string_buffer,
pointer_t<X_EXCEPTION_RECORD> record) {
string_buffer->AppendFormat("{:08X}({:08X})", record.guest_address(),
uint32_t(record->exception_code));
uint32_t(record->code));
}
template <typename T>
void AppendParam(StringBuffer* string_buffer, pointer_t<T> param) {

View File

@@ -14,6 +14,7 @@
#include "xenia/kernel/util/shim_utils.h"
#include "xenia/kernel/xam/xam_private.h"
#include "xenia/ui/imgui_dialog.h"
#include "xenia/ui/imgui_drawer.h"
#include "xenia/ui/window.h"
#include "xenia/ui/windowed_app_context.h"
#include "xenia/xbox.h"
@@ -49,17 +50,21 @@ dword_result_t XamShowNuiTroubleshooterUI_entry(unknown_t unk1, unknown_t unk2,
return 0;
}
auto display_window = kernel_state()->emulator()->display_window();
xe::threading::Fence fence;
if (display_window->app_context().CallInUIThreadSynchronous([&]() {
xe::ui::ImGuiDialog::ShowMessageBox(
display_window, "NUI Troubleshooter",
"The game has indicated there is a problem with NUI (Kinect).")
->Then(&fence);
})) {
++xam_dialogs_shown_;
fence.Wait();
--xam_dialogs_shown_;
const Emulator* emulator = kernel_state()->emulator();
ui::Window* display_window = emulator->display_window();
ui::ImGuiDrawer* imgui_drawer = emulator->imgui_drawer();
if (display_window && imgui_drawer) {
xe::threading::Fence fence;
if (display_window->app_context().CallInUIThreadSynchronous([&]() {
xe::ui::ImGuiDialog::ShowMessageBox(
imgui_drawer, "NUI Troubleshooter",
"The game has indicated there is a problem with NUI (Kinect).")
->Then(&fence);
})) {
++xam_dialogs_shown_;
fence.Wait();
--xam_dialogs_shown_;
}
}
return 0;

View File

@@ -16,6 +16,7 @@
#include "xenia/kernel/util/shim_utils.h"
#include "xenia/kernel/xam/xam_private.h"
#include "xenia/ui/imgui_dialog.h"
#include "xenia/ui/imgui_drawer.h"
#include "xenia/ui/window.h"
#include "xenia/ui/windowed_app_context.h"
#include "xenia/xbox.h"
@@ -51,7 +52,8 @@ class XamDialog : public xe::ui::ImGuiDialog {
}
protected:
XamDialog(xe::ui::Window* window) : xe::ui::ImGuiDialog(window) {}
XamDialog(xe::ui::ImGuiDrawer* imgui_drawer)
: xe::ui::ImGuiDialog(imgui_drawer) {}
void OnClose() override {
if (close_callback_) {
@@ -206,10 +208,10 @@ DECLARE_XAM_EXPORT2(XamIsUIActive, kUI, kImplemented, kHighFrequency);
class MessageBoxDialog : public XamDialog {
public:
MessageBoxDialog(xe::ui::Window* window, std::string title,
MessageBoxDialog(xe::ui::ImGuiDrawer* imgui_drawer, std::string title,
std::string description, std::vector<std::string> buttons,
uint32_t default_button)
: XamDialog(window),
: XamDialog(imgui_drawer),
title_(title),
description_(description),
buttons_(std::move(buttons)),
@@ -310,11 +312,11 @@ dword_result_t XamShowMessageBoxUI_entry(
*result_ptr = dialog->chosen_button();
return X_ERROR_SUCCESS;
};
auto display_window = kernel_state()->emulator()->display_window();
const Emulator* emulator = kernel_state()->emulator();
ui::ImGuiDrawer* imgui_drawer = emulator->imgui_drawer();
result = xeXamDispatchDialog<MessageBoxDialog>(
new MessageBoxDialog(display_window, title,
xe::to_utf8(text_ptr.value()), buttons,
active_button),
new MessageBoxDialog(imgui_drawer, title, xe::to_utf8(text_ptr.value()),
buttons, active_button),
close, overlapped);
}
return result;
@@ -323,10 +325,10 @@ DECLARE_XAM_EXPORT1(XamShowMessageBoxUI, kUI, kImplemented);
class KeyboardInputDialog : public XamDialog {
public:
KeyboardInputDialog(xe::ui::Window* window, std::string title,
KeyboardInputDialog(xe::ui::ImGuiDrawer* imgui_drawer, std::string title,
std::string description, std::string default_text,
size_t max_length)
: XamDialog(window),
: XamDialog(imgui_drawer),
title_(title),
description_(description),
default_text_(default_text),
@@ -446,10 +448,11 @@ dword_result_t XamShowKeyboardUI_entry(
return X_ERROR_SUCCESS;
}
};
auto display_window = kernel_state()->emulator()->display_window();
const Emulator* emulator = kernel_state()->emulator();
ui::ImGuiDrawer* imgui_drawer = emulator->imgui_drawer();
result = xeXamDispatchDialogEx<KeyboardInputDialog>(
new KeyboardInputDialog(
display_window, title ? xe::to_utf8(title.value()) : "",
imgui_drawer, title ? xe::to_utf8(title.value()) : "",
description ? xe::to_utf8(description.value()) : "",
default_text ? xe::to_utf8(default_text.value()) : "",
buffer_length),
@@ -479,10 +482,11 @@ void XamShowDirtyDiscErrorUI_entry(dword_t user_index) {
exit(1);
return;
}
auto display_window = kernel_state()->emulator()->display_window();
const Emulator* emulator = kernel_state()->emulator();
ui::ImGuiDrawer* imgui_drawer = emulator->imgui_drawer();
xeXamDispatchDialog<MessageBoxDialog>(
new MessageBoxDialog(
display_window, "Disc Read Error",
imgui_drawer, "Disc Read Error",
"There's been an issue reading content from the game disc.\nThis is "
"likely caused by bad or unimplemented file IO calls.",
{"OK"}, 0),

View File

@@ -124,7 +124,7 @@ void HandleCppException(pointer_t<X_EXCEPTION_RECORD> record) {
}
void RtlRaiseException_entry(pointer_t<X_EXCEPTION_RECORD> record) {
switch (record->exception_code) {
switch (record->code) {
case 0x406D1388: {
HandleSetThreadName(record);
return;