|
Blender V4.3
|
#include <vk_resource_pool.hh>
Public Member Functions | |
| void | deinit (VKDevice &device) |
| void | discard_image (VkImage vk_image, VmaAllocation vma_allocation) |
| void | discard_image_view (VkImageView vk_image_view) |
| void | discard_buffer (VkBuffer vk_buffer, VmaAllocation vma_allocation) |
| void | discard_shader_module (VkShaderModule vk_shader_module) |
| void | discard_pipeline_layout (VkPipelineLayout vk_pipeline_layout) |
| void | move_data (VKDiscardPool &src_pool) |
| void | destroy_discarded_resources (VKDevice &device) |
Friends | |
| class | VKDevice |
Pool of resources that are discarded, but can still be in used and cannot be destroyed.
When GPU resources are deleted (GPU_*_delete) the GPU handles are kept inside a discard pool. When we are sure that the resource isn't used on the GPU anymore we can safely destroy it.
When preparing the next frame, the previous frame can still be rendered. Resources that needs to be destroyed can only be when the previous frame has been completed and being displayed on the screen.
Definition at line 29 of file vk_resource_pool.hh.
| void blender::gpu::VKDiscardPool::deinit | ( | VKDevice & | device | ) |
Definition at line 32 of file vk_resource_pool.cc.
References destroy_discarded_resources().
Referenced by blender::gpu::VKResourcePool::deinit().
| void blender::gpu::VKDiscardPool::destroy_discarded_resources | ( | VKDevice & | device | ) |
Definition at line 82 of file vk_resource_pool.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), blender::gpu::VKDevice::mem_allocator_get(), mutex, blender::Vector< T, InlineBufferCapacity, Allocator >::pop_last(), blender::gpu::render_graph::VKResourceStateTracker::remove_buffer(), blender::gpu::render_graph::VKResourceStateTracker::remove_image(), blender::gpu::VKDevice::resources, VK_ALLOCATION_CALLBACKS, and blender::gpu::VKDevice::vk_handle().
Referenced by deinit(), and blender::gpu::VKContext::sync_backbuffer().
| void blender::gpu::VKDiscardPool::discard_buffer | ( | VkBuffer | vk_buffer, |
| VmaAllocation | vma_allocation ) |
Definition at line 65 of file vk_resource_pool.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), and mutex.
Referenced by blender::gpu::VKBuffer::free().
| void blender::gpu::VKDiscardPool::discard_image | ( | VkImage | vk_image, |
| VmaAllocation | vma_allocation ) |
Definition at line 53 of file vk_resource_pool.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), and mutex.
Referenced by blender::gpu::VKTexture::~VKTexture().
| void blender::gpu::VKDiscardPool::discard_image_view | ( | VkImageView | vk_image_view | ) |
Definition at line 59 of file vk_resource_pool.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), and mutex.
Referenced by blender::gpu::VKImageView::~VKImageView().
| void blender::gpu::VKDiscardPool::discard_pipeline_layout | ( | VkPipelineLayout | vk_pipeline_layout | ) |
Definition at line 76 of file vk_resource_pool.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), and mutex.
Referenced by blender::gpu::VKShader::~VKShader().
| void blender::gpu::VKDiscardPool::discard_shader_module | ( | VkShaderModule | vk_shader_module | ) |
Definition at line 71 of file vk_resource_pool.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), and mutex.
Referenced by blender::gpu::VKShaderModule::~VKShaderModule().
| void blender::gpu::VKDiscardPool::move_data | ( | VKDiscardPool & | src_pool | ) |
Move discarded resources from src_pool into this.
GPU resources that are discarded from the dependency graph are stored in the device orphaned data. When a swap chain context list is made active the orphaned data can be merged into a swap chain discard pool.
Definition at line 37 of file vk_resource_pool.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::clear(), blender::Vector< T, InlineBufferCapacity, Allocator >::extend(), and mutex.
Referenced by blender::gpu::VKContext::sync_backbuffer().
|
friend |
Definition at line 30 of file vk_resource_pool.hh.