9 VulkanEmitter::VulkanEmitter() : bufferQueueFamilyTransitionsNeseccary(false), renderQueueFamily(0),
15 VulkanEmitter::~VulkanEmitter()
19 void VulkanEmitter::Compile()
23 if (device->GetPhysicalDevice()->GetQueueFamilies().compute == device->GetPhysicalDevice()->GetQueueFamilies().graphics) {
24 bufferQueueFamilyTransitionsNeseccary =
false;
27 bufferQueueFamilyTransitionsNeseccary =
true;
28 computeQueueFamily = device->GetPhysicalDevice()->GetQueueFamilies().compute;
29 renderQueueFamily = device->GetPhysicalDevice()->GetQueueFamilies().graphics;
32 pipeline = eastl::unique_ptr<VulkanComputePipeline>(
new VulkanComputePipeline(device));
34 pipeline->SetComputeShader(
"ParticleUpdate.comp.spv");
39 VulkanLogicalDevice* VulkanEmitter::device =
nullptr;
40 VulkanRenderer* VulkanEmitter::renderer =
nullptr;
41 VmaAllocator VulkanEmitter::allocator = VK_NULL_HANDLE;
42 VkCommandPool VulkanEmitter::commandPool = VK_NULL_HANDLE;
44 void VulkanEmitter::InitParticleEmitter(VulkanRenderer* renderer, VulkanLogicalDevice * device, VmaAllocator allocator, VkCommandPool commandPool)
46 VulkanEmitter::device = device;
47 VulkanEmitter::renderer = renderer;
48 VulkanEmitter::allocator = allocator;
49 VulkanEmitter::commandPool = commandPool;
virtual void Compile()
Compiles the emitter and associated particle. After this, the particle can't be changed. Any particle enum values are also no longer changeable. NOTE: This needs to be called before the emitter can be used.