mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-10 05:38:49 +00:00
qt-gui: Added GPU device selection functionality (#399)
* qt-gui: Added GPU device selection functionality * Getting list of GPU only when application starts * Fixed formatting * Fixed formatting * Fixed formatting * Added warning when GPU doesn't support API version. * Changed Unsupported Vulkan Version warning * Removed unused size checking on GetPhysicalDevices The method is only being called once so this doesn't make sense. It was some left over of me trying to get this done some other way. * Fix formatting * Fix formatting * SettingsDialog: Passing physical devices as span * Fixed formatting
This commit is contained in:
@@ -4,13 +4,20 @@
|
||||
#include "settings_dialog.h"
|
||||
#include "ui_settings_dialog.h"
|
||||
|
||||
SettingsDialog::SettingsDialog(QWidget* parent) : QDialog(parent), ui(new Ui::SettingsDialog) {
|
||||
SettingsDialog::SettingsDialog(std::span<const QString> physical_devices, QWidget* parent)
|
||||
: QDialog(parent), ui(new Ui::SettingsDialog) {
|
||||
ui->setupUi(this);
|
||||
ui->tabWidgetSettings->setUsesScrollButtons(false);
|
||||
const auto config_dir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);
|
||||
|
||||
ui->buttonBox->button(QDialogButtonBox::StandardButton::Close)->setFocus();
|
||||
|
||||
// Add list of available GPUs
|
||||
ui->graphicsAdapterBox->addItem("Auto Select"); // -1, auto selection
|
||||
for (const auto& device : physical_devices) {
|
||||
ui->graphicsAdapterBox->addItem(device);
|
||||
}
|
||||
|
||||
LoadValuesFromConfig();
|
||||
|
||||
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QWidget::close);
|
||||
@@ -40,7 +47,10 @@ SettingsDialog::SettingsDialog(QWidget* parent) : QDialog(parent), ui(new Ui::Se
|
||||
|
||||
// GPU TAB
|
||||
{
|
||||
// TODO: Implement graphics device changing
|
||||
// First options is auto selection -1, so gpuId on the GUI will always have to subtract 1
|
||||
// when setting and add 1 when getting to select the correct gpu in Qt
|
||||
connect(ui->graphicsAdapterBox, &QComboBox::currentIndexChanged, this,
|
||||
[](int index) { Config::setGpuId(index - 1); });
|
||||
|
||||
connect(ui->widthSpinBox, &QSpinBox::valueChanged, this,
|
||||
[](int val) { Config::setScreenWidth(val); });
|
||||
@@ -98,6 +108,7 @@ SettingsDialog::SettingsDialog(QWidget* parent) : QDialog(parent), ui(new Ui::Se
|
||||
void SettingsDialog::LoadValuesFromConfig() {
|
||||
ui->consoleLanguageComboBox->setCurrentIndex(Config::GetLanguage());
|
||||
|
||||
ui->graphicsAdapterBox->setCurrentIndex(Config::getGpuId() + 1);
|
||||
ui->widthSpinBox->setValue(Config::getScreenWidth());
|
||||
ui->heightSpinBox->setValue(Config::getScreenHeight());
|
||||
ui->vblankSpinBox->setValue(Config::vblankDiv());
|
||||
|
||||
Reference in New Issue
Block a user