#include <AllocatorVk.h>
Definition at line 414 of file AllocatorVk.h.
◆ VkMAInfo()
vkmm::VkMAInfo::VkMAInfo |
( |
| ) |
|
|
inline |
Definition at line 473 of file AllocatorVk.h.
474
475 (*(VkMemoryAllocateInfo*)(this)) = VkMemoryAllocateInfo{ .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO };
476 pCurr = (Header*)(
this);
477
478
479 };
struct vkmm::VkMAInfo::Header * pCurr
◆ ~VkMAInfo()
vkmm::VkMAInfo::~VkMAInfo |
( |
| ) |
|
|
inline |
◆ append()
template<typename T >
void vkmm::VkMAInfo::append |
( |
T *& |
info | ) |
|
|
inline |
BYTE* ptr = traits::allocate(alloc, size + n);
Definition at line 481 of file AllocatorVk.h.
481 {
482
483 size_t n = sizeof(T);
485 BYTE* ptr = new BYTE[n];
486 info =
reinterpret_cast<T*
>(ptr);
488
493
494 }
VkStructureType setsType(T *i)
◆ clear()
void vkmm::VkMAInfo::clear |
( |
| ) |
|
|
inline |
Definition at line 495 of file AllocatorVk.h.
495 {
496
498 auto h = (VkMAInfo::Header*)(this->pNext);
499 BYTE* data = nullptr;
500 size_t dsize = 0;
501 while (h) {
502 data = (BYTE*)h;
504 h = (VkMAInfo::Header*)h->pNext;
505 memset(data, 0, dsize);
506 ::operator delete(data, dsize);
507 }
509 }
510 (*(VkMemoryAllocateInfo*)(this)) = VkMemoryAllocateInfo{ .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO };
511 pCurr = (Header*)(
this);
512
513 }
size_t getSize(Header *h)
◆ getSize()
size_t vkmm::VkMAInfo::getSize |
( |
Header * |
h | ) |
|
|
inline |
Definition at line 447 of file AllocatorVk.h.
447 {
448 switch (h->sType)
449 {
450#define STYPE2SIZE(t,stype) case stype: return sizeof(t);
451 STYPE2SIZE(VkMemoryAllocateFlagsInfo, VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO)
452 STYPE2SIZE(VkMemoryDedicatedAllocateInfo, VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO)
453 default:
454 break;
455 }
456 assert(0);
457 return 0;
458 };
#define STYPE2SIZE(t, stype)
◆ getStruct() [1/2]
template<typename T >
T * vkmm::VkMAInfo::getStruct |
( |
| ) |
|
|
inline |
Definition at line 460 of file AllocatorVk.h.
460 {
461 auto h = (VkMAInfo::Header*)(VkMemoryAllocateInfo::pNext);
462 VkStructureType stype =
setsType((T*)h);
463 while (h) {
464 if (stype == h->sType) return (T*)h;
465 else h = (VkMAInfo::Header*)h->pNext;
466 }
467 return (T*)nullptr;
468 };
◆ getStruct() [2/2]
template<>
float * vkmm::VkMAInfo::getStruct |
( |
| ) |
|
|
inline |
Definition at line 470 of file AllocatorVk.h.
470 {
471 return (float*)nullptr;
472 }
◆ setsType()
template<class T >
VkStructureType vkmm::VkMAInfo::setsType |
( |
T * |
i | ) |
|
|
inline |
Definition at line 438 of file AllocatorVk.h.
438 {
439 if (0) {}
440#define ST2STYPE(t,stype) else if (std::is_same<T, t>::value) return stype;
441 ST2STYPE(VkMemoryAllocateFlagsInfo, VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO)
442 ST2STYPE(VkMemoryDedicatedAllocateInfo, VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO)
443 ;
444 assert(0);
445 return (VkStructureType)0;
446 };
#define ST2STYPE(t, stype)
◆ pCurr
◆ size
std::size_t vkmm::VkMAInfo::size |
The documentation for this struct was generated from the following file: