summaryrefslogtreecommitdiff
path: root/src/tests/webgpu_test_fixture.h
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/tests/webgpu_test_fixture.h
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/tests/webgpu_test_fixture.h')
-rw-r--r--src/tests/webgpu_test_fixture.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tests/webgpu_test_fixture.h b/src/tests/webgpu_test_fixture.h
index 2c700a4..fd08276 100644
--- a/src/tests/webgpu_test_fixture.h
+++ b/src/tests/webgpu_test_fixture.h
@@ -4,6 +4,7 @@
#pragma once
+#include "gpu/gpu.h"
#include "platform/platform.h"
// Shared test fixture for WebGPU tests
@@ -25,6 +26,7 @@ class WebGPUTestFixture {
WGPUDevice device() const { return device_; }
WGPUQueue queue() const { return queue_; }
WGPUTextureFormat format() const { return WGPUTextureFormat_BGRA8Unorm; }
+ GpuContext ctx() const { return {device_, queue_, format()}; }
// Check if fixture is ready
bool is_initialized() const { return device_ != nullptr; }