diff options
| author | 2019-02-09 09:05:47 +0100 | |
|---|---|---|
| committer | 2019-03-29 18:22:08 +0100 | |
| commit | 35ebbbc167986552f5fb4784cc53214ddcca505a (patch) | |
| tree | d5e96460ad7c8e6c7b688c5dfb91c74c163ce938 | |
| parent | common/zstd_compression: Add Zstandard wrapper (diff) | |
| download | yuzu-35ebbbc167986552f5fb4784cc53214ddcca505a.tar.gz yuzu-35ebbbc167986552f5fb4784cc53214ddcca505a.tar.xz yuzu-35ebbbc167986552f5fb4784cc53214ddcca505a.zip | |
gl_shader_disk_cache: Use Zstandard for compression
Diffstat (limited to '')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_disk_cache.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp index d2d979997..e74ffd291 100644 --- a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | #include "common/file_util.h" | 11 | #include "common/file_util.h" |
| 12 | #include "common/logging/log.h" | 12 | #include "common/logging/log.h" |
| 13 | #include "common/lz4_compression.h" | 13 | #include "common/zstd_compression.h" |
| 14 | #include "common/scm_rev.h" | 14 | #include "common/scm_rev.h" |
| 15 | 15 | ||
| 16 | #include "core/core.h" | 16 | #include "core/core.h" |
| @@ -259,7 +259,7 @@ ShaderDiskCacheOpenGL::LoadPrecompiledFile(FileUtil::IOFile& file) { | |||
| 259 | return {}; | 259 | return {}; |
| 260 | } | 260 | } |
| 261 | 261 | ||
| 262 | dump.binary = Common::Compression::DecompressDataLZ4(compressed_binary, binary_length); | 262 | dump.binary = Common::Compression::DecompressDataZSTD(compressed_binary, binary_length); |
| 263 | if (dump.binary.empty()) { | 263 | if (dump.binary.empty()) { |
| 264 | return {}; | 264 | return {}; |
| 265 | } | 265 | } |
| @@ -288,7 +288,7 @@ std::optional<ShaderDiskCacheDecompiled> ShaderDiskCacheOpenGL::LoadDecompiledEn | |||
| 288 | return {}; | 288 | return {}; |
| 289 | } | 289 | } |
| 290 | 290 | ||
| 291 | const std::vector<u8> code = Common::Compression::DecompressDataLZ4(compressed_code, code_size); | 291 | const std::vector<u8> code = Common::Compression::DecompressDataZSTD(compressed_code, code_size); |
| 292 | if (code.empty()) { | 292 | if (code.empty()) { |
| 293 | return {}; | 293 | return {}; |
| 294 | } | 294 | } |
| @@ -474,8 +474,8 @@ void ShaderDiskCacheOpenGL::SaveDecompiled(u64 unique_identifier, const std::str | |||
| 474 | if (!IsUsable()) | 474 | if (!IsUsable()) |
| 475 | return; | 475 | return; |
| 476 | 476 | ||
| 477 | const std::vector<u8> compressed_code{Common::Compression::CompressDataLZ4HC( | 477 | const std::vector<u8> compressed_code{Common::Compression::CompressDataZSTDDefault( |
| 478 | reinterpret_cast<const u8*>(code.data()), code.size(), 9)}; | 478 | reinterpret_cast<const u8*>(code.data()), code.size())}; |
| 479 | if (compressed_code.empty()) { | 479 | if (compressed_code.empty()) { |
| 480 | LOG_ERROR(Render_OpenGL, "Failed to compress GLSL code - skipping shader {:016x}", | 480 | LOG_ERROR(Render_OpenGL, "Failed to compress GLSL code - skipping shader {:016x}", |
| 481 | unique_identifier); | 481 | unique_identifier); |
| @@ -506,7 +506,7 @@ void ShaderDiskCacheOpenGL::SaveDump(const ShaderDiskCacheUsage& usage, GLuint p | |||
| 506 | glGetProgramBinary(program, binary_length, nullptr, &binary_format, binary.data()); | 506 | glGetProgramBinary(program, binary_length, nullptr, &binary_format, binary.data()); |
| 507 | 507 | ||
| 508 | const std::vector<u8> compressed_binary = | 508 | const std::vector<u8> compressed_binary = |
| 509 | Common::Compression::CompressDataLZ4HC(binary.data(), binary.size(), 9); | 509 | Common::Compression::CompressDataZSTDDefault(binary.data(), binary.size()); |
| 510 | 510 | ||
| 511 | if (compressed_binary.empty()) { | 511 | if (compressed_binary.empty()) { |
| 512 | LOG_ERROR(Render_OpenGL, "Failed to compress binary program in shader={:016x}", | 512 | LOG_ERROR(Render_OpenGL, "Failed to compress binary program in shader={:016x}", |