| 501 | } |
| 502 | |
| 503 | void ResourceHandler::destroyBuffer( GraphContext & context |
| 504 | , BufferId bufferId ) |
| 505 | { |
| 506 | lock_type lock( m_buffersMutex ); |
| 507 | auto it = m_buffers.find( bufferId ); |
| 508 | |
| 509 | if ( it != m_buffers.end() ) |
| 510 | { |
| 511 | if ( context.vkDestroyBuffer && it->second.first ) |
| 512 | { |
| 513 | context.vkDestroyBuffer( context.device, it->second.first, context.allocator ); |
| 514 | } |
| 515 | |
| 516 | if ( context.vkFreeMemory && it->second.second ) |
| 517 | { |
| 518 | context.vkFreeMemory( context.device, it->second.second, context.allocator ); |
| 519 | } |
| 520 | |
| 521 | m_buffers.erase( it ); |
| 522 | } |
| 523 | } |
| 524 | |
| 525 | void ResourceHandler::destroyBufferView( GraphContext & context |
| 526 | , BufferViewId viewId ) |