Skip to content

Commit 2a4692d

Browse files
committed
Skip invalid frame
1 parent 625d234 commit 2a4692d

File tree

2 files changed

+5067
-16
lines changed

2 files changed

+5067
-16
lines changed

src/renderers/webgpu/utils/WebGPUTextureUtils.js

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -770,22 +770,24 @@ class WebGPUTextureUtils {
770770

771771
const width = ( mipLevel > 0 ) ? image.width : textureDescriptorGPU.size.width;
772772
const height = ( mipLevel > 0 ) ? image.height : textureDescriptorGPU.size.height;
773-
774-
device.queue.copyExternalImageToTexture(
775-
{
776-
source: image,
777-
flipY: flipY
778-
}, {
779-
texture: textureGPU,
780-
mipLevel: mipLevel,
781-
origin: { x: 0, y: 0, z: originDepth },
782-
premultipliedAlpha: premultiplyAlpha
783-
}, {
784-
width: width,
785-
height: height,
786-
depthOrArrayLayers: 1
787-
}
788-
);
773+
try
774+
{
775+
device.queue.copyExternalImageToTexture(
776+
{
777+
source: image,
778+
flipY: flipY
779+
}, {
780+
texture: textureGPU,
781+
mipLevel: mipLevel,
782+
origin: { x: 0, y: 0, z: originDepth },
783+
premultipliedAlpha: premultiplyAlpha
784+
}, {
785+
width: width,
786+
height: height,
787+
depthOrArrayLayers: 1
788+
}
789+
);
790+
} catch(_) {}// Just skip bad texture frame to avoid broken pipeline.
789791

790792
}
791793

0 commit comments

Comments
 (0)