Refactor: Move Vulkan descriptor pools
Moves the descriptor pools from resource pools to thread data. The descriptor pools uses a recycling approach and don't need to be guarded anymore inside a resource pool. Now only the descriptor set tracker is inside the resource pool. Pull Request: https://projects.blender.org/blender/blender/pulls/145393
This commit is contained in:
@@ -211,7 +211,7 @@ void VKContext::memory_statistics_get(int *r_total_mem_kb, int *r_free_mem_kb)
|
||||
|
||||
VKDescriptorPools &VKContext::descriptor_pools_get()
|
||||
{
|
||||
return thread_data_.value().get().resource_pool_get().descriptor_pools;
|
||||
return thread_data_.value().get().descriptor_pools;
|
||||
}
|
||||
|
||||
VKDescriptorSetTracker &VKContext::descriptor_set_get()
|
||||
|
||||
@@ -509,9 +509,7 @@ std::string VKDevice::driver_version() const
|
||||
|
||||
VKThreadData::VKThreadData(VKDevice &device, pthread_t thread_id) : thread_id(thread_id)
|
||||
{
|
||||
for (VKResourcePool &resource_pool : resource_pools) {
|
||||
resource_pool.init(device);
|
||||
}
|
||||
descriptor_pools.init(device);
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
@@ -125,6 +125,7 @@ class VKThreadData : public NonCopyable, NonMovable {
|
||||
uint32_t resource_pool_index = UINT32_MAX;
|
||||
std::array<VKResourcePool, resource_pools_count> resource_pools;
|
||||
|
||||
VKDescriptorPools descriptor_pools;
|
||||
/**
|
||||
* The current rendering depth.
|
||||
*
|
||||
|
||||
@@ -12,11 +12,6 @@
|
||||
|
||||
namespace blender::gpu {
|
||||
|
||||
void VKResourcePool::init(VKDevice &device)
|
||||
{
|
||||
descriptor_pools.init(device);
|
||||
}
|
||||
|
||||
void VKDiscardPool::deinit(VKDevice &device)
|
||||
{
|
||||
destroy_discarded_resources(device, true);
|
||||
|
||||
@@ -146,9 +146,6 @@ class VKDiscardPool {
|
||||
class VKResourcePool {
|
||||
|
||||
public:
|
||||
VKDescriptorPools descriptor_pools;
|
||||
VKDescriptorSetTracker descriptor_set;
|
||||
|
||||
void init(VKDevice &device);
|
||||
};
|
||||
} // namespace blender::gpu
|
||||
|
||||
Reference in New Issue
Block a user