summaryrefslogtreecommitdiff
path: root/src/tests/common/test_3d_helpers.h
blob: 5e9c72cd9c3df351d324df4abe2d3d77d913afaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// This file is part of the 64k demo project.
// Common WGPU initialization for 3D visual tests with surfaces.

#pragma once

#include "platform/platform.h"
#include <webgpu.h>

// Result of WGPU initialization with surface
struct WgpuSurfaceContext {
  WGPUDevice device;
  WGPUQueue queue;
  WGPUSurface surface;
  WGPUAdapter adapter;
  WGPUTextureFormat format;
};

// Initialize WGPU with surface for rendering tests
// Returns context with device/queue/surface/adapter/format
WgpuSurfaceContext init_wgpu_with_surface(PlatformState* platform_state);