From e6e34e551a73e65301685071445aaec9aaf60fd2 Mon Sep 17 00:00:00 2001 From: skal Date: Sun, 1 Feb 2026 01:41:01 +0100 Subject: Refactor: Move common GPU fields to base Effect classes Moved WGPUDevice, WGPUQueue, and GpuBuffer uniforms_ into the base Effect and PostProcessEffect classes. Updated all derived effect classes to use these inherited members and refactored their constructors. Also fixed associated compilation errors in test files and adjusted a printf statement. --- src/gpu/effects/moving_ellipse_effect.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gpu/effects/moving_ellipse_effect.cc') diff --git a/src/gpu/effects/moving_ellipse_effect.cc b/src/gpu/effects/moving_ellipse_effect.cc index 60fc825..b46eecd 100644 --- a/src/gpu/effects/moving_ellipse_effect.cc +++ b/src/gpu/effects/moving_ellipse_effect.cc @@ -7,13 +7,13 @@ // --- MovingEllipseEffect --- MovingEllipseEffect::MovingEllipseEffect(WGPUDevice device, WGPUQueue queue, WGPUTextureFormat format) - : queue_(queue) { + : Effect(device, queue) { uniforms_ = - gpu_create_buffer(device, sizeof(float) * 4, + gpu_create_buffer(device_, sizeof(float) * 4, WGPUBufferUsage_Uniform | WGPUBufferUsage_CopyDst); ResourceBinding bindings[] = {{uniforms_, WGPUBufferBindingType_Uniform}}; pass_ = - gpu_create_render_pass(device, format, ellipse_shader_wgsl, bindings, 1); + gpu_create_render_pass(device_, format, ellipse_shader_wgsl, bindings, 1); pass_.vertex_count = 3; } void MovingEllipseEffect::render(WGPURenderPassEncoder pass, float t, float b, -- cgit v1.2.3