Просмотр исходного кода

WebGPURenderer: Fall back to default texture when texture creation fails. (#32853)

ycw 4 недель назад
Родитель
Сommit
433099fd42
1 измененных файлов с 11 добавлено и 1 удалено
  1. 11 1
      src/renderers/webgpu/utils/WebGPUTextureUtils.js

+ 11 - 1
src/renderers/webgpu/utils/WebGPUTextureUtils.js

@@ -312,7 +312,17 @@ class WebGPUTextureUtils {
 
 		}
 
-		textureData.texture = backend.device.createTexture( textureDescriptorGPU );
+		try {
+
+			textureData.texture = backend.device.createTexture( textureDescriptorGPU );
+
+		} catch ( e ) {
+
+			warn( 'WebGPURenderer: Failed to create texture with descriptor:', textureDescriptorGPU );
+			this.createDefaultTexture( texture );
+			return;
+
+		}
 
 		if ( isMSAA ) {
 

粤ICP备19079148号