Skip to content

Commit d4873eb

Browse files
authored
Temp: Use pass['endPass'] when pass['end'] is not available (#16467)
1 parent 5c4bcd1 commit d4873eb

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/library_webgpu.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,7 +1890,12 @@ var LibraryWebGPU = {
18901890

18911891
wgpuComputePassEncoderEnd: function(passId) {
18921892
var pass = WebGPU.mgrComputePassEncoder.get(passId);
1893-
pass["end"]();
1893+
// TODO(shrekshao): remove once this API change moves to stable (e.g. in Chrome)
1894+
if (pass["end"]) {
1895+
pass["end"]();
1896+
} else {
1897+
pass["endPass"]();
1898+
}
18941899
},
18951900

18961901
// wgpuRenderPass
@@ -2024,7 +2029,12 @@ var LibraryWebGPU = {
20242029

20252030
wgpuRenderPassEncoderEnd: function(passId) {
20262031
var pass = WebGPU.mgrRenderPassEncoder.get(passId);
2027-
pass["end"]();
2032+
// TODO(shrekshao): remove once this API change moves to stable (e.g. in Chrome)
2033+
if (pass["end"]) {
2034+
pass["end"]();
2035+
} else {
2036+
pass["endPass"]();
2037+
}
20282038
},
20292039

20302040
// Render bundle encoder

0 commit comments

Comments
 (0)