summaryrefslogtreecommitdiff
path: root/src/gpu/effects/particle_spray_effect.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/effects/particle_spray_effect.cc')
-rw-r--r--src/gpu/effects/particle_spray_effect.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gpu/effects/particle_spray_effect.cc b/src/gpu/effects/particle_spray_effect.cc
index b5c5f42..e8ead0a 100644
--- a/src/gpu/effects/particle_spray_effect.cc
+++ b/src/gpu/effects/particle_spray_effect.cc
@@ -10,7 +10,7 @@ ParticleSprayEffect::ParticleSprayEffect(WGPUDevice device, WGPUQueue queue,
WGPUTextureFormat format)
: Effect(device, queue) {
uniforms_ =
- gpu_create_buffer(device_, sizeof(float) * 4,
+ gpu_create_buffer(device_, sizeof(float) * 6,
WGPUBufferUsage_Uniform | WGPUBufferUsage_CopyDst);
std::vector<Particle> init_p(NUM_PARTICLES);
for (Particle& p : init_p)
@@ -34,8 +34,8 @@ ParticleSprayEffect::ParticleSprayEffect(WGPUDevice device, WGPUQueue queue,
void ParticleSprayEffect::compute(WGPUCommandEncoder e, float t, float b,
float i, float a) {
struct {
- float i, a, t, b;
- } u = {i, a, t, b};
+ float i, a, t, b, w, h;
+ } u = {i, a, t, b, (float)width_, (float)height_};
wgpuQueueWriteBuffer(queue_, uniforms_.buffer, 0, &u, sizeof(u));
WGPUComputePassEncoder pass = wgpuCommandEncoderBeginComputePass(e, nullptr);
wgpuComputePassEncoderSetPipeline(pass, compute_pass_.pipeline);