@flighthq/render-wgpu 0.5.1-next.903.f434bc2 → 0.5.1-next.905.5fbf787
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/README.md +2 -2
- package/package.json +11 -11
- package/src/wgpuDraw.test.ts +8 -2
- package/src/wgpuExternalTexture.test.ts +17 -1
- package/src/wgpuFullscreenPass.test.ts +6 -0
- package/src/wgpuHost.test.ts +7 -1
- package/src/wgpuPipeline.test.ts +11 -1
- package/src/wgpuRenderState.test.ts +40 -13
- package/src/wgpuRenderTarget.test.ts +8 -2
- package/src/wgpuRenderTargetPool.test.ts +6 -0
- package/src/wgpuRenderTexturePool.test.ts +7 -1
- package/src/wgpuShader.test.ts +8 -2
package/README.md
CHANGED
|
@@ -13,5 +13,5 @@ Import the supported application-facing API from `@flighthq/render-wgpu`. The `@
|
|
|
13
13
|
This package is part of the locked-version Flight SDK graph. Applications may instead install and import `@flighthq/sdk` when package-level tree shaking is sufficient.
|
|
14
14
|
|
|
15
15
|
- [Flight project](https://github.com/flighthq/flight)
|
|
16
|
-
- [Source for @flighthq/render-wgpu@0.5.1-next.
|
|
17
|
-
- [License](https://github.com/flighthq/flight/blob/
|
|
16
|
+
- [Source for @flighthq/render-wgpu@0.5.1-next.905.5fbf787](https://github.com/flighthq/flight/tree/5fbf7874064c384307542d68b4dcb6a895ff0dcf/packages/render-wgpu)
|
|
17
|
+
- [License](https://github.com/flighthq/flight/blob/5fbf7874064c384307542d68b4dcb6a895ff0dcf/LICENSE.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flighthq/render-wgpu",
|
|
3
|
-
"version": "0.5.1-next.
|
|
3
|
+
"version": "0.5.1-next.905.5fbf787",
|
|
4
4
|
"author": "Joshua Granick and other contributors",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,16 +38,16 @@
|
|
|
38
38
|
"clean:dist": "tsx ../../scripts/clean-package-dist.ts"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@flighthq/color": "0.5.1-next.
|
|
42
|
-
"@flighthq/entity": "0.5.1-next.
|
|
43
|
-
"@flighthq/geometry": "0.5.1-next.
|
|
44
|
-
"@flighthq/log": "0.5.1-next.
|
|
45
|
-
"@flighthq/render": "0.5.1-next.
|
|
46
|
-
"@flighthq/registry": "0.5.1-next.
|
|
47
|
-
"@flighthq/signals": "0.5.1-next.
|
|
48
|
-
"@flighthq/bitmap": "0.5.1-next.
|
|
49
|
-
"@flighthq/texture": "0.5.1-next.
|
|
50
|
-
"@flighthq/types": "0.5.1-next.
|
|
41
|
+
"@flighthq/color": "0.5.1-next.905.5fbf787",
|
|
42
|
+
"@flighthq/entity": "0.5.1-next.905.5fbf787",
|
|
43
|
+
"@flighthq/geometry": "0.5.1-next.905.5fbf787",
|
|
44
|
+
"@flighthq/log": "0.5.1-next.905.5fbf787",
|
|
45
|
+
"@flighthq/render": "0.5.1-next.905.5fbf787",
|
|
46
|
+
"@flighthq/registry": "0.5.1-next.905.5fbf787",
|
|
47
|
+
"@flighthq/signals": "0.5.1-next.905.5fbf787",
|
|
48
|
+
"@flighthq/bitmap": "0.5.1-next.905.5fbf787",
|
|
49
|
+
"@flighthq/texture": "0.5.1-next.905.5fbf787",
|
|
50
|
+
"@flighthq/types": "0.5.1-next.905.5fbf787"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@webgpu/types": "^0.1.70"
|
package/src/wgpuDraw.test.ts
CHANGED
|
@@ -25,11 +25,12 @@ import {
|
|
|
25
25
|
bindWgpuTexture,
|
|
26
26
|
bindWgpuVideoTexture,
|
|
27
27
|
createWgpuTextureEntry,
|
|
28
|
+
destroyWgpuVideoTexture,
|
|
28
29
|
drawWgpuQuad,
|
|
29
30
|
drawWgpuQuadWithTransform,
|
|
30
|
-
destroyWgpuVideoTexture,
|
|
31
31
|
enableWgpuBlendModeSupport,
|
|
32
32
|
getWgpuRenderProxyColorScaleBias,
|
|
33
|
+
initializeWgpuTextureEntry,
|
|
33
34
|
resolveWgpuSmoothingBindGroup,
|
|
34
35
|
submitWgpuQuadDraw,
|
|
35
36
|
updateWgpuTextureEntry,
|
|
@@ -475,6 +476,12 @@ describe('getWgpuRenderProxyColorScaleBias', () => {
|
|
|
475
476
|
});
|
|
476
477
|
});
|
|
477
478
|
|
|
479
|
+
describe('initializeWgpuTextureEntry', () => {
|
|
480
|
+
it('is the construction initializer of createWgpuTextureEntry', () => {
|
|
481
|
+
expect(typeof initializeWgpuTextureEntry).toBe('function');
|
|
482
|
+
});
|
|
483
|
+
});
|
|
484
|
+
|
|
478
485
|
describe('resolveWgpuSmoothingBindGroup', () => {
|
|
479
486
|
it('follows the state smoothing policy for a null smoothing', async () => {
|
|
480
487
|
const state = await createWgpuRenderStateForTest();
|
|
@@ -590,7 +597,6 @@ describe('updateWgpuTextureEntry', () => {
|
|
|
590
597
|
expect(() => updateWgpuTextureEntry(state, entry, canvas)).not.toThrow();
|
|
591
598
|
});
|
|
592
599
|
});
|
|
593
|
-
|
|
594
600
|
describe('warmWgpuPipelines', () => {
|
|
595
601
|
it('pre-populates the pipeline cache', async () => {
|
|
596
602
|
const state = await createWgpuRenderStateForTest();
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { getTextureSourceKind } from '@flighthq/texture/contract';
|
|
2
2
|
import { ExternalTextureSourceKind } from '@flighthq/types/contract';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
createExternalWgpuTexture,
|
|
6
|
+
disposeExternalWgpuTexture,
|
|
7
|
+
initializeExternalWgpuTextureEntry,
|
|
8
|
+
initializeExternalWgpuTextureSource,
|
|
9
|
+
} from './wgpuExternalTexture';
|
|
5
10
|
import { createWgpuRenderStateForTest, installWgpuMock } from './wgpuTestHelper';
|
|
6
11
|
import { resolveWgpuTexture } from './wgpuTextureResolver';
|
|
7
12
|
|
|
@@ -33,3 +38,14 @@ describe('disposeExternalWgpuTexture', () => {
|
|
|
33
38
|
expect(disposeExternalWgpuTexture(state, texture)).toBe(false);
|
|
34
39
|
});
|
|
35
40
|
});
|
|
41
|
+
describe('initializeExternalWgpuTextureEntry', () => {
|
|
42
|
+
it('is the construction initializer of createExternalWgpuTextureEntry', () => {
|
|
43
|
+
expect(typeof initializeExternalWgpuTextureEntry).toBe('function');
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
describe('initializeExternalWgpuTextureSource', () => {
|
|
48
|
+
it('is the construction initializer of createExternalWgpuTextureSource', () => {
|
|
49
|
+
expect(typeof initializeExternalWgpuTextureSource).toBe('function');
|
|
50
|
+
});
|
|
51
|
+
});
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
createWgpuFullscreenPipeline,
|
|
4
4
|
destroyWgpuFullscreenPipeline,
|
|
5
5
|
drawWgpuFullscreenPass,
|
|
6
|
+
initializeWgpuFullscreenPipeline,
|
|
6
7
|
} from './wgpuFullscreenPass';
|
|
7
8
|
import { createWgpuRenderTarget } from './wgpuRenderTarget';
|
|
8
9
|
import { createWgpuRenderStateForTest, installWgpuMock } from './wgpuTestHelper';
|
|
@@ -62,3 +63,8 @@ describe('drawWgpuFullscreenPass', () => {
|
|
|
62
63
|
expect(() => drawWgpuFullscreenPass(state, pipeline, [target], null, null)).not.toThrow();
|
|
63
64
|
});
|
|
64
65
|
});
|
|
66
|
+
describe('initializeWgpuFullscreenPipeline', () => {
|
|
67
|
+
it('is the construction initializer of createWgpuFullscreenPipeline', () => {
|
|
68
|
+
expect(typeof initializeWgpuFullscreenPipeline).toBe('function');
|
|
69
|
+
});
|
|
70
|
+
});
|
package/src/wgpuHost.test.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { afterEach, beforeAll, describe, expect, it, vi } from 'vitest';
|
|
|
5
5
|
import {
|
|
6
6
|
createWebWgpuHostBackend,
|
|
7
7
|
getWgpuHostBackend,
|
|
8
|
+
initializeWebWgpuHostBackend,
|
|
8
9
|
installWgpuHostBackend,
|
|
9
10
|
resetWgpuHostBackendForTest,
|
|
10
11
|
setWgpuHostBackend,
|
|
@@ -94,6 +95,12 @@ describe('getWgpuHostBackend', () => {
|
|
|
94
95
|
});
|
|
95
96
|
});
|
|
96
97
|
|
|
98
|
+
describe('initializeWebWgpuHostBackend', () => {
|
|
99
|
+
it('is the construction initializer of createWebWgpuHostBackend', () => {
|
|
100
|
+
expect(typeof initializeWebWgpuHostBackend).toBe('function');
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
|
|
97
104
|
describe('installWgpuHostBackend', () => {
|
|
98
105
|
it('preserves the first installed host identity', () => {
|
|
99
106
|
const first = fakeBackend();
|
|
@@ -115,7 +122,6 @@ describe('resetWgpuHostBackendForTest', () => {
|
|
|
115
122
|
expect(getWgpuHostBackend()).toBe(fallback);
|
|
116
123
|
});
|
|
117
124
|
});
|
|
118
|
-
|
|
119
125
|
describe('setWgpuHostBackend', () => {
|
|
120
126
|
it('routes acquisition and release through the same selected backend', async () => {
|
|
121
127
|
const web = createWebWgpuHostBackend();
|
package/src/wgpuPipeline.test.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type { WgpuPipeline } from '@flighthq/types/contract';
|
|
2
2
|
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
createEmptyWgpuRegistries,
|
|
6
|
+
createWgpuPipeline,
|
|
7
|
+
getWgpuPipelineRegistries,
|
|
8
|
+
initializeEmptyWgpuRegistries,
|
|
9
|
+
} from './wgpuPipeline';
|
|
5
10
|
|
|
6
11
|
describe('createEmptyWgpuRegistries', () => {
|
|
7
12
|
it('creates empty tables for every required WGPU policy seam', () => {
|
|
@@ -50,3 +55,8 @@ describe('getWgpuPipelineRegistries', () => {
|
|
|
50
55
|
expect(getWgpuPipelineRegistries(createWgpuPipeline(registries))).toBe(registries);
|
|
51
56
|
});
|
|
52
57
|
});
|
|
58
|
+
describe('initializeEmptyWgpuRegistries', () => {
|
|
59
|
+
it('is the construction initializer of createEmptyWgpuRegistries', () => {
|
|
60
|
+
expect(typeof initializeEmptyWgpuRegistries).toBe('function');
|
|
61
|
+
});
|
|
62
|
+
});
|
|
@@ -38,12 +38,11 @@ import { setWgpuHostBackend } from './wgpuHost';
|
|
|
38
38
|
import { registerWgpuMaterialRenderer } from './wgpuMaterialRegistry';
|
|
39
39
|
import { createEmptyWgpuRegistries, createWgpuPipeline } from './wgpuPipeline';
|
|
40
40
|
import {
|
|
41
|
-
createWgpuOffscreenRenderState as createDeviceOnlyWgpuRenderState,
|
|
42
41
|
createWgpuAcquisitionFromCanvasElement,
|
|
42
|
+
createWgpuDeviceState,
|
|
43
|
+
createWgpuOffscreenRenderState as createDeviceOnlyWgpuRenderState,
|
|
43
44
|
createWgpuRenderState as createWgpuRenderStateWithPipeline,
|
|
44
45
|
createWgpuRenderStateFromCanvasElement as createWgpuRenderStateFromCanvasElementWithPipeline,
|
|
45
|
-
releaseWgpuAcquisition,
|
|
46
|
-
createWgpuDeviceState,
|
|
47
46
|
createWgpuRenderStateRuntime as createWgpuRenderStateRuntimeWithPipeline,
|
|
48
47
|
destroyWgpuRenderState,
|
|
49
48
|
getWgpuColorAdjustmentMaterialFeature,
|
|
@@ -52,9 +51,14 @@ import {
|
|
|
52
51
|
getWgpuRenderStateDeviceResources,
|
|
53
52
|
getWgpuRenderStateRuntime,
|
|
54
53
|
getWgpuSampler,
|
|
54
|
+
initializeWgpuDeviceState,
|
|
55
|
+
initializeWgpuHostAcquisition,
|
|
56
|
+
initializeWgpuOffscreenRenderStateDeviceLostResult,
|
|
57
|
+
initializeWgpuOffscreenRenderStateOkResult,
|
|
55
58
|
isWgpuSupported,
|
|
56
59
|
registerWgpuDeviceTeardown,
|
|
57
60
|
registerWgpuRenderStateTeardown,
|
|
61
|
+
releaseWgpuAcquisition,
|
|
58
62
|
resolveWgpuApplyBlendMode,
|
|
59
63
|
} from './wgpuRenderState';
|
|
60
64
|
import { createWgpuRenderStateForTest, installWgpuMock } from './wgpuTestHelper';
|
|
@@ -933,6 +937,30 @@ describe('getWgpuSampler', () => {
|
|
|
933
937
|
});
|
|
934
938
|
});
|
|
935
939
|
|
|
940
|
+
describe('initializeWgpuDeviceState', () => {
|
|
941
|
+
it('is the construction initializer of createWgpuDeviceState', () => {
|
|
942
|
+
expect(typeof initializeWgpuDeviceState).toBe('function');
|
|
943
|
+
});
|
|
944
|
+
});
|
|
945
|
+
|
|
946
|
+
describe('initializeWgpuHostAcquisition', () => {
|
|
947
|
+
it('is the construction initializer of createWgpuHostAcquisition', () => {
|
|
948
|
+
expect(typeof initializeWgpuHostAcquisition).toBe('function');
|
|
949
|
+
});
|
|
950
|
+
});
|
|
951
|
+
|
|
952
|
+
describe('initializeWgpuOffscreenRenderStateDeviceLostResult', () => {
|
|
953
|
+
it('is the construction initializer of createWgpuOffscreenRenderStateDeviceLostResult', () => {
|
|
954
|
+
expect(typeof initializeWgpuOffscreenRenderStateDeviceLostResult).toBe('function');
|
|
955
|
+
});
|
|
956
|
+
});
|
|
957
|
+
|
|
958
|
+
describe('initializeWgpuOffscreenRenderStateOkResult', () => {
|
|
959
|
+
it('is the construction initializer of createWgpuOffscreenRenderStateOkResult', () => {
|
|
960
|
+
expect(typeof initializeWgpuOffscreenRenderStateOkResult).toBe('function');
|
|
961
|
+
});
|
|
962
|
+
});
|
|
963
|
+
|
|
936
964
|
describe('isWgpuSupported', () => {
|
|
937
965
|
it('returns true when navigator.gpu is present', () => {
|
|
938
966
|
expect(isWgpuSupported()).toBe(true);
|
|
@@ -964,6 +992,15 @@ describe('registerWgpuDeviceTeardown', () => {
|
|
|
964
992
|
});
|
|
965
993
|
});
|
|
966
994
|
|
|
995
|
+
function ownerAcquisition(owner: WgpuPresentationRenderState): Omit<WgpuHostAcquisition, 'ownership'> {
|
|
996
|
+
const out = allocateEntity<any>();
|
|
997
|
+
out.context = owner.context;
|
|
998
|
+
out.device = owner.device;
|
|
999
|
+
out.format = owner.format;
|
|
1000
|
+
out.surface = owner.surface;
|
|
1001
|
+
return finishEntity(out);
|
|
1002
|
+
}
|
|
1003
|
+
|
|
967
1004
|
describe('registerWgpuRenderStateTeardown', () => {
|
|
968
1005
|
it('runs a state-owned callback exactly once on teardown', async () => {
|
|
969
1006
|
const state = await createWgpuRenderStateForTest();
|
|
@@ -1000,7 +1037,6 @@ describe('releaseWgpuAcquisition', () => {
|
|
|
1000
1037
|
destroyWgpuRenderState(owner);
|
|
1001
1038
|
});
|
|
1002
1039
|
});
|
|
1003
|
-
|
|
1004
1040
|
describe('resolveWgpuApplyBlendMode', () => {
|
|
1005
1041
|
it('returns a hook installed directly on the state', async () => {
|
|
1006
1042
|
const state = await createWgpuRenderStateForTest();
|
|
@@ -1108,15 +1144,6 @@ describe('wgpu acquisition lifecycle', () => {
|
|
|
1108
1144
|
});
|
|
1109
1145
|
});
|
|
1110
1146
|
|
|
1111
|
-
function ownerAcquisition(owner: WgpuPresentationRenderState): Omit<WgpuHostAcquisition, 'ownership'> {
|
|
1112
|
-
const out = allocateEntity<any>();
|
|
1113
|
-
out.context = owner.context;
|
|
1114
|
-
out.device = owner.device;
|
|
1115
|
-
out.format = owner.format;
|
|
1116
|
-
out.surface = owner.surface;
|
|
1117
|
-
return finishEntity(out);
|
|
1118
|
-
}
|
|
1119
|
-
|
|
1120
1147
|
describe('WgpuPipeline snapshots', () => {
|
|
1121
1148
|
it('captures late Wgpu registrations only when an explicit pipeline is created', async () => {
|
|
1122
1149
|
const screen = await createWgpuRenderStateForTest();
|
|
@@ -5,13 +5,14 @@ import { renderWgpuBackground, submitWgpuRenderPass } from './wgpuBackground';
|
|
|
5
5
|
import { resolveWgpuSmoothingBindGroup } from './wgpuDraw';
|
|
6
6
|
import { getWgpuRenderStateDeviceResources, getWgpuRenderStateRuntime } from './wgpuRenderState';
|
|
7
7
|
import {
|
|
8
|
-
getWgpuRenderTargetSupersampleScale,
|
|
9
8
|
beginWgpuRenderPass,
|
|
10
9
|
createWgpuRenderTarget,
|
|
11
10
|
declareWgpuRenderTargetColorSpace,
|
|
12
11
|
destroyWgpuRenderTarget,
|
|
13
12
|
drawWgpuRenderTargetResult,
|
|
14
13
|
endWgpuRenderPass,
|
|
14
|
+
getWgpuRenderTargetSupersampleScale,
|
|
15
|
+
initializeWgpuRenderTarget,
|
|
15
16
|
resizeWgpuRenderTarget,
|
|
16
17
|
setWgpuRenderTransform2D,
|
|
17
18
|
} from './wgpuRenderTarget';
|
|
@@ -195,6 +196,12 @@ describe('getWgpuRenderTargetSupersampleScale', () => {
|
|
|
195
196
|
});
|
|
196
197
|
});
|
|
197
198
|
|
|
199
|
+
describe('initializeWgpuRenderTarget', () => {
|
|
200
|
+
it('is the construction initializer of createWgpuRenderTarget', () => {
|
|
201
|
+
expect(typeof initializeWgpuRenderTarget).toBe('function');
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
|
|
198
205
|
describe('resizeWgpuRenderTarget', () => {
|
|
199
206
|
it('preserves the allocation when dimensions are unchanged', async () => {
|
|
200
207
|
const state = await createWgpuRenderStateForTest();
|
|
@@ -237,7 +244,6 @@ describe('resizeWgpuRenderTarget', () => {
|
|
|
237
244
|
expect(target.texture).not.toBe(previousTexture);
|
|
238
245
|
});
|
|
239
246
|
});
|
|
240
|
-
|
|
241
247
|
describe('setWgpuRenderTransform2D', () => {
|
|
242
248
|
it('installs a copy of the transform, restored by the enclosing pass', async () => {
|
|
243
249
|
const state = await createWgpuRenderStateForTest();
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
acquireWgpuRenderTarget,
|
|
3
3
|
createWgpuRenderTargetPool,
|
|
4
4
|
destroyWgpuRenderTargetPool,
|
|
5
|
+
initializeWgpuRenderTargetPool,
|
|
5
6
|
releaseWgpuRenderTarget,
|
|
6
7
|
} from './wgpuRenderTargetPool';
|
|
7
8
|
import { createWgpuRenderStateForTest, installWgpuMock } from './wgpuTestHelper';
|
|
@@ -74,6 +75,11 @@ describe('destroyWgpuRenderTargetPool', () => {
|
|
|
74
75
|
});
|
|
75
76
|
});
|
|
76
77
|
|
|
78
|
+
describe('initializeWgpuRenderTargetPool', () => {
|
|
79
|
+
it('is the construction initializer of createWgpuRenderTargetPool', () => {
|
|
80
|
+
expect(typeof initializeWgpuRenderTargetPool).toBe('function');
|
|
81
|
+
});
|
|
82
|
+
});
|
|
77
83
|
describe('releaseWgpuRenderTarget', () => {
|
|
78
84
|
it('returns the target to the free list', async () => {
|
|
79
85
|
const state = await createWgpuRenderStateForTest();
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
acquireWgpuRenderTexture,
|
|
9
9
|
createWgpuRenderTexturePool,
|
|
10
10
|
destroyWgpuRenderTexturePool,
|
|
11
|
+
initializeWgpuRenderTexturePool,
|
|
11
12
|
releaseWgpuRenderTexture,
|
|
12
13
|
withWgpuRenderTextures,
|
|
13
14
|
} from './wgpuRenderTexturePool';
|
|
@@ -109,6 +110,12 @@ describe('destroyWgpuRenderTexturePool', () => {
|
|
|
109
110
|
});
|
|
110
111
|
});
|
|
111
112
|
|
|
113
|
+
describe('initializeWgpuRenderTexturePool', () => {
|
|
114
|
+
it('is the construction initializer of createWgpuRenderTexturePool', () => {
|
|
115
|
+
expect(typeof initializeWgpuRenderTexturePool).toBe('function');
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
|
|
112
119
|
describe('releaseWgpuRenderTexture', () => {
|
|
113
120
|
it('rejects a double release', async () => {
|
|
114
121
|
const state = await createWgpuRenderStateForTest();
|
|
@@ -119,7 +126,6 @@ describe('releaseWgpuRenderTexture', () => {
|
|
|
119
126
|
expect(() => releaseWgpuRenderTexture(state, pool, texture)).toThrow('texture is not leased');
|
|
120
127
|
});
|
|
121
128
|
});
|
|
122
|
-
|
|
123
129
|
describe('withWgpuRenderTextures', () => {
|
|
124
130
|
it('releases every lease when the bracket callback throws', async () => {
|
|
125
131
|
const state = await createWgpuRenderStateForTest();
|
package/src/wgpuShader.test.ts
CHANGED
|
@@ -3,13 +3,14 @@ import { AdvancedBlendMode, BlendMode } from '@flighthq/types/contract';
|
|
|
3
3
|
import { renderWgpuBackground } from './wgpuBackground';
|
|
4
4
|
import { getWgpuRenderStateDeviceResources, getWgpuRenderStateRuntime } from './wgpuRenderState';
|
|
5
5
|
import {
|
|
6
|
+
UNIFORM_BYTE_SIZE,
|
|
6
7
|
createWgpuBindGroupLayouts,
|
|
7
8
|
createWgpuPipelineLayout,
|
|
8
9
|
getActiveWgpuPipeline,
|
|
9
10
|
getWgpuBlendState,
|
|
10
11
|
getWgpuPipeline,
|
|
12
|
+
initializeWgpuBindGroupLayouts,
|
|
11
13
|
setWgpuMatrixFromTransform,
|
|
12
|
-
UNIFORM_BYTE_SIZE,
|
|
13
14
|
writeWgpuMatrixOnlyUniforms,
|
|
14
15
|
writeWgpuQuadUniforms,
|
|
15
16
|
} from './wgpuShader';
|
|
@@ -129,6 +130,12 @@ describe('getWgpuPipeline', () => {
|
|
|
129
130
|
});
|
|
130
131
|
});
|
|
131
132
|
|
|
133
|
+
describe('initializeWgpuBindGroupLayouts', () => {
|
|
134
|
+
it('is the construction initializer of createWgpuBindGroupLayouts', () => {
|
|
135
|
+
expect(typeof initializeWgpuBindGroupLayouts).toBe('function');
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
|
|
132
139
|
describe('setWgpuMatrixFromTransform', () => {
|
|
133
140
|
it('builds a column-major clip-space matrix from an identity transform', () => {
|
|
134
141
|
const m = new Float32Array(9);
|
|
@@ -165,7 +172,6 @@ describe('writeWgpuMatrixOnlyUniforms', () => {
|
|
|
165
172
|
expect(runtime.uniformOffset).toBe(before + runtime.uniformStride);
|
|
166
173
|
});
|
|
167
174
|
});
|
|
168
|
-
|
|
169
175
|
describe('writeWgpuQuadUniforms', () => {
|
|
170
176
|
it('advances uniformOffset by uniformStride', async () => {
|
|
171
177
|
const state = await createWgpuRenderStateForTest();
|