Files
RedScarfEngine/tests/src/mocks/vk_mem_alloc.h
T
Piotr Krygier f5ab5f3f27 Improve testing framework
Replaced Criterrion with CMock. Added few tests, currently not working
properly. Random test upgrades.
2025-06-20 13:44:33 +02:00

72 lines
2.2 KiB
C

#ifndef AMD_VULKAN_MEMORY_ALLOCATOR_H
#define AMD_VULKAN_MEMORY_ALLOCATOR_H
#include <stdint.h>
#include <vulkan/vulkan.h>
#define VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE 1
#define VMA_ALLOCATION_CREATE_MAPPED_BIT 2
#define VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT 3
#define VMA_MEMORY_USAGE_AUTO_PREFER_HOST 4
#define VMA_MEMORY_USAGE_AUTO 5;
#define VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT 6
typedef int VmaAllocation;
typedef int VmaAllocator;
typedef int VmaMemoryUsage;
typedef int VmaAllocationCreateFlags;
typedef struct {
VkBuffer buffer;
VmaAllocation allocation;
} VmaBuffer;
typedef struct {
VkImage image;
VmaAllocation allocation;
} VmaImage;
typedef struct {
float priority;
uint32_t flags;
uint32_t usage;
uint32_t requiredFlags;
uint32_t preferredFlags;
uint32_t memoryTypeBits;
void* pool;
void* pUserData;
} VmaAllocationCreateInfo;
typedef struct {
VkDeviceMemory memory;
VkDeviceSize offset;
VkDeviceSize size;
void* pMappedData;
} VmaAllocationInfo;
typedef struct {
void* vkGetInstanceProcAddr;
void* vkGetDeviceProcAddr;
} VmaVulkanFunctions;
typedef struct {
uint32_t vulkanApiVersion;
VkPhysicalDevice physicalDevice;
VkDevice device;
VkInstance instance;
VmaVulkanFunctions* pVulkanFunctions;
} VmaAllocatorCreateInfo;
VkResult vmaCreateAllocator(VmaAllocatorCreateInfo* pCreateInfo, VmaAllocator* pAllocator);
VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo* pBufferCreateInfo, const VmaAllocationCreateInfo* pAllocationCreateInfo, VkBuffer* pBuffer, VmaAllocation* pAllocation, VmaAllocationInfo* pAllocationInfo);
VkResult vmaCreateImage(VmaAllocator allocator, const VkImageCreateInfo* pImageCreateInfo, const VmaAllocationCreateInfo* pAllocationCreateInfo, VkImage* pImage, VmaAllocation* pAllocation, VmaAllocationInfo* pAllocationInfo);
void vmaDestroyAllocator(VmaAllocator allocator);
void vmaDestroyBuffer(VmaAllocator allocator, VkBuffer buffer, VmaAllocation allocation);
void vmaDestroyImage(VmaAllocator allocator, VkImage image, VmaAllocation allocation);
VkResult vmaMapMemory(VmaAllocator allocator, VmaAllocation allocation, void** ppData);
#endif // AMD_VULKAN_MEMORY_ALLOCATOR_H