Ok, I'm thoroughly stumped on this one and I need to go to bed.
// Calling vmaCreateBuffer
std::cerr << "Before vmaCreateBuffer" << std::endl;
// Temporarily ignoring return value
vmaCreateBuffer(
device.getAllocator(), // prints the returning allocator
&bufferCreateInfo, // non null
&bufferAllocationCreateInfo, // non null
&this->buffer, // non null
&this->buffer_allocation, // non null
nullptr
);
std::cerr << "After vmaCreateBuffer" << std::endl;
seb::panic("CREATED BUFFER SHUTDOWN");
// Slightly modified vmaCreateBuffer
VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBuffer(
VmaAllocator allocator,
const VkBufferCreateInfo* pBufferCreateInfo,
const VmaAllocationCreateInfo* pAllocationCreateInfo,
VkBuffer* pBuffer,
VmaAllocation* pAllocation,
VmaAllocationInfo* pAllocationInfo)
{
std::cerr << "Inside vmaCreateBuffer" << std::endl; // added
VMA_ASSERT(allocator && pBufferCreateInfo && pAllocationCreateInfo && pBuffer && pAllocation);
...
Output (normal):
Before vmaCreateBuffer
[Jan 01/01/2023 03:20:12.938:484 AM] [src/render/renderer.cpp:143:47] [Fatal] Before Object Creation
Before vmaCreateBuffer
[Jan 01/01/2023 03:20:12.938:941 AM] [src/render/device.hpp:176:49] [Fatal] Returning allocator!
PS C:\Users\samsk\Desktop\sebgen-vkhp\build>
using gdb:
[Jan 01/01/2023 03:20:43.365:784 AM] [src/render/renderer.cpp:143:47] [Fatal] Before Object Creation
Before vmaCreateBuffer
[Jan 01/01/2023 03:20:43.366:251 AM] [src/render/device.hpp:176:49] [Fatal] Returning allocator!
After vmaCreateBuffer
Thread panic! id: 1 | [Jan 01/01/2023 03:20:43.367:771 AM] [src/render/buffer.cpp:111:53] [Fatal] CREATED BUFFER SHUTDOWN
I have absolutely no idea what is going on here. Why does it work inside of gdb and not normally. Why does putting a function call in the beginning of vmaCreateBuffer not get called?
