summaryrefslogtreecommitdiff
path: root/src/gpu/effects/distort_effect.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-07 17:04:56 +0100
committerskal <pascal.massimino@gmail.com>2026-02-07 17:04:56 +0100
commitbd939acdf750181ef0e1a612b445da4c15077c85 (patch)
tree028401c762b0436d9a5de1aa656ab35ba6445674 /src/gpu/effects/distort_effect.cc
parentf2963ac821a3af1c54002ba13944552166956d04 (diff)
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.
Diffstat (limited to 'src/gpu/effects/distort_effect.cc')
-rw-r--r--src/gpu/effects/distort_effect.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gpu/effects/distort_effect.cc b/src/gpu/effects/distort_effect.cc
index 0d4bb36..abaa2e7 100644
--- a/src/gpu/effects/distort_effect.cc
+++ b/src/gpu/effects/distort_effect.cc
@@ -5,14 +5,13 @@
#include "gpu/gpu.h"
// --- DistortEffect ---
-DistortEffect::DistortEffect(WGPUDevice device, WGPUQueue queue,
- WGPUTextureFormat format)
- : PostProcessEffect(device, queue) {
+DistortEffect::DistortEffect(const GpuContext& ctx)
+ : PostProcessEffect(ctx) {
uniforms_ =
gpu_create_buffer(device_, sizeof(float) * 6,
WGPUBufferUsage_Uniform | WGPUBufferUsage_CopyDst);
pipeline_ =
- create_post_process_pipeline(device_, format, distort_shader_wgsl);
+ create_post_process_pipeline(device_, format_, distort_shader_wgsl);
}
void DistortEffect::render(WGPURenderPassEncoder pass, float t, float b,
float i, float a) {