@flighthq/effects-wgpu 0.4.0-next.1920.b93ad0f → 0.4.0-next.1932.1ef883a

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.md ADDED
@@ -0,0 +1,9 @@
1
+ # MIT License
2
+
3
+ Copyright (c) 2013-2026 Joshua Granick and other contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,17 @@
1
+ # @flighthq/effects-wgpu
2
+
3
+ WebGPU shader recipes for render effects (substrate-agnostic post-process pipeline)
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ npm install @flighthq/effects-wgpu
9
+ ```
10
+
11
+ Import the supported application-facing API from `@flighthq/effects-wgpu`. The `@flighthq/effects-wgpu/contract` export is the wider package-to-package contract used to compose Flight itself.
12
+
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
+
15
+ - [Flight project](https://github.com/flighthq/flight)
16
+ - [Source for @flighthq/effects-wgpu@0.4.0-next.1932.1ef883a](https://github.com/flighthq/flight/tree/1ef883a866729a9bc6f461111970f6377de1499f/packages/effects-wgpu)
17
+ - [License](https://github.com/flighthq/flight/blob/1ef883a866729a9bc6f461111970f6377de1499f/LICENSE.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flighthq/effects-wgpu",
3
- "version": "0.4.0-next.1920.b93ad0f",
3
+ "version": "0.4.0-next.1932.1ef883a",
4
4
  "author": "Joshua Granick and other contributors",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -38,14 +38,14 @@
38
38
  "clean:dist": "tsx ../../scripts/clean-package-dist.ts"
39
39
  },
40
40
  "dependencies": {
41
- "@flighthq/adjustments": "0.4.0-next.1920.b93ad0f",
42
- "@flighthq/color": "0.4.0-next.1920.b93ad0f",
43
- "@flighthq/effects": "0.4.0-next.1920.b93ad0f",
44
- "@flighthq/geometry": "0.4.0-next.1920.b93ad0f",
45
- "@flighthq/log": "0.4.0-next.1920.b93ad0f",
46
- "@flighthq/render-wgpu": "0.4.0-next.1920.b93ad0f",
47
- "@flighthq/registry": "0.4.0-next.1920.b93ad0f",
48
- "@flighthq/types": "0.4.0-next.1920.b93ad0f"
41
+ "@flighthq/adjustments": "0.4.0-next.1932.1ef883a",
42
+ "@flighthq/color": "0.4.0-next.1932.1ef883a",
43
+ "@flighthq/effects": "0.4.0-next.1932.1ef883a",
44
+ "@flighthq/geometry": "0.4.0-next.1932.1ef883a",
45
+ "@flighthq/log": "0.4.0-next.1932.1ef883a",
46
+ "@flighthq/render-wgpu": "0.4.0-next.1932.1ef883a",
47
+ "@flighthq/registry": "0.4.0-next.1932.1ef883a",
48
+ "@flighthq/types": "0.4.0-next.1932.1ef883a"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@webgpu/types": "^0.1.70"
@@ -1,21 +1,10 @@
1
1
  import type { WgpuRenderState, WgpuRenderTarget } from '@flighthq/types/contract';
2
2
 
3
- import type * as WgpuCrtEffectModule from './wgpuCrtEffect';
4
- import type * as WgpuDirectionalBlurEffectModule from './wgpuDirectionalBlurEffect';
5
- import type * as WgpuDisplacementEffectModule from './wgpuDisplacementEffect';
6
- import type * as WgpuDitherEffectModule from './wgpuDitherEffect';
7
- import type * as WgpuFxaaEffectModule from './wgpuFxaaEffect';
8
- import type * as WgpuGlitchEffectModule from './wgpuGlitchEffect';
9
- import type * as WgpuKuwaharaEffectModule from './wgpuKuwaharaEffect';
10
- import type * as WgpuMotionBlurEffectModule from './wgpuMotionBlurEffect';
11
- import type * as WgpuPixelateEffectModule from './wgpuPixelateEffect';
12
- import type * as WgpuSharpenEffectModule from './wgpuSharpenEffect';
13
- import type * as WgpuSmaaEffectModule from './wgpuSmaaEffect';
14
- import type * as WgpuSsaoEffectModule from './wgpuSsaoEffect';
15
- import type * as WgpuTiltShiftEffectModule from './wgpuTiltShiftEffect';
16
-
17
- const recorded = { uniforms: [] as number[][] };
18
- const passMock = () => {
3
+ // This file is in REGISTRY_ISOLATED_TESTS because its two top-level mocks replace shared effect-pass
4
+ // modules for every table row. The private registry makes the hoisted form file-scoped without rebuilding
5
+ // the full effects graph through resetModules plus dynamic imports for each test.
6
+ const recorded = vi.hoisted(() => ({ uniforms: [] as number[][] }));
7
+ const passMock = vi.hoisted(() => {
19
8
  const recordUniforms = (setUniforms: (f32: Float32Array) => void): void => {
20
9
  const f32 = new Float32Array(8);
21
10
  setUniforms(f32);
@@ -44,70 +33,25 @@ const passMock = () => {
44
33
  ) => recordUniforms(setUniforms),
45
34
  ),
46
35
  };
47
- };
48
- const pipelineMock = { getWgpuEffectPipeline: vi.fn(() => ({})) };
49
-
50
- let applyCrtEffectToWgpu: typeof WgpuCrtEffectModule.applyCrtEffectToWgpu;
51
- let applyDirectionalBlurEffectToWgpu: typeof WgpuDirectionalBlurEffectModule.applyDirectionalBlurEffectToWgpu;
52
- let applyDisplacementEffectToWgpu: typeof WgpuDisplacementEffectModule.applyDisplacementEffectToWgpu;
53
- let applyDitherEffectToWgpu: typeof WgpuDitherEffectModule.applyDitherEffectToWgpu;
54
- let applyFxaaEffectToWgpu: typeof WgpuFxaaEffectModule.applyFxaaEffectToWgpu;
55
- let applyGlitchEffectToWgpu: typeof WgpuGlitchEffectModule.applyGlitchEffectToWgpu;
56
- let applyKuwaharaEffectToWgpu: typeof WgpuKuwaharaEffectModule.applyKuwaharaEffectToWgpu;
57
- let applyMotionBlurEffectToWgpu: typeof WgpuMotionBlurEffectModule.applyMotionBlurEffectToWgpu;
58
- let applyPixelateEffectToWgpu: typeof WgpuPixelateEffectModule.applyPixelateEffectToWgpu;
59
- let applySharpenEffectToWgpu: typeof WgpuSharpenEffectModule.applySharpenEffectToWgpu;
60
- let applySmaaEffectToWgpu: typeof WgpuSmaaEffectModule.applySmaaEffectToWgpu;
61
- let applySsaoEffectToWgpu: typeof WgpuSsaoEffectModule.applySsaoEffectToWgpu;
62
- let applyTiltShiftEffectToWgpu: typeof WgpuTiltShiftEffectModule.applyTiltShiftEffectToWgpu;
36
+ });
37
+ const pipelineMock = vi.hoisted(() => ({ getWgpuEffectPipeline: vi.fn(() => ({})) }));
63
38
 
64
- beforeAll(async () => {
65
- vi.doMock('./wgpuEffectPass', passMock);
66
- vi.doMock('./wgpuEffectProgramCache', () => pipelineMock);
39
+ vi.mock('./wgpuEffectPass', () => passMock);
40
+ vi.mock('./wgpuEffectProgramCache', () => pipelineMock);
67
41
 
68
- const [
69
- crt,
70
- directionalBlur,
71
- displacement,
72
- dither,
73
- fxaa,
74
- glitch,
75
- kuwahara,
76
- motionBlur,
77
- pixelate,
78
- sharpen,
79
- smaa,
80
- ssao,
81
- tiltShift,
82
- ] = await Promise.all([
83
- import('./wgpuCrtEffect'),
84
- import('./wgpuDirectionalBlurEffect'),
85
- import('./wgpuDisplacementEffect'),
86
- import('./wgpuDitherEffect'),
87
- import('./wgpuFxaaEffect'),
88
- import('./wgpuGlitchEffect'),
89
- import('./wgpuKuwaharaEffect'),
90
- import('./wgpuMotionBlurEffect'),
91
- import('./wgpuPixelateEffect'),
92
- import('./wgpuSharpenEffect'),
93
- import('./wgpuSmaaEffect'),
94
- import('./wgpuSsaoEffect'),
95
- import('./wgpuTiltShiftEffect'),
96
- ]);
97
- ({ applyCrtEffectToWgpu } = crt);
98
- ({ applyDirectionalBlurEffectToWgpu } = directionalBlur);
99
- ({ applyDisplacementEffectToWgpu } = displacement);
100
- ({ applyDitherEffectToWgpu } = dither);
101
- ({ applyFxaaEffectToWgpu } = fxaa);
102
- ({ applyGlitchEffectToWgpu } = glitch);
103
- ({ applyKuwaharaEffectToWgpu } = kuwahara);
104
- ({ applyMotionBlurEffectToWgpu } = motionBlur);
105
- ({ applyPixelateEffectToWgpu } = pixelate);
106
- ({ applySharpenEffectToWgpu } = sharpen);
107
- ({ applySmaaEffectToWgpu } = smaa);
108
- ({ applySsaoEffectToWgpu } = ssao);
109
- ({ applyTiltShiftEffectToWgpu } = tiltShift);
110
- }, 30_000);
42
+ import { applyCrtEffectToWgpu } from './wgpuCrtEffect';
43
+ import { applyDirectionalBlurEffectToWgpu } from './wgpuDirectionalBlurEffect';
44
+ import { applyDisplacementEffectToWgpu } from './wgpuDisplacementEffect';
45
+ import { applyDitherEffectToWgpu } from './wgpuDitherEffect';
46
+ import { applyFxaaEffectToWgpu } from './wgpuFxaaEffect';
47
+ import { applyGlitchEffectToWgpu } from './wgpuGlitchEffect';
48
+ import { applyKuwaharaEffectToWgpu } from './wgpuKuwaharaEffect';
49
+ import { applyMotionBlurEffectToWgpu } from './wgpuMotionBlurEffect';
50
+ import { applyPixelateEffectToWgpu } from './wgpuPixelateEffect';
51
+ import { applySharpenEffectToWgpu } from './wgpuSharpenEffect';
52
+ import { applySmaaEffectToWgpu } from './wgpuSmaaEffect';
53
+ import { applySsaoEffectToWgpu } from './wgpuSsaoEffect';
54
+ import { applyTiltShiftEffectToWgpu } from './wgpuTiltShiftEffect';
111
55
 
112
56
  type ApplyEffect = (
113
57
  state: WgpuRenderState,