Improve testing framework

Replaced Criterrion with CMock. Added few tests, currently not working
properly. Random test upgrades.
This commit is contained in:
Piotr Krygier committed 2025-06-20 13:44:33 +02:00
1 parent 56c0b7922f
commit f5ab5f3f27
29 files changed
+140082 -310

No files matched your search

+71
View File
@@ -0,0 +1,71 @@
#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