function isCompatibleTexture(texture, source) {
  if (texture.source !== source) {
    return false;
  }
  if (source.data instanceof HTMLCanvasElement) {
    return texture.isCanvasTexture;
  }
  if (source.data instanceof HTMLVideoElement) {
    return texture.isVideoTexture;
  }
  return texture.isTexture && !texture.isCanvasTexture && !texture.isVideoTexture;
}
Checks if a given texture type is compatible with a given source.

@param {THREE.Texture} texture - The texture to check compatibility with
@param {THREE.Source} source - The source to check compatibility with
@returns {boolean} True if the texture is compatible with the source, false otherwise