Engine
Frameworkcreatedbymeusableforthecreationofsimplegames.CurrentlysupportsOpenGL(Verysimple)andVulkan.
VulkanEmitter.cpp
Go to the documentation of this file.
1 #include "VulkanEmitter.hpp"
2 
3 #ifdef USING_VULKAN
4 
6 
7 namespace Engine {
8 
9  VulkanEmitter::VulkanEmitter() : bufferQueueFamilyTransitionsNeseccary(false), renderQueueFamily(0),
10  computeQueueFamily(0)
11  {
12  }
13 
14 
15  VulkanEmitter::~VulkanEmitter()
16  {
17  }
18 
19  void VulkanEmitter::Compile()
20  {
22 
23  if (device->GetPhysicalDevice()->GetQueueFamilies().compute == device->GetPhysicalDevice()->GetQueueFamilies().graphics) {
24  bufferQueueFamilyTransitionsNeseccary = false;
25  }
26  else {
27  bufferQueueFamilyTransitionsNeseccary = true;
28  computeQueueFamily = device->GetPhysicalDevice()->GetQueueFamilies().compute;
29  renderQueueFamily = device->GetPhysicalDevice()->GetQueueFamilies().graphics;
30  }
31 
32  pipeline = eastl::unique_ptr<VulkanComputePipeline>(new VulkanComputePipeline(device));
33 
34  pipeline->SetComputeShader("ParticleUpdate.comp.spv");
35 
36 
37  }
38 
39  VulkanLogicalDevice* VulkanEmitter::device = nullptr;
40  VulkanRenderer* VulkanEmitter::renderer = nullptr;
41  VmaAllocator VulkanEmitter::allocator = VK_NULL_HANDLE;
42  VkCommandPool VulkanEmitter::commandPool = VK_NULL_HANDLE;
43 
44  void VulkanEmitter::InitParticleEmitter(VulkanRenderer* renderer, VulkanLogicalDevice * device, VmaAllocator allocator, VkCommandPool commandPool)
45  {
46  VulkanEmitter::device = device;
47  VulkanEmitter::renderer = renderer;
48  VulkanEmitter::allocator = allocator;
49  VulkanEmitter::commandPool = commandPool;
50  }
51 
52 }
53 
54 #endif
virtual void Compile()
Compiles the emitter and associated particle. After this, the particle can&#39;t be changed. Any particle enum values are also no longer changeable. NOTE: This needs to be called before the emitter can be used.
Definition: Emitter.cpp:16