This repository has been archived by the owner on Apr 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 47
/
vk_mem_alloc.hpp
2880 lines (2497 loc) · 117 KB
/
vk_mem_alloc.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#ifndef AMD_VULKAN_MEMORY_ALLOCATOR_HPP
#define AMD_VULKAN_MEMORY_ALLOCATOR_HPP
#include "vk_mem_alloc.h"
#include <vulkan/vulkan.hpp>
#if !defined(VMA_HPP_NAMESPACE)
#define VMA_HPP_NAMESPACE vma
#endif
#define VMA_HPP_NAMESPACE_STRING VULKAN_HPP_STRINGIFY(VMA_HPP_NAMESPACE)
namespace VMA_HPP_NAMESPACE {
class Allocation;
class Allocator;
class DefragmentationContext;
class Pool;
struct AllocationCreateInfo;
struct AllocationInfo;
struct AllocatorCreateInfo;
struct DefragmentationInfo2;
struct DefragmentationStats;
struct DeviceMemoryCallbacks;
struct PoolCreateInfo;
struct PoolStats;
struct RecordSettings;
struct StatInfo;
struct Stats;
struct Budget;
struct VulkanFunctions;
enum class MemoryUsage
{
eUnknown = VMA_MEMORY_USAGE_UNKNOWN,
eGpuOnly = VMA_MEMORY_USAGE_GPU_ONLY,
eCpuOnly = VMA_MEMORY_USAGE_CPU_ONLY,
eCpuToGpu = VMA_MEMORY_USAGE_CPU_TO_GPU,
eGpuToCpu = VMA_MEMORY_USAGE_GPU_TO_CPU,
eCpuCopy = VMA_MEMORY_USAGE_CPU_COPY,
eGpuLazilyAllocated = VMA_MEMORY_USAGE_GPU_LAZILY_ALLOCATED
};
VULKAN_HPP_INLINE std::string to_string( MemoryUsage value )
{
switch ( value )
{
case MemoryUsage::eUnknown : return "Unknown";
case MemoryUsage::eGpuOnly : return "GpuOnly";
case MemoryUsage::eCpuOnly : return "CpuOnly";
case MemoryUsage::eCpuToGpu : return "CpuToGpu";
case MemoryUsage::eGpuToCpu : return "GpuToCpu";
case MemoryUsage::eCpuCopy : return "CpuCopy";
case MemoryUsage::eGpuLazilyAllocated : return "GpuLazilyAllocated";
default: return "invalid";
}
}
enum class AllocationCreateFlagBits : VmaAllocationCreateFlags
{
eDedicatedMemory = VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT,
eNeverAllocate = VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT,
eMapped = VMA_ALLOCATION_CREATE_MAPPED_BIT,
eCanBecomeLost = VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT,
eCanMakeOtherLost = VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT,
eUserDataCopyString = VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT,
eUpperAddress = VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT,
eDontBind = VMA_ALLOCATION_CREATE_DONT_BIND_BIT,
eWithinBudget = VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT,
eStrategyBestFit = VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT,
eStrategyWorstFit = VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT,
eStrategyFirstFit = VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT,
eStrategyMinMemory = VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT,
eStrategyMinTime = VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT,
eStrategyMinFragmentation = VMA_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT,
eStrategyMask = VMA_ALLOCATION_CREATE_STRATEGY_MASK
};
VULKAN_HPP_INLINE std::string to_string( AllocationCreateFlagBits value )
{
switch ( value )
{
case AllocationCreateFlagBits::eDedicatedMemory : return "DedicatedMemory";
case AllocationCreateFlagBits::eNeverAllocate : return "NeverAllocate";
case AllocationCreateFlagBits::eMapped : return "Mapped";
case AllocationCreateFlagBits::eCanBecomeLost : return "CanBecomeLost";
case AllocationCreateFlagBits::eCanMakeOtherLost : return "CanMakeOtherLost";
case AllocationCreateFlagBits::eUserDataCopyString : return "UserDataCopyString";
case AllocationCreateFlagBits::eUpperAddress : return "UpperAddress";
case AllocationCreateFlagBits::eDontBind : return "DontBind";
case AllocationCreateFlagBits::eWithinBudget : return "WithinBudget";
case AllocationCreateFlagBits::eStrategyBestFit : return "StrategyBestFit";
case AllocationCreateFlagBits::eStrategyWorstFit : return "StrategyWorstFit";
case AllocationCreateFlagBits::eStrategyFirstFit : return "StrategyFirstFit";
default: return "invalid";
}
}
using AllocationCreateFlags = VULKAN_HPP_NAMESPACE::Flags<AllocationCreateFlagBits>;
VULKAN_HPP_INLINE AllocationCreateFlags operator|( AllocationCreateFlagBits bit0, AllocationCreateFlagBits bit1 )
{
return AllocationCreateFlags( bit0 ) | bit1;
}
VULKAN_HPP_INLINE AllocationCreateFlags operator~( AllocationCreateFlagBits bits )
{
return ~( AllocationCreateFlags( bits ) );
}
VULKAN_HPP_INLINE std::string to_string( AllocationCreateFlags value )
{
if ( !value ) return "{}";
std::string result;
if ( value & AllocationCreateFlagBits::eDedicatedMemory ) result += "DedicatedMemory | ";
if ( value & AllocationCreateFlagBits::eNeverAllocate ) result += "NeverAllocate | ";
if ( value & AllocationCreateFlagBits::eMapped ) result += "Mapped | ";
if ( value & AllocationCreateFlagBits::eCanBecomeLost ) result += "CanBecomeLost | ";
if ( value & AllocationCreateFlagBits::eCanMakeOtherLost ) result += "CanMakeOtherLost | ";
if ( value & AllocationCreateFlagBits::eUserDataCopyString ) result += "UserDataCopyString | ";
if ( value & AllocationCreateFlagBits::eUpperAddress ) result += "UpperAddress | ";
if ( value & AllocationCreateFlagBits::eDontBind ) result += "DontBind | ";
if ( value & AllocationCreateFlagBits::eWithinBudget ) result += "WithinBudget | ";
if ( value & AllocationCreateFlagBits::eStrategyBestFit ) result += "StrategyBestFit | ";
if ( value & AllocationCreateFlagBits::eStrategyWorstFit ) result += "StrategyWorstFit | ";
if ( value & AllocationCreateFlagBits::eStrategyFirstFit ) result += "StrategyFirstFit | ";
if ( value & AllocationCreateFlagBits::eStrategyMinMemory ) result += "StrategyMinMemory | ";
if ( value & AllocationCreateFlagBits::eStrategyMinTime ) result += "StrategyMinTime | ";
if ( value & AllocationCreateFlagBits::eStrategyMinFragmentation ) result += "StrategyMinFragmentation | ";
return "{ " + result.substr(0, result.size() - 3) + " }";
}
enum class AllocatorCreateFlagBits : VmaAllocatorCreateFlags
{
eExternallySynchronized = VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT,
eKhrDedicatedAllocation = VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT,
eKhrBindMemory2 = VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT,
eExtMemoryBudget = VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT,
eAmdDeviceCoherentMemory = VMA_ALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT,
eBufferDeviceAddress = VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT,
eExtMemoryPriority = VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT
};
VULKAN_HPP_INLINE std::string to_string( AllocatorCreateFlagBits value )
{
switch ( value )
{
case AllocatorCreateFlagBits::eExternallySynchronized : return "ExternallySynchronized";
case AllocatorCreateFlagBits::eKhrDedicatedAllocation : return "KhrDedicatedAllocation";
case AllocatorCreateFlagBits::eKhrBindMemory2 : return "KhrBindMemory2";
case AllocatorCreateFlagBits::eExtMemoryBudget : return "ExtMemoryBudget";
case AllocatorCreateFlagBits::eAmdDeviceCoherentMemory : return "AmdDeviceCoherentMemory";
case AllocatorCreateFlagBits::eBufferDeviceAddress : return "BufferDeviceAddress";
case AllocatorCreateFlagBits::eExtMemoryPriority : return "ExtMemoryPriority";
default: return "invalid";
}
}
using AllocatorCreateFlags = VULKAN_HPP_NAMESPACE::Flags<AllocatorCreateFlagBits>;
VULKAN_HPP_INLINE AllocatorCreateFlags operator|( AllocatorCreateFlagBits bit0, AllocatorCreateFlagBits bit1 )
{
return AllocatorCreateFlags( bit0 ) | bit1;
}
VULKAN_HPP_INLINE AllocatorCreateFlags operator~( AllocatorCreateFlagBits bits )
{
return ~( AllocatorCreateFlags( bits ) );
}
VULKAN_HPP_INLINE std::string to_string( AllocatorCreateFlags value )
{
if ( !value ) return "{}";
std::string result;
if ( value & AllocatorCreateFlagBits::eExternallySynchronized ) result += "ExternallySynchronized | ";
if ( value & AllocatorCreateFlagBits::eKhrDedicatedAllocation ) result += "KhrDedicatedAllocation | ";
if ( value & AllocatorCreateFlagBits::eKhrBindMemory2 ) result += "KhrBindMemory2 | ";
if ( value & AllocatorCreateFlagBits::eExtMemoryBudget ) result += "ExtMemoryBudget | ";
if ( value & AllocatorCreateFlagBits::eAmdDeviceCoherentMemory ) result += "AmdDeviceCoherentMemory | ";
if ( value & AllocatorCreateFlagBits::eBufferDeviceAddress ) result += "BufferDeviceAddress | ";
if ( value & AllocatorCreateFlagBits::eExtMemoryPriority ) result += "ExtMemoryPriority | ";
return "{ " + result.substr(0, result.size() - 3) + " }";
}
enum class DefragmentationFlagBits : VmaDefragmentationFlags
{
eIncremental = VMA_DEFRAGMENTATION_FLAG_INCREMENTAL
};
VULKAN_HPP_INLINE std::string to_string( DefragmentationFlagBits value )
{
switch ( value )
{
case DefragmentationFlagBits::eIncremental : return "Incremental";
default: return "invalid";
}
}
using DefragmentationFlags = VULKAN_HPP_NAMESPACE::Flags<DefragmentationFlagBits>;
VULKAN_HPP_INLINE DefragmentationFlags operator|( DefragmentationFlagBits bit0, DefragmentationFlagBits bit1 )
{
return DefragmentationFlags( bit0 ) | bit1;
}
VULKAN_HPP_INLINE DefragmentationFlags operator~( DefragmentationFlagBits bits )
{
return ~( DefragmentationFlags( bits ) );
}
VULKAN_HPP_INLINE std::string to_string( DefragmentationFlags value )
{
if ( !value ) return "{}";
std::string result;
if ( value & DefragmentationFlagBits::eIncremental ) result += "Incremental | ";
return "{ " + result.substr(0, result.size() - 3) + " }";
}
enum class PoolCreateFlagBits : VmaPoolCreateFlags
{
eIgnoreBufferImageGranularity = VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT,
eLinearAlgorithm = VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT,
eBuddyAlgorithm = VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT,
eAlgorithmMask = VMA_POOL_CREATE_ALGORITHM_MASK
};
VULKAN_HPP_INLINE std::string to_string( PoolCreateFlagBits value )
{
switch ( value )
{
case PoolCreateFlagBits::eIgnoreBufferImageGranularity : return "IgnoreBufferImageGranularity";
case PoolCreateFlagBits::eLinearAlgorithm : return "LinearAlgorithm";
case PoolCreateFlagBits::eBuddyAlgorithm : return "BuddyAlgorithm";
case PoolCreateFlagBits::eAlgorithmMask : return "AlgorithmMask";
default: return "invalid";
}
}
using PoolCreateFlags = VULKAN_HPP_NAMESPACE::Flags<PoolCreateFlagBits>;
VULKAN_HPP_INLINE PoolCreateFlags operator|( PoolCreateFlagBits bit0, PoolCreateFlagBits bit1 )
{
return PoolCreateFlags( bit0 ) | bit1;
}
VULKAN_HPP_INLINE PoolCreateFlags operator~( PoolCreateFlagBits bits )
{
return ~( PoolCreateFlags( bits ) );
}
VULKAN_HPP_INLINE std::string to_string( PoolCreateFlags value )
{
if ( !value ) return "{}";
std::string result;
if ( value & PoolCreateFlagBits::eIgnoreBufferImageGranularity ) result += "IgnoreBufferImageGranularity | ";
if ( value & PoolCreateFlagBits::eLinearAlgorithm ) result += "LinearAlgorithm | ";
if ( value & PoolCreateFlagBits::eBuddyAlgorithm ) result += "BuddyAlgorithm | ";
return "{ " + result.substr(0, result.size() - 3) + " }";
}
enum class RecordFlagBits : VmaRecordFlags
{
eFlushAfterCall = VMA_RECORD_FLUSH_AFTER_CALL_BIT
};
VULKAN_HPP_INLINE std::string to_string( RecordFlagBits value )
{
switch ( value )
{
case RecordFlagBits::eFlushAfterCall : return "FlushAfterCall";
default: return "invalid";
}
}
using RecordFlags = VULKAN_HPP_NAMESPACE::Flags<RecordFlagBits>;
VULKAN_HPP_INLINE RecordFlags operator|( RecordFlagBits bit0, RecordFlagBits bit1 )
{
return RecordFlags( bit0 ) | bit1;
}
VULKAN_HPP_INLINE RecordFlags operator~( RecordFlagBits bits )
{
return ~( RecordFlags( bits ) );
}
VULKAN_HPP_INLINE std::string to_string( RecordFlags value )
{
if ( !value ) return "{}";
std::string result;
if ( value & RecordFlagBits::eFlushAfterCall ) result += "FlushAfterCall | ";
return "{ " + result.substr(0, result.size() - 3) + " }";
}
class Allocator
{
public:
using CType = VmaAllocator;
public:
VULKAN_HPP_CONSTEXPR Allocator()
: m_allocator(VK_NULL_HANDLE)
{}
VULKAN_HPP_CONSTEXPR Allocator( std::nullptr_t )
: m_allocator(VK_NULL_HANDLE)
{}
VULKAN_HPP_TYPESAFE_EXPLICIT Allocator( VmaAllocator allocator )
: m_allocator( allocator )
{}
#if defined(VULKAN_HPP_TYPESAFE_CONVERSION)
Allocator & operator=(VmaAllocator allocator)
{
m_allocator = allocator;
return *this;
}
#endif
Allocator & operator=( std::nullptr_t )
{
m_allocator = VK_NULL_HANDLE;
return *this;
}
bool operator==( Allocator const & rhs ) const
{
return m_allocator == rhs.m_allocator;
}
bool operator!=(Allocator const & rhs ) const
{
return m_allocator != rhs.m_allocator;
}
bool operator<(Allocator const & rhs ) const
{
return m_allocator < rhs.m_allocator;
}
VULKAN_HPP_NAMESPACE::Result allocateMemory( const VULKAN_HPP_NAMESPACE::MemoryRequirements* pVkMemoryRequirements, const AllocationCreateInfo* pCreateInfo, Allocation* pAllocation, AllocationInfo* pAllocationInfo ) const;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
VULKAN_HPP_NAMESPACE::ResultValueType<Allocation>::type allocateMemory( const VULKAN_HPP_NAMESPACE::MemoryRequirements & vkMemoryRequirements, const AllocationCreateInfo & createInfo, VULKAN_HPP_NAMESPACE::Optional<AllocationInfo> allocationInfo = nullptr ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
VULKAN_HPP_NAMESPACE::Result allocateMemoryForBuffer( VULKAN_HPP_NAMESPACE::Buffer buffer, const AllocationCreateInfo* pCreateInfo, Allocation* pAllocation, AllocationInfo* pAllocationInfo ) const;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
VULKAN_HPP_NAMESPACE::ResultValueType<Allocation>::type allocateMemoryForBuffer( VULKAN_HPP_NAMESPACE::Buffer buffer, const AllocationCreateInfo & createInfo, VULKAN_HPP_NAMESPACE::Optional<AllocationInfo> allocationInfo = nullptr ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
VULKAN_HPP_NAMESPACE::Result allocateMemoryForImage( VULKAN_HPP_NAMESPACE::Image image, const AllocationCreateInfo* pCreateInfo, Allocation* pAllocation, AllocationInfo* pAllocationInfo ) const;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
VULKAN_HPP_NAMESPACE::ResultValueType<Allocation>::type allocateMemoryForImage( VULKAN_HPP_NAMESPACE::Image image, const AllocationCreateInfo & createInfo, VULKAN_HPP_NAMESPACE::Optional<AllocationInfo> allocationInfo = nullptr ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
VULKAN_HPP_NAMESPACE::Result allocateMemoryPages( const VULKAN_HPP_NAMESPACE::MemoryRequirements* pVkMemoryRequirements, const AllocationCreateInfo* pCreateInfo, size_t allocationCount, Allocation* pAllocations, AllocationInfo* pAllocationInfos ) const;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template<typename VectorAllocator = std::allocator<AllocationInfo>>
typename VULKAN_HPP_NAMESPACE::ResultValueType<std::vector<AllocationInfo,VectorAllocator>>::type allocateMemoryPages( const VULKAN_HPP_NAMESPACE::MemoryRequirements & vkMemoryRequirements, const AllocationCreateInfo & createInfo, VULKAN_HPP_NAMESPACE::ArrayProxy<Allocation> allocations ) const;
template<typename VectorAllocator = std::allocator<AllocationInfo>>
typename VULKAN_HPP_NAMESPACE::ResultValueType<std::vector<AllocationInfo,VectorAllocator>>::type allocateMemoryPages( const VULKAN_HPP_NAMESPACE::MemoryRequirements & vkMemoryRequirements, const AllocationCreateInfo & createInfo, VULKAN_HPP_NAMESPACE::ArrayProxy<Allocation> allocations, Allocator const& vectorAllocator ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE
VULKAN_HPP_NAMESPACE::Result bindBufferMemory( Allocation allocation, VULKAN_HPP_NAMESPACE::Buffer buffer ) const;
#else
VULKAN_HPP_NAMESPACE::ResultValueType<void>::type bindBufferMemory( Allocation allocation, VULKAN_HPP_NAMESPACE::Buffer buffer ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE
VULKAN_HPP_NAMESPACE::Result bindBufferMemory2( Allocation allocation, VULKAN_HPP_NAMESPACE::DeviceSize allocationLocalOffset, VULKAN_HPP_NAMESPACE::Buffer buffer, const void* pNext ) const;
#else
VULKAN_HPP_NAMESPACE::ResultValueType<void>::type bindBufferMemory2( Allocation allocation, VULKAN_HPP_NAMESPACE::DeviceSize allocationLocalOffset, VULKAN_HPP_NAMESPACE::Buffer buffer, const void* pNext ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE
VULKAN_HPP_NAMESPACE::Result bindImageMemory( Allocation allocation, VULKAN_HPP_NAMESPACE::Image image ) const;
#else
VULKAN_HPP_NAMESPACE::ResultValueType<void>::type bindImageMemory( Allocation allocation, VULKAN_HPP_NAMESPACE::Image image ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE
VULKAN_HPP_NAMESPACE::Result bindImageMemory2( Allocation allocation, VULKAN_HPP_NAMESPACE::DeviceSize allocationLocalOffset, VULKAN_HPP_NAMESPACE::Image image, const void* pNext ) const;
#else
VULKAN_HPP_NAMESPACE::ResultValueType<void>::type bindImageMemory2( Allocation allocation, VULKAN_HPP_NAMESPACE::DeviceSize allocationLocalOffset, VULKAN_HPP_NAMESPACE::Image image, const void* pNext ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
void calculateStats( Stats* pStats ) const;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
Stats calculateStats() const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
void getBudget( Budget* pBudget ) const;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
std::vector<Budget> getBudget() const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE
VULKAN_HPP_NAMESPACE::Result checkCorruption( uint32_t memoryTypeBits ) const;
#else
VULKAN_HPP_NAMESPACE::ResultValueType<void>::type checkCorruption( uint32_t memoryTypeBits ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE
VULKAN_HPP_NAMESPACE::Result checkPoolCorruption( Pool pool ) const;
#else
VULKAN_HPP_NAMESPACE::ResultValueType<void>::type checkPoolCorruption( Pool pool ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE
void getPoolName( Pool pool, const char** ppName ) const;
#else
const char* getPoolName( Pool pool ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE
void setPoolName( Pool pool, const char* pName ) const;
#else
void setPoolName( Pool pool, const char* pName ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
VULKAN_HPP_NAMESPACE::Result createBuffer( const VULKAN_HPP_NAMESPACE::BufferCreateInfo* pBufferCreateInfo, const AllocationCreateInfo* pAllocationCreateInfo, VULKAN_HPP_NAMESPACE::Buffer* pBuffer, Allocation* pAllocation, AllocationInfo* pAllocationInfo ) const;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
VULKAN_HPP_NAMESPACE::ResultValueType<std::pair<VULKAN_HPP_NAMESPACE::Buffer, vma::Allocation>>::type createBuffer( const VULKAN_HPP_NAMESPACE::BufferCreateInfo & bufferCreateInfo, const AllocationCreateInfo & allocationCreateInfo, VULKAN_HPP_NAMESPACE::Optional<AllocationInfo> allocationInfo = nullptr ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
VULKAN_HPP_NAMESPACE::Result createImage( const VULKAN_HPP_NAMESPACE::ImageCreateInfo* pImageCreateInfo, const AllocationCreateInfo* pAllocationCreateInfo, VULKAN_HPP_NAMESPACE::Image* pImage, Allocation* pAllocation, AllocationInfo* pAllocationInfo ) const;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
VULKAN_HPP_NAMESPACE::ResultValueType<std::pair<VULKAN_HPP_NAMESPACE::Image, vma::Allocation>>::type createImage( const VULKAN_HPP_NAMESPACE::ImageCreateInfo & imageCreateInfo, const AllocationCreateInfo & allocationCreateInfo, VULKAN_HPP_NAMESPACE::Optional<AllocationInfo> allocationInfo = nullptr ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
void createLostAllocation( Allocation* pAllocation ) const;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
Allocation createLostAllocation() const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
VULKAN_HPP_NAMESPACE::Result createPool( const PoolCreateInfo* pCreateInfo, Pool* pPool ) const;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
VULKAN_HPP_NAMESPACE::ResultValueType<Pool>::type createPool( const PoolCreateInfo & createInfo ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
VULKAN_HPP_NAMESPACE::Result defragmentationBegin( const DefragmentationInfo2* pInfo, DefragmentationStats* pStats, DefragmentationContext* pContext ) const;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
VULKAN_HPP_NAMESPACE::ResultValueType<DefragmentationContext>::type defragmentationBegin( const DefragmentationInfo2 & info, VULKAN_HPP_NAMESPACE::Optional<DefragmentationStats> stats = nullptr ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE
VULKAN_HPP_NAMESPACE::Result defragmentationEnd( DefragmentationContext context ) const;
#else
VULKAN_HPP_NAMESPACE::ResultValueType<void>::type defragmentationEnd( DefragmentationContext context ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
void destroy() const;
void destroyBuffer( VULKAN_HPP_NAMESPACE::Buffer buffer, Allocation allocation ) const;
void destroyImage( VULKAN_HPP_NAMESPACE::Image image, Allocation allocation ) const;
void destroyPool( Pool pool ) const;
VULKAN_HPP_NAMESPACE::Result findMemoryTypeIndex( uint32_t memoryTypeBits, const AllocationCreateInfo* pAllocationCreateInfo, uint32_t* pMemoryTypeIndex ) const;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
VULKAN_HPP_NAMESPACE::ResultValueType<uint32_t>::type findMemoryTypeIndex( uint32_t memoryTypeBits, const AllocationCreateInfo & allocationCreateInfo ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
VULKAN_HPP_NAMESPACE::Result findMemoryTypeIndexForBufferInfo( const VULKAN_HPP_NAMESPACE::BufferCreateInfo* pBufferCreateInfo, const AllocationCreateInfo* pAllocationCreateInfo, uint32_t* pMemoryTypeIndex ) const;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
VULKAN_HPP_NAMESPACE::ResultValueType<uint32_t>::type findMemoryTypeIndexForBufferInfo( const VULKAN_HPP_NAMESPACE::BufferCreateInfo & bufferCreateInfo, const AllocationCreateInfo & allocationCreateInfo ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
VULKAN_HPP_NAMESPACE::Result findMemoryTypeIndexForImageInfo( const VULKAN_HPP_NAMESPACE::ImageCreateInfo* pImageCreateInfo, const AllocationCreateInfo* pAllocationCreateInfo, uint32_t* pMemoryTypeIndex ) const;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
VULKAN_HPP_NAMESPACE::ResultValueType<uint32_t>::type findMemoryTypeIndexForImageInfo( const VULKAN_HPP_NAMESPACE::ImageCreateInfo & imageCreateInfo, const AllocationCreateInfo & allocationCreateInfo ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
void flushAllocation( Allocation allocation, VULKAN_HPP_NAMESPACE::DeviceSize offset, VULKAN_HPP_NAMESPACE::DeviceSize size ) const;
void freeMemory( Allocation allocation ) const;
void freeMemoryPages( size_t allocationCount, Allocation* pAllocations ) const;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
void freeMemoryPages( VULKAN_HPP_NAMESPACE::ArrayProxy<Allocation> allocations ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
void getAllocationInfo( Allocation allocation, AllocationInfo* pAllocationInfo ) const;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
AllocationInfo getAllocationInfo( Allocation allocation ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
void getMemoryTypeProperties( uint32_t memoryTypeIndex, VULKAN_HPP_NAMESPACE::MemoryPropertyFlags* pFlags ) const;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
VULKAN_HPP_NAMESPACE::MemoryPropertyFlags getMemoryTypeProperties( uint32_t memoryTypeIndex ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
void getPoolStats( Pool pool, PoolStats* pPoolStats ) const;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
PoolStats getPoolStats( Pool pool ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
void invalidateAllocation( Allocation allocation, VULKAN_HPP_NAMESPACE::DeviceSize offset, VULKAN_HPP_NAMESPACE::DeviceSize size ) const;
void makePoolAllocationsLost( Pool pool, size_t* pLostAllocationCount ) const;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
size_t makePoolAllocationsLost( Pool pool ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
VULKAN_HPP_NAMESPACE::Result mapMemory( Allocation allocation, void** ppData ) const;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
VULKAN_HPP_NAMESPACE::ResultValueType<void*>::type mapMemory( Allocation allocation ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
void setAllocationUserData( Allocation allocation, void* pUserData ) const;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
void setAllocationUserData( Allocation allocation ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
void setCurrentFrameIndex( uint32_t frameIndex ) const;
VULKAN_HPP_NAMESPACE::Bool32 touchAllocation( Allocation allocation ) const;
void unmapMemory( Allocation allocation ) const;
VULKAN_HPP_TYPESAFE_EXPLICIT operator VmaAllocator() const
{
return m_allocator;
}
explicit operator bool() const
{
return m_allocator != VK_NULL_HANDLE;
}
bool operator!() const
{
return m_allocator == VK_NULL_HANDLE;
}
private:
VmaAllocator m_allocator;
};
static_assert( sizeof( Allocator ) == sizeof( VmaAllocator ), "handle and wrapper have different size!" );
class Pool
{
public:
using CType = VmaPool;
public:
VULKAN_HPP_CONSTEXPR Pool()
: m_pool(VK_NULL_HANDLE)
{}
VULKAN_HPP_CONSTEXPR Pool( std::nullptr_t )
: m_pool(VK_NULL_HANDLE)
{}
VULKAN_HPP_TYPESAFE_EXPLICIT Pool( VmaPool pool )
: m_pool( pool )
{}
#if defined(VULKAN_HPP_TYPESAFE_CONVERSION)
Pool & operator=(VmaPool pool)
{
m_pool = pool;
return *this;
}
#endif
Pool & operator=( std::nullptr_t )
{
m_pool = VK_NULL_HANDLE;
return *this;
}
bool operator==( Pool const & rhs ) const
{
return m_pool == rhs.m_pool;
}
bool operator!=(Pool const & rhs ) const
{
return m_pool != rhs.m_pool;
}
bool operator<(Pool const & rhs ) const
{
return m_pool < rhs.m_pool;
}
VULKAN_HPP_TYPESAFE_EXPLICIT operator VmaPool() const
{
return m_pool;
}
explicit operator bool() const
{
return m_pool != VK_NULL_HANDLE;
}
bool operator!() const
{
return m_pool == VK_NULL_HANDLE;
}
private:
VmaPool m_pool;
};
static_assert( sizeof( Pool ) == sizeof( VmaPool ), "handle and wrapper have different size!" );
class Allocation
{
public:
using CType = VmaAllocation;
public:
VULKAN_HPP_CONSTEXPR Allocation()
: m_allocation(VK_NULL_HANDLE)
{}
VULKAN_HPP_CONSTEXPR Allocation( std::nullptr_t )
: m_allocation(VK_NULL_HANDLE)
{}
VULKAN_HPP_TYPESAFE_EXPLICIT Allocation( VmaAllocation allocation )
: m_allocation( allocation )
{}
#if defined(VULKAN_HPP_TYPESAFE_CONVERSION)
Allocation & operator=(VmaAllocation allocation)
{
m_allocation = allocation;
return *this;
}
#endif
Allocation & operator=( std::nullptr_t )
{
m_allocation = VK_NULL_HANDLE;
return *this;
}
bool operator==( Allocation const & rhs ) const
{
return m_allocation == rhs.m_allocation;
}
bool operator!=(Allocation const & rhs ) const
{
return m_allocation != rhs.m_allocation;
}
bool operator<(Allocation const & rhs ) const
{
return m_allocation < rhs.m_allocation;
}
VULKAN_HPP_TYPESAFE_EXPLICIT operator VmaAllocation() const
{
return m_allocation;
}
explicit operator bool() const
{
return m_allocation != VK_NULL_HANDLE;
}
bool operator!() const
{
return m_allocation == VK_NULL_HANDLE;
}
private:
VmaAllocation m_allocation;
};
static_assert( sizeof( Allocation ) == sizeof( VmaAllocation ), "handle and wrapper have different size!" );
class DefragmentationContext
{
public:
using CType = VmaDefragmentationContext;
public:
VULKAN_HPP_CONSTEXPR DefragmentationContext()
: m_defragmentationContext(VK_NULL_HANDLE)
{}
VULKAN_HPP_CONSTEXPR DefragmentationContext( std::nullptr_t )
: m_defragmentationContext(VK_NULL_HANDLE)
{}
VULKAN_HPP_TYPESAFE_EXPLICIT DefragmentationContext( VmaDefragmentationContext defragmentationContext )
: m_defragmentationContext( defragmentationContext )
{}
#if defined(VULKAN_HPP_TYPESAFE_CONVERSION)
DefragmentationContext & operator=(VmaDefragmentationContext defragmentationContext)
{
m_defragmentationContext = defragmentationContext;
return *this;
}
#endif
DefragmentationContext & operator=( std::nullptr_t )
{
m_defragmentationContext = VK_NULL_HANDLE;
return *this;
}
bool operator==( DefragmentationContext const & rhs ) const
{
return m_defragmentationContext == rhs.m_defragmentationContext;
}
bool operator!=(DefragmentationContext const & rhs ) const
{
return m_defragmentationContext != rhs.m_defragmentationContext;
}
bool operator<(DefragmentationContext const & rhs ) const
{
return m_defragmentationContext < rhs.m_defragmentationContext;
}
VULKAN_HPP_TYPESAFE_EXPLICIT operator VmaDefragmentationContext() const
{
return m_defragmentationContext;
}
explicit operator bool() const
{
return m_defragmentationContext != VK_NULL_HANDLE;
}
bool operator!() const
{
return m_defragmentationContext == VK_NULL_HANDLE;
}
private:
VmaDefragmentationContext m_defragmentationContext;
};
static_assert( sizeof( DefragmentationContext ) == sizeof( VmaDefragmentationContext ), "handle and wrapper have different size!" );
VULKAN_HPP_NAMESPACE::Result createAllocator( const AllocatorCreateInfo* pCreateInfo, Allocator* pAllocator );
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
VULKAN_HPP_NAMESPACE::ResultValueType<Allocator>::type createAllocator( const AllocatorCreateInfo & createInfo );
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
struct AllocationCreateInfo
{
AllocationCreateInfo( AllocationCreateFlags flags_ = AllocationCreateFlags(),
MemoryUsage usage_ = MemoryUsage::eUnknown,
VULKAN_HPP_NAMESPACE::MemoryPropertyFlags requiredFlags_ = VULKAN_HPP_NAMESPACE::MemoryPropertyFlags(),
VULKAN_HPP_NAMESPACE::MemoryPropertyFlags preferredFlags_ = VULKAN_HPP_NAMESPACE::MemoryPropertyFlags(),
uint32_t memoryTypeBits_ = 0,
Pool pool_ = Pool(),
void* pUserData_ = nullptr,
float priority_ = 0 )
: flags( flags_ )
, usage( usage_ )
, requiredFlags( requiredFlags_ )
, preferredFlags( preferredFlags_ )
, memoryTypeBits( memoryTypeBits_ )
, pool( pool_ )
, pUserData( pUserData_ )
, priority( priority_ )
{}
AllocationCreateInfo( VmaAllocationCreateInfo const & rhs )
{
*reinterpret_cast<VmaAllocationCreateInfo*>(this) = rhs;
}
AllocationCreateInfo& operator=( VmaAllocationCreateInfo const & rhs )
{
*reinterpret_cast<VmaAllocationCreateInfo*>(this) = rhs;
return *this;
}
AllocationCreateInfo & setFlags( AllocationCreateFlags flags_ )
{
flags = flags_;
return *this;
}
AllocationCreateInfo & setUsage( MemoryUsage usage_ )
{
usage = usage_;
return *this;
}
AllocationCreateInfo & setRequiredFlags( VULKAN_HPP_NAMESPACE::MemoryPropertyFlags requiredFlags_ )
{
requiredFlags = requiredFlags_;
return *this;
}
AllocationCreateInfo & setPreferredFlags( VULKAN_HPP_NAMESPACE::MemoryPropertyFlags preferredFlags_ )
{
preferredFlags = preferredFlags_;
return *this;
}
AllocationCreateInfo & setMemoryTypeBits( uint32_t memoryTypeBits_ )
{
memoryTypeBits = memoryTypeBits_;
return *this;
}
AllocationCreateInfo & setPool( Pool pool_ )
{
pool = pool_;
return *this;
}
AllocationCreateInfo & setPUserData( void* pUserData_ )
{
pUserData = pUserData_;
return *this;
}
AllocationCreateInfo & setPriority( float priority_ )
{
priority = priority_;
return *this;
}
operator VmaAllocationCreateInfo const&() const
{
return *reinterpret_cast<const VmaAllocationCreateInfo*>( this );
}
operator VmaAllocationCreateInfo &()
{
return *reinterpret_cast<VmaAllocationCreateInfo*>( this );
}
bool operator==( AllocationCreateInfo const& rhs ) const
{
return ( flags == rhs.flags )
&& ( usage == rhs.usage )
&& ( requiredFlags == rhs.requiredFlags )
&& ( preferredFlags == rhs.preferredFlags )
&& ( memoryTypeBits == rhs.memoryTypeBits )
&& ( pool == rhs.pool )
&& ( pUserData == rhs.pUserData )
&& ( priority == rhs.priority );
}
bool operator!=( AllocationCreateInfo const& rhs ) const
{
return !operator==( rhs );
}
public:
AllocationCreateFlags flags;
MemoryUsage usage;
VULKAN_HPP_NAMESPACE::MemoryPropertyFlags requiredFlags;
VULKAN_HPP_NAMESPACE::MemoryPropertyFlags preferredFlags;
uint32_t memoryTypeBits;
Pool pool;
void* pUserData;
float priority;
};
static_assert( sizeof( AllocationCreateInfo ) == sizeof( VmaAllocationCreateInfo ), "struct and wrapper have different size!" );
static_assert( std::is_standard_layout<AllocationCreateInfo>::value, "struct wrapper is not a standard layout!" );
struct AllocationInfo
{
AllocationInfo( uint32_t memoryType_ = 0,
VULKAN_HPP_NAMESPACE::DeviceMemory deviceMemory_ = VULKAN_HPP_NAMESPACE::DeviceMemory(),
VULKAN_HPP_NAMESPACE::DeviceSize offset_ = 0,
VULKAN_HPP_NAMESPACE::DeviceSize size_ = 0,
void* pMappedData_ = nullptr,
void* pUserData_ = nullptr )
: memoryType( memoryType_ )
, deviceMemory( deviceMemory_ )
, offset( offset_ )
, size( size_ )
, pMappedData( pMappedData_ )
, pUserData( pUserData_ )
{}
AllocationInfo( VmaAllocationInfo const & rhs )
{
*reinterpret_cast<VmaAllocationInfo*>(this) = rhs;
}
AllocationInfo& operator=( VmaAllocationInfo const & rhs )
{
*reinterpret_cast<VmaAllocationInfo*>(this) = rhs;
return *this;
}
AllocationInfo & setMemoryType( uint32_t memoryType_ )
{
memoryType = memoryType_;
return *this;
}
AllocationInfo & setDeviceMemory( VULKAN_HPP_NAMESPACE::DeviceMemory deviceMemory_ )
{
deviceMemory = deviceMemory_;
return *this;
}
AllocationInfo & setOffset( VULKAN_HPP_NAMESPACE::DeviceSize offset_ )
{
offset = offset_;
return *this;
}
AllocationInfo & setSize( VULKAN_HPP_NAMESPACE::DeviceSize size_ )
{
size = size_;
return *this;
}
AllocationInfo & setPMappedData( void* pMappedData_ )
{
pMappedData = pMappedData_;
return *this;
}
AllocationInfo & setPUserData( void* pUserData_ )
{
pUserData = pUserData_;
return *this;
}
operator VmaAllocationInfo const&() const
{
return *reinterpret_cast<const VmaAllocationInfo*>( this );
}
operator VmaAllocationInfo &()
{
return *reinterpret_cast<VmaAllocationInfo*>( this );
}
bool operator==( AllocationInfo const& rhs ) const
{
return ( memoryType == rhs.memoryType )
&& ( deviceMemory == rhs.deviceMemory )
&& ( offset == rhs.offset )
&& ( size == rhs.size )
&& ( pMappedData == rhs.pMappedData )
&& ( pUserData == rhs.pUserData );
}
bool operator!=( AllocationInfo const& rhs ) const
{
return !operator==( rhs );
}
public:
uint32_t memoryType;
VULKAN_HPP_NAMESPACE::DeviceMemory deviceMemory;
VULKAN_HPP_NAMESPACE::DeviceSize offset;
VULKAN_HPP_NAMESPACE::DeviceSize size;
void* pMappedData;
void* pUserData;
};
static_assert( sizeof( AllocationInfo ) == sizeof( VmaAllocationInfo ), "struct and wrapper have different size!" );
static_assert( std::is_standard_layout<AllocationInfo>::value, "struct wrapper is not a standard layout!" );
struct DeviceMemoryCallbacks
{
DeviceMemoryCallbacks( PFN_vmaAllocateDeviceMemoryFunction pfnAllocate_ = nullptr,
PFN_vmaFreeDeviceMemoryFunction pfnFree_ = nullptr,
void* pUserData_ = nullptr )
: pfnAllocate( pfnAllocate_ )
, pfnFree( pfnFree_ )
, pUserData( pUserData_ )
{}
DeviceMemoryCallbacks( VmaDeviceMemoryCallbacks const & rhs )
{
*reinterpret_cast<VmaDeviceMemoryCallbacks*>(this) = rhs;
}
DeviceMemoryCallbacks& operator=( VmaDeviceMemoryCallbacks const & rhs )
{
*reinterpret_cast<VmaDeviceMemoryCallbacks*>(this) = rhs;
return *this;
}
DeviceMemoryCallbacks & setPfnAllocate( PFN_vmaAllocateDeviceMemoryFunction pfnAllocate_ )
{
pfnAllocate = pfnAllocate_;
return *this;
}
DeviceMemoryCallbacks & setPfnFree( PFN_vmaFreeDeviceMemoryFunction pfnFree_ )