diff --git a/src/Eden/Config/GlobalConfigureDialog.qml b/src/Eden/Config/GlobalConfigureDialog.qml index 74f3feb693..5491dd5a01 100644 --- a/src/Eden/Config/GlobalConfigureDialog.qml +++ b/src/Eden/Config/GlobalConfigureDialog.qml @@ -30,7 +30,6 @@ NativeDialog { function applyConfigs() { configs.forEach(config => { - // console.log(config) config.apply() }) @@ -39,7 +38,6 @@ NativeDialog { function syncConfigs() { configs.forEach(setting => { - console.log(setting) setting.sync() }) } diff --git a/src/Eden/Config/fields/BaseField.qml b/src/Eden/Config/fields/BaseField.qml index c5ee218e7d..efcf129840 100644 --- a/src/Eden/Config/fields/BaseField.qml +++ b/src/Eden/Config/fields/BaseField.qml @@ -27,17 +27,12 @@ Item { function apply() { if (setting.value !== value) { - console.log("Changing value", setting.value, "of setting", - setting.label, "to", value) setting.value = value } } function sync() { if (value !== setting.value) { - - // console.log("Syncing setting", setting.label, "from", value, "to", - // setting.value) value = setting.value } } diff --git a/src/Eden/Interface/QMLSetting.cpp b/src/Eden/Interface/QMLSetting.cpp index ea1ea880c0..9ecce8f2ef 100644 --- a/src/Eden/Interface/QMLSetting.cpp +++ b/src/Eden/Interface/QMLSetting.cpp @@ -145,12 +145,9 @@ QVariant QMLSetting::value() const } void QMLSetting::setValue(const QVariant& newValue) { - qDebug() << "changing value" << m_setting->ToString() << "to" << newValue << "for setting" - << m_setting->GetLabel(); QVariant var = newValue; var.convert(QMetaType(m_metaType)); - qDebug() << var.toString(); m_setting->LoadString(var.toString().toStdString()); emit valueChanged(); diff --git a/src/Eden/Interface/RenderWindow.cpp b/src/Eden/Interface/RenderWindow.cpp index 25490fae25..3869effef0 100644 --- a/src/Eden/Interface/RenderWindow.cpp +++ b/src/Eden/Interface/RenderWindow.cpp @@ -24,8 +24,8 @@ private: }; struct VulkanRenderItem : public QQuickItem { - explicit VulkanRenderItem(RenderWindow* parent) : QQuickItem(parent) { - window()->setSurfaceType(QWindow::VulkanSurface); + explicit VulkanRenderItem(QQuickItem* parent) : QQuickItem(parent) { + // window()->setSurfaceType(QWindow::VulkanSurface); } }; @@ -45,11 +45,11 @@ bool RenderWindow::initializeOpenGL() { // WA_DontShowOnScreen, WA_DeleteOnClose auto child = new OpenGLRenderItem(this); child_item = child; - child_item->window()->create(); - auto context = std::make_shared(child->window()); + child->window()->create(); + auto context = std::make_shared(m_window); main_context = context; child->SetContext( - std::make_unique(context->GetShareContext(), child->window())); + std::make_unique(context->GetShareContext(), m_window)); return true; #else @@ -61,9 +61,9 @@ bool RenderWindow::initializeOpenGL() { bool RenderWindow::initializeVulkan() { qDebug() << "initializing Vulkan."; - auto child = new VulkanRenderItem(this); + auto child = new VulkanRenderItem(m_parent); child_item = child; - // child_item->window()->create(); + // child->window()->create(); main_context = std::make_unique(); return true; @@ -76,8 +76,21 @@ void RenderWindow::initializeNull() { RenderWindow::RenderWindow(QQuickWindow* window, std::shared_ptr input_subsystem_) - : QQuickItem(window->contentItem()), input_subsystem{std::move(input_subsystem_)} { + : QQuickItem(), input_subsystem{std::move(input_subsystem_)}, m_window(window) { // STUBBED + + QQuickItem* renderHost = m_window->findChild("renderHost"); + + assert(renderHost); + + setParentItem(renderHost); + m_parent = renderHost; + + setWidth(renderHost->width()); + setHeight(renderHost->height()); + setX(0); + setY(0); + window->setTitle(QStringLiteral("Eden %1 | %2-%3") .arg(QString::fromUtf8(Common::g_build_name), QString::fromUtf8(Common::g_scm_branch), @@ -111,7 +124,7 @@ std::unique_ptr RenderWindow::CreateSharedConte auto c = static_cast(main_context.get()); // Bind the shared contexts to the main surface in case the backend wants to take over // presentation - return std::make_unique(c->GetShareContext(), child_item->window()); + return std::make_unique(c->GetShareContext(), m_window); } #endif return std::make_unique(); @@ -151,7 +164,7 @@ bool RenderWindow::initRenderTarget() { } // Update the Window System information with the new render target - window_info = QtCommon::GetWindowSystemInfo(window()); + window_info = QtCommon::GetWindowSystemInfo(m_window); OnMinimalClientAreaChangeRequest(GetActiveConfig().min_client_area_size); onFramebufferSizeChanged(); @@ -167,7 +180,7 @@ bool RenderWindow::initRenderTarget() { } void RenderWindow::OnMinimalClientAreaChangeRequest(std::pair minimal_size) { - window()->setMinimumSize(QSize(minimal_size.first, minimal_size.second)); + m_window->setMinimumSize(QSize(minimal_size.first, minimal_size.second)); } bool RenderWindow::loadOpenGL() { @@ -223,8 +236,9 @@ QStringList RenderWindow::getUnsupportedGLExtensions() const { void RenderWindow::onFramebufferSizeChanged() { // Screen changes potentially incur a change in screen DPI, hence we should update the // framebuffer size - const qreal pixel_ratio = window()->devicePixelRatio(); - const u32 width = this->width() * pixel_ratio; - const u32 height = this->height() * pixel_ratio; + qDebug() << width() << height(); + const qreal pixel_ratio = m_window->devicePixelRatio(); + const u32 width = (this->width()) * pixel_ratio; + const u32 height = (this->height()) * pixel_ratio; UpdateCurrentFramebufferLayout(width, height); } diff --git a/src/Eden/Interface/RenderWindow.h b/src/Eden/Interface/RenderWindow.h index fb4a0345f0..8c64ed50bb 100644 --- a/src/Eden/Interface/RenderWindow.h +++ b/src/Eden/Interface/RenderWindow.h @@ -45,6 +45,8 @@ private: InputCommon::TasInput::TasState last_tas_state; QQuickItem* child_item = nullptr; + QQuickWindow* m_window; + QQuickItem* m_parent; void initializeNull(); bool initializeVulkan(); diff --git a/src/Eden/Main/Main.qml b/src/Eden/Main/Main.qml index adab03fdea..9741dfb731 100644 --- a/src/Eden/Main/Main.qml +++ b/src/Eden/Main/Main.qml @@ -304,6 +304,21 @@ ApplicationWindow { } } + Item { + id: renderHost + objectName: "renderHost" + + anchors { + top: parent.top + left: parent.left + right: parent.right + bottom: status.top + } + + layer.enabled: true + z: -1 + } + StatusBar { id: status diff --git a/src/qt_common/config/qt_config.cpp b/src/qt_common/config/qt_config.cpp index 8ff85c4c24..1229554091 100644 --- a/src/qt_common/config/qt_config.cpp +++ b/src/qt_common/config/qt_config.cpp @@ -562,23 +562,11 @@ void QtConfig::SaveMultiplayerValues() { } std::vector& QtConfig::FindRelevantList(Settings::Category category) { - qDebug() << "-- Category" << u32(category); - auto log_list = [](auto list, QString label) { - qDebug() << "-- !" << label; - for (auto s : list) { - qDebug() << "-- *" << s->GetLabel(); - } - }; auto& list = Settings::values.linkage.by_category[category]; - log_list(list, QStringLiteral("Settings")); - if (!list.empty()) return list; - auto& list2 = UISettings::values.linkage.by_category[category]; - log_list(list2, QStringLiteral("UISettings")); - - return list2; + return UISettings::values.linkage.by_category[category]; } void QtConfig::ReadQtControlPlayerValues(std::size_t player_index) { diff --git a/src/qt_common/render/emu_thread.cpp b/src/qt_common/render/emu_thread.cpp index b6fdc891fa..f2a4d7e291 100644 --- a/src/qt_common/render/emu_thread.cpp +++ b/src/qt_common/render/emu_thread.cpp @@ -1,3 +1,4 @@ +#include #include "core/core.h" #include "core/cpu_manager.h" #include "emu_thread.h" @@ -20,6 +21,7 @@ void EmuThread::run() { // Main process has been loaded. Make the context current to this thread and begin GPU and CPU // execution. + qDebug() << "Obtaining Context"; gpu.ObtainContext(); emit LoadProgress(VideoCore::LoadCallbackStage::Prepare, 0, 0); @@ -32,15 +34,26 @@ void EmuThread::run() { } emit LoadProgress(VideoCore::LoadCallbackStage::Complete, 0, 0); + qDebug() << "Releaseing Context"; + gpu.ReleaseContext(); + + qDebug() << "Starting"; + gpu.Start(); + qDebug() << "GPU Ready"; + QtCommon::system->GetCpuManager().OnGpuReady(); + qDebug() << "Debugger stuff."; + if (QtCommon::system->DebuggerEnabled()) { QtCommon::system->InitializeDebugger(); } + qDebug() << "Beginning EmuThread"; + while (!stop_token.stop_requested()) { std::unique_lock lk{m_should_run_mutex}; if (m_should_run) { @@ -58,6 +71,8 @@ void EmuThread::run() { } } + qDebug() << "Obtaining Context"; + // Shutdown the main emulated process QtCommon::system->DetachDebugger(); QtCommon::system->ShutdownMainProcess();