Skip to content

Commit d139a66

Browse files
authored
Add GPURenderPassEncoder (#2389)
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
1 parent 364c8e1 commit d139a66

30 files changed

+1380
-17
lines changed

baselines/dom.generated.d.ts

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,13 @@ interface FullscreenOptions {
805805
navigationUI?: FullscreenNavigationUI;
806806
}
807807

808+
interface GPUColorDict {
809+
a: number;
810+
b: number;
811+
g: number;
812+
r: number;
813+
}
814+
808815
interface GPUObjectDescriptorBase {
809816
label?: string;
810817
}
@@ -15207,6 +15214,68 @@ interface GPURenderCommandsMixin {
1520715214
setVertexBuffer(slot: GPUIndex32, buffer: GPUBuffer | null, offset?: GPUSize64, size?: GPUSize64): void;
1520815215
}
1520915216

15217+
/**
15218+
* The **`GPURenderPassEncoder`** interface of the WebGPU API encodes commands related to controlling the vertex and fragment shader stages, as issued by a GPURenderPipeline. It forms part of the overall encoding activity of a GPUCommandEncoder.
15219+
* Available only in secure contexts.
15220+
*
15221+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder)
15222+
*/
15223+
interface GPURenderPassEncoder extends GPUBindingCommandsMixin, GPUDebugCommandsMixin, GPUObjectBase, GPURenderCommandsMixin {
15224+
/**
15225+
* The **`beginOcclusionQuery()`** method of the GPURenderPassEncoder interface begins an occlusion query at the specified index of the relevant GPUQuerySet (provided as the value of the occlusionQuerySet descriptor property when invoking GPUCommandEncoder.beginRenderPass() to run the render pass).
15226+
*
15227+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/beginOcclusionQuery)
15228+
*/
15229+
beginOcclusionQuery(queryIndex: GPUSize32): void;
15230+
/**
15231+
* The **`end()`** method of the GPURenderPassEncoder interface completes recording of the current render pass command sequence.
15232+
*
15233+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/end)
15234+
*/
15235+
end(): void;
15236+
/**
15237+
* The **`endOcclusionQuery()`** method of the GPURenderPassEncoder interface ends an active occlusion query previously started with beginOcclusionQuery().
15238+
*
15239+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/endOcclusionQuery)
15240+
*/
15241+
endOcclusionQuery(): void;
15242+
/**
15243+
* The **`executeBundles()`** method of the GPURenderPassEncoder interface executes commands previously recorded into the referenced GPURenderBundles, as part of this render pass.
15244+
*
15245+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/executeBundles)
15246+
*/
15247+
executeBundles(bundles: GPURenderBundle[]): void;
15248+
/**
15249+
* The **`setBlendConstant()`** method of the GPURenderPassEncoder interface sets the constant blend color and alpha values used with "constant" and "one-minus-constant" blend factors (as set in the descriptor of the GPUDevice.createRenderPipeline() method, in the blend property).
15250+
*
15251+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/setBlendConstant)
15252+
*/
15253+
setBlendConstant(color: GPUColor): void;
15254+
/**
15255+
* The **`setScissorRect()`** method of the GPURenderPassEncoder interface sets the scissor rectangle used during the rasterization stage. After transformation into viewport coordinates any fragments that fall outside the scissor rectangle will be discarded.
15256+
*
15257+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/setScissorRect)
15258+
*/
15259+
setScissorRect(x: GPUIntegerCoordinate, y: GPUIntegerCoordinate, width: GPUIntegerCoordinate, height: GPUIntegerCoordinate): void;
15260+
/**
15261+
* The **`setStencilReference()`** method of the GPURenderPassEncoder interface sets the stencil reference value using during stencil tests with the "replace" stencil operation (as set in the descriptor of the GPUDevice.createRenderPipeline() method, in the properties defining the various stencil operations).
15262+
*
15263+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/setStencilReference)
15264+
*/
15265+
setStencilReference(reference: GPUStencilValue): void;
15266+
/**
15267+
* The **`setViewport()`** method of the GPURenderPassEncoder interface sets the viewport used during the rasterization stage to linearly map from normalized device coordinates to viewport coordinates.
15268+
*
15269+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/setViewport)
15270+
*/
15271+
setViewport(x: number, y: number, width: number, height: number, minDepth: number, maxDepth: number): void;
15272+
}
15273+
15274+
declare var GPURenderPassEncoder: {
15275+
prototype: GPURenderPassEncoder;
15276+
new(): GPURenderPassEncoder;
15277+
};
15278+
1521015279
/**
1521115280
* The **`GPURenderPipeline`** interface of the WebGPU API represents a pipeline that controls the vertex and fragment shader stages and can be used in a GPURenderPassEncoder or GPURenderBundleEncoder.
1521215281
* Available only in secure contexts.
@@ -43285,6 +43354,7 @@ type GLsizeiptr = number;
4328543354
type GLuint = number;
4328643355
type GLuint64 = number;
4328743356
type GPUBufferDynamicOffset = number;
43357+
type GPUColor = number[] | GPUColorDict;
4328843358
type GPUFlagsConstant = number;
4328943359
type GPUIndex32 = number;
4329043360
type GPUIntegerCoordinate = number;
@@ -43295,6 +43365,7 @@ type GPUSize32 = number;
4329543365
type GPUSize32Out = number;
4329643366
type GPUSize64 = number;
4329743367
type GPUSize64Out = number;
43368+
type GPUStencilValue = number;
4329843369
type GPUTextureUsageFlags = number;
4329943370
type HTMLOrSVGImageElement = HTMLImageElement | SVGImageElement;
4330043371
type HTMLOrSVGScriptElement = HTMLScriptElement | SVGScriptElement;
@@ -43701,6 +43772,21 @@ interface GPUBindingCommandsMixin {
4370143772
setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup | null, dynamicOffsets?: GPUBufferDynamicOffset[]): void;
4370243773
}
4370343774

43775+
interface GPURenderPassEncoder {
43776+
/**
43777+
* The **`executeBundles()`** method of the GPURenderPassEncoder interface executes commands previously recorded into the referenced GPURenderBundles, as part of this render pass.
43778+
*
43779+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/executeBundles)
43780+
*/
43781+
executeBundles(bundles: GPURenderBundle[]): void;
43782+
/**
43783+
* The **`setBlendConstant()`** method of the GPURenderPassEncoder interface sets the constant blend color and alpha values used with "constant" and "one-minus-constant" blend factors (as set in the descriptor of the GPUDevice.createRenderPipeline() method, in the blend property).
43784+
*
43785+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/setBlendConstant)
43786+
*/
43787+
setBlendConstant(color: number[]): void;
43788+
}
43789+
4370443790
interface GPUSupportedFeatures extends ReadonlySet<string> {
4370543791
}
4370643792

