载入中...
搜索中...
未找到
InitFlow.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Export.h"
4
7
8#include <cstdint>
9#include <string>
10#include <utility>
11
12namespace eve::graphics::webgpu {
13
14// Stage objects are produced in a strict order: each request consumes the
15// previous stage and yields the next one, so calling a later step without the
16// earlier one (or out of order) is a compile error — the vk-bootstrap principle
17// applied to WebGPU's async initialization.
18
21 wgpu::Instance instance;
22};
23
26 wgpu::Instance instance;
27 wgpu::Adapter adapter;
28};
29
31struct DeviceDone {
32 wgpu::Instance instance;
33 wgpu::Adapter adapter;
34 wgpu::Device device;
35 wgpu::Queue queue;
37};
38
48public:
50 static InstanceDone createInstance();
51
58 static AdapterDone requestAdapter(InstanceDone &&prev, const wgpu::Surface &compatibleSurface);
59
69 static DeviceDone requestDevice(AdapterDone&& prev, uint32_t colorAttachmentByteBudget = 40);
70};
71
72} // namespace eve::graphics::webgpu
#define EVENGINE_API_BACKENDS
Definition Export.h:108
Read-only snapshot of WebGPU adapter/device limits and surface capabilities, queried once after devic...
Typed, blocking WebGPU initialization flow.
Definition InitFlow.h:47
Instance + adapter resolved.
Definition InitFlow.h:25
Instance + adapter + device + queue + capability snapshot.
Definition InitFlow.h:31
Instance created, no adapter yet.
Definition InitFlow.h:20