@agpu/bindings 0.2.4 → 0.2.6

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.
@@ -1 +1,149 @@
1
- import{BRAND,LABEL,RAW}from"@agpu/helpers/decorators";import DC_MEMBER from"../../../../helpers/types/DCMember";import UNSURE from"@agpu/helpers/unsure";import BindGroupCreator from"../../data/bindGroup";import BufferCreator from"../../data/buffers";import ComputePipelineCreator from"../computePipeline";import QuerySetCreator from"../querySet";import IndirectBufferCreator,{INDIRECT_BUFFER_OPTIONS}from"./renderPass/indirectBuffer";export interface ComputePassCreator extends RAW<GPUComputePassEncoder>,BRAND<"ComputePassCreator">,LABEL{}export declare class ComputePassCreator{#private;readonly computepass:GPUComputePassEncoder;constructor(device:GPUDevice,cmdencoder:GPUCommandEncoder,options?:COMPUTE_PASS_OPTIONS);bindGroup(index:number,bindGroup:BindGroupCreator|DC_MEMBER<"BindGroup">,dynamicOffsets?:number[]|Uint32Array,dynamicOffsetData?:ComputePassCreator.bindGroup.DYNAMIC_OFFSET_DATA):void;pipeline():Promise<UNSURE<ComputePipelineCreator>>;pipeline<T extends ComputePipelineCreator|DC_MEMBER<"ComputePipeline">>(pipeline:T):Promise<T>;dispatchWorkgroup:((x:number,y:number,z:number)=>void)&{IndirectBuffer:{new(options:INDIRECT_BUFFER_OPTIONS):{"__#private@#currentBuffer":GPUBuffer;"__#private@#device":GPUDevice;"__#private@#value":GPUAllowSharedBufferSource;"__#private@#dirty":boolean;"__#private@#destroyed":boolean;"__#private@#checkFlags"():boolean;raw():GPUBuffer;clone():BufferCreator;destroy():boolean;destroy<T extends boolean>(destroy:T):T;value():UNSURE<GPUAllowSharedBufferSource>;value<T extends GPUAllowSharedBufferSource>(val:T):T;label():string;label<T extends string>(label:T):T;sync():void;read():Promise<ArrayBuffer>;get can():{copy:{read:boolean;write:boolean};map:{read:boolean;write:boolean};beBoundAs:{index:boolean;vertex:boolean;uniform:boolean;storage:boolean;indirect:boolean};query:boolean};copyToBuffer(destination:BufferCreator|GPUBuffer,size?:number):void;copyToTexture(destination:import("../../data/buffers").TEXTURE_COPY_DESTINATION|GPUTexture,options?:import("../../data/buffers").BUFFER_TO_TEXTURE_OPTIONS):void;query(querySet:GPUQuerySet,firstQuery?:number,queryCount?:number,destinationOffset?:number):void;readonly __brand:"BufferCreator";[Symbol.hasInstance](instance:BufferCreator):instance is BufferCreator};readonly len:3;from(buffer:BufferCreator|GPUBuffer):Promise<IndirectBufferCreator>};indirect:(buffer:{"__#private@#currentBuffer":GPUBuffer;"__#private@#device":GPUDevice;"__#private@#value":GPUAllowSharedBufferSource;"__#private@#dirty":boolean;"__#private@#destroyed":boolean;"__#private@#checkFlags"():boolean;raw():GPUBuffer;clone():BufferCreator;destroy():boolean;destroy<T extends boolean>(destroy:T):T;value():UNSURE<GPUAllowSharedBufferSource>;value<T extends GPUAllowSharedBufferSource>(val:T):T;label():string;label<T extends string>(label:T):T;sync():void;read():Promise<ArrayBuffer>;get can():{copy:{read:boolean;write:boolean};map:{read:boolean;write:boolean};beBoundAs:{index:boolean;vertex:boolean;uniform:boolean;storage:boolean;indirect:boolean};query:boolean};copyToBuffer(destination:BufferCreator|GPUBuffer,size?:number):void;copyToTexture(destination:import("../../data/buffers").TEXTURE_COPY_DESTINATION|GPUTexture,options?:import("../../data/buffers").BUFFER_TO_TEXTURE_OPTIONS):void;query(querySet:GPUQuerySet,firstQuery?:number,queryCount?:number,destinationOffset?:number):void;readonly __brand:"BufferCreator";[Symbol.hasInstance](instance:BufferCreator):instance is BufferCreator},offset:number)=>void};end():void;readonly debug:{push:(label:string)=>void;pop:()=>void;insertMarker:(label:string)=>void}}export declare namespace ComputePassCreator{namespace bindGroup{interface DYNAMIC_OFFSET_DATA{start:number;len:number}}}export default ComputePassCreator;export interface COMPUTE_PASS_OPTIONS extends GPUObjectDescriptorBase{timestampRewrites?:TIMESTAMP_REWRITES}export interface TIMESTAMP_REWRITES{querySet:QuerySetCreator|DC_MEMBER<"QuerySet">;passWriteIndex?:{beginning?:number;end?:number}}
1
+ import { BRAND, LABEL, RAW } from "@agpu/helpers/decorators";
2
+ import DC_MEMBER from "../../../../helpers/types/DCMember";
3
+ import UNSURE from "@agpu/helpers/unsure";
4
+ import BindGroupCreator from "../../data/bindGroup";
5
+ import BufferCreator from "../../data/buffers";
6
+ import ComputePipelineCreator from "../computePipeline";
7
+ import QuerySetCreator from "../querySet";
8
+ import IndirectBufferCreator, { INDIRECT_BUFFER_OPTIONS } from "./renderPass/indirectBuffer";
9
+ export interface ComputePassCreator extends RAW<GPUComputePassEncoder>, BRAND<"ComputePassCreator">, LABEL {
10
+ }
11
+ /**
12
+ * Wrapper around {@link GPUComputePassEncoder}.
13
+ */
14
+ export declare class ComputePassCreator {
15
+ #private;
16
+ readonly computepass: GPUComputePassEncoder;
17
+ constructor(device: GPUDevice, cmdencoder: GPUCommandEncoder, options?: COMPUTE_PASS_OPTIONS);
18
+ /**
19
+ * Mirrors `setBindGroup` for the compute pass.
20
+ */
21
+ bindGroup(index: number, bindGroup: BindGroupCreator | DC_MEMBER<"BindGroup">, dynamicOffsets?: number[] | Uint32Array, dynamicOffsetData?: ComputePassCreator.bindGroup.DYNAMIC_OFFSET_DATA): void;
22
+ /**
23
+ * Getter/Setter for the current compute pipeline wrapper.
24
+ */
25
+ pipeline(): Promise<UNSURE<ComputePipelineCreator>>;
26
+ pipeline<T extends ComputePipelineCreator | DC_MEMBER<"ComputePipeline">>(pipeline: T): Promise<T>;
27
+ dispatchWorkgroup: ((x: number, y: number, z: number) => void) & {
28
+ IndirectBuffer: {
29
+ new (options: INDIRECT_BUFFER_OPTIONS): {
30
+ "__#private@#currentBuffer": GPUBuffer;
31
+ "__#private@#device": GPUDevice;
32
+ "__#private@#value": GPUAllowSharedBufferSource;
33
+ "__#private@#dirty": boolean;
34
+ "__#private@#destroyed": boolean;
35
+ "__#private@#checkFlags"(): boolean;
36
+ raw(): GPUBuffer;
37
+ clone(): BufferCreator;
38
+ destroy(): boolean;
39
+ destroy<T extends boolean>(destroy: T): T;
40
+ value(): UNSURE<GPUAllowSharedBufferSource>;
41
+ value<T extends GPUAllowSharedBufferSource>(val: T): T;
42
+ label(): string;
43
+ label<T extends string>(label: T): T;
44
+ sync(): void;
45
+ read(): Promise<ArrayBuffer>;
46
+ get can(): {
47
+ copy: {
48
+ read: boolean;
49
+ write: boolean;
50
+ };
51
+ map: {
52
+ read: boolean;
53
+ write: boolean;
54
+ };
55
+ beBoundAs: {
56
+ index: boolean;
57
+ vertex: boolean;
58
+ uniform: boolean;
59
+ storage: boolean;
60
+ indirect: boolean;
61
+ };
62
+ query: boolean;
63
+ };
64
+ copyToBuffer(destination: BufferCreator | GPUBuffer, size?: number): void;
65
+ copyToTexture(destination: import("../../data/buffers").TEXTURE_COPY_DESTINATION | GPUTexture, options?: import("../../data/buffers").BUFFER_TO_TEXTURE_OPTIONS): void;
66
+ query(querySet: GPUQuerySet, firstQuery?: number, queryCount?: number, destinationOffset?: number): void;
67
+ readonly __brand: "BufferCreator";
68
+ [Symbol.hasInstance](instance: BufferCreator): instance is BufferCreator;
69
+ };
70
+ readonly len: 3;
71
+ from(buffer: BufferCreator | GPUBuffer): Promise<IndirectBufferCreator>;
72
+ };
73
+ indirect: (buffer: {
74
+ "__#private@#currentBuffer": GPUBuffer;
75
+ "__#private@#device": GPUDevice;
76
+ "__#private@#value": GPUAllowSharedBufferSource;
77
+ "__#private@#dirty": boolean;
78
+ "__#private@#destroyed": boolean;
79
+ "__#private@#checkFlags"(): boolean;
80
+ raw(): GPUBuffer;
81
+ clone(): BufferCreator;
82
+ destroy(): boolean;
83
+ destroy<T extends boolean>(destroy: T): T;
84
+ value(): UNSURE<GPUAllowSharedBufferSource>;
85
+ value<T extends GPUAllowSharedBufferSource>(val: T): T;
86
+ label(): string;
87
+ label<T extends string>(label: T): T;
88
+ sync(): void;
89
+ read(): Promise<ArrayBuffer>;
90
+ get can(): {
91
+ copy: {
92
+ read: boolean;
93
+ write: boolean;
94
+ };
95
+ map: {
96
+ read: boolean;
97
+ write: boolean;
98
+ };
99
+ beBoundAs: {
100
+ index: boolean;
101
+ vertex: boolean;
102
+ uniform: boolean;
103
+ storage: boolean;
104
+ indirect: boolean;
105
+ };
106
+ query: boolean;
107
+ };
108
+ copyToBuffer(destination: BufferCreator | GPUBuffer, size?: number): void;
109
+ copyToTexture(destination: import("../../data/buffers").TEXTURE_COPY_DESTINATION | GPUTexture, options?: import("../../data/buffers").BUFFER_TO_TEXTURE_OPTIONS): void;
110
+ query(querySet: GPUQuerySet, firstQuery?: number, queryCount?: number, destinationOffset?: number): void;
111
+ readonly __brand: "BufferCreator";
112
+ [Symbol.hasInstance](instance: BufferCreator): instance is BufferCreator;
113
+ }, offset: number) => void;
114
+ };
115
+ /**
116
+ * Ends the underlying compute pass encoder.
117
+ */
118
+ end(): void;
119
+ readonly debug: {
120
+ push: (label: string) => void;
121
+ pop: () => void;
122
+ insertMarker: (label: string) => void;
123
+ };
124
+ }
125
+ export declare namespace ComputePassCreator {
126
+ namespace bindGroup {
127
+ interface DYNAMIC_OFFSET_DATA {
128
+ start: number;
129
+ len: number;
130
+ }
131
+ }
132
+ }
133
+ export default ComputePassCreator;
134
+ /**
135
+ * Options used to configure a compute pass.
136
+ */
137
+ export interface COMPUTE_PASS_OPTIONS extends GPUObjectDescriptorBase {
138
+ timestampRewrites?: TIMESTAMP_REWRITES;
139
+ }
140
+ /**
141
+ * Timestamp query writes emitted at the start and/or end of a compute pass.
142
+ */
143
+ export interface TIMESTAMP_REWRITES {
144
+ querySet: QuerySetCreator | DC_MEMBER<"QuerySet">;
145
+ passWriteIndex?: {
146
+ beginning?: number;
147
+ end?: number;
148
+ };
149
+ }
@@ -1 +1,89 @@
1
- import DC_MEMBER from"../../../../helpers/types/DCMember";import UNSURE from"@agpu/helpers/unsure";import BindGroupCreator from"../../data/bindGroup";import BufferCreator from"../../data/buffers";import IndirectBufferCreator,{INDIRECT_BUFFER_OPTIONS}from"./renderPass/indirectBuffer";import RenderPipelineCreator from"../renderPipeline";export interface INDIRECT_BUFFER_CONSTRUCTOR{new(options:INDIRECT_BUFFER_OPTIONS):IndirectBufferCreator;readonly len:number;from(buffer:BufferCreator|GPUBuffer):Promise<IndirectBufferCreator>}export interface DRAW_MACHINE{(vertexCount:number,instanceCount?:number,firstVertex?:number,firstInstance?:number):void;indexed(indexCount:number,instanceCount?:number,firstIndex?:number,baseVertex?:number,firstInstance?:number):void;indexedIndirect(buffer:IndirectBufferCreator,offset?:number):void;indirect(buffer:IndirectBufferCreator,offset?:number):void;IndexedIndirectBuffer:INDIRECT_BUFFER_CONSTRUCTOR;IndirectBuffer:INDIRECT_BUFFER_CONSTRUCTOR}export interface RENDER_ENCODER_BIND_GROUP_DYNAMIC_OFFSET_DATA{start:number;len:number}export interface COMMON_RENDER_ENCODER{label:string;draw(vertexCount:number,instanceCount?:number,firstVertex?:number,firstInstance?:number):void;drawIndexed(indexCount:number,instanceCount?:number,firstIndex?:number,baseVertex?:number,firstInstance?:number):void;drawIndexedIndirect(indirectBuffer:GPUBuffer,indirectOffset:number):void;drawIndirect(indirectBuffer:GPUBuffer,indirectOffset:number):void;setIndexBuffer(buffer:GPUBuffer,indexFormat:GPUIndexFormat,offset?:number,size?:number):void;setVertexBuffer(slot:number,buffer:GPUBuffer|null,offset?:number,size?:number):void;setBindGroup(index:number,bindGroup:GPUBindGroup|null,dynamicOffsets?:Iterable<number>):void;setBindGroup(index:number,bindGroup:GPUBindGroup|null,dynamicOffsetsData:Uint32Array,dynamicOffsetsDataStart:number,dynamicOffsetsDataLength:number):void;setPipeline(pipeline:GPURenderPipeline):void;pushDebugGroup(groupLabel:string):void;popDebugGroup():void;insertDebugMarker(markerLabel:string):void}export default class RenderEncoderBase<T_ENCODER extends COMMON_RENDER_ENCODER=COMMON_RENDER_ENCODER>{#private;readonly encoder:T_ENCODER;readonly draw:DRAW_MACHINE;readonly buffer:{index:(buffer:BufferCreator|DC_MEMBER<"Buffer">)=>void;vertex:(slot:number,buffer:BufferCreator|DC_MEMBER<"Buffer">)=>void};readonly debug:{push:(label:string)=>void;pop:()=>void;insertMarker:(label:string)=>void};constructor(device:GPUDevice,encoder:T_ENCODER);bindGroup(index:number,bindGroup:BindGroupCreator|DC_MEMBER<"BindGroup">,dynamicOffsets?:number[]|Uint32Array,dynamicOffsetData?:RENDER_ENCODER_BIND_GROUP_DYNAMIC_OFFSET_DATA):void;pipeline():Promise<UNSURE<RenderPipelineCreator>>;pipeline<T extends RenderPipelineCreator|DC_MEMBER<"RenderPipeline">>(pipeline:T):Promise<T>}
1
+ import DC_MEMBER from "../../../../helpers/types/DCMember";
2
+ import UNSURE from "@agpu/helpers/unsure";
3
+ import BindGroupCreator from "../../data/bindGroup";
4
+ import BufferCreator from "../../data/buffers";
5
+ import IndirectBufferCreator, { INDIRECT_BUFFER_OPTIONS } from "./renderPass/indirectBuffer";
6
+ import RenderPipelineCreator from "../renderPipeline";
7
+ export interface INDIRECT_BUFFER_CONSTRUCTOR {
8
+ new (options: INDIRECT_BUFFER_OPTIONS): IndirectBufferCreator;
9
+ readonly len: number;
10
+ from(buffer: BufferCreator | GPUBuffer): Promise<IndirectBufferCreator>;
11
+ }
12
+ /**
13
+ * Helper object around the shared draw calls available on render pass and
14
+ * render bundle encoders.
15
+ */
16
+ export interface DRAW_MACHINE {
17
+ (vertexCount: number, instanceCount?: number, firstVertex?: number, firstInstance?: number): void;
18
+ indexed(indexCount: number, instanceCount?: number, firstIndex?: number, baseVertex?: number, firstInstance?: number): void;
19
+ indexedIndirect(buffer: IndirectBufferCreator, offset?: number): void;
20
+ indirect(buffer: IndirectBufferCreator, offset?: number): void;
21
+ IndexedIndirectBuffer: INDIRECT_BUFFER_CONSTRUCTOR;
22
+ IndirectBuffer: INDIRECT_BUFFER_CONSTRUCTOR;
23
+ }
24
+ /**
25
+ * Dynamic-offset window information passed to `setBindGroup`.
26
+ */
27
+ export interface RENDER_ENCODER_BIND_GROUP_DYNAMIC_OFFSET_DATA {
28
+ start: number;
29
+ len: number;
30
+ }
31
+ /**
32
+ * Structural subset shared by {@link GPURenderPassEncoder} and
33
+ * {@link GPURenderBundleEncoder}.
34
+ */
35
+ export interface COMMON_RENDER_ENCODER {
36
+ label: string;
37
+ draw(vertexCount: number, instanceCount?: number, firstVertex?: number, firstInstance?: number): void;
38
+ drawIndexed(indexCount: number, instanceCount?: number, firstIndex?: number, baseVertex?: number, firstInstance?: number): void;
39
+ drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: number): void;
40
+ drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: number): void;
41
+ setIndexBuffer(buffer: GPUBuffer, indexFormat: GPUIndexFormat, offset?: number, size?: number): void;
42
+ setVertexBuffer(slot: number, buffer: GPUBuffer | null, offset?: number, size?: number): void;
43
+ setBindGroup(index: number, bindGroup: GPUBindGroup | null, dynamicOffsets?: Iterable<number>): void;
44
+ setBindGroup(index: number, bindGroup: GPUBindGroup | null, dynamicOffsetsData: Uint32Array, dynamicOffsetsDataStart: number, dynamicOffsetsDataLength: number): void;
45
+ setPipeline(pipeline: GPURenderPipeline): void;
46
+ pushDebugGroup(groupLabel: string): void;
47
+ popDebugGroup(): void;
48
+ insertDebugMarker(markerLabel: string): void;
49
+ }
50
+ /**
51
+ * Shared wrapper for commands supported by both render passes and render
52
+ * bundle encoders.
53
+ */
54
+ export default class RenderEncoderBase<T_ENCODER extends COMMON_RENDER_ENCODER = COMMON_RENDER_ENCODER> {
55
+ #private;
56
+ readonly encoder: T_ENCODER;
57
+ /**
58
+ * Draw helpers plus indirect-buffer helper constructors.
59
+ */
60
+ readonly draw: DRAW_MACHINE;
61
+ /**
62
+ * Vertex and index buffer binding helpers.
63
+ */
64
+ readonly buffer: {
65
+ index: (buffer: BufferCreator | DC_MEMBER<"Buffer">) => void;
66
+ vertex: (slot: number, buffer: BufferCreator | DC_MEMBER<"Buffer">) => void;
67
+ };
68
+ /**
69
+ * Debug-group helpers that mirror the underlying encoder.
70
+ */
71
+ readonly debug: {
72
+ push: (label: string) => void;
73
+ pop: () => void;
74
+ insertMarker: (label: string) => void;
75
+ };
76
+ constructor(device: GPUDevice, encoder: T_ENCODER);
77
+ /**
78
+ * Mirrors `setBindGroup` and supports both direct dynamic offsets and
79
+ * typed-array window arguments.
80
+ */
81
+ bindGroup(index: number, bindGroup: BindGroupCreator | DC_MEMBER<"BindGroup">, dynamicOffsets?: number[] | Uint32Array, dynamicOffsetData?: RENDER_ENCODER_BIND_GROUP_DYNAMIC_OFFSET_DATA): void;
82
+ /**
83
+ * Getter/Setter for the current render pipeline wrapper.
84
+ *
85
+ * Returns the cached pipeline wrapper when called without arguments.
86
+ */
87
+ pipeline(): Promise<UNSURE<RenderPipelineCreator>>;
88
+ pipeline<T extends RenderPipelineCreator | DC_MEMBER<"RenderPipeline">>(pipeline: T): Promise<T>;
89
+ }
@@ -1 +1,28 @@
1
- import BufferCreator,{BUFFER_CONSTRUCTION_OPTIONS}from"../../../data/buffers";import BUFFER_USAGE_OPTIONS,{BUFFER_BINDING_OPTIONS}from"../../../data/buffers/bufferUsageOptions";export default class IndirectBufferCreator extends BufferCreator{constructor(device:GPUDevice,options:INDIRECT_BUFFER_OPTIONS)}export interface INDIRECT_BUFFER_OPTIONS extends BUFFER_CONSTRUCTION_OPTIONS{usage?:INDIRECT_BUFFER_USAGE_OPTIONS;value:GPUAllowSharedBufferSource}export interface INDIRECT_BUFFER_USAGE_OPTIONS extends BUFFER_USAGE_OPTIONS{buffer:INDIRECT_BUFFER_BINDING_OPTIONS}export interface INDIRECT_BUFFER_BINDING_OPTIONS extends BUFFER_BINDING_OPTIONS{indirect?:true}
1
+ import BufferCreator, { BUFFER_CONSTRUCTION_OPTIONS } from "../../../data/buffers";
2
+ import BUFFER_USAGE_OPTIONS, { BUFFER_BINDING_OPTIONS } from "../../../data/buffers/bufferUsageOptions";
3
+ /**
4
+ * Buffer wrapper specialized for indirect draw and dispatch argument payloads.
5
+ */
6
+ declare class IndirectBufferCreator extends BufferCreator {
7
+ constructor(device: GPUDevice, options: INDIRECT_BUFFER_OPTIONS);
8
+ }
9
+ export default IndirectBufferCreator;
10
+ /**
11
+ * Construction options for an indirect buffer.
12
+ */
13
+ export interface INDIRECT_BUFFER_OPTIONS extends BUFFER_CONSTRUCTION_OPTIONS {
14
+ usage?: INDIRECT_BUFFER_USAGE_OPTIONS;
15
+ value: GPUAllowSharedBufferSource;
16
+ }
17
+ /**
18
+ * Buffer usage options constrained for indirect buffers.
19
+ */
20
+ export interface INDIRECT_BUFFER_USAGE_OPTIONS extends BUFFER_USAGE_OPTIONS {
21
+ buffer: INDIRECT_BUFFER_BINDING_OPTIONS;
22
+ }
23
+ /**
24
+ * Binding flags constrained for indirect buffers.
25
+ */
26
+ export interface INDIRECT_BUFFER_BINDING_OPTIONS extends BUFFER_BINDING_OPTIONS {
27
+ indirect?: true;
28
+ }
@@ -1 +1,128 @@
1
- import DC_MEMBER from"../../../../helpers/types/DCMember";import UNSURE from"@agpu/helpers/unsure";import QuerySetCreator from"../querySet";import TextureCreator from"../../data/texture";import TextureViewCreator from"../../data/texture/textureView";import RenderEncoderBase,{RENDER_ENCODER_BIND_GROUP_DYNAMIC_OFFSET_DATA}from"./renderEncoderBase";import RenderBundleCreator from"../renderBundleEncoder/renderBundle";export declare class RenderPassCreator extends RenderEncoderBase<GPURenderPassEncoder>{#private;readonly OcclusionQuery:{new(queryIndex:number):{"__#private@#ended":boolean;end():void}};constructor(device:GPUDevice,cmdEncoder:GPUCommandEncoder,options:RENDER_PASS_OPTIONS);static buildDescriptor(options:RENDER_PASS_OPTIONS):GPURenderPassDescriptor;end():void;blendConstant():GPUColor;blendConstant<T extends GPUColor>(color:T):T;scissorRect():[number,number,number?,number?];scissorRect<T extends[number,number,number,number]>(x:T[0],y:T[1],width:T[2],height:T[3]):T;viewport():[number,number,UNSURE<number>,UNSURE<number>,number,number];viewport<T extends[number,number,number,number,number,number]>(x:T[0],y:T[1],width:T[2],height:T[3],minDepth:T[4],maxDepth:T[5]):T;executeBundles(bundles:RenderBundleCreator[]):undefined}export declare namespace RenderPassCreator{namespace bindGroup{interface DYNAMIC_OFFSET_DATA extends RENDER_ENCODER_BIND_GROUP_DYNAMIC_OFFSET_DATA{}}}export default RenderPassCreator;export interface RENDER_PASS_OPTIONS extends GPUObjectDescriptorBase{attachment?:RENDER_PASS_OPTIONS.ATTACHMENT;occlusionQuerySet?:QuerySetCreator;timestampRewrites?:RENDER_PASS_OPTIONS.TIMESTAMP_REWRITES;maxDrawCount?:number}export declare namespace RENDER_PASS_OPTIONS{interface ATTACHMENT{depthStencil:ATTACHMENT.DEPTH_STENCIL;color:ATTACHMENT.COLOR[]}interface OPERATIONS{load:GPULoadOp;store:GPUStoreOp}interface TIMESTAMP_REWRITES{querySet:QuerySetCreator|DC_MEMBER<"QuerySet">;passWriteIndex:{beginning?:number;end?:number}}}export declare namespace RENDER_PASS_OPTIONS.ATTACHMENT{interface COLOR{depthSlice?:number;operations:RENDER_PASS_OPTIONS.OPERATIONS;color:GPUColor;texture:RENDER_PASS_OPTIONS.ATTACHMENT.COLOR.TEXTURE}interface DEPTH_STENCIL{view:TextureCreator|DC_MEMBER<"Texture">|TextureViewCreator;depth:RENDER_PASS_OPTIONS.ATTACHMENT.DEPTH_STENCIL.COMMON;stencil:RENDER_PASS_OPTIONS.ATTACHMENT.DEPTH_STENCIL.COMMON}}export declare namespace RENDER_PASS_OPTIONS.ATTACHMENT.DEPTH_STENCIL{interface COMMON{clear?:number;operations?:RENDER_PASS_OPTIONS.OPERATIONS;readonly?:boolean}}export declare namespace RENDER_PASS_OPTIONS.ATTACHMENT.COLOR{interface TEXTURE{view:TextureCreator|DC_MEMBER<"Texture">|TextureViewCreator;resolve?:TextureCreator|DC_MEMBER<"Texture">|TextureViewCreator}}
1
+ import DC_MEMBER from "../../../../helpers/types/DCMember";
2
+ import UNSURE from "@agpu/helpers/unsure";
3
+ import QuerySetCreator from "../querySet";
4
+ import TextureCreator from "../../data/texture";
5
+ import TextureViewCreator from "../../data/texture/textureView";
6
+ import RenderEncoderBase, { RENDER_ENCODER_BIND_GROUP_DYNAMIC_OFFSET_DATA } from "./renderEncoderBase";
7
+ import RenderBundleCreator from "../renderBundleEncoder/renderBundle";
8
+ /**
9
+ * Wrapper around {@link GPURenderPassEncoder} with cached state helpers and a
10
+ * higher-level API consistent with the rest of the bindings package.
11
+ */
12
+ export declare class RenderPassCreator extends RenderEncoderBase<GPURenderPassEncoder> {
13
+ #private;
14
+ readonly OcclusionQuery: {
15
+ new (queryIndex: number): {
16
+ "__#private@#ended": boolean;
17
+ end(): void;
18
+ };
19
+ };
20
+ constructor(device: GPUDevice, cmdEncoder: GPUCommandEncoder, options: RENDER_PASS_OPTIONS);
21
+ /**
22
+ * Builds the native WebGPU descriptor consumed by `beginRenderPass`.
23
+ */
24
+ static buildDescriptor(options: RENDER_PASS_OPTIONS): GPURenderPassDescriptor;
25
+ /**
26
+ * Ends the underlying render pass encoder.
27
+ */
28
+ end(): void;
29
+ /**
30
+ * Getter/Setter for the blend constant cached by this wrapper.
31
+ */
32
+ blendConstant(): GPUColor;
33
+ blendConstant<T extends GPUColor>(color: T): T;
34
+ /**
35
+ * Getter/Setter for the current scissor rectangle.
36
+ */
37
+ scissorRect(): [number, number, number?, number?];
38
+ scissorRect<T extends [number, number, number, number]>(x: T[0], y: T[1], width: T[2], height: T[3]): T;
39
+ /**
40
+ * Getter/Setter for the current viewport transform.
41
+ */
42
+ viewport(): [number, number, UNSURE<number>, UNSURE<number>, number, number];
43
+ viewport<T extends [number, number, number, number, number, number]>(x: T[0], y: T[1], width: T[2], height: T[3], minDepth: T[4], maxDepth: T[5]): T;
44
+ /**
45
+ * Executes pre-recorded render bundles inside this render pass.
46
+ */
47
+ executeBundles(bundles: RenderBundleCreator[]): undefined;
48
+ }
49
+ export declare namespace RenderPassCreator {
50
+ namespace bindGroup {
51
+ interface DYNAMIC_OFFSET_DATA extends RENDER_ENCODER_BIND_GROUP_DYNAMIC_OFFSET_DATA {
52
+ }
53
+ }
54
+ }
55
+ export default RenderPassCreator;
56
+ /**
57
+ * Options used to construct a render pass descriptor.
58
+ */
59
+ export interface RENDER_PASS_OPTIONS extends GPUObjectDescriptorBase {
60
+ attachment?: RENDER_PASS_OPTIONS.ATTACHMENT;
61
+ occlusionQuerySet?: QuerySetCreator;
62
+ timestampRewrites?: RENDER_PASS_OPTIONS.TIMESTAMP_REWRITES;
63
+ maxDrawCount?: number;
64
+ }
65
+ export declare namespace RENDER_PASS_OPTIONS {
66
+ /**
67
+ * Attachment configuration passed to the render pass.
68
+ */
69
+ interface ATTACHMENT {
70
+ depthStencil: ATTACHMENT.DEPTH_STENCIL;
71
+ color: ATTACHMENT.COLOR[];
72
+ }
73
+ /**
74
+ * Shared load/store operations used by color, depth, and stencil state.
75
+ */
76
+ interface OPERATIONS {
77
+ load: GPULoadOp;
78
+ store: GPUStoreOp;
79
+ }
80
+ /**
81
+ * Timestamp query writes emitted at the start and/or end of the pass.
82
+ */
83
+ interface TIMESTAMP_REWRITES {
84
+ querySet: QuerySetCreator | DC_MEMBER<"QuerySet">;
85
+ passWriteIndex: {
86
+ beginning?: number;
87
+ end?: number;
88
+ };
89
+ }
90
+ }
91
+ export declare namespace RENDER_PASS_OPTIONS.ATTACHMENT {
92
+ /**
93
+ * Configuration for one color attachment in the pass.
94
+ */
95
+ interface COLOR {
96
+ depthSlice?: number;
97
+ operations: RENDER_PASS_OPTIONS.OPERATIONS;
98
+ color: GPUColor;
99
+ texture: RENDER_PASS_OPTIONS.ATTACHMENT.COLOR.TEXTURE;
100
+ }
101
+ /**
102
+ * Combined depth/stencil attachment configuration.
103
+ */
104
+ interface DEPTH_STENCIL {
105
+ view: TextureCreator | DC_MEMBER<"Texture"> | TextureViewCreator;
106
+ depth: RENDER_PASS_OPTIONS.ATTACHMENT.DEPTH_STENCIL.COMMON;
107
+ stencil: RENDER_PASS_OPTIONS.ATTACHMENT.DEPTH_STENCIL.COMMON;
108
+ }
109
+ }
110
+ export declare namespace RENDER_PASS_OPTIONS.ATTACHMENT.DEPTH_STENCIL {
111
+ /**
112
+ * Shared options for either the depth or stencil half of the attachment.
113
+ */
114
+ interface COMMON {
115
+ clear?: number;
116
+ operations?: RENDER_PASS_OPTIONS.OPERATIONS;
117
+ readonly?: boolean;
118
+ }
119
+ }
120
+ export declare namespace RENDER_PASS_OPTIONS.ATTACHMENT.COLOR {
121
+ /**
122
+ * Texture views used by a color attachment and its optional resolve target.
123
+ */
124
+ interface TEXTURE {
125
+ view: TextureCreator | DC_MEMBER<"Texture"> | TextureViewCreator;
126
+ resolve?: TextureCreator | DC_MEMBER<"Texture"> | TextureViewCreator;
127
+ }
128
+ }
@@ -1 +1,176 @@
1
- import DC_MEMBER from"../../../helpers/types/DCMember";import{BRAND,LABEL}from"@agpu/helpers/decorators";import UNSURE from"@agpu/helpers/unsure";import BufferCreator from"../data/buffers";import CommandBufferCreator from"../data/commandbuffer";import ComputePassCreator,{COMPUTE_PASS_OPTIONS}from"./commandEncoder/computepass";import RenderPassCreator from"./commandEncoder/renderPass";import TextureCreator from"../data/texture";export interface CommandEncoderCreator extends BRAND<"CommandEncoderCreator">,LABEL{}export declare class CommandEncoderCreator{#private;cmdencoder:GPUCommandEncoder;readonly RenderPass:typeof RenderPassCreator;readonly ComputePass:{new(options:COMPUTE_PASS_OPTIONS):{readonly computepass:GPUComputePassEncoder;"__#private@#debugDepth":number;"__#private@#buildOptions"(options?:COMPUTE_PASS_OPTIONS):GPUComputePassDescriptor;bindGroup(index:number,bindGroup:import("../data/bindGroup").BindGroupCreator|DC_MEMBER<"BindGroup">,dynamicOffsets?:number[]|Uint32Array,dynamicOffsetData?:ComputePassCreator.bindGroup.DYNAMIC_OFFSET_DATA):void;"__#private@#pipeline"?:import("./computePipeline").ComputePipelineCreator;pipeline():Promise<UNSURE<import("./computePipeline").ComputePipelineCreator>>;pipeline<T extends import("./computePipeline").ComputePipelineCreator|DC_MEMBER<"ComputePipeline">>(pipeline:T):Promise<T>;dispatchWorkgroup:((x:number,y:number,z:number)=>void)&{IndirectBuffer:{new(options:import("./commandEncoder/renderPass/indirectBuffer").INDIRECT_BUFFER_OPTIONS):{"__#private@#currentBuffer":GPUBuffer;"__#private@#device":GPUDevice;"__#private@#value":GPUAllowSharedBufferSource;"__#private@#dirty":boolean;"__#private@#destroyed":boolean;"__#private@#checkFlags"():boolean;raw():GPUBuffer;clone():BufferCreator;destroy():boolean;destroy<T extends boolean>(destroy:T):T;value():UNSURE<GPUAllowSharedBufferSource>;value<T extends GPUAllowSharedBufferSource>(val:T):T;label():string;label<T extends string>(label:T):T;sync():void;read():Promise<ArrayBuffer>;get can():{copy:{read:boolean;write:boolean};map:{read:boolean;write:boolean};beBoundAs:{index:boolean;vertex:boolean;uniform:boolean;storage:boolean;indirect:boolean};query:boolean};copyToBuffer(destination:BufferCreator|GPUBuffer,size?:number):void;copyToTexture(destination:import("../data/buffers").TEXTURE_COPY_DESTINATION|GPUTexture,options?:import("../data/buffers").BUFFER_TO_TEXTURE_OPTIONS):void;query(querySet:GPUQuerySet,firstQuery?:number,queryCount?:number,destinationOffset?:number):void;readonly __brand:"BufferCreator";[Symbol.hasInstance](instance:BufferCreator):instance is BufferCreator};readonly len:3;from(buffer:BufferCreator|GPUBuffer):Promise<import("./commandEncoder/renderPass/indirectBuffer").default>};indirect:(buffer:{"__#private@#currentBuffer":GPUBuffer;"__#private@#device":GPUDevice;"__#private@#value":GPUAllowSharedBufferSource;"__#private@#dirty":boolean;"__#private@#destroyed":boolean;"__#private@#checkFlags"():boolean;raw():GPUBuffer;clone():BufferCreator;destroy():boolean;destroy<T extends boolean>(destroy:T):T;value():UNSURE<GPUAllowSharedBufferSource>;value<T extends GPUAllowSharedBufferSource>(val:T):T;label():string;label<T extends string>(label:T):T;sync():void;read():Promise<ArrayBuffer>;get can():{copy:{read:boolean;write:boolean};map:{read:boolean;write:boolean};beBoundAs:{index:boolean;vertex:boolean;uniform:boolean;storage:boolean;indirect:boolean};query:boolean};copyToBuffer(destination:BufferCreator|GPUBuffer,size?:number):void;copyToTexture(destination:import("../data/buffers").TEXTURE_COPY_DESTINATION|GPUTexture,options?:import("../data/buffers").BUFFER_TO_TEXTURE_OPTIONS):void;query(querySet:GPUQuerySet,firstQuery?:number,queryCount?:number,destinationOffset?:number):void;readonly __brand:"BufferCreator";[Symbol.hasInstance](instance:BufferCreator):instance is BufferCreator},offset:number)=>void};end():void;readonly debug:{push:(label:string)=>void;pop:()=>void;insertMarker:(label:string)=>void};raw():GPUComputePassEncoder;readonly __brand:"ComputePassCreator";[Symbol.hasInstance](instance:any):boolean;label():string;label<T extends string>(val:T):T}};readonly debug:{push:(label:string)=>void;pop:()=>void;insertMarker:(label:string)=>void};readonly copy:{textureToTexture:(texture:CommandEncoderCreator.copy.TEXEL_COPY_TEXTURE,des:CommandEncoderCreator.copy.TEXEL_COPY_TEXTURE,copySize:GPUExtent3DStrict)=>undefined;textureToBuffer:(texture:CommandEncoderCreator.copy.TEXEL_COPY_TEXTURE,des:CommandEncoderCreator.copy.TEXEL_COPY_BUFFER,copySize:GPUExtent3DStrict)=>undefined;bufferToTexture:(buf:CommandEncoderCreator.copy.TEXEL_COPY_BUFFER,des:CommandEncoderCreator.copy.TEXEL_COPY_TEXTURE,copySize:GPUExtent3DStrict)=>undefined;bufferToBuffer:(buf:BufferCreator,des:BufferCreator,copySize:number)=>undefined};constructor(device:GPUDevice,labelOrCommandEncoder:UNSURE<string>|GPUCommandEncoder);finish(des:GPUObjectDescriptorBase):CommandBufferCreator}export declare namespace CommandEncoderCreator{namespace copy{interface TEXEL_COPY_TEXTURE{texture:TextureCreator|DC_MEMBER<"Texture">;origin?:GPUOrigin3D;aspect?:GPUTextureAspect;mipLevel?:number}interface TEXEL_COPY_BUFFER extends GPUTexelCopyBufferLayout{buffer:BufferCreator|DC_MEMBER<"Buffer">}}}export default CommandEncoderCreator;
1
+ import DC_MEMBER from "../../../helpers/types/DCMember";
2
+ import { BRAND, LABEL } from "@agpu/helpers/decorators";
3
+ import UNSURE from "@agpu/helpers/unsure";
4
+ import BufferCreator from "../data/buffers";
5
+ import CommandBufferCreator from "../data/commandbuffer";
6
+ import ComputePassCreator, { COMPUTE_PASS_OPTIONS } from "./commandEncoder/computepass";
7
+ import RenderPassCreator from "./commandEncoder/renderPass";
8
+ import TextureCreator from "../data/texture";
9
+ export interface CommandEncoderCreator extends BRAND<"CommandEncoderCreator">, LABEL {
10
+ }
11
+ /**
12
+ * Wrapper around {@link GPUCommandEncoder}.
13
+ */
14
+ export declare class CommandEncoderCreator {
15
+ #private;
16
+ cmdencoder: GPUCommandEncoder;
17
+ readonly RenderPass: typeof RenderPassCreator;
18
+ readonly ComputePass: {
19
+ new (options: COMPUTE_PASS_OPTIONS): {
20
+ readonly computepass: GPUComputePassEncoder;
21
+ "__#private@#debugDepth": number;
22
+ "__#private@#buildOptions"(options?: COMPUTE_PASS_OPTIONS): GPUComputePassDescriptor;
23
+ bindGroup(index: number, bindGroup: import("../data/bindGroup").BindGroupCreator | DC_MEMBER<"BindGroup">, dynamicOffsets?: number[] | Uint32Array, dynamicOffsetData?: ComputePassCreator.bindGroup.DYNAMIC_OFFSET_DATA): void;
24
+ "__#private@#pipeline"?: import("./computePipeline").ComputePipelineCreator;
25
+ pipeline(): Promise<UNSURE<import("./computePipeline").ComputePipelineCreator>>;
26
+ pipeline<T extends import("./computePipeline").ComputePipelineCreator | DC_MEMBER<"ComputePipeline">>(pipeline: T): Promise<T>;
27
+ dispatchWorkgroup: ((x: number, y: number, z: number) => void) & {
28
+ IndirectBuffer: {
29
+ new (options: import("./commandEncoder/renderPass/indirectBuffer").INDIRECT_BUFFER_OPTIONS): {
30
+ "__#private@#currentBuffer": GPUBuffer;
31
+ "__#private@#device": GPUDevice;
32
+ "__#private@#value": GPUAllowSharedBufferSource;
33
+ "__#private@#dirty": boolean;
34
+ "__#private@#destroyed": boolean;
35
+ "__#private@#checkFlags"(): boolean;
36
+ raw(): GPUBuffer;
37
+ clone(): BufferCreator;
38
+ destroy(): boolean;
39
+ destroy<T extends boolean>(destroy: T): T;
40
+ value(): UNSURE<GPUAllowSharedBufferSource>;
41
+ value<T extends GPUAllowSharedBufferSource>(val: T): T;
42
+ label(): string;
43
+ label<T extends string>(label: T): T;
44
+ sync(): void;
45
+ read(): Promise<ArrayBuffer>;
46
+ get can(): {
47
+ copy: {
48
+ read: boolean;
49
+ write: boolean;
50
+ };
51
+ map: {
52
+ read: boolean;
53
+ write: boolean;
54
+ };
55
+ beBoundAs: {
56
+ index: boolean;
57
+ vertex: boolean;
58
+ uniform: boolean;
59
+ storage: boolean;
60
+ indirect: boolean;
61
+ };
62
+ query: boolean;
63
+ };
64
+ copyToBuffer(destination: BufferCreator | GPUBuffer, size?: number): void;
65
+ copyToTexture(destination: import("../data/buffers").TEXTURE_COPY_DESTINATION | GPUTexture, options?: import("../data/buffers").BUFFER_TO_TEXTURE_OPTIONS): void;
66
+ query(querySet: GPUQuerySet, firstQuery?: number, queryCount?: number, destinationOffset?: number): void;
67
+ readonly __brand: "BufferCreator";
68
+ [Symbol.hasInstance](instance: BufferCreator): instance is BufferCreator;
69
+ };
70
+ readonly len: 3;
71
+ from(buffer: BufferCreator | GPUBuffer): Promise<import("./commandEncoder/renderPass/indirectBuffer").default>;
72
+ };
73
+ indirect: (buffer: {
74
+ "__#private@#currentBuffer": GPUBuffer;
75
+ "__#private@#device": GPUDevice;
76
+ "__#private@#value": GPUAllowSharedBufferSource;
77
+ "__#private@#dirty": boolean;
78
+ "__#private@#destroyed": boolean;
79
+ "__#private@#checkFlags"(): boolean;
80
+ raw(): GPUBuffer;
81
+ clone(): BufferCreator;
82
+ destroy(): boolean;
83
+ destroy<T extends boolean>(destroy: T): T;
84
+ value(): UNSURE<GPUAllowSharedBufferSource>;
85
+ value<T extends GPUAllowSharedBufferSource>(val: T): T;
86
+ label(): string;
87
+ label<T extends string>(label: T): T;
88
+ sync(): void;
89
+ read(): Promise<ArrayBuffer>;
90
+ get can(): {
91
+ copy: {
92
+ read: boolean;
93
+ write: boolean;
94
+ };
95
+ map: {
96
+ read: boolean;
97
+ write: boolean;
98
+ };
99
+ beBoundAs: {
100
+ index: boolean;
101
+ vertex: boolean;
102
+ uniform: boolean;
103
+ storage: boolean;
104
+ indirect: boolean;
105
+ };
106
+ query: boolean;
107
+ };
108
+ copyToBuffer(destination: BufferCreator | GPUBuffer, size?: number): void;
109
+ copyToTexture(destination: import("../data/buffers").TEXTURE_COPY_DESTINATION | GPUTexture, options?: import("../data/buffers").BUFFER_TO_TEXTURE_OPTIONS): void;
110
+ query(querySet: GPUQuerySet, firstQuery?: number, queryCount?: number, destinationOffset?: number): void;
111
+ readonly __brand: "BufferCreator";
112
+ [Symbol.hasInstance](instance: BufferCreator): instance is BufferCreator;
113
+ }, offset: number) => void;
114
+ };
115
+ end(): void;
116
+ readonly debug: {
117
+ push: (label: string) => void;
118
+ pop: () => void;
119
+ insertMarker: (label: string) => void;
120
+ };
121
+ raw(): GPUComputePassEncoder;
122
+ readonly __brand: "ComputePassCreator";
123
+ [Symbol.hasInstance](instance: any): boolean;
124
+ label(): string;
125
+ label<T extends string>(val: T): T;
126
+ };
127
+ };
128
+ readonly debug: {
129
+ push: (label: string) => void;
130
+ pop: () => void;
131
+ insertMarker: (label: string) => void;
132
+ };
133
+ readonly copy: {
134
+ /**
135
+ * Does not update the cached value in the buffer
136
+ */
137
+ textureToTexture: (texture: CommandEncoderCreator.copy.TEXEL_COPY_TEXTURE, des: CommandEncoderCreator.copy.TEXEL_COPY_TEXTURE, copySize: GPUExtent3DStrict) => undefined;
138
+ /**
139
+ * Does not update the cached value in the buffer
140
+ */
141
+ textureToBuffer: (texture: CommandEncoderCreator.copy.TEXEL_COPY_TEXTURE, des: CommandEncoderCreator.copy.TEXEL_COPY_BUFFER, copySize: GPUExtent3DStrict) => undefined;
142
+ /**
143
+ * Does not update the cached value in the buffer
144
+ */
145
+ bufferToTexture: (buf: CommandEncoderCreator.copy.TEXEL_COPY_BUFFER, des: CommandEncoderCreator.copy.TEXEL_COPY_TEXTURE, copySize: GPUExtent3DStrict) => undefined;
146
+ /**
147
+ * Does not update the cached value in the buffer
148
+ */
149
+ bufferToBuffer: (buf: BufferCreator, des: BufferCreator, copySize: number) => undefined;
150
+ };
151
+ constructor(device: GPUDevice, labelOrCommandEncoder: UNSURE<string> | GPUCommandEncoder);
152
+ /**
153
+ * Finishes recording and returns a wrapped command buffer.
154
+ */
155
+ finish(des: GPUObjectDescriptorBase): CommandBufferCreator;
156
+ }
157
+ export declare namespace CommandEncoderCreator {
158
+ namespace copy {
159
+ /**
160
+ * Texture copy source/destination metadata used by the copy helpers.
161
+ */
162
+ interface TEXEL_COPY_TEXTURE {
163
+ texture: TextureCreator | DC_MEMBER<"Texture">;
164
+ origin?: GPUOrigin3D;
165
+ aspect?: GPUTextureAspect;
166
+ mipLevel?: number;
167
+ }
168
+ /**
169
+ * Buffer copy source/destination metadata used by the copy helpers.
170
+ */
171
+ interface TEXEL_COPY_BUFFER extends GPUTexelCopyBufferLayout {
172
+ buffer: BufferCreator | DC_MEMBER<"Buffer">;
173
+ }
174
+ }
175
+ }
176
+ export default CommandEncoderCreator;
@@ -1 +1 @@
1
- "use strict";var e=this&&this.__esDecorate||((e,r,t,o,s,i)=>{function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var c,n=o.kind,u="getter"===n?"get":"setter"===n?"set":"value",d=!r&&e?o.static?e:e.prototype:null,f=r||(d?Object.getOwnPropertyDescriptor(d,o.name):{}),l=!1,p=t.length-1;p>=0;p--){var m={};for(var h in o)m[h]="access"===h?{}:o[h];for(var h in o.access)m.access[h]=o.access[h];m.addInitializer=e=>{if(l)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var b=(0,t[p])("accessor"===n?{get:f.get,set:f.set}:f[u],m);if("accessor"===n){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(c=a(b.get))&&(f.get=c),(c=a(b.set))&&(f.set=c),(c=a(b.init))&&s.unshift(c)}else(c=a(b))&&("field"===n?s.unshift(c):f[u]=c)}d&&Object.defineProperty(d,o.name,f),l=!0}),r=this&&this.__runInitializers||function(e,r,t){for(var o=arguments.length>2,s=0;r.length>s;s++)t=o?r[s].call(e,t):r[s].call(e);return o?t:void 0},t=this&&this.__importDefault||(e=>e&&e.__esModule?e:{default:e});Object.defineProperty(exports,"__esModule",{value:!0}),exports.CommandEncoderCreator=void 0;const o=t(require("../../../helpers/errors")),s=require("@agpu/helpers/decorators"),i=require("@agpu/helpers/decorators"),a=t(require("../data/commandbuffer")),c=t(require("./commandEncoder/computepass")),n=t(require("./commandEncoder/renderPass"));let u=(()=>{let t,u,d=[(0,s.brand)("CommandEncoderCreator"),(0,i.labeling)({get:e=>e.cmdencoder.label,set:(e,r)=>e.cmdencoder.label=r})],f=[];return class{static{u=this}static{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;e(null,t={value:u},d,{kind:"class",name:u.name,metadata:o},null,f),u=t.value,o&&Object.defineProperty(u,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o}),r(u,f)}cmdencoder;RenderPass;ComputePass;debug;copy;#e=0;constructor(e,r){this.cmdencoder=r instanceof GPUCommandEncoder?r:e.createCommandEncoder({label:r}),this.cmdencoder=this.cmdencoder;const t=this;this.RenderPass=class extends n.default{constructor(r){super(e,t.cmdencoder,r)}},this.ComputePass=class extends c.default{constructor(r){super(e,t.cmdencoder,r)}},this.debug={push:e=>{this.#e++,this.cmdencoder.pushDebugGroup(e)},pop:()=>{if(0>=this.#e)throw(0,o.default)(17,"debug.pop used before init");this.cmdencoder.popDebugGroup(),this.#e--},insertMarker:e=>{this.cmdencoder.insertDebugMarker(e)}},this.copy={textureToTexture:(e,r,t)=>this.cmdencoder.copyTextureToTexture({texture:e.texture.raw(),mipLevel:e.mipLevel,aspect:e.aspect,origin:e.origin},{texture:r.texture.raw(),mipLevel:r.mipLevel,aspect:r.aspect,origin:r.origin},t),textureToBuffer:(e,r,t)=>this.cmdencoder.copyTextureToBuffer({texture:e.texture.raw(),mipLevel:e.mipLevel,aspect:e.aspect,origin:e.origin},{buffer:r.buffer.raw(),bytesPerRow:r.bytesPerRow,offset:r.offset,rowsPerImage:r.rowsPerImage},t),bufferToTexture:(e,r,t)=>this.cmdencoder.copyBufferToTexture({buffer:e.buffer.raw(),bytesPerRow:e.bytesPerRow,offset:e.offset,rowsPerImage:e.rowsPerImage},{texture:r.texture.raw(),mipLevel:r.mipLevel,aspect:r.aspect,origin:r.origin},t),bufferToBuffer:(e,r,t)=>this.cmdencoder.copyBufferToBuffer(e.raw(),r.raw(),t)}}finish(e){return new a.default(this.cmdencoder.finish(e))}},u})();exports.CommandEncoderCreator=u,exports.default=u;
1
+ "use strict";var e=this&&this.__esDecorate||((e,r,t,o,s,i)=>{function c(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,n=o.kind,u="getter"===n?"get":"setter"===n?"set":"value",d=!r&&e?o.static?e:e.prototype:null,l=r||(d?Object.getOwnPropertyDescriptor(d,o.name):{}),f=!1,p=t.length-1;p>=0;p--){var m={};for(var h in o)m[h]="access"===h?{}:o[h];for(var h in o.access)m.access[h]=o.access[h];m.addInitializer=e=>{if(f)throw new TypeError("Cannot add initializers after decoration has completed");i.push(c(e||null))};var b=(0,t[p])("accessor"===n?{get:l.get,set:l.set}:l[u],m);if("accessor"===n){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(a=c(b.get))&&(l.get=a),(a=c(b.set))&&(l.set=a),(a=c(b.init))&&s.unshift(a)}else(a=c(b))&&("field"===n?s.unshift(a):l[u]=a)}d&&Object.defineProperty(d,o.name,l),f=!0}),r=this&&this.__runInitializers||function(e,r,t){for(var o=arguments.length>2,s=0;r.length>s;s++)t=o?r[s].call(e,t):r[s].call(e);return o?t:void 0},t=this&&this.__importDefault||(e=>e&&e.__esModule?e:{default:e});Object.defineProperty(exports,"__esModule",{value:!0}),exports.CommandEncoderCreator=void 0;const o=t(require("../../../helpers/errors")),s=require("@agpu/helpers/decorators"),i=require("@agpu/helpers/decorators"),c=t(require("../data/commandbuffer")),a=t(require("./commandEncoder/computepass")),n=t(require("./commandEncoder/renderPass"));let u=(()=>{let t,u,d=[(0,s.brand)("CommandEncoderCreator"),(0,i.labeling)({get:e=>e.cmdencoder.label,set:(e,r)=>e.cmdencoder.label=r})],l=[];return class{static{u=this}static{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;e(null,t={value:u},d,{kind:"class",name:u.name,metadata:o},null,l),u=t.value,o&&Object.defineProperty(u,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o}),r(u,l)}cmdencoder;RenderPass;ComputePass;debug;copy;#e=0;constructor(e,r){this.cmdencoder=r instanceof GPUCommandEncoder?r:e.createCommandEncoder({label:r}),this.cmdencoder=this.cmdencoder;const t=this;this.RenderPass=class extends n.default{constructor(r){super(e,t.cmdencoder,r)}static buildDescriptor(e){return n.default.buildDescriptor(e)}},this.ComputePass=class extends a.default{constructor(r){super(e,t.cmdencoder,r)}},this.debug={push:e=>{this.#e++,this.cmdencoder.pushDebugGroup(e)},pop:()=>{if(0>=this.#e)throw(0,o.default)(17,"debug.pop used before init");this.cmdencoder.popDebugGroup(),this.#e--},insertMarker:e=>{this.cmdencoder.insertDebugMarker(e)}},this.copy={textureToTexture:(e,r,t)=>this.cmdencoder.copyTextureToTexture({texture:e.texture.raw(),mipLevel:e.mipLevel,aspect:e.aspect,origin:e.origin},{texture:r.texture.raw(),mipLevel:r.mipLevel,aspect:r.aspect,origin:r.origin},t),textureToBuffer:(e,r,t)=>this.cmdencoder.copyTextureToBuffer({texture:e.texture.raw(),mipLevel:e.mipLevel,aspect:e.aspect,origin:e.origin},{buffer:r.buffer.raw(),bytesPerRow:r.bytesPerRow,offset:r.offset,rowsPerImage:r.rowsPerImage},t),bufferToTexture:(e,r,t)=>this.cmdencoder.copyBufferToTexture({buffer:e.buffer.raw(),bytesPerRow:e.bytesPerRow,offset:e.offset,rowsPerImage:e.rowsPerImage},{texture:r.texture.raw(),mipLevel:r.mipLevel,aspect:r.aspect,origin:r.origin},t),bufferToBuffer:(e,r,t)=>this.cmdencoder.copyBufferToBuffer(e.raw(),r.raw(),t)}}finish(e){return new c.default(this.cmdencoder.finish(e))}},u})();exports.CommandEncoderCreator=u,exports.default=u;