|
@@ -190,6 +190,36 @@ export class Session extends AREventTarget<SessionEventType>
|
190
|
190
|
{
|
191
|
191
|
// If Safari or iOS, require version 15.2 or later
|
192
|
192
|
if(/(Mac|iOS|iPhone|iPad|iPod)/i.test(Utils.platformString())) {
|
|
193
|
+
|
|
194
|
+ /*
|
|
195
|
+
|
|
196
|
+ iOS compatibility
|
|
197
|
+ -----------------
|
|
198
|
+
|
|
199
|
+ The engine is known to work on iPhone 8 or later, with iOS 15.2 or
|
|
200
|
+ later. Tested on many devices, including iPads, on the cloud.
|
|
201
|
+
|
|
202
|
+ The engine crashes on an iPhone 13 Pro Max with iOS 15.1 and on an
|
|
203
|
+ iPhone 12 Pro with iOS 15.0.2. A (valid) shader from speedy-vision
|
|
204
|
+ version 0.9.1 (bf-knn) fails to compile: "WebGL error. Program has
|
|
205
|
+ not been successfully linked".
|
|
206
|
+
|
|
207
|
+ The engine freezes on an older iPhone 6S (2015) with iOS 15.8.2.
|
|
208
|
+ The exact cause is unknown, but it happens when training an image
|
|
209
|
+ tracker, at ImageTrackerTrainingState._gpuUpdate() (a WebGL error?
|
|
210
|
+ a hardware limitation?)
|
|
211
|
+
|
|
212
|
+ Successfully tested down to iPhone 8 so far.
|
|
213
|
+ Successfully tested down to iOS 15.2.
|
|
214
|
+
|
|
215
|
+ >> WebGL2 support was introduced in Safari 15 <<
|
|
216
|
+
|
|
217
|
+ Note: the webp image format used in the demos is supported on
|
|
218
|
+ Safari for iOS 14+. Desktop Safari 14-15.6 supports webp, but
|
|
219
|
+ requires macOS 11 Big Sur or later. https://caniuse.com/webp
|
|
220
|
+
|
|
221
|
+ */
|
|
222
|
+
|
193
|
223
|
const ios = /(iPhone|iPad|iPod).* (CPU[\s\w]* OS|CPU iPhone|iOS) ([\d\._]+)/.exec(navigator.userAgent); // Chrome, Firefox, Edge, Safari on iOS
|
194
|
224
|
const safari = /(AppleWebKit)\/.* (Version)\/([\d\.]+)/.exec(navigator.userAgent); // Desktop and Mobile Safari, Epiphany on Linux
|
195
|
225
|
const matches = safari || ios; // match safari first (min version)
|
|
@@ -525,8 +555,10 @@ export class Session extends AREventTarget<SessionEventType>
|
525
|
555
|
Utils.error('Tracking error: ' + err.toString(), err);
|
526
|
556
|
|
527
|
557
|
// throw WebGL errors
|
528
|
|
- if(err.name == 'GLError' || (typeof err.cause == 'object' && err.cause.name == 'GLError'))
|
|
558
|
+ if(err.name == 'GLError' || (typeof err.cause == 'object' && err.cause.name == 'GLError')) {
|
|
559
|
+ alert(err.message); // fatal error?
|
529
|
560
|
throw err;
|
|
561
|
+ }
|
530
|
562
|
});
|
531
|
563
|
}
|
532
|
564
|
else {
|