From 26aa465a3d64e9efbf6baca036064c1e682b9eef Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Thu, 20 May 2021 01:36:46 +0200 Subject: [PATCH] early-access version 1697 --- README.md | 2 +- .../renderer_opengl/gl_texture_cache.cpp | 7 +++ .../configuration/configuration_shared.cpp | 43 ------------------- src/yuzu/configuration/configuration_shared.h | 16 +++---- 4 files changed, 15 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index 3bacd190f..c501013c2 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 1696. +This is the source code for early-access 1697. ## Legal Notice diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index ffe9edc1b..f38871500 100755 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp @@ -823,6 +823,13 @@ void Image::CopyBufferToImage(const VideoCommon::BufferImageCopy& copy, size_t b const bool is_compressed = gl_format == GL_NONE; const void* const offset = reinterpret_cast(copy.buffer_offset + buffer_offset); + if (is_compressed && !IsPixelFormatASTC(info.format) && + (copy.image_extent.width < 4 || copy.image_extent.height < 4)) { + // Per the documentation for the BPTC, S3TC, and RGTC formats, INVALID_OPERATION will be + // generated if either of the dimensions are not a multiple of four. This mainly occurs on + // small levels of mip-mapped textures, which this condition will catch. + return; + } switch (info.type) { case ImageType::e1D: if (is_compressed) { diff --git a/src/yuzu/configuration/configuration_shared.cpp b/src/yuzu/configuration/configuration_shared.cpp index 83ec83745..096e42e94 100755 --- a/src/yuzu/configuration/configuration_shared.cpp +++ b/src/yuzu/configuration/configuration_shared.cpp @@ -39,21 +39,6 @@ void ConfigurationShared::ApplyPerGameSetting(Settings::Setting* setting, } } -void ConfigurationShared::ApplyPerGameSetting(Settings::Setting* setting, - const QComboBox* combobox) { - if (Settings::IsConfiguringGlobal() && setting->UsingGlobal()) { - setting->SetValue(static_cast(combobox->currentIndex())); - } else if (!Settings::IsConfiguringGlobal()) { - if (combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { - setting->SetGlobal(true); - } else { - setting->SetGlobal(false); - setting->SetValue(static_cast( - combobox->currentIndex() - ConfigurationShared::USE_GLOBAL_OFFSET)); - } - } -} - void ConfigurationShared::SetPerGameSetting(QCheckBox* checkbox, const Settings::Setting* setting) { if (setting->UsingGlobal()) { @@ -63,34 +48,6 @@ void ConfigurationShared::SetPerGameSetting(QCheckBox* checkbox, } } -void ConfigurationShared::SetPerGameSetting(QComboBox* combobox, - const Settings::Setting* setting) { - combobox->setCurrentIndex(setting->UsingGlobal() - ? ConfigurationShared::USE_GLOBAL_INDEX - : setting->GetValue() + ConfigurationShared::USE_GLOBAL_OFFSET); -} - -void ConfigurationShared::SetPerGameSetting( - QComboBox* combobox, const Settings::Setting* setting) { - combobox->setCurrentIndex(setting->UsingGlobal() ? ConfigurationShared::USE_GLOBAL_INDEX - : static_cast(setting->GetValue()) + - ConfigurationShared::USE_GLOBAL_OFFSET); -} - -void ConfigurationShared::SetPerGameSetting( - QComboBox* combobox, const Settings::Setting* setting) { - combobox->setCurrentIndex(setting->UsingGlobal() ? ConfigurationShared::USE_GLOBAL_INDEX - : static_cast(setting->GetValue()) + - ConfigurationShared::USE_GLOBAL_OFFSET); -} - -void ConfigurationShared::SetPerGameSetting( - QComboBox* combobox, const Settings::Setting* setting) { - combobox->setCurrentIndex(setting->UsingGlobal() ? ConfigurationShared::USE_GLOBAL_INDEX - : static_cast(setting->GetValue()) + - ConfigurationShared::USE_GLOBAL_OFFSET); -} - void ConfigurationShared::SetHighlight(QWidget* widget, bool highlighted) { if (highlighted) { widget->setStyleSheet(QStringLiteral("QWidget#%1 { background-color:rgba(0,203,255,0.5) }") diff --git a/src/yuzu/configuration/configuration_shared.h b/src/yuzu/configuration/configuration_shared.h index 13f313a93..1e0ef01ca 100755 --- a/src/yuzu/configuration/configuration_shared.h +++ b/src/yuzu/configuration/configuration_shared.h @@ -29,18 +29,16 @@ enum class CheckState { void ApplyPerGameSetting(Settings::Setting* setting, const QCheckBox* checkbox, const CheckState& tracker); void ApplyPerGameSetting(Settings::Setting* setting, const QComboBox* combobox); -void ApplyPerGameSetting(Settings::Setting* setting, - const QComboBox* combobox); // Sets a Qt UI element given a Settings::Setting void SetPerGameSetting(QCheckBox* checkbox, const Settings::Setting* setting); -void SetPerGameSetting(QComboBox* combobox, const Settings::Setting* setting); -void SetPerGameSetting(QComboBox* combobox, - const Settings::Setting* setting); -void SetPerGameSetting(QComboBox* combobox, - const Settings::Setting* setting); -void SetPerGameSetting(QComboBox* combobox, - const Settings::Setting* setting); + +template +void SetPerGameSetting(QComboBox* combobox, const Settings::Setting* setting) { + combobox->setCurrentIndex(setting->UsingGlobal() ? ConfigurationShared::USE_GLOBAL_INDEX + : static_cast(setting->GetValue()) + + ConfigurationShared::USE_GLOBAL_OFFSET); +} // (Un)highlights a Qt UI element void SetHighlight(QWidget* widget, bool highlighted);