Changeset 8e02b6b in opengl-game for vulkan-utils.hpp
- Timestamp:
- Nov 22, 2019, 6:27:13 PM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- f97c5e7
- Parents:
- 683dd55
- git-author:
- Dmitry Portnoy <dmitry.portnoy@…> (11/22/19 18:26:59)
- git-committer:
- Dmitry Portnoy <dmitry.portnoy@…> (11/22/19 18:27:13)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vulkan-utils.hpp
r683dd55 r8e02b6b 94 94 VkDeviceSize srcOffset, VkDeviceSize dstOffset, VkDeviceSize size, VkQueue graphicsQueue); 95 95 96 template<class DataType> 97 static void copyDataToMemory(VkDevice device, VkDeviceMemory bufferMemory, const DataType& srcData); 98 96 99 static bool hasStencilComponent(VkFormat format); 97 100 … … 122 125 } 123 126 127 template<class DataType> 128 void VulkanUtils::copyDataToMemory(VkDevice device, VkDeviceMemory bufferMemory, const DataType& srcData) { 129 void* data; 130 vkMapMemory(device, bufferMemory, 0, sizeof(DataType), 0, &data); 131 memcpy(data, &srcData, sizeof(DataType)); 132 vkUnmapMemory(device, bufferMemory); 133 } 134 124 135 #endif // _VULKAN_UTILS_H
Note:
See TracChangeset
for help on using the changeset viewer.