forked from eden-emu/eden
		
	shader_environment: Receive cache version from outside
This allows us invalidating OpenGL and Vulkan separately in the future.
This commit is contained in:
		
							parent
							
								
									2e6acac647
								
							
						
					
					
						commit
						a97c0ccabd
					
				
					 4 changed files with 23 additions and 16 deletions
				
			
		|  | @ -164,18 +164,19 @@ private: | |||
| }; | ||||
| 
 | ||||
| void SerializePipeline(std::span<const char> key, std::span<const GenericEnvironment* const> envs, | ||||
|                        const std::filesystem::path& filename); | ||||
|                        const std::filesystem::path& filename, u32 cache_version); | ||||
| 
 | ||||
| template <typename Key, typename Envs> | ||||
| void SerializePipeline(const Key& key, const Envs& envs, const std::filesystem::path& filename) { | ||||
| void SerializePipeline(const Key& key, const Envs& envs, const std::filesystem::path& filename, | ||||
|                        u32 cache_version) { | ||||
|     static_assert(std::is_trivially_copyable_v<Key>); | ||||
|     static_assert(std::has_unique_object_representations_v<Key>); | ||||
|     SerializePipeline(std::span(reinterpret_cast<const char*>(&key), sizeof(key)), | ||||
|                       std::span(envs.data(), envs.size()), filename); | ||||
|                       std::span(envs.data(), envs.size()), filename, cache_version); | ||||
| } | ||||
| 
 | ||||
| void LoadPipelines( | ||||
|     std::stop_token stop_loading, const std::filesystem::path& filename, | ||||
|     std::stop_token stop_loading, const std::filesystem::path& filename, u32 expected_cache_version, | ||||
|     Common::UniqueFunction<void, std::ifstream&, FileEnvironment> load_compute, | ||||
|     Common::UniqueFunction<void, std::ifstream&, std::vector<FileEnvironment>> load_graphics); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 ReinUsesLisp
						ReinUsesLisp