Changeset 1abebc1 in opengl-game
- Timestamp:
- May 19, 2021, 4:49:43 PM (3 years ago)
- Branches:
- feature/imgui-sdl
- Children:
- c163d81
- Parents:
- a3cefaa
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
graphics-pipeline_vulkan.hpp
ra3cefaa r1abebc1 237 237 } 238 238 239 // TODO: Instead, assert that (bufferData->size() == swapChainImages.size() 239 240 if (bufferData->size() != swapChainImages.size()) { 240 241 cout << "ALERT ALERT ALERT: SIZE MISMATCH!!!!!!!" << endl; -
sdl-game.cpp
ra3cefaa r1abebc1 133 133 {{-0.5f, 0.5f, 0.0f}, {1.0f, 1.0f, 1.0f}, {0.0f, 0.0f}, {1.0f, 0.0f, 0.0f}, 0}, 134 134 {{-0.5f, -0.5f, 0.0f}, {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f}, {1.0f, 0.0f, 0.0f}, 0} 135 })), { 136 0, 1, 2, 3, 4, 5 135 })), 136 { 137 0, 1, 2, 3, 4, 5 137 138 }, { 138 139 mat4(1.0f) 139 } , storageBuffers_modelPipeline);140 }); 140 141 141 142 objects_modelPipeline.numObjects++; … … 158 159 }, { 159 160 mat4(1.0f) 160 } , storageBuffers_modelPipeline);161 }); 161 162 162 163 objects_modelPipeline.numObjects++; … … 378 379 {{-0.5f, 0.5f, 0.0f}, {1.0f, 1.0f, 1.0f}, {0.0f, 0.0f}, {1.0f, 0.0f, 0.0f}, 0}, 379 380 {{-0.5f, -0.5f, 0.0f}, {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f}, {1.0f, 0.0f, 0.0f}, 0} 380 })), { 381 0, 1, 2, 3, 4, 5 381 })), 382 { 383 0, 1, 2, 3, 4, 5 382 384 }, { 383 385 mat4(1.0f) 384 } , storageBuffers_modelPipeline);386 }); 385 387 386 388 objects_modelPipeline.numObjects++; … … 462 464 // TODO: Probably move the resizing to the VulkanBuffer class 463 465 if (objects_modelPipeline.numObjects > objects_modelPipeline.capacity) { 464 resizeStorageBufferSet(storageBuffers_modelPipeline, objects_modelPipeline, modelPipeline, resourceCommandPool, 465 graphicsQueue); 466 // TODO: Also resize the dynamic ubo 467 resizeBufferSet(storageBuffers_modelPipeline, objects_modelPipeline, modelPipeline, resourceCommandPool, 468 graphicsQueue); 466 469 } 467 470 468 471 for (size_t i = 0; i < modelObjects.size(); i++) { 469 472 if (modelObjects[i].modified) { 470 updateObject(modelObjects, modelPipeline, i); 471 updateStorageBuffer(storageBuffers_modelPipeline, i, modelObjects[i].ssbo); 473 updateObject(modelObjects[i]); 474 updateBufferSet(storageBuffers_modelPipeline, i, modelObjects[i].ssbo); 475 472 476 } 473 477 } -
sdl-game.hpp
ra3cefaa r1abebc1 79 79 // has a VkBuffer, VkDeviceMemory, and VkDescriptorBufferInfo 80 80 // TODO: Maybe change the structure here since VkDescriptorBufferInfo already stores a reference to the VkBuffer 81 struct StorageBufferSet {81 struct BufferSet { 82 82 vector<VkBuffer> buffers; 83 83 vector<VkDeviceMemory> memory; … … 220 220 GraphicsPipeline_Vulkan<ModelVertex> modelPipeline; 221 221 222 StorageBufferSet storageBuffers_modelPipeline;222 BufferSet storageBuffers_modelPipeline; 223 223 VulkanBuffer<SSBO_ModelObject> objects_modelPipeline; 224 224 … … 299 299 // TODO: Remove the need for templating, which is only there so a GraphicsPupeline_Vulkan can be passed in 300 300 template<class VertexType, class SSBOType> 301 void resize StorageBufferSet(StorageBufferSet& set, VulkanBuffer<SSBOType>& buffer,302 GraphicsPipeline_Vulkan<VertexType>& pipeline,303 VkCommandPool commandPool,VkQueue graphicsQueue);301 void resizeBufferSet(BufferSet& set, VulkanBuffer<SSBOType>& buffer, 302 GraphicsPipeline_Vulkan<VertexType>& pipeline, VkCommandPool commandPool, 303 VkQueue graphicsQueue); 304 304 305 305 template<class SSBOType> 306 void update StorageBuffer(StorageBufferSet& storageBufferSet, size_t objIndex, SSBOType& ssbo);306 void updateBufferSet(BufferSet& set, size_t objIndex, SSBOType& ssbo); 307 307 308 308 // TODO: Since addObject() returns a reference to the new object now, … … 312 312 GraphicsPipeline_Vulkan<VertexType>& pipeline, 313 313 const vector<VertexType>& vertices, vector<uint16_t> indices, 314 SSBOType ssbo , StorageBufferSet& storageBuffers);314 SSBOType ssbo); 315 315 316 316 template<class VertexType> … … 324 324 325 325 template<class VertexType, class SSBOType> 326 void updateObject(vector<SceneObject<VertexType, SSBOType>>& objects, 327 GraphicsPipeline_Vulkan<VertexType>& pipeline, size_t index); 326 void updateObject(SceneObject<VertexType, SSBOType>& obj); 328 327 329 328 void renderFrame(ImDrawData* draw_data); … … 347 346 348 347 template<class VertexType, class SSBOType> 349 void VulkanGame::resize StorageBufferSet(StorageBufferSet& set, VulkanBuffer<SSBOType>& buffer,350 GraphicsPipeline_Vulkan<VertexType>& pipeline,351 VkCommandPool commandPool,VkQueue graphicsQueue) {348 void VulkanGame::resizeBufferSet(BufferSet& set, VulkanBuffer<SSBOType>& buffer, 349 GraphicsPipeline_Vulkan<VertexType>& pipeline, VkCommandPool commandPool, 350 VkQueue graphicsQueue) { 352 351 size_t numObjects = buffer.numObjects < buffer.capacity ? buffer.numObjects : buffer.capacity; 353 352 … … 388 387 // TODO: See if it makes sense to pass in the current swapchain index instead of updating all of them 389 388 template<class SSBOType> 390 void VulkanGame::update StorageBuffer(StorageBufferSet& storageBufferSet, size_t objIndex, SSBOType& ssbo) {391 for (size_t i = 0; i < s torageBufferSet.memory.size(); i++) {392 VulkanUtils::copyDataToMemory(device, ssbo, s torageBufferSet.memory[i], objIndex * sizeof(SSBOType));389 void VulkanGame::updateBufferSet(BufferSet& set, size_t objIndex, SSBOType& ssbo) { 390 for (size_t i = 0; i < set.memory.size(); i++) { 391 VulkanUtils::copyDataToMemory(device, ssbo, set.memory[i], objIndex * sizeof(SSBOType)); 393 392 } 394 393 } … … 401 400 GraphicsPipeline_Vulkan<VertexType>& pipeline, 402 401 const vector<VertexType>& vertices, vector<uint16_t> indices, 403 SSBOType ssbo , StorageBufferSet& storageBuffers) {402 SSBOType ssbo) { 404 403 // TODO: Use the model field of ssbo to set the object's model_base 405 404 // currently, the passed in model is useless since it gets overridden in updateObject() anyway … … 504 503 // TODO: Just pass in the single object instead of a list of all of them 505 504 template<class VertexType, class SSBOType> 506 void VulkanGame::updateObject(vector<SceneObject<VertexType, SSBOType>>& objects, 507 GraphicsPipeline_Vulkan<VertexType>& pipeline, size_t index) { 508 SceneObject<VertexType, SSBOType>& obj = objects[index]; 509 505 void VulkanGame::updateObject(SceneObject<VertexType, SSBOType>& obj) { 510 506 obj.ssbo.model = obj.model_transform * obj.model_base; 511 507 obj.center = vec3(obj.ssbo.model * vec4(0.0f, 0.0f, 0.0f, 1.0f)); -
vulkan-buffer.hpp
ra3cefaa r1abebc1 29 29 T* data(); 30 30 void* mappedData(); // TODO: Maybe rename this to just mapped() 31 32 // TODO: Add a resize function 31 33 32 34 private: -
vulkan-game.cpp
ra3cefaa r1abebc1 157 157 {{-0.5f, 0.5f, 0.0f}, {1.0f, 1.0f, 1.0f}, {0.0f, 0.0f}}, 158 158 {{-0.5f, -0.5f, 0.0f}, {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f}} 159 })), { 160 0, 1, 2, 3, 4, 5 161 }, { 162 mat4(1.0f) 163 }, storageBuffers_modelPipeline); 159 })), 160 { 161 0, 1, 2, 3, 4, 5 162 }, { 163 mat4(1.0f) 164 }); 164 165 165 166 objects_modelPipeline.numObjects++; … … 178 179 {{-0.5f, 0.5f, 0.0f}, {1.0f, 1.0f, 1.0f}, {0.0f, 0.0f}}, 179 180 {{-0.5f, -0.5f, 0.0f}, {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f}} 180 })), { 181 0, 1, 2, 3, 4, 5 182 }, { 183 mat4(1.0f) 184 }, storageBuffers_modelPipeline); 181 })), 182 { 183 0, 1, 2, 3, 4, 5 184 }, { 185 mat4(1.0f) 186 }); 185 187 186 188 objects_modelPipeline.numObjects++; … … 412 414 {{ 1.5f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.3f}}, 413 415 {{ 1.3f, 0.0f, -0.3f}, {0.0f, 0.0f, 0.3f}}, 414 })), { 415 0, 1, 2, 3, 4, 5, 416 6, 7, 8, 9, 10, 11, 417 12, 13, 14, 15, 16, 17, 418 18, 19, 20, 21, 22, 23, 419 24, 25, 26, 27, 28, 29, 420 30, 31, 32, 421 33, 34, 35, 422 36, 37, 38, 39, 40, 41, 423 42, 43, 44, 45, 46, 47, 424 48, 49, 50, 51, 52, 53, 425 54, 55, 56, 57, 58, 59, 426 60, 61, 62, 427 63, 64, 65, 428 66, 67, 68, 69, 70, 71, 429 72, 73, 74, 75, 76, 77, 430 78, 79, 80, 81, 82, 83, 431 84, 85, 86, 87, 88, 89, 432 90, 91, 92, 433 93, 94, 95, 434 96, 97, 98, 435 99, 100, 101, 436 102, 103, 104, 105, 106, 107, 437 108, 109, 110, 111, 112, 113, 438 114, 115, 116, 117, 118, 119, 439 120, 121, 122, 123, 124, 125, 440 126, 127, 128, 441 129, 130, 131, 442 132, 133, 134, 443 135, 136, 137, 416 })), 417 { 418 0, 1, 2, 3, 4, 5, 419 6, 7, 8, 9, 10, 11, 420 12, 13, 14, 15, 16, 17, 421 18, 19, 20, 21, 22, 23, 422 24, 25, 26, 27, 28, 29, 423 30, 31, 32, 424 33, 34, 35, 425 36, 37, 38, 39, 40, 41, 426 42, 43, 44, 45, 46, 47, 427 48, 49, 50, 51, 52, 53, 428 54, 55, 56, 57, 58, 59, 429 60, 61, 62, 430 63, 64, 65, 431 66, 67, 68, 69, 70, 71, 432 72, 73, 74, 75, 76, 77, 433 78, 79, 80, 81, 82, 83, 434 84, 85, 86, 87, 88, 89, 435 90, 91, 92, 436 93, 94, 95, 437 96, 97, 98, 438 99, 100, 101, 439 102, 103, 104, 105, 106, 107, 440 108, 109, 110, 111, 112, 113, 441 114, 115, 116, 117, 118, 119, 442 120, 121, 122, 123, 124, 125, 443 126, 127, 128, 444 129, 130, 131, 445 132, 133, 134, 446 135, 136, 137, 444 447 }, { 445 448 mat4(1.0f) 446 } , storageBuffers_shipPipeline);449 }); 447 450 448 451 objects_shipPipeline.numObjects++; … … 780 783 {{-0.5f, 0.5f, 0.0f}, {1.0f, 1.0f, 1.0f}, {0.0f, 0.0f}}, 781 784 {{-0.5f, -0.5f, 0.0f}, {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f}} 782 })), { 783 0, 1, 2, 3, 4, 5 784 }, { 785 mat4(1.0f) 786 }, storageBuffers_modelPipeline); 785 })), 786 { 787 0, 1, 2, 3, 4, 5 788 }, { 789 mat4(1.0f) 790 }); 787 791 788 792 objects_modelPipeline.numObjects++; … … 1056 1060 {{-1.0f, -1.0f, -1.0f}, {0.4f, 0.4f, 0.4f}}, 1057 1061 {{-1.0f, -1.0f, 1.0f}, {0.4f, 0.4f, 0.4f}}, 1058 })), { 1059 0, 1, 2, 3, 4, 5, 1060 6, 7, 8, 9, 10, 11, 1061 12, 13, 14, 15, 16, 17, 1062 18, 19, 20, 21, 22, 23, 1063 24, 25, 26, 27, 28, 29, 1064 30, 31, 32, 33, 34, 35, 1065 }, { 1066 mat4(1.0f), 1067 10.0f, 1068 false 1069 }, storageBuffers_asteroidPipeline); 1062 })), 1063 { 1064 0, 1, 2, 3, 4, 5, 1065 6, 7, 8, 9, 10, 11, 1066 12, 13, 14, 15, 16, 17, 1067 18, 19, 20, 21, 22, 23, 1068 24, 25, 26, 27, 28, 29, 1069 30, 31, 32, 33, 34, 35, 1070 }, { 1071 mat4(1.0f), 1072 10.0f, 1073 false 1074 }); 1070 1075 1071 1076 objects_asteroidPipeline.numObjects++; … … 1096 1101 // TODO: Probably move the resizing to the VulkanBuffer class 1097 1102 if (objects_modelPipeline.numObjects > objects_modelPipeline.capacity) { 1098 resize StorageBufferSet(storageBuffers_modelPipeline, objects_modelPipeline, modelPipeline, resourceCommandPool,1099 1103 resizeBufferSet(storageBuffers_modelPipeline, objects_modelPipeline, modelPipeline, resourceCommandPool, 1104 graphicsQueue); 1100 1105 } 1101 1106 1102 1107 for (size_t i = 0; i < modelObjects.size(); i++) { 1103 1108 if (modelObjects[i].modified) { 1104 updateObject(modelObjects , modelPipeline, i);1105 update StorageBuffer(storageBuffers_modelPipeline, i, modelObjects[i].ssbo);1109 updateObject(modelObjects[i]); 1110 updateBufferSet(storageBuffers_modelPipeline, i, modelObjects[i].ssbo); 1106 1111 } 1107 1112 } … … 1109 1114 // TODO: Probably move the resizing to the VulkanBuffer class 1110 1115 if (objects_shipPipeline.numObjects > objects_shipPipeline.capacity) { 1111 resize StorageBufferSet(storageBuffers_shipPipeline, objects_shipPipeline, shipPipeline, resourceCommandPool,1112 1116 resizeBufferSet(storageBuffers_shipPipeline, objects_shipPipeline, shipPipeline, resourceCommandPool, 1117 graphicsQueue); 1113 1118 } 1114 1119 1115 1120 for (size_t i = 0; i < shipObjects.size(); i++) { 1116 1121 if (shipObjects[i].modified) { 1117 updateObject(shipObjects , shipPipeline, i);1118 update StorageBuffer(storageBuffers_shipPipeline, i, shipObjects[i].ssbo);1122 updateObject(shipObjects[i]); 1123 updateBufferSet(storageBuffers_shipPipeline, i, shipObjects[i].ssbo); 1119 1124 } 1120 1125 } … … 1122 1127 // TODO: Probably move the resizing to the VulkanBuffer class 1123 1128 if (objects_asteroidPipeline.numObjects > objects_asteroidPipeline.capacity) { 1124 resize StorageBufferSet(storageBuffers_asteroidPipeline, objects_asteroidPipeline, asteroidPipeline,1125 1129 resizeBufferSet(storageBuffers_asteroidPipeline, objects_asteroidPipeline, asteroidPipeline, 1130 resourceCommandPool, graphicsQueue); 1126 1131 } 1127 1132 1128 1133 for (size_t i = 0; i < asteroidObjects.size(); i++) { 1129 1134 if (asteroidObjects[i].modified) { 1130 updateObject(asteroidObjects , asteroidPipeline, i);1131 update StorageBuffer(storageBuffers_asteroidPipeline, i, asteroidObjects[i].ssbo);1135 updateObject(asteroidObjects[i]); 1136 updateBufferSet(storageBuffers_asteroidPipeline, i, asteroidObjects[i].ssbo); 1132 1137 } 1133 1138 } … … 1135 1140 // TODO: Probably move the resizing to the VulkanBuffer class 1136 1141 if (objects_laserPipeline.numObjects > objects_laserPipeline.capacity) { 1137 resize StorageBufferSet(storageBuffers_laserPipeline, objects_laserPipeline, laserPipeline, resourceCommandPool,1138 1142 resizeBufferSet(storageBuffers_laserPipeline, objects_laserPipeline, laserPipeline, resourceCommandPool, 1143 graphicsQueue); 1139 1144 } 1140 1145 1141 1146 for (size_t i = 0; i < laserObjects.size(); i++) { 1142 1147 if (laserObjects[i].modified) { 1143 updateObject(laserObjects , laserPipeline, i);1144 update StorageBuffer(storageBuffers_laserPipeline, i, laserObjects[i].ssbo);1148 updateObject(laserObjects[i]); 1149 updateBufferSet(storageBuffers_laserPipeline, i, laserObjects[i].ssbo); 1145 1150 } 1146 1151 } … … 1148 1153 // TODO: Probably move the resizing to the VulkanBuffer class 1149 1154 if (objects_explosionPipeline.numObjects > objects_explosionPipeline.capacity) { 1150 resize StorageBufferSet(storageBuffers_explosionPipeline, objects_explosionPipeline, explosionPipeline,1151 1155 resizeBufferSet(storageBuffers_explosionPipeline, objects_explosionPipeline, explosionPipeline, 1156 resourceCommandPool, graphicsQueue); 1152 1157 } 1153 1158 1154 1159 for (size_t i = 0; i < explosionObjects.size(); i++) { 1155 1160 if (explosionObjects[i].modified) { 1156 updateObject(explosionObjects , explosionPipeline, i);1157 update StorageBuffer(storageBuffers_explosionPipeline, i, explosionObjects[i].ssbo);1161 updateObject(explosionObjects[i]); 1162 updateBufferSet(storageBuffers_explosionPipeline, i, explosionObjects[i].ssbo); 1158 1163 } 1159 1164 } … … 1976 1981 color, 1977 1982 false 1978 } , storageBuffers_laserPipeline);1983 }); 1979 1984 1980 1985 objects_laserPipeline.numObjects++; … … 2181 2186 2182 2187 SceneObject<ExplosionVertex, SSBO_Explosion>& explosion = addObject( 2183 explosionObjects, explosionPipeline, 2184 addObjectIndex(explosionObjects.size(), vertices), 2185 indices, { 2188 explosionObjects, explosionPipeline, addObjectIndex(explosionObjects.size(), vertices), indices, { 2186 2189 mat4(1.0f), 2187 2190 cur_time, 2188 2191 duration, 2189 2192 false 2190 } , storageBuffers_explosionPipeline);2193 }); 2191 2194 2192 2195 objects_explosionPipeline.numObjects++; -
vulkan-game.hpp
ra3cefaa r1abebc1 103 103 // has a VkBuffer, VkDeviceMemory, and VkDescriptorBufferInfo 104 104 // TODO: Maybe change the structure here since VkDescriptorBufferInfo already stores a reference to the VkBuffer 105 struct StorageBufferSet {105 struct BufferSet { 106 106 vector<VkBuffer> buffers; 107 107 vector<VkDeviceMemory> memory; … … 317 317 GraphicsPipeline_Vulkan<ExplosionVertex> explosionPipeline; 318 318 319 StorageBufferSet storageBuffers_modelPipeline;319 BufferSet storageBuffers_modelPipeline; 320 320 VulkanBuffer<SSBO_ModelObject> objects_modelPipeline; 321 321 322 StorageBufferSet storageBuffers_shipPipeline;322 BufferSet storageBuffers_shipPipeline; 323 323 VulkanBuffer<SSBO_ModelObject> objects_shipPipeline; 324 324 325 StorageBufferSet storageBuffers_asteroidPipeline;325 BufferSet storageBuffers_asteroidPipeline; 326 326 VulkanBuffer<SSBO_Asteroid> objects_asteroidPipeline; 327 327 328 StorageBufferSet storageBuffers_laserPipeline;328 BufferSet storageBuffers_laserPipeline; 329 329 VulkanBuffer<SSBO_Laser> objects_laserPipeline; 330 330 331 StorageBufferSet storageBuffers_explosionPipeline;331 BufferSet storageBuffers_explosionPipeline; 332 332 VulkanBuffer<SSBO_Explosion> objects_explosionPipeline; 333 333 … … 454 454 // TODO: Remove the need for templating, which is only there so a GraphicsPupeline_Vulkan can be passed in 455 455 template<class VertexType, class SSBOType> 456 void resize StorageBufferSet(StorageBufferSet& set, VulkanBuffer<SSBOType>& buffer,457 GraphicsPipeline_Vulkan<VertexType>& pipeline,458 VkCommandPool commandPool,VkQueue graphicsQueue);456 void resizeBufferSet(BufferSet& set, VulkanBuffer<SSBOType>& buffer, 457 GraphicsPipeline_Vulkan<VertexType>& pipeline, VkCommandPool commandPool, 458 VkQueue graphicsQueue); 459 459 460 460 template<class SSBOType> 461 void update StorageBuffer(StorageBufferSet& storageBufferSet, size_t objIndex, SSBOType& ssbo);461 void updateBufferSet(BufferSet& set, size_t objIndex, SSBOType& ssbo); 462 462 463 463 // TODO: Since addObject() returns a reference to the new object now, … … 467 467 GraphicsPipeline_Vulkan<VertexType>& pipeline, 468 468 const vector<VertexType>& vertices, vector<uint16_t> indices, 469 SSBOType ssbo , StorageBufferSet& storageBuffers);469 SSBOType ssbo); 470 470 471 471 template<class VertexType> … … 479 479 480 480 template<class VertexType, class SSBOType> 481 void updateObject(vector<SceneObject<VertexType, SSBOType>>& objects, 482 GraphicsPipeline_Vulkan<VertexType>& pipeline, size_t index); 481 void updateObject(SceneObject<VertexType, SSBOType>& obj); 483 482 484 483 template<class VertexType, class SSBOType> … … 522 521 523 522 template<class VertexType, class SSBOType> 524 void VulkanGame::resize StorageBufferSet(StorageBufferSet& set, VulkanBuffer<SSBOType>& buffer,525 GraphicsPipeline_Vulkan<VertexType>& pipeline,526 VkCommandPool commandPool,VkQueue graphicsQueue) {523 void VulkanGame::resizeBufferSet(BufferSet& set, VulkanBuffer<SSBOType>& buffer, 524 GraphicsPipeline_Vulkan<VertexType>& pipeline, VkCommandPool commandPool, 525 VkQueue graphicsQueue) { 527 526 size_t numObjects = buffer.numObjects < buffer.capacity ? buffer.numObjects : buffer.capacity; 528 527 … … 563 562 // TODO: See if it makes sense to pass in the current swapchain index instead of updating all of them 564 563 template<class SSBOType> 565 void VulkanGame::update StorageBuffer(StorageBufferSet& storageBufferSet, size_t objIndex, SSBOType& ssbo) {566 for (size_t i = 0; i < s torageBufferSet.memory.size(); i++) {567 VulkanUtils::copyDataToMemory(device, ssbo, s torageBufferSet.memory[i], objIndex * sizeof(SSBOType));564 void VulkanGame::updateBufferSet(BufferSet& set, size_t objIndex, SSBOType& ssbo) { 565 for (size_t i = 0; i < set.memory.size(); i++) { 566 VulkanUtils::copyDataToMemory(device, ssbo, set.memory[i], objIndex * sizeof(SSBOType)); 568 567 } 569 568 } … … 576 575 GraphicsPipeline_Vulkan<VertexType>& pipeline, 577 576 const vector<VertexType>& vertices, vector<uint16_t> indices, 578 SSBOType ssbo , StorageBufferSet& storageBuffers) {577 SSBOType ssbo) { 579 578 // TODO: Use the model field of ssbo to set the object's model_base 580 579 // currently, the passed in model is useless since it gets overridden in updateObject() anyway … … 684 683 // TODO: Just pass in the single object instead of a list of all of them 685 684 template<class VertexType, class SSBOType> 686 void VulkanGame::updateObject(vector<SceneObject<VertexType, SSBOType>>& objects, 687 GraphicsPipeline_Vulkan<VertexType>& pipeline, size_t index) { 688 SceneObject<VertexType, SSBOType>& obj = objects[index]; 689 685 void VulkanGame::updateObject(SceneObject<VertexType, SSBOType>& obj) { 690 686 obj.ssbo.model = obj.model_transform * obj.model_base; 691 687 obj.center = vec3(obj.ssbo.model * vec4(0.0f, 0.0f, 0.0f, 1.0f));
Note:
See TracChangeset
for help on using the changeset viewer.