Changeset 5a1ace0 in opengl-game for vulkan-utils.hpp
- Timestamp:
- Feb 16, 2020, 8:18:50 PM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 2d87297
- Parents:
- 4ece3bf
- git-author:
- Dmitry Portnoy <dmitry.portnoy@…> (02/14/20 20:41:35)
- git-committer:
- Dmitry Portnoy <dmitry.portnoy@…> (02/16/20 20:18:50)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vulkan-utils.hpp
r4ece3bf r5a1ace0 95 95 96 96 template<class DataType> 97 static void copyDataToMemory(VkDevice device, VkDeviceMemory bufferMemory, const DataType& srcData); 97 static void copyDataToMemory(VkDevice device, VkDeviceMemory bufferMemory, VkDeviceSize offset, 98 const DataType& srcData); 98 99 99 100 static bool hasStencilComponent(VkFormat format); … … 125 126 } 126 127 127 // TODO: Change copyDataToMemory so it can accept offsets for the data source and destination128 128 template<class DataType> 129 void VulkanUtils::copyDataToMemory(VkDevice device, VkDeviceMemory bufferMemory, const DataType& srcData) { 129 void VulkanUtils::copyDataToMemory(VkDevice device, VkDeviceMemory bufferMemory, VkDeviceSize offset, 130 const DataType& srcData) { 130 131 void* data; 131 vkMapMemory(device, bufferMemory, 0, sizeof(DataType), 0, &data); 132 133 vkMapMemory(device, bufferMemory, offset * sizeof(DataType), sizeof(DataType), 0, &data); 132 134 memcpy(data, &srcData, sizeof(DataType)); 133 135 vkUnmapMemory(device, bufferMemory);
Note:
See TracChangeset
for help on using the changeset viewer.