@@ -759,20 +759,32 @@ interface GPUCompilationInfo {
759
759
readonly messages : ReadonlyArray < GPUCompilationMessage > ;
760
760
}
761
761
762
- /** @category GPU */
763
- declare class GPUPipelineError extends DOMException {
764
- constructor ( message ?: string , options ?: GPUPipelineErrorInit ) ;
765
-
766
- readonly reason : GPUPipelineErrorReason ;
762
+ /**
763
+ * The **`GPUPipelineError`** interface of the WebGPU API describes a pipeline failure.
764
+ * Available only in secure contexts.
765
+ *
766
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUPipelineError)
767
+ * @category GPU
768
+ */
769
+ interface GPUPipelineError extends DOMException {
770
+ /**
771
+ * The **`reason`** read-only property of the GPUPipelineError interface defines the reason the pipeline creation failed in a machine-readable way.
772
+ *
773
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUPipelineError/reason)
774
+ */
775
+ readonly reason : "validation" | "internal" ;
767
776
}
768
777
769
778
/** @category GPU */
770
- interface GPUPipelineErrorInit {
771
- reason : GPUPipelineErrorReason ;
772
- }
779
+ declare var GPUPipelineError : {
780
+ prototype : GPUPipelineError ;
781
+ new ( message : string , options : GPUPipelineErrorInit ) : GPUPipelineError ;
782
+ } ;
773
783
774
784
/** @category GPU */
775
- type GPUPipelineErrorReason = "validation" | "internal" ;
785
+ interface GPUPipelineErrorInit {
786
+ reason : "validation" | "internal" ;
787
+ }
776
788
777
789
/**
778
790
* Represents a compiled shader module that can be used to create graphics or compute pipelines.
@@ -1584,25 +1596,55 @@ interface GPUDeviceLostInfo {
1584
1596
readonly message : string ;
1585
1597
}
1586
1598
1587
- /** @category GPU */
1588
- declare class GPUError {
1599
+ /**
1600
+ * The **`GPUError`** interface of the WebGPU API is the base interface for errors surfaced by GPUDevice.popErrorScope and the GPUDevice.uncapturederror_event event.
1601
+ * Available only in secure contexts.
1602
+ *
1603
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUError)
1604
+ * @category GPU
1605
+ */
1606
+ interface GPUError {
1607
+ /**
1608
+ * The **`message`** read-only property of the A string.
1609
+ * The **`message`** read-only property of the GPUError interface provides a human-readable message that explains why the error occurred.
1610
+ *
1611
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUError/message)
1612
+ */
1589
1613
readonly message : string ;
1590
1614
}
1591
1615
1592
1616
/** @category GPU */
1593
- declare class GPUOutOfMemoryError extends GPUError {
1594
- constructor ( message : string ) ;
1595
- }
1617
+ declare var GPUError : {
1618
+ prototype : GPUError ;
1619
+ new ( ) : GPUError ;
1620
+ } ;
1596
1621
1597
1622
/** @category GPU */
1598
- declare class GPUValidationError extends GPUError {
1599
- constructor ( message : string ) ;
1600
- }
1623
+ interface GPUOutOfMemoryError extends GPUError { }
1601
1624
1602
1625
/** @category GPU */
1603
- declare class GPUInternalError extends GPUError {
1604
- constructor ( message : string ) ;
1605
- }
1626
+ declare var GPUOutOfMemoryError : {
1627
+ prototype : GPUOutOfMemoryError ;
1628
+ new ( message ?: string ) : GPUOutOfMemoryError ;
1629
+ } ;
1630
+
1631
+ /** @category GPU */
1632
+ interface GPUValidationError extends GPUError { }
1633
+
1634
+ /** @category GPU */
1635
+ declare var GPUValidationError : {
1636
+ prototype : GPUValidationError ;
1637
+ new ( message ?: string ) : GPUValidationError ;
1638
+ } ;
1639
+
1640
+ /** @category GPU */
1641
+ interface GPUInternalError extends GPUError { }
1642
+
1643
+ /** @category GPU */
1644
+ declare var GPUInternalError : {
1645
+ prototype : GPUInternalError ;
1646
+ new ( message ?: string ) : GPUInternalError ;
1647
+ } ;
1606
1648
1607
1649
/** @category GPU */
1608
1650
type GPUErrorFilter = "out-of-memory" | "validation" | "internal" ;
0 commit comments