[Qt] Initialize Vulkan display after the backend
This commit is contained in:
parent
20360cce48
commit
b56296007c
|
@ -99,12 +99,6 @@ EmulatorWindow::EmulatorWindow() {
|
||||||
// TODO(DrChat): Pass in command line arguments.
|
// TODO(DrChat): Pass in command line arguments.
|
||||||
emulator_ = std::make_unique<xe::Emulator>(L"");
|
emulator_ = std::make_unique<xe::Emulator>(L"");
|
||||||
|
|
||||||
// Initialize the graphics backend.
|
|
||||||
// TODO(DrChat): Pick from gpu command line flag.
|
|
||||||
if (!InitializeVulkan()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto audio_factory = [&](cpu::Processor* processor,
|
auto audio_factory = [&](cpu::Processor* processor,
|
||||||
kernel::KernelState* kernel_state) {
|
kernel::KernelState* kernel_state) {
|
||||||
auto audio = apu::xaudio2::XAudio2AudioSystem::Create(processor);
|
auto audio = apu::xaudio2::XAudio2AudioSystem::Create(processor);
|
||||||
|
@ -116,6 +110,7 @@ EmulatorWindow::EmulatorWindow() {
|
||||||
return audio;
|
return audio;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
graphics_provider_ = ui::vulkan::VulkanProvider::Create(nullptr);
|
||||||
auto graphics_factory = [&](cpu::Processor* processor,
|
auto graphics_factory = [&](cpu::Processor* processor,
|
||||||
kernel::KernelState* kernel_state) {
|
kernel::KernelState* kernel_state) {
|
||||||
auto graphics = std::make_unique<gpu::vulkan::VulkanGraphicsSystem>();
|
auto graphics = std::make_unique<gpu::vulkan::VulkanGraphicsSystem>();
|
||||||
|
@ -136,11 +131,16 @@ EmulatorWindow::EmulatorWindow() {
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Initialize our backend display window.
|
||||||
|
if (!InitializeVulkan()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EmulatorWindow::InitializeVulkan() {
|
bool EmulatorWindow::InitializeVulkan() {
|
||||||
auto provider = xe::ui::vulkan::VulkanProvider::Create(nullptr);
|
auto provider =
|
||||||
auto device = provider->device();
|
reinterpret_cast<ui::vulkan::VulkanProvider*>(graphics_provider_.get());
|
||||||
|
|
||||||
// Create a Qt wrapper around our vulkan instance.
|
// Create a Qt wrapper around our vulkan instance.
|
||||||
vulkan_instance_ = std::make_unique<QVulkanInstance>();
|
vulkan_instance_ = std::make_unique<QVulkanInstance>();
|
||||||
|
@ -158,7 +158,6 @@ bool EmulatorWindow::InitializeVulkan() {
|
||||||
QWidget* wrapper = QWidget::createWindowContainer(graphics_window_.get());
|
QWidget* wrapper = QWidget::createWindowContainer(graphics_window_.get());
|
||||||
setCentralWidget(wrapper);
|
setCentralWidget(wrapper);
|
||||||
|
|
||||||
graphics_provider_ = std::move(provider);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue