From 35ebbbc167986552f5fb4784cc53214ddcca505a Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 9 Feb 2019 09:05:47 +0100 Subject: gl_shader_disk_cache: Use Zstandard for compression --- src/video_core/renderer_opengl/gl_shader_disk_cache.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') 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 @@ #include "common/common_types.h" #include "common/file_util.h" #include "common/logging/log.h" -#include "common/lz4_compression.h" +#include "common/zstd_compression.h" #include "common/scm_rev.h" #include "core/core.h" @@ -259,7 +259,7 @@ ShaderDiskCacheOpenGL::LoadPrecompiledFile(FileUtil::IOFile& file) { return {}; } - dump.binary = Common::Compression::DecompressDataLZ4(compressed_binary, binary_length); + dump.binary = Common::Compression::DecompressDataZSTD(compressed_binary, binary_length); if (dump.binary.empty()) { return {}; } @@ -288,7 +288,7 @@ std::optional ShaderDiskCacheOpenGL::LoadDecompiledEn return {}; } - const std::vector code = Common::Compression::DecompressDataLZ4(compressed_code, code_size); + const std::vector code = Common::Compression::DecompressDataZSTD(compressed_code, code_size); if (code.empty()) { return {}; } @@ -474,8 +474,8 @@ void ShaderDiskCacheOpenGL::SaveDecompiled(u64 unique_identifier, const std::str if (!IsUsable()) return; - const std::vector compressed_code{Common::Compression::CompressDataLZ4HC( - reinterpret_cast(code.data()), code.size(), 9)}; + const std::vector compressed_code{Common::Compression::CompressDataZSTDDefault( + reinterpret_cast(code.data()), code.size())}; if (compressed_code.empty()) { LOG_ERROR(Render_OpenGL, "Failed to compress GLSL code - skipping shader {:016x}", unique_identifier); @@ -506,7 +506,7 @@ void ShaderDiskCacheOpenGL::SaveDump(const ShaderDiskCacheUsage& usage, GLuint p glGetProgramBinary(program, binary_length, nullptr, &binary_format, binary.data()); const std::vector compressed_binary = - Common::Compression::CompressDataLZ4HC(binary.data(), binary.size(), 9); + Common::Compression::CompressDataZSTDDefault(binary.data(), binary.size()); if (compressed_binary.empty()) { LOG_ERROR(Render_OpenGL, "Failed to compress binary program in shader={:016x}", -- cgit v1.2.3