From bd939acdf750181ef0e1a612b445da4c15077c85 Mon Sep 17 00:00:00 2001 From: skal Date: Sat, 7 Feb 2026 17:04:56 +0100 Subject: refactor: Bundle GPU context into GpuContext struct - Created GpuContext struct {device, queue, format} - Updated Effect/PostProcessEffect to take const GpuContext& - Updated all 19 effect implementations - Updated MainSequence.init() and LoadTimeline() signatures - Updated generated timeline files - Updated all test files - Added gpu_get_context() accessor and fixture.ctx() helper Fixes test_mesh.cc compilation error from g_device/g_queue/g_format conflicts. All targets build successfully. --- src/gpu/effects/particles_effect.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/gpu/effects/particles_effect.cc') diff --git a/src/gpu/effects/particles_effect.cc b/src/gpu/effects/particles_effect.cc index 6218af9..137150a 100644 --- a/src/gpu/effects/particles_effect.cc +++ b/src/gpu/effects/particles_effect.cc @@ -6,9 +6,8 @@ #include // --- ParticlesEffect --- -ParticlesEffect::ParticlesEffect(WGPUDevice device, WGPUQueue queue, - WGPUTextureFormat format) - : Effect(device, queue) { +ParticlesEffect::ParticlesEffect(const GpuContext& ctx) + : Effect(ctx) { uniforms_ = gpu_create_buffer(device_, sizeof(float) * 4, WGPUBufferUsage_Uniform | WGPUBufferUsage_CopyDst); @@ -25,7 +24,7 @@ ParticlesEffect::ParticlesEffect(WGPUDevice device, WGPUQueue queue, {particles_buffer_, WGPUBufferBindingType_ReadOnlyStorage}, {uniforms_, WGPUBufferBindingType_Uniform}}; render_pass_ = - gpu_create_render_pass(device_, format, particle_render_wgsl, rb, 2); + gpu_create_render_pass(device_, format_, particle_render_wgsl, rb, 2); render_pass_.vertex_count = 6; render_pass_.instance_count = NUM_PARTICLES; } -- cgit v1.2.3