From 0cff786038019fbaa97041cd0a7df83cb4569a4b Mon Sep 17 00:00:00 2001 From: 06wj <06wj@163.com> Date: Wed, 20 Dec 2023 16:32:22 +0800 Subject: [PATCH] fix framebuffer texture capture with texStorage2D bug --- src/backend/states/context/visualState.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/backend/states/context/visualState.ts b/src/backend/states/context/visualState.ts index 0314ae9..5b009cf 100644 --- a/src/backend/states/context/visualState.ts +++ b/src/backend/states/context/visualState.ts @@ -207,7 +207,9 @@ export class VisualState extends BaseState { const info = storage.__SPECTOR_Object_CustomData as ITextureRecorderData; width = info.width; height = info.height; - textureType = info.type; + if (info.type !== undefined) { + textureType = info.type; + } knownAsTextureArray = info.target === WebGlConstants.TEXTURE_2D_ARRAY.name; if (!ReadPixelsHelper.isSupportedCombination(info.type, info.format, info.internalFormat)) { return;