diff options
Diffstat (limited to 'src/test_demo.cc')
| -rw-r--r-- | src/test_demo.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/test_demo.cc b/src/test_demo.cc index 9ae0e3a..69b18cc 100644 --- a/src/test_demo.cc +++ b/src/test_demo.cc @@ -15,14 +15,14 @@ // External declarations from generated files extern float GetDemoDuration(); -extern void LoadTimeline(MainSequence& main_seq, WGPUDevice device, WGPUQueue queue, WGPUTextureFormat format); +extern void LoadTimeline(MainSequence& main_seq, const GpuContext& ctx); // Inline peak meter effect for debugging audio-visual sync #include "gpu/effects/post_process_helper.h" class PeakMeterEffect : public PostProcessEffect { public: - PeakMeterEffect(WGPUDevice device, WGPUQueue queue, WGPUTextureFormat format) - : PostProcessEffect(device, queue) { + PeakMeterEffect(const GpuContext& ctx) + : PostProcessEffect(ctx) { const char* shader_code = R"( struct VertexOutput { @builtin(position) position: vec4<f32>, @@ -82,9 +82,9 @@ class PeakMeterEffect : public PostProcessEffect { } )"; - 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 update_bind_group(WGPUTextureView input_view) { @@ -196,7 +196,8 @@ int main(int argc, char** argv) { // Add peak meter visualization effect (renders as final post-process) #if !defined(STRIP_ALL) - auto* peak_meter = new PeakMeterEffect(g_device, g_queue, g_format); + const GpuContext* gpu_ctx = gpu_get_context(); + auto* peak_meter = new PeakMeterEffect(*gpu_ctx); gpu_add_custom_effect(peak_meter, 0.0f, 99999.0f, 999); // High priority = renders last #endif |
