Changeset bb76950 in opengl-game for sdl-game.cpp
- Timestamp:
- Jun 9, 2021, 6:41:48 PM (4 years ago)
- Branches:
- feature/imgui-sdl
- Children:
- b7fc3c2
- Parents:
- 6bac215
- git-author:
- Dmitry Portnoy <dportnoy@…> (06/09/21 18:41:20)
- git-committer:
- Dmitry Portnoy <dportnoy@…> (06/09/21 18:41:48)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sdl-game.cpp
r6bac215 rbb76950 459 459 if (objects_modelPipeline.resized) { 460 460 // TODO: Also resize the dynamic ubo 461 resizeBufferSet(storageBuffers_modelPipeline, objects_modelPipeline , modelPipeline, resourceCommandPool,462 graphicsQueue);461 resizeBufferSet(storageBuffers_modelPipeline, objects_modelPipeline.capacity * sizeof(SSBO_ModelObject), 462 resourceCommandPool, graphicsQueue, true); 463 463 464 464 objects_modelPipeline.resize(); 465 466 modelPipeline.updateDescriptorInfo(1, &storageBuffers_modelPipeline.infoSet, swapChainImages.size()); 465 467 } 466 468 … … 1130 1132 } 1131 1133 1134 void VulkanGame::resizeBufferSet(BufferSet& set, VkDeviceSize newSize, VkCommandPool commandPool, 1135 VkQueue graphicsQueue, bool copyData) { 1136 for (size_t i = 0; i < set.buffers.size(); i++) { 1137 VkBuffer newBuffer; 1138 VkDeviceMemory newMemory; 1139 1140 VulkanUtils::createBuffer(device, physicalDevice, newSize, set.usages, set.properties, newBuffer, newMemory); 1141 1142 if (copyData) { 1143 VulkanUtils::copyBuffer(device, commandPool, set.buffers[i], newBuffer, 0, 0, set.infoSet[i].range, 1144 graphicsQueue); 1145 } 1146 1147 vkDestroyBuffer(device, set.buffers[i], nullptr); 1148 vkFreeMemory(device, set.memory[i], nullptr); 1149 1150 set.buffers[i] = newBuffer; 1151 set.memory[i] = newMemory; 1152 1153 set.infoSet[i].buffer = set.buffers[i]; 1154 set.infoSet[i].offset = 0; // This is the offset from the start of the buffer, so always 0 for now 1155 set.infoSet[i].range = newSize; // Size of the update starting from offset, or VK_WHOLE_SIZE 1156 } 1157 } 1158 1132 1159 void VulkanGame::renderFrame(ImDrawData* draw_data) { 1133 1160 VkResult result = vkAcquireNextImageKHR(device, swapChain, numeric_limits<uint64_t>::max(),
Note:
See TracChangeset
for help on using the changeset viewer.