vk_pipeline_cache: Reduce worker threads

* Using so many threads might starve other system work, especially if pipelines take way to long
This commit is contained in:
GPUCode 2024-04-06 13:49:29 +03:00
parent 0cc094e7c8
commit 7296604746

View file

@ -82,7 +82,7 @@ constexpr std::array<vk::DescriptorSetLayoutBinding, 7> SHADOW_BINDINGS = {{
PipelineCache::PipelineCache(const Instance& instance_, Scheduler& scheduler_, PipelineCache::PipelineCache(const Instance& instance_, Scheduler& scheduler_,
RenderpassCache& renderpass_cache_, DescriptorPool& pool_) RenderpassCache& renderpass_cache_, DescriptorPool& pool_)
: instance{instance_}, scheduler{scheduler_}, renderpass_cache{renderpass_cache_}, pool{pool_}, : instance{instance_}, scheduler{scheduler_}, renderpass_cache{renderpass_cache_}, pool{pool_},
num_worker_threads{std::max(std::thread::hardware_concurrency(), 2U)}, num_worker_threads{std::max(std::thread::hardware_concurrency() >> 1, 2U)},
workers{num_worker_threads, "Pipeline workers"}, workers{num_worker_threads, "Pipeline workers"},
descriptor_set_providers{DescriptorSetProvider{instance, pool, BUFFER_BINDINGS}, descriptor_set_providers{DescriptorSetProvider{instance, pool, BUFFER_BINDINGS},
DescriptorSetProvider{instance, pool, TEXTURE_BINDINGS}, DescriptorSetProvider{instance, pool, TEXTURE_BINDINGS},