Changeset 5a1ace0 in opengl-game for vulkan-game.cpp
- 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-game.cpp
r4ece3bf r5a1ace0 197 197 modelPipeline.addAttribute(VK_FORMAT_R32G32B32_SFLOAT, offset_of(&ModelVertex::color)); 198 198 modelPipeline.addAttribute(VK_FORMAT_R32G32_SFLOAT, offset_of(&ModelVertex::texCoord)); 199 modelPipeline.addAttribute(VK_FORMAT_R32_UINT, offset_of(&ModelVertex::objIndex)); 199 200 200 201 createBufferSet(sizeof(UBO_VP_mats), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, … … 213 214 214 215 addObject(modelObjects, modelPipeline, 215 {216 addObjectIndex<ModelVertex>(modelObjects.size(), { 216 217 {{-0.5f, -0.5f, -2.0f}, {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f}}, 217 218 {{ 0.5f, -0.5f, -2.0f}, {0.0f, 1.0f, 0.0f}, {1.0f, 1.0f}}, 218 219 {{ 0.5f, 0.5f, -2.0f}, {0.0f, 0.0f, 1.0f}, {1.0f, 0.0f}}, 219 220 {{-0.5f, 0.5f, -2.0f}, {1.0f, 1.0f, 1.0f}, {0.0f, 0.0f}} 220 } , {221 }), { 221 222 0, 1, 2, 2, 3, 0 222 223 }); 223 224 224 225 addObject(modelObjects, modelPipeline, 225 {226 addObjectIndex<ModelVertex>(modelObjects.size(), { 226 227 {{-0.5f, -0.5f, -1.5f}, {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f}}, 227 228 {{ 0.5f, -0.5f, -1.5f}, {0.0f, 1.0f, 0.0f}, {1.0f, 1.0f}}, 228 229 {{ 0.5f, 0.5f, -1.5f}, {0.0f, 0.0f, 1.0f}, {1.0f, 0.0f}}, 229 230 {{-0.5f, 0.5f, -1.5f}, {1.0f, 1.0f, 1.0f}, {0.0f, 0.0f}} 230 } , {231 }), { 231 232 0, 1, 2, 2, 3, 0 232 233 }); … … 699 700 700 701 addObject(modelObjects, modelPipeline, 701 {702 addObjectIndex<ModelVertex>(modelObjects.size(), { 702 703 {{-0.5f, -0.5f, zOffset}, {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f}}, 703 704 {{ 0.5f, -0.5f, zOffset}, {0.0f, 1.0f, 0.0f}, {1.0f, 1.0f}}, 704 705 {{ 0.5f, 0.5f, zOffset}, {0.0f, 0.0f, 1.0f}, {1.0f, 0.0f}}, 705 706 {{-0.5f, 0.5f, zOffset}, {1.0f, 1.0f, 1.0f}, {0.0f, 0.0f}} 706 } , {707 }), { 707 708 0, 1, 2, 2, 3, 0 708 709 }); … … 774 775 so_Asteroid.model = asteroidObjects[0].model_transform * asteroidObjects[0].model_base; 775 776 776 VulkanUtils::copyDataToMemory(device, uniformBuffersMemory_scenePipeline[currentImage], object_VP_mats); 777 778 VulkanUtils::copyDataToMemory(device, storageBuffersMemory_scenePipeline[currentImage], so_Object); 779 780 VulkanUtils::copyDataToMemory(device, uniformBuffersMemory_shipPipeline[currentImage], ship_VP_mats); 781 782 VulkanUtils::copyDataToMemory(device, storageBuffersMemory_shipPipeline[currentImage], so_Ship); 783 784 VulkanUtils::copyDataToMemory(device, uniformBuffersMemory_asteroidPipeline[currentImage], asteroid_VP_mats); 785 786 VulkanUtils::copyDataToMemory(device, storageBuffersMemory_asteroidPipeline[currentImage], so_Asteroid); 777 VulkanUtils::copyDataToMemory(device, uniformBuffersMemory_scenePipeline[currentImage], 0, object_VP_mats); 778 779 for (size_t i = 0; i < modelObjects.size(); i++) { 780 VulkanUtils::copyDataToMemory(device, storageBuffersMemory_scenePipeline[currentImage], 781 i, so_Object); 782 } 783 784 VulkanUtils::copyDataToMemory(device, uniformBuffersMemory_shipPipeline[currentImage], 0, ship_VP_mats); 785 786 VulkanUtils::copyDataToMemory(device, storageBuffersMemory_shipPipeline[currentImage], 0, so_Ship); 787 788 VulkanUtils::copyDataToMemory(device, uniformBuffersMemory_asteroidPipeline[currentImage], 0, asteroid_VP_mats); 789 790 VulkanUtils::copyDataToMemory(device, storageBuffersMemory_asteroidPipeline[currentImage], 0, so_Asteroid); 787 791 } 788 792
Note:
See TracChangeset
for help on using the changeset viewer.