diff options
Diffstat (limited to 'src/gpu/effects/particle_spray_effect.cc')
| -rw-r--r-- | src/gpu/effects/particle_spray_effect.cc | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/gpu/effects/particle_spray_effect.cc b/src/gpu/effects/particle_spray_effect.cc index a435884..9b615d0 100644 --- a/src/gpu/effects/particle_spray_effect.cc +++ b/src/gpu/effects/particle_spray_effect.cc @@ -27,16 +27,9 @@ ParticleSprayEffect::ParticleSprayEffect(const GpuContext& ctx) : Effect(ctx) { render_pass_.vertex_count = 6; render_pass_.instance_count = NUM_PARTICLES; } -void ParticleSprayEffect::compute(WGPUCommandEncoder e, float t, float b, - float i, float a) { - const CommonPostProcessUniforms u = { - .resolution = {(float)width_, (float)height_}, - .aspect_ratio = a, - .time = t, - .beat = b, - .audio_intensity = i, - }; - uniforms_.update(ctx_.queue, u); +void ParticleSprayEffect::compute(WGPUCommandEncoder e, + const CommonPostProcessUniforms& uniforms) { + uniforms_.update(ctx_.queue, uniforms); WGPUComputePassEncoder pass = wgpuCommandEncoderBeginComputePass(e, nullptr); wgpuComputePassEncoderSetPipeline(pass, compute_pass_.pipeline); wgpuComputePassEncoderSetBindGroup(pass, 0, compute_pass_.bind_group, 0, @@ -45,8 +38,9 @@ void ParticleSprayEffect::compute(WGPUCommandEncoder e, float t, float b, 1, 1); wgpuComputePassEncoderEnd(pass); } -void ParticleSprayEffect::render(WGPURenderPassEncoder pass, float t, float b, - float i, float a) { +void ParticleSprayEffect::render(WGPURenderPassEncoder pass, + const CommonPostProcessUniforms& uniforms) { + (void)uniforms; wgpuRenderPassEncoderSetPipeline(pass, render_pass_.pipeline); wgpuRenderPassEncoderSetBindGroup(pass, 0, render_pass_.bind_group, 0, nullptr); |