baselines/serviceworker.generated.d.ts

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,13 @@ interface FontFaceSetLoadEventInit extends EventInit {
272272
fontfaces?: FontFace[];
273273
}
274274

275+
interface GPUColorDict {
276+
a: number;
277+
b: number;
278+
g: number;
279+
r: number;
280+
}
281+
275282
interface GPUObjectDescriptorBase {
276283
label?: string;
277284
}
@@ -4650,6 +4657,68 @@ interface GPURenderCommandsMixin {
46504657
setVertexBuffer(slot: GPUIndex32, buffer: GPUBuffer | null, offset?: GPUSize64, size?: GPUSize64): void;
46514658
}
46524659

4660+
/**
4661+
* The **`GPURenderPassEncoder`** interface of the WebGPU API encodes commands related to controlling the vertex and fragment shader stages, as issued by a GPURenderPipeline. It forms part of the overall encoding activity of a GPUCommandEncoder.
4662+
* Available only in secure contexts.
4663+
*
4664+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder)
4665+
*/
4666+
interface GPURenderPassEncoder extends GPUBindingCommandsMixin, GPUDebugCommandsMixin, GPUObjectBase, GPURenderCommandsMixin {
4667+
/**
4668+
* The **`beginOcclusionQuery()`** method of the GPURenderPassEncoder interface begins an occlusion query at the specified index of the relevant GPUQuerySet (provided as the value of the occlusionQuerySet descriptor property when invoking GPUCommandEncoder.beginRenderPass() to run the render pass).
4669+
*
4670+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/beginOcclusionQuery)
4671+
*/
4672+
beginOcclusionQuery(queryIndex: GPUSize32): void;
4673+
/**
4674+
* The **`end()`** method of the GPURenderPassEncoder interface completes recording of the current render pass command sequence.
4675+
*
4676+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/end)
4677+
*/
4678+
end(): void;
4679+
/**
4680+
* The **`endOcclusionQuery()`** method of the GPURenderPassEncoder interface ends an active occlusion query previously started with beginOcclusionQuery().
4681+
*
4682+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/endOcclusionQuery)
4683+
*/
4684+
endOcclusionQuery(): void;
4685+
/**
4686+
* The **`executeBundles()`** method of the GPURenderPassEncoder interface executes commands previously recorded into the referenced GPURenderBundles, as part of this render pass.
4687+
*
4688+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/executeBundles)
4689+
*/
4690+
executeBundles(bundles: GPURenderBundle[]): void;
4691+
/**
4692+
* The **`setBlendConstant()`** method of the GPURenderPassEncoder interface sets the constant blend color and alpha values used with "constant" and "one-minus-constant" blend factors (as set in the descriptor of the GPUDevice.createRenderPipeline() method, in the blend property).
4693+
*
4694+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/setBlendConstant)
4695+
*/
4696+
setBlendConstant(color: GPUColor): void;
4697+
/**
4698+
* The **`setScissorRect()`** method of the GPURenderPassEncoder interface sets the scissor rectangle used during the rasterization stage. After transformation into viewport coordinates any fragments that fall outside the scissor rectangle will be discarded.
4699+
*
4700+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/setScissorRect)
4701+
*/
4702+
setScissorRect(x: GPUIntegerCoordinate, y: GPUIntegerCoordinate, width: GPUIntegerCoordinate, height: GPUIntegerCoordinate): void;
4703+
/**
4704+
* The **`setStencilReference()`** method of the GPURenderPassEncoder interface sets the stencil reference value using during stencil tests with the "replace" stencil operation (as set in the descriptor of the GPUDevice.createRenderPipeline() method, in the properties defining the various stencil operations).
4705+
*
4706+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/setStencilReference)
4707+
*/
4708+
setStencilReference(reference: GPUStencilValue): void;
4709+
/**
4710+
* The **`setViewport()`** method of the GPURenderPassEncoder interface sets the viewport used during the rasterization stage to linearly map from normalized device coordinates to viewport coordinates.
4711+
*
4712+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/setViewport)
4713+
*/
4714+
setViewport(x: number, y: number, width: number, height: number, minDepth: number, maxDepth: number): void;
4715+
}
4716+
4717+
declare var GPURenderPassEncoder: {
4718+
prototype: GPURenderPassEncoder;
4719+
new(): GPURenderPassEncoder;
4720+
};
4721+
46534722
/**
46544723
* The **`GPURenderPipeline`** interface of the WebGPU API represents a pipeline that controls the vertex and fragment shader stages and can be used in a GPURenderPassEncoder or GPURenderBundleEncoder.
46554724
* Available only in secure contexts.
@@ -12483,6 +12552,7 @@ type GLsizeiptr = number;
1248312552
type GLuint = number;
1248412553
type GLuint64 = number;
1248512554
type GPUBufferDynamicOffset = number;
12555+
type GPUColor = number[] | GPUColorDict;
1248612556
type GPUFlagsConstant = number;
1248712557
type GPUIndex32 = number;
1248812558
type GPUIntegerCoordinate = number;
@@ -12493,6 +12563,7 @@ type GPUSize32 = number;
1249312563
type GPUSize32Out = number;
1249412564
type GPUSize64 = number;
1249512565
type GPUSize64Out = number;
12566+
type GPUStencilValue = number;
1249612567
type GPUTextureUsageFlags = number;
1249712568
type HashAlgorithmIdentifier = AlgorithmIdentifier;
1249812569
type HeadersInit = [string, string][] | Record<string, string> | Headers;
@@ -12688,6 +12759,21 @@ interface GPUBindingCommandsMixin {
1268812759
setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup | null, dynamicOffsets?: GPUBufferDynamicOffset[]): void;
1268912760
}
1269012761

12762+
interface GPURenderPassEncoder {
12763+
/**
12764+
* The **`executeBundles()`** method of the GPURenderPassEncoder interface executes commands previously recorded into the referenced GPURenderBundles, as part of this render pass.
12765+
*
12766+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/executeBundles)
12767+
*/
12768+
executeBundles(bundles: GPURenderBundle[]): void;
12769+
/**
12770+
* The **`setBlendConstant()`** method of the GPURenderPassEncoder interface sets the constant blend color and alpha values used with "constant" and "one-minus-constant" blend factors (as set in the descriptor of the GPUDevice.createRenderPipeline() method, in the blend property).
12771+
*
12772+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/setBlendConstant)
12773+
*/
12774+
setBlendConstant(color: number[]): void;
12775+
}
12776+
1269112777
interface GPUSupportedFeatures extends ReadonlySet<string> {
1269212778
}
1269312779

