@forgeax/engine-rhi-null 0.0.0-dev.8d955ade1c79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +129 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/adapter.d.ts +9 -0
- package/dist/adapter.d.ts.map +1 -0
- package/dist/bookkeeping.d.ts +86 -0
- package/dist/bookkeeping.d.ts.map +1 -0
- package/dist/canvas-context.d.ts +22 -0
- package/dist/canvas-context.d.ts.map +1 -0
- package/dist/command-encoder.d.ts +27 -0
- package/dist/command-encoder.d.ts.map +1 -0
- package/dist/device.d.ts +67 -0
- package/dist/device.d.ts.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +470 -0
- package/dist/index.mjs.map +1 -0
- package/dist/pass-encoders.d.ts +65 -0
- package/dist/pass-encoders.d.ts.map +1 -0
- package/dist/queue.d.ts +10 -0
- package/dist/queue.d.ts.map +1 -0
- package/dist/shader.d.ts +14 -0
- package/dist/shader.d.ts.map +1 -0
- package/package.json +58 -0
- package/src/adapter.ts +40 -0
- package/src/bookkeeping.ts +179 -0
- package/src/canvas-context.ts +71 -0
- package/src/command-encoder.ts +146 -0
- package/src/device.ts +258 -0
- package/src/index.ts +63 -0
- package/src/pass-encoders.ts +211 -0
- package/src/queue.ts +61 -0
- package/src/shader.ts +37 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# @forgeax/engine-rhi-null
|
|
2
|
+
|
|
3
|
+
> Headless no-op RHI backend for structural unit tests -- inject via `createRenderer(canvas, { rhi })`, zero GPU / DOM dependency. Covers the full `RhiDevice` surface with no-op brands and a per-device handle ledger so command-stream assertions (draw count / pass schedule / create-destroy pairing / bind-group assembly) work in `test:unit` without a real GPU.
|
|
4
|
+
|
|
5
|
+
## Access -- Channel 1 injection
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { rhi } from '@forgeax/engine-rhi-null';
|
|
9
|
+
import { createRenderer } from '@forgeax/engine-runtime';
|
|
10
|
+
|
|
11
|
+
// `canvas` is a required positional param. In headless CI hand it any object
|
|
12
|
+
// shaped like a canvas -- RhiNull never touches the DOM, so a minimal stub is
|
|
13
|
+
// enough (the dogfood tests use one; see packages/runtime/src/__tests__).
|
|
14
|
+
const canvas = { width: 1, height: 1 } as unknown as HTMLCanvasElement;
|
|
15
|
+
const created = await createRenderer(canvas, { rhi });
|
|
16
|
+
if (!created.ok) throw created.error;
|
|
17
|
+
const renderer = created.value;
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The exported `rhi` singleton has the `RhiBackendPack`-mandated shape (`RhiInstance & { acquireCanvasContext; createShaderModule }`). `createRenderer` picks it up via Channel 1's `rendererOptions.rhi` escape hatch -- no backend auto-selection logic is modified, no `navigator.gpu` probe involved.
|
|
21
|
+
|
|
22
|
+
| Entry | Type | Purpose |
|
|
23
|
+
|:--|:--|:--|
|
|
24
|
+
| `rhi` | `RhiInstance & { acquireCanvasContext; createShaderModule }` | Singleton; inject into `createRenderer({ rhi })` |
|
|
25
|
+
| `rhi.requestAdapter(opts?, canvas?)` | `async fn` | Returns `ok(new RhiNullAdapter())` |
|
|
26
|
+
| `rhi.createShaderModule(device, desc)` | `async fn` | Returns `ok(ShaderModule)` without real compile |
|
|
27
|
+
| `rhi.acquireCanvasContext(canvas?)` | `fn` | Returns `ok(RhiNullCanvasContext)` for any canvas / null / undefined |
|
|
28
|
+
| `rhi.adapter.requestDevice()` | `async fn` | Returns `ok(new RhiNullDevice(queue, encoderFactory))` |
|
|
29
|
+
| `RhiNullDevice` | class `implements RhiDevice` | All `create*` mint legal brands + ledger entries; all `destroy*` fail-fast on double-destroy |
|
|
30
|
+
| `RhiNullQueue` | class `implements RhiQueue` | `submit` returns `ok`; `onSubmittedWorkDone` resolves immediately |
|
|
31
|
+
|
|
32
|
+
## Capabilities
|
|
33
|
+
|
|
34
|
+
`renderer.inspect().capabilities` reports the D-5 profile: every boolean cap is `true` except the three `@reserved-for-wgpu-native-only` fields (`multiDrawIndirect`, `pushConstants`, `textureBindingArray`), which are `false`. `maxColorAttachments` is 8. The headless backend maximizes structural coverage -- any `caps.X` gate in the engine codebase passes through:
|
|
35
|
+
|
|
36
|
+
| Cap | Value | Note |
|
|
37
|
+
|:--|:--|:--|
|
|
38
|
+
| `backendKind` | `'null'` | 4th union member alongside `'webgpu'` / `'wgpu-native'` / `'wgpu-webgl2'` |
|
|
39
|
+
| `compute` | `true` | |
|
|
40
|
+
| `timestampQuery` | `false` | Structural backend; GPU timing is refused |
|
|
41
|
+
| `indirectDrawing` | `true` | |
|
|
42
|
+
| `textureCompressionBc` | `false` | headless has no compression hardware (AC-06) |
|
|
43
|
+
| `textureCompressionEtc2` | `false` | headless has no compression hardware (AC-06) |
|
|
44
|
+
| `textureCompressionAstc` | `false` | headless has no compression hardware (AC-06) |
|
|
45
|
+
| `multiDrawIndirect` | `false` | `@reserved-for-wgpu-native-only` |
|
|
46
|
+
| `pushConstants` | `false` | `@reserved-for-wgpu-native-only` |
|
|
47
|
+
| `textureBindingArray` | `false` | `@reserved-for-wgpu-native-only` |
|
|
48
|
+
| `samplerAliasing` | `true` | |
|
|
49
|
+
| `firstInstanceIndirect` | `true` | |
|
|
50
|
+
| `storageBuffer` | `true` | |
|
|
51
|
+
| `storageTexture` | `true` | |
|
|
52
|
+
| `rgba16floatRenderable` | `true` | |
|
|
53
|
+
| `rg11b10ufloatRenderable` | `true` | |
|
|
54
|
+
| `float32Filterable` | `true` | |
|
|
55
|
+
| `maxColorAttachments` | `8` | >= 4 (HDRP deferred minimum) |
|
|
56
|
+
|
|
57
|
+
> [!WARNING]
|
|
58
|
+
> RhiNull is deliberately non-timing. Timestamp query creation returns a
|
|
59
|
+
> structured feature error and membership timing must terminate as
|
|
60
|
+
> `timestamp-query-unsupported`; do not turn the structural ledger into fake
|
|
61
|
+
> GPU evidence.
|
|
62
|
+
|
|
63
|
+
`device.features` returns an empty `ReadonlySet`; `device.limits` returns an empty `Record`. Capability planning reads `caps` booleans, not the feature set.
|
|
64
|
+
|
|
65
|
+
## Handle bookkeeping
|
|
66
|
+
|
|
67
|
+
Every `create*` call on `RhiNullDevice` registers the returned handle in a per-device `Bookkeeper`. Each ledger row is a `HandleRecord`:
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
interface HandleRecord {
|
|
71
|
+
readonly id: number; // per-device monotonic
|
|
72
|
+
readonly kind: string; // 'Buffer' / 'Texture' / 'BindGroupLayout' / ...
|
|
73
|
+
destroyed: boolean; // flipped on first destroy
|
|
74
|
+
readonly sourceDeviceId: number; // cross-device validation
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Readback for assertions** -- the device ledger is an owner-local test concern. Public `Renderer` exposes no device; inject the RhiNull pack into a package-local construction test when counters are needed:
|
|
79
|
+
|
|
80
|
+
```ts
|
|
81
|
+
import type { RhiNullDevice } from '@forgeax/engine-rhi-null';
|
|
82
|
+
|
|
83
|
+
const device = ownerLocalDevice as RhiNullDevice;
|
|
84
|
+
device.totalDrawCount = 0; // reset before a frame if you assert deltas
|
|
85
|
+
device.totalDispatchCount = 0;
|
|
86
|
+
renderer.draw(world);
|
|
87
|
+
const records = device.bookkeeper.allRecords(); // snapshot of all ledger rows
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
M3 unit tests read this to assert:
|
|
91
|
+
|
|
92
|
+
- **Create / destroy pairing** (`kind: 'Buffer'` count == `kind: 'Buffer'` with `destroyed === true` count)
|
|
93
|
+
- **Draw count >= 1** (`device.totalDrawCount` after `renderer.draw(world)`)
|
|
94
|
+
- **Compute dispatch count** (`device.totalDispatchCount`, including indirect dispatch)
|
|
95
|
+
- **Bind-group assembly counts** (`device.totalBindGroupCount`)
|
|
96
|
+
- **Pass schedule order** -- prefer the type-safe `renderer.perFramePassNames` (no cast needed); `device.framePassNames` is the same data on the cast `RhiNullDevice`
|
|
97
|
+
- **BGL / PSO shape** (ledger entries with `kind: 'BindGroupLayout'` / `kind: 'RenderPipeline'`)
|
|
98
|
+
|
|
99
|
+
**Handle-chain validation** -- `setVertexBuffer` / `setBindGroup` validate handle ownership. A handle issued by device A passed to device B returns `err({ code: 'rhi-not-available', expected, hint })`. A second `destroy` on the same handle returns `err({ code: 'destroy-after-destroy', expected, hint })`. Zero new `RhiErrorCode` members -- reuses existing closed-union codes (D-1).
|
|
100
|
+
|
|
101
|
+
## Pipeline `getBindGroupLayout`
|
|
102
|
+
|
|
103
|
+
`createRenderPipeline` and `createComputePipeline` return pipeline handles that carry a no-op `getBindGroupLayout(index)` method (D-2). The method returns a legal `BindGroupLayout` brand registered in the ledger, so the auto-layout path in `debug-draw.ts` and existing mock unit tests do not crash on a missing method.
|
|
104
|
+
|
|
105
|
+
## Boundaries
|
|
106
|
+
|
|
107
|
+
- **Structural only, never produces pixels.** RhiNull covers the command-stream protocol layer (buffer / texture / bind-group / pipeline / pass-encoder creation and submission). It does not execute shaders, write to GPU memory, or produce render-target contents. `getCurrentTexture()` returns a brand with no pixel data.
|
|
108
|
+
- **Does not replace dawn / browser pixel readback.** Smoke tests (`apps/hello/*`, `apps/learn-render/*`) still need a real GPU backend (`rhi-webgpu` or `rhi-wgpu`). RhiNull is for `test:unit` structural assertions, not visual verification.
|
|
109
|
+
- **No image-channel dependency** (charter P2). The README is ASCII-only; the backend has no screenshots, no pixel baselines, no render-target PNGs.
|
|
110
|
+
- **Per-renderer instances are independent.** Each `createRenderer({ rhi })` creates a fresh `RhiNullDevice` with its own `Bookkeeper`. Cross-instance handle pollution is impossible because each device's ledger keys on `sourceDeviceId`.
|
|
111
|
+
- **`'null'` union member meaning.** The 3 pre-existing backends (`webgpu` / `wgpu-native` / `wgpu-webgl2`) are unchanged. `'null'` is the 4th member, representing "no real GPU -- structural-only command-stream ledger." `render-graph` barrier insertion treats it as no-barrier (same equivalence group as `webgpu` / `wgpu-webgl2`).
|
|
112
|
+
|
|
113
|
+
## Distinction from vitest mocks
|
|
114
|
+
|
|
115
|
+
| Aspect | vitest mock (`vi.fn()`) | RhiNull (`createRenderer({ rhi })`) |
|
|
116
|
+
|:--|:--|:--|
|
|
117
|
+
| Surface | Partial stub (caller chooses what to mock) | Full `implements RhiDevice` (tsc-complete) |
|
|
118
|
+
| Ledger | None (assert `.toHaveBeenCalled()` on mocks) | `Bookkeeper.allRecords()` + `totalDrawCount` / `framePassNames` |
|
|
119
|
+
| Integration depth | Tests one function call at a time | Exercises real `createRenderer` -> `Result<Renderer>` -> `renderer.draw(frame)` path |
|
|
120
|
+
| Handle validation | None | Cross-device and double-destroy fail-fast |
|
|
121
|
+
| Render-graph coverage | Mock `RhiCommandEncoder` return values | Real pass scheduling through URP default pipeline |
|
|
122
|
+
|
|
123
|
+
Use vitest mocks for isolated unit tests (single function / class). Use RhiNull for structural integration tests that need the full engine lifecycle (renderer init -> draw -> command flow).
|
|
124
|
+
|
|
125
|
+
## Dependencies
|
|
126
|
+
|
|
127
|
+
- `@forgeax/engine-rhi` (workspace) -- interface contract SSOT.
|
|
128
|
+
- `@forgeax/engine-types` (workspace) -- POD types / `Result` SSOT.
|
|
129
|
+
- `@webgpu/types` (workspace) -- descriptor type alignment; no real GPU binding.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"fileNames":["../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../types/dist/animation-target.d.ts","../../types/dist/asset-errors.d.ts","../../types/dist/result.d.ts","../../types/dist/asset-evidence.d.ts","../../types/dist/asset.d.ts","../../types/dist/material/color-space.d.ts","../../types/dist/material/asset.d.ts","../../types/dist/vfx.d.ts","../../types/dist/asset-runtime.d.ts","../../types/dist/handle.d.ts","../../types/dist/material/errors.d.ts","../../types/dist/material/resolve.d.ts","../../types/dist/material/index.d.ts","../../types/dist/asset-producer.d.ts","../../types/dist/catalog.d.ts","../../types/dist/runtime-scope.d.ts","../../types/dist/derive-paramschema.d.ts","../../types/dist/import.d.ts","../../types/dist/index.d.ts","../../rhi/dist/errors.d.ts","../../rhi/dist/index.d.ts","../src/bookkeeping.ts","../src/device.ts","../src/pass-encoders.ts","../src/command-encoder.ts","../src/queue.ts","../src/adapter.ts","../src/canvas-context.ts","../src/shader.ts","../src/index.ts","../../../node_modules/.pnpm/@webgpu+types@0.1.71/node_modules/@webgpu/types/dist/index.d.ts"],"fileIdsList":[[78,80,82,84,85],[78,80],[78,80,81,82,83],[78,80,81],[78,80,82,83,84,85,86,87,88],[78],[78,79],[61,62,64],[61,62,64,78],[63],[62,64,73],[61,73,74,75,78],[60,61,62,64,66,67,68,69,72,73,74,75,76,77],[65,78],[66],[65,66,70,71],[62,66,70],[73,74]],"fileInfos":[{"version":"bcd24271a113971ba9eb71ff8cb01bc6b0f872a85c23fdbe5d93065b375933cd","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f88bedbeb09c6f5a6645cb24c7c55f1aa22d19ae96c8e6959cbd8b85a707bc6","impliedFormat":1},{"version":"7fe93b39b810eadd916be8db880dd7f0f7012a5cc6ffb62de8f62a2117fa6f1f","impliedFormat":1},{"version":"bb0074cc08b84a2374af33d8bf044b80851ccc9e719a5e202eacf40db2c31600","impliedFormat":1},{"version":"1a7daebe4f45fb03d9ec53d60008fbf9ac45a697fdc89e4ce218bc94b94f94d6","impliedFormat":1},{"version":"f94b133a3cb14a288803be545ac2683e0d0ff6661bcd37e31aaaec54fc382aed","impliedFormat":1},{"version":"f59d0650799f8782fd74cf73c19223730c6d1b9198671b1c5b3a38e1188b5953","impliedFormat":1},{"version":"8a15b4607d9a499e2dbeed9ec0d3c0d7372c850b2d5f1fb259e8f6d41d468a84","impliedFormat":1},{"version":"26e0fe14baee4e127f4365d1ae0b276f400562e45e19e35fd2d4c296684715e6","impliedFormat":1},{"version":"d6b1eba8496bdd0eed6fc8a685768fe01b2da4a0388b5fe7df558290bffcf32f","affectsGlobalScope":true,"impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","impliedFormat":1},{"version":"eadcffda2aa84802c73938e589b9e58248d74c59cb7fcbca6474e3435ac15504","affectsGlobalScope":true,"impliedFormat":1},{"version":"105ba8ff7ba746404fe1a2e189d1d3d2e0eb29a08c18dded791af02f29fb4711","affectsGlobalScope":true,"impliedFormat":1},{"version":"00343ca5b2e3d48fa5df1db6e32ea2a59afab09590274a6cccb1dbae82e60c7c","affectsGlobalScope":true,"impliedFormat":1},{"version":"ebd9f816d4002697cb2864bea1f0b70a103124e18a8cd9645eeccc09bdf80ab4","affectsGlobalScope":true,"impliedFormat":1},{"version":"2c1afac30a01772cd2a9a298a7ce7706b5892e447bb46bdbeef720f7b5da77ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"7b0225f483e4fa685625ebe43dd584bb7973bbd84e66a6ba7bbe175ee1048b4f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c0a4b8ac6ce74679c1da2b3795296f5896e31c38e888469a8e0f99dc3305de60","affectsGlobalScope":true,"impliedFormat":1},{"version":"3084a7b5f569088e0146533a00830e206565de65cae2239509168b11434cd84f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5079c53f0f141a0698faa903e76cb41cd664e3efb01cc17a5c46ec2eb0bef42","affectsGlobalScope":true,"impliedFormat":1},{"version":"32cafbc484dea6b0ab62cf8473182bbcb23020d70845b406f80b7526f38ae862","affectsGlobalScope":true,"impliedFormat":1},{"version":"fca4cdcb6d6c5ef18a869003d02c9f0fd95df8cfaf6eb431cd3376bc034cad36","affectsGlobalScope":true,"impliedFormat":1},{"version":"b93ec88115de9a9dc1b602291b85baf825c85666bf25985cc5f698073892b467","affectsGlobalScope":true,"impliedFormat":1},{"version":"f5c06dcc3fe849fcb297c247865a161f995cc29de7aa823afdd75aaaddc1419b","affectsGlobalScope":true,"impliedFormat":1},{"version":"b77e16112127a4b169ef0b8c3a4d730edf459c5f25fe52d5e436a6919206c4d7","affectsGlobalScope":true,"impliedFormat":1},{"version":"fbffd9337146eff822c7c00acbb78b01ea7ea23987f6c961eba689349e744f8c","affectsGlobalScope":true,"impliedFormat":1},{"version":"a995c0e49b721312f74fdfb89e4ba29bd9824c770bbb4021d74d2bf560e4c6bd","affectsGlobalScope":true,"impliedFormat":1},{"version":"c7b3542146734342e440a84b213384bfa188835537ddbda50d30766f0593aff9","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce6180fa19b1cccd07ee7f7dbb9a367ac19c0ed160573e4686425060b6df7f57","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f02e2476bccb9dbe21280d6090f0df17d2f66b74711489415a8aa4df73c9675","affectsGlobalScope":true,"impliedFormat":1},{"version":"45e3ab34c1c013c8ab2dc1ba4c80c780744b13b5676800ae2e3be27ae862c40c","affectsGlobalScope":true,"impliedFormat":1},{"version":"805c86f6cca8d7702a62a844856dbaa2a3fd2abef0536e65d48732441dde5b5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"e42e397f1a5a77994f0185fd1466520691456c772d06bf843e5084ceb879a0ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"f4c2b41f90c95b1c532ecc874bd3c111865793b23aebcc1c3cbbabcd5d76ffb0","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab26191cfad5b66afa11b8bf935ef1cd88fabfcb28d30b2dfa6fad877d050332","affectsGlobalScope":true,"impliedFormat":1},{"version":"2088bc26531e38fb05eedac2951480db5309f6be3fa4a08d2221abb0f5b4200d","affectsGlobalScope":true,"impliedFormat":1},{"version":"cb9d366c425fea79716a8fb3af0d78e6b22ebbab3bd64d25063b42dc9f531c1e","affectsGlobalScope":true,"impliedFormat":1},{"version":"500934a8089c26d57ebdb688fc9757389bb6207a3c8f0674d68efa900d2abb34","affectsGlobalScope":true,"impliedFormat":1},{"version":"689da16f46e647cef0d64b0def88910e818a5877ca5379ede156ca3afb780ac3","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc21cc8b6fee4f4c2440d08035b7ea3c06b3511314c8bab6bef7a92de58a2593","affectsGlobalScope":true,"impliedFormat":1},{"version":"7ca53d13d2957003abb47922a71866ba7cb2068f8d154877c596d63c359fed25","affectsGlobalScope":true,"impliedFormat":1},{"version":"54725f8c4df3d900cb4dac84b64689ce29548da0b4e9b7c2de61d41c79293611","affectsGlobalScope":true,"impliedFormat":1},{"version":"e5594bc3076ac29e6c1ebda77939bc4c8833de72f654b6e376862c0473199323","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f3eb332c2d73e729f3364fcc0c2b375e72a121e8157d25a82d67a138c83a95c","affectsGlobalScope":true,"impliedFormat":1},{"version":"6f4427f9642ce8d500970e4e69d1397f64072ab73b97e476b4002a646ac743b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"48915f327cd1dea4d7bd358d9dc7732f58f9e1626a29cc0c05c8c692419d9bb7","affectsGlobalScope":true,"impliedFormat":1},{"version":"b7bf9377723203b5a6a4b920164df22d56a43f593269ba6ae1fdc97774b68855","affectsGlobalScope":true,"impliedFormat":1},{"version":"db9709688f82c9e5f65a119c64d835f906efe5f559d08b11642d56eb85b79357","affectsGlobalScope":true,"impliedFormat":1},{"version":"4b25b8c874acd1a4cf8444c3617e037d444d19080ac9f634b405583fd10ce1f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"37be57d7c90cf1f8112ee2636a068d8fd181289f82b744160ec56a7dc158a9f5","affectsGlobalScope":true,"impliedFormat":1},{"version":"a917a49ac94cd26b754ab84e113369a75d1a47a710661d7cd25e961cc797065f","affectsGlobalScope":true,"impliedFormat":1},{"version":"6d3261badeb7843d157ef3e6f5d1427d0eeb0af0cf9df84a62cfd29fd47ac86e","affectsGlobalScope":true,"impliedFormat":1},{"version":"195daca651dde22f2167ac0d0a05e215308119a3100f5e6268e8317d05a92526","affectsGlobalScope":true,"impliedFormat":1},{"version":"8b11e4285cd2bb164a4dc09248bdec69e9842517db4ca47c1ba913011e44ff2f","affectsGlobalScope":true,"impliedFormat":1},{"version":"0508571a52475e245b02bc50fa1394065a0a3d05277fbf5120c3784b85651799","affectsGlobalScope":true,"impliedFormat":1},{"version":"8f9af488f510c3015af3cc8c267a9e9d96c4dd38a1fdff0e11dc5a544711415b","affectsGlobalScope":true,"impliedFormat":1},{"version":"fc611fea8d30ea72c6bbfb599c9b4d393ce22e2f5bfef2172534781e7d138104","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ce14b81c5cc821994aa8ec1d42b220dd41b27fcc06373bce3958af7421b77d4","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3a048b3e9302ef9a34ef4ebb9aecfb28b66abb3bce577206a79fee559c230da","affectsGlobalScope":true,"impliedFormat":1},"89fe170d9a59f81cd9a9d95de3278f108ff91491810b2529cc0ffb502a57b6c0","0b4928041c807c01b33b1fa028236df635c52f7acff5a40f2c2d0d677b53428b","5ad2e5b8b17893d0eb1f11a1b6e8c03b17344be03a6a72a624cd38ab05fe4d5c","6a1e553079e654a1771463e9eeb98ea4f7bb4b6417a5237d4fdf9b546d49647f","7f11be86b9ac5c2cd5127cd9d40ccc7694c58868a3157692a153d452fc171525","6e3488ee1183ea915eb43f08aebc5f75e30be25aef1f678d1965324bdd7506e1","bc2f20caa6ccca429df0bf6a6f21506c4b00f9b171fdc3a4b6ada1775252db31","a318d8734523d9e750681e7b8e685ef817d4049c5612451f4e849da8b2b572a9","8b52dd8be86f44f871db89a6c1f77f7585688d53141ff55b6c5fac3eb67b1241","beae2d03867dde9fdf8da461c7e7e84da71612842422d4b482ab1c2a15fe6b12","080e7748d9754ccaea8debbc933552c7976c1ef588f9642a6f07e5a4d139d43b","51342c51a9090c0bc8bae60c5ec1a0f46d6d44db84392f12a8cd46e6d8a9f617","ae777307a0baeb9b5d7ba18e6a029a54eb0b612b1491591dcedb020cc8d36f97","d7ba738e316b7baed10ca49cc156b57b8c973b747bec6612e62a925e9f7f33a4","1d5292578fcf0329a43ef19fe2481d7d1cde75e75610019a7897c70dcfff0b31","459b3765e622008ed590474ae6b61ab55107a7b9529a28d05087a6fef51d7248","e1f11ad703121f97a74001059d054aba25c9c4662af44da05ead0a247fe18742","d9c64d02dfe3a9c74da35fdbcc645cf4e8d4ca0f4162ec312de51474103ac3a7","f4fbd89956010d9d27d3bbc562f0e5e00d374ba03a3f3bb11bcc94f5505bc3d2","8d6101c60d99ac57af23b947db35bedaa5580f2e7ae126c5b39841aa423cd242","28361b3472a80a6249aa6db3122c2ebe8a24be0310c071e64b79cd1cd3c2f297",{"version":"e6ab1909f187622ae669cf63724c9ea605a205b6722963f0c3c8128a1e6d6604","signature":"09dc81335309c1cbd4e76e059081d600202d1ee94f28f472f7e268bbe3038f3c"},{"version":"6a379a45f68b6512c078edc38dbe923bfa4602e913dde8a9ba2a82e2ea99b4b8","signature":"144f48de4a0e8e5edfa2401d214040eda94438dd1259a0df1a330cb5a50cedc9"},{"version":"50785ac8e17f7830df875aed608bcd406b617477c1a59f240405e0b113bacb94","signature":"e8238980485ff78002802ba1459cc9c3d535b4780d9e5fd93275b431ce22b976"},{"version":"7440f13da434317832dfc31f4a08277b2f4b1bddac770fdbf2833a678853ea68","signature":"7be5a6082d47bfc5a4734c782c9aec453bf59d10fc303841f21c6babcb2e61f2"},{"version":"4494b76dd2de2fe3496eff1c73f011b5b90f702ca50c89a584117686f306bc7b","signature":"fc304265d07f6f2f6375b9940342f00ac07310d129744314cc4e498fbde8a2cd"},{"version":"5c922107890068582021093ebb548c2c9c95e3fb76c68f02bdf4293410652828","signature":"fcc13b35d46376913754604f7b81009164b5622798324ca14a0faaeb88b302d9"},{"version":"827972af1602afdf6980f358beabe2434441e3b09783db6795a6a0b199d30aa7","signature":"d4dba6009e05b0c51e668d54ba8756d76a5c80c342a8e18f7adcde962c130a21"},{"version":"daaf595617f9e5d7315f958ba0f35127e94400033cf13564f7ed7fc467e667cc","signature":"a3a9d29a44d494ebcd48e3745a0cfb086ea2ec547372e8994ecd869f9b37c203"},{"version":"84cfde571cec4735a9f768e9f74cf9ff728fd8be13017c7acd127aa2a97904a8","signature":"853323635a5dab6bb009411a2af0c65a7126d18b3aafdb65591b1034311b0ad4"},{"version":"d2e5cfb2397ec8cacfd30de0e6f7992eb7db7b02cc83b7c43ef58bcd5aa88bc3","affectsGlobalScope":true,"impliedFormat":1}],"root":[[81,89]],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"exactOptionalPropertyTypes":true,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitOverride":true,"noImplicitReturns":true,"noUncheckedIndexedAccess":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../src","skipLibCheck":true,"strict":true,"target":9,"tsBuildInfoFile":"./.tsbuildinfo","useDefineForClassFields":true,"verbatimModuleSyntax":true},"referencedMap":[[86,1],[81,2],[87,2],[84,3],[82,4],[89,5],[83,4],[85,2],[88,2],[79,6],[80,7],[63,8],[68,9],[64,10],[74,11],[76,6],[69,6],[77,12],[78,13],[66,14],[65,15],[72,16],[71,17],[75,18]],"latestChangedDtsFile":"./index.d.ts","version":"6.0.3"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { RequestDeviceOptions, Result, RhiAdapter, RhiDevice, RhiError as RhiErrorType } from '@forgeax/engine-rhi';
|
|
2
|
+
/** Headless adapter. Holds an empty feature set + limits map; requestDevice
|
|
3
|
+
* builds a fully-wired RhiNullDevice. */
|
|
4
|
+
export declare class RhiNullAdapter implements RhiAdapter {
|
|
5
|
+
readonly features: ReadonlySet<GPUFeatureName>;
|
|
6
|
+
readonly limits: Readonly<Record<string, number>>;
|
|
7
|
+
requestDevice(_opts?: RequestDeviceOptions | undefined): Promise<Result<RhiDevice, RhiErrorType>>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,oBAAoB,EACpB,MAAM,EACN,UAAU,EACV,SAAS,EACT,QAAQ,IAAI,YAAY,EACzB,MAAM,qBAAqB,CAAC;AAM7B;0CAC0C;AAC1C,qBAAa,cAAe,YAAW,UAAU;IAC/C,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,cAAc,CAAC,CAAa;IAC3D,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAM;IAIvD,aAAa,CACX,KAAK,CAAC,EAAE,oBAAoB,GAAG,SAAS,GACvC,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;CAO5C"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { Result, RhiError as RhiErrorType } from '@forgeax/engine-rhi';
|
|
2
|
+
/**
|
|
3
|
+
* One ledger row for an issued opaque-handle brand.
|
|
4
|
+
*
|
|
5
|
+
* - `id` — per-device monotonic numeric id assigned at register time; the value
|
|
6
|
+
* M3 assertions read back to pair create / destroy and count draws.
|
|
7
|
+
* - `kind` — the handle category (`'Buffer'` / `'Texture'` / `'BindGroupLayout'`
|
|
8
|
+
* etc.); free-form so every create* entry can tag what it minted.
|
|
9
|
+
* - `destroyed` — flipped to `true` by the first destroy; a second destroy
|
|
10
|
+
* fail-fasts via `'destroy-after-destroy'`.
|
|
11
|
+
* - `sourceDeviceId` — the id of the device that issued the handle; cross-device
|
|
12
|
+
* use fail-fasts via `'rhi-not-available'`.
|
|
13
|
+
*/
|
|
14
|
+
export interface HandleRecord {
|
|
15
|
+
readonly id: number;
|
|
16
|
+
readonly kind: string;
|
|
17
|
+
destroyed: boolean;
|
|
18
|
+
readonly sourceDeviceId: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The brand attachment RhiNull stamps onto every issued handle object so the
|
|
22
|
+
* ledger can be recovered from the handle alone (handle-chain validation reads
|
|
23
|
+
* `handle[BOOKKEEPING_KEY]` rather than holding a side Map keyed on identity,
|
|
24
|
+
* which would leak across device instances).
|
|
25
|
+
*
|
|
26
|
+
* Lives behind a module-private symbol so it never collides with a real RHI
|
|
27
|
+
* brand symbol and never appears in the public `.d.ts` surface.
|
|
28
|
+
*/
|
|
29
|
+
export declare const BOOKKEEPING_KEY: unique symbol;
|
|
30
|
+
/** A handle object as RhiNull mints it: a plain object carrying its ledger row
|
|
31
|
+
* under the private bookkeeping symbol, cast to the relevant brand at the
|
|
32
|
+
* create* call site. */
|
|
33
|
+
export interface BookkeptHandle {
|
|
34
|
+
readonly [BOOKKEEPING_KEY]: HandleRecord;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Per-device handle ledger. One Bookkeeper instance lives on each
|
|
38
|
+
* RhiNullDevice; it assigns the device id at construction and mints monotonic
|
|
39
|
+
* handle ids thereafter.
|
|
40
|
+
*/
|
|
41
|
+
export declare class Bookkeeper {
|
|
42
|
+
readonly deviceId: number;
|
|
43
|
+
private nextHandleId;
|
|
44
|
+
private readonly records;
|
|
45
|
+
constructor(deviceId: number);
|
|
46
|
+
/**
|
|
47
|
+
* Register a freshly-minted handle of the given kind, returning a plain
|
|
48
|
+
* object that carries its ledger row. The caller casts the return value to
|
|
49
|
+
* the concrete brand (`as unknown as Buffer` etc.).
|
|
50
|
+
*/
|
|
51
|
+
register(kind: string): BookkeptHandle;
|
|
52
|
+
/**
|
|
53
|
+
* Mark a handle destroyed. Fail-fasts on a second destroy
|
|
54
|
+
* ('destroy-after-destroy') or on a handle issued by a different device
|
|
55
|
+
* ('rhi-not-available'); otherwise flips the destroyed flag and returns ok.
|
|
56
|
+
*/
|
|
57
|
+
destroy(handle: unknown): Result<void, RhiErrorType>;
|
|
58
|
+
/**
|
|
59
|
+
* Report whether a handle has already been destroyed (true once destroy()
|
|
60
|
+
* has flipped its flag). Used by command-stream methods that must not
|
|
61
|
+
* consume a stale handle.
|
|
62
|
+
*/
|
|
63
|
+
isDestroyed(handle: unknown): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Validate that a handle was issued by THIS device. Returns the ledger row on
|
|
66
|
+
* success so callers can mutate it (e.g. flip destroyed); returns
|
|
67
|
+
* 'rhi-not-available' for a foreign handle (AC-09 — no silent pass).
|
|
68
|
+
*/
|
|
69
|
+
validateOwnership(handle: unknown): Result<HandleRecord, RhiErrorType>;
|
|
70
|
+
/**
|
|
71
|
+
* Return all ledger rows as a readonly array. M3 unit tests (w17) read this
|
|
72
|
+
* to assert create/destroy pairing, BGL/PSO shape counts, and resource
|
|
73
|
+
* lifecycle coverage (AC-05/06/07). Returns a snapshot of the current Map
|
|
74
|
+
* so callers can iterate without a stale reference after further mutations.
|
|
75
|
+
*/
|
|
76
|
+
allRecords(): readonly HandleRecord[];
|
|
77
|
+
/** Report the total number of records in the ledger. */
|
|
78
|
+
recordCount(): number;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Validation function: has this handle already been destroyed? Returns ok(void)
|
|
82
|
+
* for a live handle; returns 'destroy-after-destroy' for a handle whose ledger
|
|
83
|
+
* row is flagged destroyed (charter P3 fail-fast over silent idempotency).
|
|
84
|
+
*/
|
|
85
|
+
export declare function isHandleDestroyed(handle: unknown): Result<void, RhiErrorType>;
|
|
86
|
+
//# sourceMappingURL=bookkeeping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookkeeping.d.ts","sourceRoot":"","sources":["../src/bookkeeping.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAI5E;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,eAAyC,CAAC;AAEtE;;yBAEyB;AACzB,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,CAAC,eAAe,CAAC,EAAE,YAAY,CAAC;CAC1C;AAED;;;;GAIG;AACH,qBAAa,UAAU;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmC;gBAE/C,QAAQ,EAAE,MAAM;IAI5B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc;IAYtC;;;;OAIG;IACH,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC;IASpD;;;;OAIG;IACH,WAAW,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO;IAIrC;;;;OAIG;IACH,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,YAAY,EAAE,YAAY,CAAC;IActE;;;;;OAKG;IACH,UAAU,IAAI,SAAS,YAAY,EAAE;IAIrC,wDAAwD;IACxD,WAAW,IAAI,MAAM;CAGtB;AAUD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAW7E"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CanvasConfiguration, Result, RhiCanvasContext, RhiError as RhiErrorType, Texture } from '@forgeax/engine-rhi';
|
|
2
|
+
/**
|
|
3
|
+
* Headless canvas context. configure succeeds vacuously; getCurrentTexture
|
|
4
|
+
* mints a legal opaque-handle Texture brand so the swap-chain acquisition path
|
|
5
|
+
* never blocks frame rendering in headless CI.
|
|
6
|
+
*/
|
|
7
|
+
export declare class RhiNullCanvasContext implements RhiCanvasContext {
|
|
8
|
+
configure(_desc: CanvasConfiguration): Result<void, RhiErrorType>;
|
|
9
|
+
unconfigure(): void;
|
|
10
|
+
getConfiguration(): CanvasConfiguration | undefined;
|
|
11
|
+
getCurrentTexture(): Result<Texture, RhiErrorType>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Acquire a canvas context. The headless backend returns ok(context) so the
|
|
15
|
+
* createRenderer context-acquisition step succeeds. The context's
|
|
16
|
+
* getCurrentTexture mints a legal Texture brand once a bookkeeper is attached.
|
|
17
|
+
*
|
|
18
|
+
* R-1: this is mounted on the rhi singleton so Channel 1's facade never
|
|
19
|
+
* crashes on a missing acquireCanvasContext.
|
|
20
|
+
*/
|
|
21
|
+
export declare function acquireCanvasContext(_canvas?: HTMLCanvasElement | OffscreenCanvas | null | undefined): Result<RhiCanvasContext, RhiErrorType>;
|
|
22
|
+
//# sourceMappingURL=canvas-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canvas-context.d.ts","sourceRoot":"","sources":["../src/canvas-context.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EACV,mBAAmB,EACnB,MAAM,EACN,gBAAgB,EAChB,QAAQ,IAAI,YAAY,EACxB,OAAO,EACR,MAAM,qBAAqB,CAAC;AAG7B;;;;GAIG;AACH,qBAAa,oBAAqB,YAAW,gBAAgB;IAC3D,SAAS,CAAC,KAAK,EAAE,mBAAmB,GAAG,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC;IAIjE,WAAW,IAAI,IAAI;IAEnB,gBAAgB,IAAI,mBAAmB,GAAG,SAAS;IAInD,iBAAiB,IAAI,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC;CAMnD;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,CAAC,EAAE,iBAAiB,GAAG,eAAe,GAAG,IAAI,GAAG,SAAS,GAC/D,MAAM,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAExC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Buffer, CommandBuffer, ComputePassDescriptor, QuerySet, RenderPassDescriptor, Result, RhiCommandEncoder, RhiComputePassEncoder, RhiError as RhiErrorType, RhiRenderPassEncoder } from '@forgeax/engine-rhi';
|
|
2
|
+
import type { Bookkeeper } from './bookkeeping';
|
|
3
|
+
import type { RhiNullDevice } from './device';
|
|
4
|
+
/**
|
|
5
|
+
* Headless command encoder. begin*Pass returns a no-op pass encoder bound to
|
|
6
|
+
* the issuing device's ledger; recording methods are no-ops; finish mints a
|
|
7
|
+
* CommandBuffer brand.
|
|
8
|
+
*/
|
|
9
|
+
export declare class RhiNullCommandEncoder implements RhiCommandEncoder {
|
|
10
|
+
private readonly bookkeeper;
|
|
11
|
+
private readonly counter;
|
|
12
|
+
constructor(bookkeeper: Bookkeeper, device: RhiNullDevice);
|
|
13
|
+
beginRenderPass(desc: RenderPassDescriptor): RhiRenderPassEncoder;
|
|
14
|
+
beginComputePass(desc?: ComputePassDescriptor | undefined): RhiComputePassEncoder;
|
|
15
|
+
copyBufferToBuffer(_source: Buffer, _sourceOffsetOrDestination: number | Buffer, _destinationOrSize?: Buffer | number | undefined, _destinationOffset?: number | undefined, _size?: number | undefined): void;
|
|
16
|
+
copyBufferToTexture(_source: GPUTexelCopyBufferInfo, _destination: GPUTexelCopyTextureInfo, _copySize: GPUExtent3DStrict): void;
|
|
17
|
+
copyTextureToBuffer(_source: GPUTexelCopyTextureInfo, _destination: GPUTexelCopyBufferInfo, _copySize: GPUExtent3DStrict): void;
|
|
18
|
+
copyTextureToTexture(_source: GPUTexelCopyTextureInfo, _destination: GPUTexelCopyTextureInfo, _copySize: GPUExtent3DStrict): void;
|
|
19
|
+
clearBuffer(_buffer: Buffer, _offset?: number | undefined, _size?: number | undefined): void;
|
|
20
|
+
resolveQuerySet(_querySet: QuerySet, _firstQuery: number, _queryCount: number, _destination: Buffer, _destinationOffset: number): Result<void, RhiErrorType>;
|
|
21
|
+
writeTimestamp(_querySet: QuerySet, _queryIndex: number): void;
|
|
22
|
+
pushDebugGroup(_groupLabel: string): void;
|
|
23
|
+
popDebugGroup(): void;
|
|
24
|
+
insertDebugMarker(_markerLabel: string): void;
|
|
25
|
+
finish(): Result<CommandBuffer, RhiErrorType>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=command-encoder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-encoder.d.ts","sourceRoot":"","sources":["../src/command-encoder.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACV,MAAM,EACN,aAAa,EACb,qBAAqB,EACrB,QAAQ,EACR,oBAAoB,EACpB,MAAM,EACN,iBAAiB,EACjB,qBAAqB,EACrB,QAAQ,IAAI,YAAY,EACxB,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AA2C9C;;;;GAIG;AACH,qBAAa,qBAAsB,YAAW,iBAAiB;IAC7D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;gBAE1B,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa;IAKzD,eAAe,CAAC,IAAI,EAAE,oBAAoB,GAAG,oBAAoB;IAKjE,gBAAgB,CAAC,IAAI,CAAC,EAAE,qBAAqB,GAAG,SAAS,GAAG,qBAAqB;IAKjF,kBAAkB,CAChB,OAAO,EAAE,MAAM,EACf,0BAA0B,EAAE,MAAM,GAAG,MAAM,EAC3C,kBAAkB,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EAChD,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,EACvC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,GACzB,IAAI;IAEP,mBAAmB,CACjB,OAAO,EAAE,sBAAsB,EAC/B,YAAY,EAAE,uBAAuB,EACrC,SAAS,EAAE,iBAAiB,GAC3B,IAAI;IAEP,mBAAmB,CACjB,OAAO,EAAE,uBAAuB,EAChC,YAAY,EAAE,sBAAsB,EACpC,SAAS,EAAE,iBAAiB,GAC3B,IAAI;IAEP,oBAAoB,CAClB,OAAO,EAAE,uBAAuB,EAChC,YAAY,EAAE,uBAAuB,EACrC,SAAS,EAAE,iBAAiB,GAC3B,IAAI;IAEP,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAE5F,eAAe,CACb,SAAS,EAAE,QAAQ,EACnB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,kBAAkB,EAAE,MAAM,GACzB,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC;IAI7B,cAAc,CAAC,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IAE9D,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAEzC,aAAa,IAAI,IAAI;IAErB,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAE7C,MAAM,IAAI,MAAM,CAAC,aAAa,EAAE,YAAY,CAAC;CAG9C"}
|
package/dist/device.d.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { BindGroup, BindGroupDescriptor, BindGroupLayout, BindGroupLayoutDescriptor, Buffer, BufferDescriptor, CommandEncoderDescriptor, ComputePipeline, ComputePipelineDescriptor, PipelineLayout, PipelineLayoutDescriptor, QuerySet, QuerySetDescriptor, RenderPipeline, RenderPipelineDescriptor, Result, RhiCaps, RhiCommandEncoder, RhiDevice, RhiError as RhiErrorType, RhiFeatures, RhiLimits, RhiQueue, Sampler, SamplerDescriptor, Texture, TextureDescriptor, TextureView, TextureViewDescriptor } from '@forgeax/engine-rhi';
|
|
2
|
+
import { Bookkeeper } from './bookkeeping';
|
|
3
|
+
/**
|
|
4
|
+
* Factory that builds a command encoder bound to a device's ledger. Injected at
|
|
5
|
+
* device construction (rather than imported here) so device.ts carries no
|
|
6
|
+
* dependency on command-encoder.ts; the singleton assembly (index.ts) supplies
|
|
7
|
+
* the real factory. The Bookkeeper and RhiNullDevice are passed so the encoder
|
|
8
|
+
* threads draw / dispatch counts + binding validation through the same per-device
|
|
9
|
+
* ledger AND writes aggregated frame stats to the device for M3 unit-test readback.
|
|
10
|
+
*/
|
|
11
|
+
export type CommandEncoderFactory = (bookkeeper: Bookkeeper, device: RhiNullDevice) => RhiCommandEncoder;
|
|
12
|
+
/**
|
|
13
|
+
* Headless no-op RhiDevice. Every create* mints a legal brand and records it;
|
|
14
|
+
* every destroy* fail-fasts a double-destroy; caps reports the all-true-except-
|
|
15
|
+
* reserved profile (D-5).
|
|
16
|
+
*/
|
|
17
|
+
export declare class RhiNullDevice implements RhiDevice {
|
|
18
|
+
private readonly internalBookkeeper;
|
|
19
|
+
private readonly nullQueue;
|
|
20
|
+
private readonly encoderFactory;
|
|
21
|
+
/** Per-frame total draw count across all pass encoders executed this frame
|
|
22
|
+
* (aggregated by the command encoder on finish, then reset). M3 unit tests
|
|
23
|
+
* (w17) read this to assert draw count >= 1 (AC-06). */
|
|
24
|
+
totalDrawCount: number;
|
|
25
|
+
/** Per-frame total direct and indirect compute dispatch count. */
|
|
26
|
+
totalDispatchCount: number;
|
|
27
|
+
/** Per-frame total bind group set count (AC-06 / AC-05 readback). */
|
|
28
|
+
totalBindGroupCount: number;
|
|
29
|
+
/** Per-frame pass names executed this frame, in schedule order (AC-04). */
|
|
30
|
+
framePassNames: string[];
|
|
31
|
+
/** The per-device handle ledger — exposed so M3 tests can assert create/destroy
|
|
32
|
+
* pairing and BGL/PSO shape counts (AC-05/06/07). */
|
|
33
|
+
get bookkeeper(): Bookkeeper;
|
|
34
|
+
constructor(queue: RhiQueue, encoderFactory: CommandEncoderFactory);
|
|
35
|
+
get caps(): RhiCaps;
|
|
36
|
+
get features(): RhiFeatures;
|
|
37
|
+
get limits(): RhiLimits;
|
|
38
|
+
get queue(): RhiQueue;
|
|
39
|
+
get lost(): Promise<{
|
|
40
|
+
readonly reason: 'destroyed' | 'unknown';
|
|
41
|
+
readonly message: string;
|
|
42
|
+
}>;
|
|
43
|
+
createBuffer(_desc: BufferDescriptor): Result<Buffer, RhiErrorType>;
|
|
44
|
+
createTexture(_desc: TextureDescriptor): Result<Texture, RhiErrorType>;
|
|
45
|
+
destroyBuffer(buf: Buffer): Result<void, RhiErrorType>;
|
|
46
|
+
destroyQuerySet(querySet: QuerySet): Result<void, RhiErrorType>;
|
|
47
|
+
destroyTexture(tex: Texture): Result<void, RhiErrorType>;
|
|
48
|
+
createTextureView(_texture: Texture, _desc: TextureViewDescriptor): Result<TextureView, RhiErrorType>;
|
|
49
|
+
createSampler(_desc?: SamplerDescriptor | undefined): Result<Sampler, RhiErrorType>;
|
|
50
|
+
createBindGroupLayout(_desc: BindGroupLayoutDescriptor): Result<BindGroupLayout, RhiErrorType>;
|
|
51
|
+
createBindGroup(_desc: BindGroupDescriptor): Result<BindGroup, RhiErrorType>;
|
|
52
|
+
createPipelineLayout(_desc: PipelineLayoutDescriptor): Result<PipelineLayout, RhiErrorType>;
|
|
53
|
+
createRenderPipeline(_desc: RenderPipelineDescriptor): Result<RenderPipeline, RhiErrorType>;
|
|
54
|
+
createComputePipeline(_desc: ComputePipelineDescriptor): Result<ComputePipeline, RhiErrorType>;
|
|
55
|
+
createQuerySet(desc: QuerySetDescriptor): Result<QuerySet, RhiErrorType>;
|
|
56
|
+
createCommandEncoder(_desc?: CommandEncoderDescriptor | undefined): Result<RhiCommandEncoder, RhiErrorType>;
|
|
57
|
+
/**
|
|
58
|
+
* Mint a pipeline handle whose object also carries the no-op
|
|
59
|
+
* `getBindGroupLayout(index)` ops method (D-2). The prod auto-layout path
|
|
60
|
+
* (debug-draw.ts) and the existing mock unit tests both call
|
|
61
|
+
* `pipeline.getBindGroupLayout(n)`; returning a legal BindGroupLayout brand
|
|
62
|
+
* (recorded in the ledger) keeps those consumers from crashing on a missing
|
|
63
|
+
* method.
|
|
64
|
+
*/
|
|
65
|
+
private makePipeline;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=device.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../src/device.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EACV,SAAS,EACT,mBAAmB,EACnB,eAAe,EACf,yBAAyB,EACzB,MAAM,EACN,gBAAgB,EAChB,wBAAwB,EACxB,eAAe,EACf,yBAAyB,EACzB,cAAc,EACd,wBAAwB,EACxB,QAAQ,EACR,kBAAkB,EAClB,cAAc,EACd,wBAAwB,EACxB,MAAM,EACN,OAAO,EACP,iBAAiB,EAEjB,SAAS,EACT,QAAQ,IAAI,YAAY,EACxB,WAAW,EACX,SAAS,EACT,QAAQ,EAER,OAAO,EACP,iBAAiB,EACjB,OAAO,EACP,iBAAiB,EACjB,WAAW,EACX,qBAAqB,EACtB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAM3C;;;;;;;GAOG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAClC,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,aAAa,KAClB,iBAAiB,CAAC;AAOvB;;;;GAIG;AACH,qBAAa,aAAc,YAAW,SAAS;IAC7C,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAa;IAChD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAW;IACrC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAwB;IAEvD;;6DAEyD;IACzD,cAAc,SAAK;IACnB,kEAAkE;IAClE,kBAAkB,SAAK;IACvB,qEAAqE;IACrE,mBAAmB,SAAK;IACxB,2EAA2E;IAC3E,cAAc,EAAE,MAAM,EAAE,CAAM;IAE9B;0DACsD;IACtD,IAAI,UAAU,IAAI,UAAU,CAE3B;gBAEW,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,qBAAqB;IAMlE,IAAI,IAAI,IAAI,OAAO,CAwBlB;IAED,IAAI,QAAQ,IAAI,WAAW,CAE1B;IAED,IAAI,MAAM,IAAI,SAAS,CAEtB;IAED,IAAI,KAAK,IAAI,QAAQ,CAEpB;IAMD,IAAI,IAAI,IAAI,OAAO,CAAC;QAAE,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAE1F;IAED,YAAY,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC;IAInE,aAAa,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC;IAItE,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC;IAItD,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC;IAI/D,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC;IAIxD,iBAAiB,CACf,QAAQ,EAAE,OAAO,EACjB,KAAK,EAAE,qBAAqB,GAC3B,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC;IAIpC,aAAa,CAAC,KAAK,CAAC,EAAE,iBAAiB,GAAG,SAAS,GAAG,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC;IAInF,qBAAqB,CAAC,KAAK,EAAE,yBAAyB,GAAG,MAAM,CAAC,eAAe,EAAE,YAAY,CAAC;IAI9F,eAAe,CAAC,KAAK,EAAE,mBAAmB,GAAG,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC;IAI5E,oBAAoB,CAAC,KAAK,EAAE,wBAAwB,GAAG,MAAM,CAAC,cAAc,EAAE,YAAY,CAAC;IAI3F,oBAAoB,CAAC,KAAK,EAAE,wBAAwB,GAAG,MAAM,CAAC,cAAc,EAAE,YAAY,CAAC;IAI3F,qBAAqB,CAAC,KAAK,EAAE,yBAAyB,GAAG,MAAM,CAAC,eAAe,EAAE,YAAY,CAAC;IAI9F,cAAc,CAAC,IAAI,EAAE,kBAAkB,GAAG,MAAM,CAAC,QAAQ,EAAE,YAAY,CAAC;IAaxE,oBAAoB,CAClB,KAAK,CAAC,EAAE,wBAAwB,GAAG,SAAS,GAC3C,MAAM,CAAC,iBAAiB,EAAE,YAAY,CAAC;IAI1C;;;;;;;OAOG;IACH,OAAO,CAAC,YAAY;CAMrB"}
|