void heapUpheap( void * v ){ int i = heapIndex( v ); if( !i ){ fprintf(stderr, "There is no such element in heap \n"); return; } upheap(i); }
uint32 PhysicalDeviceProperties::GetIndexOfLargestHeapSupportingFlags( VkMemoryPropertyFlags flags ) const { VkDeviceSize selectedHeapSize( 0u ); uint32_t selectedHeapIndex( static_cast<uint32>(-1) ); for( uint32_t heapIndex( 0u ); heapIndex < memoryProperties.memoryHeapCount; ++heapIndex ) { auto& heapDescriptor( memoryProperties.memoryHeaps[heapIndex] ); if( (flags == (heapDescriptor.flags & flags)) && (heapDescriptor.size > selectedHeapSize) ) { selectedHeapIndex = heapIndex; selectedHeapSize = heapDescriptor.size; } } return selectedHeapIndex; }