mirror of
				https://git.suyu.dev/suyu/suyu
				synced 2025-10-30 23:49:01 -05:00 
			
		
		
		
	gl_shader_cache: Use std::max() for determining num_workers
Does not allocate more threads than available in the host system for boot-time shader compilation and always allocates at least 1 thread if hardware_concurrency() returns 0.
This commit is contained in:
		| @@ -403,7 +403,7 @@ void ShaderCacheOpenGL::LoadDiskCache(const std::atomic_bool& stop_loading, | |||||||
|         } |         } | ||||||
|     }; |     }; | ||||||
|  |  | ||||||
|     const auto num_workers{static_cast<std::size_t>(std::thread::hardware_concurrency() + 1ULL)}; |     const std::size_t num_workers{std::max(1U, std::thread::hardware_concurrency())}; | ||||||
|     const std::size_t bucket_size{transferable->size() / num_workers}; |     const std::size_t bucket_size{transferable->size() / num_workers}; | ||||||
|     std::vector<std::unique_ptr<Core::Frontend::GraphicsContext>> contexts(num_workers); |     std::vector<std::unique_ptr<Core::Frontend::GraphicsContext>> contexts(num_workers); | ||||||
|     std::vector<std::thread> threads(num_workers); |     std::vector<std::thread> threads(num_workers); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Morph
					Morph