mirror of
https://github.com/PabloMK7/citra.git
synced 2025-09-11 05:10:05 +00:00
common: Add more robust ZSTD handling. (#7071)
This commit is contained in:
parent
07839fb3ce
commit
4c59443ed2
3 changed files with 35 additions and 8 deletions
|
@ -206,6 +206,10 @@ ShaderDiskCache::LoadPrecompiledFile(FileUtil::IOFile& file, bool compressed) {
|
|||
if (compressed) {
|
||||
const std::vector<u8> decompressed =
|
||||
Common::Compression::DecompressDataZSTD(precompiled_file);
|
||||
if (decompressed.empty()) {
|
||||
LOG_ERROR(Render_OpenGL, "Could not decompress precompiled shader cache.");
|
||||
return std::nullopt;
|
||||
}
|
||||
SaveArrayToPrecompiled(decompressed.data(), decompressed.size());
|
||||
} else {
|
||||
SaveArrayToPrecompiled(precompiled_file.data(), precompiled_file.size());
|
||||
|
|
|
@ -10,10 +10,11 @@
|
|||
|
||||
namespace Pica::Shader::Generator {
|
||||
|
||||
// NOTE: Changing the order impacts shader transferable and precompiled cache loading.
|
||||
enum ProgramType : u32 {
|
||||
VS = 0,
|
||||
GS = 2,
|
||||
FS = 1,
|
||||
GS = 2,
|
||||
};
|
||||
|
||||
enum Attributes {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue