Browse Source

WebGPURenderer: Fix broken worker support. (#31607)

Michael Herzog 9 months ago
parent
commit
f396dcb2ed
2 changed files with 2 additions and 2 deletions
  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号