[vulkan] Use the particle system buffer for indirect draws

I realized I'd need to get the particle counts out to the draw commands
somehow, and this seemed to be the most natural way.
This commit is contained in:
Bill Currie 2021-12-17 00:18:25 +09:00
parent 6aaf5c3722
commit 8228146ac0
2 changed files with 20 additions and 4 deletions

View file

@ -25,8 +25,12 @@ layout(std140, set = 0, binding = 1) buffer ParticleParameters {
Parameters parameters[];
};
//doubles as VkDrawIndirectCommand
layout(std140, set = 0, binding = 2) buffer ParticleSystem {
uint particleCount;
uint vertexCount;
uint particleCount; //instanceCount
uint firstVertex;
uint firstInstance;
};
layout (push_constant) uniform PushConstants {

View file

@ -27,8 +27,12 @@ layout(std140, set = 0, binding = 1) buffer InParameters {
Parameters parameters[];
} inParameters;
//doubles as VkDrawIndirectCommand
layout(std140, set = 0, binding = 2) buffer InSystem {
uint particleCount;
uint vertexCount;
uint particleCount; //instanceCount
uint firstVertex;
uint firstInstance;
} inSystem;
layout(std140, set = 1, binding = 0) buffer OutStates {
@ -39,8 +43,12 @@ layout(std140, set = 1, binding = 1) buffer OutParameters {
Parameters parameters[];
} outParameters;
//doubles as VkDrawIndirectCommand
layout(std140, set = 1, binding = 2) buffer OutSystem {
uint particleCount;
uint vertexCount;
uint particleCount; //instanceCount
uint firstVertex;
uint firstInstance;
} outSystem;
layout(std140, set = 2, binding = 0) buffer NewStates {
@ -51,8 +59,12 @@ layout(std140, set = 2, binding = 1) buffer NewParameters {
Parameters parameters[];
} newParameters;
//doubles as VkDrawIndirectCommand
layout(std140, set = 2, binding = 2) buffer NewSystem {
uint particleCount;
uint vertexCount;
uint particleCount; //instanceCount
uint firstVertex;
uint firstInstance;
} newSystem;
bool