summaryrefslogtreecommitdiff
path: root/src/gpu/effect.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/effect.cc')
-rw-r--r--src/gpu/effect.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gpu/effect.cc b/src/gpu/effect.cc
index c3bd99a..0ac9063 100644
--- a/src/gpu/effect.cc
+++ b/src/gpu/effect.cc
@@ -89,6 +89,8 @@ MainSequence::MainSequence() = default;
MainSequence::~MainSequence() = default;
void MainSequence::create_framebuffers(int width, int height) {
+ // In test mode, this would be skipped or mocked.
+ // For now, it will only be called by the real init.
WGPUTextureDescriptor desc = {};
desc.usage =
WGPUTextureUsage_RenderAttachment | WGPUTextureUsage_TextureBinding;
@@ -111,6 +113,14 @@ void MainSequence::create_framebuffers(int width, int height) {
framebuffer_view_b_ = wgpuTextureCreateView(framebuffer_b_, &view_desc);
}
+void MainSequence::init_test(WGPUDevice d, WGPUQueue q, WGPUTextureFormat f) {
+ device = d;
+ queue = q;
+ format = f;
+ // No framebuffers or passthrough effect created in test mode.
+ // Test effects should not rely on these being real.
+}
+
void MainSequence::init(WGPUDevice d, WGPUQueue q, WGPUTextureFormat f,
int width, int height) {
device = d;