diff --git a/externals/zstd b/externals/zstd index 470344d33e..10f0e6993f 160000 --- a/externals/zstd +++ b/externals/zstd @@ -1 +1 @@ -Subproject commit 470344d33e1d52a2ada75d278466da8d4ee2faf6 +Subproject commit 10f0e6993f9d2f682da6d04aa2385b7d53cbb4ee diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index d59e34daec..4bc3da632e 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp @@ -557,7 +557,7 @@ std::optional GetCurrentDir() { #endif free(dir); return strDir; -} // namespace FileUtil +} bool SetCurrentDir(const std::string& directory) { #ifdef _WIN32 diff --git a/src/common/zstd_compression.cpp b/src/common/zstd_compression.cpp index 23263ce30d..64fb188690 100644 --- a/src/common/zstd_compression.cpp +++ b/src/common/zstd_compression.cpp @@ -11,7 +11,7 @@ namespace Common::Compression { std::vector CompressDataZSTD(const u8* source, std::size_t source_size, s32 compression_level) { - compression_level = std::clamp(compression_level, 1, ZSTD_maxCLevel()); + compression_level = std::clamp(compression_level, ZSTD_minCLevel(), ZSTD_maxCLevel()); const std::size_t max_compressed_size = ZSTD_compressBound(source_size); std::vector compressed(max_compressed_size); @@ -48,4 +48,4 @@ std::vector DecompressDataZSTD(const std::vector& compressed) { return decompressed; } -} // namespace Common::Compression \ No newline at end of file +} // namespace Common::Compression diff --git a/src/common/zstd_compression.h b/src/common/zstd_compression.h index e9de941c80..1715bae7a0 100644 --- a/src/common/zstd_compression.h +++ b/src/common/zstd_compression.h @@ -41,4 +41,4 @@ std::vector CompressDataZSTDDefault(const u8* source, std::size_t source_siz */ std::vector DecompressDataZSTD(const std::vector& compressed); -} // namespace Common::Compression \ No newline at end of file +} // namespace Common::Compression diff --git a/src/video_core/renderer_base.h b/src/video_core/renderer_base.h index cecf2a3235..7fcaf53702 100644 --- a/src/video_core/renderer_base.h +++ b/src/video_core/renderer_base.h @@ -6,7 +6,6 @@ #include #include "common/common_types.h" -#include "core/frontend/emu_window.h" #include "video_core/rasterizer_interface.h" #include "video_core/video_core.h" diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index a3f6fd9b92..862dcac00a 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -15,7 +15,6 @@ #include "common/microprofile.h" #include "common/scope_exit.h" #include "common/vector_math.h" -#include "core/core.h" #include "core/hw/gpu.h" #include "video_core/pica_state.h" #include "video_core/regs_framebuffer.h" 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 de29626f84..adf1cc8851 100644 --- a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp @@ -19,7 +19,8 @@ namespace OpenGL { -using ShaderCacheVersionHash = std::array; +constexpr std::size_t HASH_LENGTH = 64; +using ShaderCacheVersionHash = std::array; enum class TransferableEntryKind : u32 { Raw, @@ -44,10 +45,6 @@ ShaderDiskCacheRaw::ShaderDiskCacheRaw(u64 unique_identifier, ProgramType progra : unique_identifier{unique_identifier}, program_type{program_type}, config{config}, program_code{std::move(program_code)} {} -ShaderDiskCacheRaw::ShaderDiskCacheRaw() = default; - -ShaderDiskCacheRaw::~ShaderDiskCacheRaw() = default; - bool ShaderDiskCacheRaw::Load(FileUtil::IOFile& file) { if (file.ReadBytes(&unique_identifier, sizeof(u64)) != sizeof(u64) || file.ReadBytes(&program_type, sizeof(u32)) != sizeof(u32)) { @@ -107,8 +104,6 @@ bool ShaderDiskCacheRaw::Save(FileUtil::IOFile& file) const { ShaderDiskCache::ShaderDiskCache(bool separable) : separable{separable} {} -ShaderDiskCache::~ShaderDiskCache() = default; - std::optional> ShaderDiskCache::LoadTransferable() { const bool has_title_id = GetProgramID() != 0; if (!Settings::values.use_disk_shader_cache || !has_title_id) @@ -158,7 +153,7 @@ std::optional> ShaderDiskCache::LoadTransferable LOG_ERROR(Render_OpenGL, "Failed to load transferable raw entry - skipping"); return {}; } - transferable.insert({entry.GetUniqueIdentifier(), {}}); + transferable.emplace(entry.GetUniqueIdentifier(), ShaderDiskCacheRaw{}); raws.push_back(std::move(entry)); break; } diff --git a/src/video_core/renderer_opengl/gl_shader_disk_cache.h b/src/video_core/renderer_opengl/gl_shader_disk_cache.h index 9492fd9c09..df01c0ee54 100644 --- a/src/video_core/renderer_opengl/gl_shader_disk_cache.h +++ b/src/video_core/renderer_opengl/gl_shader_disk_cache.h @@ -46,8 +46,8 @@ class ShaderDiskCacheRaw { public: explicit ShaderDiskCacheRaw(u64 unique_identifier, ProgramType program_type, RawShaderConfig config, ProgramCode program_code); - ShaderDiskCacheRaw(); - ~ShaderDiskCacheRaw(); + ShaderDiskCacheRaw() = default; + ~ShaderDiskCacheRaw() = default; bool Load(FileUtil::IOFile& file); @@ -90,7 +90,7 @@ struct ShaderDiskCacheDump { class ShaderDiskCache { public: explicit ShaderDiskCache(bool separable); - ~ShaderDiskCache(); + ~ShaderDiskCache() = default; /// Loads transferable cache. If file has a old version or on failure, it deletes the file. std::optional> LoadTransferable(); diff --git a/src/video_core/renderer_opengl/gl_shader_manager.h b/src/video_core/renderer_opengl/gl_shader_manager.h index ada9015102..94149415c9 100644 --- a/src/video_core/renderer_opengl/gl_shader_manager.h +++ b/src/video_core/renderer_opengl/gl_shader_manager.h @@ -19,8 +19,6 @@ class System; namespace OpenGL { -class ShaderDiskCacheOpenGL; - enum class UniformBindings : GLuint { Common, VS, GS }; struct LightSrc {