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/chroma_aberration_effect.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/gpu/effects/chroma_aberration_effect.cc') diff --git a/src/gpu/effects/chroma_aberration_effect.cc b/src/gpu/effects/chroma_aberration_effect.cc index 6e64988..83c5f2a 100644 --- a/src/gpu/effects/chroma_aberration_effect.cc +++ b/src/gpu/effects/chroma_aberration_effect.cc @@ -5,14 +5,12 @@ #include "gpu/gpu.h" // --- ChromaAberrationEffect --- -ChromaAberrationEffect::ChromaAberrationEffect(WGPUDevice device, - WGPUQueue queue, - WGPUTextureFormat format) - : PostProcessEffect(device, queue) { +ChromaAberrationEffect::ChromaAberrationEffect(const GpuContext& ctx) + : PostProcessEffect(ctx) { uniforms_ = gpu_create_buffer(device_, sizeof(float) * 6, WGPUBufferUsage_Uniform | WGPUBufferUsage_CopyDst); - pipeline_ = create_post_process_pipeline(device_, format, + pipeline_ = create_post_process_pipeline(device_, format_, chroma_aberration_shader_wgsl); } void ChromaAberrationEffect::render(WGPURenderPassEncoder pass, float t, -- cgit v1.2.3