Skip to content

Commit 1c8d271

Browse files
authored
Add GPUTexture (#2367)
Co-authored-by: saschanaz <[email protected]>
1 parent da7684b commit 1c8d271

18 files changed

+1569
-4
lines changed

baselines/dom.generated.d.ts

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

808+
interface GPUObjectDescriptorBase {
809+
label?: string;
810+
}
811+
808812
interface GPUPipelineErrorInit {
809813
reason: GPUPipelineErrorReason;
810814
}
811815

816+
interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase {
817+
arrayLayerCount?: GPUIntegerCoordinate;
818+
aspect?: GPUTextureAspect;
819+
baseArrayLayer?: GPUIntegerCoordinate;
820+
baseMipLevel?: GPUIntegerCoordinate;
821+
dimension?: GPUTextureViewDimension;
822+
format?: GPUTextureFormat;
823+
mipLevelCount?: GPUIntegerCoordinate;
824+
usage?: GPUTextureUsageFlags;
825+
}
826+
812827
interface GPUUncapturedErrorEventInit extends EventInit {
813828
error: GPUError;
814829
}
@@ -15026,6 +15041,80 @@ declare var GPUSupportedLimits: {
1502615041
new(): GPUSupportedLimits;
1502715042
};
1502815043

15044+
/**
15045+
* The **`GPUTexture`** interface of the WebGPU API represents a container used to store 1D, 2D, or 3D arrays of data, such as images, to use in GPU rendering operations.
15046+
* Available only in secure contexts.
15047+
*
15048+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUTexture)
15049+
*/
15050+
interface GPUTexture extends GPUObjectBase {
15051+
/**
15052+
* The **`depthOrArrayLayers`** read-only property of the GPUTexture interface represents the depth or layer count of the GPUTexture.
15053+
*
15054+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUTexture/depthOrArrayLayers)
15055+
*/
15056+
readonly depthOrArrayLayers: GPUIntegerCoordinateOut;
15057+
/**
15058+
* The **`dimension`** read-only property of the GPUTexture interface represents the dimension of the set of texels for each GPUTexture subresource.
15059+
*
15060+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUTexture/dimension)
15061+
*/
15062+
readonly dimension: GPUTextureDimension;
15063+
/**
15064+
* The **`format`** read-only property of the GPUTexture interface represents the format of the GPUTexture.
15065+
*
15066+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUTexture/format)
15067+
*/
15068+
readonly format: GPUTextureFormat;
15069+
/**
15070+
* The **`height`** read-only property of the GPUTexture interface represents the height of the GPUTexture.
15071+
*
15072+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUTexture/height)
15073+
*/
15074+
readonly height: GPUIntegerCoordinateOut;
15075+
/**
15076+
* The **`mipLevelCount`** read-only property of the GPUTexture interface represents the number of mip levels of the GPUTexture.
15077+
*
15078+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUTexture/mipLevelCount)
15079+
*/
15080+
readonly mipLevelCount: GPUIntegerCoordinateOut;
15081+
/**
15082+
* The **`sampleCount`** read-only property of the GPUTexture interface represents the sample count of the GPUTexture.
15083+
*
15084+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUTexture/sampleCount)
15085+
*/
15086+
readonly sampleCount: GPUSize32Out;
15087+
/**
15088+
* The **`usage`** read-only property of the GPUTexture interface is the bitwise flags representing the allowed usages of the GPUTexture.
15089+
*
15090+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUTexture/usage)
15091+
*/
15092+
readonly usage: GPUFlagsConstant;
15093+
/**
15094+
* The **`width`** read-only property of the GPUTexture interface represents the width of the GPUTexture.
15095+
*
15096+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUTexture/width)
15097+
*/
15098+
readonly width: GPUIntegerCoordinateOut;
15099+
/**
15100+
* The **`createView()`** method of the GPUTexture interface creates a GPUTextureView representing a specific view of the GPUTexture.
15101+
*
15102+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUTexture/createView)
15103+
*/
15104+
createView(descriptor?: GPUTextureViewDescriptor): GPUTextureView;
15105+
/**
15106+
* The **`destroy()`** method of the GPUTexture interface destroys the GPUTexture.
15107+
*
15108+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUTexture/destroy)
15109+
*/
15110+
destroy(): void;
15111+
}
15112+
15113+
declare var GPUTexture: {
15114+
prototype: GPUTexture;
15115+
new(): GPUTexture;
15116+
};
15117+
1502915118
/**
1503015119
* The **`GPUTextureView`** interface of the WebGPU API represents a view into a subset of the texture resources defined by a particular GPUTexture.
1503115120
* Available only in secure contexts.
@@ -42818,6 +42907,11 @@ type GLsizei = number;
4281842907
type GLsizeiptr = number;
4281942908
type GLuint = number;
4282042909
type GLuint64 = number;
42910+
type GPUFlagsConstant = number;
42911+
type GPUIntegerCoordinate = number;
42912+
type GPUIntegerCoordinateOut = number;
42913+
type GPUSize32Out = number;
42914+
type GPUTextureUsageFlags = number;
4282142915
type HTMLOrSVGImageElement = HTMLImageElement | SVGImageElement;
4282242916
type HTMLOrSVGScriptElement = HTMLScriptElement | SVGScriptElement;
4282342917
type HashAlgorithmIdentifier = AlgorithmIdentifier;
@@ -42923,6 +43017,10 @@ type FontFaceSetLoadStatus = "loaded" | "loading";
4292343017
type FullscreenNavigationUI = "auto" | "hide" | "show";
4292443018
type GPUDeviceLostReason = "destroyed" | "unknown";
4292543019
type GPUPipelineErrorReason = "internal" | "validation";
43020+
type GPUTextureAspect = "all" | "depth-only" | "stencil-only";
43021+
type GPUTextureDimension = "1d" | "2d" | "3d";
43022+
type GPUTextureFormat = "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-snorm" | "bc4-r-unorm" | "bc5-rg-snorm" | "bc5-rg-unorm" | "bc6h-rgb-float" | "bc6h-rgb-ufloat" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "bgra8unorm" | "bgra8unorm-srgb" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "eac-r11snorm" | "eac-r11unorm" | "eac-rg11snorm" | "eac-rg11unorm" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "r16float" | "r16sint" | "r16snorm" | "r16uint" | "r16unorm" | "r32float" | "r32sint" | "r32uint" | "r8sint" | "r8snorm" | "r8uint" | "r8unorm" | "rg11b10ufloat" | "rg16float" | "rg16sint" | "rg16snorm" | "rg16uint" | "rg16unorm" | "rg32float" | "rg32sint" | "rg32uint" | "rg8sint" | "rg8snorm" | "rg8uint" | "rg8unorm" | "rgb10a2uint" | "rgb10a2unorm" | "rgb9e5ufloat" | "rgba16float" | "rgba16sint" | "rgba16snorm" | "rgba16uint" | "rgba16unorm" | "rgba32float" | "rgba32sint" | "rgba32uint" | "rgba8sint" | "rgba8snorm" | "rgba8uint" | "rgba8unorm" | "rgba8unorm-srgb" | "stencil8";
43023+
type GPUTextureViewDimension = "1d" | "2d" | "2d-array" | "3d" | "cube" | "cube-array";
4292643024
type GamepadHapticEffectType = "dual-rumble" | "trigger-rumble";
4292743025
type GamepadHapticsResult = "complete" | "preempted";
4292843026
type GamepadMappingType = "" | "standard" | "xr-standard";

baselines/serviceworker.generated.d.ts

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

275+
interface GPUObjectDescriptorBase {
276+
label?: string;
277+
}
278+
275279
interface GPUPipelineErrorInit {
276280
reason: GPUPipelineErrorReason;
277281
}
278282

283+
interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase {
284+
arrayLayerCount?: GPUIntegerCoordinate;
285+
aspect?: GPUTextureAspect;
286+
baseArrayLayer?: GPUIntegerCoordinate;
287+
baseMipLevel?: GPUIntegerCoordinate;
288+
dimension?: GPUTextureViewDimension;
289+
format?: GPUTextureFormat;
290+
mipLevelCount?: GPUIntegerCoordinate;
291+
usage?: GPUTextureUsageFlags;
292+
}
293+
279294
interface GPUUncapturedErrorEventInit extends EventInit {
280295
error: GPUError;
281296
}
@@ -4503,6 +4518,80 @@ declare var GPUSupportedLimits: {
45034518
new(): GPUSupportedLimits;
45044519
};
45054520

4521+
/**
4522+
* The **`GPUTexture`** interface of the WebGPU API represents a container used to store 1D, 2D, or 3D arrays of data, such as images, to use in GPU rendering operations.
4523+
* Available only in secure contexts.
4524+
*
4525+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUTexture)
4526+
*/
4527+
interface GPUTexture extends GPUObjectBase {
4528+
/**
4529+
* The **`depthOrArrayLayers`** read-only property of the GPUTexture interface represents the depth or layer count of the GPUTexture.
4530+
*
4531+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUTexture/depthOrArrayLayers)
4532+
*/
4533+
readonly depthOrArrayLayers: GPUIntegerCoordinateOut;
4534+
/**
4535+
* The **`dimension`** read-only property of the GPUTexture interface represents the dimension of the set of texels for each GPUTexture subresource.
4536+
*
4537+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUTexture/dimension)
4538+
*/
4539+
readonly dimension: GPUTextureDimension;
4540+
/**
4541+
* The **`format`** read-only property of the GPUTexture interface represents the format of the GPUTexture.
4542+
*
4543+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUTexture/format)
4544+
*/
4545+
readonly format: GPUTextureFormat;
4546+
/**
4547+
* The **`height`** read-only property of the GPUTexture interface represents the height of the GPUTexture.
4548+
*
4549+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUTexture/height)
4550+
*/
4551+
readonly height: GPUIntegerCoordinateOut;
4552+
/**
4553+
* The **`mipLevelCount`** read-only property of the GPUTexture interface represents the number of mip levels of the GPUTexture.
4554+
*
4555+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUTexture/mipLevelCount)
4556+
*/
4557+
readonly mipLevelCount: GPUIntegerCoordinateOut;
4558+
/**
4559+
* The **`sampleCount`** read-only property of the GPUTexture interface represents the sample count of the GPUTexture.
4560+
*
4561+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUTexture/sampleCount)
4562+
*/
4563+
readonly sampleCount: GPUSize32Out;
4564+
/**
4565+
* The **`usage`** read-only property of the GPUTexture interface is the bitwise flags representing the allowed usages of the GPUTexture.
4566+
*
4567+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUTexture/usage)
4568+
*/
4569+
readonly usage: GPUFlagsConstant;
4570+
/**
4571+
* The **`width`** read-only property of the GPUTexture interface represents the width of the GPUTexture.
4572+
*
4573+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUTexture/width)
4574+
*/
4575+
readonly width: GPUIntegerCoordinateOut;
4576+
/**
4577+
* The **`createView()`** method of the GPUTexture interface creates a GPUTextureView representing a specific view of the GPUTexture.
4578+
*
4579+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUTexture/createView)
4580+
*/
4581+
createView(descriptor?: GPUTextureViewDescriptor): GPUTextureView;
4582+
/**
4583+
* The **`destroy()`** method of the GPUTexture interface destroys the GPUTexture.
4584+
*
4585+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUTexture/destroy)
4586+
*/
4587+
destroy(): void;
4588+
}
4589+
4590+
declare var GPUTexture: {
4591+
prototype: GPUTexture;
4592+
new(): GPUTexture;
4593+
};
4594+
45064595
/**
45074596
* The **`GPUTextureView`** interface of the WebGPU API represents a view into a subset of the texture resources defined by a particular GPUTexture.
45084597
* Available only in secure contexts.
@@ -12107,6 +12196,11 @@ type GLsizei = number;
1210712196
type GLsizeiptr = number;
1210812197
type GLuint = number;
1210912198
type GLuint64 = number;
12199+
type GPUFlagsConstant = number;
12200+
type GPUIntegerCoordinate = number;
12201+
type GPUIntegerCoordinateOut = number;
12202+
type GPUSize32Out = number;
12203+
type GPUTextureUsageFlags = number;
1211012204
type HashAlgorithmIdentifier = AlgorithmIdentifier;
1211112205
type HeadersInit = [string, string][] | Record<string, string> | Headers;
1211212206
type IDBValidKey = number | string | Date | BufferSource | IDBValidKey[];
@@ -12157,6 +12251,10 @@ type FontFaceSetLoadStatus = "loaded" | "loading";
1215712251
type FrameType = "auxiliary" | "nested" | "none" | "top-level";
1215812252
type GPUDeviceLostReason = "destroyed" | "unknown";
1215912253
type GPUPipelineErrorReason = "internal" | "validation";
12254+
type GPUTextureAspect = "all" | "depth-only" | "stencil-only";
12255+
type GPUTextureDimension = "1d" | "2d" | "3d";
12256+
type GPUTextureFormat = "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-snorm" | "bc4-r-unorm" | "bc5-rg-snorm" | "bc5-rg-unorm" | "bc6h-rgb-float" | "bc6h-rgb-ufloat" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "bgra8unorm" | "bgra8unorm-srgb" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "eac-r11snorm" | "eac-r11unorm" | "eac-rg11snorm" | "eac-rg11unorm" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "r16float" | "r16sint" | "r16snorm" | "r16uint" | "r16unorm" | "r32float" | "r32sint" | "r32uint" | "r8sint" | "r8snorm" | "r8uint" | "r8unorm" | "rg11b10ufloat" | "rg16float" | "rg16sint" | "rg16snorm" | "rg16uint" | "rg16unorm" | "rg32float" | "rg32sint" | "rg32uint" | "rg8sint" | "rg8snorm" | "rg8uint" | "rg8unorm" | "rgb10a2uint" | "rgb10a2unorm" | "rgb9e5ufloat" | "rgba16float" | "rgba16sint" | "rgba16snorm" | "rgba16uint" | "rgba16unorm" | "rgba32float" | "rgba32sint" | "rgba32uint" | "rgba8sint" | "rgba8snorm" | "rgba8uint" | "rgba8unorm" | "rgba8unorm-srgb" | "stencil8";
12257+
type GPUTextureViewDimension = "1d" | "2d" | "2d-array" | "3d" | "cube" | "cube-array";
1216012258
type GlobalCompositeOperation = "color" | "color-burn" | "color-dodge" | "copy" | "darken" | "destination-atop" | "destination-in" | "destination-out" | "destination-over" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "lighter" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light" | "source-atop" | "source-in" | "source-out" | "source-over" | "xor";
1216112259
type HdrMetadataType = "smpteSt2086" | "smpteSt2094-10" | "smpteSt2094-40";
1216212260
type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique";

0 commit comments

Comments
 (0)