Skip to content

Commit 01a3267

Browse files
authored
Add GPUDevice.createShaderModule/Texture (#2417)
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
1 parent 6473d3d commit 01a3267

18 files changed

+420
-2
lines changed

baselines/dom.generated.d.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,10 @@ interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
990990
mipmapFilter?: GPUMipmapFilterMode;
991991
}
992992

993+
interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase {
994+
code: string;
995+
}
996+
993997
interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
994998
buffer: GPUBuffer;
995999
}
@@ -1007,6 +1011,16 @@ interface GPUTexelCopyTextureInfo {
10071011
texture: GPUTexture;
10081012
}
10091013

1014+
interface GPUTextureDescriptor extends GPUObjectDescriptorBase {
1015+
dimension?: GPUTextureDimension;
1016+
format: GPUTextureFormat;
1017+
mipLevelCount?: GPUIntegerCoordinate;
1018+
sampleCount?: GPUSize32;
1019+
size: GPUExtent3D;
1020+
usage: GPUTextureUsageFlags;
1021+
viewFormats?: GPUTextureFormat[];
1022+
}
1023+
10101024
interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase {
10111025
arrayLayerCount?: GPUIntegerCoordinate;
10121026
aspect?: GPUTextureAspect;
@@ -15449,6 +15463,18 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
1544915463
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createSampler)
1545015464
*/
1545115465
createSampler(descriptor?: GPUSamplerDescriptor): GPUSampler;
15466+
/**
15467+
* The **`createShaderModule()`** method of the GPUDevice interface creates a GPUShaderModule from a string of WGSL source code.
15468+
*
15469+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createShaderModule)
15470+
*/
15471+
createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
15472+
/**
15473+
* The **`createTexture()`** method of the GPUDevice interface creates a GPUTexture in which to store 1D, 2D, or 3D arrays of data, such as images, to use in GPU rendering operations.
15474+
*
15475+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createTexture)
15476+
*/
15477+
createTexture(descriptor: GPUTextureDescriptor): GPUTexture;
1545215478
/**
1545315479
* The **`destroy()`** method of the GPUDevice interface destroys the device, preventing further operations on it.
1545415480
*

baselines/serviceworker.generated.d.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,10 @@ interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
456456
mipmapFilter?: GPUMipmapFilterMode;
457457
}
458458

459+
interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase {
460+
code: string;
461+
}
462+
459463
interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
460464
buffer: GPUBuffer;
461465
}
@@ -473,6 +477,16 @@ interface GPUTexelCopyTextureInfo {
473477
texture: GPUTexture;
474478
}
475479

480+
interface GPUTextureDescriptor extends GPUObjectDescriptorBase {
481+
dimension?: GPUTextureDimension;
482+
format: GPUTextureFormat;
483+
mipLevelCount?: GPUIntegerCoordinate;
484+
sampleCount?: GPUSize32;
485+
size: GPUExtent3D;
486+
usage: GPUTextureUsageFlags;
487+
viewFormats?: GPUTextureFormat[];
488+
}
489+
476490
interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase {
477491
arrayLayerCount?: GPUIntegerCoordinate;
478492
aspect?: GPUTextureAspect;
@@ -4891,6 +4905,18 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
48914905
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createSampler)
48924906
*/
48934907
createSampler(descriptor?: GPUSamplerDescriptor): GPUSampler;
4908+
/**
4909+
* The **`createShaderModule()`** method of the GPUDevice interface creates a GPUShaderModule from a string of WGSL source code.
4910+
*
4911+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createShaderModule)
4912+
*/
4913+
createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
4914+
/**
4915+
* The **`createTexture()`** method of the GPUDevice interface creates a GPUTexture in which to store 1D, 2D, or 3D arrays of data, such as images, to use in GPU rendering operations.
4916+
*
4917+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createTexture)
4918+
*/
4919+
createTexture(descriptor: GPUTextureDescriptor): GPUTexture;
48944920
/**
48954921
* The **`destroy()`** method of the GPUDevice interface destroys the device, preventing further operations on it.
48964922
*

baselines/sharedworker.generated.d.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,10 @@ interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
400400
mipmapFilter?: GPUMipmapFilterMode;
401401
}
402402

403+
interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase {
404+
code: string;
405+
}
406+
403407
interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
404408
buffer: GPUBuffer;
405409
}
@@ -417,6 +421,16 @@ interface GPUTexelCopyTextureInfo {
417421
texture: GPUTexture;
418422
}
419423

424+
interface GPUTextureDescriptor extends GPUObjectDescriptorBase {
425+
dimension?: GPUTextureDimension;
426+
format: GPUTextureFormat;
427+
mipLevelCount?: GPUIntegerCoordinate;
428+
sampleCount?: GPUSize32;
429+
size: GPUExtent3D;
430+
usage: GPUTextureUsageFlags;
431+
viewFormats?: GPUTextureFormat[];
432+
}
433+
420434
interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase {
421435
arrayLayerCount?: GPUIntegerCoordinate;
422436
aspect?: GPUTextureAspect;
@@ -4574,6 +4588,18 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
45744588
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createSampler)
45754589
*/
45764590
createSampler(descriptor?: GPUSamplerDescriptor): GPUSampler;
4591+
/**
4592+
* The **`createShaderModule()`** method of the GPUDevice interface creates a GPUShaderModule from a string of WGSL source code.
4593+
*
4594+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createShaderModule)
4595+
*/
4596+
createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
4597+
/**
4598+
* The **`createTexture()`** method of the GPUDevice interface creates a GPUTexture in which to store 1D, 2D, or 3D arrays of data, such as images, to use in GPU rendering operations.
4599+
*
4600+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createTexture)
4601+
*/
4602+
createTexture(descriptor: GPUTextureDescriptor): GPUTexture;
45774603
/**
45784604
* The **`destroy()`** method of the GPUDevice interface destroys the device, preventing further operations on it.
45794605
*

baselines/ts5.5/dom.generated.d.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,10 @@ interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
987987
mipmapFilter?: GPUMipmapFilterMode;
988988
}
989989

990+
interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase {
991+
code: string;
992+
}
993+
990994
interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
991995
buffer: GPUBuffer;
992996
}
@@ -1004,6 +1008,16 @@ interface GPUTexelCopyTextureInfo {
10041008
texture: GPUTexture;
10051009
}
10061010

1011+
interface GPUTextureDescriptor extends GPUObjectDescriptorBase {
1012+
dimension?: GPUTextureDimension;
1013+
format: GPUTextureFormat;
1014+
mipLevelCount?: GPUIntegerCoordinate;
1015+
sampleCount?: GPUSize32;
1016+
size: GPUExtent3D;
1017+
usage: GPUTextureUsageFlags;
1018+
viewFormats?: GPUTextureFormat[];
1019+
}
1020+
10071021
interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase {
10081022
arrayLayerCount?: GPUIntegerCoordinate;
10091023
aspect?: GPUTextureAspect;
@@ -15435,6 +15449,18 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
1543515449
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createSampler)
1543615450
*/
1543715451
createSampler(descriptor?: GPUSamplerDescriptor): GPUSampler;
15452+
/**
15453+
* The **`createShaderModule()`** method of the GPUDevice interface creates a GPUShaderModule from a string of WGSL source code.
15454+
*
15455+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createShaderModule)
15456+
*/
15457+
createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
15458+
/**
15459+
* The **`createTexture()`** method of the GPUDevice interface creates a GPUTexture in which to store 1D, 2D, or 3D arrays of data, such as images, to use in GPU rendering operations.
15460+
*
15461+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createTexture)
15462+
*/
15463+
createTexture(descriptor: GPUTextureDescriptor): GPUTexture;
1543815464
/**
1543915465
* The **`destroy()`** method of the GPUDevice interface destroys the device, preventing further operations on it.
1544015466
*

baselines/ts5.5/serviceworker.generated.d.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,10 @@ interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
453453
mipmapFilter?: GPUMipmapFilterMode;
454454
}
455455

456+
interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase {
457+
code: string;
458+
}
459+
456460
interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
457461
buffer: GPUBuffer;
458462
}
@@ -470,6 +474,16 @@ interface GPUTexelCopyTextureInfo {
470474
texture: GPUTexture;
471475
}
472476

477+
interface GPUTextureDescriptor extends GPUObjectDescriptorBase {
478+
dimension?: GPUTextureDimension;
479+
format: GPUTextureFormat;
480+
mipLevelCount?: GPUIntegerCoordinate;
481+
sampleCount?: GPUSize32;
482+
size: GPUExtent3D;
483+
usage: GPUTextureUsageFlags;
484+
viewFormats?: GPUTextureFormat[];
485+
}
486+
473487
interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase {
474488
arrayLayerCount?: GPUIntegerCoordinate;
475489
aspect?: GPUTextureAspect;
@@ -4888,6 +4902,18 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
48884902
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createSampler)
48894903
*/
48904904
createSampler(descriptor?: GPUSamplerDescriptor): GPUSampler;
4905+
/**
4906+
* The **`createShaderModule()`** method of the GPUDevice interface creates a GPUShaderModule from a string of WGSL source code.
4907+
*
4908+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createShaderModule)
4909+
*/
4910+
createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
4911+
/**
4912+
* The **`createTexture()`** method of the GPUDevice interface creates a GPUTexture in which to store 1D, 2D, or 3D arrays of data, such as images, to use in GPU rendering operations.
4913+
*
4914+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createTexture)
4915+
*/
4916+
createTexture(descriptor: GPUTextureDescriptor): GPUTexture;
48914917
/**
48924918
* The **`destroy()`** method of the GPUDevice interface destroys the device, preventing further operations on it.
48934919
*

baselines/ts5.5/sharedworker.generated.d.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,10 @@ interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
397397
mipmapFilter?: GPUMipmapFilterMode;
398398
}
399399

400+
interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase {
401+
code: string;
402+
}
403+
400404
interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
401405
buffer: GPUBuffer;
402406
}
@@ -414,6 +418,16 @@ interface GPUTexelCopyTextureInfo {
414418
texture: GPUTexture;
415419
}
416420

421+
interface GPUTextureDescriptor extends GPUObjectDescriptorBase {
422+
dimension?: GPUTextureDimension;
423+
format: GPUTextureFormat;
424+
mipLevelCount?: GPUIntegerCoordinate;
425+
sampleCount?: GPUSize32;
426+
size: GPUExtent3D;
427+
usage: GPUTextureUsageFlags;
428+
viewFormats?: GPUTextureFormat[];
429+
}
430+
417431
interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase {
418432
arrayLayerCount?: GPUIntegerCoordinate;
419433
aspect?: GPUTextureAspect;
@@ -4571,6 +4585,18 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
45714585
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createSampler)
45724586
*/
45734587
createSampler(descriptor?: GPUSamplerDescriptor): GPUSampler;
4588+
/**
4589+
* The **`createShaderModule()`** method of the GPUDevice interface creates a GPUShaderModule from a string of WGSL source code.
4590+
*
4591+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createShaderModule)
4592+
*/
4593+
createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
4594+
/**
4595+
* The **`createTexture()`** method of the GPUDevice interface creates a GPUTexture in which to store 1D, 2D, or 3D arrays of data, such as images, to use in GPU rendering operations.
4596+
*
4597+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createTexture)
4598+
*/
4599+
createTexture(descriptor: GPUTextureDescriptor): GPUTexture;
45744600
/**
45754601
* The **`destroy()`** method of the GPUDevice interface destroys the device, preventing further operations on it.
45764602
*

baselines/ts5.5/webworker.generated.d.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,10 @@ interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
544544
mipmapFilter?: GPUMipmapFilterMode;
545545
}
546546

547+
interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase {
548+
code: string;
549+
}
550+
547551
interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
548552
buffer: GPUBuffer;
549553
}
@@ -561,6 +565,16 @@ interface GPUTexelCopyTextureInfo {
561565
texture: GPUTexture;
562566
}
563567

568+
interface GPUTextureDescriptor extends GPUObjectDescriptorBase {
569+
dimension?: GPUTextureDimension;
570+
format: GPUTextureFormat;
571+
mipLevelCount?: GPUIntegerCoordinate;
572+
sampleCount?: GPUSize32;
573+
size: GPUExtent3D;
574+
usage: GPUTextureUsageFlags;
575+
viewFormats?: GPUTextureFormat[];
576+
}
577+
564578
interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase {
565579
arrayLayerCount?: GPUIntegerCoordinate;
566580
aspect?: GPUTextureAspect;
@@ -5591,6 +5605,18 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
55915605
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createSampler)
55925606
*/
55935607
createSampler(descriptor?: GPUSamplerDescriptor): GPUSampler;
5608+
/**
5609+
* The **`createShaderModule()`** method of the GPUDevice interface creates a GPUShaderModule from a string of WGSL source code.
5610+
*
5611+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createShaderModule)
5612+
*/
5613+
createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
5614+
/**
5615+
* The **`createTexture()`** method of the GPUDevice interface creates a GPUTexture in which to store 1D, 2D, or 3D arrays of data, such as images, to use in GPU rendering operations.
5616+
*
5617+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createTexture)
5618+
*/
5619+
createTexture(descriptor: GPUTextureDescriptor): GPUTexture;
55945620
/**
55955621
* The **`destroy()`** method of the GPUDevice interface destroys the device, preventing further operations on it.
55965622
*

baselines/ts5.6/dom.generated.d.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,10 @@ interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
987987
mipmapFilter?: GPUMipmapFilterMode;
988988
}
989989

990+
interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase {
991+
code: string;
992+
}
993+
990994
interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
991995
buffer: GPUBuffer;
992996
}
@@ -1004,6 +1008,16 @@ interface GPUTexelCopyTextureInfo {
10041008
texture: GPUTexture;
10051009
}
10061010

1011+
interface GPUTextureDescriptor extends GPUObjectDescriptorBase {
1012+
dimension?: GPUTextureDimension;
1013+
format: GPUTextureFormat;
1014+
mipLevelCount?: GPUIntegerCoordinate;
1015+
sampleCount?: GPUSize32;
1016+
size: GPUExtent3D;
1017+
usage: GPUTextureUsageFlags;
1018+
viewFormats?: GPUTextureFormat[];
1019+
}
1020+
10071021
interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase {
10081022
arrayLayerCount?: GPUIntegerCoordinate;
10091023
aspect?: GPUTextureAspect;
@@ -15446,6 +15460,18 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
1544615460
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createSampler)
1544715461
*/
1544815462
createSampler(descriptor?: GPUSamplerDescriptor): GPUSampler;
15463+
/**
15464+
* The **`createShaderModule()`** method of the GPUDevice interface creates a GPUShaderModule from a string of WGSL source code.
15465+
*
15466+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createShaderModule)
15467+
*/
15468+
createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
15469+
/**
15470+
* The **`createTexture()`** method of the GPUDevice interface creates a GPUTexture in which to store 1D, 2D, or 3D arrays of data, such as images, to use in GPU rendering operations.
15471+
*
15472+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createTexture)
15473+
*/
15474+
createTexture(descriptor: GPUTextureDescriptor): GPUTexture;
1544915475
/**
1545015476
* The **`destroy()`** method of the GPUDevice interface destroys the device, preventing further operations on it.
1545115477
*

0 commit comments

Comments
 (0)