quakeforge/include/QF/Vulkan/qf_particles.h
Bill Currie 6aaf5c3722 [vulkan] Start work on particles for Vulkan
This gets the pipelines loaded (and unloaded on shutdown). Probably the
easy part :P. Still need to sort out the command buffers,
synchronization, and particle generation (and probably a bunch else
that's not coming to mind).
2021-12-24 06:45:13 +09:00

71 lines
1.6 KiB
C

#ifndef __QF_Vulkan_qf_particles_h
#define __QF_Vulkan_qf_particles_h
#include "QF/darray.h"
#include "QF/image.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;
typedef enum {
QFV_particleTranslucent,
QFV_particleNumPasses
} QFV_ParticleSubpass;
typedef struct particleframe_s {
VkCommandBuffer compute;
VkSemaphore physSem;
VkSemaphore drawSem;
VkSemaphore updateSem;
VkBuffer state;
VkBuffer params;
VkBuffer system;
VkDescriptorSet descriptors;
qfv_cmdbufferset_t cmdSet;
} particleframe_t;
typedef struct particleframeset_s
DARRAY_TYPE (particleframe_t) particleframeset_t;
typedef struct particlectx_s {
particleframeset_t frames;
VkPipeline physics;
VkPipeline update;
VkPipeline draw;
VkDescriptorPool pool;
VkDescriptorSetLayout setLayout;
VkPipelineLayout physics_layout;
VkPipelineLayout update_layout;
VkPipelineLayout draw_layout;
} particlectx_t;
struct cvar_s;
struct vulkan_ctx_s;;
void Vulkan_ClearParticles (struct vulkan_ctx_s *ctx);
void Vulkan_InitParticles (struct vulkan_ctx_s *ctx);
void Vulkan_r_easter_eggs_f (struct cvar_s *var, struct vulkan_ctx_s *ctx);
void Vulkan_r_particles_style_f (struct cvar_s *var, struct vulkan_ctx_s *ctx);
void Vulkan_Particles_Init (struct vulkan_ctx_s *ctx);
void Vulkan_Particles_Shutdown (struct vulkan_ctx_s *ctx);
void Vulkan_DrawParticles (struct vulkan_ctx_s *ctx);
#endif//__QF_Vulkan_qf_particles_h