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

WebGPURenderer: Fix broken worker support. (#31607)

Michael Herzog 9 месяцев назад
Родитель
Сommit
f396dcb2ed
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      src/renderers/common/Textures.js
  2. 1 1
      src/textures/Source.js

+ 1 - 1
src/renderers/common/Textures.js

@@ -376,7 +376,7 @@ class Textures extends DataMap {
 
 			if ( image.image !== undefined ) image = image.image;
 
-			if ( image instanceof HTMLVideoElement ) {
+			if ( ( typeof HTMLVideoElement !== 'undefined' ) && ( image instanceof HTMLVideoElement ) ) {
 
 				target.width = image.videoWidth || 1;
 				target.height = image.videoHeight || 1;

+ 1 - 1
src/textures/Source.js

@@ -83,7 +83,7 @@ class Source {
 
 		const data = this.data;
 
-		if ( data instanceof HTMLVideoElement ) {
+		if ( ( typeof HTMLVideoElement !== 'undefined' ) && ( data instanceof HTMLVideoElement ) ) {
 
 			target.set( data.videoWidth, data.videoHeight, 0 );
 

粤ICP备19079148号