[UI] Loop thread to main thread WindowedAppContext

This commit is contained in:
Triang3l
2021-08-28 19:38:24 +03:00
parent f540c188bf
commit 6ce5330f5f
95 changed files with 2343 additions and 1235 deletions

View File

@@ -49,7 +49,7 @@ std::string D3D12GraphicsSystem::name() const {
X_STATUS D3D12GraphicsSystem::Setup(cpu::Processor* processor,
kernel::KernelState* kernel_state,
ui::Window* target_window) {
provider_ = xe::ui::d3d12::D3D12Provider::Create(target_window);
provider_ = xe::ui::d3d12::D3D12Provider::Create();
auto d3d12_provider = static_cast<xe::ui::d3d12::D3D12Provider*>(provider());
auto device = d3d12_provider->GetDevice();

View File

@@ -7,8 +7,8 @@
******************************************************************************
*/
#include "xenia/base/console_app_main.h"
#include "xenia/base/logging.h"
#include "xenia/base/main.h"
#include "xenia/gpu/d3d12/d3d12_command_processor.h"
#include "xenia/gpu/d3d12/d3d12_graphics_system.h"
#include "xenia/gpu/trace_dump.h"
@@ -54,6 +54,6 @@ int trace_dump_main(const std::vector<std::string>& args) {
} // namespace gpu
} // namespace xe
DEFINE_ENTRY_POINT("xenia-gpu-d3d12-trace-dump",
xe::gpu::d3d12::trace_dump_main, "some.trace",
"target_trace_file");
XE_DEFINE_CONSOLE_APP("xenia-gpu-d3d12-trace-dump",
xe::gpu::d3d12::trace_dump_main, "some.trace",
"target_trace_file");

View File

@@ -2,13 +2,15 @@
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2020 Ben Vanik. All rights reserved. *
* Copyright 2021 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#include <memory>
#include <string>
#include "xenia/base/logging.h"
#include "xenia/base/main.h"
#include "xenia/gpu/d3d12/d3d12_command_processor.h"
#include "xenia/gpu/d3d12/d3d12_graphics_system.h"
#include "xenia/gpu/trace_viewer.h"
@@ -17,10 +19,13 @@ namespace xe {
namespace gpu {
namespace d3d12 {
using namespace xe::gpu::xenos;
class D3D12TraceViewer : public TraceViewer {
class D3D12TraceViewer final : public TraceViewer {
public:
static std::unique_ptr<WindowedApp> Create(
xe::ui::WindowedAppContext& app_context) {
return std::unique_ptr<WindowedApp>(new D3D12TraceViewer(app_context));
}
std::unique_ptr<gpu::GraphicsSystem> CreateGraphicsSystem() override {
return std::unique_ptr<gpu::GraphicsSystem>(new D3D12GraphicsSystem());
}
@@ -45,17 +50,15 @@ class D3D12TraceViewer : public TraceViewer {
// TextureInfo/SamplerInfo which are going away.
return 0;
}
};
int trace_viewer_main(const std::vector<std::string>& args) {
D3D12TraceViewer trace_viewer;
return trace_viewer.Main(args);
}
private:
explicit D3D12TraceViewer(xe::ui::WindowedAppContext& app_context)
: TraceViewer(app_context, "xenia-gpu-d3d12-trace-viewer") {}
};
} // namespace d3d12
} // namespace gpu
} // namespace xe
DEFINE_ENTRY_POINT("xenia-gpu-d3d12-trace-viewer",
xe::gpu::d3d12::trace_viewer_main, "some.trace",
"target_trace_file");
XE_DEFINE_WINDOWED_APP(xenia_gpu_d3d12_trace_viewer,
xe::gpu::d3d12::D3D12TraceViewer::Create);

View File

@@ -54,7 +54,7 @@ project("xenia-gpu-d3d12-trace-viewer")
})
files({
"d3d12_trace_viewer_main.cc",
"../../base/main_"..platform_suffix..".cc",
"../../ui/windowed_app_main_"..platform_suffix..".cc",
})
-- Only create the .user file if it doesn't already exist.
local user_file = project_root.."/build/xenia-gpu-d3d12-trace-viewer.vcxproj.user"
@@ -101,7 +101,7 @@ project("xenia-gpu-d3d12-trace-dump")
})
files({
"d3d12_trace_dump_main.cc",
"../../base/main_"..platform_suffix..".cc",
"../../base/console_app_main_"..platform_suffix..".cc",
})
-- Only create the .user file if it doesn't already exist.
local user_file = project_root.."/build/xenia-gpu-d3d12-trace-dump.vcxproj.user"