mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-30 21:30:04 +00:00 
			
		
		
		
	Address review and update zstd
This commit is contained in:
		
							parent
							
								
									936094dd27
								
							
						
					
					
						commit
						6945b6539f
					
				
					 9 changed files with 11 additions and 20 deletions
				
			
		|  | @ -6,7 +6,6 @@ | |||
| 
 | ||||
| #include <memory> | ||||
| #include "common/common_types.h" | ||||
| #include "core/frontend/emu_window.h" | ||||
| #include "video_core/rasterizer_interface.h" | ||||
| #include "video_core/video_core.h" | ||||
| 
 | ||||
|  |  | |||
|  | @ -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" | ||||
|  |  | |||
|  | @ -19,7 +19,8 @@ | |||
| 
 | ||||
| namespace OpenGL { | ||||
| 
 | ||||
| using ShaderCacheVersionHash = std::array<u8, 64>; | ||||
| constexpr std::size_t HASH_LENGTH = 64; | ||||
| using ShaderCacheVersionHash = std::array<u8, HASH_LENGTH>; | ||||
| 
 | ||||
| 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<std::vector<ShaderDiskCacheRaw>> 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<std::vector<ShaderDiskCacheRaw>> 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; | ||||
|         } | ||||
|  |  | |||
|  | @ -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<std::vector<ShaderDiskCacheRaw>> LoadTransferable(); | ||||
|  |  | |||
|  | @ -19,8 +19,6 @@ class System; | |||
| 
 | ||||
| namespace OpenGL { | ||||
| 
 | ||||
| class ShaderDiskCacheOpenGL; | ||||
| 
 | ||||
| enum class UniformBindings : GLuint { Common, VS, GS }; | ||||
| 
 | ||||
| struct LightSrc { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue