wgsl-renderer 0.1.4 → 0.1.5
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/dist/esm/index.d.ts +9 -9
- package/package.json +1 -1
package/dist/esm/index.d.ts
CHANGED
|
@@ -10,10 +10,10 @@ declare class PassTextureRef {
|
|
|
10
10
|
}
|
|
11
11
|
//#endregion
|
|
12
12
|
//#region src/RenderPass.d.ts
|
|
13
|
-
type
|
|
13
|
+
type BindingResource = GPUBindingResource | PassTextureRef;
|
|
14
14
|
type BindingEntry = {
|
|
15
15
|
binding: number;
|
|
16
|
-
resource:
|
|
16
|
+
resource: BindingResource;
|
|
17
17
|
};
|
|
18
18
|
type BlendMode = 'additive' | 'alpha' | 'darken' | 'difference' | 'exclusion' | 'lighten' | 'linear-burn' | 'linear-dodge' | 'max' | 'min' | 'multiply' | 'none' | 'screen' | 'subtract';
|
|
19
19
|
interface RenderPassOptions {
|
|
@@ -30,9 +30,9 @@ interface RenderPassOptions {
|
|
|
30
30
|
a: number;
|
|
31
31
|
};
|
|
32
32
|
blendMode?: BlendMode;
|
|
33
|
-
resources?:
|
|
33
|
+
resources?: BindingResource[];
|
|
34
34
|
bindGroupSets?: {
|
|
35
|
-
[setName: string]:
|
|
35
|
+
[setName: string]: BindingResource[];
|
|
36
36
|
};
|
|
37
37
|
view?: GPUTextureView;
|
|
38
38
|
format?: GPUTextureFormat;
|
|
@@ -54,7 +54,7 @@ interface InternalRenderPassDescriptor {
|
|
|
54
54
|
blendMode?: BlendMode;
|
|
55
55
|
bindGroupEntries: BindingEntry[];
|
|
56
56
|
bindGroupSets?: {
|
|
57
|
-
[setName: string]:
|
|
57
|
+
[setName: string]: BindingResource[];
|
|
58
58
|
};
|
|
59
59
|
view?: GPUTextureView;
|
|
60
60
|
format?: GPUTextureFormat;
|
|
@@ -75,7 +75,7 @@ declare class RenderPass {
|
|
|
75
75
|
view?: GPUTextureView;
|
|
76
76
|
format?: GPUTextureFormat;
|
|
77
77
|
renderToCanvas?: boolean;
|
|
78
|
-
passResources:
|
|
78
|
+
passResources: BindingResource[];
|
|
79
79
|
bindGroups: {
|
|
80
80
|
[setName: string]: GPUBindGroup;
|
|
81
81
|
};
|
|
@@ -114,7 +114,7 @@ declare class RenderPass {
|
|
|
114
114
|
* Update or add a bind group set with new resources
|
|
115
115
|
* This allows dynamic modification of bind groups at runtime
|
|
116
116
|
*/
|
|
117
|
-
updateBindGroupSetResources(setName: string, resources:
|
|
117
|
+
updateBindGroupSetResources(setName: string, resources: BindingResource[]): void;
|
|
118
118
|
private getBlendState;
|
|
119
119
|
}
|
|
120
120
|
//#endregion
|
|
@@ -186,7 +186,7 @@ declare class WGSLRenderer {
|
|
|
186
186
|
* Update bind group set resources for a specific pass
|
|
187
187
|
* This allows dynamic modification of bind groups at runtime
|
|
188
188
|
*/
|
|
189
|
-
updateBindGroupSetResources(passName: string, setName: string, resources:
|
|
189
|
+
updateBindGroupSetResources(passName: string, setName: string, resources: BindingResource[]): void;
|
|
190
190
|
private createPass;
|
|
191
191
|
/**
|
|
192
192
|
* Add a render pass to the multi-pass pipeline
|
|
@@ -231,4 +231,4 @@ declare class WGSLRenderer {
|
|
|
231
231
|
}
|
|
232
232
|
declare function createWGSLRenderer(cvs: HTMLCanvasElement, options?: WGSLRendererOptions): Promise<WGSLRenderer>;
|
|
233
233
|
//#endregion
|
|
234
|
-
export { type
|
|
234
|
+
export { type BindingResource, type PassTextureRef, type RenderPassOptions, type WGSLRenderer, createWGSLRenderer };
|