baselines/sharedworker.generated.d.ts

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,13 @@ interface FontFaceSetLoadEventInit extends EventInit {
216216
fontfaces?: FontFace[];
217217
}
218218

219+
interface GPUColorDict {
220+
a: number;
221+
b: number;
222+
g: number;
223+
r: number;
224+
}
225+
219226
interface GPUObjectDescriptorBase {
220227
label?: string;
221228
}
@@ -4333,6 +4340,68 @@ interface GPURenderCommandsMixin {
43334340
setVertexBuffer(slot: GPUIndex32, buffer: GPUBuffer | null, offset?: GPUSize64, size?: GPUSize64): void;
43344341
}
43354342

4343+
/**
4344+
* The **`GPURenderPassEncoder`** interface of the WebGPU API encodes commands related to controlling the vertex and fragment shader stages, as issued by a GPURenderPipeline. It forms part of the overall encoding activity of a GPUCommandEncoder.
4345+
* Available only in secure contexts.
4346+
*
4347+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder)
4348+
*/
4349+
interface GPURenderPassEncoder extends GPUBindingCommandsMixin, GPUDebugCommandsMixin, GPUObjectBase, GPURenderCommandsMixin {
4350+
/**
4351+
* The **`beginOcclusionQuery()`** method of the GPURenderPassEncoder interface begins an occlusion query at the specified index of the relevant GPUQuerySet (provided as the value of the occlusionQuerySet descriptor property when invoking GPUCommandEncoder.beginRenderPass() to run the render pass).
4352+
*
4353+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/beginOcclusionQuery)
4354+
*/
4355+
beginOcclusionQuery(queryIndex: GPUSize32): void;
4356+
/**
4357+
* The **`end()`** method of the GPURenderPassEncoder interface completes recording of the current render pass command sequence.
4358+
*
4359+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/end)
4360+
*/
4361+
end(): void;
4362+
/**
4363+
* The **`endOcclusionQuery()`** method of the GPURenderPassEncoder interface ends an active occlusion query previously started with beginOcclusionQuery().
4364+
*
4365+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/endOcclusionQuery)
4366+
*/
4367+
endOcclusionQuery(): void;
4368+
/**
4369+
* The **`executeBundles()`** method of the GPURenderPassEncoder interface executes commands previously recorded into the referenced GPURenderBundles, as part of this render pass.
4370+
*
4371+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/executeBundles)
4372+
*/
4373+
executeBundles(bundles: GPURenderBundle[]): void;
4374+
/**
4375+
* The **`setBlendConstant()`** method of the GPURenderPassEncoder interface sets the constant blend color and alpha values used with "constant" and "one-minus-constant" blend factors (as set in the descriptor of the GPUDevice.createRenderPipeline() method, in the blend property).
4376+
*
4377+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/setBlendConstant)
4378+
*/
4379+
setBlendConstant(color: GPUColor): void;
4380+
/**
4381+
* The **`setScissorRect()`** method of the GPURenderPassEncoder interface sets the scissor rectangle used during the rasterization stage. After transformation into viewport coordinates any fragments that fall outside the scissor rectangle will be discarded.
4382+
*
4383+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/setScissorRect)
4384+
*/
4385+
setScissorRect(x: GPUIntegerCoordinate, y: GPUIntegerCoordinate, width: GPUIntegerCoordinate, height: GPUIntegerCoordinate): void;
4386+
/**
4387+
* The **`setStencilReference()`** method of the GPURenderPassEncoder interface sets the stencil reference value using during stencil tests with the "replace" stencil operation (as set in the descriptor of the GPUDevice.createRenderPipeline() method, in the properties defining the various stencil operations).
4388+
*
4389+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/setStencilReference)
4390+
*/
4391+
setStencilReference(reference: GPUStencilValue): void;
4392+
/**
4393+
* The **`setViewport()`** method of the GPURenderPassEncoder interface sets the viewport used during the rasterization stage to linearly map from normalized device coordinates to viewport coordinates.
4394+
*
4395+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/setViewport)
4396+
*/
4397+
setViewport(x: number, y: number, width: number, height: number, minDepth: number, maxDepth: number): void;
4398+
}
4399+
4400+
declare var GPURenderPassEncoder: {
4401+
prototype: GPURenderPassEncoder;
4402+
new(): GPURenderPassEncoder;
4403+
};
4404+
43364405
/**
43374406
* The **`GPURenderPipeline`** interface of the WebGPU API represents a pipeline that controls the vertex and fragment shader stages and can be used in a GPURenderPassEncoder or GPURenderBundleEncoder.
43384407
* Available only in secure contexts.
@@ -12153,6 +12222,7 @@ type GLsizeiptr = number;
1215312222
type GLuint = number;
1215412223
type GLuint64 = number;
1215512224
type GPUBufferDynamicOffset = number;
12225+
type GPUColor = number[] | GPUColorDict;
1215612226
type GPUFlagsConstant = number;
1215712227
type GPUIndex32 = number;
1215812228
type GPUIntegerCoordinate = number;
@@ -12163,6 +12233,7 @@ type GPUSize32 = number;
1216312233
type GPUSize32Out = number;
1216412234
type GPUSize64 = number;
1216512235
type GPUSize64Out = number;
12236+
type GPUStencilValue = number;
1216612237
type GPUTextureUsageFlags = number;
1216712238
type HashAlgorithmIdentifier = AlgorithmIdentifier;
1216812239
type HeadersInit = [string, string][] | Record<string, string> | Headers;
@@ -12340,6 +12411,21 @@ interface GPUBindingCommandsMixin {
1234012411
setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup | null, dynamicOffsets?: GPUBufferDynamicOffset[]): void;
1234112412
}
1234212413

12414+
interface GPURenderPassEncoder {
12415+
/**
12416+
* The **`executeBundles()`** method of the GPURenderPassEncoder interface executes commands previously recorded into the referenced GPURenderBundles, as part of this render pass.
12417+
*
12418+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/executeBundles)
12419+
*/
12420+
executeBundles(bundles: GPURenderBundle[]): void;
12421+
/**
12422+
* The **`setBlendConstant()`** method of the GPURenderPassEncoder interface sets the constant blend color and alpha values used with "constant" and "one-minus-constant" blend factors (as set in the descriptor of the GPUDevice.createRenderPipeline() method, in the blend property).
12423+
*
12424+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPURenderPassEncoder/setBlendConstant)
12425+
*/
12426+
setBlendConstant(color: number[]): void;
12427+
}
12428+
1234312429
interface GPUSupportedFeatures extends ReadonlySet<string> {
1234412430
}
1234512431

0 commit comments

Comments
 (0)