Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/metal/mtl_memory.hh
| Show First 20 Lines • Show All 334 Lines • ▼ Show 20 Lines | |||||
| * command buffer submission are added to the `completed_safelist_queue_`. | * command buffer submission are added to the `completed_safelist_queue_`. | ||||
| * | * | ||||
| * * At a set point in time, all MTLSafeFreeList's in `completed_safelist_queue_` have their | * * At a set point in time, all MTLSafeFreeList's in `completed_safelist_queue_` have their | ||||
| * MTLBuffers re-inserted into the Memory Manager's pools. */ | * MTLBuffers re-inserted into the Memory Manager's pools. */ | ||||
| class MTLBufferPool { | class MTLBufferPool { | ||||
| private: | private: | ||||
| /* Memory statistics. */ | /* Memory statistics. */ | ||||
| long long int total_allocation_bytes_ = 0; | int64_t total_allocation_bytes_ = 0; | ||||
| #if MTL_DEBUG_MEMORY_STATISTICS == 1 | #if MTL_DEBUG_MEMORY_STATISTICS == 1 | ||||
| /* Debug statistics. */ | /* Debug statistics. */ | ||||
| std::atomic<int> per_frame_allocation_count_; | std::atomic<int> per_frame_allocation_count_; | ||||
| std::atomic<long long int> allocations_in_pool_; | std::atomic<int64_t> allocations_in_pool_; | ||||
| std::atomic<long long int> buffers_in_pool_; | std::atomic<int64_t> buffers_in_pool_; | ||||
| #endif | #endif | ||||
| /* Metal resources. */ | /* Metal resources. */ | ||||
| bool ensure_initialised_ = false; | bool ensure_initialised_ = false; | ||||
| id<MTLDevice> device_ = nil; | id<MTLDevice> device_ = nil; | ||||
| /* The buffer selection aims to pick a buffer which meets the minimum size requirements. | /* The buffer selection aims to pick a buffer which meets the minimum size requirements. | ||||
| * To do this, we keep an ordered set of all available buffers. If the buffer is larger than the | * To do this, we keep an ordered set of all available buffers. If the buffer is larger than the | ||||
| ▲ Show 20 Lines • Show All 125 Lines • Show Last 20 Lines | |||||