diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-07 17:04:56 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-07 17:04:56 +0100 |
| commit | bd939acdf750181ef0e1a612b445da4c15077c85 (patch) | |
| tree | 028401c762b0436d9a5de1aa656ab35ba6445674 /src/gpu/effects/flash_effect.cc | |
| parent | f2963ac821a3af1c54002ba13944552166956d04 (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/flash_effect.cc')
| -rw-r--r-- | src/gpu/effects/flash_effect.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gpu/effects/flash_effect.cc b/src/gpu/effects/flash_effect.cc index 176c60c..3dcb48a 100644 --- a/src/gpu/effects/flash_effect.cc +++ b/src/gpu/effects/flash_effect.cc @@ -5,9 +5,8 @@ #include "gpu/effects/post_process_helper.h" #include <cmath> -FlashEffect::FlashEffect(WGPUDevice device, WGPUQueue queue, - WGPUTextureFormat format) - : PostProcessEffect(device, queue) { +FlashEffect::FlashEffect(const GpuContext& ctx) + : PostProcessEffect(ctx) { const char* shader_code = R"( struct VertexOutput { @builtin(position) position: vec4<f32>, @@ -48,9 +47,9 @@ FlashEffect::FlashEffect(WGPUDevice device, WGPUQueue queue, } )"; - pipeline_ = create_post_process_pipeline(device, format, shader_code); + pipeline_ = create_post_process_pipeline(device_, format_, shader_code); uniforms_ = gpu_create_buffer( - device, 16, WGPUBufferUsage_Uniform | WGPUBufferUsage_CopyDst); + device_, 16, WGPUBufferUsage_Uniform | WGPUBufferUsage_CopyDst); } void FlashEffect::update_bind_group(WGPUTextureView input_view) { |
