Skip to content

Commit b005a66

Browse files
authored
Make isCompatibleTexture check stricter by requiring equal source (#5529)
Co-authored-by: Noeri Huisman <mrxz@users.noreply.github.com>
1 parent 6aea9e7 commit b005a66

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/utils/material.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,13 +291,16 @@ module.exports.handleTextureEvents = handleTextureEvents;
291291
* @returns {boolean} True if the texture is compatible with the source, false otherwise
292292
*/
293293
function isCompatibleTexture (texture, source) {
294+
if (texture.source !== source) {
295+
return false;
296+
}
297+
294298
if (source.data instanceof HTMLCanvasElement) {
295299
return texture.isCanvasTexture;
296300
}
297301

298302
if (source.data instanceof HTMLVideoElement) {
299-
// VideoTexture can't have its source changed after initial user
300-
return texture.isVideoTexture && texture.source === source;
303+
return texture.isVideoTexture;
301304
}
302305

303306
return texture.isTexture && !texture.isCanvasTexture && !texture.isVideoTexture;

0 commit comments

Comments
 (0)