mat4x4_mul(MVP, VP, demo->model_matrix);
assert(demo->uniform_data.num_mem == 1);
- err = vkMapMemory(demo->uniform_data.mem[0], 0, (void **) &pData);
+ err = vkMapMemory(demo->uniform_data.mem[0], 0, 0, 0, (void **) &pData);
assert(!err);
memcpy(pData, (const void*) &MVP[0][0], matrixSize);
/* Linear texture must be within a single memory object */
assert(num_allocations == 1);
- err = vkMapMemory(tex_obj->mem[0], 0, &data);
+ err = vkMapMemory(tex_obj->mem[0], 0, 0, 0, &data);
assert(!err);
if (!loadTexture(filename, data, &layout, &tex_width, &tex_height)) {
err = vkAllocMemory(demo->device, &alloc_info, &(demo->uniform_data.mem[i]));
assert(!err);
- err = vkMapMemory(demo->uniform_data.mem[i], 0, (void **) &pData);
+ err = vkMapMemory(demo->uniform_data.mem[i], 0, 0, 0, (void **) &pData);
assert(!err);
memcpy(pData, &data, (size_t)alloc_info.allocationSize);
VK_IMAGE_LAYOUT_CLEAR_OPTIMAL = 0x00000006, // Optimal layout when image is used only for clear operations
VK_IMAGE_LAYOUT_TRANSFER_SOURCE_OPTIMAL = 0x00000007, // Optimal layout when image is used only as source of transfer operations
VK_IMAGE_LAYOUT_TRANSFER_DESTINATION_OPTIMAL = 0x00000008, // Optimal layout when image is used only as destination of transfer operations
-
+
VK_ENUM_RANGE(IMAGE_LAYOUT, UNDEFINED, TRANSFER_DESTINATION_OPTIMAL)
} VkImageLayout;
VK_ENUM_RANGE(VERTEX_INPUT_STEP_RATE, VERTEX, DRAW)
} VkVertexInputStepRate;
-// ------------------------------------------------------------------------------------------------
// Vulkan format definitions
typedef enum VkFormat_
{
{
VkDeviceSize size; // Specified in bytes
VkDeviceSize alignment; // Specified in bytes
- VkDeviceSize granularity; // Granularity on which vkBindObjectMemoryRange can bind sub-ranges of memory specified in bytes (usually the page size)
+ VkDeviceSize granularity; // Granularity on which vkQueueBindObjectMemoryRange can bind sub-ranges of memory specified in bytes (usually the page size)
VkMemoryPropertyFlags memPropsAllowed; // Allowed memory property flags
VkMemoryPropertyFlags memPropsRequired; // Required memory property flags
} VkMemoryRequirements;
uint32_t localSizeX;
uint32_t localSizeY;
uint32_t localSizeZ;
-
} VkComputePipelineCreateInfo;
typedef struct VkVertexInputBindingDescription_
typedef VkResult (VKAPI *PFN_vkAllocMemory)(VkDevice device, const VkMemoryAllocInfo* pAllocInfo, VkDeviceMemory* pMem);
typedef VkResult (VKAPI *PFN_vkFreeMemory)(VkDeviceMemory mem);
typedef VkResult (VKAPI *PFN_vkSetMemoryPriority)(VkDeviceMemory mem, VkMemoryPriority priority);
-typedef VkResult (VKAPI *PFN_vkMapMemory)(VkDeviceMemory mem, VkFlags flags, void** ppData);
+typedef VkResult (VKAPI *PFN_vkMapMemory)(VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData);
typedef VkResult (VKAPI *PFN_vkUnmapMemory)(VkDeviceMemory mem);
+typedef VkResult (VKAPI *PFN_vkFlushMappedMemory)(VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size);
typedef VkResult (VKAPI *PFN_vkPinSystemMemory)(VkDevice device, const void* pSysMem, size_t memSize, VkDeviceMemory* pMem);
typedef VkResult (VKAPI *PFN_vkGetMultiDeviceCompatibility)(VkPhysicalDevice physicalDevice0, VkPhysicalDevice physicalDevice1, VkPhysicalDeviceCompatibilityInfo* pInfo);
typedef VkResult (VKAPI *PFN_vkOpenSharedMemory)(VkDevice device, const VkMemoryOpenInfo* pOpenInfo, VkDeviceMemory* pMem);
typedef VkResult (VKAPI *PFN_vkDestroyObject)(VkObject object);
typedef VkResult (VKAPI *PFN_vkGetObjectInfo)(VkBaseObject object, VkObjectInfoType infoType, size_t* pDataSize, void* pData);
typedef VkResult (VKAPI *PFN_vkQueueBindObjectMemory)(VkQueue queue, VkObject object, uint32_t allocationIdx, VkDeviceMemory mem, VkDeviceSize offset);
-typedef VkResult (VKAPI *PFN_vkQueueBindObjectMemoryRange)(VkQueue queue, VkObject object, uint32_t allocationIdx, VkDeviceSize rangeOffset,VkDeviceSize rangeSize, VkDeviceMemory mem, VkDeviceSize memOffset);
+typedef VkResult (VKAPI *PFN_vkQueueBindObjectMemoryRange)(VkQueue queue, VkObject object, uint32_t allocationIdx, VkDeviceSize rangeOffset, VkDeviceSize rangeSize, VkDeviceMemory mem, VkDeviceSize memOffset);
typedef VkResult (VKAPI *PFN_vkQueueBindImageMemoryRange)(VkQueue queue, VkImage image, uint32_t allocationIdx, const VkImageMemoryBindInfo* pBindInfo, VkDeviceMemory mem, VkDeviceSize memOffset);
typedef VkResult (VKAPI *PFN_vkCreateFence)(VkDevice device, const VkFenceCreateInfo* pCreateInfo, VkFence* pFence);
typedef VkResult (VKAPI *PFN_vkResetFences)(VkDevice device, uint32_t fenceCount, VkFence* pFences);
typedef void (VKAPI *PFN_vkCmdEndQuery)(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot);
typedef void (VKAPI *PFN_vkCmdResetQueryPool)(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount);
typedef void (VKAPI *PFN_vkCmdWriteTimestamp)(VkCmdBuffer cmdBuffer, VkTimestampType timestampType, VkBuffer destBuffer, VkDeviceSize destOffset);
-typedef void (VKAPI *PFN_vkCmdCopyQueryPoolResults)(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize destStride, VkFlags flags);
+typedef void (VKAPI *PFN_vkCmdCopyQueryPoolResults)(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize destStride, VkQueryResultFlags flags);
typedef void (VKAPI *PFN_vkCmdInitAtomicCounters)(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, uint32_t startCounter, uint32_t counterCount, const uint32_t* pData);
typedef void (VKAPI *PFN_vkCmdLoadAtomicCounters)(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, uint32_t startCounter, uint32_t counterCount, VkBuffer srcBuffer, VkDeviceSize srcOffset);
typedef void (VKAPI *PFN_vkCmdSaveAtomicCounters)(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, uint32_t startCounter, uint32_t counterCount, VkBuffer destBuffer, VkDeviceSize destOffset);
VkResult VKAPI vkQueueAddMemReferences(
VkQueue queue,
uint32_t count,
- const VkDeviceMemory* pMems);
+ const VkDeviceMemory* pMems);
VkResult VKAPI vkQueueRemoveMemReferences(
VkQueue queue,
uint32_t count,
- const VkDeviceMemory* pMems);
+ const VkDeviceMemory* pMems);
VkResult VKAPI vkQueueWaitIdle(
VkQueue queue);
VkResult VKAPI vkMapMemory(
VkDeviceMemory mem,
+ VkDeviceSize offset,
+ VkDeviceSize size,
VkMemoryMapFlags flags,
void** ppData);
size_t* pDataSize,
void* pData);
-// Memory namagement API functions
+// Memory management API functions
VkResult VKAPI vkQueueBindObjectMemory(
VkQueue queue,
uint32_t layoutChainSlot,
uint32_t count,
const VkDescriptorSet* pDescriptorSets,
- const uint32_t * pUserData);
+ const uint32_t* pUserData);
void VKAPI vkCmdBindIndexBuffer(
VkCmdBuffer cmdBuffer,
VkBuffer destBuffer,
VkDeviceSize destOffset,
VkDeviceSize destStride,
- VkFlags flags); // VkQueryResultFlags
+ VkQueryResultFlags flags);
void VKAPI vkCmdInitAtomicCounters(
VkCmdBuffer cmdBuffer,