| 540 | } |
| 541 | |
| 542 | void ResourceHandler::destroyImage( GraphContext & context |
| 543 | , ImageId imageId ) |
| 544 | { |
| 545 | lock_type lock( m_imagesMutex ); |
| 546 | auto it = m_images.find( imageId ); |
| 547 | |
| 548 | if ( it != m_images.end() ) |
| 549 | { |
| 550 | if ( context.vkDestroyImage && it->second.first ) |
| 551 | { |
| 552 | context.vkDestroyImage( context.device, it->second.first, context.allocator ); |
| 553 | } |
| 554 | |
| 555 | if ( context.vkFreeMemory && it->second.second ) |
| 556 | { |
| 557 | context.vkFreeMemory( context.device, it->second.second, context.allocator ); |
| 558 | } |
| 559 | |
| 560 | m_images.erase( it ); |
| 561 | } |
| 562 | } |
| 563 | |
| 564 | void ResourceHandler::destroyImageView( GraphContext & context |
| 565 | , ImageViewId viewId ) |