diff options
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp | 3 | ||||
| -rw-r--r-- | src/shader_recompiler/backend/spirv/spirv_emit_context.cpp | 3 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 33 | ||||
| -rw-r--r-- | src/yuzu/main.h | 1 |
4 files changed, 38 insertions, 2 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp index 0cd87a48f..fee510f7b 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp | |||
| @@ -473,7 +473,8 @@ void EmitSetFragColor(EmitContext& ctx, u32 index, u32 component, Id value) { | |||
| 473 | } | 473 | } |
| 474 | 474 | ||
| 475 | void EmitSetSampleMask(EmitContext& ctx, Id value) { | 475 | void EmitSetSampleMask(EmitContext& ctx, Id value) { |
| 476 | ctx.OpStore(ctx.sample_mask, value); | 476 | const Id pointer{ctx.OpAccessChain(ctx.output_u32, ctx.sample_mask, ctx.u32_zero_value)}; |
| 477 | ctx.OpStore(pointer, value); | ||
| 477 | } | 478 | } |
| 478 | 479 | ||
| 479 | void EmitSetFragDepth(EmitContext& ctx, Id value) { | 480 | void EmitSetFragDepth(EmitContext& ctx, Id value) { |
diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp index d48d4860e..47739794f 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp | |||
| @@ -1572,7 +1572,8 @@ void EmitContext::DefineOutputs(const IR::Program& program) { | |||
| 1572 | Decorate(frag_depth, spv::Decoration::BuiltIn, spv::BuiltIn::FragDepth); | 1572 | Decorate(frag_depth, spv::Decoration::BuiltIn, spv::BuiltIn::FragDepth); |
| 1573 | } | 1573 | } |
| 1574 | if (info.stores_sample_mask) { | 1574 | if (info.stores_sample_mask) { |
| 1575 | sample_mask = DefineOutput(*this, U32[1], std::nullopt); | 1575 | const Id array_type{TypeArray(U32[1], Const(1U))}; |
| 1576 | sample_mask = DefineOutput(*this, array_type, std::nullopt); | ||
| 1576 | Decorate(sample_mask, spv::Decoration::BuiltIn, spv::BuiltIn::SampleMask); | 1577 | Decorate(sample_mask, spv::Decoration::BuiltIn, spv::BuiltIn::SampleMask); |
| 1577 | } | 1578 | } |
| 1578 | break; | 1579 | break; |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index b79409a68..ba9eece1d 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | #include "configuration/configure_input.h" | 27 | #include "configuration/configure_input.h" |
| 28 | #include "configuration/configure_per_game.h" | 28 | #include "configuration/configure_per_game.h" |
| 29 | #include "configuration/configure_tas.h" | 29 | #include "configuration/configure_tas.h" |
| 30 | #include "core/file_sys/romfs_factory.h" | ||
| 30 | #include "core/file_sys/vfs.h" | 31 | #include "core/file_sys/vfs.h" |
| 31 | #include "core/file_sys/vfs_real.h" | 32 | #include "core/file_sys/vfs_real.h" |
| 32 | #include "core/frontend/applets/cabinet.h" | 33 | #include "core/frontend/applets/cabinet.h" |
| @@ -4171,6 +4172,8 @@ void GMainWindow::OnReinitializeKeys(ReinitializeKeyBehavior behavior) { | |||
| 4171 | } | 4172 | } |
| 4172 | 4173 | ||
| 4173 | Core::Crypto::KeyManager& keys = Core::Crypto::KeyManager::Instance(); | 4174 | Core::Crypto::KeyManager& keys = Core::Crypto::KeyManager::Instance(); |
| 4175 | bool all_keys_present{true}; | ||
| 4176 | |||
| 4174 | if (keys.BaseDeriveNecessary()) { | 4177 | if (keys.BaseDeriveNecessary()) { |
| 4175 | Core::Crypto::PartitionDataManager pdm{vfs->OpenDirectory("", FileSys::Mode::Read)}; | 4178 | Core::Crypto::PartitionDataManager pdm{vfs->OpenDirectory("", FileSys::Mode::Read)}; |
| 4176 | 4179 | ||
| @@ -4195,6 +4198,7 @@ void GMainWindow::OnReinitializeKeys(ReinitializeKeyBehavior behavior) { | |||
| 4195 | errors += tr(" - Missing PRODINFO"); | 4198 | errors += tr(" - Missing PRODINFO"); |
| 4196 | } | 4199 | } |
| 4197 | if (!errors.isEmpty()) { | 4200 | if (!errors.isEmpty()) { |
| 4201 | all_keys_present = false; | ||
| 4198 | QMessageBox::warning( | 4202 | QMessageBox::warning( |
| 4199 | this, tr("Derivation Components Missing"), | 4203 | this, tr("Derivation Components Missing"), |
| 4200 | tr("Encryption keys are missing. " | 4204 | tr("Encryption keys are missing. " |
| @@ -4222,11 +4226,40 @@ void GMainWindow::OnReinitializeKeys(ReinitializeKeyBehavior behavior) { | |||
| 4222 | 4226 | ||
| 4223 | system->GetFileSystemController().CreateFactories(*vfs); | 4227 | system->GetFileSystemController().CreateFactories(*vfs); |
| 4224 | 4228 | ||
| 4229 | if (all_keys_present && !this->CheckSystemArchiveDecryption()) { | ||
| 4230 | LOG_WARNING(Frontend, "Mii model decryption failed"); | ||
| 4231 | QMessageBox::warning( | ||
| 4232 | this, tr("System Archive Decryption Failed"), | ||
| 4233 | tr("Encryption keys failed to decrypt firmware. " | ||
| 4234 | "<br>Please follow <a href='https://yuzu-emu.org/help/quickstart/'>the yuzu " | ||
| 4235 | "quickstart guide</a> to get all your keys, firmware and " | ||
| 4236 | "games.")); | ||
| 4237 | } | ||
| 4238 | |||
| 4225 | if (behavior == ReinitializeKeyBehavior::Warning) { | 4239 | if (behavior == ReinitializeKeyBehavior::Warning) { |
| 4226 | game_list->PopulateAsync(UISettings::values.game_dirs); | 4240 | game_list->PopulateAsync(UISettings::values.game_dirs); |
| 4227 | } | 4241 | } |
| 4228 | } | 4242 | } |
| 4229 | 4243 | ||
| 4244 | bool GMainWindow::CheckSystemArchiveDecryption() { | ||
| 4245 | constexpr u64 MiiModelId = 0x0100000000000802; | ||
| 4246 | |||
| 4247 | auto bis_system = system->GetFileSystemController().GetSystemNANDContents(); | ||
| 4248 | if (!bis_system) { | ||
| 4249 | // Not having system BIS files is not an error. | ||
| 4250 | return true; | ||
| 4251 | } | ||
| 4252 | |||
| 4253 | auto mii_nca = bis_system->GetEntry(MiiModelId, FileSys::ContentRecordType::Data); | ||
| 4254 | if (!mii_nca) { | ||
| 4255 | // Not having the Mii model is not an error. | ||
| 4256 | return true; | ||
| 4257 | } | ||
| 4258 | |||
| 4259 | // Return whether we are able to decrypt the RomFS of the Mii model. | ||
| 4260 | return mii_nca->GetRomFS().get() != nullptr; | ||
| 4261 | } | ||
| 4262 | |||
| 4230 | std::optional<u64> GMainWindow::SelectRomFSDumpTarget(const FileSys::ContentProvider& installed, | 4263 | std::optional<u64> GMainWindow::SelectRomFSDumpTarget(const FileSys::ContentProvider& installed, |
| 4231 | u64 program_id) { | 4264 | u64 program_id) { |
| 4232 | const auto dlc_entries = | 4265 | const auto dlc_entries = |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 8b5c1d747..3bbc31ada 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -392,6 +392,7 @@ private: | |||
| 392 | void LoadTranslation(); | 392 | void LoadTranslation(); |
| 393 | void OpenPerGameConfiguration(u64 title_id, const std::string& file_name); | 393 | void OpenPerGameConfiguration(u64 title_id, const std::string& file_name); |
| 394 | bool CheckDarkMode(); | 394 | bool CheckDarkMode(); |
| 395 | bool CheckSystemArchiveDecryption(); | ||
| 395 | 396 | ||
| 396 | QString GetTasStateDescription() const; | 397 | QString GetTasStateDescription() const; |
| 397 | bool CreateShortcut(const std::string& shortcut_path, const std::string& title, | 398 | bool CreateShortcut(const std::string& shortcut_path, const std::string& title, |