quakeforge/include/QF/Vulkan/qf_particles.h
Bill Currie 743b06d5c1 [vulkan] Script render graph initialization sequence
While every possible subsystem needs an initialization call, all that
does is add the actual initialization task to the render graph system.
This allows the render graph to be fully configurable, initializing only
those subsystems that the graph needs.

Scripted initialization is still separated from startup as render graph
creation needs various resources (eg, attachments) defined before
creating render and compute passes, but all those need to be created
before the subsystems can actually start up.
2024-01-30 23:13:16 +09:00

62 lines
1.4 KiB
C

#ifndef __QF_Vulkan_qf_particles_h
#define __QF_Vulkan_qf_particles_h
#include "QF/darray.h"
#include "QF/image.h"
#include "QF/render.h"
#include "QF/Vulkan/command.h"
typedef struct qfv_particle_s {
vec4f_t pos;
vec4f_t vel;
vec4f_t color;
float texture;
float ramp;
float scale;
float live;
} qfv_particle_t;
typedef struct qfv_parameters_s {
vec4f_t drag;
vec4f_t ramp;
} qfv_parameters_t;
// Doubles as VkDrawIndirectCommand
typedef struct qfv_particle_system_s {
uint32_t vertexCount; // always 1
uint32_t particleCount;
uint32_t firstVertex; // always 0
uint32_t firstInstance; // always 0
} qfv_particle_system_t;
typedef struct particleframe_s {
VkEvent physicsEvent;
VkEvent updateEvent;
VkBuffer states;
VkBuffer params;
VkBuffer system;
VkDescriptorSet curDescriptors;
VkDescriptorSet inDescriptors;
VkDescriptorSet newDescriptors;
} particleframe_t;
typedef struct particleframeset_s
DARRAY_TYPE (particleframe_t) particleframeset_t;
typedef struct particlectx_s {
particleframeset_t frames;
struct qfv_resource_s *resources;
struct qfv_stagebuf_s *stage;
psystem_t *psystem;
} particlectx_t;
struct vulkan_ctx_s;
struct psystem_s *Vulkan_ParticleSystem (struct vulkan_ctx_s *ctx);
void Vulkan_Particles_Init (struct vulkan_ctx_s *ctx);
#endif//__QF_Vulkan_qf_particles_h