source: opengl-game/vulkan-game.hpp@ a00eb06

feature/imgui-sdl
Last change on this file since a00eb06 was a00eb06, checked in by Dmitry Portnoy <dportnoy@…>, 3 years ago

In VulkanGame, add a normal varying attribute to ModelVertex

  • Property mode set to 100644
File size: 21.3 KB
Line 
1#ifndef _VULKAN_GAME_H
2#define _VULKAN_GAME_H
3
4#include <algorithm>
5#include <chrono>
6#include <map>
7#include <vector>
8
9#include <vulkan/vulkan.h>
10
11#include <SDL2/SDL.h>
12#include <SDL2/SDL_ttf.h>
13
14#define GLM_FORCE_RADIANS
15#define GLM_FORCE_DEPTH_ZERO_TO_ONE // Since, in Vulkan, the depth range is 0 to 1 instead of -1 to 1
16#define GLM_FORCE_RIGHT_HANDED
17
18#include <glm/glm.hpp>
19#include <glm/gtc/matrix_transform.hpp>
20
21#include "IMGUI/imgui_impl_vulkan.h"
22
23#include "consts.hpp"
24#include "vulkan-utils.hpp"
25#include "graphics-pipeline_vulkan.hpp"
26#include "game-gui-sdl.hpp"
27
28using namespace glm;
29using namespace std::chrono;
30
31#ifdef NDEBUG
32 const bool ENABLE_VALIDATION_LAYERS = false;
33#else
34 const bool ENABLE_VALIDATION_LAYERS = true;
35#endif
36
37// TODO: Consider if there is a better way of dealing with all the vertex types and ssbo types, maybe
38// by consolidating some and trying to keep new ones to a minimum
39
40struct OverlayVertex {
41 vec3 pos;
42 vec2 texCoord;
43};
44
45struct ModelVertex {
46 vec3 pos;
47 vec3 color;
48 vec2 texCoord;
49 vec3 normal;
50 unsigned int objIndex;
51};
52
53struct ShipVertex {
54 vec3 pos;
55 vec3 color;
56 vec3 normal;
57 unsigned int objIndex;
58};
59
60struct AsteroidVertex {
61 vec3 pos;
62 vec3 color;
63 vec3 normal;
64 unsigned int objIndex;
65};
66
67struct LaserVertex {
68 vec3 pos;
69 vec2 texCoord;
70 unsigned int objIndex;
71};
72
73struct ExplosionVertex {
74 vec3 particleStartVelocity;
75 float particleStartTime;
76 unsigned int objIndex;
77};
78
79struct SSBO_ModelObject {
80 alignas(16) mat4 model;
81};
82
83struct SSBO_Asteroid {
84 alignas(16) mat4 model;
85 alignas(4) float hp;
86 alignas(4) unsigned int deleted;
87};
88
89struct SSBO_Laser {
90 alignas(16) mat4 model;
91 alignas(4) vec3 color;
92 alignas(4) unsigned int deleted;
93};
94
95struct SSBO_Explosion {
96 alignas(16) mat4 model;
97 alignas(4) float explosionStartTime;
98 alignas(4) float explosionDuration;
99 alignas(4) unsigned int deleted;
100};
101
102struct UBO_VP_mats {
103 alignas(16) mat4 view;
104 alignas(16) mat4 proj;
105};
106
107struct UBO_Explosion {
108 alignas(16) mat4 view;
109 alignas(16) mat4 proj;
110 alignas(4) float cur_time;
111};
112
113// TODO: Change the index type to uint32_t and check the Vulkan Tutorial loading model section as a reference
114// TODO: Create a typedef for index type so I can easily change uin16_t to something else later
115// TODO: Maybe create a typedef for each of the templated SceneObject types
116template<class VertexType, class SSBOType>
117struct SceneObject {
118 vector<VertexType> vertices;
119 vector<uint16_t> indices;
120 SSBOType ssbo;
121
122 mat4 model_base;
123 mat4 model_transform;
124
125 bool modified;
126
127 // TODO: Figure out if I should make child classes that have these fields instead of putting them in the
128 // parent class
129 vec3 center; // currently only matters for asteroids
130 float radius; // currently only matters for asteroids
131 SceneObject<AsteroidVertex, SSBO_Asteroid>* targetAsteroid; // currently only used for lasers
132};
133
134// TODO: Have to figure out how to include an optional ssbo parameter for each object
135// Could probably use the same approach to make indices optional
136// Figure out if there are sufficient use cases to make either of these optional or is it fine to make
137// them mamdatory
138
139
140// TODO: Look into using dynamic_cast to check types of SceneObject and EffectOverTime
141
142struct BaseEffectOverTime {
143 bool deleted;
144
145 virtual void applyEffect(float curTime) = 0;
146
147 BaseEffectOverTime() :
148 deleted(false) {
149 }
150
151 virtual ~BaseEffectOverTime() {
152 }
153};
154
155template<class VertexType, class SSBOType>
156struct EffectOverTime : public BaseEffectOverTime {
157 GraphicsPipeline_Vulkan<VertexType, SSBOType>& pipeline;
158 vector<SceneObject<VertexType, SSBOType>>& objects;
159 unsigned int objectIndex;
160 size_t effectedFieldOffset;
161 float startValue;
162 float startTime;
163 float changePerSecond;
164
165 EffectOverTime(GraphicsPipeline_Vulkan<VertexType, SSBOType>& pipeline,
166 vector<SceneObject<VertexType, SSBOType>>& objects, unsigned int objectIndex,
167 size_t effectedFieldOffset, float startTime, float changePerSecond) :
168 pipeline(pipeline),
169 objects(objects),
170 objectIndex(objectIndex),
171 effectedFieldOffset(effectedFieldOffset),
172 startTime(startTime),
173 changePerSecond(changePerSecond) {
174 size_t ssboOffset = offset_of(&SceneObject<VertexType, SSBOType>::ssbo);
175
176 unsigned char* effectedFieldPtr = reinterpret_cast<unsigned char*>(&objects[objectIndex]) +
177 ssboOffset + effectedFieldOffset;
178
179 startValue = *reinterpret_cast<float*>(effectedFieldPtr);
180 }
181
182 void applyEffect(float curTime) {
183 if (objects[objectIndex].ssbo.deleted) {
184 this->deleted = true;
185 return;
186 }
187
188 size_t ssboOffset = offset_of(&SceneObject<VertexType, SSBOType>::ssbo);
189
190 unsigned char* effectedFieldPtr = reinterpret_cast<unsigned char*>(&objects[objectIndex]) +
191 ssboOffset + effectedFieldOffset;
192
193 *reinterpret_cast<float*>(effectedFieldPtr) = startValue + (curTime - startTime) * changePerSecond;
194
195 objects[objectIndex].modified = true;
196 }
197};
198
199// TODO: Maybe move this to a different header
200
201enum UIValueType {
202 UIVALUE_INT,
203 UIVALUE_DOUBLE,
204};
205
206struct UIValue {
207 UIValueType type;
208 string label;
209 void* value;
210
211 UIValue(UIValueType _type, string _label, void* _value) : type(_type), label(_label), value(_value) {}
212};
213
214class VulkanGame {
215
216 public:
217
218 VulkanGame();
219 ~VulkanGame();
220
221 void run(int width, int height, unsigned char guiFlags);
222
223 private:
224
225 static VKAPI_ATTR VkBool32 VKAPI_CALL debugCallback(
226 VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
227 VkDebugUtilsMessageTypeFlagsEXT messageType,
228 const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData,
229 void* pUserData);
230
231 // TODO: Maybe pass these in as parameters to some Camera class
232 const float NEAR_CLIP = 0.1f;
233 const float FAR_CLIP = 100.0f;
234 const float FOV_ANGLE = 67.0f; // means the camera lens goes from -33 deg to 33 deg
235
236 const int EXPLOSION_PARTICLE_COUNT = 300;
237 const vec3 LASER_COLOR = vec3(0.2f, 1.0f, 0.2f);
238
239 bool done;
240
241 vec3 cam_pos;
242
243 // TODO: Good place to start using smart pointers
244 GameGui* gui;
245
246 SDL_version sdlVersion;
247 SDL_Window* window = nullptr;
248
249 int drawableWidth, drawableHeight;
250
251 VkInstance instance;
252 VkDebugUtilsMessengerEXT debugMessenger;
253 VkSurfaceKHR vulkanSurface;
254 VkPhysicalDevice physicalDevice = VK_NULL_HANDLE;
255 VkDevice device;
256
257 VkQueue graphicsQueue;
258 VkQueue presentQueue;
259
260 // TODO: Maybe make a swapchain struct for convenience
261 VkSurfaceFormatKHR swapChainSurfaceFormat;
262 VkPresentModeKHR swapChainPresentMode;
263 VkExtent2D swapChainExtent;
264 uint32_t swapChainMinImageCount;
265 uint32_t swapChainImageCount;
266 VkSwapchainKHR swapChain;
267 vector<VkImage> swapChainImages;
268 vector<VkImageView> swapChainImageViews;
269 vector<VkFramebuffer> swapChainFramebuffers;
270
271 VkRenderPass renderPass;
272
273 VkCommandPool resourceCommandPool;
274
275 vector<VkCommandPool> commandPools;
276 vector<VkCommandBuffer> commandBuffers;
277
278 VulkanImage depthImage;
279
280 // These are per frame
281 vector<VkSemaphore> imageAcquiredSemaphores;
282 vector<VkSemaphore> renderCompleteSemaphores;
283
284 // These are per swap chain image
285 vector<VkFence> inFlightFences;
286
287 uint32_t imageIndex;
288 uint32_t currentFrame;
289
290 bool shouldRecreateSwapChain;
291
292 VkSampler textureSampler;
293
294 VulkanImage floorTextureImage;
295 VkDescriptorImageInfo floorTextureImageDescriptor;
296
297 VulkanImage laserTextureImage;
298 VkDescriptorImageInfo laserTextureImageDescriptor;
299
300 mat4 viewMat, projMat;
301
302 // Maybe at some point create an imgui pipeline class, but I don't think it makes sense right now
303 VkDescriptorPool imguiDescriptorPool;
304
305 // TODO: Probably restructure the GraphicsPipeline_Vulkan class based on what I learned about descriptors and textures
306 // while working on graphics-library. Double-check exactly what this was and note it down here.
307 // Basically, I think the point was that if I have several modesl that all use the same shaders and, therefore,
308 // the same pipeline, but use different textures, the approach I took when initially creating GraphicsPipeline_Vulkan
309 // wouldn't work since the whole pipeline couldn't have a common set of descriptors for the textures
310 GraphicsPipeline_Vulkan<ModelVertex, SSBO_ModelObject> modelPipeline;
311 GraphicsPipeline_Vulkan<ShipVertex, SSBO_ModelObject> shipPipeline;
312 GraphicsPipeline_Vulkan<AsteroidVertex, SSBO_Asteroid> asteroidPipeline;
313 GraphicsPipeline_Vulkan<LaserVertex, SSBO_Laser> laserPipeline;
314 GraphicsPipeline_Vulkan<ExplosionVertex, SSBO_Explosion> explosionPipeline;
315
316 // TODO: Maybe make the ubo objects part of the pipeline class since there's only one ubo
317 // per pipeline.
318 // Or maybe create a higher level wrapper around GraphicsPipeline_Vulkan to hold things like
319 // the objects vector, the ubo, and the ssbo
320
321 // TODO: Rename *_VP_mats to *_uniforms and possibly use different types for each one
322 // if there is a need to add other uniform variables to one or more of the shaders
323
324 vector<SceneObject<ModelVertex, SSBO_ModelObject>> modelObjects;
325
326 vector<VkBuffer> uniformBuffers_modelPipeline;
327 vector<VkDeviceMemory> uniformBuffersMemory_modelPipeline;
328 vector<VkDescriptorBufferInfo> uniformBufferInfoList_modelPipeline;
329
330 UBO_VP_mats object_VP_mats;
331
332 vector<SceneObject<ShipVertex, SSBO_ModelObject>> shipObjects;
333
334 vector<VkBuffer> uniformBuffers_shipPipeline;
335 vector<VkDeviceMemory> uniformBuffersMemory_shipPipeline;
336 vector<VkDescriptorBufferInfo> uniformBufferInfoList_shipPipeline;
337
338 UBO_VP_mats ship_VP_mats;
339
340 vector<SceneObject<AsteroidVertex, SSBO_Asteroid>> asteroidObjects;
341
342 vector<VkBuffer> uniformBuffers_asteroidPipeline;
343 vector<VkDeviceMemory> uniformBuffersMemory_asteroidPipeline;
344 vector<VkDescriptorBufferInfo> uniformBufferInfoList_asteroidPipeline;
345
346 UBO_VP_mats asteroid_VP_mats;
347
348 vector<SceneObject<LaserVertex, SSBO_Laser>> laserObjects;
349
350 vector<VkBuffer> uniformBuffers_laserPipeline;
351 vector<VkDeviceMemory> uniformBuffersMemory_laserPipeline;
352 vector<VkDescriptorBufferInfo> uniformBufferInfoList_laserPipeline;
353
354 UBO_VP_mats laser_VP_mats;
355
356 vector<SceneObject<ExplosionVertex, SSBO_Explosion>> explosionObjects;
357
358 vector<VkBuffer> uniformBuffers_explosionPipeline;
359 vector<VkDeviceMemory> uniformBuffersMemory_explosionPipeline;
360 vector<VkDescriptorBufferInfo> uniformBufferInfoList_explosionPipeline;
361
362 UBO_Explosion explosion_UBO;
363
364 vector<BaseEffectOverTime*> effects;
365
366 float shipSpeed = 0.5f;
367 float asteroidSpeed = 2.0f;
368
369 float spawnRate_asteroid = 0.5;
370 float lastSpawn_asteroid;
371
372 unsigned int leftLaserIdx = -1;
373 EffectOverTime<AsteroidVertex, SSBO_Asteroid>* leftLaserEffect = nullptr;
374
375 unsigned int rightLaserIdx = -1;
376 EffectOverTime<AsteroidVertex, SSBO_Asteroid>* rightLaserEffect = nullptr;
377
378 /*** High-level vars ***/
379
380 // TODO: Just typedef the type of this function to RenderScreenFn or something since it's used in a few places
381 void (VulkanGame::* currentRenderScreenFn)(int width, int height);
382
383 map<string, vector<UIValue>> valueLists;
384
385 int score;
386 float fps;
387
388 // TODO: Make a separate TImer class
389 time_point<steady_clock> startTime;
390 float fpsStartTime, curTime, prevTime, elapsedTime;
391
392 int frameCount;
393
394 /*** Functions ***/
395
396 bool initUI(int width, int height, unsigned char guiFlags);
397 void initVulkan();
398 void initGraphicsPipelines();
399 void initMatrices();
400 void renderLoop();
401 void updateScene();
402 void cleanup();
403
404 void createVulkanInstance(const vector<const char*>& validationLayers);
405 void setupDebugMessenger();
406 void populateDebugMessengerCreateInfo(VkDebugUtilsMessengerCreateInfoEXT& createInfo);
407 void createVulkanSurface();
408 void pickPhysicalDevice(const vector<const char*>& deviceExtensions);
409 bool isDeviceSuitable(VkPhysicalDevice physicalDevice, const vector<const char*>& deviceExtensions);
410 void createLogicalDevice(const vector<const char*>& validationLayers,
411 const vector<const char*>& deviceExtensions);
412 void chooseSwapChainProperties();
413 void createSwapChain();
414 void createImageViews();
415 void createResourceCommandPool();
416 void createImageResources();
417 VkFormat findDepthFormat(); // TODO: Declare/define (in the cpp file) this function in some util functions section
418 void createRenderPass();
419 void createCommandPools();
420 void createFramebuffers();
421 void createCommandBuffers();
422 void createSyncObjects();
423
424 void createTextureSampler();
425
426 void initImGuiOverlay();
427 void cleanupImGuiOverlay();
428
429 void createBufferSet(VkDeviceSize bufferSize, VkBufferUsageFlags flags,
430 vector<VkBuffer>& buffers, vector<VkDeviceMemory>& buffersMemory,
431 vector<VkDescriptorBufferInfo>& bufferInfoList);
432
433 // TODO: Since addObject() returns a reference to the new object now,
434 // stop using objects.back() to access the object that was just created
435 template<class VertexType, class SSBOType>
436 SceneObject<VertexType, SSBOType>& addObject(
437 vector<SceneObject<VertexType, SSBOType>>& objects,
438 GraphicsPipeline_Vulkan<VertexType, SSBOType>& pipeline,
439 const vector<VertexType>& vertices, vector<uint16_t> indices, SSBOType ssbo,
440 bool pipelinesCreated);
441
442 template<class VertexType>
443 vector<VertexType> addObjectIndex(unsigned int objIndex, vector<VertexType> vertices);
444
445 template<class VertexType>
446 vector<VertexType> addVertexNormals(vector<VertexType> vertices);
447
448 template<class VertexType, class SSBOType>
449 void centerObject(SceneObject<VertexType, SSBOType>& object);
450
451 template<class VertexType, class SSBOType>
452 void updateObject(vector<SceneObject<VertexType, SSBOType>>& objects,
453 GraphicsPipeline_Vulkan<VertexType, SSBOType>& pipeline, size_t index);
454
455 template<class VertexType, class SSBOType>
456 void updateObjectVertices(GraphicsPipeline_Vulkan<VertexType, SSBOType>& pipeline,
457 SceneObject<VertexType, SSBOType>& obj, size_t index);
458
459 void addLaser(vec3 start, vec3 end, vec3 color, float width);
460 void translateLaser(size_t index, const vec3& translation);
461 void updateLaserTarget(size_t index);
462 bool getLaserAndAsteroidIntersection(SceneObject<AsteroidVertex, SSBO_Asteroid>& asteroid,
463 vec3& start, vec3& end, vec3& intersection);
464
465 void addExplosion(mat4 model_mat, float duration, float cur_time);
466
467 void renderFrame(ImDrawData* draw_data);
468 void presentFrame();
469
470 void recreateSwapChain();
471
472 void cleanupSwapChain();
473
474 /*** High-level functions ***/
475
476 void renderMainScreen(int width, int height);
477 void renderGameScreen(int width, int height);
478
479 void initGuiValueLists(map<string, vector<UIValue>>& valueLists);
480 void renderGuiValueList(vector<UIValue>& values);
481
482 void goToScreen(void (VulkanGame::* renderScreenFn)(int width, int height));
483 void quitGame();
484};
485
486// Start of specialized no-op functions
487
488template<>
489inline void VulkanGame::centerObject(SceneObject<ExplosionVertex, SSBO_Explosion>& object) {
490}
491
492// End of specialized no-op functions
493
494// TODO: Right now, it's basically necessary to pass the identity matrix in for ssbo.model
495// and to change the model matrix later by setting model_transform and then calling updateObject()
496// Figure out a better way to allow the model matrix to be set during objecting creation
497
498// TODO: Maybe return a reference to the object from this method if I decide that updating it
499// immediately after creation is a good idea (such as setting model_base)
500// Currently, model_base is set like this in a few places and the radius is set for asteroids
501// to account for scaling
502template<class VertexType, class SSBOType>
503SceneObject<VertexType, SSBOType>& VulkanGame::addObject(
504 vector<SceneObject<VertexType, SSBOType>>& objects,
505 GraphicsPipeline_Vulkan<VertexType, SSBOType>& pipeline,
506 const vector<VertexType>& vertices, vector<uint16_t> indices, SSBOType ssbo,
507 bool pipelinesCreated) {
508 // TODO: Use the model field of ssbo to set the object's model_base
509 // currently, the passed in model is useless since it gets overridden in updateObject() anyway
510 size_t numVertices = pipeline.getNumVertices();
511
512 for (uint16_t& idx : indices) {
513 idx += numVertices;
514 }
515
516 objects.push_back({ vertices, indices, ssbo, mat4(1.0f), mat4(1.0f), false });
517
518 SceneObject<VertexType, SSBOType>& obj = objects.back();
519
520 // TODO: Specify whether to center the object outside of this function or, worst case, maybe
521 // with a boolean being passed in here, so that I don't have to rely on checking the specific object
522 // type
523 if (!is_same_v<VertexType, LaserVertex> && !is_same_v<VertexType, ExplosionVertex>) {
524 centerObject(obj);
525 }
526
527 bool storageBufferResized = pipeline.addObject(obj.vertices, obj.indices, obj.ssbo,
528 resourceCommandPool, graphicsQueue);
529
530 if (pipelinesCreated) {
531 vkDeviceWaitIdle(device);
532
533 for (uint32_t i = 0; i < swapChainImageCount; i++) {
534 vkFreeCommandBuffers(device, commandPools[i], 1, &commandBuffers[i]);
535 }
536
537 // TODO: The pipeline recreation only has to be done once per frame where at least
538 // one SSBO is resized.
539 // Refactor the logic to check for any resized SSBOs after all objects for the frame
540 // are created and then recreate each of the corresponding pipelines only once per frame
541 if (storageBufferResized) {
542 pipeline.createPipeline(pipeline.vertShaderFile, pipeline.fragShaderFile);
543 pipeline.createDescriptorPool(swapChainImages);
544 pipeline.createDescriptorSets(swapChainImages);
545 }
546
547 createCommandBuffers();
548 }
549
550 return obj;
551}
552
553template<class VertexType>
554vector<VertexType> VulkanGame::addObjectIndex(unsigned int objIndex, vector<VertexType> vertices) {
555 for (VertexType& vertex : vertices) {
556 vertex.objIndex = objIndex;
557 }
558
559 return vertices;
560}
561
562// This function sets all the normals for a face to be parallel
563// This is good for models that should have distinct faces, but bad for models that should appear smooth
564// Maybe add an option to set all copies of a point to have the same normal and have the direction of
565// that normal be the weighted average of all the faces it is a part of, where the weight from each face
566// is its surface area.
567
568// TODO: Since the current approach to normal calculation basicaly makes indexed drawing useless, see if it's
569// feasible to automatically enable/disable indexed drawing based on which approach is used
570template<class VertexType>
571vector<VertexType> VulkanGame::addVertexNormals(vector<VertexType> vertices) {
572 for (unsigned int i = 0; i < vertices.size(); i += 3) {
573 vec3 p1 = vertices[i].pos;
574 vec3 p2 = vertices[i + 1].pos;
575 vec3 p3 = vertices[i + 2].pos;
576
577 vec3 normal = normalize(cross(p2 - p1, p3 - p1));
578
579 // Add the same normal for all 3 vertices
580 vertices[i].normal = normal;
581 vertices[i + 1].normal = normal;
582 vertices[i + 2].normal = normal;
583 }
584
585 return vertices;
586}
587
588template<class VertexType, class SSBOType>
589void VulkanGame::centerObject(SceneObject<VertexType, SSBOType>& object) {
590 vector<VertexType>& vertices = object.vertices;
591
592 float min_x = vertices[0].pos.x;
593 float max_x = vertices[0].pos.x;
594 float min_y = vertices[0].pos.y;
595 float max_y = vertices[0].pos.y;
596 float min_z = vertices[0].pos.z;
597 float max_z = vertices[0].pos.z;
598
599 // start from the second point
600 for (unsigned int i = 1; i < vertices.size(); i++) {
601 vec3& pos = vertices[i].pos;
602
603 if (min_x > pos.x) {
604 min_x = pos.x;
605 } else if (max_x < pos.x) {
606 max_x = pos.x;
607 }
608
609 if (min_y > pos.y) {
610 min_y = pos.y;
611 } else if (max_y < pos.y) {
612 max_y = pos.y;
613 }
614
615 if (min_z > pos.z) {
616 min_z = pos.z;
617 } else if (max_z < pos.z) {
618 max_z = pos.z;
619 }
620 }
621
622 vec3 center = vec3(min_x + max_x, min_y + max_y, min_z + max_z) / 2.0f;
623
624 for (unsigned int i = 0; i < vertices.size(); i++) {
625 vertices[i].pos -= center;
626 }
627
628 object.radius = std::max(max_x - center.x, max_y - center.y);
629 object.radius = std::max(object.radius, max_z - center.z);
630
631 object.center = vec3(0.0f, 0.0f, 0.0f);
632}
633
634// TODO: Just pass in the single object instead of a list of all of them
635template<class VertexType, class SSBOType>
636void VulkanGame::updateObject(vector<SceneObject<VertexType, SSBOType>>& objects,
637 GraphicsPipeline_Vulkan<VertexType, SSBOType>& pipeline, size_t index) {
638 SceneObject<VertexType, SSBOType>& obj = objects[index];
639
640 obj.ssbo.model = obj.model_transform * obj.model_base;
641 obj.center = vec3(obj.ssbo.model * vec4(0.0f, 0.0f, 0.0f, 1.0f));
642
643 pipeline.updateObject(index, obj.ssbo);
644
645 obj.modified = false;
646}
647
648template<class VertexType, class SSBOType>
649void VulkanGame::updateObjectVertices(GraphicsPipeline_Vulkan<VertexType, SSBOType>& pipeline,
650 SceneObject<VertexType, SSBOType>& obj, size_t index) {
651 pipeline.updateObjectVertices(index, obj.vertices, resourceCommandPool, graphicsQueue);
652}
653
654#endif // _VULKAN_GAME_H
Note: See TracBrowser for help on using the repository browser.