diff options
Diffstat (limited to 'src/gpu/effects/particles_effect.cc')
| -rw-r--r-- | src/gpu/effects/particles_effect.cc | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/gpu/effects/particles_effect.cc b/src/gpu/effects/particles_effect.cc index cd0df74..f8c18f0 100644 --- a/src/gpu/effects/particles_effect.cc +++ b/src/gpu/effects/particles_effect.cc @@ -25,16 +25,9 @@ ParticlesEffect::ParticlesEffect(const GpuContext& ctx) : Effect(ctx) { render_pass_.vertex_count = 6; render_pass_.instance_count = NUM_PARTICLES; } -void ParticlesEffect::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 ParticlesEffect::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, @@ -43,8 +36,9 @@ void ParticlesEffect::compute(WGPUCommandEncoder e, float t, float b, float i, 1, 1); wgpuComputePassEncoderEnd(pass); } -void ParticlesEffect::render(WGPURenderPassEncoder pass, float t, float b, - float i, float a) { +void ParticlesEffect::render(WGPURenderPassEncoder pass, + const CommonPostProcessUniforms& uniforms) { + (void)uniforms; wgpuRenderPassEncoderSetPipeline(pass, render_pass_.pipeline); wgpuRenderPassEncoderSetBindGroup(pass, 0, render_pass_.bind_group, 0, nullptr); |
